Files
disasm/_wip/Golf (JU)/copilot/PASS2_PLAN.md
T
2026-10-18 16:47:03 -04:00

60 lines
2.3 KiB
Markdown

# Golf (JU) Pass 2 naming plan and progress
Pass 1 baseline: ca65/ld65 build verified byte-identical.
## Batch 1: startup, interrupt, PPU helpers, title/menu backbone
- Rename high-confidence startup and interrupt-local labels.
- Name NMI vector fields and PPU shadow values in `locals.inc`.
- Name the title/menu selection and input-latch fields where usage is proven.
- Name the menu cursor Y-position table at `$DB0D`.
- Keep uncertain gameplay temporaries numerical.
## Later batches
1. Controller polling and shot-selection state.
2. Gameplay NMI sequence fields and callbacks.
3. Course decompressor fields and package tables.
4. Golfer sprite-layout routines and states.
5. Course object expansion and collision routines.
6. Terrain-grid generator and course overview.
7. Audio engine and command tables.
Every batch must complete `make clean && make` with `BYTE-IDENTICAL` before the
next naming batch is accepted.
## Batch 2 completed: controller and shot-selection callback
Named the controller serial scan, repeat latch, club-selection index, aim index,
aim direction, animation counters, major callback phases, and OAM-update loops
within `$C5A0-$C71D`.
## Batch 3 completed: gameplay sequence NMI chain
Named the sequence position, three bounds, phase and completion fields, dynamic
NMI continuations, position/frame selection loops, and threshold tables in
`$CF87-$D13D`.
### Batch 3 correction
The branch at `$D09C` must target the trampoline at `$D0A6`, not the frame
selector at `$D0A9`. The target is now `JumpToSelectSequenceFrame`, preserving
the original displacement `$08` and byte sequence `90 08`.
## Subroutine-entry Label_ cleanup (Pass 2 residue)
All 112 `Label_` definitions that are JSR/JMP subroutine entry points have been
renamed:
- 4 with established semantics: `WaitForFramePreservingY` ($C881),
`SpriteOffsetForController` ($C894), `SetPpuScrollAndMask` ($C89D),
`MultiplyABy32` ($C8BB).
- 108 as address-based `SubC<addr>` names where behaviour is not yet
established (e.g. `SubC84D`, `SubC89A`, `SubCE64`).
The remaining 349 `Label_` definitions are internal branch targets within
routines; per repo convention these do not need semantic names for the call
graph to be readable and are intentionally left as `Label_`.
Build verified `BYTE-IDENTICAL` after the rename.