# The MAME oracle: a headless recipe, run 2026-11-26 MAME 0.285 is a detector (tier 5): it finds differences, it never decides them. Its Astrocade files are BSD-3-Clause, but nothing of its source is fetched or read here; the binary is run. ## Recipe `scripts/mame_trace.py` writes a Lua autoboot script and runs: ``` mame astrocde -rompath $MAME_ROMPATH -homepath -video none -sound none \ -nothrottle -noreadconfig -skip_gameinfo -log -seconds_to_run N \ -autoboot_script run.lua [-debug -debugger none] [-cart ] ``` The Lua script sets `manager.machine.debugger.visible_cpu` to `:maincpu`, issues `trace Z.trace,:maincpu,noloop,{logerror "Z %X ... %d\n",pc,af,bc,de,hl,sp,ix,iy,totalcycles}` and `wpiset 0,10000,w,1,{logerror "IO %X %X %d\n",wpaddr,wpdata,totalcycles; g}` (every I/O write, all 16 address bits), then exits after N frames through a frame notifier (held in a global: the family's MAME notes say Lua taps are collected otherwise). The log lands in `error.log` and is renamed `run.log`. Z80 state symbols in 0.285: `A AF AF2 B BC BC2 C D DE DE2 E F H HL HL2 I IFF1 IFF2 IM IX IY L PC R SP WZ` (probed by Lua). ## Runs | Command | Result | | --- | --- | | `mame_trace.py --frames 3` (astrocde, no cartridge) | 8,263 Z80 instructions, 89,400 cycles in 3 frames (~29,800 a frame: 1.7898 MHz / 60); 0.6 s wall. First I/O writes: 08=00 at cycle 12 (low resolution), a sound block transfer 0818..0118, 09=29, 0A=BF, 0E=08 (screen interrupt enabled, mode 0), a colour block transfer 070B..000B (register 0 last, =20), then each frame 0F=C8 (screen interrupt at line 200, i.e. RAM line 100 in bits 7-1) and 0D=34 (the vector byte) | | `mame_trace.py --snap 8` | the BIOS menu "SELECT GAME 1-GUNFIGHT 2-CHECKMATE 3-CALCULATOR 4-SCRIBBLING (C) BALLY MFG 1978", 352 x 240, with a purple column at the right edge (PURPLE's line) | | `mame_trace.py --driver gorf --frames 2` | 5,378 instructions; 139 writes to I/O address A55B among others (high-byte use on the arcade board) | What MAME shows that the documents dispute: no WAIT states (the first instructions take 4 T-states each, where SYS 111-112 adds one per memory access: C3), and 262 progressive lines (C2). Both are reasons it can only be a detector here.