# MAME 0.285 as a closed-box detector: the recipe as run MAME is run, never read. Its `philips/odyssey2.cpp` driver and the `video/i8244.cpp`, `video/ef9340_1.cpp`, `sound/sp0256.cpp`, `bus/odyssey2/*` devices are not fetched into this repository (the Phase 0 brief's closed-box rule; their per-file licence lines were not opened either). A detector finds differences; it does not decide who is right. ## What MAME says about the machines (`mame -listxml`, 2026-11-26) | Driver | Description | 8048 clock | Video chip clock | Screen (half-clock pixels) | | --- | --- | --- | --- | --- | | odyssey2 | Odyssey 2 (US) 1979 | 5,369,317 | 8244 3,579,545 | 455 x 263, 59.826 Hz | | videopac | Videopac G7000 (Europe) 1978 | 5,911,492 | 8245 3,546,895 | 456 x 313, 49.701 Hz | | videopacf | Videopac C52 (France) 1979 | 5,937,333 | 8245 3,562,400 | 456 x 313, 49.919 Hz | | videopacp | Videopac+ G7400 (Europe) 1983 | 5,911,000 | 8245 3,546,800 (+ ef9340_1, i8243) | 456 x 313, 49.700 Hz | | jopac | Jopac JO7400 (France) 1983 | 5,911,000 | 8245 3,562,500 (+ ef9340_1, i8243) | 456 x 313, 49.920 Hz | | odyssey3 | Odyssey 3 Command Center (US, prototype) 1983 | 5,369,317 | 8244 3,579,545 (+ ef9340_1, i8243) | 455 x 263, 59.826 Hz | All six are marked "good" with save states supported. Every one **refuses to start without a cartridge** ("Images must be mounted for the following devices: cartridge"). Users of the chips across all of MAME 0.285 (`-listxml`, device references): i8244 2 machines, i8245 4, ef9340_1 3 (all in this driver), sp0256 31, i8243 71. ## The recipe `scripts/mame_trace.py` writes a Lua script and runs: ``` mame -rompath "$MAME_ROMPATH" -homepath . -cfg_directory cfg -nvram_directory nvram \ -snapshot_directory snap -video none -sound none -nothrottle -noreadconfig -skip_gameinfo \ -autoboot_script run.lua -cart [-debug -debugger none -log] ``` with, for a trace, ```lua dbg.visible_cpu = manager.machine.devices[":maincpu"] dbg:command('trace trace.log,:maincpu,noloop,{logerror "S %03X %02X %02X %02X %02X %02X %d\\n",curpc,a,curflags,p1,p2,tc,totalcycles}') dbg:command('wpiset 0,100,w,1,{logerror "W %02X %02X %d\\n",wpaddr,wpdata,totalcycles; g}') dbg:command('wpiset 0,100,r,1,{logerror "R %02X %02X %d\\n",wpaddr,wpdata,totalcycles; g}') ``` Traps: the 8048's `MOVX` space is MAME's **I/O space** (`wpiset`, not `wpset`); the PSW is `curflags` (no `psw` symbol: a missing symbol makes the whole trace action print nothing, as mcs48-python's recipe found); `totalcycles` counts **machine cycles** (a `JMP` adds 2). All output stays in the git-ignored `reference/mame//`. ## Runs made (2026-11-26, one process at a time, `nice`, CPUs 24-31) | Command | Result | | --- | --- | | `--driver videopac --frames 3 --cart ` | 12,241 instructions, 565 `MOVX` writes, 8 reads; external interrupt entered at machine cycles 7,926, 15,855, 23,784: **7,929 cycles per PAL frame** | | `--driver odyssey2 --frames 4 --cart ` | 12,332 instructions, 565 writes, 10 reads; interrupt entries at 5,980, 11,965, 17,948, 23,931: **5,983 cycles per NTSC frame** | | `--driver videopac --snap 4 --cart ` | snapshot: the BIOS's "SELECT GAME" in colour on black | | `--driver videopacp --snap 6 --cart ` | snapshot: the G7400's full-screen tiled "SELECT GAME" drawn by the EF9340/41 | | `--driver videopacp --frames 3 --cart ` | 14,331 instructions, 1,484 writes, 741 reads; no external-interrupt entry in 3 frames (the G7400 BIOS path differs: to look into at milestone 7) | Both frame figures agree with MAME's screen geometry: a machine cycle is 15 XTAL clocks, which is 10 VDC clocks on NTSC (clock ratio 3 : 2) and 9 on PAL (5 : 3), so a frame is 263 x 227.5 / 10 = 5,983.3 and 313 x 228 / 9 = 7,929.3 machine cycles and with GUST's instructions per line (22.8, 25.3). They are MAME's model, not a measurement of a console. Average cycles per instruction in the BIOS's SELECT GAME loop: 23,932 / 12,332 = **1.94** (NTSC run); used for the speed arithmetic in the brief. The first instructions (`trace.log`): `000: jmp $400`, `400: jmp $2C3` (the cartridge calling SELECT GAME), `2C3: mov r7,#$FF`, `2C5: sel rb1`, `2C6: call $0F1`; the BIOS then clears external RAM downwards from FFh (`W FF 00`, `W FE 00`, ...). Only these few lines are quoted, as evidence the recipe runs; the trace itself is firmware behaviour and is never committed. ## What MAME can and cannot decide here - Can find: instruction-stream differences against the board running the same BIOS and cartridge; register-write order and timing per frame; pictures to compare. - Cannot decide: anything about the 8244's dot-level rules (collisions, overlap, mid-line writes), the sound waveform, the SP0256's rate (intellivision-python found MAME's 9,285 Hz against a console's 10 kHz), the EF9340/41 character shapes (its ROM is a bad dump).