Pass 2 _wip: Slalom (U), Kung Fu (U), Othello (U) label replacement complete
Pass 3 _wip: Slalom (U), Kung Fu (U), Othello (U) semantic naming complete Pass 3 _wip: apply symbols (0 residue) for Slalom (U), Kung Fu (U), Othello (U) Pass 2/3 _wip: 10 NROM projects (Elevator Action, 1942, Tag Team Wrestling, Galaga, Kung Fu a1, Stack-Up, Magmax, Ms Pac-Man Namco, Soccer, Sqoon) Promote 13 _wip/NROM projects to NROM/ (Slalom, Kung Fu, Othello, Elevator Action, 1942, Tag Team Wrestling, Galaga, Kung Fu a1, Stack-Up, Magmax, Ms Pac-Man Namco, Soccer, Sqoon) Pass 2/3 _wip: 5 CNROM games (Tiger-Heli, Paperboy, Last Starfighter, Mighty Bomb Jack, Kung-Fu Heroes) Docs: document CDL capture + re-trace workflow in TODO.md Adds more code for - Elevator Action (U) - Kung Fu (U) - Othello (U) - Slalom (U) - Sqoon (U)
This commit is contained in:
1 parent
f8d62601e5
commit
0a49ee6da7
228 files changed
+101961
-37231
No files matched your search
@@ -0,0 +1,25 @@
|
||||
CA65 ?= ca65
|
||||
LD65 ?= ld65
|
||||
|
||||
all: reconstructed.nes verify
|
||||
|
||||
prg.o: prg.s symbols.inc locals.inc prg.bin
|
||||
$(CA65) -g -o $@ $<
|
||||
|
||||
header.o: header.s header.bin
|
||||
$(CA65) -g -o $@ $<
|
||||
|
||||
chr.o: chr.s chr.bin
|
||||
$(CA65) -g -o $@ $<
|
||||
|
||||
reconstructed.nes: header.o prg.o chr.o linker.cfg
|
||||
$(LD65) -C linker.cfg -m reconstructed.map -Ln reconstructed.lbl -o $@ header.o prg.o chr.o
|
||||
|
||||
verify: reconstructed.nes rom.nes
|
||||
cmp reconstructed.nes rom.nes
|
||||
@echo "Byte-identical ROM verified."
|
||||
|
||||
clean:
|
||||
rm -f *.o reconstructed.nes reconstructed_prg.bin reconstructed.map reconstructed.lbl
|
||||
|
||||
.PHONY: all verify clean
|
||||
@@ -0,0 +1,67 @@
|
||||
# Tag Team Wrestling (U)
|
||||
|
||||
## Status
|
||||
|
||||
**Pass 3.** All address-derived `Label_XXXX` definitions replaced;
|
||||
every `jsr`/`jmp` operand symbolic; hardware-register operands resolved
|
||||
via `apply_symbols.py` (0 residue); audit comments aligned; `make`
|
||||
stays byte-identical.
|
||||
|
||||
`make` assembles `header.s`, `prg.s`, `chr.s`, links them with `ld65` and compares the
|
||||
result against `rom.nes`:
|
||||
|
||||
```
|
||||
Byte-identical ROM verified.
|
||||
```
|
||||
|
||||
## ROM
|
||||
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| Format | iNES |
|
||||
| Mapper | 0 |
|
||||
| Board | NROM-256 |
|
||||
| Mirroring | Horizontal |
|
||||
| Four-screen VRAM | no |
|
||||
| Battery | no |
|
||||
| PRG | 32 KB (2 x 16 KB), mapped at CPU $8000-$FFFF |
|
||||
| CHR | 8 KB (1 x 8 KB) |
|
||||
| Trainer | none |
|
||||
| Footer | none |
|
||||
| NMI vector | $FFCD |
|
||||
| RESET vector | $FD43 |
|
||||
| IRQ vector | $FD43 |
|
||||
| ROM file | `Tag Team Wrestling (U).nes` |
|
||||
| SHA-256 | `a2df0fc3948a91ef637f804fb793f92ca0a3e510c6ae72d9f9c4738b6194aa5a` |
|
||||
|
||||
### Header notes
|
||||
|
||||
- none
|
||||
|
||||
## Open work
|
||||
|
||||
- **Pass 1** - run `nesdis.py` over `prg.bin` to produce the code/data
|
||||
split. The tracer reads the vectors from the last six bytes of the PRG
|
||||
image, so the split seeds correctly.
|
||||
- **Pass 1** must emit the canonical audit comment
|
||||
`; CPU:$C123 PRG:0123 AD 21 03` at column 35 for every instruction.
|
||||
- **Pass 2** - replace the address-derived `Label_XXXX` names and the raw
|
||||
`$XXXX` call operands.
|
||||
- **Pass 3** - semantic zero-page aliases (applied only at the sites where
|
||||
their role is proven) and named data tables.
|
||||
- **Promotion** to `NROM/<name>/` once Pass 3 is done, as `git mv`.
|
||||
|
||||
## Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `prg.s` | Pass 0 PRG include (replaced by the Pass 1 disassembly) |
|
||||
| `header.s` | iNES header include |
|
||||
| `chr.s` | CHR include |
|
||||
| `prg.bin` | 32768 bytes (32 KB) PRG image |
|
||||
| `chr.bin` | 8192 bytes (8 KB) CHR image |
|
||||
| `rom.nes` | byte-identical copy of the original ROM |
|
||||
| `linker.cfg` | HEADER / PRG / CHR memory areas |
|
||||
| `symbols.inc` | NES hardware register names |
|
||||
| `locals.inc` | zero-page aliases (empty at Pass 0) |
|
||||
| `Makefile` | build and byte-identity check |
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
.segment "CHR"
|
||||
.incbin "chr.bin"
|
||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
.segment "HEADER"
|
||||
.incbin "header.bin"
|
||||
@@ -0,0 +1,124 @@
|
||||
FD43 Reset
|
||||
FFCD NmiHandler
|
||||
|
||||
# ---- derived internal branch-target names ----
|
||||
9BF0 Sub_9BF0
|
||||
9BF3 Sub_9BF3
|
||||
9BF9 Sub_9BF9
|
||||
9BFD Sub_OnNonzero
|
||||
9C05 Sub_OnNonnegative
|
||||
9C1A Sub_9C1A
|
||||
9C2E Sub_Loop
|
||||
9C39 Sub_Loop2
|
||||
9C3A Sub_9C3A
|
||||
9C48 Sub_Loop3
|
||||
9C5E Sub_Loop4
|
||||
9C61 Sub_Loop5
|
||||
9C7F Sub_Loop6
|
||||
9C9A Sub_Loop7
|
||||
9CAF Sub_Loop8
|
||||
9CC4 Sub_Loop9
|
||||
9CCA Sub_9CCA
|
||||
9CD3 Sub_Loop10
|
||||
9CDB Sub_Loop11
|
||||
9CDE Sub_Loop12
|
||||
9CED Sub_Loop13
|
||||
9CFF Sub_Loop14
|
||||
9D10 Sub_Loop15
|
||||
9D16 Sub_Loop16
|
||||
9D29 Sub_Loop17
|
||||
9D3A Sub_Loop18
|
||||
9D40 Sub_Loop19
|
||||
9D53 Sub_Loop20
|
||||
9D5F Sub_Loop21
|
||||
9D6C Sub_Loop22
|
||||
9D71 Sub_Loop23
|
||||
9D8E Sub_Loop24
|
||||
9DA7 Sub_Loop25
|
||||
9DCC Sub_9DCC
|
||||
9DDA Sub_Loop26
|
||||
9DDE Sub_9DDE
|
||||
9DE3 Sub_Loop27
|
||||
9DEB Sub_Loop28
|
||||
9DF1 Sub_Loop29
|
||||
9DF9 Sub_Loop30
|
||||
9E02 Sub_Loop31
|
||||
9E1D Sub_Loop32
|
||||
9E22 Sub_Loop33
|
||||
9E45 Sub_Loop34
|
||||
9E4D Sub_Loop35
|
||||
9E4F Sub_Loop36
|
||||
9E52 Sub_Loop37
|
||||
9E78 Sub_9E78
|
||||
9E86 Sub_Loop38
|
||||
9E91 Sub_Loop39
|
||||
9E93 Sub_Loop40
|
||||
9E9F Sub_Loop41
|
||||
9EAB Sub_Loop42
|
||||
9EB7 Sub_Loop43
|
||||
9EC7 Sub_Loop44
|
||||
9ECB Sub_9ECB
|
||||
9F13 Sub_Loop45
|
||||
9F22 Sub_9F22
|
||||
9F43 Sub_Loop46
|
||||
9F4C Sub_9F4C
|
||||
9F5A Sub_Loop47
|
||||
9F6F Sub_OnCarryClear
|
||||
9F8B Sub_Loop48
|
||||
9FAA Sub_9FAA
|
||||
9FC1 Sub_OnNonnegative2
|
||||
9FCC Sub_OnNonnegative3
|
||||
9FD5 Sub_Loop49
|
||||
9FD9 Sub_Loop50
|
||||
9FEB Sub_9FEB
|
||||
A03F Sub_Loop51
|
||||
A048 Sub_Loop52
|
||||
A05E Sub_Loop53
|
||||
A061 Sub_Loop54
|
||||
A069 Sub_Loop55
|
||||
A06A Sub_Loop56
|
||||
A070 Sub_OnZero
|
||||
A089 Sub_Loop57
|
||||
A0AC Sub_OnNonzero2
|
||||
A0BD Sub_Loop58
|
||||
A0FC Sub_A0FC
|
||||
A116 Sub_Loop59
|
||||
A11F Sub_A11F
|
||||
A129 Sub_OnNonnegative4
|
||||
A35C Sub_A35C
|
||||
A9F1 Sub_A9F1
|
||||
A9F4 Sub_A9F4
|
||||
A9F7 Sub_A9F7
|
||||
AA1D Sub_AA1D
|
||||
AA3C Sub_Loop60
|
||||
AA48 Sub_Loop61
|
||||
AA7C Sub_AA7C
|
||||
BACF Sub_BACF
|
||||
F22F Sub_F22F
|
||||
F238 Sub_Loop62
|
||||
F23F Sub_Loop63
|
||||
F2C4 Sub_F2C4
|
||||
F2CA Sub_Loop64
|
||||
F2D5 Sub_Loop65
|
||||
FD40 Sub_FD40
|
||||
FD43 Reset
|
||||
FD4D Reset_OnNonnegative
|
||||
FD52 Reset_OnNonnegative2
|
||||
FD9C Sub_FD9C
|
||||
FDA4 Sub_FDA4
|
||||
FDB2 Reset_OnNonzero
|
||||
FDB8 Reset_OnNonzero2
|
||||
FDC0 Reset_Loop
|
||||
FDC5 Reset_Loop2
|
||||
FDC8 Reset_OnZero
|
||||
FDE3 Sub_FDE3
|
||||
FDF1 Sub_FDF1
|
||||
FDF5 Reset_OnNonzero3
|
||||
FE0D Sub_FE0D
|
||||
FE17 Reset_OnNonzero4
|
||||
FE1F Reset_Loop3
|
||||
FE28 Reset_Loop4
|
||||
FF53 Sub_FF53
|
||||
FF5A Sub_FF5A
|
||||
FFC4 Sub_FFC4
|
||||
FFCD NmiHandler
|
||||
|
@@ -0,0 +1,10 @@
|
||||
MEMORY {
|
||||
HEADER: start = $0000, size = $0010, fill = yes;
|
||||
PRG: start = $8000, size = $8000, fill = yes;
|
||||
CHR: start = $0000, size = $2000, fill = yes;
|
||||
}
|
||||
SEGMENTS {
|
||||
HEADER: load = HEADER, type = ro;
|
||||
PRG: load = PRG, type = ro;
|
||||
CHR: load = CHR, type = ro;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
; Tag Team Wrestling (U) application-specific RAM aliases - Pass 1
|
||||
; Generated from every direct zero-page operand in reachable code:
|
||||
; ref counts are reads/writes, `where` lists the referencing addresses.
|
||||
; ZpXX names indicate storage with a role not yet unique enough for a behavioral name;
|
||||
; Pass 2 replaces them with names derived from observed usage.
|
||||
|
||||
Zp04 = $04 ; 1 refs; reads=0 writes=1; used at $FD92
|
||||
Zp05 = $05 ; 1 refs; reads=0 writes=1; used at $FD97
|
||||
Zp0C = $0C ; 4 refs; reads=1 writes=3; used at $FD9E, FDC8, FDCE, FFE4
|
||||
Zp0D = $0D ; 1 refs; reads=0 writes=1; used at $FD73
|
||||
Zp0E = $0E ; 1 refs; reads=0 writes=1; used at $FD80
|
||||
Zp0F = $0F ; 2 refs; reads=1 writes=1; used at $FD59, FF5A
|
||||
Zp10 = $10 ; 2 refs; reads=1 writes=1; used at $FD5B, FF5F
|
||||
Zp11 = $11 ; 2 refs; reads=1 writes=1; used at $FFE6
|
||||
Zp12 = $12 ; 3 refs; reads=2 writes=1; used at $F22F, FD8B, FFC4
|
||||
Zp13 = $13 ; 1 refs; reads=0 writes=1; used at $FFC8
|
||||
Zp14 = $14 ; 1 refs; reads=0 writes=1; used at $FFCA
|
||||
Zp22 = $22 ; 1 refs; reads=0 writes=1; used at $F24B
|
||||
Zp23 = $23 ; 1 refs; reads=0 writes=1; used at $F250
|
||||
Zp35 = $35 ; 3 refs; reads=2 writes=1; used at $F2C4, F2C8
|
||||
Zp4F = $4F ; 1 refs; reads=0 writes=1; used at $AA4C
|
||||
Zp50 = $50 ; 1 refs; reads=0 writes=1; used at $AA52
|
||||
Zp73 = $73 ; 2 refs; reads=1 writes=1; used at $AA24, AA56
|
||||
Zp74 = $74 ; 2 refs; reads=1 writes=1; used at $AA2A, AA5A
|
||||
Zp75 = $75 ; 2 refs; reads=1 writes=1; used at $AA30, AA5E
|
||||
Zp76 = $76 ; 2 refs; reads=1 writes=1; used at $AA36, AA62
|
||||
Zp77 = $77 ; 1 refs; reads=0 writes=1; used at $AA46
|
||||
Zp78 = $78 ; 1 refs; reads=0 writes=1; used at $AA66
|
||||
Zp79 = $79 ; 1 refs; reads=0 writes=1; used at $AA68
|
||||
Zp7A = $7A ; 1 refs; reads=0 writes=1; used at $AA72
|
||||
Zp7D = $7D ; 1 refs; reads=0 writes=1; used at $AA3E
|
||||
Zp7E = $7E ; 1 refs; reads=0 writes=1; used at $AA42
|
||||
Zp83 = $83 ; 1 refs; reads=0 writes=1; used at $AA4A
|
||||
Zp84 = $84 ; 1 refs; reads=0 writes=1; used at $AA50
|
||||
Zp8A = $8A ; 2 refs; reads=1 writes=1; used at $F238, F2CC
|
||||
ZpAC = $AC ; 3 refs; reads=2 writes=1; used at $BACF, F242
|
||||
ZpAF = $AF ; 2 refs; reads=1 writes=1; used at $AA74, F2CE
|
||||
ZpB1 = $B1 ; 1 refs; reads=0 writes=1; used at $AA6A
|
||||
ZpB2 = $B2 ; 1 refs; reads=0 writes=1; used at $AA6C
|
||||
ZpB3 = $B3 ; 1 refs; reads=0 writes=1; used at $AA6E
|
||||
ZpB4 = $B4 ; 1 refs; reads=0 writes=1; used at $AA70
|
||||
ZpD0 = $D0 ; 7 refs; reads=4 writes=3; used at $9C22, 9DDE, 9DF6, 9DF9, +3 more
|
||||
ZpD1 = $D1 ; 22 refs; reads=17 writes=5; used at $9E09, 9E12, 9E54, 9E6C, +18 more
|
||||
ZpD2 = $D2 ; 9 refs; reads=4 writes=5; used at $9E0E, 9F62, 9F83, 9F87, +5 more
|
||||
ZpD7 = $D7 ; 4 refs; reads=1 writes=3; used at $A11F, A129, A12E, A361
|
||||
ZpD8 = $D8 ; 2 refs; reads=0 writes=2; used at $A123, A366
|
||||
ZpD9 = $D9 ; 4 refs; reads=2 writes=2; used at $9F25, 9F2C, A02F, A03F
|
||||
ZpDA = $DA ; 4 refs; reads=2 writes=2; used at $9F2A, 9F31, 9F36, 9F3B
|
||||
ZpDC = $DC ; 2 refs; reads=1 writes=1; used at $9E14, 9E16
|
||||
ZpDE = $DE ; 2 refs; reads=1 writes=1; used at $A08B, A0D6
|
||||
ZpDF = $DF ; 7 refs; reads=3 writes=4; used at $A09D, A0AE, A0B8, A0D4, +2 more
|
||||
ZpE0 = $E0 ; 6 refs; reads=3 writes=3; used at $A0A6, A0AC, A0B3, A0E7, +1 more
|
||||
ZpE1 = $E1 ; 3 refs; reads=2 writes=1; used at $9FEB, A0BD, A0EE
|
||||
ZpE2 = $E2 ; 9 refs; reads=7 writes=2; used at $9F6D, 9F78, 9F8B, 9F95, +5 more
|
||||
ZpE3 = $E3 ; 4 refs; reads=2 writes=2; used at $9F6B, 9F90, A003, A0FC
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
# routinemap (seed)
|
||||
FD43 Reset
|
||||
FFCD NmiHandler
|
||||
|
@@ -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