Phase 2: display the title screen (mmap, vic, screen swap)
Replace helloworld.c with main.c. Add memmap_setup/restore (banks out KERNAL+BASIC+CHAR ROMs so $E000-$FFFF is free for the 8 KB bitmap and $D000-$DFFF is I/O), show_screen(n) which copies the title .bin to $E000 and the .attr to $D000 (screen memory in multicolor bitmap mode) then flips the VIC into BMM=1 MCM=1 CSEL=1 RSEL=1 DEN=1 with bitmap base CB13=1 and screen base VM13-VM10=4 ($D018 = 0x48), and input_fire(port) which reads bit 4 of CIA1 $DC00/$DC01. build.sh default target is now main.c -> whack_hare.prg (still builds helloworld explicitly via the existing -c flag if needed). Verified: ./build.sh -e runs the title screen in oscar64's built-in emulator and exits cleanly. .map shows code at $0880-$09A6 and embedded title data at $09A7-$2CCF, well within the 38 KB main region. .prg is 9428 bytes, well under the 202-block LOAD"*",8,1 limit. Concerns for Phase 3 (score bar): the score bar will overlay the top 8 pixel rows of the bitmap ($E000-$E13F, 320 bytes). show_screen() will continue to copy the full .bin to $E000; score_render() will be called immediately after and overwrite the top 320 bytes. This keeps show_screen() dumb and lets the score bar be re-rendered on state change without re-copying the whole 8 KB bitmap.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#include "memmap.h"
|
||||
|
||||
void memmap_setup(void)
|
||||
{
|
||||
mmap_trampoline();
|
||||
mmap_set(MMAP_RAM);
|
||||
mmap_set(MMAP_NO_ROM);
|
||||
}
|
||||
|
||||
void memmap_restore(void)
|
||||
{
|
||||
mmap_set(MMAP_ROM);
|
||||
}
|
||||
Reference in New Issue
Block a user