Claude Code helps create native ARM64 Portal 2 port for Mac and iPhone
Developer /u/kanapitsas said Claude Code and Opus 5.5 built a tool that converts about 125,000 functions from the Linux release of Portal 2 into C and compiles them as native ARM64, without an emulator, Wine or Rosetta. The resulting app can run on Apple silicon Macs and an iPhone 15 Pro Max with touch controls, while LAN co-op lets a Mac host another Mac or iPhone joining by IP address. The project also includes a direct D3D9-to-Metal path, with one M3 Pro scene reported at 122 fps versus 81 fps using OpenGL, though results varied by room.
The project demonstrates a substantial AI-assisted reverse-engineering workflow that produced a playable native Apple-platform port, with an open repository, gameplay demo, touch controls and LAN co-op available for inspection.
| 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] |