# The CPU: which 6502 is in the ASIC? ## What the sources say | Source | Tier | Says | | --- | --- | --- | | KH ("Gamate Inside", intro) | 3 (bench measurements on real units) | "The CPU is an NCR 65CX02, which is very similar to a stock NMOS 6502. It is *NOT* A 65C02! The 65C02 instructions are missing. Supposidly the bit manipulation instructions are still present but I didn't test them and none of the games appear to use them." Clock: the 4.433 MHz crystal halved, 2.2165 MHz (cart pin 35, phi2, 50 % duty) | | NCR 1985 Microelectronics Data Book, "65CX02 Supercell" (CMOS II standard cell library), book pp. 313-315 | 2 (manufacturer) | the 65CX02 supercell is a full CMOS part: "59 additional OP codes encompassing fourteen new instructions", "210 operational codes", "four more than the NCR65C02" (RMB, SMB, BBR, BBS), up to 3 MHz. Its enhancement table: invalid opcodes are NOPs of fixed length (X2: 2 bytes 2 cycles; X3, XB: 1/1; 44: 2/3; 54, D4, F4: 2/4; 5C: 3/8; DC, FC: 3/4); indexed page crossing re-reads the last instruction byte; `JMP (xxFF)` fixed, one more cycle; RMW is two reads and one write; D cleared by reset and interrupts; valid N/V/Z after decimal arithmetic, one more cycle; BRK then interrupt | | MAME 0.285 `-listxml gamate` | 5 | "MOS Technology 6502" at 2,216,500 Hz (an NMOS model) | | MAME traces (mame-oracle.md) | 5, but the opcodes are the games' and the BIOS's own | 7.46 M instructions over two games and both BIOS sets: **no opcode outside the 151 documented NMOS opcodes** was executed | | The Phase 0 brief | - | "a 65C02-family CPU" | The data book is pinned by w65c02-python (`reference/docs/1985_NCR_Microelectronics_Data_Book.pdf`, SHA-256 `a429263e59668cb1a16448fc35bbf05d5a2a3690d843831a8d48ab918de7bd94`, from bitsavers); this repository cites it and does not fetch a second copy (decision 6). ## C1: data sheet vs bench The supercell's data sheet describes an R65C02-class instruction set; KH, on the Gamate's own chip, says the 65C02 instructions are missing. Both can be true: the supercell was a library cell that a customer's ASIC instantiated, and nothing says a customer could not order it with the new opcodes disabled, or that the Gamate's three ASIC versions (KH) all use the same cell. KH names the part but does not say how he identified it (marking, documentation from EdHunter, or behaviour). The games settle only that the documented NMOS set is enough: the traces show nothing else. What is **not** settled, and matters cycle by cycle (U1, U2): - NMOS vs CMOS **bus behaviour**: the dummy read on indexed page crossing (invalid address vs last instruction byte), RMW (one read two writes vs two reads one write), `JMP (xxFF)`, the extra decimal cycle. A write-twice RMW on an I/O register with side effects (5007 Wdat increments the VRAM address on each write) would show the difference on screen if any game does `INC $5007`-style accesses; none is known. - the **D flag** at reset and interrupt entry (CC65's startup and the BIOS clear it with `CLD` anyway: CC65 `crt0.s`); - what the **undocumented opcodes** do: NMOS undocumented behaviour, or the supercell's fixed-length NOPs, or the bit instructions KH could not rule out. ## The family's rows | Core | Row | Fits | Needs | | --- | --- | --- | --- | | `../6502-python` (`sixfiveohtwo`, pin `81e0eb6`) | `MOS6502`, all 256 NMOS opcodes, bus-cycle exact; `RP2A03` shows the frame carries a second part | KH's "stock NMOS 6502" reading; MAME's model | nothing for the provisional choice. A `Gamate65CX02` row (NMOS opcodes, CMOS bus shapes) only if U1 is answered that way: a variant on the frame, raised on 6502-python | | `../w65c02-python` (pin `fca677f`) | `R65C02` (bit instructions, no `WAI`/`STP`), `G65SC02` (the NCR65C02 is in this row) | the data sheet's 65CX02 (an R65C02-class set) | nothing, if the data sheet wins; a row with the new opcodes disabled would be a new row there | Both cores keep no time and make one callback per cycle; the board keeps time (one callback = one 2.2165 MHz phi2 cycle = two crystal clocks). ## Provisional choice (decision 1) **`MOS6502` from 6502-python**, tagged HYPOTHESIS for bus shapes: it matches KH's bench statement (the only hardware-tier evidence on this machine), MAME's model, and every opcode the software runs. The data sheet is recorded beside it as C1. A probe cartridge (a handful of instructions: `BRA`, `STZ`, `RMB0`, an indexed page cross into 4400, an `INC` on 5007 with VRAM read back) would settle U1-U2 on a unit; queued for the probe batch (Aubrey's "Probe batching", 2026-11-23), not run (no hardware here).