Mode 18 memory access
Hi all,
I think someone was trying to access graphic_mode(18) memory in one of the
earlier messages, this is how you can do it.
Mode 18 is arranged in 4 "Pixel Planes" of 38400 bytes each, each plane is
the same structure as Mode 17 (640 x 480 x 2 colours, 1 byte = 8 pixels).
You can write to 1,2,3 or 4 planes at the same time by setting port #3C4 =
2 and setting the appropriate bits in port #3C5 (ie BIT 0=1 for plane 0,
BIT 1=1 for plane 1, BIT 2=1 for plane 2, etc ...) and POKE in your data,
don't forget the screen base address is #A0000 (NOT #A000 as in DOS)
To read data from each plane set port #3CE = 4 and set port #3CF to the
plane number (ie 0 for plane 0, 1 for plane 1, 2 for plane 2, 3 for plane
3) and PEEK the data.
If any of you need more detail I will write some code to demonstrate
grabbing and replacing an image in mode 18.
Have fun - Peter Blue
|
Not Categorized, Please Help
|
|