Image: u/kanapitsas on Reddit · Half-Life 2 running natively on Apple hardware
Half-Life 2 recompiled to run natively on Mac and iPhone
The static recompiler built for Portal 2 translates the Linux version's x86 code into C and compiles it for ARM64. Claude Code (mostly Opus 5.5) wrote the code; Episodes One and Two and Lost Coast run too.
Credits
- Reddit poster kanapitsas Source ↗
- Repository account kanapitsas Source ↗
Earliest dated source:
The full story
After Portal 2, the same static recompiler now runs Half-Life 2 natively on Apple Silicon Macs and iPhones, along with Episode One, Episode Two and Lost Coast. It translates the x86 code of the Linux version into C and compiles that for ARM64, with no emulator, Wine or Rosetta. An earlier native port relied on leaked code; this one does not.
Claude Code, mainly Opus 5.5, wrote the code while the maker tested and decided. On day one Claude added per-game profiles, the SSSE3 instructions and Linux imports Half-Life 2 needs, bridged its newer Steam SDK, fixed texture filtering (macOS's OpenGL lacks sampler objects) and moved it onto Metal with Portal 2's Direct3D 9 bridge. Day two brought performance work and an iOS build with touch controls. It reaches 120 fps with Metal on an M3 Pro at 1280×720 and 60 fps on an iPhone 15 Pro Max.
An installer app finds the player's own Steam games and builds them locally in 10 to 20 minutes. No game files are included, players must own the games, and built apps shouldn't be shared. Half-Life 2 is marked experimental and the episodes have only been tested as far as their first maps.
How it was done
Tools
Themes
Loading themes…
Sources
From a short post by the maker, so the details are as they tell them.
- Reddit: Half-Life 2 running natively on Mac and iPhone (static recompilation)Reddit poster: kanapitsasPosted
The maker's post in r/ClaudeAI.
- The code: github.comRepository account: kanapitsas
The recompiler's repository, covering Portal 2 and Half-Life 2.