XboxRecomp2
.-''-.
▄▄▀ .' .-. )
▄▄▀▄██▀ / .' / /
▄█ ███ (_/ / /
█▓██▓█ ▄▄███ ▐▄• ▄ ▄▄▄▄· ▐▄• ▄ ▄▄▄ ▄▄▄ . ▄▄· • ▌ ▄ ·. ▄▄▄· / /
█▓█████▓█▀ █▌█▌▪▐█ ▀█▪▪ █▌█▌▪▀▄ █·▀▄.▀·▐█ ▌▪▪ ·██ ▐███▪▐█ ▄█ / /
█▓▓▀ ▄▄▄██▄▄ ·██· ▐█▀▀█▄ ▄█▀▄ ·██· ▐▀▀▄ ▐▀▀▪▄██ ▄▄ ▄█▀▄ ▐█ ▌▐▌▐█· ██▀· . '
█▒▒█▄▄██ █ ▪▐█·█▌██▄▪▐█▐█▌.▐▌▪▐█·█▌▐█•█▌▐█▄▄▌▐███▌▐█▌.▐▌██ ██▌▐█▌▐█▪·• / / _.-')
█▀▓▒▒▓▓▀▀ •▀▀ ▀▀·▀▀▀▀ ▀█▄▀▪•▀▀ ▀▀.▀ ▀ ▀▀▀ ·▀▀▀ ▀█▄▀▪▀▀ █▪▀▀▀.▀ .' ' _.'.-''
▀▓▓▄ / /.-'_.'
▀▀██▄▄▄ / _.'
( _.-'
XboxRecomp2 translates original Xbox x86 game code into C++ source.
And makes it go brr~ 🦔 🏎️

For many reasons, x86 is a notoriously difficult architecture to recompile; especially at speed.
Most recompilers do 1:1 code translation; but that simply doesn't cut it here.
XboxRecomp2 achieves around 2.5x the performance of a raw 1:1 ASM -> C translation.
Through a series of speed hacks, heavy optimisation, and intermediate code rewrites.
You can learn about How It Works in this detailed write-up.
Source Code Structure
How the internal code is arranged.
+--------------+
| cli | Entry point (command-line binary)
+------+-------+
|
v
+---------------------+
| xbox-recomp2-xbox | XBE + Xbox platform
+----------+----------+
|
v
+---------------------+
| xbox-recomp2 | Core recompiler
+------+-------+------+
| |
| +----------------------+
v v
+---------------------+ +-----------------------------+
| xbox-recomp2- | | xbox-recomp2-recomp-config |
| executable | | (recompConfig.toml parser) |
+---------------------+ +-----------------------------+
Arrows point from a crate (project) to the other crates it uses.
- xbox-recomp2: Core library (recompiler pipeline)
- xbox-recomp2-executable: Allows you to add executable formats (e.g.
.xbe,.exe) - xbox-recomp2-xbox: Xbox support: XBE loading, memory access routing etc.
- xbox-recomp2-recomp-config: Parser for
recompConfig.toml. - cli: Command-line interface.
The XboxRecomp2 recompiler supports most of the x86 instruction set required to run games built for the original Xbox. (Pentium III)
Also taken extra care to carefully carve out the Xbox-specific parts of the recompiler into their own, dedicated modules and crates.
In other words, you can make this recompile Win32, Linux, Chihiro, SEGA Lindbergh or other 32-bit x86-based platforms.
That's an exercise for the reader 😉.
Warning: Imperfect Code
Due to time constraints, some parts of source code aren't as polished as I'd like.
Quite frankly, I spent 12h everyday coding, for 3 months straight; between paid work and this recompiler.
For our Nov15 Shadow05 release.
I provide this recompiler to help you port awesome Xbox games to the PC.
That said, I got too many other projects of my own- please fork this if you plan to do significant work on this.
Why I wrote it
Developer Manual
For step-by-step development guidance, see the Developer Manual.
Contributing
We welcome contributions! See the Contributing Guide for details.
License
Licensed under MIT.
Greetz
- Sora & Skyth: Original XboxRecomp & XenonRecomp which were used as reference.
- CXBX-Reloaded & Co: Reference code for kernel thunk handling & other similar shenianigans.
- Caustik: (OG CXBX Dev) XBE File Format Reference
- Font: Elite (from TheDraw, Author Unknown)