How wie-project/ps4recomp works
PS4Recomp is a macOS Apple Silicon AOT recompiler and runtime for decrypted PS4 game folders. The main user flow is to analyze or build a game through the CLI: load ELF/game data, inspect control flow, translate x86-64 instructions to ARM64, emit native assembly, and run the result with PS4-compatible runtime services. Graphics translation and Orbis subsystem emulation are important parallel capabilities. The README documents the high-level flow; several runtime and graphics implementation links are not visible in the sampled source, so those relationships are omitted rather than inferred.
Main entry points: recomp_runtime.h Recomp runtime · cli.go PS4Recomp CLI · arm64_lifter.go ARM64 lifter · asm_emitter.go Assembly emitter
Components 20
CLI and analysis
- PS4Recomp CLI
pkg/cli/cli.go - ELF loader
pkg/elfloader/loader.go - Executable analyzer
pkg/analyzer/analyzer.go - CFG and disassembly
pkg/disasm/cfg.go
Native translation
- ARM64 lifter
pkg/lifter/arm64_lifter.go - Assembly emitter
pkg/emitter/asm_emitter.go - macOS app output
pkg/cli/cli.go
Orbis runtime
- Recomp runtime
pkg/runtime/core/recomp_runtime.h - Kernel services
pkg/runtime/kernel - User service
pkg/runtime/modules/libSceUserService/ps4_user_service.c - System service
pkg/runtime/modules/libSceSystemService/ps4_system_service.c
Graphics translation
- Metal graphics
3rdparty/gcn-recompiler - GCN recompiler API
3rdparty/gcn-recompiler/include/gcn_recompiler.h
Media and input
- Audio services
pkg/runtime/modules/libSceAudioOut - ATRAC9 decoding
pkg/runtime/modules/libSceAjm/ps4_ajm.c - Video decoding
pkg/runtime/modules/libSceVideodec - Controller input
pkg/runtime/modules/libScePad
Other components
- Game developer
- Decrypted game folder
- Native ARM64 app
Connections 19
- Game developer → PS4Recomp CLI: invokes
README.md - PS4Recomp CLI → ELF loader: loads game
- Decrypted game folder → PS4Recomp CLI: supplies input
README.md - PS4Recomp CLI → Executable analyzer: analyzes
- PS4Recomp CLI → CFG and disassembly: inspects CFG
- PS4Recomp CLI → ARM64 lifter: recompiles
README.md - ARM64 lifter → Assembly emitter: emits assembly
- Assembly emitter → macOS app output: builds output
README.md - macOS app output → Native ARM64 app: produces
README.md - Native ARM64 app → Recomp runtime: runs with
- Recomp runtime → Kernel services: provides services
- Recomp runtime → User service: dispatches shims
pkg/runtime/modules/libSceUserService/ps4_user_service.c - Recomp runtime → System service: dispatches shims
pkg/runtime/modules/libSceSystemService/ps4_system_service.c - Recomp runtime → Metal graphics: runs graphics
- Metal graphics → GCN recompiler API: exposes API
- Recomp runtime → Audio services: provides audio
- Recomp runtime → ATRAC9 decoding: decodes audio
- Recomp runtime → Video decoding: decodes video
- Recomp runtime → Controller input: handles input