# MAME 0.285 as an emulator-derived 6800 oracle MAME's `m6800`/`m6801` core is the most exercised 6800-family model that exists: every Williams, Atari, Irem, Zaccaria, Taito and pinball 6800 board in MAME runs on it. It is also **emulator-derived**, so under this project's oracle-tier rule ([validation.md](validation.md)) it is a **detector, never a judge**. A disagreement between `m6800-python` and MAME is a lead, resolved by the Motorola manuals or by a second independent emulator — never by MAME's say-so. MAME's own source agrees: `- verify invalid opcodes for the different CPU types` is an open TODO at the top of `m6800.cpp`. Everything on this page was run on 2026-09-12 with the commands as committed. ## What is installed - MAME **0.285** at `/usr/games/mame` (`mame -version` → `0.285 (unknown)`). - ROM sets under the directory `$ROMPATH` names (non-merged here), used in place with `-rompath`. Nothing is copied, and no ROM, trace or `error.log` is committed (`.gitignore` covers `*.trace`, `error.log`, `mame-work/`, `mame-home/`, `reference/`). - **Check the version of any MAME source tree before quoting it.** The one on the machine these documents were written on was 0.261, not 0.285. Its 6800 core differs from the installed binary's in the `CLI`/`SEI`/`TAP` interrupt-delay handling and in the illegal-opcode cycle sentinel. Do not quote it. `scripts/fetch_mame_source.py` fetches the six files of the 0.285 core, SHA-256 verified, into `reference/mame0285/`, and that is what every citation in these documents refers to. ## Games confirmed to run a 6800-family CPU From `mame -listxml` on the installed binary, not from the source tree: | Game | Tag | Part | MAME clock | Bus rate | | --- | --- | --- | --- | --- | | `dragrace` (Atari Drag Race, 1977) | `:maincpu` | Motorola **MC6800** | 1,008,000 | 1,008,000 Hz | | `firetrk`, `orbit`, `skydiver`, `toratora`, `fgoal` | `:maincpu` | MC6800 | see [timing.md](timing.md) | | | `robotron` (Williams, 1982) | `:soundcpu` | Motorola **MC6808** | 3,579,545 | 894,886 Hz (÷4 on-chip) | | `qix` | `:audiocpu` | Motorola MC6802 | 3,686,400 | 921,600 Hz | | `kncljoe` (Knuckle Joe, 1985) | `:soundcpu` | Motorola **MC6803** | 3,579,545 | 894,886 Hz | | `kungfum` | `:iremsound` | MC6803 | 3,579,545 | 894,886 Hz | `robotron`'s `:maincpu` is a **6809E** and belongs to the other repository; only its sound CPU is in scope here. ## The working command line `scripts/mame_trace.sh [game] [seconds] [tag] [workdir]` wraps exactly this: ```sh M6800_TRACE_TAG=":maincpu" M6800_TRACE_FILE="dragrace.trace" \ /usr/games/mame dragrace \ -rompath "$ROMPATH" \ -homepath "$PWD/mame-home" \ -video none -sound none -nothrottle -noreadconfig -skip_gameinfo \ -debug -debugger none -log \ -seconds_to_run 2 \ -autoboot_script scripts/mame_trace.lua ``` and `scripts/mame_trace.lua` does: ```lua local cpu = manager.machine.devices[tag] local dbg = manager.machine.debugger dbg.visible_cpu = cpu dbg:command('trace ' .. file .. ',,noloop,{logerror "%X %X %X %X %X %X %X %d\n",' .. 'curpc,a,b,x,s,cc,wai,totalcycles}') dbg:command("go") ``` The script also prints the device's state names and the vector table, and can hold an input for a while (`M6800_PRESS`, below). ## Gotchas, confirmed or corrected here | Claim carried in from earlier sessions | Status here | | --- | --- | | `-log` writes `error.log` into the **current working directory**, not beside `-homepath` | **Confirmed.** `-homepath "$PWD/mame-home"` and `error.log` still appeared in the cwd; the wrapper `cd`s into a work directory first for exactly this reason | | `tracelog` is silent | **Confirmed.** A run with `dbg:command('tracelog "%X %X\n",curpc,a')` produced a 223-byte `error.log` containing only MAME's own warnings and no register lines, and left a stray `trace_