https://jxnplays.github.io/cod3-reborn
Call of Duty 3 (Xbox 360, 2007) running as a native Windows PC binary.
The Xbox 360 executable is translated ahead-of-time from PowerPC to x86-64 with XenonRecomp, and this project supplies the runtime the translated code links against: guest memory, the PowerPC dispatch table, the Xbox 360 kernel API surface, the Xenos GPU command processor and a Direct3D 11 renderer that draws the title's own shaders.
There is no emulation layer and no dynamic translation at run time — once compiled, the game code is ordinary x86-64 that the OS runs natively.
Source dump (read-only): your own copy of default.xex.
Status: this is a working port, and the remaster work is starting. The inherited runtime is solid enough that levels load, render and play. What is not done is everything this project intends to add on top. See Roadmap for where the line is, and please read Known gaps before reporting a bug — several are long-standing and documented rather than hidden.
Start here, in the order you probably want them:
| docs/SETUP.md | Setup tutorial. Prerequisites, how to build it, every environment variable, troubleshooting. Read this first if you want to run it. |
| docs/PROVENANCE.md | Whose work this is, and what this project changed. Read before patching the runtime. |
| docs/GAPS.md | The open questions, with what is known about each |
| docs/CONSOLE.md | How commands reach the title, and the 188 console variables it has |
| docs/MOUSE.md | Mouse look: the measurements, and the leads already exhausted |
| docs/cvars.txt | The console variables, as a plain list |
| docs/FINDINGS.md | Earlier analysis |
| docs/renderer.md | How the Direct3D 11 renderer works |
| docs/animation.md | Animation |
| docs/scripts.md | What each script in scripts/ does |
| docs/kernel-imports.txt | The 179 Xbox 360 imports and their status |
Two things a newcomer usually gets wrong, so they are said here as well as
below: the game is not in this repository (no .xex, no assets, ever), and
the level libraries are a separate build step that recompile.ps1 does not
perform for you.
This repository is a continuation of the work in
FrankHUN88453/CoD3Recomp, which
reached a working, rendering port of Call of Duty 3 through static recompilation.
That project is the foundation here, and its runtime is what this one builds on.
The runtime — the kernel, the GPU command processor, the D3D11 renderer, the Xenos shader translator, the audio and input paths — is his work, under the BSD 3-Clause licence. That notice is retained in LICENSE; it is a condition of the licence and this repository keeps it.
What this project adds is the direction, the roadmap and the work on top. We are not presenting his port as ours.
See docs/PROVENANCE.md for the full picture, including what this repository inherited and what it changed.
What the inherited port does. Read this table as inherited and reported, not independently re-verified by us — we have measured less of it than it claims, and Known gaps and STATUS.md are the honest sources.
| Boot | Loads default.xex, maps 15 sections, enters guest code |
| Kernel | 179 Xbox 360 imports present in the table; a handful are stubs |
| Recompilation | ~19.4k functions, main game plus 15 level DLLs |
| GPU | Xenos PM4 command processor decodes the register writes |
| Rendering | Direct3D 11, the title's own shaders via HLSL |
| Assets | Streams level archives from the game directory |
| Audio | XMA decoded through FFmpeg |
| Input | Keyboard, mouse and pad, with controller navigation in the menus |
| Settings | Resolution, filtering, anisotropy, AA, FOV, FPS cap |
| Color | One "Look" preset sets the whole grade; every slider can still be moved on its own |
| Cheats | The title's own GAME_* debug commands, from F11 |
| Mods | 41 of the title's own console variables, from F11 |
Small list, but it is measured rather than inherited. Saint-Lô (saint_lo)
was run end-to-end on this build: it loads, streams its archives, and renders —
299 fps, 74 files, 195 MB read, at 1280x720.
All fifteen levels now run. Each was launched on its own with \scripts/probe_level.ps1\ and confirmed to stream its archives and draw a world: \saint_lo\ 145 fps, \�lkbrn\ 90, \chambois\ 46, \credits\ 234 (the end reel), \crssrds\ 120, \alaise\ 125, \orest\ 111, \uelplnt\ 127, \hostage91, \island\ 89, \laison\ 104, \mace2\ 113, \mayenne\ 127, ightd\ 118, \stbert\ 88. \docs/GAPS.md\ has the table.
That says each level loads and renders. It does not say the whole campaign plays start to finish, and one bug found only by playing is still open: in \�lkbrn, being shot in a vehicle empties the 3D world for several seconds while the HUD keeps drawing.
Measured and confirmed:
rldicr's mask. We changed it to match Xenia's own instruction tests, which broke the title badly enough that it would not boot. Reverted. Where MB is 31 or more, the tests and this title's code genuinely disagree, and the code that runs is the one that counts. The finding is written up in the recompiler and indocs/GAPS.md, because "matches the test suite" is not the same as "correct" and here they came apart.- Input latency. The message pump runs 540 rounds a second, one every 1.85 ms,
so end-to-end input latency is that plus at most one frame. Aim mapping is
confirmed
MAP_LINEAR, so there is no response curve to compensate for. Details and the list of leads already exhausted:docs/MOUSE.md.
Stated plainly, because a port that hides its holes is harder to help with.
From the inherited work:
- Depth, blend and stencil coverage is narrower than the hardware's
- Several texture and vertex formats are counted and named at run time, not implemented
- Texture sampling is nearest; edges are harder than they should be
RtlRaiseException/RtlUnwindreport and stop — anything that throws is unrecoverable. This is why the kernel row above does not say "all implemented."- The recompiled output has not been verified instruction-by-instruction against the original
Ours:
- Mouse look is unresolved. An attempt to fix it was reverted in full; see
docs/MOUSE.mdfor what was measured and what has already been ruled out. The open lead is upstream in the kernel:XamUserReadProfileSettingsreports all eight settings as unset, so the title falls back to its own default sensitivity and nothing persists. - Frame rate is not understood. The same build and level have been observed at 22 fps, 144 fps and 299 fps. We do not yet know what the difference is, and we are not going to guess in public.
- 73 failing checks across 27 of Xenia's 165 instruction tests, all sharing
one root cause in the four-argument
make_full_test_constantmacro and theclrldi r3,r3,32inside it. Not yet solved. (verify.ps1 -Allprints the first 40 failing lines, which is why the console output understates this.)
STATUS.md carries the detail and the measurements behind the inherited work.
A clone alone will not build the game. The tools build from a bare checkout in about 30 seconds.
CoD3.exeneeds your own legally owned copy of Call of Duty 3, because the game code, data, audio and shaders are Activision's and are not committed here — there is no.xexin this repository and there never will be. Expect 2–4 hours for the first full build, nearly all of it waiting.
docs/SETUP.md is the step-by-step tutorial, including prerequisites, what each step costs in time and disk, every environment variable the host understands, and a troubleshooting section. Start there.
The short version:
Requires CMake 3.20+, Ninja, Clang (not optional — the generated code
depends on Clang intrinsics and the alias attribute used for function hooking),
and Visual Studio or the Visual Studio Build Tools for the Windows SDK headers
and rc.exe. A PowerShell 5+ shell. Pin LLVM 20.1.8.
A user with an extracted COD3 folder can build the .exe. One folder is the requirement:
<game>\default.xex
<game>\sp\<level>\<level>.dll (15 levels, discovered automatically)
Three ways to point the scripts at it:
- Pass
-GameRoottorecompile.ps1orrecompile_level.ps1. - Run
CoD3.exe --gameor--isoonce; it records the path ingame.path. - Drop a
game/folder beside the repo.
The scripts search all three and copy the executable and level DLLs out themselves.
game.path is written beside the executable, which is build\CoD3Host\, and
both scripts look there as well as at the repository root. A game.path naming
a folder that no longer holds the game is reported and skipped, not believed.
The recompiler carries fixes this project depends on. They live as a patch so they apply to a pristine checkout:
git submodule update --init tools/XenonRecomp
git -C tools/XenonRecomp apply ..\patches\XenonRecomp.patchSkip this and the recompiler mistranslates the title.
They are GPL and deliberately not committed. This downloads them:
.\scripts\get_ffmpeg_headers.ps1 # pinned to FFmpeg 8.1 (avcodec-62)Without this the build has no XMA decoder and there is no audio.
.\scripts\recompile.ps1 -BuildTools -BuildLib -BuildHostHours. ~19.4k functions. It compiles the main game into CoD3RecompLib/ppc/
and builds the host.
.\scripts\recompile_level.ps1 -All # 15 more DLLs, also hoursThese are separate libraries and this step is not optional. -BuildLib does
not build them — the level targets are not in the default build. Skipping this
produces a host that starts, shows a black window and hangs before it draws
anything, which looks like a driver problem and is not one.
The level libraries are discovered by CMake at configure time, so step 4
created 15 new targets that the existing build tree knows nothing about. Run
CMake directly — do not go back through recompile.ps1, whose recompile stage
is not optional and would repeat the hours from steps 3 and 4 for no reason:
$bt = 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools'
& cmd /c "`"$bt\VC\Auxiliary\Build\vcvars64.bat`" >nul 2>&1 && set PATH=$bt\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;$bt\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\PROGRA~1\LLVM\bin;%PATH% && cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl && cmake --build build --parallel 4"Substitute your own Visual Studio path — recompile.ps1 globs for it rather than
naming one, which is why it keeps working across VS versions.
recompile.ps1 applies the coroutine patch after recompiling; without it the
first level's scripts spin forever.
On parallelism: the default in recompile.ps1 is your core count, and that
will run the machine out of memory. Clang-cl holds several GB per translation
unit and the generated code is 549 MB of it. --parallel 4 is what works on
a 32 GB machine. Lower it if you are short on memory; going above 4 buys little
and risks a failed build with LLVM ERROR: out of memory. We hit exactly that at
16 jobs on this machine.
You should end up with build/CoD3Host/CoD3.exe.
.\scripts\verify.ps1 # mechanical build and behaviour checks
.\scripts\verify.ps1 -All # plus the instruction tests-All runs 165 of Xenia's instruction tests and currently reports 73
failing checks across 27 tests, all from one root cause in Xenia's test
macros (see Known gaps). That is the known baseline, not a
regression you introduced. It prints the first 40 failing lines, so the output
you see is shorter than the number of failures.
CoD3.exe looks for a game folder beside itself and offers to install from a
disc image (XGD1/XGD2/XGD3 all recognised), from a folder you already extracted,
or in place from a folder elsewhere.
CoD3.exe --iso "D:\Call of Duty 3.iso"
CoD3.exe --game "D:\Call of Duty 3 (USA, Europe)"
CoD3.exe --help
| Key | |
|---|---|
F11 |
settings, and the mod menu — both work with a controller |
F12 |
screenshot, plus the next two frames' draws to CoD3.log |
` |
the title's own console (spmap forest, sv_cheats 1, GAME_GODMODEON) |
Escape |
pause |
F11 opens the settings panel: Graphics, Color, Cheats,
Controls, and Mods.
The Mods tab is 41 of the title's own console variables — crosshair, weapon
model, HUD brightness, compass, objectives, fog, fullbright, clipping planes,
texture filtering, and the r_show* debug set. Each takes effect the moment
you change it. docs/cvars.txt has the full list and docs/CONSOLE.md
explains the mechanism.
F11 has a Cheats tab, and it works. These are the title's own debug
commands, which were sitting in guest memory the whole time:
| Menu row | Command | |
|---|---|---|
| God mode | GAME_GODMODEON / GAME_GODMODEOFF |
|
| Enemies ignore you | GAME_NOTARGETON / GAME_NOTARGETOFF |
|
| Walk through walls | GAME_NOCLIPON / GAME_NOCLIPOFF |
|
| Clear the fog | fog off / fog on |
measured working |
| Give ammo / Give everything | give ammo / give all |
They are behind the title's own sv_cheats gate, which the menu sets to 1 the
first time you switch one on. All start off, and a level starting turns them
all off again.
They were nearly missed twice. The short names — god, noclip,
notarget — appear in the same table and are arguments, not commands;
sending them does nothing at all, silently. And the reason was not in that
table either: it is the string GAME_CHEATSNOTENABLED, which is what the
title prints when it refuses. docs/DEV_COMMANDS.md has the addresses and
the full story, including why the wrong conclusion was written down and
pushed before it was corrected.
SMAA, TAA and FSR. Ambient occlusion. Shadow quality settings. A skybox or day-night cycle. Weather toggles. Weapon inspect animations. Higher internal resolution (see below). Multiplayer.
On resolution scale: the game renders at 1040×720 at every setting. The control changes the size of the buffer the finished image is blown up into, not the resolution the geometry is drawn at, so above 100% it is a pure upscale that adds no detail and makes existing edges larger. It is left in place because it does no harm at or below 100%, but do not expect supersampling from it.
Controls drives the whole panel with a controller as well as a mouse: D-pad or left stick to move, A to activate, bumpers to switch tabs. Which set of button icons to draw is chosen there too, and it changes immediately — Xbox, PlayStation by default, or letters only with no images at all. Every keybind also shows the pad button that does the same thing.
CONTRIBUTING.md covers how to submit a change, which parts of the repository are most useful to work on, and the house rule: a number should be something someone measured.
Two things to know before you start — you need your own copy of the game (nothing of it is in this repository), and most of the code here is FrankHUN88453's under BSD 3-Clause rather than ours.
Call of Duty 3 Remastered. The port is the foundation; the remaster is the project. The 360 original is capped at 720p, 4:3, 30 fps, with no settings menu worth the name and no widescreen. None of that is a hardware limit — it is what shipped on a seven-year-old console. A recompiled build running on a modern GPU has no reason to inherit any of it.
Phase 1 — a stable base. All fifteen levels run, the campaign plays start to
finish, saves work. Then close the inherited gaps: depth, blend and stencil
coverage, the missing texture and vertex formats, filtering that is not nearest-
neighbour, and RtlRaiseException so a thrown exception is not the end of the
process. Make what runs be what shipped, then improve on it.
Phase 2 — modern settings and presentation. An Escape-key settings menu covering what the 360 never exposed: resolution and windowed modes, ultrawide and arbitrary aspect ratios, uncapped frame rate, shadow and lighting options, anisotropic filtering done properly, and per-user profiles.
Phase 3 — remaster features. The ones the design invites: custom servers, larger multiplayer matches, modern input handling, and beyond.
Work is ordered by what unblocks the next thing, and every claim on this page gets measured before it is believed. Where we do not know — the mouse, the frame rate swing — we say so rather than guessing. Contributions welcome; see Known gaps for the shortest route to something useful.
| Path | |
|---|---|
CoD3Host/ |
the executable: kernel, renderer, GPU, audio, input |
CoD3RecompLib/config/ |
recompiler configuration, every address documented |
scripts/ |
the pipeline, analysis tools and frame comparison |
tools/ |
XenonRecomp (patched submodule), XEX scanner, PowerPC assembler |
docs/ |
setup tutorial, provenance, gaps, findings, renderer design, kernel import list |
This repository contains no Activision or Treyarch assets, no game code, no game data, no game audio and no screenshots of the game. It is build configuration, tooling and a host runtime that target a separately supplied, legally owned copy of the game. (Game screenshots that were committed here earlier have been removed for exactly that reason.)
You provide your own disc or dump. Please do not ask where to obtain one.
The port derives from FrankHUN88453/CoD3Recomp,
used with his permission. Its BSD 3-Clause notice is retained in
LICENSE. We are grateful for it — this project would not exist
without it. Please treat that attribution as a condition of use, not a
formality; the provenance is spelled out in
docs/PROVENANCE.md.
Our own work is MIT. The inherited runtime is BSD 3-Clause and retains its notice. See LICENSE.
