Quick Start Guide
This guide walks you through creating, configuring, and building your first recompiled Xbox 360 project using ReXGlue.Prerequisites: Make sure you have installed the ReXGlue SDK and have a Clang 18+ toolchain configured.
Overview
The ReXGlue workflow consists of four main steps:
Let’s get started!
Step 1: Initialize a New Project
Use therexglue init command to create a new project scaffold:
--app_name(required): Project name (snake_case recommended)--app_root(required): Directory where project will be created--app_desc(optional): Project description--app_author(optional): Your name or organization--force: Overwrite existing files if present
src/rexglue/main.cpp:101-119
Generated Project Structure
The init command creates the following structure:Understanding main.cpp
The generatedmain.cpp creates a minimal ReXApp:
src/rexglue/commands/init_command.cpp:109-140
The REX_DEFINE_APP macro provides the platform-specific entry point (WinMain on Windows, main on Linux).
Step 2: Configure Code Generation
Edit the generatedmy_game_config.toml file to configure code generation:
src/rexglue/commands/init_command.cpp:142-155
Configuration Options Reference
Required Fields
Required Fields
project_name: Project identifier used for generated file namesfile_path: Path to Xbox 360 XEX executable (relative or absolute)out_directory_path: Where to write generated C++ files
Code Generation Options
Code Generation Options
skip_lr: Skip link register (LR) tracking (default: false)skip_msr: Skip machine state register (MSR) (default: false)ctr_as_local_variable: Promote CTR to local variable (default: false)xer_as_local_variable: Promote XER to local variable (default: false)cr_registers_as_local_variables: Promote CR fields (default: false)non_volatile_registers_as_local_variables: Promote saved registers (default: false)generate_exception_handlers: Wrap functions in SEH handlers (default: false)
Analysis Tuning
Analysis Tuning
max_jump_extension: Max bytes to extend function for jump targets (default: 65536)data_region_threshold: Invalid instruction count to mark data region (default: 16)large_function_threshold: Warn if function exceeds size (default: 1048576)
Manual Overrides
Manual Overrides
Functions: Explicitly define function boundaries and namesSwitch Tables: Hint jump table locations
include/rex/codegen/config.h:71-134
Step 3: Place Your XEX File
Copy your Xbox 360 executable to the path specified infile_path:
XEX files are Xbox 360 executable format. You’ll need to extract these from Xbox 360 game discs or downloads. ReXGlue does not provide these files.
Step 4: Run Code Generation
Analyze the XEX and generate C++ code:--force: Force regeneration even if output is newer than input--enable_exception_handlers: Override TOML setting to enable SEH wrappers--log_level=<level>: Set logging verbosity (trace, debug, info, warn, error)--log_file=<path>: Write logs to file
src/rexglue/main.cpp:120-130
Generated Output
The codegen command creates:Code generation can take several minutes for large executables. Use
--log_level=debug to see detailed progress.Step 5: Configure CMake
Configure the build using CMake presets:- Subdirectory: Set
REXSDK_DIRto SDK source tree location - Installed Package: Omit
REXSDK_DIRif SDK is onCMAKE_PREFIX_PATH
src/rexglue/commands/init_command.cpp:47-60
Step 6: Build Your Project
Compile the generated code and runtime:CMakeLists.txt includes a custom target for regenerating code:
src/rexglue/commands/init_command.cpp:96-103
Step 7: Run Your Recompiled Game
Run the built executable:Customizing Your App
Extend the generatedMyGameApp class to add custom behavior:
CMakeLists.txt to use your custom main:
Migrating to New SDK Versions
When updating to a new SDK version, use the migrate command:src/rexglue/main.cpp:145-155
Troubleshooting
Codegen fails with 'file not found'
Codegen fails with 'file not found'
Check that Use absolute paths if relative paths aren’t resolving correctly.
file_path in your TOML points to a valid XEX file:Build fails with 'GENERATED_SOURCES not found'
Build fails with 'GENERATED_SOURCES not found'
You need to run codegen before building:This creates
generated/sources.cmake which CMake includes.Runtime crashes immediately
Runtime crashes immediately
Common causes:
- Missing assets: Game may need additional data files
- Invalid function boundaries: Check TOML function definitions
- Memory mapping failed: Check system has enough virtual address space
Game renders incorrectly
Game renders incorrectly
Graphics issues may require shader translation fixes or GPU state mapping. This is an active area of development.Try:
- Different graphics backend (Vulkan vs D3D12)
- Enable RenderDoc for frame capture analysis
- Report issues on GitHub with screenshots
Example Projects
Study these complete examples to learn more:demo-iruka
Simple demonstration project showing basic recompilation
reblue
Full game recompilation with custom hooks and asset loading
Next Steps
Configuration Reference
Complete TOML configuration options and advanced features
API Reference
ReXGlue SDK API documentation and runtime hooks
Join Discord
Get help and share your recompiled projects
GitHub Issues
Report bugs or request features