# The CPU cores: 68000s, a 6809, an MCU and the TMS320C25 DSPs Rates below are MAME 0.285 traces (OBSERVED, `scripts/mame_trace.py`, 0.25 emulated seconds each; [mame-oracle.md](mame-oracle.md) has the runs). They say how busy each CPU is in MAME, including spin loops, which an exact interpreter pays for just the same. ## MC68000: [m68000-python](../../m68000-python) Public, v0.1.0, with m68000-rust and m68000-rust-fast. System 21 needs **two** instances (the master and slave of System 2) and, on Winning Run, a **third** (the `gpu` CPU that owns the palette and frame-buffer side), each at 12.288 MHz with its own bus callbacks, interrupts vectored through a C148, and a reset the board holds. Nothing new is expected from the core (as for namcos2-python). | Set | CPU | Instructions/s in MAME | Spins (MAME's folded loops) | | --- | --- | ---: | ---: | | starblad (3D scene, 50 s) | main | 1.04 M | 65 % | | starblad | slave | 0.94 M | 43 % | | winrun (race, 20 s) | main | 0.74 M | 71 % | | winrun | slave | 0.76 M | 100 % (idle loop) | | winrun | gpu | 0.91 M | 91 % | ## MC6809E (sound): [m6809-python](../../m6809-python) Phase 0 only, no core yet (as for namcos1-python and namcos2-python). 2.048 MHz on Winning Run and the C67 boards, 3.072 MHz on Driver's Eyes (OBSERVED: `-listxml`). MAME: 0.50 M instructions/s (starblad), 0.65 M (winrun), 97 % in loops. ## C65 (HD63705Z0, Winning Run) and C68 (M37450, the rest) Exactly System 2's two MCUs, with the same internal firmware images (SHA-1s in [census.md](census.md)). The cores are namcos2-python's proposals: **`m6805-python`** with an HD6305/HD63705 variant, and **`m740-python`** on the 6502 CPU frame (namcos2-python decisions 3 and 4; that repository's [cpu-cores.md](../../namcos2-python/docs/cpu-cores.md) has the documents, pinned there: Hitachi U08, Mitsubishi M37450M2 and Series 740 manuals). This board adds a second user to each, which is what the chip rule asks for before a core is built. MAME: C65 0.145 M instructions/s (winrun), C68 0.53 M (starblad). ## TMS320C25 and Namco C67: a new core, `tms320c25-python` **The chip.** Texas Instruments' second-generation fixed-point DSP (DOC: C2X, the TMS320C2x User's Guide SPRU014C, pinned here): - Harvard architecture: 64K words of program and 64K words of data space, 16-bit words; 544 words of on-chip data RAM (blocks B0 256, B1 256, B2 32), a **4K-word on-chip mask ROM** on the TMS320C25 (C2X 1.2, "Key Features"). - 32-bit ALU and accumulator, a 16 x 16 multiplier with a 32-bit product, single-cycle multiply/accumulate, eight auxiliary registers with their own arithmetic unit, an eight-level hardware stack, a timer, a serial port, repeat and block-move instructions (C2X 1.2). - **One machine cycle is four CLKIN cycles**: 100 ns at the TMS320C25's 40 MHz (C2X 1.2 and 3.6, "The TMS320C25 machine cycle ... consists of four internal cycles (or CLKIN cycles)"). So MAME's 40 MHz is 10 M machine cycles a second and its 24 MHz is 6 M. Most instructions are one machine cycle from internal memory; external fetches, multiple accesses and branches add cycles by the pipeline rules (C2X 3.6, Table 3-5 and the wait-state pages). - Multiprocessing: global data memory allocated by GREG, the HOLD/HOLDA function, the BIO pin and XF flag (C2X 3.10, 3.7.3; the BIO-XF handshake in chapter 5). Which of these the board wires is unknown (U5). **The Namco C67** (`namcoc67`, MAME's description "Namco C67 (TMS320C25)"): its device set holds one 8,192-byte image, exactly the 4K-word mask ROM, so the C67 is a TMS320C25 carrying Namco's code in its on-chip ROM (OBSERVED: `-listxml`; the part identity is HYPOTHESIS, no Namco document). The C71 of System 22 is the same with another image ([namcos22-python](../../namcos22-python/docs/cpu-cores.md)). **What MAME runs, and what it changes.** The C67 boards have five C67s. MAME clocks the master and slaves 1-3 at 24 MHz and **slave 0 at 96 MHz, and slaves 1-3 never execute** (OBSERVED: 0 instructions traced on `dspslave1` at 20 s; `dspslave0` 16.0 M instructions/s in Starblade's 3D scene, above the 6 M a 24 MHz C25 can do). MAME evidently substitutes one fast slave for the four real ones. That makes MAME a weak detector for DSP timing and for how work is shared among the slaves (U4). | Set | DSP | MAME clock | Instructions/s in MAME | Spins | Peak of the real part | | --- | --- | ---: | ---: | ---: | ---: | | winrun (race) | TMS320C25 | 40 MHz | 8.14 M | 11 % | 10 M | | starblad (3D, 50 s) | C67 master | 24 MHz | 3.02 M | 92 % | 6 M | | starblad (3D, 50 s) | C67 slave 0 | 96 MHz | 16.0 M | 47 % | 6 M each, x4 | | starblad (title, 20 s) | C67 slave 0 | 96 MHz | 12.1 M | 71 % | | The 24 MHz and 40 MHz figures are MAME's; community pages give "four TMS320C25 at 24.576 MHz" and "five TMS320C20" for Starblade (Wikipedia, citing nothing): contradiction C1. **Core proposal.** No TMS320C2x core exists in the family (searched 2026-11-26: model2-python fetched the C2X guide only to refute a claim, its geometry DSPs are Fujitsu parts). The CPU rule gives the DSP its own repository: **`tms320c25-python`** (package `tms320c25_python`), with the TMS320C25 as the one variant needed, its mask ROM supplied by the board (the C67 or C71 image, or RAM on Winning Run). Users: this board (Winning Run x1, C67 boards x5), namcos22-python (C71 x2), and in MAME also Galaxian 3 and Taito's Air System (`taitoair.cpp`, 5 sets): MAME `-listxml` counts 57 machines with a TMS320C25. Its documents are tier 2 and complete for an instruction-level and cycle-level model (C2X has the pipeline and timing); its Phase 0 would pin C2X and the 1986 reference card (also pinned here) and look for TI's test material. Decision 3. ## Summary of the chip rule for CPUs | CPU | Family core | State | Other consumers | | --- | --- | --- | --- | | MC68000 x 2 (x 3 on Winning Run) | m68000-python | built, public | many | | MC6809E | m6809-python | Phase 0 | namcos1, namcos2 | | HD63705Z0 (C65) | `m6805-python` proposed by namcos2-python | - | namcos2, psx-python's LLE CD controller | | M37450 (C68) | `m740-python` proposed by namcos2-python | - | namcos2 | | TMS320C25 (and C67) | none: **`tms320c25-python`** proposed | - | namcos22-python (C71), Taito Air System and Galaxian 3 in MAME |