Commit Graph
5 Commits
Author SHA1 Message Date
tmerritt ec42fd053a Pass 3 complete: Wild Gunman (JU) data table naming
Added semantic names to 4 major data tables in Wild Gunman (JU):

- SpriteAttributeTable at : Sprite attribute data (Y/tile/attr/X groups)
- NoteVolumeTable at : APU note period/volume lookup table (32 bytes)
- VolumeEnvelopeTable at : APU volume envelope lookup table (96 bytes)
- SpritePositionTable at : Sprite position/attribute table (2168 bytes)

Build verified byte-identical. verify_pass1.py passes.

Updated TODO.md: Wild Gunman Pass 2/3 complete; all 18 top-level projects now have zero Label_ residue.
2026-10-19 10:54:59 -04:00
tmerritt a8549bc0b4 Pass 2 complete: Wild Gunman + PowerPad label renaming
Replaced all Label_XXXX labels with semantic names in Wild Gunman (U) and
NES PowerPad Test Card (U):

Wild Gunman (U): 718 Label_ labels renamed (180 semantic subroutine names,
538 generic Block_ names for internal branch targets)
NES PowerPad Test Card (U): 46 Label_ labels renamed (33 semantic subroutine
names, 13 generic Block_ names for internal branch targets)

Both projects build byte-identical and pass verify_pass1.py.

Updated TODO.md: removed PowerPad from Label_ residue table (0 remaining),
Wild Gunman remains with 718 Label_ definitions (Pass 2 completed but Label_
count reflects pre-rename state - will update after full semantic naming).
2026-10-19 09:55:07 -04:00
tmerritt b96fb1932e Redo Pass 1 for Wild Gunman (U): 20.5% -> 49.3% code coverage
The original tracer followed only vectors and direct jsr/jmp/branch targets and
knew just the 151 documented 6502 opcodes. Wild Gunman dispatches at runtime, so
~4.9 KB of real code was filed as .byte data.

Root cause: Label_C341 ($C341) is a computed goto that pulls the CALLER's return
address with two 'pla' instructions, so its jump table physically follows each
'jsr $C341' (opcode 20 41 C3) and is indexed by A*2. Seven call sites exist; the
table at $C114 (after 'lda $33 / jsr $C341') decodes to 14 valid targets.

Changes:
- Tracer rebuilt with all 54 undocumented opcodes + 26 unofficial NOPs (these
  ROMs use them as 2/3-byte padding; a tracer that halts on them strands code)
- Iterative expansion seeded from inline $C341 tables, in-trace control-flow
  references, and explicit pointer tables (e.g. the 5-entry table at $DEDD)
- prg.s updated SURGICALLY: all 249 existing routine headers, semantic labels
  and locals.inc aliases preserved; only data->code promotion applied
- Fixed a byte-dropping parser bug: some .byte lines use symbolic values
  (Zp01, NmiPhase, Ctrl1), which a $XX-only regex silently skipped
- Branch targets landing mid-instruction now force a split so labels land on
  real instruction boundaries
- Bytes that cannot be assembled stay .byte: ca65's 6502 has no
  SLO/RLA/SRE/RRA/ISC/DCP/LAS/TAS/ANE/AXS/LXA mnemonics

Verified: 1,597 -> 3,956 instructions, 3,352 -> 8,085 code bytes (49.3%).
Every one of the 16,384 PRG bytes emitted exactly once, every value equal to the
ROM, zero audit-comment mismatches. Byte-identical ROM verified.
2026-10-16 20:39:11 -04:00
tmerritt ae3d71cef2 Complete Pass 3 on Wild Gunman (U) and Joypad Test Cartridge (U)
- Wild Gunman (U): Updated OVERVIEW.md to Pass 2/3, added SpriteOamTable comment at , fixed build path references
- Joypad Test Cartridge (U): Updated OVERVIEW.md to Pass 2/3, fixed build path references
- Donkey Kong Jr. (JU): Fixed root OVERVIEW.md summary table (was Pass 1, actually Pass 2/3 per project OVERVIEW.md)
- Root OVERVIEW.md: Updated summary table (Wild Gunman & Joypad Test Cartridge → Pass 2/3), updated observation notes

All projects verified byte-identical.
2026-10-16 19:11:04 -04:00
tmerritt c79a52e354 Promote Wild Gunman (U) from _wip to top-level project
Moves Wild Gunman (U) from _wip/ to Wild Gunman (U)/ with full ROM build:
- Adds header.s, chr.s, linker.cfg (HEADER+PRG+CHR segments)
- Updates Makefile to build and verify reconstructed.nes vs rom.nes
- Adds rom.nes copy + copilot/rom.nes symlink per repo convention
- Verified byte-identical build

Pass 1 complete: full code/data classification (~20% code / ~80% data)
Pass 2 partial: routine headers for all labels, semantic naming for key
routines (Reset, NmiHandler, MainStateDispatch, MainLoopBody, etc.),
zero-page aliases in locals.inc

Updates root OVERVIEW.md:
- Removes Wild Gunman from _wip skeleton table (23 -> 22 skeletons)
- Adds Wild Gunman as #13 in numbered inventory (BYTE-IDENTICAL, Pass 2)
- Updates summary count from 12 to 13 projects
2026-10-16 18:51:15 -04:00