Claude Code协助开发《Portal 2》原生ARM64移植
AI 总结
开发者 /u/kanapitsas 称,Claude Code 与 Opus 5.5 构建了一套工具,将 Linux 版《Portal 2》约12.5万个函数转换为C代码并编译为原生ARM64,全程不使用模拟器、Wine或Rosetta。生成的应用可在苹果芯片Mac和配备触控的iPhone 15 Pro Max上运行,并支持由Mac托管、其他Mac或iPhone通过IP加入的局域网合作模式。项目还加入了D3D9直连Metal路径;开发者称M3 Pro上的一个场景由OpenGL的81 fps升至122 fps,但不同房间差异较大。
深度见解
该项目以公开仓库、试玩演示、触控操作和局域网合作展示了AI辅助逆向工程如何产出可运行的原生苹果平台移植项目。
| I wanted to play Portal 2 natively on Apple silicon, so we (that is, Opus 5.5 and I) built a tool that translates the Linux release’s machine code into C (about 125,000 functions) and then compiles it to native ARM64. It turns out it took only two days to get a playable room (Claude thought it would take many months). There’s no emulator, Wine or Rosetta involved. You need your own copy of Portal 2. The repo has no game files; the native app is generated on your machine. It’s playable on an iPhone 15 Pro Max with touch controls. You fire portals by tapping the back of the phone: https://youtu.be/YWX2BeMnlQI. You can also use a Bluetooth controller (tested with 8BitDo). Co-op works over LAN: a Mac hosts, and another Mac or an iPhone joins by IP address. We recently replaced OpenGL with a direct D3D9 → Metal path, built on mtld3d (https://github.com/athei/mtld3d). In one scene on an M3 Pro, it ran at 122 fps versus 81 with OpenGL. Numbers vary a lot by room. Claude Code wrote the code; I set the direction, tested on my devices and made the calls. I used Codex as a reviewer and for second opinions when Claude was stuck. Happy to answer questions about the project. Contributions on GitHub are welcome: https://github.com/kanapitsas/portal2-recomp submitted by /u/kanapitsas [link] [comments] |