# Quirks (U) and contradictions between sources (C) Each entry says what it is, the evidence, and the tier of that evidence ([validation.md](validation.md) defines them): **manufacturer** is NEC's data sheets (DS 1997, DB 1992, as in [start-here.md](start-here.md)); **research** is fullsnes and byuu's write-ups; **program** is what the seven shipped programs require to make sense (they were written for, and sold on, the real chips: a strong hint, never a measurement); **emulator** is ares, MAME, Mesen2 or the snes9x HLE code. Remember that **ares and MAME are one lineage** (byuu's core, also bsnes's), so their agreement counts once; Mesen2 is the only independent emulator. **A low tier detects and never judges.** No hardware capture of this chip exists (validation.md), so nothing here is closed by a console result. **Sources marked †** (2026-11-19): Mesen2 (GPL-3), snes9x and bsnes's HLE code were read from source under the old rule (before 2026-11-19). They are closed boxes from now on: their source is not opened again, and no default rests on them. byuu's model is cited through ares (ISC, NOTICE) and MAME's `upd7725.cpp` (BSD-3-Clause), at the pinned revisions; bsnes (GPL-3) is a closed box. ## Quirks (U) | # | Quirk | Evidence | Tier | | --- | --- | --- | --- | | U1 | **One instruction, several operations, in a fixed order**: the product of the previous K and L is in M/N; SRC drives IDB; the ALU reads P (RAM[DP], IDB, M, N) and the selected accumulator; the move writes DST; DP and RP change; RT pops. "Pointer modifications occur at the end of the instruction cycle after their values have been used for data moves"; "If a return is specified as part of an OP instruction, it is executed last"; the new DPL, DPH and RP "become valid from the next instruction" | DB p.9; DS p.16, p.26; every emulator's `execOP` | manufacturer, emulator | | U2 | **A move to DP cancels DPL/DPHM; a move to RP cancels RPDEC** in the same instruction | ares `instructions.cpp` l.137, l.146 (`if(dst != 4)`, `if(dst != 5)`); MAME l.462, l.472; Mesen2 †. Not in any document. No shipped program combines them (survey: 0) | emulator; harmless | | U3 | **The multiplier runs every instruction**: M = sign and upper 15 bits of K x L (signed), N = the lower 15 bits shifted left (bit 0 = 0); a new K or L shows in M/N from the next instruction. `-8000h x -8000h`: fullsnes "Result on overflows ... is unknown"; the emulators compute `40000000h`, so M = `8000h`, N = 0 | DS (9); DB p.6; fullsnes "Multiplier"; ares `instructions.cpp` l.10-12 | manufacturer; the overflow case emulator, *undecidable here* | | U4 | **SGN** = `8000h` if SA1 = 0, `7FFFh` if SA1 = 1, whatever ASL selects | DS (16); DB p.6 ("not affected by arithmetic operations on accumulator B"); ares `instructions.cpp` l.34 (`0x8000 - flags.a.s1`, "ASL ignored; always SA1") | manufacturer, emulator | | U5 | **@KLM** loads K from RAM at DP with bit 6 forced to 1 (`DP | 40h`; DP7 kept); **@KLR** loads L from RO (ROM[RP]). Both load the other register from IDB | DS DST notes 3-4 ("RAM (DP7, '1', DP5, DP4, DP3, DP2, DP1, and DP0)"); DB note 4 lists only 7 bits (the 7720's 128-word RAM); ares `instructions.cpp` l.234-235 | manufacturer | | U6 | **DPINC/DPDEC wrap inside DP bits 3-0** (no carry into DPH); DPCLR clears them; DPHM XORs DP bits 7-4. On the uPD96050 (11-bit DP) DPHM still touches bits 7-4 only | DS (5), section 3.1 (4)-(5); fullsnes "DPL"/"DPH"; all emulators. The uPD96050 part: emulator and research only (no NEC document) | manufacturer; uPD96050 emulator | | U7 | **The host port**: A0 = 0 DR, A0 = 1 SR (bits 15-8 only, read-only to the host); in 16-bit mode low byte then high byte, DRS = 1 between them, RQM cleared by the second; in 8-bit mode each access is DR bits 7-0 and clears RQM. The DSP's `MOV x,DR` and `MOV @DR,x`/`LD @DR` set RQM; `DRNF` (SRC 9) does not | DS (17)(g)(i), (19), (20) table, SRC note 2; fullsnes "RQM"; ares `memory.cpp` l.8-42; MAME `data_r`/`data_w`; Mesen2 † | manufacturer, emulator | | U8 | **`@SR` writes keep RQM, DRS and bits 6-2**: the program changes USF1-0, DMA, DRC, SOC, SIC, EI, P1-0 only (mask `907Ch` kept) | DB p.7 ("The RQM and DRS bits can only be affected by parallel data moves"); DS (17) bits 6-2 read 0; ares `instructions.cpp` l.230, MAME l.557, Mesen2 † | manufacturer, emulator | | U9 | **Register widths**: uPD7725 PC 11, RP 10, DP 8 bits; uPD96050 PC 14, RP 11, DP 11 bits. RPDEC from 0 gives `3FFh` (`7FFh`) | DS (7) ("a 10-bit register ... connected to the lower 10 bits of the internal data bus"), "Comparison" table (RP 10 bits); fullsnes "Registers"; ares `upd96050.cpp` l.11-22 (`power()`, `resize()`). The emulators that do not mask: C9 | manufacturer; uPD96050 research | | U10 | **The stack** is 4 x 11 bits on the uPD7725 (8 x 14 on the uPD96050, fullsnes). What a fifth CALL or an RT on an empty stack does is undocumented (a 2-bit pointer would wrap; no source says) | DS (3), "Comparison" table; DB p.6; fullsnes; C5 | manufacturer; overflow *undecidable here* | | U11 | **uPD96050 jumps**: JP bits 1-0 are NA bits 12-11; conditional jumps keep PC bit 13; `JMP`/`CALL` clear it, `HJMP`/`HCALL` set it; `JMPSO` loads PC from SO | fullsnes "JP Instructions" ("(*) Opcodes 000h,101h,141h supported on ST010/ST011 only"); ares `instructions.cpp` l.156-216; the ST011 program uses 227 HJMP, 1,000 HCALL, 23 JMPSO and 2,848 JPs with bank bits | research, emulator, program | | U12 | **ALU code 0 (NOP) leaves both flag sets alone**; an ALU op changes only the selected accumulator's flags | DS flag table p.25 ("Retains the previous state" for NOP and for the non-selected flags); ares `instructions.cpp` l.45 (`if(alu)`) | manufacturer | | U13 | **The "prohibited" combinations are used by the shipped programs**, so the core must define them: P = RAM with DST = @MEM in an ALU op (DSP-1 9, DSP-2 36, DSP-3 33, DSP-4 33, ST010 4, ST011 94 words; only 1 in DSP-1 and 6 in DSP-4 are binary ops that read P, C14); @KLR/@KLM with SRC = K or L (DSP-1 2 words, C15); SRC = DST: none. The Pilotwings window executed the DSP-1's binary P=RAM/@MEM word and both @KLM-from-K/L words | DS p.22 "Remark: Following combination are prohibited"; survey; trace coverage | manufacturer (the prohibition), program (the use) | | U14 | **SBB, ADC and SHL1 take the carry of the other accumulator** | DS flag table ("Nonselected FLAG ... C: Affects the result"); fullsnes "OtherCy"; all emulators | manufacturer | | U15 | **SRC 0 ("NON") puts TRB on the bus** | DS SRC note 1 ("The contents of the TRB register are also output if NON is specified"); all emulators | manufacturer | | U16 | **The serial port is not wired on SNES cartridges**; the ST011 uses SO only as a computed-jump register (`MOV @SOL, RO` then `JMPSO`, 19 times; plus 60 `LD @SOL`) | fullsnes; survey; C4 | research, program | | U17 | **P0/P1**: SR bits 1-0 drive two output pins. The DSP-1 writes SR = `0001h` (P0 = 1) and the DSP-2 `1130h`; whether the cartridge connects P0/P1 to anything is unknown | DS (17)(a), (18); survey (`LD @SR` values); no SNES source mentions the pins | manufacturer; wiring *unknown* | | U18 | **Power-on state**: the DS requires a reset after power-on and leaves every register not named in U-reset (C6) and the data RAM "not changed", i.e. undefined at power-on. ares and MAME zero everything (ares `upd96050.cpp` l.11-46); Mesen2 † fills RAM and stack with its RAM-initialisation setting | DS p.55, NEC's general note on CMOS devices ("Reset operation must be executed immediately after power-on for devices having reset function"), (25); emulators | manufacturer; values *undecidable here* | | U19 | **RQM latency**: after the host's access that clears RQM, "The RQM flag is recognized as '0' from this instruction", one instruction after the instruction during which it fell; setting RQM by a DR move shows in the same instruction's chart | DS p.36-37; DB p.19-22 (timing charts) | manufacturer (charts); C13 | | U20 | **A DSP move to or from DR does not touch DRS**: if the host has done half a 16-bit transfer, the next half completes it whatever the program did in between | every emulator (none writes DRS outside the host path); not in any document | emulator; *undecidable here* | | U21 | **uPD96050 data RAM on the SNES bus**: 2 K words seen as 4 KB, even byte = low half, odd = high half, at `$68-$6F:0000-$0FFF` (MAME mirrors it to `$7FFF`); battery-backed | fullsnes "SNES I/O Ports"; MAME `dataram_r/w`; Mesen2 †; the board decodes; the core exposes words | research, emulator | ## Contradictions (C) | # | The disagreement | Sources and tiers | Resolution proposed | | --- | --- | --- | --- | | C1 | **Carry of SUB/ADD/SBB/ADC/DEC/INC**. MAME computes `C = r < q` (add) and `C = r > q` (subtract) (`upd7725.cpp` l.433, l.437: byuu's original rule), which is wrong when the carry-in makes P + C wrap: `ADC` with P = `FFFFh` and C = 1 gives r = q and C = 0, where the true carry is 1 (likewise `SBB`). ares (`instructions.cpp` l.105-109: `carries = q ^ p ^ r; overflow = ...; c = (carries ^ overflow) & 8000h`) and Mesen2 † take the bit-15 carry out of the chain | DS (14)(a) "carry or borrow resulting from the executed operation" [manufacturer: the arithmetic definition]; ares, Mesen2 † [emulator, two lineages] vs MAME [emulator, byuu's original]. The DSP-1 has 15 ADC and 7 SBB words; whether any operand reaches the case is not known statically | **The carry chain** (DS meaning; ares). The MAME replay names a divergence at an ADC/SBB with P + C = `10000h` as C1, not a core fault | | C2 | **How S1 and OV1 change.** Emulators (ares l.80-82, l.108; MAME; Mesen2 † alike): every ALU op first sets S1 = S0 if OV1 was 0; then for SUB..INC `OV1 = (OV0 and OV1_old) ? (S0 == S1) : (OV0 or OV1_old)`; logic ops and shifts clear OV1. fullsnes: on an overflow S1 = sign and OV1 toggles, otherwise both stay; logic ops "actually" set S1 = sign ("required for loopings in Super Air Diver 2"). DS: OV1 = odd number of overflows in the last three operations; S1 = the direction of the overflow; S1 undefined (X) after logic ops | DS (14)(e)(f), flag table [manufacturer, intent only]; fullsnes [research]; emulators [one formula, all four]. They differ: after an arithmetic op without overflow (emulators move S1 when OV1 = 0; fullsnes keeps it), after two overflows (fullsnes always clears OV1; the emulators keep it when both went the same way, which matches fullsnes' own "doesn't work if two overflows occur in same direction"), and after a logic op with OV1 = 1. Only SGN reads S1 in the programs (DSP-1 twice; no program uses the OV1/S1 jumps) | **The emulators' formula** by default (it is what every game was tested on, and the DSP-1's SGN uses are reached by it), with fullsnes' rule behind a switch for the command-level comparisons (validation.md rung 5). *Undecidable here* without a console | | C3 | **An ALU op whose accumulator is also the move's destination.** DB p.9: "the ALU operation becomes a NOP, as the data move supersedes the ALU operation". Emulators: the ALU runs and sets the flags, then the move overwrites the accumulator. The difference is the flags. The DSP-4 has two such words (`09Ch` and `465h`: `SHL2 A, RAM` with `MOV @A, MEM`) and two instructions later `SHL1 B` shifts in **flag A's carry**: SHL2's only effect that survives is C = 0, so the programmer wrote it to clear CA | DB p.9 [manufacturer; the 1997 DS dropped the sentence]; emulators [one model]; the DSP-4's code [program] | **The emulators' model** (flags from the ALU, accumulator from the move), on the program evidence: an instruction whose only purpose is its flag effect argues that the "NOP" is the value, not the flags. Record it in the handler's comment; Top Gear 3000 is the only judge | | C4 | **Bit order of `@SOL` and `SIL`.** MAME stores `@SOL` and reads `SIL` bit-reversed (`bitswap<16>`, l.373, l.561), modelling the shift direction; ares (`instructions.cpp` l.38-39, l.231-232) and Mesen2 † store them as they are. `JMPSO` loads PC from SO. The ST011's jump tables (`MOV @SOL, RO; JMPSO` with RP at data ROM `015Ah`, `0191h`, `01C6h`, ...) hold plain addresses: 33 of 36 entries in three tables land right after a JP or RT as stored, 1 of 36 bit-reversed | DS SRC/DST notes 3-4 describe the order bits leave and enter the pins, not a reversed register [manufacturer]; the ST011 program [program]; MAME vs the rest [emulator] | **No reversal**: SO holds the value written; MAME's ST011 jumps through SO go wrong. Serial order is moot on the SNES (U16) | | C5 | **Stack depth**: DS 4 levels (uPD7725), fullsnes 8 (uPD96050); Mesen2 † 4 and 8; ares (`upd96050.hpp` l.105, l.109) and MAME 16 for both (a 4-bit pointer) | DS (3) [manufacturer]; fullsnes [research]; emulators | **4 and 8**, as documented; record the deepest nesting each MAME replay reaches; overflow behaviour U10 | | C6 | **Reset and power-on values.** DS and fullsnes: reset sets PC, FLAGA, FLAGB, SR = 0 and **RP = 3FFh**, leaves the rest. ares `power()` (`upd96050.cpp` l.11-46): everything 0 (RP = 0). MAME: `device_start` zeroes RP, DP, K, L, M, N, A, B, TR, TRB, DR, SI, SO; `device_reset` sets only PC, SR, flags (RP stays). Mesen2 †: whole state 0 | DS (25) [manufacturer]; fullsnes [research]; emulators | **The DS**: `reset()` does exactly that list; power-on values are a constructor argument defaulting to zero. The MAME replay starts the core with MAME's power-on values (RP = 0) | | C7 | **Interrupt entry.** DB p.6 and the DS chart: EI is cleared on entry; one NOP, then the instruction at `100h`. fullsnes: "the interrupts are NOT automatically disabled". MAME: clears EI, executes a NOP and then `LCALL 100h` as a separate instruction cycle (one slot more than the chart) | DB p.6, DS p.40 [manufacturer]; fullsnes [research]; MAME [emulator]. Unused on the SNES: no program sets EI, no cartridge drives INT | **The DS** if the input is kept at all (open decision 6) | | C8 | **`JMPSO`, `HJMP`, `HCALL` on the uPD7725**: fullsnes says uPD96050 only; every emulator executes them on both chips (ares masks PC to 11 bits, `upd96050.cpp` l.13) | fullsnes [research]; emulators. No DSP-n program uses them | Execute them as the emulators do, PC masked to the chip's width; moot for the shipped programs | | C9 | **Visible register widths in the emulators.** ares masks PC, RP, DP to the chip's widths (U9). MAME keeps 16-bit RP and DP, masks only when it reads memory, and indexes RAM with `DP & 7FFh` on both chips (2,048 words on the uPD7725). Mesen2 † keeps 16-bit DP and RP and masks reads (256-word RAM on the uPD7725). The difference shows when a program moves DP or RP to the bus (DSP-1: SRC = RP 17, SRC = DP 5 words) after RPDEC below 0 or an `LD @DP` above `FFh` | DS (5), (7) [manufacturer]; emulators | **The DS widths**. A MAME replay divergence in RP after an RPDEC from 0, or in DP above `FFh`, is C9 | | C10 | **Clock rates**: DSPn 7.6 MHz (fullsnes, ares, Mesen2 †) vs 8 MHz (MAME); ST010 11 MHz (fullsnes: 22 MHz crystal halved; ares, Mesen2 †) vs 10 MHz (MAME); ST011 15 MHz (fullsnes, MAME) vs 22 MHz (Mesen2 †) vs 11 MHz (ares default without a database entry, `load.cpp` l.420-424) | fullsnes oscillator list [research: read off the parts]; emulators | **fullsnes' crystals** (7.6, 11, 15 MHz): the board's setting, not the core's | | C11 | **SR's DRS bit in 8-bit mode**: ares reports DRS = 0 whenever DRC = 1 (`upd96050.hpp` l.63, `_drs = drs & !drc`); MAME and Mesen2 † report the stored bit | emulators only; the DS defines DRS for DRC = 0 only | Report the stored bit masked as ares does; it can only differ after a mode switch mid-transfer, which no program does knowingly | | C12 | **`JSIAK`/`JSOAK` conditions**: ares (`instructions.cpp` l.201-205) and MAME test the serial acknowledge latches (always 0 here); Mesen2 † tests SR's SIC/SOC bits | emulators | The latches (DS: SI ACK, SO ACK); no program uses these jumps | | C13 | **When the DSP sees the host's access**: the DS charts show one instruction of latency (U19); the emulators none beyond scheduling; MAME's stamps say "after instruction N, seen by N + 1" | DS p.36 [manufacturer]; emulators | A board concern: the core applies an access between two instructions; the board may delay it by one instruction to follow the chart. Decision 5 | | C14 | **P = RAM with DST = @MEM** (prohibited, used; U13): the emulators read P from RAM before the move writes it (old value). The DB's order ("data moves from source to destination before other elements") could mean the ALU sees the new value. Only binary ops read P: 1 DSP-1 word (executed in the Pilotwings window), 6 DSP-4 words | DB p.9, DS p.22 [manufacturer: prohibited, so undefined]; emulators [one model, Mesen2 † agrees] | **Old value** (the emulators). MAME cannot tell the two apart; the HLE command results can (rung 5) | | C15 | **@KLR/@KLM with SRC = K or L** (prohibited, DSP-1 uses 2, both executed): the emulators read SRC first, so `MOV @KLM, L` sets L = old L and K = RAM[DP | 40h] | DS p.22 [manufacturer: prohibited]; emulators | **The emulators' order** (read, then write) | | C16 | **DPINC/DPDEC/DPCLR on the uPD96050's 11-bit DP.** ares (`instructions.cpp` l.137-144), MAME and Mesen2 † rebuild DP as `(DP & F0h) + low nibble`, which clears DP bits 10-8 whenever DPL is not DPNOP (code written for the 8-bit DP and kept); DPNOP and DPHM keep them. fullsnes: DPL adjusts "DP.3-0" | fullsnes [research]; ares, MAME, Mesen2 † [two lineages, but plainly inherited 8-bit code]; no NEC document for the uPD96050. Found by the build session (2026-11-05); the uPD7725 cannot tell the rules apart | **DP bits 3-0 only** (fullsnes; the DS's field meaning), the emulators' rule behind `DPL_CLEARS_DP_BITS_10_8`. No replay window (ST010 2.0 M, ST011 1.5 M traced instructions; 170 M + 163 M replayed) produced a C16 difference: the programs never apply DPL with DP above FFh there. *Undecidable here* | ## What the build session measured (2026-11-05, rung 4) - **C1 is reached by real code but never seen.** The default core's carry differed from MAME's at an SBB/ADC with P + carry = 10000h 168 times in the Pilotwings window (`03C7 SBB ACCA,RAM`), 122 times in Exhaust Heat II's (`00D7 SBB ACCB,RAM`, 795 in 20 s), once in Top Gear 3000's (`00FA ADC ACCB,M`, 1,259 in 120 s). A core with the carry chain and MAME's other switches still matched every traced register and every host read in all three (`replay.py` run with only C1 flipped): the differing carry is always overwritten before a branch, SHL1 or ADC/SBB reads it. MAME cannot decide C1; the HLE comparison (rung 3) might. - **C4 is real in MAME's ST011 run**: the command dispatch `MOV @SOL,RO; JMPSO` (0012h) sends MAME to 3800h (the reversed 001Ch, whose plain value is the CALL table entry); the default core jumps to 001Ch. Morita Shougi does not work in MAME for this and the next reason (mame-oracle.md trap 11). - **C5**: the deepest CALL nesting in every game window was 1-3 (Pilotwings 2, Super Mario Kart 2, Top Gear 3000 2-3, the rest 1); only MAME's C4-misdirected ST011 path nested 15 deep. **U10**: that path also executed RT on an empty stack twice, popping MAME's uninitialised `stack[15]` (3Eh): U18 power-on memory, recorded by the replay. - **C9**: MAME's RP went below 0 in the ST010 window (FFFEh where the core holds 7FEh, 49,597 traced instructions) and its PC and DP above the chip's width on the ST011's misdirected path; the replay counts these as width-only. - **C3, C6, C11, C14, C15**: no difference in any window (C6 by construction: the replay starts both cores from MAME's power-on zeros, without a reset). ## What would close them Nothing in this list can be closed by a console probe ROM alone: the X5 flash cart has no DSP, and a probe would need a cartridge with a DSP-1 that runs our code (an SD2SNES/FXPak emulates the DSP in its FPGA: emulator tier). The judges that exist are the shipped programs' own results in their games (the DSP-1 Pilotwings demo glitch fixed in the DSP-1B, fullsnes; the games' pictures), and, for C2/C14, the HLE implementations written from hardware probes by Overload and others in 2006 (research). validation.md lists them.