Xenon 2

How it works · write-up

Timed-power countdown capture

xenondoc/POWER_COUNTDOWN_RENDERING.MD · 3 KB · updated 2026-10-05

The missing gray shape in the Nashwan attachment probe was the countdown digit. It is a direct prepared-sprite draw, not an attachment or an object-list entry. Auditing unknown object draw procedures could not discover it.

Original routine and fix

ReVa's /mydumpat0 program contains the common routine at $6B94. Its bytes at $6BE8..$6C40 were compared with the Level 5 probe's start.ram; they match. This verification matters because the level-specific overlays differ between dumps.

Power Remaining counter Caller Digit anchor Divisor
Dive word $0434 $6C02 (152,8) $88 + 1
Super Nashwan Power word $0CA2 $6C32 (152,160) $AA + 1

$6B94 selects a digit using integer remaining * 10 / (duration + 1). $6BA0 reads its prepared-sprite pointer from the ten-entry table at $6B6C. $6BA4 branches directly to the prepared blitter at $10AE, bypassing both the object dispatcher and the $0EA2/$0F26 wrappers.

The table contains $26CF0, $26DA0, $26E50, $26F00, $26FB0, $27060, $27110, $271C0, $27270, $27320. These sprites already exist in the shared atlas.

DrawCommandStream_OnInstructionFetch() now captures $6BA4 using the actual A0 sprite pointer and D0/D1 anchor. Synthetic draw identity $FFF70000 | Y distinguishes the two timer rows. The capture uses the existing prepared-sprite path, so it needs no new texture, shader, wire record or Web replay decoder case. It follows executed draws, including the original final zero digit.

The permanent POWERUP upgrade is distinct from these timed powers; it does not have an expiry countdown. Manual Dive activation remains untested live. The shared hook covers its original caller, but that is not a live Dive pass.

Live evidence

Both Hatari and the native replay DLL were rebuilt using hatari_dev.ps1. The existing attachment harness bought Nashwan through the original shop, then used visible resident-C gameplay and recorded both AVIs:

E:/xenon_runs/power-countdown-20261004-retest/attachment-06-buy1.validation/attachment-06-buy1.x2events.

All ten digit sprites were captured. Their full 16×16 regions, scaled to 32×32 AVI pixels, were identical to Original AVI in 168/168 aligned frames, 40193–40360, using Original VBL +2. The last draw has scalar timer zero; the original timer routine draws zero before restoring the normal loadout. Later frames contain no timer draw.

All ten digits: Original and Sprite AVI

The paired AVI container/index audits pass. Whole-playfield comparison is 111/248 exact frames, median 12 changed physical pixels, worst 388; residual weapon-edge differences remain. This verifies the countdown, not universal Nashwan pixel parity. See digit-region evidence.

Reproduce with a new output directory:

python xenon_tools\validate_ship_attachments.py --checkpoint E:/xenon_runs/level4-full-after-level3-20261003-r278.validation/checkpoints/f38513-periodic.sav --output E:/xenon_runs/NEW-COUNTDOWN-TEST --items 6 --max-purchases 1 --frames 230 --port 6933 --build-directory out/build/codex-validate --build