Memory layout improvements?
I can't say for certain this will be beneficial, but moving the VIC-II bank from $4000...$7FFF to $C000...$FFFF may make things simpler:
-
The VIC-II always gets screen / sprite data from RAM regardless of the presence of ROM shadows; if the text screens and sprites were stored in $D000...$DFFF, then we would not need to switch the I/O shadow on and off so much
-
With the bitmap screen located at $E000...$FFFF, there would not be a need relocate data in the disk-file -- code/data is stored in the bitmap area in the disk file and moved out during initialisation -- instead the disk-file can simply stop before the text-screens. this saves code space and simplifies any fast-loading (make the game one file)
Other observations:
- Removing the #2 tape code and implementing a fast-loader (to minimize Kernal use) should allow us to push base memory down to $0200. I'm not certain of this in practice, but it's something to explore; an extra 256 bytes wouldn't go amiss
Something I have noticed now that I am able to re-arrange segments in memory is that we should place all page-aligned segments together so as to avoid wasted bytes between the end of a flexible segment (such as code) and data-tables that must be page-aligned.
For the benefit of also producing a #4 cartridge version, we want to place the aligned segments in the upper-memory region where the cartridge banking occurs as we want to mostly use the cartridge to bank in/out data-tables and not code.
I've got the game working on VIC bank 3 ($E000..$FFFF); there remain a few bugs related to the move, but once they've been rectified, we can move to the new layout permanently and this bug can be officially closed!
- [ ] A small buffer is written to at $FFC0; in the original game this is empty space, but on elite-harmless this is part of the bitmap screen, so we need to relocate this. It's not clear how large this buffer is, but it's guaranteed to not be any larger than $FFC0..$FFFA
- [x] Rendering of the local chart is very broken in the hiram build!