How it works · write-up
Main scenes and startup
Working notes, rendered as they are: they were written while building the game, so expect ROM addresses, register names and references to source files that are not published.
main-scene.ts dispatches the production attract/start flow. The lab selects
an initial state and supplies inputs to the same FirstSectionGame methods.
playlab.html imports no lab scenario or probe stepping code.
| Source | Implementation | Contract |
|---|---|---|
$0400-$0561 |
attract.ts |
Six attract phases, timer/animation output, backdrop selection, foreground requests and credit handoff |
$0562-$05FB |
attract.ts |
Menu, blink, one/two-player start selectors and BCD credit debit |
$0646-$07FB |
start-game.ts |
Score/bank/RNG setup, pool clear, backdrop restore, wait/cinematic and player-ready handoff |
$A58E |
scene-background.ts |
Placement cursors, state clear, five macro blocks, eight scenery acceptance calls and native sprite writes |
$A9BC-$AE94 |
start-cinematic.ts |
Transport phases, shadow, saved scenery animation and player deployment effect |
$8906/$8CB1 |
player-initialization.ts |
Native player record, retained counters/fractions, three-code pose and ready sound request |
$2B88/$8DC2 |
presentation/native-templates.ts |
Packed templates and exact three-code composite writes, including hidden bytes |
The startup transport at $E160, its shadow sprites and the $E420 player
deployment effect form the introduction sequence. They use phase/pose records
and extracted ROM tables. NativeStartPhase and CinematicPhase retain source
hex IDs. Presentation writes are shared helpers; no frame-number pose script
drives this scene.
MainSceneStage.worldHandoff_04 preserves the final native sprite buffer for
one presentation update. The following active update uses the shared world
runtime, carrying player position/heading/counter, lives, stock, native score,
bonus threshold, cooldowns, RNG and wave rotation from the native start state.
Verification: capture_mame_attract.lua and attract.test.ts compare all six
attract selectors over 1,554 updates and 99 start-input updates. The startup
comparison covers 936 updates from two controlled starts, every transport and
effect phase, and complete captured state/persistent banks/RNG/tile/collision/
scenery/sprite buffers. No ROM payload or capture is tracked in Git.
The browser's ROM title → Insert coin → Start 1 player flow and the lab's ROM title preset were checked through localhost HTTP. Sound request IDs are translated, while hardware scheduling remains backlog 89/92. The two-player start selector is implemented and compared; live turn handoff remains item 95.