joeylib2/installer/patches/ppsspp/README.md
2026-10-13 14:01:46 -05:00

34 lines
2.7 KiB
Markdown

# PPSSPP 1.20.4 patches
install.sh (component `ppsspp`) applies these to the PPSSPP 1.20.4 release
source in filename order, then builds only its headless test runner,
PPSSPPHeadless. The psp gates depend on every one of them.
| Patch | What it adds | Needed by |
|---|---|---|
| 0001-headless-gate-options | Four PPSSPPHeadless options (below) | `bench-psp.sh`, every `verify-psp-*.sh`, `joey-run --port psp --headless` |
## The options (0001)
| Option | What it does |
|---|---|
| `--strict-mem` | Every memory access is checked, and an unaligned or out-of-range one stops the run, as it raises an address error on a real PSP. The run prints `STRICT-MEM: <kind> exception at <address> (size <n>), pc <pc>` and the emulated call stack; `psp-addr2line -f -e build/psp/elf/NAME.elf <pc>` names the function. Stock headless runs with fast memory and ignores bad accesses, so an unaligned `lw` simply works there. Use it with `--jit-ir` (or `--ir`): PPSSPP checks alignment only in its IR cores, not in the default x86 JIT. |
| `--snapshot=FILE` | When the run ends (the program exits, or `--timeout` stops it), the PSP's display as a 480x272 PNG. Stock headless can only compare screenshots a test program asks for itself. |
| `--dump-audio` | Records what the program plays, as PPSSPP's own "dump audio" does: a WAV in the memory stick's `PSP/AUDIO` folder. Stock headless runs with sound off, and the mix is only made with sound on. |
| `--input=FILE` | Plays an input script: one step a line, `MS buttons NAME...` (the buttons held from then on: up down left right cross circle square triangle ltrigger rtrigger start select, or `none`), `MS analog X Y` (the analog stick, -1 to 1 an axis) or `MS snapshot FILE` (a PNG of the screen then), MS being emulated milliseconds since boot; `#` starts a comment line. Steps run in order at the first 100 ms slice of emulated time at or after their time. Stock headless has no input at all; its WebSocket debugger has, but it listens on every network interface and registers itself with report.ppsspp.org. |
## Running it
PPSSPPHeadless keeps the emulated memory stick in `$HOME/.ppsspp`, so the
gates and joey-run always run it with `HOME` pointing at a scratch folder:
the program goes in `$HOME/.ppsspp/PSP/GAME/NAME/EBOOT.PBP`, where a PSP
keeps it, and runs from there (`ms0:/PSP/GAME/NAME`). It runs unthrottled:
emulated time passes as fast as the host can run it, much faster than real
time while the program only waits, so a recording made with `--dump-audio`
grows by many emulated seconds every real second, and `--timeout` (real
seconds) is no measure of emulated time; an `--input` script is.
## License
The patch modifies PPSSPP and contains its code, so it is under PPSSPP's
license, the GNU GPL v2 or later, not JoeyLib's MIT License.