# MAME 0.285 as a closed-box detector The binary only (the script finds `mame` on PATH or in `$MAME`). One MAME process at a time, a few emulated seconds per run, `nice` and `taskset -c 24-31` on this shared machine. ```sh source ../profile-env-2026-11-23.sh # MAME_ROMPATH nice taskset -c 24-31 python -I scripts/mame_trace.py tmnt --cpu main --seconds 2 nice taskset -c 24-31 python -I scripts/mame_trace.py tmnt --cpu sound --seconds 2 nice taskset -c 24-31 python -I scripts/mame_trace.py simpsons --cpu konami --seconds 2 nice taskset -c 24-31 python -I scripts/mame_trace.py ssriders --maps --seconds 1 ``` What it runs: `mame -rompath $MAME_ROMPATH -video none -sound none -nothrottle -noreadconfig -skip_gameinfo -seconds_to_run N -autoboot_script run.lua -debug -debugger none -log`, with the run's folder `reference/mame/-/` as cwd, homepath, cfg and nvram directory. The Lua script sets the debugger's visible CPU and starts `trace T.trace,,noloop,{logerror "T %X ... %d %d %d\n",,totalcycles,frame,beamy}`. Each instruction becomes one `T` line in `error.log`: PC, registers, total cycles, frame, beam line. `--maps` runs `scripts/mame_maps.lua`, which prints every CPU's address-map entries from the running binary and exits. Tags and register symbols (probed): `:maincpu` is the MC68000 (`pc sr d0 d1 a0 a7` traced) or the KONAMI CPU on simpsons and aliens (`pc a b x y u s cc`); `:audiocpu` is the Z80 (`pc af bc de hl sp`). ## Runs of 2026-11-26 (16 emulation runs: 10 traces and 6 map dumps, one at a time) | Run | Instructions in 2 s | Last frame | Cycles | Rate | | --- | --- | --- | --- | --- | | tmnt main | 1,892,981 | 118 | 16,084,990 | 8.0 MHz | | tmnt sound | 783,778 | 118 | 7,197,116 | 3.58 MHz | | punkshot main | 2,670,906 | 118 | 24,127,482 | 12.0 MHz | | ssriders main | 3,971,221 | 118 | 32,169,978 | 16.0 MHz | | ssriders sound | 1,634,291 | 118 | 16,084,979 | 8.0 MHz | | xmen main | 3,870,432 | 118 | 32,169,980 | 16.0 MHz | | xmen sound | 2,126,279 | 118 | 16,084,988 | 8.0 MHz | | simpsons KONAMI | 1,488,237 | 118 | 6,039,550 | 3.0 MHz | | simpsons sound | 1,030,626 | 118 | 7,206,278 | 3.58 MHz | | aliens KONAMI | 1,330,365 | 118 | 6,031,869 | 3.0 MHz | Plus address-map dumps of tmnt (32 entries), punkshot (27), ssriders (33), xmen (38), simpsons (27), aliens (17): [memory-map.md](memory-map.md). Plus two `-listxml` runs (the 92 in-scope sets; all 1,084 Konami machines for [shared-cores.md](shared-cores.md)) and one `-listsource`. Observations: - Every CPU starts at frame 0; nothing is held in reset at boot (unlike Namco System 2). - Every main-CPU PC traced lies in ROM (68000 sets: maximum PC `0x197EC` on ssriders; the KONAMI CPU sets run from `6000-FFFF`, banked and fixed ROM). - The first 68000 trace line of tmnt reads `PC 1002 SR 2700` after MAME's "Soft reset" line: the trace starts after the reset vector fetch, so the reset sequence itself is not in the trace. M1 compares from the first instruction. ## Limits A detector only: MAME marks every Sunset Riders set but two "graphics imperfect" and every X-Men set but one "sound imperfect". Its Konami chip files carry BSD-3-Clause `license:` lines ([sources.md](sources.md)), but whether their content was informed by furrtek's die traces is not known without opening them (U25); using MAME only as a run-time detector keeps that question out of our code either way. Not yet done: watchpoint traces on the sound ports and interrupt lines (U7, U8), pictures (`-video` with snapshots needs a display or the `-video none` snapshot path; the script's `--snap` exists but was not run), audio captures.