A static recompilation of Perfect Dark Remaster (Xbox 360, 2010, Title ID 584109C2)
to native PC, built on the ReXGlue SDK.
The game's PowerPC code is translated into C++ and compiled. There is no emulator.
This project is not affiliated with Microsoft, Rare or 4J. It contains no game files: you need your own legally owned copy of the game.
- Playable on Windows x64. Codegen runs clean: 15 032 functions from
default.xex. - Two renderers (
gpu_plugininhardware.toml):native, the SDK's Vulkan renderer (early; memexport and tessellated draws are skipped, as checked in), andxenos, the Xenos GPU emulation on Direct3D 12, Vulkan or the experimental Direct3D 11 (graphics_backend), to fall back to. - Keyboard and mouse with native mouse look, mouse in menus.
- Local split-screen, enabled for 2 players (
max_local_users), seesettings/split-screen.md. Online multiplayer is not implemented. - A launcher (
perfectdarkremasterrecomp_launcher.exe) to pick the main settings and start the game.
- CMake 3.25+, Ninja, and Clang/LLVM. MSVC alone won't build this.
- The game's files, extracted from your disc or ISO with XBLA-Extract or extract-xiso.
Copy the extracted files into assets/ (gitignored), so default.xex sits at
assets/default.xex alongside DataFiles/ and the rest.
-
Clone the repo with its submodule. The ReXGlue SDK is built from source (
thirdparty/rexglue-sdk).git clone --recursive <repo-url>If you already cloned without it, run
git submodule update --init --recursive. -
Build:
cmake --preset win-amd64-relwithdebinfo cmake --build --preset win-amd64-relwithdebinfoThere are also release and debug presets, and Linux, macOS and ARM64 ones (
linux-amd64-*,win-arm64-*,mac-*); only Windows x64 is tested. Codegen (default.xex→generated/) runs automatically as part of the build, again when the manifest,patches.tomlor the.xexchange. Optional:-DREXGLUE_RECOMP_ISA=x86-64-v3builds the generated code for newer CPUs.
out\build\win-amd64-relwithdebinfo\perfectdarkremasterrecomp.exe
Game files are found in <repo>/assets automatically; use --game_data_root
to point somewhere else. Logs go to out\build\<preset>\logs\.
Or start the launcher next to it:
out\build\win-amd64-relwithdebinfo\perfectdarkremasterrecomp_launcher.exe
It edits settings/hardware.toml and settings/mapping.toml in place (only
the changed lines), starts the game, and reopens with Safe mode if the game
crashes. Its page for this game is launcher/launcher.toml;
the format is described in the SDK's docs/launcher.md.
All settings live in settings/ and are loaded at
startup. CLI flags and REX_* environment variables override them. Restart the
game after editing the files.
| File | What it covers |
|---|---|
hardware.toml |
renderer (gpu_plugin, graphics_backend), upscaling, window, vsync, language (user_language), local players (max_local_users, keyboard_own_player), pdr_* gameplay and accessibility options |
mapping.toml |
input backend, keyboard and mouse bindings, pdr_mouse_*, mod hotkeys |
All SDK rendering options are described in settings/faq.md.
- Frame rate — the game clock advances at least one 60 Hz frame per pass of
the main loop, so without vsync it ran faster the higher the frame rate. It
now follows real time;
pdr_max_logic_hz(60-240, default 240) is the most game frames per second. Code insrc/timing/. - Mouse look and PC controls — the mouse turns the camera directly; menus
work with the mouse, keyboard keys show in on-screen prompts, stick dead
zones are below the game's 30%. Code in
src/mod/. - Upscalers and frame generation — on the native renderer, FSR 3/4, XeSS
and DLSS upscale the 3D scene with its depth and motion, and FSR / DLSS frame
generation runs in the game. The frame is then drawn in one 720p pass instead
of the game's four 1080p strips (
pdr_render_single_pass). Options insettings/faq.md; code insrc/render/engine/. - Third-person camera — camera behind Joanna, solo play, toggle with
V. Seesrc/mod/third_person/README.md. - Accessibility —
pdr_view_bob,pdr_cutscene_skip,pdr_default_auto_aim; small in-function changes emitted as mid-asm hooks frompatches.toml. - Fixes — no hang on mission restart (empty audio event queue), no random
crash or black screen at start-up and level loads (the sound player's
channel table was sized from an uninitialized value and overran the heap,
src/audio/), the xenia-canary texture noise fix, Combat Simulator / Co-Operative / Counter-Operative opening instead of closing after "Please wait" (profile sign-in order,src/platform/), and an optional skip of the Xbox LIVE prompt (pdr_skip_live_prompt). - Skip intro —
pdr_skip_introstarts at the menu, without the Rare and Perfect Dark logos. Code insrc/platform/. - Language —
user_languageinhardware.toml(1 English, 2 Japanese, 3 German, 4 French, 5 Spanish, 6 Italian).
- Reverse-engineering scripts for the game image and the generated code are in
tools/re/. The game is 4J's port of the N64 code, so the n64decomp/perfect_dark decompilation applies and names the functions. - Set
dev_debug_runtime = trueto stub every unknown function and log missing ones tologs/stub_sweep.txtandlogs/missed_functions.txt.
- ReXGlue SDK, whose runtime is derived from Xenia
- xenia-canary/game-patches, the source of the texture noise fix
- Perfect Dark XBLA PC Recomp by CaiusCodes (The Unlicense), the source of the PC controls (mouse in menus, keyboard prompts, mouse steering of the CamSpy, hoverbike and rocket, stick dead zones, cutscene skip), the view bob and auto-aim options, the start-up skip idea, the unlock options and the 2010 update's options (N64 explosions, Advanced Control)
- n64decomp/perfect_dark (MIT, Ryan Dwyer), the N64 decompilation behind the function names; not included in this repo
- SDL_GameControllerDB, for
settings/gamecontrollerdb.txt(zlib license) - XBLA-Extract and extract-xiso, for dumping the game
- Chakra Petch, the launcher's font (SIL OFL 1.1, see
launcher/fonts/)
MIT. See LICENSE. This applies to this project's own code only, not to the game or its assets.