# MAME as a detector for the ARM60 (tier 5, closed box) MAME 0.285 (`/usr/games/mame`, the installed binary) runs the 3DO as `3do_fz1`, `3do_fz10`, `3do_fz10e`, `3do_fz10j`, `3do_fz1e`, `3do_fz1j`, `3do_fc1`, `3do_fc2`, `3do_gdo101`, `3do_hc21`, `3do_try` (`misc/3do.cpp`). `mame -listdevices 3do_fz1` (run 2026-11-26): `maincpu ARM7 (big) @ 12.50 MHz`, beside `madam`, `clio` (with `dspp`), `amy` (all "@ 12.50 MHz"), `cdrom` (CR-560-B), `screen @ 24.54 MHz`. **What that means for this core:** MAME models the ARM60 with its ARMv4 ARM7 core in big-endian mode. On the code the 3DO firmware runs (no ARMv4-only instructions in the traces below) it is a useful detector of differences in results; it cannot judge any ARMv3-only corner (26-bit modes, the ARM6 multiplier's timing and flags, undefined encodings), and its cycle counts are its own model. The file headers (`license:BSD-3-Clause` on `arm7.cpp`) were read as the first line only; the source is not opened (closed box, the brief). ## The recipe (run) ```sh MAME_ROMPATH=... python -I scripts/mame_trace.py --machine 3do_fz10 --start 0 --frames 2 \ --out tests/mame_traces/boot.trace python -I scripts/survey_trace.py tests/mame_traces/boot.trace ``` `mame_trace.py` runs MAME headless (`-video none -sound none -nothrottle -noreadconfig -skip_gameinfo -debug -debugger none -autoboot_script`), with a Lua script that issues the debugger command `trace ,maincpu,noloop,{tracelog "CPSR=%08X ",CPSR}` at frame `--start` (or at once for 0) and `trace off` `--frames` later, then exits. The register symbol for the status register is `CPSR` (R0-R15 also exist). Everything lands in the git-ignored `tests/mame_traces/`; the trace is a disassembly of the firmware and is never committed. `survey_trace.py` reduces a trace to counts. ## Results (2026-11-26, 3do_fz10, panafz10.bin SHA-1 3c912300...) | Window | Instructions | Wall time | Modes | Notes | | --- | --- | --- | --- | --- | | reset, 2 frames (to 0.034 s) | 214,148 | 3.6 s | svc32 only | 572 distinct PCs; a delay loop dominates | | frames 300-310 (5.29 s) | 871,549 | about 4 s | usr32 689,943, svc32 112,509, fiq32 69,097 | 1,995 distinct PCs; one 4-instruction loop in user mode is 79% | Counts are in `tests/detectors/mame-trace-fz10-*.txt`. Facts read from the run: - At reset the CPU fetches from address 0 and sees ROM there: the firmware's first instructions run at 0x0, then branch into 0x0300_0000+ (the ROM's home). So the board overlays ROM at 0 at reset (3do-python docs/memory-map.md; OBSERVED in MAME, which is the emulator's model, consistent with patent WO1994010641's boot description). - The firmware's status register is 0xD3 at reset (SVC32, I and F set) and later shows usr32, svc32, fiq32: the firmware is written for the 32-bit configuration. (MAME's ARM7 cannot be in a 26-bit mode at all, so this shows the firmware's intent, not the board's PROG32/DATA32 straps; U5.) - FIQ is the 3DO's main interrupt (CLIO drives nFIQ; 3do-python docs/clio.md): 8% of the window runs in fiq32. - MAME executes about 6.3 M instructions per emulated second in the reset window (214,148 in 0.0341 s) and about 5.2 M in frames 300-310 (871,549 in 10 frames of 1/60 s, i.e. about 87,000 per frame). That is about 2 cycles per instruction at 12.5 MHz: MAME's timing model, not a measurement, but a usable order of magnitude for the speed estimate. ## Not done No disc was run (the compute rule: no emulator over a library). A later session may run one or two homebrew programs from trapexit's devkit (built locally, never committed) as longer detector baselines.