# Golf (JU) — Pass 1 complete, Pass 2 substantial, Pass 3 started ROM: `_wip/Golf (JU)/Golf (JU).nes` (24,592 bytes, iNES). Status: **Pass 1 complete, Pass 2 substantial, Pass 3 started — PAUSED.** PRG build is **byte-identical**. **Pass 1 (code/data split) — complete.** Reachable code traced from RESET ($C000) and NMI ($C0A6); all 4,063 reachable instructions are explicit source. NMI callbacks ($C5A0=`GameplayInputNmiCallback`, $C6C8, $CFAA, $DAA2; continuations $CFC3/$D03E/$D08A) and controller/attract paths ($DAA2, $C0C7=`InitializeRuntimeState`) are in source. All remaining `.incbin` spans have zero code entry points and are confirmed data. **Pass 2 (label naming) — substantial.** Startup/NMI/PPU/controller/course-decode routines named (batches 1–3 per `PASS2_PLAN.md`). All 112 subroutine-entry `Label_` labels renamed to `SubC` (108) or semantic names (4: `WaitForFramePreservingY`, `SpriteOffsetForController`, `SetPpuScrollAndMask`, `MultiplyABy32`); 349 internal branch-target `Label_` labels remain intentionally. **Pass 3 (data tables) — started, PAUSED.** Conversions completed: - Interrupt vectors at $FFFA–$FFFF → `.word NmiHandler`/`Reset`/`IrqLoop` - Course-stream split pointer table at $E6C3/$E6D5 (18 entries) → `CourseLayoutPointerLo`/`CourseLayoutPointerHi` - Bit-mask table $D6F4–$D6FB → `BitMaskTable` ($80 40 20 10 08 04 02 01) - PPU write table $FD0A–$FD11 → `PpuTableFd0a` - Score adjust table $D988–$D9B0 → `D988ScoreAdjustTable` - PPU value table $FF85–$FF9F → `FF85PpuValueTable` - Sprite/object tables (`sprite_object_tables.inc`) and gameplay PPU palette ($E1B8–$E1D7) already emitted as structured source. **Paused:** Remaining `.incbin` spans are largely Iwata's compressed level data ($E6E7–$F905, ~4.6 KB) and opaque lookup tables ($C786–$C84C, $CD85–$CE63, $D304–$D3B6, $D563–$D659, $D823–$D8EC, $DC59–$DD77, $E1D8–$E281, $E3DE–$E3FB, $E588–$E6AF, $FBBF–$FC23). Without runtime tracing / a code/data log to confirm consumers and structure, converting these risks guessy rewrites. Per repo convention, they remain as `.incbin` with address comments. Remaining `.incbin` spans ($C71E–$C720, $C786–$C84C, $CD85–$CE63, $D304–$D3B6, $D563–$D659, $D823–$D8EC, $DC59–$DD77, $E1D8–$E281, $E3DE–$E3FB, $E588–$E6AF, $E6E7–$F905, $FBBF–$FC23) remain as data per the no-guessy-rewrites convention; convert only when a consumer is identified. **Next Pass 3 candidates:** when runtime tracing tools are available, remaining structured tables (course-stream data, opaque lookup spans) can be converted where structure is confirmed. **Promotion:** not yet — `_wip` tier (PRG-only compare). Promotion requires full-ROM build (`header.s`/`chr.s` + vectors) and root inventory entry. ## ROM Facts | Property | Value | |----------|-------| | Mapper | 0 (NROM) — from the iNES header | | PRG | 16 KB (header claims map at CPU $C000–$FFFF) | | CHR | 8 KB | | Mirroring | Vertical | | Battery-backed flag | clear | | ROM SHA-256 | `70986ed4fb441199a9ff50c7b5c6388d9f7a17c29990d1b5f7214572ae0a4bc6` | | PRG SHA-256 | `9f729074cd7c74340f325460173519427b1180f5101f8dc37da7b1c2b9b604d5` | ## Interrupt Vectors (taken from PRG $3FFA–$3FFF) | Vector | Target | Note | |--------|--------|------| | NMI | `$C0A6` | per-frame heartbeat | | RESET | `$C000` | cold start at $C000 — the usual pattern in this repo | | IRQ | `$C0C4` | IRQ handler | ## `copilot/` Contents | File | Purpose | |------|---------| | `Golf (JU).nes` | original ROM image (reference) | | `prg.bin` / `header.bin` / `chr.bin` | split image, produced by `_tools/splitnes.py` | | `prg.s` | Pass-1 disassembly: classified code/data split with audit comments; Pass 2 substantial. Data split into `course_streams.inc` and `sprite_object_tables.inc` | | `symbols.inc` | shared NES hardware constants (PPU/APU/controller) | | `locals.inc` | project-local zero-page aliases (Pass 2 batches kept alongside as `locals.inc.pass2-*` backups) | | `linker.cfg` | PRG at $C000, 16 KB, `fill = yes` | | `Makefile` | links `reconstructed_prg.bin` and `cmp`s it against `prg.bin` | | `reconstructed_prg.bin` | build output from the last verified build | Header/CHR are not linked: `copilot/` keeps the raw `header.bin`/`chr.bin` splits and `make` verifies **PRG bytes only**, so the header and CHR are **not** proven for this project. Promotion to the top level adds `header.s` / `chr.s` (as e.g. `Burger Time (U)`), a HEADER/PRG/CHR `linker.cfg`, and a full-ROM `make` target. ## Build ```bash cd "_wip/Golf (JU)/copilot" make # → cmp reconstructed_prg.bin prg.bin → "BYTE-IDENTICAL" ``` ## Next Steps 1. **Pass 1** — done (byte-identical PRG build). 2. **Pass 2** — substantial: startup/NMI/PPU/controller/course-decode routines and all 112 subroutine entry points named; 349 internal branch-target `Label_` labels remain. 3. **Pass 3** — paused: convert the remaining `.incbin` spans (Iwata-compressed level data `$E6E7–$F905`, opaque lookup tables) only once a consumer/structure is confirmed; per repo convention they stay `.incbin` with address comments rather than be guessed at. 4. **Promotion** — move to a top-level `/copilot/` folder, add a full-ROM build (`header.s` + `chr.s` + HEADER/PRG/CHR `linker.cfg`), and write the power-on flow `OVERVIEW.md` in the established style.