| |
TSM
Registered: Jan 2007 Posts: 42 |
Hires bitmap RAM arrangement
I wanted to make a little program to display the "Doodle" picture file from this page:
http://www.editorix.org/congo/html/c64_image_formats__part_i.ht..
It loads at $1C00, so you have screen data at $1C00 and bitmap data at $2000. I set everything up very carefully (screen mode, base VIC address, screen RAM and bitmap RAM addresses) and the bitmap is correct but the colors are all messed up. If I move the screen data to $0C00 and change the address accordingly in $D018, then it works.
I wanted to display the picture without moving any data around; is this possible at all?
Strangely, if I save a snapshot with Vice at the messed-up screen and feed the file to "vicegrab", it will spit up a perfectly working .prg file (although with screen RAM @ $0C00)! |
|
... 15 posts hidden. Click here to view all posts.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
vice emulates it for quite some time :) its not very hard to do either, the VIC fetches from $3fff in border area. so all you need to do is wait for border, write the value you want to go to $00 to $3fff, and write (whatever) value to $00. same for $01 respectively. check readme and source here |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quote: Krill: But doesn't the VIC just see the RAM at $0000-$0fff when looking at $1000-$1fff in the Ultimax memory configuration, since there is only 4K of RAM available? Thanks for pointing out this very important and relevant fact, btw. :)
In Ultimax mode, the CPU can only access the lowmost 4 kB of internal RAM, but VIC sees internal RAM beyond that, including the $1000..$1fff and $9000..$9fff ranges.
(However, it reads external memory at $3000..$3fff of each 16 kB VIC bank, and can even be forced to only see external memory, but that is another story.)
You can confirm this by putting graphics in the usually non-displayable memory range as the OP did, and then freeze using a freezer cartridge. When freezing, it will briefly switch into Ultimax mode, revealing the graphics normally hidden underneath the character generator ROM.
Action Replay and similar cartridges allow you to programmatically enable the Ultimax mode. With some code below $1000, disable interrupts and write #$03 to $de00, and the graphics are revealed permanently.
Sources:
http://skoe.de/docs/c64-dissected/pla/c64_pla_dissected_a4ss.pdf
http://codebase64.org/doku.php?id=base:memory_management
http://ar.c64.org/wiki/Hiding_kilobytes_C%3DHacking_Issue_7.txt
http://www.floodgap.com/retrobits/ckb/secret/ultimax.html
http://ar.c64.org/wiki/Action_Replay |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: vice emulates it for quite some time :) its not very hard to do either, the VIC fetches from $3fff in border area. so all you need to do is wait for border, write the value you want to go to $00 to $3fff, and write (whatever) value to $00. same for $01 respectively. check readme and source here
So VICII will leave the data on the bus it has read, and the CPU will drive the R/W line to write, but not change bus contents since it pushes the data internally, correct ?
what other stuff may have required VICE to emulate what happens to the memory on such a low level ? |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: So VICII will leave the data on the bus it has read, and the CPU will drive the R/W line to write, but not change bus contents since it pushes the data internally, correct ?
what other stuff may have required VICE to emulate what happens to the memory on such a low level ?
A similar "feature" is the last OP-code read will become d8xx-color in the FLI-bug area etc. You simply need to emulate the memory bus behavior correctly and not just set a byte in some array. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
thanks, that explains. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
another thing is the "garbage" that you can read from open i/o space |
| |
Copyfault
Registered: Dec 2001 Posts: |
Quoting Krill...
Action Replay and similar cartridges allow you to programmatically enable the Ultimax mode. With some code below $1000, disable interrupts and write #$03 to $de00, and the graphics are revealed permanently.
Wondering if there are demos already that utilize this? Since years (if not decades) every compo-machine comes equipped with an AR, so it should be rather probable... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
i doubt it, as ultimax mode also means that only the first 4k of memory are available as RAM - so you could display gfx from the non existing memory at $1000 =D (you could abuse it in cartridge memory at $9000 - not very useful though) |
| |
Copyfault
Registered: Dec 2001 Posts: |
Groepaz, it's correct that in ultimax there's only 4k of RAM ($0000-$0fff), but this ofcourse only applies for the cpu! The VIC sees all of'em 64k.
By switching to ultimax at the beginning of the display area and swichting back to full RAM/IO access e.g. at the beginning of the lower border, I guess some "nice things" might be possible.
Hmm, somehow cries for a 4K AR Compo ;) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
Quote:but this ofcourse only applies for the cpu!
yes. forgot about that /o\ |
Previous - 1 | 2 | 3 - Next |