ps3recomp: how games run on a PC

← project docs   main page   ps3recomp (upstream)   fork

PS3RECOMP, HOW GAMES RUN ON A PC two simulated walk-throughs

ps3recomp is a toolkit that turns PlayStation 3 programs into native PC programs ahead of time, so no emulator has to run beside them. These two scenarios follow a port from the build to the first frames. They are fixed scripts that explain the project's own README, not a recording of a game.

tool or call inside the program work on the host PC SPU work

The project is sp00nznet/ps3recomp (MIT licence); this site links to a fork and the upstream. As of its README on 2026-11-13, the runtime builds on Windows, macOS and Linux, and runs a recompiled game on Windows; macOS and Linux have no title booted to gameplay from that tree yet. No game code or data is part of ps3recomp: you need your own copy of a game.

Build: from an executable to a native port

What the tools do to a game's executable, ahead of time, to get a program that runs on a PC.

NID tablegame executablefrom your own copyppu_loaderimage, importsppu_lifterPowerPC to C++gen_hle_nidsNID to handlercompiler + runtimeCMake, ps3recompnative programruns on your PC
  1. executable → loader ppu_loader Stage 1: the loader reads the executable from your own copy of the game and writes out its image, function table, TOC and firmware imports.
  2. loader → lifter ppu_lifter Stage 2: the lifter turns every PowerPC function into C++. With --hle-stubs, each firmware import stub becomes a ps3_hle_call(nid).
  3. lifter SPU programs are handled separately: they are pulled out of the executable, and spu_lifter turns each into C. Its 256 KB local store becomes an array.
  4. lifter → NID tool gen_hle_nids Stage 3: gen_hle_nids writes the table that maps each NID (the id of a firmware function) to a handler in the runtime.
  5. NID tool → compiler compile The lifted code, the NID table and the ps3recomp runtime library are built together with CMake and a C++ compiler.
  6. compiler → program native exe The result is an ordinary native program for your PC. No emulator runs underneath it.

Run: what happens when the port plays

What the native program does when the game calls the console's firmware, threads, graphics and SPUs.

hostSPUgame codelifted, PowerPCps3_hle_callNID table lookupHLE librariescellPad, cellFsSPU programlifted, local storekernel callsfiles, memoryyour PCGPU, sound, input
  1. game code → dispatch ps3_hle_call The lifted game code calls a firmware function. Its stub is now ps3_hle_call(nid).
  2. dispatch → libraries cellPad, cellFs ... The NID table finds the handler in the HLE libraries, which are written for this project: input, audio, files, save data and more.
  3. libraries → your PC host APIs The handler does the real work on your PC: files by ordinary file I/O, a pad through XInput or SDL2, sound through WASAPI or SDL2.
  4. libraries → your PC cellGcm Graphics go through cellGcm to a command processor that stands in for the console's GPU, then to a backend: D3D12 on Windows, Metal on macOS, Vulkan on Linux (opt-in).
  5. libraries → dispatch result The handler returns its result to the dispatcher.
  6. dispatch → game code result The dispatcher hands it back, and the game code carries on as if the firmware had answered.
  7. game code → runtime LV2 calls Threads, mutexes, memory and file calls go to implementations of the console's kernel calls, on a virtual 256 MB address space.
  8. game code → SPU program SPU job When the game starts an SPU program, it runs as lifted C. Its local store is an array.
  9. SPU program → runtime DMA, channels DMA becomes a memory copy through a transfer engine, and channels become message queues between threads.