# MX vs. ATV Alive — Native Windows Recompilation A static recompilation of the Xbox 360 release of **MX vs. ATV Alive** (Title ID `5451087B`) into a native Windows x64 executable, built with [rexglue-sdk](https://github.com/rexglue/rexglue-sdk) v0.10.0. The game boots, renders, plays audio, saves, and runs a full Short Track race and Free Ride at a verified 60 fps. It is a working vertical slice and a starting point, not a finished port. > [!IMPORTANT] > **Unmaintained.** The original author is not continuing this project. It is > published so the work is not lost and can be picked up by someone else. > Forks and pull requests are welcome, but there is no maintainer to review > them. > [!WARNING] > **No game data is included.** This repository contains no game executable, > assets, or generated recompiled code. You must supply your own legally > obtained copy of the Xbox 360 game. See [Legal](#legal). ## Status | Milestone | State | What it means | |---|---|---| | M0 — Toolchain | ✅ Passed | rexglue builds; the XEX is ingested; ~41.7k functions are recompiled and linked | | M1 — Boot | ✅ Passed | Main menu, attract videos, audio, controller input, and a PC save work | | M2 — Vertical slice | ✅ Passed | Full Short Track race and Free Ride; full HUD and audio; no crashes observed | | M2.5 — 60 fps | ✅ Passed | ~59–60 guest fps with a 120 Hz guest refresh | | M3 — Full single-player | 🟡 In progress | One National event completed; all 18 levels, progression, and long-session saves remain | | M4 — Splitscreen | ⬜ Not started | | | M5 — High frame rates | 🟡 Best-effort | 60 supported; 120/144/240 do not reach target in heavy races | | M6 — Polish | ⬜ Not started | Enhancements, DLC, and an online/LIVE revisit | Detailed test results, performance measurements, and open issues are in [docs/STATUS.md](docs/STATUS.md). ## What works - Native executable; no emulator or interpreter fallback in the hot path. - Main menu, attract/Bink video playback, and menu navigation. - Short Track races and Free Ride with the full HUD, audio (XMA/XAudio2), and XInput controller input. Keyboard/mouse input is available via `--mnk_mode`. - Saves and profile data written to a PC-native directory. - Console 30 and 60 fps presets verified; 1080p guest mode verified. - 120/144/240 presets are exposed but best-effort: races measured ~85–95 fps and Free Ride 110–120 fps on the reference machine. - One National event completed with Rider XP and bike XP awards; one achievement unlock observed. ## What is missing - **M3:** only part of the single-player flow has been tested. All 18 playable levels, event unlocks, full Rider/Vehicle XP progression, and long-session saves still need validation. - **M4:** splitscreen has not been started. - **M6:** DLC, online/LIVE, leaderboards, enhancements, and a settings UI are out of scope or untested. - **Known bugs:** water textures corrupt when driving into water in Free Ride; `resolution_scale=2` (2K) shows artifacts and crashed mid-save once, damaging the save; the save-transition Bink resource lookup returns null (worked around with two mid-asm hooks); the high-FPS ceiling is CPU-bound. - No pixel/behaviour parity pass against the console or Xenia has been done. ## Quick start ### Requirements - Windows 10/11 x64 - Visual Studio 2022 Build Tools with the **Desktop development with C++** workload (MSVC v143 and a Windows 10/11 SDK) - LLVM/Clang 18+ (22.1.8 tested) and CMake 3.25+ (3.31.8 tested) on `PATH` - Ninja 1.13+ (bundled with recent Visual Studio/CMake installs) - Git for Windows and Node.js 20+ (Node is used only by the dev tools) - A DirectX 12 GPU - Your own copy of the Xbox 360 game ### Build and run ```bat git clone --recursive https://github.com/gw1337x/mx-vs-atv-alive-recomp.git cd mx-vs-atv-alive-recomp rem Build and install rexglue v0.10.0 with this project's local patches. tools\build-rexglue.bat rem Copy your own game files here (default.xex plus the rest of the disc): rem Game\MX vs. ATV Alive (USA Europe)\ tools\build-game.bat tools\run-game.bat 60 ``` The first game build runs codegen and takes a while. The executable is `out\build\win-amd64-release\mx_alive.exe`. See [docs/BUILDING.md](docs/BUILDING.md) for runtime flags, save locations, frame-rate presets, measuring FPS, SDK patch details, and troubleshooting. ## Repository layout | Path | Purpose | |---|---| | `src/` | Host app and mid-asm hooks | | `mx_alive_manifest.toml` | Codegen manifest: entrypoint, missed function boundaries, hooks | | `patches/rexglue-local.patch` | Local changes applied to the pinned SDK | | `tools/` | Build, launch, profiling, and crash-symbolization tools | | `third_party/rexglue-sdk/` | Pinned rexglue-sdk v0.10.0 submodule | | `docs/` | Building, status, credits, and architecture decisions | | `generated/` | Codegen output; gitignored and regenerated by the build | | `Game/` | Your game files; gitignored and never committed | `generated/rexglue.cmake` is the one tracked file under `generated/`: it is the CMake boilerplate that `CMakeLists.txt` includes at configure time. ## How to continue Rough priority order: 1. **M3 — finish the single-player sweep.** Enumerate the 12 National, 4 Short Track, and 2 Free Ride levels, play each, and log crashes. `.level` loads are logged by the local SDK patch. Return to the career menu after an event so the save is written. 2. **Fix water corruption** in Free Ride. Compare `readback_resolve=full` with the default eager path, then inspect the water resolve target. 3. **Fix the Bink save-transition lookup.** Two `midasm_hook`s currently skip the null dereference; the resource-system root cause is still open. 4. **Harden saves.** The 2K draw-scale preset crashed mid-save and truncated `SAVEGAME`. Reproduce with backups enabled, symbolize the crash site, and decide whether to hard-disable the preset. 5. **Raise the high-FPS ceiling.** The command processor and two guest threads are CPU-bound around 85–95 fps. The async readback worker removed the largest memcpy cost; next options are coalescing repeated resolves, a shared-memory resolve path, and profiling an async race. 6. **M4 splitscreen**, then M6 polish/DLC. 7. **Upstream generic SDK fixes** (async readback worker, FPS telemetry, crash RIP logging) to rexglue if they are still useful. Tools that make continuation easier: - `tools\boot-iterate.js` — launch, detect an unregistered indirect call, extend the manifest, and rebuild. - `tools\parse-thunks.js ` — turn the guest thunk dump into manifest entries. - `tools\symbolize.js ` — map a crash RVA to a recompiled function. - `tools\thread-sampler.cpp` + `tools\symbolize-rip.js` — RIP sampling and symbolization for performance work. - `tools\profile-race.ps1` — per-thread CPU sampling while the game runs. ## Credits This project stands on rexglue-sdk and Xenia. Full attribution and license notes are in [docs/CREDITS.md](docs/CREDITS.md). - **rexglue-sdk v0.10.0** — Tom Clay and contributors (BSD-3-Clause), with portions derived from the Xenia project (Ben Vanik and contributors). - **XenonRecomp** and **rexdex's recompiler** — the static-recompilation lineage rexglue builds on. - **Xenia Canary** — compatibility findings for this title (readback resolve and the occlusion-query workaround). - **Community reverse-engineering** — XeNTaX BXML notes, `bxml-tool`, `reflex-bxml-editor`, `reflex-package-tool`, and QuickBMS `mx_atv.bms`. - **Rainbow Studios / THQ Nordic** — the original game. ## Legal - This is an independent interoperability and research project. It is not affiliated with or endorsed by Microsoft, Xbox, THQ Nordic, Rainbow Studios, or any middleware vendor. - No copyrighted game code, game assets, encryption keys, or generated recompiled code is distributed here. `default.xex` and the game data must come from the user's own copy. - “MX vs. ATV” and related marks are trademarks of their respective owners. - The recompiled executable produced by the build process is intended for personal use with a legally owned copy of the game. ## License BSD-3-Clause. See [LICENSE](LICENSE). The pinned rexglue-sdk submodule retains its own BSD-3-Clause license and third-party notices.