Skip to content

LuaPSX v1.0

Latest

Choose a tag to compare

@soniciso1 soniciso1 released this 23 Aug 12:24
· 2 commits to main since this release

PlayStation emulator running as native x86_64 shellcode on PS5, delivered
through Luac0re. No kernel exploit —
everything runs in userland inside the ps2emu sandbox of
Star Wars Racer Revenge.

Sibling to LuaGB and
LuaMD, whose PS5 runtime this reuses.

Disc images over 1 GB do work

Nothing is loaded whole. upload_disc.py streams the image onto the console
and resumes where it left off if the connection drops, and the core reads the
disc a sector at a time. The limit is free space on the console, not RAM. A
960 MB PBP and a 530 MB compilation disc have both been run.

Memory card saving is EXPERIMENTAL

The plumbing is implemented — cards live in /temp0 while the game runs and
are mirrored into the savedata container at checkpoints (opening the picker,
switching disc, quitting) — and the offline tests for it pass. But a real
in-game save has not been written, powered off and read back yet. Treat any
progress as disposable until that is confirmed.

Everything else below is tested on a retail PS5 on firmware 4.51: booting
from .cue/.bin and compressed .pbp, video, audio, DualSense input, the
disc picker, disc switching, and full NTSC speed (measured 60.0 fps, 100% of
realtime).

Credits

  • notaz and the PCSX /
    PCSX-df / PCSX-ReARMed
    teams — the emulation core, dfsound, dfxvideo
    and gpulib (GPLv2 or later).
  • GezineLuac0re, the JIT exploit
    and Lua delivery framework this runs on. No Luac0re, no project.
  • egycnq — the savedata write method, and
    EmuC0re, whose PS5 runtime structure
    this follows.
  • CTurt and
    McCaulay
    — mast1c0re, which Luac0re builds on.

Install

Download both psx.lua and psx_emu.bin below and put them in the same
folder on your PC, next to psx_launcher.py. You need Luac0re already
working, with its loader listening on port 9026.

psx_emu.bin is the emulator, not a game. It does not go in roms/, it
does not go on the console at all — the launcher streams it over the network
each time you start. Only discs and the BIOS are copied to the console.

Unlike LuaGB and LuaMD this ships as two files. Luac0re caps a script at 500 KB
and hex encoding doubles anything embedded, so the emulator binary is streamed
to a TCP port the script opens instead of riding inside it:

your PC                              PS5
psx.lua      -->  TCP 9026   the Luac0re loader runs the script
psx_emu.bin  -->  TCP 9028   the script receives it and executes it

1. Put your BIOS in the savedata

The BIOS is read from a bios/ folder inside the game's savedata container —
the same container Luac0re lives in.

/savedata0/
    lua/          <- Luac0re (already there, leave it alone)
    bios/         <- CREATE THIS. your BIOS, e.g. scph7002.bin
    VMC0.card     <- leave alone
    VMC1.card     <- leave alone
    sce_sys/      <- leave alone

Use any PS5 save manager that can mount and write a savedata image: mount the
save, create bios/, copy the BIOS in, then unmount to commit. Do this with
the game closed. /temp0 is accepted as a fallback, but savedata is the better
home — it survives reboots and is part of the console's own save backup.

2. Upload your discs

Disc images go in /temp0, not the savedata container: a PS1 disc is hundreds
of megabytes and the container is only about 42 MB.

python upload_disc.py <PS5_IP> mygame.pbp /temp0/mygame.pbp

For a .cue/.bin pair, upload both and keep the names the .cue refers to.
.cbn also works.

/temp0 survives a game relaunch but not a console reboot, so discs have
to be re-sent after one.

3. Arm the loader and send

Launch the game, then OPTIONS → HALL OF FAME, then:

python psx_launcher.py <PS5_IP>

Add --log to watch the payload's UDP log on port 9027.

Nothing is hardcoded to one network: the payload works out where to log from
the console's own address, so any PC on the same subnet can send it.

Controls

DualSense PlayStation
D-Pad / Left stick D-Pad / Left stick
Cross, Circle, Square, Triangle the same
L1 / R1 / L2 / R2 the same
Options / Share Start / Select
L1 + R1 + L2 + R2 open the disc picker

In the picker: Cross loads the highlighted disc, Circle resumes,
Triangle toggles analog/digital, Square quits. Quitting ends the
Luac0re session and means relaunching the game.

Not included

No ROMs, disc images, BIOS or saves are distributed here, and none are needed
to build. Supply your own.

GPL-2.0-or-later, inherited from PCSX-ReARMed.