Promotes Donkey Kong Jr
Adds remaining NROM as _wip Update gitignore to not keep object files Adds AGENTS.md as this is an AI helped project
This commit is contained in:
1 parent
a29b03b00b
commit
9aef410424
412 files changed
+33427
-221
No files matched your search
@@ -0,0 +1,53 @@
|
||||
# Pinball (JU) — Skeleton Project
|
||||
|
||||
ROM: `_wip/Pinball (JU)/Pinball (JU).nes` (24,592 bytes, iNES). Status: **SKELETON — not yet disassembled.** The entire 16 KB PRG bank is a single unclassified block; `copilot/prg.s` is the default-project skeleton (`default_project.tar.gz`) that reproduces it as one `.incbin`. The skeleton build is **byte-identical** at the PRG level.
|
||||
|
||||
|
||||
## 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 | `451a201c067bbabad8d762c3fdc2a83cb0b93f26ed0c350cf23bbf486f7addb6` |
|
||||
| PRG SHA-256 | `1d79f41ef62d5045db2c45c9c75766d54c0a84e167d8067bbb6fb90227ac5619` |
|
||||
|
||||
## Interrupt Vectors (taken from PRG $3FFA–$3FFF)
|
||||
|
||||
| Vector | Target | Note |
|
||||
|--------|--------|------|
|
||||
| NMI | `$C1ED` | per-frame heartbeat |
|
||||
| RESET | `$C000` | cold start at $C000 — the usual pattern in this repo |
|
||||
| IRQ | `$C1ED` | target $C1ED — verify during Pass 1 |
|
||||
|
||||
## `copilot/` Contents
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `Pinball (JU).nes` | original ROM image (reference) |
|
||||
| `prg.bin` / `header.bin` / `chr.bin` | split image, produced by `_tools/splitnes.py` |
|
||||
| `prg.s` | Pass-1 skeleton: `.incbin "prg.bin", $0000, $4000` (whole PRG) |
|
||||
| `symbols.inc` | shared NES hardware constants (PPU/APU/controller, from the skeleton) |
|
||||
| `locals.inc` | project-local zero-page aliases — empty for now (filled in Pass 2) |
|
||||
| `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 reproduced verbatim from `header.bin`/`chr.bin` (not linked): `make` verifies **PRG bytes only** at this stage, which is exactly what a skeleton proves. When this project is promoted to a full disassembly, `header.s` / `chr.s` (as e.g. `Burger Time (U)`) and a full-ROM `make` target get added.
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
cd "_wip/Pinball (JU)/copilot"
|
||||
make # → cmp reconstructed_prg.bin prg.bin → "BYTE-IDENTICAL"
|
||||
```
|
||||
|
||||
## Next Steps (per `PROMPTS.md`)
|
||||
|
||||
1. **Pass 1** — replace the blanket `.incbin` with classified code/data: trace reachability from RESET ($C000) and NMI ($C1ED), emit per-instruction `; PRG:$xxxx AA BB` annotations, keep unreached bytes as explicit `.byte` blocks.
|
||||
2. **Pass 2** — replace `Label_`/`Sub_` names with semantic routine names; fill `locals.inc`.
|
||||
3. **Pass 3** — name data tables/structures; release provisional flags.
|
||||
4. **Promotion** — move to a top-level `<name>/copilot/` folder, add full-ROM build (header.s + chr.s + vectors), and write the power-on flow `OVERVIEW.md` in the established style; then it joins the root index's numbered inventory.
|
||||
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
all: reconstructed_prg.bin verify
|
||||
prg.o: prg.s symbols.inc prg.bin
|
||||
ca65 -g -o $@ prg.s
|
||||
reconstructed_prg.bin: prg.o linker.cfg
|
||||
ld65 -C linker.cfg -m reconstructed.map -Ln reconstructed.lbl -o $@ prg.o
|
||||
verify: reconstructed_prg.bin prg.bin
|
||||
cmp reconstructed_prg.bin prg.bin
|
||||
@echo BYTE-IDENTICAL
|
||||
clean:
|
||||
rm -f prg.o reconstructed_prg.bin reconstructed.map reconstructed.lbl
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
MEMORY {
|
||||
PRG: start = $C000, size = $4000, file = %O, fill = yes;
|
||||
}
|
||||
SEGMENTS {
|
||||
PRG: load = PRG, type = ro;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
; Pinball (JU) zero-page aliases (declared during Pass 2).
|
||||
; These intentionally conservative names will be refined in Passes 2 and 3.
|
||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
; Pinball (JU) NES disassembly - Pass 1 (skeleton)
|
||||
; Generated from the supplied 16 KiB PRG image.
|
||||
; Pass 1 classifies recursively reachable code, inline address tables, vectors,
|
||||
; and untraced/data regions. All PRG data bytes are emitted explicitly with .byte directives.
|
||||
|
||||
.setcpu "6502"
|
||||
|
||||
.include "symbols.inc"
|
||||
.include "locals.inc"
|
||||
|
||||
.segment "PRG"
|
||||
.incbin "prg.bin", $0000, $4000
|
||||
Whitespace-only changes.
@@ -0,0 +1,26 @@
|
||||
Modules list:
|
||||
-------------
|
||||
prg.o:
|
||||
PRG Offs=000000 Size=004000 Align=00001 Fill=0000
|
||||
|
||||
|
||||
Segment list:
|
||||
-------------
|
||||
Name Start End Size Align
|
||||
----------------------------------------------------
|
||||
PRG 00C000 00FFFF 004000 00001
|
||||
|
||||
|
||||
Exports list by name:
|
||||
---------------------
|
||||
|
||||
|
||||
|
||||
Exports list by value:
|
||||
----------------------
|
||||
|
||||
|
||||
|
||||
Imports list:
|
||||
-------------
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,108 @@
|
||||
; =============================================================================
|
||||
; Nintendo Entertainment System hardware symbols
|
||||
; =============================================================================
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; PPU registers
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
PPUCTRL = $2000
|
||||
PPUMASK = $2001
|
||||
PPUSTATUS = $2002
|
||||
OAMADDR = $2003
|
||||
OAMDATA = $2004
|
||||
PPUSCROLL = $2005
|
||||
PPUADDR = $2006
|
||||
PPUDATA = $2007
|
||||
|
||||
OAMDMA = $4014
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; Controller ports
|
||||
;
|
||||
; $4016:
|
||||
; Write: controller strobe
|
||||
; Read: controller port 1
|
||||
;
|
||||
; $4017:
|
||||
; Read: controller port 2
|
||||
; Write: APU frame counter
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
JOY1 = $4016
|
||||
JOY2 = $4017
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; APU pulse channel 1
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
APUPULSE1CTRL = $4000
|
||||
APUPULSE1SWEEP = $4001
|
||||
APUPULSE1TIMERLO = $4002
|
||||
APUPULSE1TIMERHI = $4003
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; APU pulse channel 2
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
APUPULSE2CTRL = $4004
|
||||
APUPULSE2SWEEP = $4005
|
||||
APUPULSE2TIMERLO = $4006
|
||||
APUPULSE2TIMERHI = $4007
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; APU triangle channel
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
APUTRIANGLECTRL = $4008
|
||||
APUTRIANGLETIMERLO = $400A
|
||||
APUTRIANGLETIMERHI = $400B
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; APU noise channel
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
APUNOISECTRL = $400C
|
||||
APUNOISEPERIOD = $400E
|
||||
APUNOISELENGTH = $400F
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; APU DMC channel
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
APUDMCCTRL = $4010
|
||||
APUDMCDIRECT = $4011
|
||||
APUDMCADDR = $4012
|
||||
APUDMCLENGTH = $4013
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; APU status and frame counter
|
||||
;
|
||||
; $4015:
|
||||
; Write: enable or disable the five APU channels
|
||||
; Read: channel and interrupt status
|
||||
;
|
||||
; $4017:
|
||||
; Write: APU frame-counter mode and IRQ inhibit
|
||||
; Read: controller port 2
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
APUSTATUS = $4015
|
||||
APUFRAMECOUNTER = $4017
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; Controller masks
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
PAD_RIGHT = $01
|
||||
PAD_LEFT = $02
|
||||
PAD_DOWN = $04
|
||||
PAD_UP = $08
|
||||
PAD_START = $10
|
||||
PAD_SELECT = $20
|
||||
PAD_B = $40
|
||||
PAD_A = $80
|
||||
|
||||
PAD_HORIZONTAL = PAD_LEFT | PAD_RIGHT
|
||||
PAD_VERTICAL = PAD_UP | PAD_DOWN
|
||||
PAD_DPAD = PAD_HORIZONTAL | PAD_VERTICAL
|
||||
Reference in new issue
Block a user