Profile
Back to NewsBack
GitHub Trending 7 min
Reader Mode
ItsNotRexed/Leonida: Leonida Is A Native PC Recompilation Of The Xbox Version Of Grand Theft Auto 6

ItsNotRexed/Leonida: Leonida Is A Native PC Recompilation Of The Xbox Version Of Grand Theft Auto 6


Leonida


Leonida

Grand Theft Auto VI (Xbox Series) running natively on Windows, built on your PC from your own copy.

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

Project status

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. ⚠️ 21,545 are wave64: exact on 64-wide subgroups (AMD), and cross-half wave ops are approximate on 32-wide (NVIDIA) | | Shader translator checked on a real GPU | ⚠️ Vertex fetch, texture sampling, exports, ALU ops, partial-register ops, barycentrics, wave-uniform branches and compute (LDS, barriers, buffer stores) checked on one 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 as Ogg Opus, PCM as WAV, XMA2 decoded with ffmpeg. --wav also writes 16-bit PCM WAV | | PE loader and import shims | ⚠️ Skeleton. Untested against the real executable | | Xbox D3D12 → Vulkan | ❌ Not started | | Booting, story mode, anything playable | ❌ No |

How to build

The port isn't downloaded ready-made. It's built on your PC from your own copy.

The easy way:

  1. Install the prerequisites below.
  2. Download this project with its submodule: git clone --recursive https://github.com/ItsNotRexed/Leonida. A
"Download ZIP" from GitHub leaves out third_party/rpf9-explorer. The build fetches it if git is installed, and otherwise tells you what to do.
  1. 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 install llvm-21 in WSL and set LLVM_MC="wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc" (see docs/design.md). On Linux, llvm-mc on 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.

Vulkan diagnostics on Linux

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/spirv

Pass the directory containing index.json and the translated SPIR-V files to vk_pipeline_check.

How it works

| 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.

Want to help?

The biggest open pieces:

  • Compute, mesh and geometry shaders: their per-stage system-value register layout.
  • Xbox D3D12 → Vulkan: the d3d12_xs command 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.

Credits

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. Grand Theft Auto and all related names are trademarks of their owners. This project is not affiliated with or endorsed by them.

License

GPLv3 (or any later version). See LICENSE. Third-party code keeps its own license.

Chat with me