PCps5 is an experimental open-source x86-64 / ELF64 Static Relinker & High-Level Emulation (HLE) compatibility layer written in C++20 for macOS (Apple Silicon / M-series).
Legal & Educational Disclaimer: This project is strictly an educational research tool and homebrew SDK. It contains no proprietary firmware, decryption keys, or copyrighted assets, and is designed solely for compiling and running legal open-source
x86-64ELF64 binaries on ARM64 Macs.
- Hybrid Relinker + JIT Architecture: Combines static ELF64 symbol/relocation analysis (
--relink) with livex86-64toARM64JIT execution via Unicorn Engine. - ELF64 Loader (
ElfParser): Parses 64-bit ELF headers and mapsPT_LOADsegments into virtual memory. - Static Relinker (
ElfRelinker): Inspects.dynsym,.dynstr, and.rela.pltsections to resolve external function imports and prepare GOT/PLT HLE patches. - Native macOS Video & Audio (
SDL2): Provides a 320x240 RGBA software framebuffer upscaled to 640x480, real-time keyboard polling, and square-wave audio synthesis. - Sandboxed HLE Filesystem: Emulates
sys_open,sys_read, andsys_closerestricted safely to thetests/directory so C programs can load external level maps and assets. - Freestanding C SDK (
sdk/pcps5_sdk.h): Allows writing and compiling standalone C games directly intox86-64ELF64 binaries.
brew install sdl2 unicorn x86_64-elf-gccclang++ -std=c++20 -I/opt/homebrew/include -L/opt/homebrew/lib -lSDL2 -lunicorn \
src/main.cpp src/loader/elf_parser.cpp src/loader/elf_relinker.cpp \
src/core/video_backend.cpp src/core/audio_backend.cpp src/kernel/unicorn_cpu.cpp \
-o pcps5./pcps5 --relink tests/dynamic_ps_stub.elfx86_64-elf-gcc -O2 -ffreestanding -nostdlib -Wl,-Ttext=0x401000 tests/c_maze.c -o tests/c_maze.elf
./pcps5 tests/c_maze.elf- 0.5% — ELF64
PT_LOADSegment Loader & Virtual Memory Mapping - 1.0% — Unicorn JIT
x86-64Execution + SDL2 Video, Input & Audio Backend - 1.5% — Static Relinker (
.dynsym/.rela.pltimport & relocation scanner) - 2.0% — Sandboxed HLE Filesystem (
sys_open,sys_read,sys_close) & C Homebrew SDK - 5.0% — Automatic GOT/PLT Trampoline Patching in Unicorn Memory
- 10.0% — Clean-Room HLE Modules (
libkernel,libSceSystemService,libc) - 15.0% — Multi-threading (
libScePthreadcooperative context switching) - 25.0% — Hardware 3D GPU Initialization (
Vulkan/MoltenVKon Apple Silicon) - 40.0% — Hardware 3D Rendering Backend via Vulkan / MoltenVK
- 55.0% — Real-Time 3D PushConstants Matrix Rotation & PS4
libSceGnmDriverHLE - 70.0% — Hardware 3D Vertex Buffers (
VkBuffer+VkDeviceMemory) & 3D Pyramid Mesh - 70.0% — Hardware 3D Vertex Buffers (
VkBuffer+VkDeviceMemory) & 3D Pyramid Mesh
I am building PCps5 as a long-term learning and open-source project on Apple Silicon! Pull Requests, code reviews, and architectural advice are very welcome, especially in:
- Automatic GOT/PLT trampoline code generation for
x86-64 - Implementing additional POSIX / FreeBSD HLE syscalls (
sys_mmap,sys_clock_gettime,pthread) - Designing a Vulkan / MoltenVK 3D graphics pipeline