# The MAME oracle: a headless recipe, run 2026-11-26 MAME 0.285's `s2650` device (BSD-3-Clause, Juergen Buchmueller) is a detector (tier 5). Nothing of its source is fetched or read; the binary is run. ## Recipe `scripts/mame_trace.py` writes a Lua autoboot script and runs the chosen driver headless (`-video none -sound none -nothrottle -noreadconfig -skip_gameinfo -log -debug -debugger none`), with a cartridge from `$NO_INTRO_DIR` (neither console has a BIOS): ``` dbg.visible_cpu = manager.machine.devices[":maincpu"] trace disasm.txt,:maincpu,noloop,{logerror "S %X %X %X %X %X %X %d\n",pc,ps,r0,r1,r2,r3,totalcycles} go ``` then exits after N frames from a frame notifier held in a global. MAME's 2650 state symbols in 0.285 (probed by Lua): `PC PS R0 R1 R2 R3 R1' R2' R3' SI FO HALT` (and the generic `CURPC GENPC CURFLAGS`). `PS` is PSU in the high byte, PSL in the low; `SI` is the SENSE input and `FO` the FLAG output. The return address stack is not exposed as state. `totalcycles` counts **clock periods** (a 2-cycle instruction shows as 6). The trace file `disasm.txt` holds MAME's disassembly, one line per instruction (`0:0000: ppsu ii`); `summary.txt` counts mnemonics and per-instruction periods. ## Runs See [validation.md](validation.md), "What ran in this phase". Notable: the VC 4000 Golf cartridge starts with `ppsu ii` at 0000 (interrupts inhibited first); the Arcadia's Escape spends most of its time in `tpsu` / `bcfr` loops polling SENSE (the UVI's vertical blank, GUIDE "Timing"); the Elektor monitor spends half its instructions in `bdrr` delay loops.