Xermu

Work in progress · pre-release · GPL-3.0-or-later

The guest's instructions run as themselves.

Xermu is an original Xbox emulator for x86-64. The Pentium III's code runs almost natively, the NV2A's command stream is parsed by the host GPU, and the audio DSPs are compiled to host code. The aim is output identical to real hardware, at faster-than-original speed.

Halo: Combat Evolved's opening cutscene: the Pillar of Autumn above a ringed planet, rendered by Xermu. Turok: Evolution, a jungle level, rendered by Xermu. Halo: Combat Evolved, the cryo room, rendered by Xermu. Gunvalkyrie, a canyon mission with the game's HUD, rendered by Xermu. Blowout, the Airlock: Port mission card, rendered by Xermu. 640 × 480 · native HLE kernel · Vulkan
Halo: Combat Evolved, the opening cutscene, as Xermu renders it.
2JITs to x86-64: the Pentium III and the DSP56300s
0push-buffer words parsed on the CPU: a compute shader is the single consumer
5ways to boot: HLE, three guest kernels, or a BIOS from the reset vector
4toolchains in CI: GCC, Clang with ASan/UBSan, MSVC, MinGW under Wine

The machine

An Xbox on the left. What runs it on the right.

The Xbox is a PC: a Pentium III, an Nvidia GPU, an NT-derived kernel. Xermu leans on that kinship wherever the host can do the guest's work directly.

CPU core

A guided executor, not a translator.

Guest and host speak nearly the same language, so most instructions are copied byte for byte. Guest registers live in host registers; guest flags are the host's flags. Only memory accesses, privileged instructions and control flow are rewritten.

guest · x86-32
01 D8  add  eax, ebx
0F AF C1  imul eax, ecx
host · x86-64
01 D8  add  eax, ebx
0F AF C1  imul eax, ecx

The same bytes. EAX to EDI stay in the host's EAX to EDI for the whole trace, and the arithmetic sets the real flags. There is no intermediate representation to lift into or lower from.

Simplified for illustration. The real emitter is in doc/DESIGN.md.

Also a library

The core builds on its own as xermu_cpu, with RAM, MMIO, port, interrupt and tick callbacks. A second target provides lib86cpu's API on top of it, as a drop-in for projects such as nxbx.

include/xermu/cpu.hpp nxbx integration

C++20
xermu::Cpu cpu({xermu::MemoryMode::handlers});
cpu.add_mmio(0xFE000000, 0x1000,
             my_read, my_write, &my_device);
cpu.load(0x1000, code, code_size);

xermu::Registers r = cpu.registers();
r.eip = 0x1000;
cpu.set_registers(r);
cpu.run();

NV2A

The host GPU reads the Xbox's command stream itself.

Other emulators decode the push buffer on the CPU and translate it into draw calls. Here the CPU only feeds and kicks: a compute shader parses the NV2A methods out of guest memory and writes the draws that the GPU then executes.

  1. guest RAMPush bufferNV097 methods, vertices and textures, where the title wrote them
  2. computeParserthe single consumer of the push buffer; emits indirect draws and exact per-draw state
  3. vertexVertex übershaderfetches from guest memory; runs vertex programs and fixed-function T&L
  4. fragmentFragment übershadertexture stages and combiners; depth, stencil and blend in the shader, in primitive order
  5. scanoutFramebufferthe guest's own surface, presented as the encoder would
When the driver lacks a feature
Optional featureWithout itResult
fragment_shader_interlockA per-pixel lock built from image atomicsExact, except overlapping blended primitives within one draw: a few pixels in 10,000 at most
drawIndirectCountA compute pass blanks the unused draw slotsExact
multiDrawIndirectOne indirect draw per slotExact
external_memory_hostGuest RAM is mirrored instead of importedExact, slower

Renderer architecture Accuracy notes

Audio

Two DSPs, compiled.

The MCPX mixes through programs running on Motorola DSP56300 cores. Xermu emulates them at the instruction level, and compiles the hot straight-line code to x86-64.

  1. Voice processorPCM and Xbox ADPCM voices, envelopes
  2. Mixbins32 accumulation buses
  3. Global processorDSP56300 · the title's effects program
  4. Encode processorDSP56300
  5. AC'97output DMA to the host device, stereo or 5.1

Kernels

Five ways to boot.

High-level emulation is the fast default. Everything below it trades speed for fidelity, down to the first instruction after reset.

HLEdefault

Xermu's HLE kernel

A synthesized xboxkrnl.exe at its real address, with exports, data exports and patch detection. Dispatcher objects, timers, DPCs and APCs. Host folders or real FATX-style partitions. Passes 331 of the 378 tests of the expanded Xbox kernel test suite.

xermu game.xbe
Guestopen

oxkrnl, the open kernel

A freestanding replacement kernel in this repository. Binary compatible with retail XBEs, drives real hardware registers only, and is meant to run on a modded console too. Passes 332 of the 378 tests of the expanded Xbox kernel test suite; in captures, Halo and Blowout reach their first level under it. It answers the console's eject and power buttons and re-reads a swapped disc.

xermu --xkernel xboxkrnl.exe [game.xbe]
Guest

nboxkrnl

ergo720's replacement kernel, booted as guest code with the host services it expects.

xermu --nboxkrnl nboxkrnl.exe game.xbe
Guest

A retail kernel image

Your own console's xboxkrnl.exe, started from its entry point against the emulated hardware.

xermu --kernel xboxkrnl.exe game.xbe
LLE

BIOS, from the reset vector

The whole boot chain, optionally with the MCPX ROM, reading a disc image in the emulated DVD drive. Without the ROM, a model of its X-code interpreter boots the open Cromwell BIOS to its menu.

xermu --bios bios.bin [--mcpx mcpx.bin]

The open kernel Machine and kernel modes

Accuracy

Measured against the console, not against other emulators.

Where real hardware has an answer, that answer is the specification. Where it doesn't yet, the question is written down as a test that still has to be run on a console.

Golden images

The renderer is compared with captures from a real Xbox, using the nxdk_pgraph_tests suite. A page counts when its only differences are raster edges.

  • Fog exceptional values96 of 9696/96
  • Fog generation60 of 6060/60
  • Fog, eye-space w34 of 3634/36
  • Specular, back faces14 of 1714/17
  • Line width61 of 6161/61
  • Bump map32 of 4132/41
  • Bump map, luminance36 of 4236/42

A sample from 2 December 2026, misses included. In the last full sweep, 3,520 of 3,861 compared pages matched; the bump fixes came after it. The work is tracked in the open.

  • Differential fuzzing

    Random instruction sequences run on the JIT and on the host CPU, and must agree.

  • Assembly suites

    NASM tests for the instruction set, paging, faults, self-modifying code and every device model.

  • Determinism test

    The same title, twice, must take the same path.

  • Kernel cross-checks

    Titles booted under the open kernel are traced and compared with the HLE run of the same title.

  • Kernel test suite

    The Xbox kernel test suite holds a console's results. Of its 87 original tests, HLE passes 85 and the open kernel 84.

  • Device data sheets

    The 8254 timer and MC146818 clock are modelled from their data sheets, the timer checked against a per-clock 8253/8254 validation suite.

Online

A fair player on Insignia.

The emulated Ethernet port connects through a NAT inside Xermu, like a console behind a home router. Xbox Live, and so Insignia, runs over it.

Build and run

CMake, a C++20 compiler, a Vulkan 1.2 GPU.

x86-64 Linux, FreeBSD or Windows, or macOS (Intel, or Apple silicon through Rosetta 2). Dependencies are fetched by CMake. ROMs, kernels, keys and games are not included and must come from your own console.

git clone https://github.com/PatrickvL/Xermu
cd Xermu
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build -j4
./build/xermu

First start

Xermu opens on a title library and suggests folders to scan. Drop an .xbe, a title folder or an XISO on the window to start it. The last title is one key press away.

Xermu is also written to be used from a gamepad: hold Back + Start for a second, or press Guide, for the menu. On a Steam Deck, add Xermu as a non-Steam game; in Gaming Mode it is meant to start fullscreen with a larger interface and its own file browser. Neither has been tried on real hardware yet.

F1
library
F2
settings
F3
speed overlay
F5
restart
F6
pause
F11
fullscreen
F12
screenshot

Status

Where it stands.

Xermu runs real Xbox software in HLE mode. Many XDK samples render correctly. Commercial titles boot, load and render to varying degrees. There are no releases yet, and no compatibility list worth the name.

In headless captures with scripted controller input, seven commercial titles reach gameplay in HLE mode, with graphics and sound: Rayman Arena, Gunvalkyrie, Galleon, Gauntlet Dark Legacy, Blowout, Turok: Evolution and Halo: Combat Evolved. Gauntlet Dark Legacy still runs far below real time in-game, and Halo's opening cutscene is slow.

Recent measured work: fast paths in the push-buffer parser cut its GPU time in an in-game window of Gauntlet Dark Legacy from 9.0 to 3.85 s on an Intel Xe. The console's eject, disc swap and power buttons, the AV pack, HDTV modes and the video standard (NTSC and PAL) are emulated, with the controls in the frontend. Disc, port and register accesses now take bus time.

Titles are run and tested on Linux. The Windows, FreeBSD and macOS builds pass their tests in CI; on macOS the packaged app starts, but no title has been run on a Mac yet. Steam Deck support is written but not yet tried on a Deck.

On ARM64 Linux the tree builds in CI and the tests that need no guest code pass, but there is no CPU backend yet. Apple has named macOS 27 as the last release with Rosetta 2; a native ARM64 backend is planned, not started.