How it works · write-up
Active player control and frame effects
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.
src/gameplay/active-player.ts translates the active $8939 path into a
typed transition over the retained player, grenade and sprite records.
FirstSectionGame calls it before the $E500/$E600 passes. Runtime lab
presets initialize the same game; they do not implement another update loop.
Order and retained state
$895C/$8960clear player flags and the pending scroll word.$8A9Adecrements an existing throw delay before joystick processing. Nonzero delays draw a raw$8AB5throw composite at the old position.- When the delay reaches zero,
$9302changes IX to$E140, copies only the player's high coordinate bytes, sets the flight timer and requests sound$06. Its return leaves IX pointing at the grenade. $8AC9/$8B3B/$8BCF/$8CB1process the selected record. On that launch update the grenade receives input/movement/draw, and the player holds position. Idle sets the skip flag and retains the preceding sprite bytes and walk counter. Nonzero opposed direction masks still read raw lookup bytes, including bytes following the nominal direction table.$9100advances flight and handles landing after all fourteen shot records. A landing does not poll another grenade press in the same pass. A core record hit here starts death in the following$0F9Epass. Scripted$E500spawners are excluded from the landing scan/award:$1869/$1AE1consume its latch next update, then$2B3Astarts death one update later and requests the separate 500-point award.
Player motion uses native fixed-point coordinates. Contact and aiming read
the high coordinate bytes, rather than subtracting floating positions first.
$8C4A accepts lateral and forward coordinates independently at screen
boundaries. Terrain/scenery blocking still rejects the entire candidate.
$890C copies fourteen initialization bytes; later walk/turn bytes survive
and its unconditional draw increments the retained walk counter.
Gate combat
$E09F keeps the camera latched and changes the player forward threshold
from $40 to $B0. Joystick movement remains active. $9F09 ignores the
queued scroll and does not push its scenery continuations while this latch
is set. The birth scheduler no longer invents automatic player movement.
Only after placements and core records drain does $085D select the forced
exit approach. This approach clears the throw delay each update and changes
high coordinate bytes while preserving their fractions.
Core effects and command consumption
Shot and death events are emitted at each physical core slot update. Death
requests use the raw $1827 subtype-to-score-event table, followed by the
native main-command consumer. The consumer's BCD score is authoritative.
The two mixed $03/$01 slot orders produce different request sequences;
both exceed or reach the bonus threshold and grant a life.
The IRQ result exposes the five ordered writes to $C800/$C809/$C808/$C804/
$C806. Sound commands enter the retained IRQ ring; audio synthesis is a
separate backlog item.
The scenery return chain executes before player control, after camera
scroll. See NATIVE_SCENERY.md for the PC/SP evidence and retained output.
The queued background consumer reloads map settings later, after gameplay.
Verification
| Evidence | Compared scope |
|---|---|
capture_mame_active_player.lua |
896 complete player/grenade records, all twelve player sprite bytes, pending scroll and final IX; all sixteen inputs, delays 0–8, gate/non-gate and wrapping/clipping boundaries. Scenery is cleared in this controlled fixture. |
capture_mame_irq_outputs.lua |
141 complete IRQ prefix state/ring/pointer pairs and the five ordered output writes. |
capture_mame_core_defeat_order.lua |
Both mixed slot orders: consumed score requests, native score/lives/threshold and sound ring/pointers. |
capture_mame_grenade_core_order.lua |
Landing leaves core $3F and 200 points; the following pass enters $20 and reaches 500 points. |
| Existing first-screen acceptance replays | Selected ordinary and controlled route state through the first gate and the second section. These do not compare every world RAM byte. |
Existing spawner_2f_grenade.csv |
Shared-runtime landing, following $3F contact and subsequent $01 death/500 points at frames1606–1608. |
HTTP lab presets: Gate $E09F joystick control, Player throw launch
frame, Grenade $9100 landing order, and the two mixed core defeat
orders. Plain grenade throw/empty presets also use the production runtime.
Remaining work includes complete grenade-flight/sprite and shared-blast buffer effects, other command/sound producers, aliased actor output, and consumer interruption scheduling. The coverage ledger records those gaps separately; these comparisons do not certify the entire first-section graph.
Live contact and input contract (139)
Player acceptance now reads the dedicated live collision ring through EF10/11/12 and the named hit fields of the first eight typed scenery records. The whole-level collision map remains a diagnostic tool; gameplay does not substitute it for current queued video state. Player/core callers share the source query in native-terrain-contact.ts.
8E52 selects the actual input bank, and8ACC masks0F before direction lookup. Fire/grenade bits do not suppress movement.4096 full native calls compare all modeled work bytes, all96 sprite records, finalIX and ordered sound, with all50 conditional outcomes. The earlier896 fixture now captures raw ring/work/scenery inputs too. Six Player live source contact lab presets seed data only and use the production dispatcher. The earlier list of missing grenade/blast and actor-output work is historical:128–138 close those bounded bodies; scheduling remains92/102.