# MAME as a detector (closed box, tier 5) MAME 0.285 at `/usr/games/mame` on this machine (any MAME 0.285 binary will do). Run, never read. The `license:` lines of the relevant files were read through the GitHub API at tag `mame0285` (`3bd358f`) on 2026-11-26, printing only those lines: every Taito file named below says **BSD-3-Clause** (taito_f2.cpp/.h/_v.cpp: David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria; taito_f3.cpp: Bryan McPhail; taito_f3.h, taito_f3_v.cpp: Bryan McPhail, ywy, 12Me21; taito_en.cpp/.h: Bryan McPhail, Aaron Giles, R. Belmont, Philip Bennett; tc0100scn, tc0110pcr, tc0280grd, tc0360pri, tc0480scp, taitoio: Nicola Salmoria; shared/taitosnd.cpp: Philip Bennett; taitocchip.cpp: Jonathan Gevaryahu, David Haywood), as do the devices `sound/es5506.cpp` (Aaron Giles), `cpu/es5510/es5510.cpp` and `sound/esqpump.cpp` (Christian Brunschen), `machine/mc68681.cpp`, `mb87078.cpp`, `mb8421.cpp`, `te7750.cpp`, `eepromser.cpp`, and the 68020's `cpu/m68000/m68020.cpp`, `m68kcpu.cpp/.h` and `m68kmake.py` (Musashi lineage, Karl Stenerud, Olivier Galibert). `m68kops.cpp` and `m68k_in.lst` printed no `license:` line: MAME's generated 68020 handlers carry no header and are therefore GPL-2.0+ (the sources.md MAME row). Whether the BSD files may be read is open decision 3; until Aubrey says so they stay closed. ## Recipes (run 2026-11-26) ```sh source python -I scripts/mame_run.py cameltry --frames 600 --trace maincpu --trace audiocpu \ --trace-from 590 --trace-frames 2 python -I scripts/mame_run.py dariusg --frames 900 --trace maincpu \ --trace taito_en:audiocpu --trace taito_en:esp --trace-from 890 --trace-frames 2 printf 'TAGS = {":maincpu", ":audiocpu"}\n' | cat - scripts/mame_map.lua > run.lua # maps ``` `mame_run.py` runs `nice mame -rompath "$MAME_ROMPATH" -video none -sound none -nothrottle -noreadconfig -skip_gameinfo -snapshot_directory snap -autoboot_script run.lua -seconds_to_run N [-debug -debugger none]` in `tests/mame_traces//` (git-ignored). Its Lua holds a write tap on `:maincpu`'s program space (counts by 64 KiB region), starts and stops the debugger's `trace ,,noloop` from a frame notifier, snapshots and exits. The tap and notifier are held in globals (collected otherwise). ## What the runs showed (OBSERVED, MAME's model) | Run | Result | | --- | --- | | `cameltry`, 600 frames | 4,427,587 main-CPU writes (work RAM 3.29 M, sprite RAM 0.72 M, TC0360PRI 0.16 M, I/O 0.15 M, palette 85 k, TC0100SCN 14.5 k, TC0280GRD 7.7 k, TC0140SYT 12); the title screen at frame 600 (320x224) | | `cameltry` trace, frames 590-592 | 68000: 26,350 lines (IRQ 5 and IRQ 6 taken once per frame each, no STOP: the main loop runs flat out); Z80: 13,283 lines | | `dariusg`, 900 frames | 10,378,581 main-CPU writes (work RAM 7.29 M, FIO 2.01 M, graphics RAM 1.05 M, palette 12.7 k, scroll 6.8 k, shared RAM 1.1 k, sound reset 4, timer 2); the Taito logo at frame 900 (320x232) | | `dariusg` trace, frames 890-892 | 68EC020: 56,260 lines (an idle loop around a random-number routine waiting for the next interrupt); sound 68000: 87,150 lines, 66,385 of them at one `bra` of a wait loop; **ES5510: an empty trace file** (MAME's ES5510 does not feed the tracer) | | address maps (Lua, `scripts/mame_map.lua`) | `tests/detectors/mame-map-cameltry-2026-11-26.txt`, `mame-map-dariusg-2026-11-26.txt`: every window with MAME's handler names (tables in f2-board.md, f3-board.md, f3-sound.md) | | ESP program counter, `dariusg` and `pbobble2` | CURPC read 59h at every one of 40 frame boundaries (frames 600-640 and 1000-1030), before and after the music starts. Inconclusive: either MAME runs the ESP in whole-sample batches that end at one PC, or it does not run | | audio (`-wavwrite`, 40 s of `dariusg`) | silent for the first 12 s, then music (RMS 190-560 per second); Cameltry audible at once. Puzzle Bobble 2's first 10.8 s silent | MAME processes run tonight, one at a time, `nice`, on CPUs 24-31: 15 emulation runs of a few emulated seconds each (2 traced detector runs, 7 ESP/audio probes, 6 address-map listings while the Lua script was refined) and about 9 information commands (`-listxml`, `-listsource`, `-listdevices`, `-version`). ## What MAME can and cannot decide Can: find differences in write streams, interrupt patterns, address decoding, pictures and sound over seconds of attract mode; count instructions per frame. Cannot: judge timing (F3's CPU at 16 MHz against 12me21's measured 15.238 MHz, C1), the FDP's priority corners, the ESP's output, or anything F2's chips do that nobody has measured. Every disagreement is a question for 12me21's measurements (F3) or for a board (F2).