# The CPU cores: two 68000s, a 6809, and two MCU families ## MC68000 x 2: [m68000-python](../../m68000-python) Public, v0.1.0, with m68000-rust and m68000-rust-fast (HEAD `55d3d60`). System 2 needs two instances on one board, each with its own bus callbacks, autovectored or vectored interrupts through the C148 (the CPU-space handlers at $FFFFF3-$FFFFFF show MAME supplying vectors per level: OBSERVED), and a reset the board holds (the slave starts at frame 141 of Valkyrie, OBSERVED). Nothing new is expected from the core; confirm against its README when wiring (as saturn-python and megadrive-python do). Measured rates (Valkyrie, MAME trace): main 2,282,756 instructions in 2.01 s = **1.14 M a second** (about 10.8 cycles each); slave 2,018,032 in the 2.67 s after its release = **0.76 M a second**. ## MC6809E (sound): [m6809-python](../../m6809-python) Phase 0 only, no core (as for namcos1-python). One instance at 2.048 MHz. Valkyrie's sound CPU starts at frame 160 and runs 1,558,951 instructions in 2.36 s = 0.66 M a second. ## C65: HD63705Z0 (43 sets) - The **HD6305** family: Hitachi's CMOS MCUs "upward compatible with HD6805 family instruction set" (DOC: Hitachi *HD6305 Series Handbook*, 1988, U08, HD6305U0/V0/HD63705V0 User's Manual 1.1 p. 101). The handbook documents the HD63705**V0** (4 KB, 192 B RAM); the **Z0** MAME names is not in it (U4). - MAME clocks it at 2.048 MHz and the trace counts cycles at 512 kHz, i.e. MAME treats 2.048 MHz as the oscillator and divides by 4 (HYPOTHESIS: the HD6305's internal divide; check U08's clock section when the core is built). - Firmware (Namco's, by SHA-1, never kept): internal `sys2mcpu.bin` (8,192 bytes, `2c420d34dba21e409bf78ddca710fc7de65a6642`, MAME device set `namcoc65`); external programs per game: `sys2c65b` (8 sets), `sys2c65c` (27 sets), Bubble Trouble's and Golly! Ghost!'s own (gun games). [census.md](census.md). - Valkyrie: 407,986 instructions in 2.67 s = 0.15 M a second. **Core.** No 6805-family core exists in the family. The PSX Phase 0 proposed `mc68hc05-python` for the PlayStation CD controller's MC68HC05 (psx-python `docs/cdrom.md`). Both chips are 6805 descendants; MAME itself keeps them in one directory (`cpu/m6805/`: `m6805`, `hd6305`, `m68hc05`, `m68705`, all BSD-3-Clause by their licence lines). Recommend **one core, `m6805-python`, with variants** (MC6805, HD6305/HD63705, MC68HC05), so both consumers pin one repository: open decision 3. Its documents: U08 here; Motorola's HC05 manuals for the PSX side (to find and pin). ## C68: Mitsubishi M37450 (17 sets) - A **MELPS 740** MCU: "Number of basic instructions 71 (69 MELPS 740 basic instructions + 2)" (DOC: Mitsubishi *M37450M2 User's Manual*, 1989), the two extra being MUL and DIV (its 2.12.1). The 740 is a 6502-derived core with extra instructions and a T flag (DOC: *Series 740 Software User's Manual*, 1989). - MAME lists 8.192 MHz; the trace counts 2.05 M cycles a second, matching the manual's internal clock of f(XIN)/4 for its timers and φ output (HYPOTHESIS for the CPU's own cycle; check the manual's clock chapter). - Firmware: `c68.bin` (32,768 bytes, `38d1ad1b1287cadef0c999aff9357927315f8e6b`, device set `namcoc68`), the same image for all 17 sets. - Super World Stadium: 1,469,540 instructions in 2.51 s = 0.59 M a second. **Core.** The family's 6502 line: [6502-python](../../6502-python) (NMOS, `sixfiveohtwo`) and its CPU frame, which [65816-python](../../65816-python) builds on, and [w65c02-python](../../w65c02-python). The 740 is neither a 65C02 nor a 6502 variant in opcode layout (its bit instructions, `LDM`, `T`-mode arithmetic, MUL/DIV are 740-only). Recommend **a new core `m740-python` on the 6502 CPU frame** (as 65816-python is), built only when the C68 games are reached (decision 4). Other MAME users of the M37450: Namco System 21 (C68), the Korg Wavestation, Shoot Away II. ## Summary of the chip rule for CPUs | CPU | Family core | State | Other consumers | | --- | --- | --- | --- | | MC68000 x 2 | m68000-python | built, public | Mega Drive, CPS-1/2, System 16, Neo Geo, ... | | MC6809E | m6809-python | Phase 0 | namcos1-python (x 3) | | HD63705Z0 (C65) | none: `m6805-python` proposed | - | psx-python's LLE CD controller (MC68HC05) | | M37450 (C68) | none: `m740-python` proposed | - | Namco System 21 (MAME) |