How retroportingtoolkit/psxrecomp works
PSXRecomp is a framework that turns a PlayStation disc into a native game executable linked to a hardware-accurate PS1 runtime. The main workflow verifies and prepares a disc, parses its executable, analyzes MIPS code and emits native C; the runtime executes that code alongside BIOS and hardware services. Separate branches provide ahead-of-time overlay sharding, interpreter fallback, widescreen and mod support, and multiplayer. The README documents these capabilities; unsampled source limits detailed call wiring, so the graph shows only the documented workflow and clear runtime responsibilities.
Main entry points: main.cpp Runtime entry · psxrecomp_cli.py Game CLI · ps1_exe_parser.cpp EXE parser · function_analysis.cpp Code analysis
Components 20
Recompilation
- Game CLI
psxrecomp_cli.py - EXE parser
recompiler/src/ps1_exe_parser.cpp - Code analysis
recompiler/src/function_analysis.cpp - Function discovery
recompiler/src/function_discovery.cpp - C code generator
recompiler/src/code_generator.cpp
Runtime execution
- Runtime entry
runtime/src/main.cpp - BIOS backends
runtime/src/psx_bios_backend.c - PS1 hardware
runtime/src/psx_interpreter.c - MIPS fallback
runtime/src/psx_interpreter.c - Overlay capture
runtime/src/autocompile.c
Game enhancements
- AOT sharding
tools/aot_overlay_pipeline.py - Widescreen
runtime/src/ws_aspect_cone_math.c - Mod runtime
runtime/src/mod_runtime.cpp
Multiplayer
- Netplay
runtime/src/psx_netplay.c - Lobby client
runtime/src/psx_lobby_client.c
Other components
- Game developer
- PS1 disc
- Native game
- Player
- Lobby service
Connections 19
- Game developer → Game CLI: runs generation
- PS1 disc → Game CLI: provides input
- Game CLI → EXE parser: prepares executable
- EXE parser → Code analysis: supplies code
- Code analysis → Function discovery: informs discovery
- Function discovery → C code generator: identifies functions
- C code generator → Native game: emits native code
- Player → Runtime entry: runs game
- Native game → Runtime entry: executes in
- Runtime entry → BIOS backends: selects BIOS
- Runtime entry → PS1 hardware: uses hardware services
- Runtime entry → MIPS fallback: falls back to
- Runtime entry → Overlay capture: captures streamed code
- Overlay capture → AOT sharding: feeds compilation
- Runtime entry → Widescreen: applies display changes
- Runtime entry → Mod runtime: loads modifications
- Runtime entry → Netplay: runs multiplayer
- Netplay → Lobby client: uses matchmaking
- Lobby client → Lobby service: communicates with