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.
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.
guest · x86-32
mov eax, [ebx+8]
host · x86-64
lea r14d, [ebx+8]
mov eax, [r12+r14]
R12 points at a 4 GB window covering the guest's whole physical address space.
A RAM access is one instruction. With paging on, an inline soft-TLB lookup comes first.
A device register is simply not mapped: the first access faults, and the fault handler
patches that one site into a call to the device. RAM never pays for MMIO.
guest · ring 0
cli
mov cr3, eax
out dx, al
host · ring 3
; virtual IF in the guest context
; emulated CR3, traces unlinked
; I/O port dispatch table
The guest kernel believes it owns the machine. Control registers, descriptor tables,
the interrupt flag, MSRs and ports are all fields and tables in user space, so ring-0
guest code is sandboxed for free: it cannot leave the window or touch host hardware.
guest · x86-32
40 inc eax
host · x86-64
FF C0 inc eax
One of the few places where the two instruction sets collide: the one-byte
INC/DEC opcodes became REX prefixes in 64-bit mode, so they
are emitted in their two-byte form. ESP is the other exception: the guest stack
pointer is kept out of RSP.
Simplified for illustration. The real emitter is in
doc/DESIGN.md.
Self-modifying code, at no cost elsewhere
Pages holding translated code are write-protected. A store into one faults and drops
its traces, from any thread and through any alias. Stores to other pages have no
overhead.
Deterministic on request
With device threads off, RDTSC, the NV2A timer and kernel time run on emulated time.
Two runs of a title execute identically, and a regression test keeps it that way.
Flag liveness
Inline checks save guest flags with LAHF/SETO, and skip even that where the analysis
shows the flags are dead.
Linked traces
Exits with a known target are patched to jump straight to the next trace. Targets
known only at run time go through an indirect-branch cache.
Real Pentium III behaviour
x87, MMX and SSE. Later extensions raise #UD, as on the real CPU, even though the
host would happily run them.
No address-space tricks required
Where a 4 GB range can't be reserved, a handler mode serves every access
through the core instead. Slower, same results.
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.
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.
guest RAMPush bufferNV097 methods, vertices and textures, where the title wrote them
computeParserthe single consumer of the push buffer; emits indirect draws and exact per-draw state
vertexVertex übershaderfetches from guest memory; runs vertex programs and fixed-function T&L
fragmentFragment übershadertexture stages and combiners; depth, stencil and blend in the shader, in primitive order
scanoutFramebufferthe guest's own surface, presented as the encoder would
Raster operations in the shader
Depth, stencil and blending follow the NV2A's rules, not the host's fixed-function
approximations of them, with per-pixel ordering through fragment-shader interlock.
No shader compilation stutter
State is data, not pipelines. One set of shaders interprets whatever the title
programs, so a new material never waits for a compile.
Textures decoded from guest RAM
Swizzled and compressed formats are read where they lie, including dependent
texture reads. No upload cache to invalidate.
Traps and flips as on hardware
Software methods interrupt the guest where the real FIFO would, and the guest's own
framebuffer is what gets scanned out.
A Vulkan 1.2 floor
Every optional feature is detected at run time and has a fallback. It runs on
desktop drivers, on lavapipe and on MoltenVK.
Enhancements come second
A render scale is there today. Upscaling and the rest must never change what a title
computes.
When the driver lacks a feature
Optional feature
Without it
Result
fragment_shader_interlock
A per-pixel lock built from image atomics
Exact, except overlapping blended primitives within one draw: a few pixels in 10,000 at most
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.
Voice processorPCM and Xbox ADPCM voices, envelopes
Mixbins32 accumulation buses
Global processorDSP56300 · the title's effects program
Encode processorDSP56300
AC'97output DMA to the host device, stereo or 5.1
Bit-exact with the interpreter
The same steps in the same order: flags, the limiter, rounding, scaling, and the
address unit's modulo and reverse-carry modes.
Precise exits
A write that would land outside data RAM stops the block before anything changes.
Compiled code never touches a peripheral or starts DMA.
Specialised, and guarded
Blocks are compiled for the current scaling and rounding modes and checked on entry.
A write to program memory drops the blocks it touches.
Checked against silicon
Of 562 cases with register and memory results captured on MCPX silicon, 527 match;
the rest probe core faults. Cycle counts follow the DSP56300 manual's Table A-1.
5.1, and a console audio mode
The console's six speaker mixes can play as discrete 5.1, offered only when the
device reports six channels. A setting chooses the stereo, surround or Dolby Digital
mode that titles read from the EEPROM. Not yet tried on a real 5.1 device.
The title is always heard
The surround encoder programs need ROM data Xermu doesn't have. When the title's own
output is silent, the six speaker mixes play instead, downmixed on stereo.
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.xbeGuestopen
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.xbeGuest
A retail kernel image
Your own console's xboxkrnl.exe, started from its entry point against the
emulated hardware.
xermu --kernel xboxkrnl.exe game.xbeLLE
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.
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.
Real-time, unmodified
While the network is on, the guest's clocks never run ahead of the wall clock, and
frame-rate unlocks, cheats and fast-forward are refused. Presentation-only
enhancements stay.
Your console's identity
Online services identify a console by its EEPROM. You import your own. Nothing
ships with Xermu, and the online key is never written to a log.
Title updates stay out
By default a title that is told to update keeps running its disc version. Nothing on
the disk is deleted, and you can allow updates.
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.
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.