A tool that ports PlayStation 5 executables to run natively on Linux, Windows and macOS. It converts a game's ELF into a native executable of the host and provides native builds of the PS5's system libraries that the converted program links against. There is no emulation and no separate runtime process: the converted game runs as a normal program on your machine.
A relinker converts the executable and its bundled modules to the target system's native format. Implementations of the system prx libraries provide the imports the converted program binds to at load time, each renamed to its NID so the OS loader resolves them without any patching.
Vibe coded. This fork is developed end to end with an AI agent: the code, the tests and the docs. Every change ships with the 699-test suite green, the conventions checker clean and its unverified-on-console details documented in Technical debt.
- One command from game directory to running game:
leonps5 <game-directory-or-elf>converts, assembles the runtime layout and launches. - A console-style home launcher: scans a games directory, shows every title as a card and starts the runner with keyboard, mouse and gamepad control.
- The relinker targets Linux ELF, Windows PE and macOS Mach-O, with
--to-intellowering of AMD-only instructions. - Every declared PS5 system-library function is either implemented or throws with a precise reason; the progress badges below are generated by this repository's own CI.
- The shader recompiler turns RDNA2 shader binaries into SPIR-V, with optional Spirv-Tools validation and optimization.
- Unknown and unexpected states strictly throw
std::runtime_error;what()is printed to stderr and the process terminates. Nothing silently pretends to work.
* System libraries: the share of functions declared in core/libs/prx that this port implements or documents, not of every PS5 system function. See Technical debt for what is unverified on console hardware.
Requirements: x86-64 host, Git, CMake 3.22 or newer, Ninja and a C++20 compiler. Linux needs the SDL X11 development headers (libx11-dev and libxext-dev on Debian and Ubuntu).
git clone https://github.com/loak7993-code/LeonPS5.git
cd LeonPS5
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --parallel
cmake --build build --target libs --parallel
ctest --test-dir buildThe libs target produces the patched system libraries in build/core/libs/libs; the runner picks them up from there automatically.
Then point the runner at a game directory that contains the game's ELF and its sce_module/ modules:
./build/core/runner/leonps5 <game-directory-or-elf> [output-directory]The command relinks the ELF, copies the system libraries and game resources into the runtime layout and starts the converted executable, printing its exit code. --libs <dir> overrides the system-library source and --windows/--macos prepare layouts for other hosts. The relinker stays available for direct use with every option documented in Usage.
| Variable | Purpose | Default |
|---|---|---|
LEONPS5_GPU |
part of a Vulkan device name to run on, matched without case | first discrete-capable device |
LEONPS5_SYSTEM_FONTS |
directory holding the console font files for sceFontOpenFontSet |
leonps5-fonts/ beside the executable |
APS5_CAPTURE_TRACE |
start the GPU execution trace at first use | off |
APS5_PIPELINE_STATS |
print driver pipeline statistics per created pipeline | off |
APS5_ENABLE_TIMING_LOG |
write frame timings to frame-timing.log |
off |
Input comes from SDL-mapped controllers, including analog sticks and triggers, and from a configurable keyboard and mouse mapping in leonps5-input.ini. See input mapping.
- Build everything:
cmake --build build --parallel. - System libraries only:
cmake --build build --target libs --parallel. - Tests:
ctest --test-dir build. - Progress report:
python3 tools/progress.py outwrites the badges and progress map served by the Pages workflow. - The runner alone:
cmake --build build --target leonps5 --parallel.
Build switches, the relinker-only mode and the compiler details for Windows and macOS are documented in Build instructions. There is no install step: the build tree is the deployment.
The relinker reads the PS5 ELF, resolves imports by NID, rewrites the dynamic section and emits a native executable; the NID patcher renames the system libraries' exports so the OS loader binds them by the same names. A converted game runs from this layout:
app.elf
libs/ <- LeonPS5 system libraries (*.prx)
app0/ <- game resources and converted modules
The shader recompiler is isolated from the rest of the tree and is a pure function of its input, designed for reuse in other projects. The full data flow is drawn in Architecture.
See the game compatibility list for tested games and known issues.
- Signatures and error codes for functions never observed on real hardware come from reverse engineering references and are documented per file in Technical debt.
- A handful of AGC exports still throw because their console contracts could not be verified:
sceAgcGetDefaultCxStateFlat,sceAgcCbMemsetExclusive(its embedded compute shader is not ported) and the_0300branch-patch targets. - The runner is verified on Linux; the
--windowsand--macospaths prepare the layout and print the command to run it on that host. - Console hardware verification of the remaining unverified-on-hardware notes is open work.
This fork continues boykopovar/AnyPS5 under its own name. Names changed accordingly: the runner binary is leonps5, runtime directories are leonps5-out/ and leonps5-fonts/, the input mapping file is leonps5-input.ini, and the environment variables and CMake switches use the LEONPS5_ prefix (LEONPS5_GPU, LEONPS5_SYSTEM_FONTS, LEONPS5_RELINKER_ONLY, LEONPS5_ENABLE_SPIRV_TOOLS). Internal ABI macros keep the upstream APS5_ prefix (APS5_VABI, APS5_EXPORT) so upstream patch sets stay applicable.
This project is intended for interoperability, research, preservation, and compatibility purposes. It does not include, distribute, or require copyrighted software, firmware, cryptographic keys, or proprietary libraries. Users are responsible for ensuring that any binaries used with this project are obtained and used in accordance with applicable laws and their respective license terms.
This project is licensed under the GNU General Public License version 2 only.
