EmuFive is an open-source project that runs the KytyPS5 PS5 emulator on a jailbroken PlayStation 4. Version 1.0.0 is out today.
Status: experimental. A PS5 homebrew app (Snes9x PS5) runs on a PS4 Pro. Whether and how fast real games run is still being tested.
The pieces
- Linux on the PS4: PS4 Multiboot starts Linux from a GoldHEN payload and installs systems on the internal drive or a USB drive, all from the controller.
-
The GPU: Mesa with PS4 patches gives the PS4's GPU Vulkan 1.3. KytyPS5 needs sparse resources, which RADV offers on this GPU with
RADV_EXPERIMENTAL=sparse. -
The emulator: KytyPS5 at a pinned commit with five patches, built with
-march=btver2for the PS4's AMD Jaguar CPU. - The system: a small Debian image that boots straight into a home screen, with no desktop.
The CPU problem
KytyPS5 doesn't emulate the PS5's CPU. It runs the game's own x86-64 code directly, which is fast, but PS5 games are built for Zen 2 and use AVX2, FMA and BMI2 throughout. The Jaguar in the PS4 has none of them.
So one patch extends KytyPS5's instruction patcher. When a module loads on a CPU without those extensions, each such instruction is replaced by code with the same result:
- 256-bit integer operations become two 128-bit halves.
- Permutes across halves use AVX moves and blends.
- FMA is computed in double precision.
- Gathers load one element at a time.
- BMI2 instructions run with saved registers.
An instruction too short to jump from is replaced the first time it runs instead.
A small test tool checks every replacement against the real instruction on a modern CPU.
The home screen
The emulator only runs games, so EmuFive adds a home screen written in Python and pygame, made for a DualShock 4:
- Games from a USB drive, the PS4's internal drive (read-only), or a PC's shared folder over SMB.
- The PS button pauses a game and opens a quick menu.
- Profiles with their own saves, trophies and play time.
- Screenshots, with a QR code to open them on a phone.
- Eight menu languages, including right-to-left Arabic.
- Drawing that stays smooth on big TVs: shapes are drawn at 4x and scaled down, then cached, since the Jaguar is slow.
Updates without SSH
New versions come from GitHub releases. The PS4 checks the releases, and in Settings you press Update. A root helper then:
- downloads each newer pack in turn and checks its SHA-256;
- backs up the files it will replace;
- puts in the new files and runs the pack's script;
- test-starts the home screen.
If anything fails, the backup goes back and nothing changes. The last update can also be rolled back.
Thanks
EmuFive stands on KytyPS5, which is based on Kyty by InoriRus. Thanks also to the PS4 GPU work in Mesa, and to the PS4 Linux kernel developers.
Code, install steps and the 1.0.0 image: https://github.com/blue0x1/EmuFive
Top comments (0)