@Quax:
Sorry, but I don't know where to get the RAM chips too.
The original frequency of the resonator is 7.36 MHz divided by 2 for the 80L188EB. A good solution may be 14.72 MHz to not have any complications with the serial communication. But at first I have to get a resonator or quartz with that frequency and disassembling the Z-1GR again.
@jvernet:
The LCD of the HD61700 series pockets (PB-1000, PB-2000C, AI-1000, FX-870P, VX-3, VX-4) is controlled by 1 main driver and 2 sub driver.
To access the LCD, at first you have to specify the Display Driver Control Register DD with the following structure:
Bit 7 Vdd: Switch the LCD on (1) or off (0)
Bit 6 clock: Syncronisation with HD61700 CPU
Bit 5 ?
Bit 4 CE4: Sub driver 4 (not used)
Bit 3 CE3: Sub driver 3 (not used)
Bit 2 CE2: Sub driver 2 (right half of LCD)
Bit 1 CE1: Sub driver 1 (left half of LCD)
Bit 0 OP: Operation Control (1=Command or 0=Data)
The next step is to send a command to the LCD driver with the following structure:
Bit 5-7: Nexus of sended data (B) and previous LCD contents (A)
000 = inv(A) and B
001 = A xor B
010 = 0
011 = A and inv(B)
100 = B
101 = A or B
110 = 0
111 = A
Bit 4: Access to sub driver 1 (0) or sub driver 2 (1)
Bit 0-3: Command
0 = not used
1 = graphic input (read the LCD contents)
2 = graphic output
3 = ASCII output
4 = LCD on/off
5 = not used
6 = ? (used by power on routine)
7 = not used
8 = width of ASCII output and scroll control
9 = ? (used by power on routine)
A = ? (used by power on routine)
B = ? (used by power on routine)
C = Contrast Control
D = LCD Pulse Frequency (connected to ON-Interrupt of HD61700)
E = not used
F = not used
For output commands it is necessary to specify the output position with two bytes:
First byte for the horizontal position:
Pixel 0..47 = &H00..&H5E (even values only) driver 1
Pixel 48..95 = &H80..&HDE (even values only) driver 1
Pixel 96..143 = &H00..&H5E (even values only) driver 2
Pixel 144..191 = &H80..&HDE (even values only) driver 2
Second byte for the vertical position:
Row 1 = 0
Row 2 = 1
Row 3 = 2
Row 4 = 3
Now an example: You want to program a game with fast output to the right half of the LCD.
Code : Tout sélectionner
var disp_buffer:array[0..383] of byte;
...
PRE IX,>disp_buffer ; Index Register IX points to disp_buffer
LD $0,48 ; 48 repetitions needed to send the 384 bytes
LD $1,&H92 ; &H92 = graphic output to the right half of LCD
LD $2,#0 ; horizontal position
LD $3,#0 ; vertical position
PCB &HFF ; DD register command announce
OCBL $1,L3 ; send contents of main registers $1-$3 as command to LCD
PCB &HFE ; DD register data announce
@00: LDIL $1,(IX+#0),L8 ; read 8 bytes from disp_buffer to main registers $1-$8
OCBL $1,L8 ; send contents of main registers $1-$8 to LCD as graphical data
SB $0,#1 ; decrement for loop
JR NZ,@00 ; loop jump
...
This is the fastest way for accessing the LCD. Interesting is, that the HD61700 has instructions to operate with byte, word and multibyte (3 to 8 byte) for much faster execution.
I hope this helps you for a better understanding of LCD programming.