Русский · English
Без цензуры: я, блять, сделал так, что игры с Xbox 360 идут на телефоне. Это форк ReXGlue SDK под Андроид — и не эмулятор, и не обёртка, сука: игра, переведённая ReXGlue в C++, собирается в обычную
.soи работает как родное приложение — Vulkan, SDL3, сенсор и геймпады.Что уже идёт на телефоне:
- Project 2099 — Android — Spider-Man: Edge of Time, со своим рендером reeot;
- Plants vs. Zombies — на обычном рендере ReXGlue (Vulkan-эмуляция видеочипа Xbox), собран в APK одной командой
port.ps1.
Plants vs. Zombies и Spider-Man: Edge of Time на POCO X7 Pro — оба с экранным геймпадом
Игры с Xbox 360 написаны для процессора, которого нет ни в компьютере, ни в телефоне. ReXGlue переводит код игры с «языка Xbox» на обычный C++, и из него собирается настоящая программа. Это не эмулятор, который притворяется приставкой, а порт: игра работает как родная.
Оригинальный ReXGlue собирает такие порты под Windows, Linux и macOS. ReXGlue Android добавляет телефоны:
- Берёшь проект игры на ReXGlue — тот же, что работает на ПК.
- Запускаешь одну команду.
- Получаешь APK и ставишь его на Андроид как обычное приложение.
В APK уже всё готово, делать ничего не надо:
- экранный геймпад, как у Xbox, — а подключишь настоящий, он сам спрячется;
- установка игры прямо с телефона: скопировал папку с игрой, нажал «Установить игру», выбрал папку;
- сохранения в папке приложения.
Всю ебучую возню с Андроидом — NDK, Gradle, подпись, права на папки — скрипты делают сами. Я на ней неделями сидел, тебе не придётся. Нужен только проект игры и своя копия игры: файлов игр тут нет и не будет.
- Одна команда вместо недели ебли.
port.ps1сам правит CMake игры, собирает её под ARM, раскладывает библиотеки, делает ключ подписи и выдаёт готовый APK. Ни Android Studio, ни шаманства с Gradle. - Ставится само.
setup.ps1качает всё — JDK, SDK, NDK, CMake, Python — в одну папку и не засирает диск C:. Даже симлинки, которые Git для Windows ломает, чинит сам. - Ни строчки кода под Андроид. Лаунчер, установка игры с телефона, экранный геймпад, сохранения — уже лежат в шаблоне.
- Геймпад для любой игры. Игра видит обычный Xbox-контроллер, поэтому меню и подсказки кнопок работают как есть. Подписать кнопки под свою игру — один текстовый файл.
- Работает на Mali. Рендер Xenia в оригинальном ReXGlue на Mali даже не запускается — отказывается от видеокарты. Тут запускается, и PvZ играется.
- Старые проекты не выкидываешь. Проекты от rexglue 0.8–0.10 собираются, имена с подчёркиваниями не ломают сборку.
- Защита от дурака. Кириллица в пути, заглушка Python из Microsoft Store, запрет скриптов в Windows, не тот
tar— на всё это я сам наступил. Скрипты либо обходят, либо по-человечески говорят, что делать. - Быстрее даже на ПК. Ожидание событий без опроса, вызовы функций без замка, звук не жрёт память впустую.
Андроид:
- Сборка NDK под arm64-v8a (телефоны) и x86_64 (эмулятор).
- Свои файберы на ассемблере (в Bionic нет getcontext/swapcontext), обычные мьютексы вместо robust, логи в logcat.
- Окно — ANativeWindow от SDL3, Vulkan через
VK_KHR_android_surface. - Vulkan-эмуляция видеочипа работает на Mali: на Андроиде не требуются геометрические шейдеры, каркасная заливка и запись в память из вершинного шейдера, которых у Mali нет.
- Точка входа
SDL_main; пути HOME/XDG ведут в папку приложенияAndroid/data/<пакет>/files— её видно по USB. - Модули игры грузятся как
lib<имя>.so— другие имена APK не носит. - Экранный Xbox-геймпад: игра видит обычный контроллер, меню и подсказки кнопок работают как есть.
rexglue initсразу делает проект, который собирается под телефон (libmain.so).- Кросс-сборка: генератор кода берётся с ПК через
REXGLUE_HOST_TOOL.
Скорость (общие правки, работают везде):
WaitMultipleспит до сигнала, а не опрашивает хэндлы каждую миллисекунду.GetFunctionчитает таблицу функций модуля без мьютекса.- Декодеры XMA создаются при первом декодировании — минус мегабайты памяти.
IsRangeReadableпроверяет только нужные страницы, а не весь регион.- На Андроиде UI-цикл спит и просыпается, когда ему ставят задачу, а не крутится вхолостую.
Совместимость:
- Проекты, сгенерированные старым
rexglue(0.8–0.10), снова собираются. - Проекты с подчёркиваниями в имени больше не ломают свою CMake-связку.
- Пустая аватарка профиля и USB-камера — как в Xenia (на этом спотыкался PvZ).
--gpu_log_resolves— пишет в лог, что игра рисует в свои текстуры, без захвата кадра (работает и на телефоне).
Всё остальное — как в ReXGlue. Изменения — небольшие отдельные коммиты поверх апстрима: их легко читать и переносить.
Нужно: Windows 10/11, Git, ~15 ГБ места и проект игры на ReXGlue (тот, что делает rexglue init; рабочий ПК-порт сильно помогает). Телефон — Android 11+, arm64, Vulkan 1.3. Пути к папкам — только латиницей.
- Скачай форк вместе с сабмодулями:
git clone --recursive https://github.com/GenryTheFox0/rexglue-android
- Поставь инструменты — один раз. В папке форка:
Скрипт сам скачает JDK 17, Android SDK с NDK r29 и CMake, готовый
powershell -ExecutionPolicy Bypass -File android\setup.ps1rexglue.exeи починит ссылки, которые Git для Windows ломает. Всё ляжет вandroid\tools, на диск C: ничего. - Собери APK:
Скрипт сам допишет в CMakeLists игры ветку под Андроид (старый файл останется как
powershell -ExecutionPolicy Bypass -File android\port.ps1 -Project E:\Games\MyGame -Name "My Game"
CMakeLists.txt.bak), соберёт игру и положитMy Game-android.apkв папку проекта. С-Installон сразу поставит APK на подключённый телефон, а с-Abi arm64-v8a,x86_64соберёт ещё и под эмулятор.
На телефоне: открой приложение → «УСТАНОВИТЬ ИГРУ» → выбери папку с распакованной игрой (где лежит default.xex). Или скопируй её сам в Android/data/<пакет>/files/game.
Что можно положить в папку android\ проекта игры:
icon.png— иконка приложения;touchpad.txt— подписи экранных кнопок, по одной на строку:A=Прыжок;args.txt— настройки игры (cvars ReXGlue), по одной на строку.
Ключ подписи. После первой сборки в проекте появится папка android-key. Сохрани её: без неё новые версии APK не встанут поверх старых.
В APK уже есть: лаунчер с установкой игры, экранный Xbox-геймпад (прячется, когда подключён настоящий), сохранения в папке приложения.
Сборка SDK вручную, без скриптов
Нужно: Android NDK (проверено на r29), CMake 3.25+, Ninja и rexglue, собранный под ПК, — он генерирует код во время сборки.
cmake -S . -B out/android-arm64 -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-30 -DANDROID_STL=c++_shared \
-DCMAKE_BUILD_TYPE=Release -DREXGLUE_BUILD_TESTS=OFF \
-DREXGLUE_HOST_TOOL=/путь/к/ПК/rexglue
cmake --build out/android-arm64Для эмулятора — -DANDROID_ABI=x86_64. Игра на этом SDK собирается в libmain.so и кладётся в APK вместе с SDLActivity из SDL3 (thirdparty/sdl3/android-project); шаблон такого APK — в android\template.
Порт делался вместе с ИИ (Claude), а проверял его я — на живом телефоне: POCO X7 Pro (Dimensity 8400, Mali-G720, Android 16). Adreno (Snapdragon) пока не проверен.
Известные косяки первой версии:
- Vulkan-эмуляция видеочипа на телефоне тяжёлая: PvZ идёт, но звук подтормаживает. Свой рендер (как reeot у Project 2099) работает намного быстрее.
- В PvZ у полупрозрачного горохострела при выборе клетки тёмный квадрат. Он есть и на ПК, и в Xenia — это старая ошибка эмуляции, разбираюсь.
- Отрисовки с записью в память из вершинного шейдера на Mali пропускаются (у Mali нет такой возможности). В PvZ таких нет, в других играх могут быть.
Это неофициальный форк: команда ReXGlue за него не отвечает. Баги форка — сюда, в Issues, а не к ним.
BSD-3-Clause, как у ReXGlue, — LICENSE не тронут.
- ReXGlue SDK — Tom Clay и команда ReXGlue; часть кода — из Xenia (Ben Vanik и авторы Xenia).
- Андроид-порт — GenryTheFox и zenit2893-cmyk.
ReXGlue не связан с Microsoft и Xbox. Для игр нужна своя копия; пиратство этот проект не поддерживает.
No censorship: I fucking made Xbox 360 games run on a phone. This is a fork of the ReXGlue SDK for Android — not an emulator, not a wrapper: a game that ReXGlue turned into C++ is built into a plain
.soand runs as a native app — Vulkan, SDL3, touch and gamepads.Running on a phone already:
- Project 2099 — Android — Spider-Man: Edge of Time, with its own reeot renderer;
- Plants vs. Zombies — on ReXGlue's usual renderer (Vulkan emulation of the Xbox GPU), made into an APK by one
port.ps1command.
Contact — Telegram and Discord.
Xbox 360 games are written for a processor that neither a PC nor a phone has. ReXGlue translates a game's code from "Xbox language" into ordinary C++, which builds into a real program. It is not an emulator pretending to be a console but a port: the game runs natively.
The original ReXGlue builds such ports for Windows, Linux and macOS. ReXGlue Android adds phones:
- Take a ReXGlue project of a game — the same one that runs on PC.
- Run one command.
- Get an APK and install it on Android like any app.
The APK has everything ready, nothing to do:
- an on-screen gamepad like an Xbox one — plug a real one in and it hides itself;
- installing the game right from the phone: copy the game's folder, tap INSTALL THE GAME, pick the folder;
- saves in the app's folder.
All the Android bullshit — NDK, Gradle, signing, folder permissions — the scripts do themselves. I spent weeks on it so you don't have to. You need only the game's project and your own copy of the game: there are no game files here and never will be.
- One command instead of a week of pain.
port.ps1patches the game's CMake, builds it for ARM, lays out the libraries, makes a signing key and hands you a finished APK. No Android Studio, no Gradle voodoo. - Installs itself.
setup.ps1downloads everything — JDK, SDK, NDK, CMake, Python — into one folder and leaves your C: drive alone. It even fixes the symlinks Git for Windows breaks. - Not a line of Android code to write. The launcher, installing the game from the phone, the on-screen gamepad, saves — all in the template already.
- A gamepad for any game. The game sees an ordinary Xbox controller, so menus and button prompts just work. Labelling the buttons for your game is one text file.
- Runs on Mali. The original ReXGlue's Xenia renderer won't even start on Mali — it rejects the GPU. Here it starts, and Plants vs. Zombies plays.
- Old projects keep working. Projects from rexglue 0.8–0.10 build; names with underscores don't break the build.
- Idiot-proof. Cyrillic in a path, the Microsoft Store Python stub, Windows blocking scripts, the wrong
tar— I stepped on all of it myself. The scripts either get around it or tell you in plain words what to do. - Faster even on PC. Event waits without polling, function lookups without a lock, sound that doesn't waste memory.
Android:
- NDK builds for arm64-v8a (phones) and x86_64 (the emulator).
- Fibers of its own in assembly (Bionic has no getcontext/swapcontext), plain mutexes instead of robust ones, logs in logcat.
- The window is SDL3's ANativeWindow; Vulkan goes through
VK_KHR_android_surface. - The Vulkan GPU emulation runs on Mali: on Android it does not require geometry shaders, wireframe fill and vertex shader memory stores, which Mali lacks.
- A
SDL_mainentry point; HOME/XDG paths lead to the app'sAndroid/data/<package>/filesfolder, which is reachable over USB. - Game modules load as
lib<name>.so— the only names an APK can carry. - An on-screen Xbox pad: the game sees an ordinary controller, its menus and button prompts work as they are.
rexglue initmakes a project that builds for a phone right away (libmain.so).- Cross builds: code generation runs a desktop
rexgluenamed byREXGLUE_HOST_TOOL.
Speed (generic changes, every platform gets them):
WaitMultiplesleeps until it is signalled instead of polling its handles every millisecond.GetFunctionreads a module's function table without the mutex.- XMA decoders are made when a context first decodes — megabytes of memory saved.
IsRangeReadablechecks only the pages it needs, not the whole region.- On Android the UI loop sleeps and wakes when work is queued for it, instead of spinning.
Compatibility:
- Projects generated by an older
rexglue(0.8–0.10) build again. - Projects with underscores in their name no longer break their CMake glue.
- An empty gamer tile and the USB camera, as in Xenia (Plants vs. Zombies tripped on them).
--gpu_log_resolveslogs what a game draws into its own textures, without a frame capture (on a phone too).
Everything else is ReXGlue as is. The changes are small separate commits on top of upstream, easy to read and to port.
You need Windows 10/11, Git, ~15 GB of space and a ReXGlue project of the game (the one rexglue init makes; a working PC port helps a lot). The phone needs Android 11+, arm64 and Vulkan 1.3. Folder paths must be plain Latin letters.
- Clone the fork with its submodules:
git clone --recursive https://github.com/GenryTheFox0/rexglue-android
- Install the tools — once. In the fork's folder:
It downloads JDK 17, the Android SDK with NDK r29 and CMake, a ready
powershell -ExecutionPolicy Bypass -File android\setup.ps1rexglue.exe, and fixes the links Git for Windows breaks. Everything goes intoandroid\tools, nothing onto C:. - Build the APK:
It adds the Android branch to the game's CMakeLists (the old file stays as
powershell -ExecutionPolicy Bypass -File android\port.ps1 -Project E:\Games\MyGame -Name "My Game"
CMakeLists.txt.bak), builds the game and putsMy Game-android.apkinto the project folder.-Installputs the APK straight onto a connected phone;-Abi arm64-v8a,x86_64also builds for the emulator.
On the phone: open the app → INSTALL THE GAME → pick the folder with the extracted game (where default.xex is). Or copy it yourself into Android/data/<package>/files/game.
What can go into the game project's android\ folder:
icon.png— the app icon;touchpad.txt— labels for the on-screen buttons, one per line:A=Jump;args.txt— the game's settings (ReXGlue cvars), one per line.
The signing key. After the first build the project gets an android-key folder. Keep it: without it new APK versions will not install over old ones.
The APK already has a launcher that installs the game, an on-screen Xbox pad (hidden while a real one is connected), and saves in the app's folder.
Building the SDK by hand, without the scripts
You need the Android NDK (tested with r29), CMake 3.25+, Ninja, and a desktop build of rexglue, which generates code during the build.
cmake -S . -B out/android-arm64 -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-30 -DANDROID_STL=c++_shared \
-DCMAKE_BUILD_TYPE=Release -DREXGLUE_BUILD_TESTS=OFF \
-DREXGLUE_HOST_TOOL=/path/to/desktop/rexglue
cmake --build out/android-arm64Use -DANDROID_ABI=x86_64 for the emulator. A game on this SDK builds into libmain.so and goes into an APK together with SDL3's SDLActivity (thirdparty/sdl3/android-project); a template of such an APK is in android\template.
The port was made together with an AI (Claude) and tested by me on real hardware: a POCO X7 Pro (Dimensity 8400, Mali-G720, Android 16). Adreno (Snapdragon) is untested so far.
Known issues of the first version:
- The Vulkan GPU emulation is heavy on a phone: Plants vs. Zombies runs, but its sound stutters. A renderer of its own (like Project 2099's reeot) is much faster.
- In Plants vs. Zombies the translucent Peashooter shown while picking a tile has a dark box around it. It is there on PC and in Xenia too — an old emulation bug, being looked into.
- On Mali, draws whose vertex shader stores to memory are skipped (Mali cannot do it). Plants vs. Zombies has none; other games may.
This is an unofficial fork; the ReXGlue team is not responsible for it. Report the fork's bugs here, in Issues, not to them.
BSD-3-Clause, like ReXGlue — the LICENSE is untouched.
- ReXGlue SDK — Tom Clay and the ReXGlue team; portions come from Xenia (Ben Vanik and the Xenia contributors).
- The Android port — GenryTheFox and zenit2893-cmyk.
ReXGlue is not affiliated with Microsoft or Xbox. Games need your own copy; this project does not support piracy.


