upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNotRexed <therealnothingfn@gmail.com>2026-11-27 02:21:37 -0500
committerNotRexed <therealnothingfn@gmail.com>2026-11-27 02:21:37 -0500
commitf9e8e2ee22fc0c901224e9ba6cbe16a944f7dcaf (patch)
treee073a9d281cfd1a764d36b40c36a4c57682b6b6b /docs
parent63c66ba6db831330fca86ddc7e89fdfdad187012 (diff)
leonida-hle: serve a PlayStation button prompt movie in place of the title's Xbox one
A zlib DirectStorage request on data.rpf at the movie's offset (0x117d7000, 28,148 bytes inflated) is answered with ps_prompt_glyphs.gfx (built by tools/ps_prompt_glyphs.py) while a PlayStation pad is in use or LEONIDA_PROMPTS=playstation. The archive and its table of contents are not touched. Unit-tested on the matching and the file checks; not run in the title. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/prompt_glyphs.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/prompt_glyphs.md b/docs/prompt_glyphs.md
index cf548c823..46608a205 100644
--- a/docs/prompt_glyphs.md
+++ b/docs/prompt_glyphs.md
@@ -68,3 +68,36 @@ Shapes are discs, polygons, thick polylines and a small stroke font written in t
68the options (`--out`, `--zlib`, `--pad-to`, `--selftest`). The movie is 13,551 bytes, 5,721 as one zlib stream, below the 68the options (`--out`, `--zlib`, `--pad-to`, `--selftest`). The movie is 13,551 bytes, 5,721 as one zlib stream, below the
69original stored 9,644, so it can be padded to that size. The ActionScript block is minimal (empty `MovieClip` 69original stored 9,644, so it can be padded to that size. The ActionScript block is minimal (empty `MovieClip`
70subclasses, no `Main` behaviour, no sound hook); whether the title's loader needs more has not been tried in the game. 70subclasses, no `Main` behaviour, no sound hook); whether the title's loader needs more has not been tried in the game.
71
72## How the runtime swaps the movie
73
74The D3D12 runtime (`leonida-hle`, `modules/glyphs.rs`, hooked in `modules/dstorage.rs` `execute`) answers the title's
75read of the movie with the movie built by `tools/ps_prompt_glyphs.py` while a PlayStation pad is in use
76(`gameinput::active_family()`, see [gameinput.md](gameinput.md)). The archive is never written and its table of contents
77is not touched or needed.
78
79- **What is matched.** A DirectStorage request is a file object (our `dstorage` file keeps the path the title opened it by),
80 an offset, a stored size, options and a destination size. A zlib request on a file named `data.rpf` at offset
81 `0x117d7000` whose destination size is `28,148` is the movie. The stored size is not looked at, because the runtime
82 never reads the archive for it: it fills the destination with the replacement itself. Whatever the table of contents says
83 the stored size is (it is encrypted and unused here, so it is not known), the title gets the replacement as if
84 inflated. A replacement stream written into the archive instead would have to fit that stored size (ours would:
85 5,721 bytes against 9,644 for the standalone movie), but that needs the archive changed and the stored size known; the
86 runtime does neither.
87- **What is served.** `ps_prompt_glyphs.gfx` beside `leonida.exe` (or one of the six folders above it), or the file
88 `LEONIDA_PS_GLYPHS` names (`off` turns the swap off). It must be exactly 28,148 bytes, begin with `GFX` or `FWS`, and say so
89 in its length field; otherwise one warning is logged and the title keeps the Xbox movie. The file is read once.
90- **When.** At the title's read, so the family at that moment decides: the pad held at start (a Sony pad connected counts as
91 PlayStation before any input), or `LEONIDA_PROMPTS=playstation`. Whether the title loads the movie once at start or each
92 time a menu loads is not known (nothing has run); if once, plugging in or picking up a PlayStation pad later does not
93 show until the next start, and a live switch is impossible without a way to make the title load the movie again.
94- **Builds.** `python -I tools/ps_prompt_glyphs.py --from-archive "<package>/data.rpf" --out ps_prompt_glyphs.gfx` builds
95 over the title's own movie: the shapes are replaced and every other tag (the ActionScript, export and class tables) is
96 kept as it is, so the title's code finds the symbols as before. The output holds those tags of the game's movie: keep it
97 on your PC, never commit it. `--pad-inflated 28148 --out ps_prompt_glyphs.gfx` builds the standalone movie
98 (with its own ActionScript block, which has never run in the title) padded to the same length.
99- **Checking it.** Run with `LEONIDA_PROMPTS=playstation` and look in the log for `prompt glyphs: PlayStation movie loaded` and
100 `prompt glyphs: the title reads its glyph movie`. If the second line never appears, the title does not read the movie
101 through a zlib DirectStorage request on `data.rpf` (or not at that offset); `LEONIDA_DSTORAGE_TRACE=2` lists the
102 requests. The warning `a read at the glyph movie's offset is not the movie` means the offset matched but the file or size
103 did not.