Project reference snapshot. Recovery notes retain earlier subsystem milestones; use the current feature overview for playable scope.

Native weapon animation timing

src/weapon_animation.c recovers the sprite animation setter 0800FC04, weapon idle reset 080116BC, and each object's complete animation advancement from 0800E460. These are native data/state operations. They execute no ROM instructions and require neither a renderer nor a GBA emulator at runtime.

SsaWeaponObject preserves the original 48-byte fixed-width object layout. Its link field is an opaque integer, not a dereferenceable host pointer. Allocation/list maintenance and presentation are outside this module. The native initializer provides the cleared defaults from FAE8, replacing GBA DMA/BIOS clearing with ordinary host memory initialization; that initializer is checked natively and is not counted as a ROM differential comparison.

Load SsaWeaponAnimations once from the user's ROM. The loader copies the 528 animation words at 0844AF4C and validates all 233 pointers in the table at 0844B36C. Actual sequences contain at most 18 words including termination. It retains no ROM pointer. Failed loads leave the destination unchanged.

FC04 accepts IDs 0 through E8 and FFFF; every other ID leaves the object unchanged. It writes the ID and the low byte of the supplied period, then clears frame index, elapsed time and completion byte. 116BC first clears weapon flags 1400 and requests current weapon minus one, period 3. Current weapon subtraction wraps/truncates before the animation validity check.

Advancement preserves these original details:

Call ssa_weapon_animation_step after gameplay consumes the preceding frame's completion state. Original main 0244C performs entity updates, movers and VM, then sprite controllers F85C, then E460, and finally rendering. This module does not implement the outer object dispatcher or draw the weapon.

tests/test_weapon_animation_rom.py executes the complete original FC04, 116BC and E460 routines without instruction hooks. It compares entire object bytes, control bytes and preserved game state. The native shared library uses UBSan. The passing results are:

There are 275,520 ROM comparisons total. The 84-object batch counts as one whole routine comparison per frame, not 84 comparisons. Actual table extraction, completion timing, paused type handling and byte overflow are covered. Full counts and the native source hash are recorded in native-weapon-animation-validation.json. Native animation timing alone does not establish projectile behavior, sprite rendering or a playable native port.

The straightforward struct-based candidate in recovered/weapon_animation_set.c matches 0800FC04 exactly: 56 bytes and 28 instructions, first manual attempt through decomp.wtf compile_and_diff. The attempt record is weapon-animation-match-attempts.json; the claim was released automatically and behavior notes were saved through add_note. Export/rebuild is coordinated by the parent integration task.