📦sp00nznet / xboxrecomp
← 返回首页
Turn any Xbox game binary into a native Windows executable. No emulation. No interpreter. Just raw, recompiled C.
⚖️ MIT📅 创建于 2026-03-06🔄 更新于 2026-10-21

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

xboxrecomp

 #   #  ####    ###   #   #         #####   ###    ###   #       ###
 #   #  #   #  #   #  #   #           #    #   #  #   #  #      #
  # #   ####   #   #   # #            #    #   #  #   #  #       ##
  # #   #   #  #   #   # #            #    #   #  #   #  #         #
 #   #  #   #  #   #  #   #           #    #   #  #   #  #         #
 #   #  ####    ###   #   #           #     ###    ###   #####   ###

 Static Recompilation Toolkit for Original Xbox Games

Turn any Xbox game binary into a native executable for Windows, Linux or macOS. No emulation. No interpreter. Just raw, recompiled C.

Join the sp00nznet recomp Discord — the community hub for sp00nznet's recomp projects, where ps3recomp development happens in the open. Good place to ask questions, show a port you are working on, or find out what people are stuck on before you duplicate the effort.

Title-agnostic. The runtime, kernel layer, D3D8 abstraction, NV2A translator, and the Python pipeline (parser → disasm → func_id → abi_analysis → recomp) all derive per-title layout and behavior from the XBE itself. Burnout 3: Takedown was the reference title the toolkit was built against, so many docs use its metrics as examples — see docs/technical/candidate-games.md for ports in progress.

Recent Changes

Current version: v0.16.0 — "Small Print" (October 2026). See the Changelog for what landed and when.


What Is This?

This is a complete toolkit for statically recompiling original Xbox (2001-2005) games from their retail XBE executables into native programs: Windows first, with Linux and macOS (x86-64 and arm64) hosts too.

Static recompilation takes the raw x86 machine code from an Xbox binary and translates every function — every mov, every jmp, every call — into equivalent C source code. That C code compiles with MSVC into a native x86-64 .exe that runs on modern Windows; the runtime libraries also build on Linux and macOS, x86-64 or arm64, with SDL2 and OpenGL standing in for Win32 and D3D11. The game's original logic executes directly on your CPU, not through an interpreter or JIT compiler.

This is the first public static recompilation toolkit for the original Xbox. Microsoft got here first: their internal Ficl/Fission recompiler shipped Xbox back-compat on the 360. We have since studied it — see Microsoft's Own Recompiler.

The technique has been proven on other platforms — N64Recomp showed MIPS-to-C was viable, XenonRecomp brought it to Xbox 360's PowerPC — but nobody had tackled the OG Xbox until now. Its x86 architecture makes it both easier (same instruction set family as the host) and harder (variable-length instructions, complex addressing modes, x87 FPU stack) than MIPS or PPC targets.

Why Not Just Use an Emulator?

Emulators are great. Cxbx-Reloaded and xemu do incredible work. But static recomp offers some unique advantages:

  • Native performance — recompiled code runs at full speed, no interpretation overhead
  • Moddability — the output is human-readable C code; you can patch, extend, and improve the game
  • Portability — the C output can target any platform with a C compiler (ARM, RISC-V, WebAssembly...)
  • Preservation — a self-contained native binary is the ultimate form of game preservation
  • Understanding — the process forces you to deeply understand the game at the machine code level

The Pipeline

         YOUR XBOX DISC
              |
              v
    +-------------------+
    |  1. Extract XBE   |     Extract default.xbe from the disc image
    +-------------------+
              |
              v
    +-------------------+
    |  2. Parse XBE     |     Read headers, sections, kernel imports
    +-------------------+     tools/xbe_parser/
              |
              v
    +-------------------+
    |  3. Disassemble   |     Find functions, build control flow graphs
    +-------------------+     tools/disasm/
              |
              v
    +-------------------+
    |  4. Identify      |     Classify: CRT, RenderWare, D3D, game code
    +-------------------+     tools/func_id/
              |
              v
    +-------------------+
    |  5. Lift to C     |     Translate x86 instructions to C statements
    +-------------------+     tools/recomp/
              |
              v
    +-------------------+
    |  6. Build Runtime  |    Kernel shim, D3D translation, memory layout
    +-------------------+     templates/runtime/
              |
              v
    +-------------------+
    |  7. Compile & Run  |    MSVC builds native .exe — game runs!
    +-------------------+

Runtime Libraries

Following the RexGlueSDK pattern (which does the same for Xbox 360 via Xenia), xboxrecomp provides link-time libraries extracted from xemu and purpose-built compatibility layers. Your recompiled game links against these — no emulator needed at runtime.

Library Source What It Does
xbox_kernel Custom Xbox kernel → Win32 (all 371 ordinals routed: 347 bridge_* functions + 24 data exports — memory, file I/O, threading, sync, crypto, HAL, EEPROM, SMBus), plus the NV2A pushbuffer executor for titles that statically link the XDK's D3D
xbox_d3d8 Custom D3D8 → D3D11 graphics: 4-stage multi-texture FFP pipeline, NV2A register combiner pixel shaders, programmable vertex shaders (NV2A microcode → HLSL), hardware T&L lighting (8 lights), vertex fog, DrawPrimitiveUP ring buffer, texture unswizzling, 20+ format conversions. On Linux/macOS a separate OpenGL 3.3 back end (SDL2 + libepoxy, d3d8_gl.c)
xbox_dsound Custom DirectSound → software mixer (IDirectSound8/IDirectSoundBuffer8)
xbox_apu xemu (LGPL-2.1+) MCPX APU audio (256-voice processor, ADPCM/PCM, envelopes, HRTF). Output through XAudio2 (waveOut fallback) on Windows, SDL2 elsewhere. The GP DSP doorbell ack is derived by default (RECOMP_APU_DSP_ACK=auto; an explicit address, or 0/off, still overrides)
xbox_nv2a xemu (regs, LGPL-2.1+) + Custom NV2A GPU (register handlers, MMIO interception, push buffer parsing, PGRAPH → D3D11 translation)
xbox_input Custom Xbox gamepad → XInput, plus the keyboard as the port-0 pad (RECOMP_KEYBOARD=1) with one key map on every host
xbox_usb Custom MCPX OHCI host controllers, so a title's statically linked XAPI finds a pad
xbox_video Custom FMV playback: Media Foundation decode onto a D3D8 texture, plus a window on the guest framebuffer. For titles whose video is a container Windows already decodes, the emulated decoder does not have to work for the video to be watchable — and the title still decides when it plays. Linux/macOS get the framebuffer window (SDL2) but no decoder

Building the Libraries

cd xboxrecomp
cmake -S . -B build
cmake --build build --config Release

This produces the static libraries in the table above, plus the platform layer they share, in build/src/*/Release/ (build/src/*/ with a single-config generator). Link your game project against xboxrecomp (umbrella target) or individual libraries.

This repo builds libraries only — there is no game .exe here, and building it will never produce one. The executable is built by your game project, which lives in its own directory and links these libraries. Start it by copying templates/new-game/: it has the CMakeLists.txt that produces the .exe and the main.c that boots the guest. See Getting Started, Step 6.

Integration Pattern

Your recompiled game provides two callback functions that the kernel bridge calls to resolve function addresses:

typedef void (*recomp_func_t)(void);
recomp_func_t recomp_lookup(uint32_t xbox_va);        // Auto-generated dispatch table
recomp_func_t recomp_lookup_manual(uint32_t xbox_va);  // Hand-written overrides

The recompiler output (tools/recomp) generates these automatically. The xboxrecomp libraries handle everything else — memory layout, kernel calls, graphics, audio, and input.

Architecture

┌─────────────────────────────────────────────────┐
│              Your Game (.exe)                     │
│  ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│  │ recomp/  │ │ manual   │ │ game-specific    │ │
│  │ gen/*.c  │ │ overrides│ │ loaders/formats  │ │
│  └────┬─────┘ └────┬─────┘ └────────┬─────────┘ │
│       │             │                │            │
│       └──────┬──────┘────────────────┘            │
│              │ recomp_lookup() / ICALL dispatch    │
├──────────────┼────────────────────────────────────┤
│              │   xboxrecomp libraries             │
│  ┌───────────┴──────────┐                         │
│  │    xbox_kernel        │  Memory layout, file    │
│  │    (kernel_bridge.c)  │  I/O, threading, sync   │
│  └───────────┬──────────┘                         │
│              │                                     │
│  ┌───────┐ ┌┴──────┐ ┌────────┐ ┌──────┐ ┌─────┐│
│  │xbox_  │ │xbox_  │ │xbox_   │ │xbox_ │ │xbox_││
│  │d3d8   │ │dsound │ │apu     │ │nv2a  │ │input││
│  │D3D8→  │ │DSound→│ │MCPX APU│ │NV2A  │ │XPP→ ││
│  │D3D11  │ │mixer  │ │(xemu)  │ │(xemu)│ │XInput│
│  └───────┘ └───────┘ └────────┘ └──────┘ └─────┘│
├──────────────────────────────────────────────────┤
│  Windows: D3D11/XInput/XAudio2; POSIX: SDL2/GL   │
└──────────────────────────────────────────────────┘

Quick Start

Prerequisites

  • Windows 11/10 (D3D11 backend) — or Linux / macOS, x86-64 or arm64 (OpenGL + SDL2 backend)
  • Linux: tools/linux/install_deps.sh installs the build dependencies
  • macOS: tools/macos/setup.sh (Homebrew SDL2 + libepoxy; --test adds the Docker images the conformance suite needs)
  • Python 3.10+ with capstone (pip install capstone)
  • Visual Studio 2022 (MSVC compiler) on Windows; Clang or GCC elsewhere
  • CMake 3.20+
  • An original Xbox game disc image (you must own the game)

py -3 below is the Windows Python Launcher — on Linux and macOS use python3, and on a Microsoft Store install that has no py, use python.

Step-by-Step

The condensed version. docs/GETTING_STARTED.md is the long one, and the one to read if a step here does not go as written — it explains why each flag is there, which is

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR