# MAME Power Macintosh仿真取得进展：Claude Code协助修复多项Bug

- 来源：Hacker News 热门（buzzing.cc 中文翻译）
- 作者：ingve
- 发布时间：2026-06-18 23:09
- AIHOT 分数：52
- AIHOT 链接：https://aihot.virxact.com/items/cmqjndi380528slmh3qjw6dkw
- 原文链接：https://rbelmont.mameworld.info/?p=1725

## AI 摘要

开发者使用Claude Code控制并调试MAME的Power Macintosh仿真。Claude通过生成Lua脚本和修改日志，发现了6522 VIA仿真故障、PowerPC DRC缓存值未覆盖实际状态的反模式、PowerPC 601的两处Bug，以及原子加载/存储指令模拟错误。修复后，Pippin播放启动音并显示Logo、鼠标可移动；PowerMac 7200显示启动磁盘搜索画面；PowerMac 6100成功启动System 7.5.3和7.5.5。此外，GPT 5.5 Pro（经Codex）在固件逆向中能快速给出内存映射和子程序猜测。

## 正文

This page will include WIP screenshots and other fun stuff for MAME™, M1, and whatever else I'm working on.

6/16/2026

I need your clothes, your boots, and your motorcycle

One of the reasons little progress was made on the Power Macintosh emulation in MAME for a long time is that it’s very tedious to debug. There’s a lot of code surface, it’s written in 3 languages (PowerPC, emulated 680×0, and compiled FORTH), and I’m not as familiar with the innards of the newer stuff like the Code Fragment Manager as I am with the behavior of the 680×0 codebase. So, this being 2026, I asked Claude Code if it could control and debug MAME. It came back with “yes, with limitations” and after a few tries settled in to using a combination of generating custom Lua boot scripts and modifying MAME to log what’s happening to a file.

So I pointed it at the Pippin and said “That doesn’t boot and it makes me sad”. (Not really. The actual prompt was not about my feelings, but rather informed by my previous attempts to debug it myself). In pretty short order it found that communication with the Cuda 68HC05 was failing due to a glitch in MAME’s 6522 VIA emulation. Fixing that got us not much farther, but after about a week it had found half a dozen things wrong with MAME’s PowerPC emulation and several other things wrong with MAME’s support for PCI-era Macintosh hardware. So the Pippin now played its (kinda creepy) startup sound and showed the initial “P!P P!N” box logo, plus you could move the mouse pointer around the screen like it was a not-very-secret Macintosh or something. Vas noticed an anti-pattern in the PowerPC DRC where values from when the code was generated and cached were used during execution instead of the actual live machine state (something that’s surprisingly easy to slip into doing when writing a DRC). I can’t point to anything specific that fixed, but it’s 100% a correctness improvement and likely will be silently helpful down the line.

Moving along from that, I wanted to add support for an actual PowerMac with hardware close to the Pippin to track the broader outcome of debugging it. The Power Macintosh 7200 fit that bill nicely (and it uses a variant of the familiar DAFB video used in the Quadras). At first it seemed to be going well, thanks to all of the fixes for the Pippin – it chimed and made it into the startup disk polling routine. But it wasn’t ever initializing the on-board video. I told Claude that’s what was now making me sad and it came up with two bugs in the PowerPC 601 emulation. With those resolved, the main screen now turns on and shows the familiar 3.5″ floppy of the boot search routine. However, the flashing ? that indicates a disk wasn’t found wasn’t working. Still great progress though, and I put it aside.

The next thing the machine got to hear about that was making me sad was that the Power Macintosh 6100 froze when trying to boot any System version newer than 7.5.0. Claude pretty quickly figured out that the difference was a native PowerPC SCSI Manager vs. the emulated 680×0 code in previous System versions, and traced its failure to MAME improperly emulating the PowerPC’s atomic load/store instructions. These are frequently used by interrupt handlers to guarantee safe operation even if another device in the system, such as a second CPU or a DMA controller, has touched memory and told the processor about it. We had a pull request from Sega Model 2 MVP gm-matthew addressing that because it was also breaking some things about the Sega Model 3 arcade games, but it had gotten tied up in review. I grabbed the changes and applied them, and System 7.5.3 and 7.5.5 booted straight to Finder and ran happily (and more efficiently, thanks to the native PowerPC SCSI driver). While regression-testing the changes I found that the same fix also caused the Pippin to advance into its animation showing that you need to insert a CD, and the PowerMac 7200 gained the missing flashing ?. Not bad!

After that, I was sad that the famous Graphing Calculator that shipped with the Power Macs to show some of the increased math power of the new CPUs didn’t work in MAME. Claude quickly pointed out that none of the FPU opcodes updated the status flags, which are not often used in highly optimized arcade games like MAME’s PowerPC core was originally written to support. But they’re very important to computer operating systems and specifically to Apple’s SANE floating point library. I have an in-progress fix there that allows the Graphing Calculator to run the 2D portion of it’s self-demo correctly now, but the 3D part of the demo isn’t working. So some sadness has been ameliorated and as I type this more is being worked on. (UPDATE: 3D works now. Alignment exceptions on the 601 weren’t working properly, something I would’ve expected to have a larger impact than I can prove it has thus far).

Also, AI is quite good at taking the firmware binary for some kind of well-defined device, from a computer keyboard or mouse up to a digital synthesizer, and give you excellent starting guesses about the memory map and where the major subroutines live and what they do. (Tip: tell it the functions of the device and where it can find a copy of MAME’s unidasm disassembler. It can do without, but you’ll get to usable output much faster if you do). GPT 5.5 Pro (via Codex) has been especially good at this for me, but Claude’s no slouch either. Once it’s got a solid preliminary understanding you can write prompts like “Tracing the data flow from a MIDI Note On message, what are the likely functions for each register in the custom sound chip?” and get useful, actionable answers.

A few caveats here, lest this come off as a full endorsement of AI. First off, all of this was accomplished with an experienced emulation programmer (me) supervising the AI and interrupting it to say “hey, stop that!” on the not-infrequent occasions where it was chasing some theoretical problem that was possible but that I believed wasn’t likely. Spoiler alert: I was almost always right. The AI is helpful in many ways, and can randomly pop out with amazing things like “oh, this data structure at 0x123456 is a QuickDraw GrafPort” and be correct, but when it has to actually draw conclusions or make a judgement from the data it can get off track quickly.

Secondly, the AI found the bugs but the fixes for them were written by me except in a few cases of trivial one-liners (and even then I edited them to fit my personal stylistic and naming preferences). MAME does not yet have a formal AI policy, but we don’t want to see “vibe code” submitted (and if you let the AI write your pull request description you will definitely annoy me, never mind some of the more AI skeptical members of the team). You are free to let the AI go wild reverse-engineering and debugging all you want, but at the end of the day MAME needs code that the people submitting it understand and can maintain.

Posted by Arbee in General @ 12:53 pm -

Content

Home
SDLMAME/MESS/HazeMD home
NEStopia Linux home
AO .PSF2 status
AO SDK (source)
My music rips
M1 home
WIP driver downloads

Links

Aaron’s WIP
Audio Overload forum
Audio Overload home
Bobby Tribble's Unemulated Games
Dave Widel's page
David Haywood (Haze)'s WIP
Discrete Logistics
Dox's WIP
FPGA Arcade
Frank Palazzolo's WIP
Kale's MAME WIP
Luca Elia's WIP
MAME E2J, home of BridgeM1
MAME Testers
MAMEdev.org
MAMEWorld
Project 2612 (Genesis VGM rips)
Robiza's WIP
ROP Music Laboratory
Slick's NSFE downloads
SNESMusic
System 16, the Arcade Museum
The MOD Archive
Ville's Development Log
Zophar's music archive

Categories

General

Linux

Non-emulation

Non-MAME/MESS emulation

Things Twisty *may* ban you for posting

Things Twisty will ban you for posting

Archives

June 2026

May 2026

January 2026

January 2025

July 2024

June 2024

October 2023

September 2023

May 2023

March 2023

December 2022

June 2022

May 2022

April 2022

December 2021

November 2021

May 2021

August 2020

March 2019

November 2017

August 2017

July 2016

May 2016

April 2016

March 2016

October 2015

August 2015

June 2015

May 2015

April 2015

March 2015

February 2015

January 2015

December 2014

November 2014

September 2014

June 2014

February 2014

October 2013

September 2013

August 2013

July 2013

June 2013

May 2013

April 2013

January 2013

December 2012

November 2012

September 2012

August 2012

July 2012

March 2012

January 2012

December 2011

November 2011

September 2011

June 2011

May 2011

March 2011

February 2011

January 2011

November 2010

October 2010

September 2010

April 2010

March 2010

February 2010

January 2010

October 2009

August 2009

July 2009

May 2009

April 2009

March 2009

October 2008

September 2008

July 2008

June 2008

May 2008

April 2008

March 2008

February 2008

January 2008

December 2007

November 2007

October 2007

September 2007

August 2007

July 2007

June 2007

May 2007

April 2007

March 2007

February 2007

January 2007

November 2006

October 2006

September 2006

August 2006

July 2006

June 2006

May 2006

April 2006

March 2006

February 2006

January 2006

December 2005

November 2005

October 2005

September 2005

August 2005

July 2005

June 2005

May 2005

April 2005

March 2005

February 2005

January 2005

June 2026

M T W T F S S

1234567

891011121314

15161718192021

22232425262728

2930

Meta

RSS 2.0
Comments RSS 2.0
WordPress

Powered by WordPress
