# MAME 0.285 as a closed-box detector The binary only (its source is never fetched or opened here). One MAME process at a time, short windows, `nice` and `taskset -c 24-31` (built into `scripts/mame_trace.py`, which also documents the method: run unthrottled to `--start`, trace one CPU with the debugger's `trace` command for `--window` emulated seconds, count instructions including the loops MAME's tracer folds, list the hottest PCs). ```sh MAME_ROMPATH=... python -I scripts/mame_trace.py ridgerac --cpu master --start 20 --window 0.25 MAME_ROMPATH=... python -I scripts/mame_trace.py timecris --cpu main --start 20 --window 0.25 MAME_ROMPATH=... python -I scripts/mame_trace.py ridgerac --snap 10 --start 0 --window 40 MAME_ROMPATH=... python -I scripts/mame_trace.py ridgerac --maps ``` ## Tags and state names (probed 2026-11-26) | Kind | Tag | Device | State names | | --- | --- | --- | --- | | main | `:maincpu` | m68020 (System 22), m68ec020 (Super 22) | D0-D7 A0-A7 PC SR SP USP ISP MSP VBR SFC DFC CACR CAAR IR PREF_ADDR PREF_DATA | | DSPs | `:master`, `:slave` | namcoc71 | PC ACC P T AR0-AR7 STR0 STR1 STK0-STK7 DRR DXR TIM PRD IMR IFR GREG RPTC | | MCU | `:mcu` | namcoc74 (System 22), m37710s4 (Super 22) | A B X Y S PC PG DT DPR PS E IRQ | | I/O MCU | `:iomcu` (System 22) | namcoc74 | as above | ## Runs (2026-11-26; 0.25 emulated seconds from 20 s) | Game | CPU | Instructions | Per second | Spins | Host time | | --- | --- | ---: | ---: | ---: | ---: | | ridgerac | master | 140,376 | 0.56 M | 24.6 % | 9.5 s | | ridgerac | slave | 0 (also 0 from 30 s) | 0 | - | 8.5 s | | ridgerac | main (MC68020) | 899,663 | 3.60 M | 92.5 % | 9.5 s | | ridgerac | mcu (C74) | 51,315 | 0.21 M | 86.9 % | 8.1 s | | ridgerac | iomcu (C74) | 0 | 0 | - | 8.2 s | | timecris | master | 477,727 | 1.91 M | 27.9 % | 10.9 s | | timecris | slave | 0 | 0 | - | 8.0 s | | timecris | main (MC68EC020) | 916,888 | 3.67 M | 89.4 % | 8.4 s | | timecris | mcu (M37710S4) | 147,780 | 0.59 M | 15.0 % | 8.8 s | **The slave DSP and the I/O MCU never run in MAME.** A Lua probe sampling `state["PC"]` every 120 frames for 1,500 frames of Ridge Racer found the master at $4BB1 at every frame boundary (a wait), the slave at **$0257 throughout**, the I/O MCU at **$C030 throughout**, and the main MCU moving. Snapshots at 10 and 30 s show full 3D scenes (the attract race), so the windows above are 3D-heavy. MAME's own speed was 2.3-2.8x real time on one of CPUs 24-31 while this machine was loaded ("Average speed" lines; with the debugger for traces, without it for snapshots). `--maps` printed 164 entries for ridgerac and 132 for timecris ([memory-map.md](memory-map.md)). ## What MAME can and cannot decide here - **Can detect:** the 68020's and the main MCU's instruction streams; the master DSP's stream; pictures (as a detector of gross errors); the C352 write stream; save states exist in MAME. - **Cannot judge:** the slave DSP (it does not run); the I/O MCU (it does not run); the renderer's pixel rules (imperfect on every set); any timing between the DSPs and the renderer.