How elmasas/lcs-recomp works
LCS Recomp is a PC port of GTA: Liberty City Stories, powered by PSPRecomp’s Allegrex analysis, ahead-of-time translation, and runtime. The main play path loads the supplied ELF, installs LCS kernel/HLE behavior, initializes host display and graphics, then executes the guest while translating its GE and audio activity into host output. The README also documents configurable Windows and Linux backends. Several host and profile sources are only partially sampled, so the graph keeps those connections at documented entry points and omits uncertain internal call chains.
Main entry points: main.cpp LCS launcher · runtime.cpp PSP runtime · lcs_profile.cpp Kernel HLE profile · codegen_main.cpp AOT code generator
Components 20
PSP runtime
- ELF loader
src/elf32.cpp - Guest memory
src/guest_memory.cpp - PSP runtime
src/runtime.cpp - Allegrex context
include/psprecomp/allegrex_context.hpp
ELF tooling
- ELF analyzer
tools/analyzer_main.cpp - Program analysis
src/program_analysis.cpp - AOT code generator
tools/codegen_main.cpp
LCS emulation
- LCS launcher
lcs/host/main.cpp - Kernel HLE profile
lcs/host/lcs_profile.cpp - GE command execution
lcs/host/lcs_ge_exec.cpp
Host output
- GE renderer
lcs/host/ge_renderer.cpp - GPU backend
lcs/host/ge_gpu_backend.hpp - Display window
lcs/host/display_window.hpp - Host controls
lcs/host/lcs_controls.cpp - Audio output
lcs/host/lcs_audio_output.cpp - Media decoder
lcs/host/lcs_media_decoder.cpp
Other components
- Player
- Game files
- Generated functions
- Host platform
Connections 30
- Player → LCS launcher: starts game
- Game files → ELF analyzer: analyzes ELF
- Game files → AOT code generator: translates ELF
- Game files → LCS launcher: supplies ELF
- ELF analyzer → ELF loader: loads image
- ELF analyzer → Program analysis: finds functions
- AOT code generator → ELF loader: loads image
- AOT code generator → Program analysis: analyzes code
- AOT code generator → Generated functions: writes functions
- LCS launcher → ELF loader: loads ELF
- LCS launcher → PSP runtime: runs guest
- LCS launcher → Kernel HLE profile: installs HLE
- LCS launcher → Display window: initializes window
- LCS launcher → GPU backend: initializes backend
- LCS launcher → Audio output: initializes output
- PSP runtime → Guest memory: accesses guest memory
- PSP runtime → Allegrex context: executes guest state
- Generated functions → PSP runtime: registers functions
- PSP runtime → Kernel HLE profile: dispatches HLE
- Kernel HLE profile → GE command execution: handles GE calls
- Kernel HLE profile → Audio output: handles audio calls
- Kernel HLE profile → Media decoder: decodes media
- GE command execution → GE renderer: submits GE work
- GE renderer → GPU backend: renders frames
- GE renderer → Host controls: reads controls
- GPU backend → Display window: presents frames
- GPU backend → Host platform: uses graphics API
- Display window → Host platform: uses window system
- Audio output → Host platform: plays audio
- Host controls → Host platform: reads input