Phase 6: SID audio (5 cues + fault stinger)

This commit is contained in:
ballz
2026-07-17 02:15:54 +02:00
parent d538cf46e2
commit a621494a21
5 changed files with 548 additions and 51 deletions
+11 -7
View File
@@ -2,17 +2,19 @@
//
// Flow:
// 1. memmap_setup() — bank out KERNAL/BASIC/CHAR ROM.
// 2. score_init() — zero both player scores.
// 3. game_init() — enter the TITLE state (which also loads
// the title screen and renders the score
// bar).
// 4. rasterirq_setup() — install the single RIRQ at line 311.
// 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.
// 5. while (1) {} — idle. All per-frame work happens in
// 6. while (1) {} — idle. All per-frame work happens in
// the IRQ handler.
//
// In Phase 4 step 5 was `while (1) game_step();` — a busy-wait that
// In Phase 4 step 6 was `while (1) game_step();` — a busy-wait that
// called game_step as fast as the CPU could, so the "frame counter"
// was CPU-bound. In Phase 5 the busy-wait is gone: game_step is
// called from the raster IRQ at exactly 50 Hz, so state durations
@@ -20,6 +22,7 @@
// what the CPU is doing between IRQs.
#include "memmap.h"
#include "audio.h"
#include "game.h"
#include "score.h"
#include "tick.h"
@@ -31,6 +34,7 @@
int main(void)
{
memmap_setup();
audio_init();
score_init();
game_init();
rasterirq_setup();