How it works · write-up
Native scenery allocation, state and output
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.
The shared modules are native-scenery.ts, scenery-record.ts and
scenery-state.ts. Scene initialization and gameplay use the same allocator
and updater. Legacy bounded pool helpers also call the same record transition.
The HTML lab only initializes the production host.
Actual frame order
$07FC → $9FA9 → $9F09 → $A318 → $A399 → $8939 → $272F →
$97EF → $0F9E → $931D → $8E93/$9100 → $AE95 → $0817.
CALL $9F09 saves $0802. Its pushes place $A399 and then $A318 above
that address. The returns therefore run allocation and scenery before
player control. A gate latch skips both. The background command consumer's
later $9F8B/$9FD7/$A000 reload is a different path.
State and rendering rules
$A318skips stale stream records, accepts one eligible record and scans for the first zero state. It runs before removal in$A399.$A399updates nine records and fills eighteen sprite pairs. Empty output clears only Y; other sprite bytes survive. Mode5+ selects$FEACinstead of$FE30.- Standing records subtract one word for any nonzero
$E062, then remove when the high byte is nonzero and the low byte is below$E0. - Hit-pending sets count
$10and requests score event$02without drawing a new pose. The preceding standing output remains for that update. - Counts
$0F-$08draw the first breakup pose;$07-$01draw the second. Breakup movement decrements only the low X byte, without borrow into high X. - Expiry frees the record but retains the last sprite bytes for that update. The next pass clears or overwrites them. Collision occupancy and retained visual output are separate state.
- Contacts use the stored native coordinate. Background movement, damage state and queued awards follow their source phases.
The first-section raw stream's maximum density is nine records. A complete
source-data simulation through camera $0700 reaches nine and produces no
allocation outside the displayed pool. Wider allocation/metadata contexts
remain part of later-area work.
Evidence and limits
capture_mame_frame_order.lua compares21 ordered PC/SP/return samples.
capture_mame_native_scenery.lua compares256 updates of twelve record-sized
memory regions, all384 sprite bytes, command-ring bytes/pointers and final IY.
It covers standing, hit-pending, timer boundaries, word/byte wrapping,
normal/late output bases, mirrored palettes and pulses0/1/3/FF.
A mixed palm/$01/$03 capture verifies score requests200→300→200, final
10,500 points and one bonus life. The lab's Scenery retained breakup and
Scenery/core score order presets use the same production paths.
Full cross-actor hardware-buffer aliasing remains backlog99. This bounded routine comparison does not certify the entire world buffer or later areas.