Status | How to build | How it works | Want to help? | Credits | License | Discord
Leonida is a static recompilation project. The Xbox Series CPU is x86-64 like a PC, so the game's code is loaded and run natively, and the console's system software is reimplemented. The console's precompiled RDNA2 GPU programs are translated to SPIR-V for Vulkan. The game's models, textures and audio are read from your package. All of this happens on your PC, from your own copy of the game.
Important
This repository does not contain the game, keys or an executable, and it does not explain how to get them. You need your own copy, with its files already readable on disk. Nothing here decrypts or works around any protection. Everything the build creates (the generated shaders, extracted assets, the runtime folder and your saves) comes from your game and stays on your PC. Never share those files.
Discord: https://discord.gg/rexed
Early. The game does not boot yet. Everything that can be done without the game's executable is in place, so work on booting can start as soon as one is available to a developer.
| What | Status |
|---|---|
| Finding and checking your copy (Xbox Series 1.0.2.1) | ✅ Works |
| Shaders: carve, unpack native RDNA2 code, disassemble | ✅ All 26,503 |
| Shaders: RDNA2 → SPIR-V translation | ✅ All 26,503: 2,236 VS, 12,101 PS, 2,689 CS, 9,282 mesh, 195 geometry. All pass spirv-val, with a per-shader metadata index for pipeline creation. |
| Shader translator checked on a real GPU | |
| Models (OBJ with real names, UVs, material references) | ✅ Exported. Not all layouts are decoded yet |
| Texture dictionaries and world texture pools (DDS) | ✅ Exported. Some pool entries (BCPack) are skipped |
| Audio banks (AWC: Opus, XMA2) | ✅ Exported whole. Opus repackaged losslessly as Ogg Opus; PCM (codec 0/2) as WAV; XMA2 decoded with ffmpeg. --wav adds 16-bit PCM WAV (notes) |
| PE loader and import shims | |
| Xbox D3D12 → Vulkan | |
| Booting, story mode, anything playable | ❌ No |
The port isn't downloaded ready-made. It's built on your PC from your own copy.
The easy way:
- Install the prerequisites below.
- Download this project with its submodule:
git clone --recursive https://github.com/ItsNotRexed/Leonida. A "Download ZIP" from GitHub leaves outthird_party/rpf9-explorer. The build fetches it ifgitis installed, and otherwise tells you what to do. - Double-click
Build.bat.
It finds your copy of the game by itself: it looks in Downloads, Desktop, Documents, Games, your home folder and
the top of every drive, two folders deep. It recognises the version from a few file sizes, without reading
anything large. If you have more than one copy it asks which one, and if it finds none it asks you to paste the
folder. Before starting it checks that everything below is installed and that there is enough free space, and it
lists anything missing in one go. The result goes to Documents\Leonida. A stopped build continues where it left
off.
Your game folder is the one that holds MicrosoftGame.Config and the .rpf archives, as plain files.
Prerequisites:
- Your own copy of the Xbox Series package, version 1.0.2.1.
- Windows 10/11 x64, with about 350 GB free for work files. They can go on another drive with
--work. - Python 3.11+ (tick "Add python.exe to PATH").
- .NET 8 SDK.
- Vulkan SDK, for
spirv-as/spirv-val. - LLVM 21+ with the AMDGPU target for
llvm-mc. The official Windows build has no AMDGPU target: on Windows installllvm-21in WSL and setLLVM_MCto the whole command,LLVM_MC="wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc"(see docs/design.md). On Linux,llvm-mcon PATH is enough. - Visual Studio 2022 with Desktop development with C++, for the runtime stage.
- ffmpeg on PATH (optional: decodes the XMA2 streams, and required for
--wav).
From a terminal, with the same behaviour and more control:
python -I make_game.py --find # list the copies found on this PC
python -I make_game.py --check # check your copy, build nothing
python -I make_game.py --game "D:\path\to\your\package" --out "D:\Games\Leonida" --work "E:\leonida-work"
python -I make_game.py --stages shaders,assets # only some stages
python -I make_game.py --game "D:\path\to\your\package" --wav # also decode Opus to PCM WAV (large)Stages run in order: check, shaders, assets, runtime, pipelines (creates every translated shader on your
GPU driver and saves a pipeline cache, so the first boot doesn't compile them). The shader translation is the longest step: it runs
on --jobs processes (half the CPU threads by default).
--wav is off by default because 16-bit PCM WAV is several times larger than Ogg Opus. It decodes the repackaged Ogg
Opus streams to work\assets\audio\wav after the audio bank step; existing WAV files are skipped when a build resumes.
With CMake 3.24+, a C++20 compiler, and Vulkan development headers and loader installed:
cmake -S runtime -B runtime/build/linux
cmake --build runtime/build/linux --parallel
./runtime/build/linux/vk_pipeline_check /path/to/spirvPass the directory containing index.json and the translated SPIR-V files to vk_pipeline_check.
| Piece | What it does | Where |
|---|---|---|
| Version check | Every package file's name, size and SHA-256 for each supported version | game/, make_game.py |
| Shader pipeline | Carves DXBC containers from shaders.rpf without its encrypted table of contents. Unpacks the XBCH → FSSM native RDNA2 program, disassembles it with LLVM (gfx1013) and translates it to SPIR-V |
tools/shader_carve.py, fssm_unpack.py, shader_disasm.py, rdna2spirv.py |
| Asset export | Finds validated resources inside RPF9 archives and the loose .ttpf texture pools |
tools/rpf9dump (on rpf9-explorer's Core) |
| Runtime | Maps the PE image, resolves imports to shims (GDK, XMem, d3d12_xs) |
runtime/ |
| Research tools | PE/RTTI inspection, raw carving, texture tiling probes, GPU test harnesses | tools/, runtime/test/ |
The translator's runtime contract (user SGPRs, push constants, memory model, bindless images, vertex fetch, system values) and all the format notes are in docs/design.md; the format, asset, runtime and validation notes are indexed in docs/README.md. The Xbox D3D12 plan is in docs/d3d12_vulkan.md. Audio bank formats and the export tools are in docs/audio.md; docs/related_projects.md records the prior art we may read and the licence limits on it.
The biggest open pieces:
- Compute, mesh and geometry shaders: their per-stage system-value register layout.
- Xbox D3D12 → Vulkan: the
d3d12_xscommand list and descriptor heap model. - Model layouts the decoder rejects today.
See CONTRIBUTING.md. Never attach game files, extracted assets or generated shaders to issues or pull requests.
- rpf9-explorer by breadbbbb: the RPF9 model, texture-pool and AWC
decoders used by
tools/rpf9dump(git submodule). - Mesa (MIT): GFX10 resource-descriptor layout (
tools/gfx10_formats.json), and the ACO/RADV rules used as reference for 16-bit results and shader system registers. - LLVM: AMDGPU disassembler.
- Logo: "Grand Theft Auto VI" icon by SlyDevil on SteamGridDB.
- SPIRV-Tools: assembly and validation.
Grand Theft Auto and all related names are trademarks of their owners. This project is not affiliated with or endorsed by them.
GPLv3 (or any later version). See LICENSE. Third-party code keeps its own license.
