# The MAME recipe (run 2026-11-26, MAME 0.285) MAME is run, never built here. Its i960 files are BSD-3-Clause and pinned for reading ([sources.md](sources.md)); the binary as a whole is GPL-2.0+ and only run. ```sh MAME_ROMPATH=... python -I scripts/mame_trace.py --driver vf2 --frames 2 ``` The script (the same one as `../model2-python/scripts/mame_trace.py`) passes `-rompath $MAME_ROMPATH -homepath -video none -sound none -nothrottle -noreadconfig -skip_gameinfo -log -seconds_to_run N -autoboot_script run.lua -nodrc -debug -debugger none`, and the Lua sets `manager.machine.debugger.visible_cpu` to `:maincpu`, issues `trace T.trace,:maincpu,noloop,{logerror "T %X %X %X %X %X %d\n",ip,ac,pc,fp,sp,totalcycles}`, and exits from a frame notifier. ## Result `vf2` (Virtua Fighter 2, Model 2A-CRX), 2 frames: **606,796 instructions in 910,199 cycles** (0.67 instructions per clock in MAME's cycle model), 21.8 MB log, 11.6 s wall, under `nice taskset -c 24-31`. The trace starts at IP 0xB0 after MAME's reset and ends in a wait loop at 0x100-0x104; MAME's log says "Start copro upload" (the i960 loading the TGP program, model2-python docs/geometry.md). ## Traps met - **MAME's `pc` on the i960 is the Process Controls register, not the program counter.** The instruction pointer is `ip`. The first run logged a constant `1F2002` (PC's value) on every line. The symbols available, listed from Lua `device.state`: `ac fp g0-g14 ip pc pfp pip prcb r3-r15 rip sat sp` plus `CURPC`/`GENPC`. - There is no i960 DRC in MAME, so `-nodrc` changes nothing for this CPU; it is passed for the TGP and SHARC. - MAME counts the i960's cycles with its own per-instruction constants (for example `m_icount -= 9` on `call`); they are not Intel's appendix C tables. Treat cycle columns as MAME's, never as the chip's.