WIP: integrate NUFLI displayer for static screens

This commit is contained in:
2026-07-20 16:37:46 +02:00
parent 4774ff036e
commit 7d69e6ec25
7 changed files with 201 additions and 301 deletions
+30 -19
View File
@@ -1,27 +1,38 @@
// main.c — Nyuller entry point (Phase 5: raster IRQ + idle loop).
// main.c — entry point and memory layout for Nyuller.
//
// Flow:
// 1. memmap_setup() — bank out KERNAL/BASIC/CHAR ROM.
// 2. audio_init() — set SID master volume, no filter, silence
// all 3 voices. Phase 6 addition.
// 3. score_init() — zero both player scores.
// 4. game_init() — enter the TITLE state (which also loads
// the title screen, renders the score bar,
// and calls audio_state_enter(STATE_TITLE)).
// 5. rasterirq_setup() — install the single RIRQ at line 311.
// The IRQ handler increments frame_count
// and calls game_step() once per frame.
// 6. while (1) {} — idle. All per-frame work happens in
// the IRQ handler.
// Memory layout chosen for the NUFLI displayer:
// $0000-$0088: zero page
// $0100-$01FF: hardware stack
// $0200-$02FF: buffers
// $0300-$03FF: system variables
// $0900-$2000: program code
// $2000-$7A00: NUFLI runtime image
// $7A00-$8000: small stack (512 bytes)
// $8000-$D000: compressed waiting bitmaps and screen attributes
// $D000-$DFFF: C64 I/O registers
// $E000-$FFFF: game bitmap (RAM with KERNAL banked out)
//
// The program is split into three address ranges so the NUFLI runtime
// image ($2000-$7A00) is never overwritten by the linker.
#include "memmap.h"
#include "audio.h"
#include "game.h"
#include "audio.h"
#include "nufli.h"
#include "memmap.h"
#include "score.h"
#include "tick.h"
#pragma heapsize(0)
#pragma stacksize(0x400)
#pragma stacksize(0x200)
#pragma section( screens, 0)
// Region layout. The stack lives in the small gap between the NUFLI
// image ($2000-$7A00) and the high data region ($8000-$D000). Code and
// data are placed in whichever region fits.
#pragma region( region_low, 0x0900, 0x2000, , , { code, bss, heap, screens } )
#pragma region( region_stack, 0x7A00, 0x8000, , , { stack } )
#pragma region( region_high, 0x8000, 0xD000, , , { code, data, bss, heap, screens } )
int main(void)
{
@@ -31,9 +42,9 @@ int main(void)
game_init();
rasterirq_setup();
// The raster IRQ does all the per-frame work.
for (;;)
for (;;) {
;
}
return 0;
}