XenonRecomp is a powerful tool designed to convert Xbox 360 executables into C++ code, allowing these executables to be recompiled for various platforms.

Currently, it supports x86 platforms due to its reliance on x86 intrinsics. This project draws inspiration from similar tools like N64: Recompiled, which serves the same purpose for Nintendo 64 executables.

Key Features Of XenonRecomp

  1. Instruction Conversion: XenonRecomp directly converts PPC instructions into C++ without optimizing them for human readability. It passes the CPU state and base address pointer as arguments to each PPC function, ensuring that all PPC registers and their current values are accounted for.
  2. Endianness Handling: Since the Xbox 360 is a big-endian machine, XenonRecomp handles memory loads and stores by swapping endianness. For vector registers, it reverses the entire 16-byte vector to manage endianness correctly.
  3. FPU and VMX Instructions: The tool manages floating-point and VMX instructions by storing the floating-point state and enabling or disabling denormal flushing as needed. Most VMX instructions are implemented using x86 intrinsics.
  4. MMIO and Indirect Functions: While Memory-Mapped Input/Output (MMIO) is currently unimplemented, XenonRecomp resolves virtual function calls by creating a “perfect hash table” at runtime.
  5. Jump Tables and Function Boundaries: XenonAnalyse, a companion tool, detects jump tables and function boundaries. Jump tables are converted into real switch cases, and users can manually define function boundaries if needed.
  6. Optimizations: XenonRecomp offers several optimizations, such as converting certain registers into local variables, which can significantly reduce executable size and improve performance.
  7. Patch Mechanisms: Users can override PPC functions with custom implementations using Clang compiler techniques. Mid-asm hooks allow for inserting custom code at specific instruction addresses.

XenonRecomp requires a TOML configuration file that specifies paths to the input XEX file, output directory, and other settings.

Users can define function boundaries, invalid instructions to skip, and mid-asm hooks within this file. XenonAnalyse is used to generate TOML files containing detected jump tables, which are then referenced by XenonRecomp.

In summary, XenonRecomp is a versatile tool for recompiling Xbox 360 executables, offering a range of features and optimizations that make it a valuable resource for developers looking to port games to other platforms.

However, it still faces challenges such as implementing MMIO and supporting exceptions.

LEAVE A REPLY

Please enter your comment!
Please enter your name here