Retour
Sharp PC-1350

La RAM vidéo (Video RAM)

La RAM vidéo du PC-1350 occupe 600 octets découpées en 20 sections :
The PC-1350's video RAM is 600 octets long, splited in 20 parts :

\|/ poids faible \|/ &70 &72 &74 &76 &78 <- poids fort
&00 -> &1D 01 05 09 13 17
&40 -> &5D 02 06 10 14 18
&1E -> &3B 03 07 11 15 19
&5E -> &7B 04 08 12 16 20
Donc, la zone 10 va de &7440 à &745D.
So, the part #10 starts at &7440 and finish at &745D.

Les indicateurs sont stockés sur l'octet &783C. &783C holds the display indicators.

0 SHIFT
1 DEF
2 P <-> NP indicateur fantôme, rien n'apparaît à l'écran
Ghost indicator, nothing is displayed
3 Reverve indicateur fantôme, rien n'apparaît à l'écran
Ghost indicator, nothing is displayed
4 RUN
5 PRO
6 KaNa
7 SML

Scrutage du clavier (Keyboard)

Le clavier est scruté par la routine située en &436. Le résultats se trouve dans l'accu. Si aucune touche n'est appuillée A=&FF et C=1. Si plusieurs touches sont appuillées en même temps, A=&40.
The keyboard is read by &436. The result is stored in the accumulator. A=&FF and C=1 if no key is pressed, and A=&40 is more than one key is pressed in the same time.

Internal codeKeyRaw reading
00Y@0/6
01H@0/5
02N@0/4
03[DEL]@0/3
04[INS]@0/2
05
06U@1/6
07J@1/5
08M@1/4
09[MODE]@1/3
0A
0BI@2/6
0CK@2/5
0D[SPC]@2/4'RamVideo'
0E[CLS]@2/3
0FO@3/6
Internal codeKeyRaw reading
10L@3/5
11[ENTER]@3/4
@4/3
12P@4/6
13=@4/5
14Lock
15[SHIFT]#0/6
16[DEF]#0/5
17[SML]#0/4
18,#0/3
19;#0/2
1A:#0/1
1B)#0/0
1CQ#1/6
1DA#1/5
1EZ#1/4
1F-#1/3
Internal codeKeyRaw reading
20*#1/2
21/#1/1
22(#1/0
23W#2/6
24S#2/5
25X#2/4
26+#2/3
273#2/2
286#2/1
299#2/0
2AE#3/6
2BD#3/5
2CC#3/4
2D.#3/3
2E2#3/2
2F5#3/1
Internal codeKeyRaw reading
308#3/0
31R#4/6
32F#4/5
33V#4/4
340#4/3
351#4/2
364#4/1
377#4/0
38T#5/6
39G#5/5
3AB#5/4
3B[->]#5/3
3C[<-]#5/2
3D[\|/]#5/1
3E[/|\]#5/0
3F[BRK]

Si plusieurs touches peuvent être appuyées en même temps (par exemple dans un jeu), il faut lire le clavier directement en utilisant les ports.
Évidement, pour diminuer le nombre de pattes nécessaire au scrutage du clavier, une sorte de multiplexage est utilisé : le clavier est découpé en zones que l'on sélectionnent en activant leur bit. Ce bit est le premier chiffre de 'Raw reading'. Un '#' indique que le latch situé en &7E00 est utilisé pour faire se multiplexage. Si elle contient un '@', il faudra utiliser le port A.

Une fois le latch initialisé, on peut lire la valeur par un INA. Si la touche est appuyée, le bit correspondant au second chiffre sera à 1.
Ne pas oublier non plus les retours : par exemple, si port A=&10 et que l'on appuit sur [SPC], INA renvera &04.

If many keys can be pressed in the same time (for example, in a game), I/O ports must be used.
To reduce the number of input chanels, the keyboard is multipexed : it's splited in areas that can be selected but setting their bit to 1. This bit is the first number of 'Raw reading'. A '#' means to use the &7E00 latch and with '@', it's the A port.

After setting the latch, the value is read by INA. If the key is pressed, the bit numbered by the second value is set.

Testing [SPC] @1/3

LIA &04		; = 2 ^ 2
LIP $5C		; Port A
EXAM
OUTA
NOPT
INA
TSIA &10	; = 2 ^ 4
...
Testing [T] #5/6

LIA &20		; = 2 ^ 5
LIDP &7E00
STD
NOPT
INA
TSIA &40	; = 2 ^ 6
...