Portal 2 recomp

Portal 2 translated to native ARM64 code, playable on Mac and iPhone.

Status
in progress
Year
2026
Built with
Python · C · SDL2 · gl4es · OpenGL ES

Source code github.com

Why

Many games have been ported to Apple Silicon with the help of LLMs. Work that would have taken months, even years, done in a few days. I wanted to try it myself. The goal: Portal 2, a game I am particularly fond of, on Mac, and why not iPhone. In the end, it took Claude 48 hours under my supervision, with my help for testing. The result is smooth and fully playable.

How

Portal 2 has a Linux version, built for 32-bit x86. The project translates its machine code to C, function by function, then compiles the result to ARM64 for macOS and iOS. No emulator, no Wine, no Rosetta. The whole game is about 125,000 functions and 15 million instructions.

A small runtime supplies what the Linux binaries expect: libc, threads, SDL2, OpenGL, Steam. On iPhone, gl4es converts OpenGL 2.1 to OpenGL ES, and a UIKit layer adds the touch controls.

On an iPhone 15 Pro Max, the game runs at 60 frames per second with 4× MSAA, and portals are fired by tapping the back of the phone (accelerometer and gyroscope). A video shows the result.

You must own the game. The repository contains no Valve files and no decompiled code: everything is generated on your machine from your own copy. Fan project, not affiliated with Valve.

Written in a few days of October 2026, with Claude Code and Codex under my direction.