Repository navigation
Porting a Game
Pablo Souza edited this page Nov 14, 2026
·
2 revisions
Here is what it took to port the six supported games, step by step. Keep the project rules in mind: C / C++ only, nothing copyrighted in git, and never write into the game's folder.
cmake --build build --target x2recomp
build/recompiler/x2recomp "<game dir>/game.exe" games/<id>/gen-
Check
report.txt. It lists unsupported instructions.outsb/insd/aascome from data misread as code and are harmless. -
Don't pipe
x2recompintohead. SIGPIPE stops it halfway, andfuncs.handtable.cthen disagree.
- Add the game's label in the
if(game STREQUAL ...)chain ofruntime/CMakeLists.txt. - Configure and build:
cmake -S . -B build && cmake --build build --target x2-<id>cd "<game dir>"
SDL_AUDIO_DRIVER=dummy X2_NOPRESENT=1 X2_SHOT=300,600 X2_SHOT_PATH=$TMPDIR/s.png \
/path/to/build/x2-<id> . -vv-
Missing imports.
-vvlists them ("unimplemented import DLL!Name"). The first call to one stops the game and names the caller. Implement it in the matchingruntime/src/hle/*.ctable. -
New DLL versions. A new version of a DLL (
d3dx9_31.dll, ...) is an alias inhle_modules[](loader.c) and infake_modules[](hle/k32_misc.c). -
Follow the game's code. Before guessing at a protocol, read what the
game does. The disassembly of
game.exeand the generated C side by side answer most questions.
-
Find the button layout. Open the game's INPUT TEST in its test menu.
X2_INPUT=900:t,910:-,...scripts the test switch and the buttons. - If the I/O board never comes up, look at how the game opens it. BlazBlue CT talks to an I/O-board controller before JVS, and its I/O thread suspends itself every frame.
-
Add a default pad layout in
padmap.cif the panel isn't KOF-like. Document theX2_PADline for 8-button sticks.
- Add the game to
X2_GAMESand build the core:cmake --build build-android --target typex2_libretro. A plaincmake --build build-androiddoes not rebuild the core. - Copy the game to
ROMs/arcade/<Game>.x2/. - Measure with
X2_PACELOGandX2_PROF. See Android and RetroArch.
-
Recompiler changes. After any change to the recompiler, regenerate
every game's
gen/. - Check the other games. At least their attract mode. Use pixel-identical screenshots of a deterministic screen (title, character select) when a change should not alter output.
-
Update the docs:
- the game's page and Game status;
- the README's games table, and Debugging for new switches;
-
CLAUDE.md(game table).
- Commit and push.
Status
Games
Guides
Development