Saturday, September 15, 2007

Accessing Memory

I'm finding that the game code addresses some external memory using "paged mode". Basically, Port2 (P2) holds the High Byte address while an 8-bit register like R0 holds the Low Byte of the address. This allows for a 16-bit pseudo-address by combining P2 and R0.

Whenever graphics are addressed in the game code, they seem to be using a value of 0x20 for P2. Which tells me they are addressing a range of 0x2000 to 0x20FF.

I found that in other drivers using the CRC6845, they generally look at 2 memory locations to get it to work. One for the registers and another for the address. I found some video code that places values at 0x2080, 0x2081 and 0x2083. One too many addresses, but I can tell that the 0x2083 value always holds the address to the graphics character in it. Since its using "Transparent Mode Addressing", I'm gonna need all three.

No comments: