# ps5-mvfg Frame generation injected into a PS5 game on a jailbroken PS5 Pro: 40 -> 120 fps with its own motion-vector frame generation (the game's motion vectors and depth, like FSR 3 / DLSS frame generation), and 30 -> 60 with Lossless Scaling's frame generation. Research code. The 120 builds use the motion-vector generator by default, in SDR and HDR (before v0.5 SDR started on Lossless Scaling's LSFG unless `/data/ps5-fg-mvfg` existed). The in-game menu's **Generator** row, or the folder `/data/ps5-fg-lsfg`, switches to LSFG. **License: GPL-3.0-or-later** (see `LICENSE`). The payload links the GPL-3.0 PS5 Vulkan driver in `driver/` (`Copyright (C) 2026 Mihawk-99`), so the whole work is GPL-3.0. **Building: see `BUILD.md`.** - `BUILD.md` - how to build it and the per-console knobs. - `native/one/` - the one-file payload (`build.sh`: `VARIANT=120|60`, `TESTER=1`). - `native/auto/` - the auto-launcher (`build.sh`, `PAYLOAD=`): send it once after jailbreaking; it stays resident and arms frame generation for every game launch (a launch whose last session never ran properly is skipped once, with a notification). It also reads the stats overlay's sensors. Log: `/data/ps5-fg-auto.txt`. - `native/m3b3/` - the in-game module (frame generation, `mvfg.comp`) and its loader `m3b3c.c`. - `native/m2r/` - the launch-time injector; `native/m3b2/` - the loader's shared structs and in-game blobs. - `native/tool/` - ps5-native-tool (the module link step); `native/tools/` - PC-side tools. - `driver/` - the PS5 Vulkan driver source (GPL-3.0, Mihawk-99); `driver/prebuilt/` - its prebuilt archives (what the module links). - `third_party/lsfg-vk/` - the Lossless Scaling frame-gen backend (GPL-3.0, third-party: lsfg-vk + Eden Emulator Project). - `tester-package/` - the readme and scripts for testers (the payloads themselves are built, not stored). ## What is tied to the game Built and tested against one title so far (PPSA38500). Moving to another game means finding these again: - **The hooks' addresses** - the display-buffer registration hook and its code cave (`native/m2r/m2inj.c`), the flip hook (`native/m3b3/m3b3c.c`), the upscaler call the motion vectors and depth are read from (`native/m3b3/mvview.inc`), the world-wait stub and the code fingerprint (`native/one/ps5fg.c`, `native/one/fingerprint.h` from `native/tools/eboot_fingerprint.py`), and the title ID. - **The motion-vector frame generation's calibration** (`native/m3b3/mvfg.comp`): the motion-vector convention and scale, the depth model (reversed-Z, near/far), and the HUD boxes (the minimap panel and compass marker: their places and the pixel tests that tell when they are on screen). - **Where motion vectors exist at all:** a game without an upscaler that takes them needs another source (or the Lossless Scaling path, which needs only the flip hook). Not tied to the game: the Vulkan driver (`driver/`), the Lossless Scaling port, the frame pacing and the presentation loop. **The code fingerprint is a report, not a gate** (2026-11-30). A different build or backport logs which regions differ and then continues: every write site is verified against its own original bytes and skipped when they do not match, and the code cave must still be empty. Backports (PSSR on/off, patched eboots baked into a PKG) therefore run without regenerating `fingerprint.h`; a genuinely different game build writes nothing, because no site matches. ## What is tied to the firmware Nothing that needs a row to run. `native/m2r/fw_profiles.h` has one row per firmware someone has tried, picked at startup from `kernel_get_fw_version()`. Every row has the same memory recipe (4 extra display buffers, memory type 12), and the one per-firmware value, an allocator fallback address, is optional. A firmware without a row therefore runs with that generic recipe and the loader log says it is untested. What decides whether a console has room is its free memory (console model and backport), not the firmware. Short of memory, either our buffers cannot be allocated (then none are added, the game's own display registration goes through unchanged and frame generation does not start), or they fit and the game's own large GPU block no longer does, so the game stops at start-up: the base PS5 case, fixed by the "GPU memory -1 GiB" patch below. | Firmware | Status | |---|---| | 4.50 (base PS5) | runs (one console, 229 s, 29.9 real + 59.4 generated fps at 119.88 Hz). Short session and visual quality unconfirmed, so `tested = 0`. Needs the base PS5 memory patch and `SF_POOL_BYTES=0`; see `docs/base-ps5-4.50/`. | | 13.00 | tested (the original values) | | 11.60 | runs (one PS5 Pro, 40 → 120), with "PSSR off" on backports that keep PSSR; flicker and FPS drops not solved yet, so `tested = 0` | | 11.40 (base PS5) | tested (one base PS5, 40 → 120 at 2560x1440, HDR auto-detected: 28.9 real + 28.6 generated fps over 228 s). Needs the **"GPU memory -1 GiB (base PS5)"** patch and a build with `SF_POOL_BYTES=0`, see below | | 13.60 (PS5 Pro) | runs (one PS5 Pro, 30 → 60 on a 60 Hz TV, SDR: LSFG 29.4 + 29.3 fps, mvfg 30.0 + 29.9 fps). Needs the 5.xx+ backport with the bp_helper shim (PSSR already stubbed); without a backport only ~135 MiB stay free. Short sessions only, so `tested = 0` | **Base PS5.** Its direct memory is ~12.1 GiB and the game reserves one 6236 MiB GPU block, leaving ~76 MiB: too little for the four extra display buffers, so the game stops at start-up. Apply **"GPU memory -1 GiB (base PS5 frame generation)"** from `patches/PPSA38500.xml` (it makes that block 1 GiB smaller at the ten places the size is written; the game's accounting stays consistent) and build the payload with `SF_POOL_BYTES=0` (no 1.25 GiB device-memory pool next to the game: the driver maps its own memory). The payload applies that patch by itself on a base PS5 (told apart by its direct memory: ~12.1 GiB against ~13.3 GiB on a PS5 Pro; the loader log says which it saw), so its switch is only needed with the PS Patch System. The 11.40 firmware row is in `fw_profiles.h`. The result and the remaining artifacts are in `docs/base-ps5-11.40/`. **HDR (2026-11-30).** 10-bit display buffers are detected from the game's own buffer: the resolve unpacks the packed `2:10:10:10` words and packs its output back the same way. Every released 120 build has done exactly this, v0.2 included, and that is the path verified in HDR on a PS5 Pro (an 8-bit write instead gave an acid-washed picture on base PS5s). mvfg is selected automatically in HDR; LSFG's chain blends the packed words as four bytes. **Experimental, opt-in:** with `/data/ps5-fg-lsfg-hdr` (live) the 120 build's LSFG reads and writes its frame and output views as `2_10_10_10` (`native/m3b3/lsfg_hdr.inc`), and HDR then no longer selects mvfg by itself - the generator choice decides, as in SDR (a console where that path cannot work falls back to mvfg). Tested only on a base PS5 at 13.60 with the unmodified game, one generated frame per real one. The frozen `VARIANT=60` payload does not have it: its LSFG still flashes green in HDR. Set HDR before launching the game: switching it in-game pauses frame generation (the game's own frames are shown) until it is switched back. **PSSR** (PS5 Pro). By default the payload applies **"PSSR off"** by itself at every launch: the game then uses the fallback upscaler, and on a Pro the ~1 GiB PSSR takes stays free for frame generation. Copies that keep PSSR (11.60 backports, the game's own files on 13.xx) need this. Without the payload: the PS Patch System entry in `patches/PPSA38500.xml`, or `native/patch/pssroff.elf` (build: `bash native/patch/build.sh`), sent once before starting the game. All of them write `31 c0 c3` at `eboot+0x8f67550`, which is what the 13.00 backport writes. *Experimental, no menu item:* the folder `/data/ps5-fg-keep-pssr` keeps PSSR *and* frame generation - the motion vectors then come from PSSR's apply, which reads the same 1440p colour, depth and vectors (holdmysocks' #73, idarius' #36). At the next launch the payload skips "PSSR off", gives a copy whose check was switched off by a patch its first 3 bytes back (only when the other 13 are the original stub's and its import slot is filled), and switches **GPU memory -1 GiB** on by itself on a Pro so PSSR and frame generation both fit. Not yet confirmed on a copy that keeps PSSR: the 13.00 backport build of the game takes PSSR's system call out (its import slot points at a function that always answers "no PSSR"), and the payload says so and leaves PSSR off. A base PS5 has no PSSR. **Your own XML patches** (the **Overlay & patches** page > **Your XML patches**): patches in the PS Patch System's XML format, from its own file `/data/user/patches/xml_prospero/PPSA38500.xml` and from every `*.xml` in `/data/ps5-fg-patches/`. At each launch the payload lists what it found in `/data/ps5-fg-xml-list.txt`; the page shows that list, and an entry switched on (`/data/ps5-fg-xml-`; the id is a hash of its name and lines, so an edited entry starts off again) is applied at the next launch, in the same stop as the built-in patches. An XML line carries no original bytes, so the payload is strict about where it writes: - only entries for this build (`AppVer` 01.002.001, `AppElf` eboot.bin), and only when the game's code is that build's; - line types `bytes`, `bytes8/16/32/64`, `float32/64` and `utf8` (an entry with any other type is shown as unavailable); - an entry is applied whole or not at all, and is skipped when a line would change one of frame generation's own sites (hooks, code cave, the upscaler the motion vectors come from, the PSSR check), a built-in patch switched on at that launch, or another of your entries - unless it writes the bytes already there; - every line is logged in `/data/ps5-fg-loader.txt` with the bytes it replaced; the page says why an entry was skipped. Host test: `bash native/one/tests/run_user_patches_test.sh`. **Motion blur off** (optional, any console): the **"Motion blur off (cleaner generated frames)"** entry in `patches/PPSA38500.xml` turns the game's motion blur off at both places it is read. Blur smears exactly what frame generation interpolates, so edges around the player and cars come out cleaner. The sites are leomars32012-cyber's, as applied by LPZ Framegen. **In-game menu** (120 build): hold **L1 + R1 and click the touchpad**. Up / Down select, Left / Right / Cross change, Circle closes; the game gets no input while it is open. Every item is one of the `/data/ps5-fg-*` switches, written at once and kept for the next launch (the LSFG flow scale applies at the next launch). Text: DejaVu Sans (`third_party/dejavu-fonts/LICENSE`). To see it on a PC with the console's own drawing code: `python3 native/m3b3/menu_preview.py ` (WSL; SDR and HDR). **Stats overlay** (the menu's **Overlay & patches** page): small text in the top-left corner - real and total fps (our own counts: the game's frames shown, and everything shown), CPU temperature and use, GPU temperature and clock, fan duty. The sensors are read by the auto-launcher's process, the way PrefBar (X1NONs/PrefBar, GPL-3.0) reads them: the game process may not call them. No GPU-usage reading is exposed, so the GPU clock is shown. **Game patches without the PS Patch System** (the menu's **Overlay & patches** page): frame rate (OFF / UNLOCKED / 40 LOCK / FULL), 120 Hz output, motion blur, the game's FPS counter, GPU memory -1 GiB, skip intro logos (ZiZc3's patch) and the close game fix (Eizovoid's patch: no hang / CE-108255-1 closing after a save). The payload applies the ones switched on (`/data/ps5-fg-patch-`) the moment the game starts, before its game check, with the same bytes as `patches/PPSA38500.xml` (`native/one/game_patches.h`, written by `patches/make_xml.py`) and only where the game still holds the original bytes; a patch the PS Patch System already applied is left alone. They apply at the next launch. **120 Hz output: FORCED** makes the call the PS Patch System's "120 Hz forced" makes (`sceVideoOutConfigureOutput` with request 15), from the module before it measures the refresh. Tested on a PS5 Pro, 13.00, without the PS Patch System loaded: frame-rate unlock + 120 Hz forced gave the full 40 -> 120 (2 generated frames per real one at 119.9 Hz). To add one: 1. Build the read-only probe (needs only the public ps5-payload-sdk): `bash native/m2r/build-fwprobe.sh`. 2. On the console, no PC needed: close the game, run `fwprobe.elf` from your payload manager (or `python tester-package/tools/send_payload.py fwprobe.elf`), launch the game when the notification says so, and wait for the `fwprobe: done` notification (~2 min). It writes nothing into the game. It reports the firmware, the game check, the allocator slot at the hook's arm moment, and where the memory functions are, in `/data/ps5-fwprobe--