# The CPU cores: a 68020, two TMS320C25s, and 7700-family MCUs Rates are MAME 0.285 traces (OBSERVED, 0.25 emulated seconds at 20 s, during 3D attract scenes; [mame-oracle.md](mame-oracle.md)). They include spin loops, which an exact interpreter pays for just the same. | Set | CPU | Instructions/s in MAME | Spins | | --- | --- | ---: | ---: | | ridgerac | MC68020 | 3.60 M | 92.5 % | | timecris | MC68EC020 | 3.67 M | 89.4 % | | ridgerac | C71 master | 0.56 M | 24.6 % | | timecris | C71 master | 1.91 M | 27.9 % | | ridgerac, timecris | C71 slave | **0** (PC stays at $0257 for 25 s) | - | | ridgerac | C74 `mcu` | 0.21 M | 86.9 % | | ridgerac | C74 `iomcu` | **0** (PC stays at $C030) | - | | timecris | M37710S4 | 0.59 M | 15.0 % | ## MC68020 / MC68EC020: a new core, `m68020-python` **The chip** (DOC: Motorola *MC68020 32-Bit Microprocessor User's Manual*, 1984, "UM020", pinned here): the 68000's programming model widened to 32-bit addresses and data, new addressing modes (memory indirect, scaled index), bit-field, 32-bit multiply/divide, CAS/CAS2, CALLM/RTM, a coprocessor interface, dynamic bus sizing, and a **direct-mapped instruction cache of 64 long-word entries** (UM020 7.1.1; 256 bytes). The MC68EC020 is a later, cheaper version with a 24-bit address bus (not in the 1984 manual; MAME's Super System 22 map is 24-bit: OBSERVED). **Timing is only bounded by the manual.** UM020 section 9 gives each instruction three figures: best case (in cache, maximum overlap), cache case (in cache, no overlap) and worst case (not in cache, no overlap), and says the real time lies between, depending on overlap with neighbouring instructions (UM020 9.1, 9.2). So the 68020's exact cycle behaviour is **not documented**; it is an **instruction-level** component in the charter's sense, with bus timing modelled per transaction (cache misses, the system bus at three clocks per access with no wait states: UM020 9.2's assumptions). This is the board's first modelling-level decision (decision 4). **Core proposal.** The family has m68000-python (public, 68000 only; its README puts the 68020 out of scope). MAME `-listxml` counts 64 machines with an MC68020 and 408 with an MC68EC020 (Taito F3 100, Konami GX 42, itech32 59, Atari GX2 and GT, Psikyo, Namco NB-1, Gaelco 3D, ...): two of those families have Phase 0s running tonight (taitof2-python's F3 row, konamigx-python). The CPU rule gives it its own repository: **`m68020-python`** (package `m68020_python`), MC68020 and MC68EC020 as variants, its decode built from m68000-python's documents and tests but not sharing code (the timing model differs entirely). Decision 3, to coordinate with the Taito F3 and Konami GX Phase 0s. ## TMS320C25 (Namco C71): `tms320c25-python` Two C71s, each a TMS320C25 with Namco's 4K-word mask ROM (`c71.bin`, 8,192 bytes, the same form as System 21's C67). MAME clocks both at 40 MHz, i.e. 10 M machine cycles a second (DOC: C2X, four CLKIN cycles per machine cycle). The chip, its documents and the core proposal are in [namcos21-python cpu-cores.md](../../namcos21-python/docs/cpu-cores.md): one core, **`tms320c25-python`**, for both boards. **What MAME runs.** The master executes (0.56-1.91 M instructions/s); **the slave never leaves $0257 and the I/O MCU never leaves $C030** in 25 emulated seconds of Ridge Racer (OBSERVED: program counters sampled every 120 frames). Either MAME computes the slave DSP's share of the work some other way, or the slave genuinely waits; MAME's source would say, and it is closed here (decision 1). Either way **MAME cannot detect the slave DSP's behaviour or timing** (U4). Community pages give the DSPs as 49.152 MHz (Wikipedia, uncited): C2. ## 7700-family MCUs: a new core, `m7700-python` - **Namco C74 = Mitsubishi M37702** (MAME's description "Namco C74 (M37702)", with a 16 KiB internal ROM image, so a mask-ROM M37702 carrying Namco's code: HYPOTHESIS for the part identity). Two on System 22: `mcu` at 16.384 MHz (runs the C352 and the inputs from its own 512 KiB external ROM) and `iomcu` at 6.144 MHz (the I/O board). - **M37710S4** on Super System 22 (16.384 MHz; ROM-less: its program is the `mcu` region). - **The 7700 family** (DOC: Mitsubishi *MELPS 7700 Series Software Manual*, 1989, "SW7700"; *M37702/M37703 Group User's Manual*, 1991, "UM37702"; both pinned): a 16-bit CPU with 103 instructions (SW7700; UM37702's specification table), 8/16-bit switchable accumulators and index registers (the M and X flags, much like the 65816), a data bank and program bank, direct page; the CPU clock φ is f(XIN)/2 and a bus cycle is f(XIN)/4 without wait (UM37702 2.x, clock and bus chapters). So MAME's 16.384 MHz is a φ of 8.192 MHz. - **Relatives in the family:** [65816-python](../../65816-python) (W65C816) has the nearest register model, but the 7700's opcode map and its extra instructions (multiply, divide, bit and block operations, the second accumulator B) differ; it is not a 65816 variant. - **Users.** MAME `-listxml`: M37702 in 129 machines (Namco System 11's C76, NA-1/NA-2, NB-1/2, FL, System 22, and others), M37710 in 22 (System 22 only). The CPU rule gives it its own repository: **`m7700-python`** (package `m7700_python`), M37702 and M37710 as variants (their SFR maps differ; the M37710's manual is not yet found: U10). Decision 3. ## Summary of the chip rule for CPUs | CPU | Family core | State | Other consumers | | --- | --- | --- | --- | | MC68020 / MC68EC020 | none: **`m68020-python`** proposed | - | Taito F3, Konami GX (Phase 0s running), many in MAME | | TMS320C25 (C71) | none: **`tms320c25-python`** proposed (with namcos21-python) | - | namcos21-python (C67), Taito Air System in MAME | | M37702 (C74), M37710S4 | none: **`m7700-python`** proposed | - | Namco System 11, NA-1/NA-2, NB-1, FL in MAME (no family boards yet) |