|
Post by mirkosoft on May 23, 2015 18:51:37 GMT
Hi!
I was investigating Robert Willie's (aka Hydrophilic) explaining twice availability of VIC2E Color RAM...
Really it needs to write that in Basic is it impossible but few POKE commands I tried.
VIC and CPU can access areas separatelly
$01 / bit 0 = 0 (CPU access Color RAM 0 / mc-bitmap)
$01 / bit 0 = 1 (CPU access Color RAM 1 / text)
$01 / bit 1 = 0 (VIC access Color RAM 0 / mc-bitmap)
$01 / bit 1 = 1 (VIC access Color RAM 1 / text)
Here are POKE commands to use all choices:
00 = poke1,peek(1)and252
01 = poke1,(peek(1)and252)or1
10 = poke1,(peek(1)and252)or2
11 = poke1,(peek(1)and252)or3
It's all about VIC Color RAM which is not available in banks 0 and 1. But really not true VIC area, really CPU RAM is VIC DATA RAM - better to say default 1024 - 2023 is possible use in both banks by simple switch:
pokedec("d506"),peek(dec("d506"))and191:rem vic ram in bank 0
pokedec("d506"),peek(dec("d506"))or64:rem vic ram in bank 1
Really in Basic is it not possible to use 'cause Kernal controls all, even also VIC registers have their shadows... In assembler is it perfect like buffer, for example: before any change in text editing you save data to bank 1, type anything, or scrolling will erase lines above, you can press keystroke, e.g. CTRL+Z and it move buffer 1024-2023 from bank 1 to bank 0 back and it looks really like UNDO...
I don't know if it is explained understandeable, if not please correct me Robert...
Miro
|
|
|
Post by hydrophilic on May 26, 2015 5:35:18 GMT
Well, your POKE DEC("D506") commands have no effect on CPU (load/save)...
They only effect how MMU will route data from RAM to the VIC ...
Your command *will* make "video" come from bank 0 or bank 1, but...
VIC Multi-Color also has "Color RAM"... you need to manipulate bit 0 (and 1?) of address 1... this is special "CPU Data Port"
FYI, C128 has 2 Color RAM banks... So you need PEEK(1) AND 1 to read the current "Color RAM" displayed...
To write (choose) the active "Color RAM", you need to POKE 1,X
So... POKE 1, PEEK(1) OR 1 will enable "classic" Color RAM (like screen text)
But, POKE 1, PEEK(1) AND 254 will enable "bitmap" Color RAM (like GRAPHIC 3)
Most important, those PEEK/POKE are temporary... unless you disable VIC interrupts! If not, the OS will erase/change your POKE 1 on the next IRQ...
Sorry if that is too complex... guess I need to write a web page?
Anyway, I will try to help if you more Questions.
|
|