Demonstrates the opt-in scene framework: title → counter → pause overlay, three Scene structs swapping via scenePush / scenePop instead of a hand-rolled state machine.
| Where | Button | Action |
|---|---|---|
| Title | Start | Push counter scene (counter resets to 0) |
| Counter | Select | Push pause overlay (counter freezes) |
| Counter | Start | Pop back to title (counter discarded) |
| Pause | Select | Pop back to counter (counter resumes from where it was) |
Three callbacks live in this example: title_init/update, counter_init/update, pause_init/update. Each is a small function (8-15 lines) that does one thing.
The hand-rolled equivalent is a enum State current; switch (current) { ... } plus an array for the suspend stack. ~15 lines of state-machine boilerplate per game. The framework brings it to 5: declare the Scene structs, call sceneRun. The runtime cost is one indirect call per frame (~20 cycles on top of WaitForVBlank's overhead) — negligible against a 357K-cycle frame budget.
Then load scene_stack.sfc in your favourite SNES emulator.
console, sprite, dma, background, text, input, scene