# Duck Hunt (JUE) — Pass 1 Disassembly (Pass 2 partial) ROM: `_wip/Duck Hunt (JUE)/Duck Hunt (JUE).nes` (24,592 bytes, iNES). Status: **Pass 1 complete — 37.5% code; Pass 2 partial.** `copilot/prg.s` is a real disassembly, not a skeleton: 3,058 instructions (6,152 bytes as code), **472 label definitions of which only 31 carry semantic names** — 441 are still address-based `Label_`. `locals.inc` holds **174 neutral `ZpXX` slots and no semantic zero-page aliases**. It builds **byte-identical** at the PRG level (`cmp reconstructed_prg.bin prg.bin`). This header said "Pass 2 complete" from `1b06820` (2026-10-18) until the 2026-10-19 correction; that claim counted the draft map's rows, not names actually present in `prg.s`. See "Pass 2 Status and Map Audit" below. ## 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 | `ca0d31e6f3aa70204fa5af67803c6533851a28fa48a133e15d772d3667fa675a` | | PRG SHA-256 | `bcdd22fbe343ebd33c7fd19309510079150d1e4dc052f65382b64d197d6ba080` | ## Interrupt Vectors (taken from PRG $3FFA–$3FFF) | Vector | Target | Note | |--------|--------|------| | NMI | `$C086` | per-frame heartbeat | | RESET | `$C000` | cold start at $C000 — the usual pattern in this repo | | IRQ | `$C000` | redirects to RESET — unused placeholder | ## `copilot/` Contents | File | Purpose | |------|---------| | `Duck Hunt (JUE).nes` | original ROM image (reference) | | `prg.bin` / `header.bin` / `chr.bin` | split image, produced by `_tools/splitnes.py` | | `prg.s` | Pass 1: classified code/data split, 3,058 instructions, 31 semantic + 441 address-based `Label_` definitions, canonical audit comments | | `symbols.inc` | shared NES hardware constants (PPU/APU/controller) | | `locals.inc` | 174 neutral `ZpXX` zero-page slots (Pass 2 naming outstanding) | | `duckhunt_label_map.tsv` / `duckhunt_full_map.tsv` | Pass 2 draft maps — **stale and multi-candidate**, see the audit below; kept for provenance only | | `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/Duck Hunt (JUE)/copilot" make # → cmp reconstructed_prg.bin prg.bin → "BYTE-IDENTICAL" ``` ## Pass Status | Pass | Status | |------|--------| | Pass 1 | **Complete** — 3,058 instructions, 6,152 bytes as code (37.5%), 10,232 bytes as data, byte accounting exact (16,384) | | Pass 2 | **Partial** — 31 of 472 label definitions named (7%); 174 zero-page slots still neutral `ZpXX`; the drafted map is stale and multi-candidate | | Pass 3 | Outstanding — data tables/structures unnamed | | Promotion | Outstanding — add `header.s`/`chr.s` + HEADER/PRG/CHR `linker.cfg`, switch `make` to a whole-ROM `cmp`, move the `_tools` paths | ## Pass 2 Status and Map Audit (corrected 2026-10-19) The earlier "Pass 2 complete" text was wrong on every number it gave, because it read the draft map instead of the source: - **"48 semantic labels"** was the number of *distinct old names* in the map (`duckhunt_full_map.tsv` has 272 `label` rows covering only 48 distinct `Label_` names). `prg.s` actually names **31** definitions; the other 441 are still `Label_`. - **"174 zero-page semantic aliases"** was the count of **neutral** `ZpXX` entries in `locals.inc`. There are **zero** semantic zero-page aliases. - Several listed "key renamed routines" (`InitPPU`, `MainGameLoop`, `GameModeCheck`, `TitleScreenMode`, `UpdateSprites`, `InitSound`) do not exist in the file under those names. Draft-map audit (`duckhunt_full_map.tsv`, 272 label rows): | Outcome | Rows | Meaning | |---|---|---| | already applied | 31 | the proposed name already sits at that address | | name conflict | 210 | a **different** candidate name already sits there — the map is a ranked *candidate* list (one `Label_C2BF` carries 205 competing names) | | stale address | 2 | the address is not an instruction boundary in the current `prg.s` | | unlabelled, unreferenced | 29 | an instruction boundary with no label and no operand referencing it | | **safely applicable** | **0** | no row is both insertable and corroborated by control flow | One row in the file is malformed (`label_Label_C2BF`, missing tab). The map is therefore kept only as provenance. Completing Pass 2 needs a fresh map derived from the committed split (routine entries plus `_Block[_n]` internal branch targets, as done for `Donkey Kong (JU)`). **Still owed:** a real power-on flow analysis (RESET/NMI/main-loop walk) in the style of the top-level project `OVERVIEW.md`s.