# NES 2.0 mapper 559 — Sangokushi II (Subor) **Status (2026-11-20):** working model in [experiments/diff_mapper.py](experiments/diff_mapper.py), ported to `famicom-python` as `Subor559` (main `f407e00`, pushed; its C88). This dump is Namco's licensed *Sangokushi II - Haou no Tairiku (Japan)* (mapper 19) with 968 bytes patched, and the patches give the register map ([audit.md](audit.md), entry 16). On it the game reaches its title, menu and map screen, within 0-20 differing pixels per frame of the licensed cart on famicom-python (held-out run). The IRQ counter's period is `FITTED` (one scanline, 341/3 CPU cycles); `$9800`, the CHR pairs and the counter's clock source are open. Mesen2 and mame_nes reject the ROM. No hardware capture exists. **Register map** (entry 16; the sections below describe entries 1-15 and are kept as the record): | Address | Job | Evidence | | --- | --- | --- | | `$8000`, `$A000` | PRG at `$8000`, `$A000`, D4-D0 | patch of the 163's `$E000`/`$E800`; `FITTED` | | `$9C00` | PRG at `$C000`; last 8 KiB fixed | patch of `$F000`; `FITTED` | | `$9C0C-$9C0F` | nametables, D0 = CIRAM A10 | patch of `$C000-$D800`; `FITTED` | | `$B000-$EC00` step `$400` | 1 KiB CHR, two addresses per bank | patch of `$8000-$B800`; `FITTED`; pair semantics open | | `$F000`/`$F400` | IRQ latch | the game's `$F6D0`; `FITTED` | | `$F800` | IRQ: 2 start from latch, 0 stop + acknowledge; 8-bit up-count, /IRQ on the wrap, one step per 341/3 CPU cycles | the game's `$F6D0`/`$FB32`; period `FITTED` against the licensed cart | | `$9800` | written 1 at reset; unknown | `HYPOTHESIS`: ignored | The old status, superseded: not implemented; fixed A/C bank sweeps and forced bank orders did not combine the palette and render states. ## Identity | Field | Value | | --- | --- | | ROM | `Sangokushi II - Haou no Tairiku (China) (Ja) (Subor) (Pirate)` | | SHA1 | `72bfd7a27cf6e5963114d16f085f67c226ea5fe4` | | Header | NES 2.0, flags `F2 28 02 00 70` | | Mapper | 559 (`$22F`), submapper 0 | | PRG / CHR | 256 KiB / 256 KiB | | WRAM | 8 KiB battery-backed at `$6000-$7FFF` | | Mirroring | horizontal in the header | | Board | unknown; Subor-branded pirate | Obtain from a No-Intro NES mirror through `NO_INTRO_DIR`; no ROM is stored here. ## Known sources - NESWiki `INES_Mapper_559` / `NES_2.0_Mapper_559`: no page (404 at access). - NESWiki `NES_2.0_Mapper_330`: a bootleg Sangokushi II, a subset of Namco 163; used as the starting hypothesis. - NESWiki `NES_2.0_Mapper_532`: a Chinese translation hack of the same game, UNIF `CHINA_ER_SAN2`, VirtuaNES EX. Shows that this game has emulator-specific translation boards. - MAME's `src/devices/bus/nes/subor.cpp` and `subor.h`: Subor Type 0/1/2; Type 2 has no iNES mapper, registers at `$4F00/$5100`, `$5200` returns `$8F`, CHR RAM and PPU latch. No mapper 559. Those two files carry explicit **BSD-3-Clause** headers; MAME as a whole is GPL-2.0. Only those BSD-3 files were read, for facts; no code copied. This is a sibling reference, not an oracle for this dump; MAME has no mapper 559 and its Subor Type 2 code has open TODOs. See [provenance](../../docs/provenance.md). - No mapper-559 support was available in the black-box detectors we tried. - `famicom-python`: mapper 559 is not implemented; its mapper registry stops the load. MIT; runtime dependency. ## Boot path observed - Reset `$E000`, NMI `$F800`, IRQ `$FB2D`. - Reset: `SEI; CLD`; `$2000 = 1`; `$9800 = 1`; APU `$4010`, `$4015`, `$4017`; PPU off; clear `$0000-$07FF`; `JSR $F3BD`; dispatch through the table at `$E07C` on `$7A`; the first path is `$E09A`; calls `$A000/$A003/$A006/...`. - `$A000` is in **8 KiB PRG bank 13**: `JMP $A3D2`, `RTS` at `$A003`, then game code. The bank calls `$C1AF`, `$D6B6`, `$DEBF` in the `$C000` window. - The boot code writes the mapper at least through `$9C00`, `$9C0C-$9C0F`, `$A000`, `$B000-$D800`, `$E000/$E800/$EC00`, `$F800` and `$5800`. ## Observed register writes | Address | Access | Observation | Source | Evidence | Confidence | | --- | --- | --- | --- | --- | --- | | `$4800/$5800` | write | `$5800 = 0` 10,516 times in the bank13 run; `$4800` 202 times, values `00/30/F0/FF`; static code writes `$4800` | ROM trace (ours) | `OBSERVED` | low | | `$8000-$B800` | write | 1 KiB CHR bank values: `$22`, `$35`, `$3E`, `$38`, `$FD`, `$F7`, `$E0`, `$E1` | ROM trace (ours); NESdev 330 (PD) | `OBSERVED`; semantics `HYPOTHESIS` | low | | `$9C00`, `$9C0C-$9C0F` | write | extra CHR bank values, including `$E0/$E1`; mapper 330's `$FC00` mask ignores these | ROM trace (ours) | `OBSERVED` | low | | `$C000-$D800` | write | `0` in the boot pass; mapper 330 maps these to CIRAM A10 | ROM trace (ours); NESdev 330 (PD) | `OBSERVED`/`DOC` | low | | `$E000/$E800/$EC00` | write | `0` in the boot pass; mapper 330 maps these to PRG banks | ROM trace (ours); NESdev 330 (PD) | `OBSERVED`/`FITTED` | low | | `$F800` | write | `0` 21,031 times in the bank13 run, `2` in the NMI handler | ROM trace (ours) | `OBSERVED` | low | | `$6Fxx` | write | game state/battery RAM; 8 KiB present and writable | ROM trace (ours); header (NES 2.0) | `OBSERVED`/`DOC` | high | | `$2000-$2007` | write | heavy `$2007` uploads; PPU mask remains `$00` in all experiments | ROM trace (ours) | `OBSERVED` | high | `$8000-$B800` is not yet proven to be the whole CHR map: the `$9C00-$9C0F` writes suggest a wider or differently decoded register file, and the bank values have not been tied to specific PPU windows. ## Current implementation state No mapper 559 class exists in `famicom-python`. The experiments here monkey-patch a subclass of the mapper-330 class: - First mapping: bank 13 at `$A000`, bank 0 at `$C000` → CPU leaves ROM to `$4010`, PPU mask `$00`; the IRQ handler at `$FB2D` repeats and returns into data at `$A029`. - Bank 13 at both `$A000` and `$C000`, PRG writes ignored, `$F800/$5800` treated as IRQ ack → gets past the immediate crash; CPU still ends in RAM/IRQ, PPU mask `$00`. At 600 frames the PC is `$FB3A`; an earlier sample was `$11F4`. The write summary counts `$F800` 21,031 times and `$5800` 10,516 times over 600 frames, so most of the time is spent in the IRQ/BRK handler. - Bank 30 at `$C000` → CPU executes data at `$DC8F`. - Bank 13 in all three windows → CPU at `$074E` (RAM), PPU mask `$00`. The furthest checkpoint is in [experiments/partial_mapper.py](experiments/partial_mapper.py). It is not a solution. The first mapping is reproducible with `MAPPER559_VARIANT=first`; it ends at PC `$4010`, mask `$00`. ## Source coverage | Source | Licence | What it covers | Used? | | --- | --- | --- | --- | | NESdev `NES_2.0_Mapper_559` | public domain | absent (404) | **gap** | | NESdev `NES_2.0_Mapper_330/532` | public domain | family context, translation-board warning | yes; documentation oracle | | MAME `subor.cpp/h` | BSD-3-Clause files (MAME as a whole GPL-2.0) | Subor Type 0/1/2 sibling; no mapper 559 | yes, as BSD facts; not an oracle | | mame_nes 2.0 | GPL-2.0 MAME fork, external black box | used for 235; 559 not tested | no claim | | Mesen2 / puNES | GPL-2.0/3.0, black boxes | incident only; no source use | no claim | | our ROM trace | ours | boot path, register writes, crash maps | yes | | hardware / test ROM | — | none | **missing** | ## Coverage summary `partial DOC (sibling pages) + BSD sibling + FITTED`. There is no mapper-559 page, no hardware and no black-box implementation that plays it. The register addresses are observed; the bank/IRQ/CHR semantics are fitted or open. MAME is a sibling reference, not a judge. ## Claim ledger | Claim | Value | Source + licence | Evidence | Confidence | Falsifier or test | | --- | --- | --- | --- | --- | --- | | Header and hash | NES 2.0 mapper 559, 256 KiB PRG/CHR, SHA1 `72bfd7a...` | ROM file and No-Intro metadata | `OBSERVED` | high | rehash a second dump | | Reset/NMI/IRQ | `$E000` / `$F800` / `$FB2D` | our ROM trace | `OBSERVED` | high | disassemble/step | | $A000 utility code | 8 KiB PRG bank 13 | our ROM trace | `OBSERVED`/`FITTED` | medium | trace a call from bank 13 | | Register writes | addresses/values listed above | our ROM trace | `OBSERVED` | low | decode against a synthetic test | | MAME Subor sibling | Type 0/1/2 facts | MAME BSD-3 files | `DOC`/BSD | low | not an oracle; verify on the ROM | | PRG/IRQ/CHR semantics | unknown | — | `HYPOTHESIS` | low | next experiments in `STATUS.md` | | NESdev page | absent | NESdev (PD) | `DOC` | high | watch for a new page | ## Open questions 1. Which addresses select the `$8000/$A000/$C000` PRG windows, and is bank 13 fixed at `$A000` or also switchable? 2. Does `$E000/$E800/$EC00` really control PRG windows, or are those writes for another register file? The game writing `0` to all of them at boot is suspicious. 3. What is the IRQ source, and what clears it: `$F800`, `$5800`, or the Namco-163 counter at `$A400`? 4. What do `$9C00` and `$9C0C-$9C0F` select? Why are the writes not aligned to the mapper-330 `$800` grid? 5. Is this a physical Subor board or a VirtuaNES EX translation board like mapper 532? No hardware or board photo exists. 6. Why does the PPU never enable, even after the bank-13 mapping? Is the game blocked on an IRQ/audio handshake, or on a bank it cannot see? 7. What is the correct CHR mapping? The 256 KiB CHR file and the values written do not yet line up. 8. Can a second dump, a hardware owner, or a MAME/VirtuaNES EX run settle anything? ## Evidence index - [audit.md](audit.md) — the full investigation, including failed mappings. - [roms.json](roms.json) — identity and hashes. - `evidence/blank-600f.png` (local only, gitignored) — the first mapping: no rendering, mask `$00`. - `evidence/first-600f.png` (local only, gitignored) and [evidence/first-summary.txt](evidence/first-summary.txt) — the first mapping at 600 frames and its write summary. - `evidence/bank13-600f.png` (local only, gitignored) and [evidence/bank13-summary.txt](evidence/bank13-summary.txt) — the bank-13 checkpoint and its write summary. - [evidence/first-writes.txt](evidence/first-writes.txt), [evidence/bank13-writes.txt](evidence/bank13-writes.txt) — the first 120 writes from each trace. - [experiments/](experiments/) — the partial mapper variants and how to run them. ## What this does not claim That mapper 559 is understood or supported; that the board is physically a mapper-330 sibling; that the `$9C00-$9C0F` writes are CHR banks; that the boot failure is only a mapper issue. The current state is `OBSERVED`/`FITTED`, with no `MEASURED` or `TEST ROM` evidence.