# MAME 0.285 as a detector MAME is an emulator (tier 5): it finds differences, it does not decide them. The binary is the machine's installed `mame` (`0.285 (unknown)`). Its Supervision source files are GPL-2.0+ by their `license:` lines (`src/mame/svision/svision.cpp`, `svis_snd.cpp`, read through the first line only, 2026-11-26) and are **never opened**. ## What MAME says it runs (`mame -listxml`, 2026-11-26) | Machine | Description | CPU | Screen | | --- | --- | --- | --- | | `svision` | Super Vision (Watara, 1992) | "WDC W65C02" at 4,000,000 Hz | LCD 160 x 160, 61.000000 Hz, pixclock 1,620,160, htotal 166 | | `svisions` | Super Vision (PeT Communication Simulation) | same | same | | `svisionn` | Super Vision (NTSC TV Link Colored), 1993 | 3,560,000 Hz | 60 Hz | | `svisionp` | Super Vision (PAL TV Link Colored), 1993 | 4,430,000 Hz | 50 Hz | | `tvlinkp` | TV Link PAL, 199? | 4,430,000 Hz | 50 Hz; ROM `9307md_512d.glob` | The sound device is "Super Vision Custom Sound" at 4 MHz. MAME's "WDC W65C02" is its base CMOS device without bit instructions (w65c02-python mame-oracle.md). MAME's 61 Hz screen is the NMI rate, not KH's 50.81 Hz LCD frame (C1). ## The recipe (run) ```sh MAME_ROMPATH=... python -I scripts/mame_trace.py --cart "$NO_INTRO_DIR/Watara - Supervision/Alien (USA, Europe).zip" --seconds 3 ``` runs, in a fresh `tests/mame_traces/-/` (git-ignored): ``` mame svision -cart -homepath -video none -sound none -nothrottle -noreadconfig -skip_gameinfo -debug -debugger none -log -seconds_to_run N -autoboot_script trace.lua ``` `trace.lua` installs a Lua write tap on 2000-20FF (`[luaengine] IOW address data` lines) and issues `trace cpu.trace,,noloop,{logerror "%X %X %X %X %X %X %X %d\n",pc,b@pc,a,x,y,sp,p,totalcycles}`. `error.log` then has one line per instruction (PC, opcode byte, registers, MAME's cycle count). MAME opens the cartridge zip itself. A 3-second run takes about 75 s wall time (load ~43, `nice`, `taskset -c 24-31`) and ~200 MB of logs. ## Run 2026-11-26 (`tests/detectors/mame-svision-2026-11-26.txt`) | Cart | Seconds | Instructions | Cycles | Cycles/instr | Bit instr. | WAI/STP | CMOS-only opcodes executed | | --- | ---: | ---: | ---: | ---: | --- | --- | --- | | Alien (USA, Europe) | 3 | 4,490,045 | 12,065,561 | 2.687 | none | 0 / 0 | `BRA` 57,944; `PHX PLX PHY PLY` ~29,130 each; `LDA (zp)` 25,891; `STZ` 278 | | Super Kong (USA, Europe) | 2 | 2,404,679 | 8,065,563 | 3.354 | none | 0 / 0 | `PHX PLX PHY PLY` 121 each; `STZ` 168 | | Galactic Crusader (USA, Europe) | 2 | 2,658,888 | 8,065,563 | 3.033 | none | 0 / 0 | none | Alien's first trace line is `C000 A2 0 80 0 1FD 36 8`: reset at C000 (its vector), opcode `LDX #`, MAME's cycle count 8 after its reset sequence. I/O registers written: Alien 2000-2003, 2010-2017, 2022, 2026 (x3), 202A; Galactic Crusader 2002/2003 121 times each in 2 s (it scrolls), 2026 x3; Super Kong clears 2000-203F once. ## What MAME can and cannot decide - **Can detect:** a board that runs a game differently (PC paths, register writes, pictures); which opcodes games use (the CPU row question, cpu.md); which registers games touch (where the build must be careful first). - **Cannot decide:** any timing (it shows a frame per NMI; KH's LCD runs at 50.81 Hz); the LCD's grey levels; VRAM contention and DMA stalls; anything about the TV-Link or the large carts (Journey to the West is `supported="no"`). - One process at a time, short runs: the family's rule.