AI-Assisted Debugging in MAME: Power Mac Emulation Gets a Boost

MAME developer R. Belmont spent a week using Claude Code to debug Power Macintosh emulation. The AI identified six bugs in MAME's PowerPC emulation and several issues with PCI-era Mac hardware support. The result: the Pippin (a Mac-based game console) now plays its startup sound and shows its logo, the Power Macintosh 7200 boots to a floppy search screen, and the 6100 runs System 7.5.3 and 7.5.5 to the Finder.

The Method: AI as a Debugging Assistant

Belmont gave Claude Code the prompt: "That doesn't boot and it makes me sad" (paraphrased). The AI used a combination of generating custom Lua boot scripts and modifying MAME to log events to a file. It quickly found that communication with the Cuda 68HC05 microcontroller was failing due to a glitch in MAME's 6522 VIA emulation. Fixing that didn't get much further, but over a week it unearthed half a dozen issues in the PowerPC emulation and several PCI hardware bugs.

Vas Crabb, another MAME developer, noticed an anti-pattern in the PowerPC DRC: values from cached code generation were used instead of live machine state. This is a subtle bug in dynamic recompilation that can silently corrupt execution.

Specific Bugs Found

  1. 6522 VIA emulation glitch — broke Cuda communication on Pippin.
  2. PowerPC 601 emulation bugs — two issues preventing Power Mac 7200 video initialization. After fixes, the screen turned on and showed the floppy boot icon.
  3. Atomic load/store instruction emulation — broken in PowerPC core. These instructions are critical for interrupt handlers and DMA safety. A fix from Sega Model 3 contributor gm-matthew had been stuck in review; Belmont applied it. This fixed boot on the 6100 (System 7.5.3+), added the flashing question mark on the 7200, and advanced the Pippin to its CD insert animation.
  4. FPU status flags not updated — broke Apple's SANE floating-point library and the Graphing Calculator. A partial fix allows 2D rendering; 3D now works after also fixing alignment exceptions on the 601.

AI's Role: Reverse Engineering Firmware

Belmont also used GPT 5.5 Pro (via Codex) to reverse-engineer firmware for well-defined devices. The trick: tell the AI the device's functions and point it to MAME's unidasm disassembler. It can then guess memory maps, subroutine locations, and function purposes. For example, "Tracing the data flow from a MIDI Note On message, what are the likely functions for each register in the custom sound chip?" yields actionable answers.

Caveats: AI Is Not Autonomous

Belmont emphasizes that all fixes were written by humans. The AI often chased improbable theoretical problems; Belmont interrupted it when it went off track. MAME does not yet have a formal AI policy, but "vibe code" submissions are not welcome. Code must be understood and maintainable by the submitter.

What This Means for Emulation

These fixes improve emulation for multiple Power Macs: Pippin, 6100, 7200. The atomic load/store fix also benefits Sega Model 3 arcade emulation. The approach — using AI to narrow down bugs while a human writes the fix — is a practical workflow for complex legacy codebases.

Next Steps

Belmont continues working on the Graphing Calculator's 3D demo. The fixes are likely to be merged into MAME's mainline. Developers interested in PowerPC emulation or MAME internals can follow the commits or contribute via the MAME project.