[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110775":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":13,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":31,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":35,"discoverSource":36},110775,"source-recomp","kanapitsas\u002Fsource-recomp","kanapitsas","Portal 1 & 2 and Half-Life 2 statically recompiled from their Linux x86 binaries to native ARM64: playable on macOS and iPhone. Bring your own copy of the games.",null,"C",139,18,1,2,0,13,42,6,56.54,"GNU General Public License v3.0",false,"main",true,[25,26,27,28,29,30],"apple-silicon","half-life-2","ios","macos","portal-2","static-recompilation","2026-11-22 15:31:52","2026-11-22 21:44:55","# Portal 2 and Half-Life 2, statically recompiled for Apple silicon\n\n[![Portal 2 running natively on iPhone (video)](https:\u002F\u002Fimg.youtube.com\u002Fvi\u002FYWX2BeMnlQI\u002Fmaxresdefault.jpg)](https:\u002F\u002Fyoutu.be\u002FYWX2BeMnlQI)\n\n*Video: Portal 2 running natively on an iPhone 15 Pro Max.*\n\n\u003Cp>\n  \u003Cimg src=\"docs\u002Fimages\u002Fiphone-menu.jpg\" alt=\"Portal 2 main menu on iPhone, 60 fps\" width=\"49%\">\n  \u003Cimg src=\"docs\u002Fimages\u002Fiphone-ingame.jpg\" alt=\"Portal 2 in game on iPhone with touch controls\" width=\"49%\">\n\u003C\u002Fp>\n\nThis project builds native Mac and iPhone apps from your own copies of\nPortal 2 and Half-Life 2 (with Episode One, Episode Two and Lost Coast). It\ntranslates the x86 code of the Linux versions into C, then compiles it for\nApple silicon. No emulator, no Wine, no Rosetta.\n\n**You must own the games.** This repository has no game files and no Valve\ncode: everything is generated on your machine from your own copy. The app and\nthe generated code contain Valve's game, so keep them for yourself and don't\nshare them.\n\n> Unofficial fan project, not affiliated with or endorsed by Valve. Portal,\n> Portal 2, Half-Life, Steam and Source are trademarks of Valve Corporation.\n> Provided as is, without warranty.\n\n## Status at a glance (8 November 2026)\n\n**Portal 2**: fully playable.\n\n- **Mac**: on an M3 Pro, Metal (the default) runs a scene at 122 fps where\n  OpenGL gets 81 (2560×1440, MSAA 4×;\n  [measurements](STATUS.md#measurements)).\n- **iPhone**: steady 60 fps on an iPhone 15 Pro Max, with touch controls and\n  portals fired by **tapping the back of the phone**.\n- **Controllers**: work on Mac and iPhone (tested with an 8BitDo SN30 Pro).\n  On Mac, turn Steam Input off for Portal 2.\n- **Co-op** over the local network: a Mac hosts, an iPhone or a second copy\n  on the same Mac joins. Connection and map load are checked; a full co-op\n  course has not been played yet.\n\n**Half-Life 2** (experimental), with Episode One, Episode Two and Lost Coast\n([details](#half-life-2-experimental)):\n\n- **Mac**: 120 fps with Metal on an M3 Pro at 1280×720. Players report an hour on an M4 Pro with no issue, and mostly\n  60 fps (dips to 50) on an M4 Air at 2560×1664, maximum settings, with a\n  DualShock 4.\n- **Episodes and Lost Coast**: their first maps load; they have not been\n  played through.\n- **iPhone**: 60 fps on an iPhone 15 Pro Max, with touch controls and gyro\n  aiming, in a short test.\n\n**Both games**\n\n- **Install**: the Natif Installer app from the\n  [releases](https:\u002F\u002Fgithub.com\u002Fkanapitsas\u002Fsource-recomp\u002Freleases), or one\n  command, `setup.sh`, for either game or both. Only the Xcode command line\n  tools are required.\n- **Multiplayer**: only Portal 2's LAN co-op. No Steam invites or online\n  play, and Half-Life 2: Deathmatch is not supported.\n\n## How it works\n\n1. `tools\u002Felfprep.py` and `tools\u002Fgameprep.py` lay out the Linux ELF modules\n   (`engine.so`, `client.so`, ...) at fixed guest addresses, apply their\n   relocations offline and record imports, exports and entry points.\n2. `tools\u002Flift.py` translates every x86 function into a C function; `clang`\n   compiles the result together with the runtime into one ARM64 executable\n   (`build\u002Fportal2-native`; `build\u002Fhl2\u002Fhl2-native` for Half-Life 2). Indirect call targets that the static pass\n   misses are collected at run time into `config\u002Fgame-roots.json`.\n3. The runtime (`runtime\u002F`) implements what the binaries import: libc,\n   pthreads and futexes, SDL2, OpenGL, Direct3D 9 and Steam. Guest threads\n   are real threads serialized by one lock, the guest gate\n   ([docs\u002Ffast-path.md](docs\u002Ffast-path.md)).\n4. Steam calls are forwarded to Valve's own arm64 `libsteam_api.dylib`\n   (from Steamworks.NET) through generated i386 → arm64 proxies; there is no\n   Steam emulator ([docs\u002Fsteam.md](docs\u002Fsteam.md)).\n5. Rendering has two paths. The default is Valve's `shaderapivk.so` talking\n   to **mtld3d**, a native Direct3D 9 on Metal\n   ([docs\u002Fd3d9-bridge.md](docs\u002Fd3d9-bridge.md)); mtld3d is the project, the\n   library it builds is `libd3d9metal`. The fallback is Valve's `togl`,\n   translating Direct3D 9 to legacy OpenGL 2.1\n   ([docs\u002Fgl-audit.md](docs\u002Fgl-audit.md)).\n6. On iPhone the OpenGL path goes through gl4es, with every shader rewritten\n   to GLSL ES 3.00 ([docs\u002Fios.md](docs\u002Fios.md)); the Metal path is linked\n   statically.\n\n## What you need\n\n- An Apple silicon Mac on macOS 13 or newer with the Xcode command line tools\n  (`xcode-select --install`, which also brings Python 3.9). SDL2, FreeType,\n  Fontconfig and the Metal renderer come prebuilt from this project's\n  releases (about 4 MB, SHA-256 checked); with\n  `brew install sdl2 freetype fontconfig`, Homebrew's are used instead.\n- Portal 2 on Steam:\n  - the game folder (the one with `portal2\u002F`, `platform\u002F` and `bin\u002F`); the\n    Windows version works;\n  - the Linux binaries: open the Steam console (`open steam:\u002F\u002Fopen\u002Fconsole`)\n    and type `download_depot 620 661` (about 90 MB).\n- And\u002For Half-Life 2 on Steam:\n  - the game data (the current version, with `hl2_complete\u002F`): install it\n    with Steam, or use `download_depot 220 221` in the Steam console;\n  - the Linux binaries: `download_depot 220 224` (about 320 MB).\n  Wait for “Depot download complete” for each download.\n- Optional: Rust 1.99 or newer from [rustup](https:\u002F\u002Frustup.rs) builds the\n  Metal renderer from source instead of using the prebuilt one; the iPhone\n  app needs it for Metal (Homebrew's `rust` has no iOS target).\n- For iPhone: Xcode with your Apple ID (a free account works),\n  `brew install xcodegen cmake ninja`, an iPhone on iOS 17 or newer\n  connected by cable with Developer Mode on, and about 12 GB free on it.\n  Tested on an iPhone 15 Pro Max only.\n\n## Install on Mac\n\n**Without Terminal**: download `Natif-Installer-\u003Cversion>.zip` from the\n[latest release](https:\u002F\u002Fgithub.com\u002Fkanapitsas\u002Fsource-recomp\u002Freleases\u002Flatest),\nunzip it and open **Natif Installer**. It is signed; if macOS refuses to\nopen it, go to System Settings > Privacy & Security and click **Open\nAnyway**. The installer checks the Xcode command\nline tools (and offers to install them), finds Portal 2, Half-Life 2 and\ntheir Linux binaries (with the Steam console commands to paste when they are\nmissing), lets you tick the games to build, then runs `setup.sh` for you.\nIts copy of the code and the builds (about 5 GB per game) live in\n`~\u002FLibrary\u002FApplication Support\u002FPortal 2 Natif Build`, as with the first\nPortal 2 installer, so an update rebuilds only what changed; its log is\n`~\u002FLibrary\u002FLogs\u002FNatifInstaller.log`.\n\n**With Terminal**:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fkanapitsas\u002Fsource-recomp.git\ncd source-recomp\n.\u002Fsetup.sh                    # every game found: Portal 2, Half-Life 2 or both\n.\u002Fsetup.sh --game hl2         # one game (portal2, hl2), or --game all for both\n.\u002Fsetup.sh \"\u002Fpath\u002Fto\u002FPortal 2\" \"\u002Fpath\u002Fto\u002Fdepot_661\"   # folders Steam did not put in the usual place\n```\n\nWithout paths, `setup.sh` looks where Steam usually puts the games and their\nLinux binaries, and builds each game it finds complete (`.\u002Fsetup.sh --detect`\nlists them without building). It downloads Valve's `libsteam_api.dylib`\n(from Steamworks.NET, SHA-256 checked), builds each game (about 10 minutes\nfor Portal 2 and 10 to 20 for Half-Life 2 the first time) and creates\n`~\u002FApplications\u002FPortal 2 Natif.app` and\u002For `Half-Life 2 Natif.app`.\nRe-running it is safe and quick, and adding the second game later does not\nrebuild the first. \"Natif\" is French for native; the name is kept so\nexisting installs are updated in place.\n\nEach app contains its own executable and libraries; the game files stay\nwhere Steam put them. After a rebuild or a change to `config\u002Flocal.json`, run\n`python3 tools\u002Fmake_app.py` (`--game hl2` for Half-Life 2) to update the app\n(`--dest` for another folder).\nDownloads and iOS libraries go to `deps\u002F` (`P2_DEPS` overrides it).\n`P2_HOST_DEPS=homebrew` or `bundle` forces where the host libraries come\nfrom; `P2_APP_DIR` puts the app elsewhere than `~\u002FApplications`.\n\n## Install on iPhone\n\nFirst create an Apple Development certificate (Xcode > Settings > Accounts >\nManage Certificates > + > Apple Development), then:\n\n```sh\n.\u002Fsetup.sh --ios              # every game found; --game hl2 for one, or paths as on Mac\n```\n\nIt builds, signs and installs each app and copies the game data (once:\nabout 11.5 GB for Portal 2, 10 GB for Half-Life 2; `tools\u002Fios_device.sh\ndata` copies it again after a reinstall). Half-Life 2's iPhone app is\nexperimental ([docs\u002Fhl2.md](docs\u002Fhl2.md#iphone)).\nOn the phone, trust your account in Settings > General > VPN & Device\nManagement. With a free account, re-run `.\u002Fsetup.sh --ios` every 7 days.\n`P2_TEAM_ID` sets the team when it cannot be read from the certificate;\n`P2_DEVICE` picks the iPhone when several are connected.\nMore in [docs\u002Fios.md](docs\u002Fios.md).\n\n## Play\n\nOn Mac, open Steam with the account that owns the game, then open\n**Portal 2 Natif** or **Half-Life 2 Natif** (it starts Steam if needed). The game language follows\nyour `-language` argument, `P2_LANGUAGE`, `config\u002Flocal.json`, then Steam\nand macOS ([details](docs\u002Fusage.md#game-language)).\n\nOn iPhone: left stick to move, right half of the screen to look, buttons to\njump, crouch, use and pause, and a tap on the back of the phone (left or\nright) to fire a portal. Everything is tunable in Settings > Portal 2. The\niPhone version has no Steam, but it can join a Mac in LAN co-op. Half-Life 2\nhas its own touch layout ([docs\u002Fhl2.md](docs\u002Fhl2.md#iphone)).\n\n**Controllers** work on both. On Mac, turn Steam Input off for Portal 2 in\nSteam (Properties > Controller), otherwise Steam keeps the controller to\nitself ([why](docs\u002Fusage.md#controllers)). On iPhone, the on-screen controls\nhide themselves when a controller connects.\n\n**Co-op** works over the local network: a Mac hosts, and an iPhone or a\nsecond copy on the same Mac joins by IP address\n([how](docs\u002Fusage.md#lan-co-op-portal-2)). Two separate Macs, Steam invites and play\nover the internet are not tested.\n\n## Renderer: Metal or OpenGL\n\nThe game renders with **Metal** when `libd3d9metal` is available, and with\n**OpenGL** otherwise. Metal measured about +50 % fps on a Mac and +20–25 % on\nan iPhone, and fixes the too-dark image of OpenGL on iPhone.\n\n- If Rust is installed, `setup.sh` fetches and builds `libd3d9metal` (about a\n  minute) from a pinned commit of\n  [mtld3d's native host branch](https:\u002F\u002Fgithub.com\u002Fkanapitsas\u002Fmtld3d\u002Ftree\u002Ffeat\u002Fnative-host).\n  Without Rust it uses the prebuilt library from the same commit (in the\n  host libraries download); if neither works, the game uses OpenGL. If the build fails,\n  a library built by an earlier run is kept as long as its file still\n  exists; otherwise OpenGL. `P2_NO_METAL=1 .\u002Fsetup.sh` skips it.\n- The end of `setup.sh` tells which renderer the Mac app and the iPhone app\n  use. The iPhone library is built separately and can still fall back to\n  OpenGL.\n- `P2_RENDERER=opengl` forces OpenGL; on iPhone, use Settings > Portal 2 >\n  Rendering > Renderer.\n- **F3** on Mac shows the renderer and the frame rate; on iPhone, the counter\n  in the top-left corner does.\n\nDetails: [docs\u002Fd3d9-bridge.md](docs\u002Fd3d9-bridge.md).\n\n## Uninstall\n\n```sh\n.\u002Funinstall.sh\n```\n\nFor each game installed, it asks before moving the app and its log to the\nTrash, and asks again for the saves; then, on its own yes, the installer's\nbuild folder. It never touches the Steam game files or the Linux binaries.\n\n## Half-Life 2 (experimental)\n\nThe same recompiler also turns the Linux version of **Half-Life 2** (the\ncurrent Steam build, 20th anniversary update) into a native Mac app. **You\nmust own Half-Life 2**; as for Portal 2, nothing from Valve is in this\nrepository.\n\nInstall Half-Life 2 with Steam, or fetch its game data from the Steam console\nwith `download_depot 220 221`. Also fetch its Linux binaries with\n`download_depot 220 224` (about 320 MB). Wait for “Depot download complete”\nfor each download. Then tick it in the\ninstaller, or run `.\u002Fsetup.sh` (or `.\u002Fsetup.sh --game hl2`) in the same\ncheckout as Portal 2: each game has its own build folder. It creates\n`~\u002FApplications\u002FHalf-Life 2 Natif.app`, with its own saves folder.\n\n- **Tested**: a few hours of the main game on an M3 Pro, at 1280×720:\n  120 fps with Metal (the display's limit; the default, as for Portal 2) and 91 with\n  OpenGL (`--release` build).\n- **iPhone**: `.\u002Fsetup.sh --game hl2 --ios` builds the app; 60 fps on an\n  iPhone 15 Pro Max in a first short test ([docs\u002Fhl2.md](docs\u002Fhl2.md#iphone)).\n- **Dark indoors**: by design, the maps cap the exposure. Use the flashlight\n  (F) or raise Options > Video > Brightness.\n- **Episodes and Lost Coast**: start them from the main menu (HL2:\n  Episode One, HL2: Episode Two; Lost Coast is under Extras). Their first\n  maps load and render on Metal; they have not been played through.\n- **Not yet**: some indirect call targets are still being found: a crash\n  ending with `target not recompiled` is one more to add (please report it\n  with the log, `~\u002FLibrary\u002FLogs\u002FHalfLife2Natif.log`).\n\nDetails, manual setup and measurements: [docs\u002Fhl2.md](docs\u002Fhl2.md).\n\n## Troubleshooting\n\n- **\"Portal 2 game data is incomplete\"**: the game needs\n  `portal2_dlc2\u002Fscripts\u002Feditoritems.txt` even when you only play the campaign.\n  The installer checks for a readable, nonempty file before building, and the\n  app checks again before launching (an empty placeholder file is reported\n  too: the game needs the real item definitions). In Steam, right-click\n  Portal 2 > Properties > Installed Files > Verify integrity of game files;\n  or fetch the complete data with `download_depot 620 621` and select\n  `depot_621` in the installer. No rebuild is needed: the data is read at\n  launch. Automatic detection prefers a complete copy over an incomplete\n  Steam folder. An empty user override can also mask the original; the\n  launch error names the effective file. This check detects missing or empty\n  data, not every possible malformed or modded file.\n- **\"Steam is not running\"**: the engine exits without a logged-in Steam\n  client. Open Steam first (the app tries to start it).\n- **\"Failed to create D3D9!\"**: `-vulkan` was passed but `libd3d9metal` is\n  missing or failed to initialize. Drop `-vulkan` or set `P2_RENDERER=opengl`.\n- **No music or voices**: `setup.sh` warns when `bin\u002Flinux32\u002Fmssmp3.asi`,\n  `mssvoice.asi` or `binkawin.asi` is missing from the game folder (Miles\n  decodes the MP3 voice lines with them). They come with the Linux game data\n  (`download_depot 620 621`); a Windows copy may lack them.\n- **iPhone app stops launching after a week**: free Apple accounts give\n  7-day profiles and allow 3 sideloaded apps; re-run `.\u002Fsetup.sh --ios`.\n- **Logs**: Mac, `~\u002FLibrary\u002FLogs\u002FPortal2Natif.log` (and\n  `HalfLife2Natif.log`); iPhone,\n  `Documents\u002Fgame.log` in the app's files once the Journal setting is on\n  (`tools\u002Fios_device.sh run` pulls it back).\n- Diagnostics variables: [docs\u002Fusage.md](docs\u002Fusage.md#diagnostics) (Mac) and\n  [docs\u002Fios.md](docs\u002Fios.md#diagnostics) (iPhone).\n\n## Roadmap and limits\n\nEach game is built and tested against one release of its Linux binaries\n(Portal 2: depot 661, manifest 8940703274703023246; Half-Life 2: depot 224);\nanother release may need new indirect call roots. iOS has no Steam features (achievements, invites, cloud saves); co-op\nthere is LAN only. A free Apple account allows 3 sideloaded apps and 7-day\nprofiles.\n\n✅ Done · 🚧 In progress · 📅 Planned · 💡 Idea\n\n| Area | Item | Status |\n|---|---|:---:|\n| Core | Static recompilation of the Linux x86 binaries into native ARM64 C, no emulator | ✅ |\n| Mac | Single player fully playable, 235–280 fps on an M3 Pro (OpenGL) | ✅ |\n| Mac | Steam bridge through Valve's official macOS `libsteam_api` (no Steam emulator) | ✅ |\n| Rendering | Metal renderer through mtld3d (about +50 % fps on Mac), OpenGL fallback | ✅ |\n| iPhone | Single player at a steady 60 fps, touch controls, Settings page | ✅ |\n| iPhone | Portals fired by tapping the back of the phone | ✅ |\n| iPhone | Pause in the background, haptic feedback, 30\u002F40 fps caps with auto power saving, MetalFX upscaling | 🚧 |\n| Install | One-command install (`setup.sh`) and the Natif Installer app, for one game or both | ✅ |\n| Co-op | LAN co-op: a Mac hosts, an iPhone or a second copy on the same Mac joins by IP address | ✅ |\n| Co-op | Find the host automatically on the local network (Bonjour), host\u002Fjoin in the iPhone settings | 🚧 |\n| Co-op | Play a full co-op course with two people (only the connection and the map load are checked so far) | 📅 |\n| Co-op | Co-op through Steam invites, over the internet and with Windows or Linux players | 📅 |\n| iPhone | Record raw back taps from the Settings page | 🚧 |\n| iPhone | Learn each player's back taps automatically from those recordings, instead of fixed thresholds | 📅 |\n| Saves | Copy saves between Mac and iPhone over the cable ([how](docs\u002Fusage.md#saves-between-mac-and-iphone-portal-2)); an iCloud version would need a paid Apple developer account | 🚧 |\n| Controllers | Physical controller on Mac (needs Steam Input off for Portal 2, [why](docs\u002Fusage.md#controllers)) and iPhone, tested with an 8BitDo in Switch mode | ✅ |\n| Controllers | A full playthrough with a controller, and other controllers (Xbox, DualSense) | 📅 |\n| Controllers | Button prompts and default bindings that match the controller | 💡 |\n| Community | Community maps copied by hand, loaded with `+map` | 📅 |\n| Community | Steam Workshop on Mac (needs the UGC part of the Steam bridge) | 💡 |\n| Half-Life 2 | Mac app from the same recompiler, installer and checkout as Portal 2, main game played for a few hours | 🚧 |\n| Half-Life 2 | iPhone app: 60 fps on an iPhone 15 Pro Max in a first short test (`.\u002Fsetup.sh --game hl2 --ios`, [details](docs\u002Fhl2.md#iphone)) | 🚧 |\n| Half-Life 2 | The episodes and Lost Coast: first maps load and render, not played through | 🚧 |\n| Rendering | Ray-traced lighting with Metal on M3 and A17 Pro GPUs, in the spirit of Portal with RTX (NVIDIA's RTX Remix is Windows and NVIDIA only, so it cannot be reused) | 💡 |\n\n## Repository layout\n\n- `src\u002F`: `main.c`, the host entry point (`--images`, `--game-dir`,\n  `--linux-root`, `--user-dir`, then the game's arguments).\n- `runtime\u002F`: the native runtime (libc, threads, SDL, GL, D3D9, Steam shims);\n  `runtime\u002Fios\u002F` for the iPhone.\n- `tools\u002F`: ELF preparation, the lifter, build and run scripts, benchmarks.\n- `tests\u002F`: Python tests (`test_*.py`) and C checks (`checks_*.c`) linked\n  into `abi-smoke`.\n- `ios\u002F`: app shell, Settings bundle, dependency build, signing project.\n- `installer\u002F`: the Mac installer app (SwiftUI, one file).\n- `config\u002F`: `game-roots.json` and `hl2-roots.json` (indirect call roots\n  of Portal 2 and Half-Life 2); `local.json` is yours and ignored by git.\n- `docs\u002F`: the documents listed below. `experiments\u002F`: the Steam init probe and the HID controller probe.\n- `build\u002F` and `deps\u002F`: generated, ignored by git. Portal 2 builds in\n  `build\u002Fgame` (and `build\u002Fios`), Half-Life 2 in `build\u002Fhl2`.\n\n## Development and tests\n\n- `make check`: Python tests and `build\u002Fabi-smoke`, no game files needed.\n- `make test INPUT_DIR=\u002Fpath\u002Fto\u002Fdepot_661\u002Fbin\u002Flinux32`: the full run; the\n  path defaults to `linux_root` in `config\u002Flocal.json`. `make sanitize` is\n  the UBSan variant.\n- `P2_STEAM_TESTS=1 make test`: live Steam tests, with the client running.\n- Releases: `tools\u002Fbuild_host_deps.sh` builds the prebuilt host libraries\n  (then update `HOST_DEPS_*` in `setup.sh`), `tools\u002Fbuild_installer.sh` the\n  installer app and its zip; see [docs\u002Fusage.md](docs\u002Fusage.md#releases).\n- CI (`.github\u002Fworkflows\u002Fci.yml`, macos-15): the Python tests, `abi-smoke`\n  and `abi-smoke-ubsan`. It cannot build the full game, whose files are not\n  in the repository.\n- Manual build, run and diagnostics: [docs\u002Fusage.md](docs\u002Fusage.md).\n  Project rules and bridge conventions: [CLAUDE.md](CLAUDE.md).\n\n## Documentation\n\n- [docs\u002Fusage.md](docs\u002Fusage.md): language, controllers, LAN co-op, manual build, diagnostics\n- [docs\u002Fhl2.md](docs\u002Fhl2.md): Half-Life 2 (experimental)\n- [docs\u002Fios.md](docs\u002Fios.md): iOS port, controls, settings, back taps\n- [docs\u002Fbacktap.md](docs\u002Fbacktap.md): back-tap detector, recordings and dataset\n- [docs\u002Fd3d9-bridge.md](docs\u002Fd3d9-bridge.md): Metal renderer (Direct3D 9 bridge)\n- [docs\u002Fsteam.md](docs\u002Fsteam.md): Steam bridge\n- [docs\u002Ffast-path.md](docs\u002Ffast-path.md): fast memory mode and direct calls\n- [docs\u002Fgl-audit.md](docs\u002Fgl-audit.md): OpenGL audit of togl (25 Oct. 2026)\n- [docs\u002Flifter-coverage.md](docs\u002Flifter-coverage.md): lifter coverage\n- [STATUS.md](STATUS.md): the development log, with every measurement\n\n## Credits\n\n- [mtld3d](https:\u002F\u002Fgithub.com\u002Fathei\u002Fmtld3d) (zlib) by Alexander Theissen,\n  the Direct3D 9 on Metal behind the Metal renderer; its Wine-free build is\n  discussed in [athei\u002Fmtld3d#1193](https:\u002F\u002Fgithub.com\u002Fathei\u002Fmtld3d\u002Fissues\u002F1193).\n- [gl4es](https:\u002F\u002Fgithub.com\u002FptitSeb\u002Fgl4es) (MIT) by ptitSeb, patched for iOS.\n- [SDL2](https:\u002F\u002Flibsdl.org) (zlib), [FreeType](https:\u002F\u002Ffreetype.org) (FTL).\n- [Steamworks.NET](https:\u002F\u002Fgithub.com\u002Frlabrecque\u002FSteamworks.NET) (MIT), whose\n  interface metadata generates the Steam bridge.\n- Touch controls inspired by\n  [MacNativeGames](https:\u002F\u002Fgithub.com\u002Fly05010419\u002FMacNativeGames) (MIT).\n\nBuilt in October and November 2026 by Raphaël Kanapitsas, with AI coding agents\n(Anthropic's Claude Code and OpenAI's Codex) writing most of the code under\nhis direction. The history and [STATUS.md](STATUS.md) show the whole process.\n\n## License\n\nCopyright (C) 2026 Raphaël Kanapitsas and contributors.\n\n[GNU GPL v3.0](LICENSE). It does not cover Portal 2, Half-Life 2 or any Valve material.\n","该项目将《Portal 2》和《Half-Life 2》的 Linux x86 二进制文件通过静态反编译（static recompilation）转换为 ARM64 原生代码，生成可在 Apple Silicon Mac 和 iOS 设备（如 iPhone）上直接运行的本地应用。核心采用将 x86 机器码翻译为 C 语言中间表示、再编译为 ARM64 的技术路径，不依赖 Rosetta、Wine 或模拟器；支持 Metal 加速、触控操作、背部轻点触发传送门、陀螺仪瞄准及本地局域网联机。适用于拥有正版游戏的 macOS\u002FiOS 用户在 Apple 芯片设备上原生运行经典 Source 引擎游戏。","2026-11-24 04:39:35","CREATED_QUERY"]