docs(debt): record libSceFont, libSceFontFt and libSceFontGs contracts from the PS4 modules #14879

Merged
ntamas94 merged 4 commits from upstream-pr/14879 into main 2026-11-06 21:26:00 +00:00
ntamas94 commented 2026-11-01 22:08:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-11-01T22:08:28Z.


What

Documentation only. Records in the libSceFont, libSceFontFt and libSceFontGs debt files what the PS4 modules settle for functions that upstream lists as having unknown signatures and behaviour. sceFontOutlineVertexesInterfaceInit, sceFontSupportSystemUpdation and sceFontGetCharVariationGlyphCode leave the "unknown signatures and behavior" lists, and the four libSceFontGs NIDs that the export inventories leave unnamed get their names. Every function still throws, so no code changes.

Source, per reading titles and libraries: the PS4 libSceFont.sprx, libSceFontFt.sprx and libSceFontGs.sprx of firmware 10.71, read from their disassembly. BunnyFl independently cross-checked sceFontOutlineVertexesInterfaceInit and sceFontSupportSystemUpdation against PS5 firmware 13.42. The libSceFontGs names and the two sequence queries were also checked on a PS4 10.71 console (comments below); everything else is disassembly only. No binary is attached.

What the modules show:

  • Export sets: every export of the three modules has an upstream declaration with the same NID. The 24 extra libSceFontFt names upstream counts are internal driver callbacks, not exports.
  • libSceFontGs names: sceKernelDlsym resolved these on PS4 10.71 at the four NIDs' module offsets, and each name hashes to its NID: UsBLoyXsQZs sceFontGraphicsGnmDrawupFillTextureImage, uksHKVEsxu4 sceFontGraphicsGnmDrawupFillTexturePattern, DI4LrTUrD04 sceFontGraphicsSequenceGetGnmCommandsForSubmit, NtbMKwRg6qg sceFontGraphicsSequenceGetGnmCommandsForChain.
  • sceFontOutlineVertexesInterfaceInit: test rdi,rdi; je returns 0x80460002. With rsi non-null and rcx from 1 to 3, mov WORD PTR [rdi],0xf08 and stores of rsi, rdx, rcx at 0x08, 0x10 and 0x18. Otherwise it zeroes 0x08 to 0x1f.
  • sceFontSupportSystemUpdation: after the 0x0F01 magic check and the lock cmpxchg on dword 4, cmp r15d,0x20230801; jne decides between or BYTE PTR [rbx+0x3],0x2 with 0 and 0x80460002.
  • sceFontGetCharVariationGlyphCode: cmp eax,0xf02 on the handle and 0x80460005 otherwise. Any non-zero result from the inner call writes 0 through the saved fourth argument.
  • sceFontSupportGlyphs: cmp ecx,0xf1f at 0 and cmp ecx,0xf03 at 4, then two global slots under a global lock. Both "already registered" branches, cmp rcx,rbx; je, jump to the epilogue past the store that releases the lock.
  • sceFontSelectGlyphsFt and sceFontSelectGraphicsGnm: test edi,edi; cmove rax,rcx returns a static table for 0 and null otherwise. The FontFt table starts with 1f 0f at 0 and 03 0f at 4.
  • sceFontFtSupportSystemFonts: mov rsi,[rip+...] loads the same GOT slot as sceFontFtSupportOpenType, bound to FTA_Support_Format_OpenType, and both jump to the same routine.
  • sceFontFtSupportFontFormats: a chain of test al,mask; cmovne over the inverted format word builds the mask passed to FTA_Support_Modules. Then cmp eax,0x40; setne cl and lea r12d,[rcx+rcx*8-0x7fb9fff0] give 0x80460010 or 0x80460019.
  • sceFontGraphicsGnmDrawupFillTextureImage and ...TexturePattern: cmp BYTE PTR [rsi+0xd],0x48, cmp DWORD PTR [rsi+0x38],0x1 and cmp DWORD PTR [rsi+0x1c],0x0 lead into calls to sceFontGraphicsDrawupFillTextureImageObject and ...TexturePatternObject. The image form's coordinate bound is the float 16834.0 at [rip+...], probably a typo for 16384, kept as stored.
  • sceFontGraphicsSequenceGetGnmCommandsForSubmit and ...ForChain: cmp eax,0xf80 on the sequence (0x8046009a otherwise), test BYTE PTR [rdi+0x1b],0x1 (0x804600b8), a null inner pointer at 0x28 (0x80460001), and every error goes to sceFontGraphicsReportError. ForSubmit returns the inner qword 0x28 and dword 0x30; ForChain returns 0x28, 0x30 shifted right by 2, 0x38 and 0x34, as the console runs below show.

The libSceFontGs entries come from a Gnm build; the PS5 exports with the same NIDs may take AGC descriptors, which the entry says.

Tested

Not tested with a title; documentation only. python3 tools/check_conventions.py --base upstream/main passes with no findings. tools/pr_overlap.py needs GitHub GraphQL, which was unavailable where this was prepared; a REST search found no open pull request naming any of these functions.

Refresh — 2026-11-03 (Codex, AI-assisted): Merged main 086c068, preserving main's sceFontGetLibrary entry and these PS4 findings. Recorded BunnyFl's independent PS5 13.42 cross-check of OutlineVertexesInterfaceInit and SupportSystemUpdation. Documentation only; conventions and whitespace checks pass. No new console or runtime tests.

Refresh — 2026-11-04 (AI-assisted): Merged main b11c7bf and restored two existing libSceFont lines whose em dash the previous merge had mis-encoded. Named the four libSceFontGs exports, recorded the two sequence queries' contract, and brought the first libSceFont entry under the 1000-character limit. Documentation only; conventions pass with no findings.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5112054625 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14879). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-11-01T22:08:28Z. --- ### What Documentation only. Records in the libSceFont, libSceFontFt and libSceFontGs debt files what the PS4 modules settle for functions that upstream lists as having unknown signatures and behaviour. `sceFontOutlineVertexesInterfaceInit`, `sceFontSupportSystemUpdation` and `sceFontGetCharVariationGlyphCode` leave the "unknown signatures and behavior" lists, and the four libSceFontGs NIDs that the export inventories leave unnamed get their names. Every function still throws, so no code changes. Source, per [reading titles and libraries](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/REVERSE_ENGINEERING.md): the PS4 `libSceFont.sprx`, `libSceFontFt.sprx` and `libSceFontGs.sprx` of firmware 10.71, read from their disassembly. BunnyFl independently cross-checked `sceFontOutlineVertexesInterfaceInit` and `sceFontSupportSystemUpdation` against PS5 firmware 13.42. The libSceFontGs names and the two sequence queries were also checked on a PS4 10.71 console (comments below); everything else is disassembly only. No binary is attached. What the modules show: - **Export sets:** every export of the three modules has an upstream declaration with the same NID. The 24 extra libSceFontFt names upstream counts are internal driver callbacks, not exports. - **libSceFontGs names:** `sceKernelDlsym` resolved these on PS4 10.71 at the four NIDs' module offsets, and each name hashes to its NID: `UsBLoyXsQZs` `sceFontGraphicsGnmDrawupFillTextureImage`, `uksHKVEsxu4` `sceFontGraphicsGnmDrawupFillTexturePattern`, `DI4LrTUrD04` `sceFontGraphicsSequenceGetGnmCommandsForSubmit`, `NtbMKwRg6qg` `sceFontGraphicsSequenceGetGnmCommandsForChain`. - **sceFontOutlineVertexesInterfaceInit:** `test rdi,rdi; je` returns `0x80460002`. With `rsi` non-null and `rcx` from 1 to 3, `mov WORD PTR [rdi],0xf08` and stores of `rsi`, `rdx`, `rcx` at 0x08, 0x10 and 0x18. Otherwise it zeroes 0x08 to 0x1f. - **sceFontSupportSystemUpdation:** after the 0x0F01 magic check and the `lock cmpxchg` on dword 4, `cmp r15d,0x20230801; jne` decides between `or BYTE PTR [rbx+0x3],0x2` with 0 and `0x80460002`. - **sceFontGetCharVariationGlyphCode:** `cmp eax,0xf02` on the handle and `0x80460005` otherwise. Any non-zero result from the inner call writes 0 through the saved fourth argument. - **sceFontSupportGlyphs:** `cmp ecx,0xf1f` at 0 and `cmp ecx,0xf03` at 4, then two global slots under a global lock. Both "already registered" branches, `cmp rcx,rbx; je`, jump to the epilogue past the store that releases the lock. - **sceFontSelectGlyphsFt and sceFontSelectGraphicsGnm:** `test edi,edi; cmove rax,rcx` returns a static table for 0 and null otherwise. The FontFt table starts with `1f 0f` at 0 and `03 0f` at 4. - **sceFontFtSupportSystemFonts:** `mov rsi,[rip+...]` loads the same GOT slot as `sceFontFtSupportOpenType`, bound to `FTA_Support_Format_OpenType`, and both jump to the same routine. - **sceFontFtSupportFontFormats:** a chain of `test al,mask; cmovne` over the inverted format word builds the mask passed to `FTA_Support_Modules`. Then `cmp eax,0x40; setne cl` and `lea r12d,[rcx+rcx*8-0x7fb9fff0]` give `0x80460010` or `0x80460019`. - **sceFontGraphicsGnmDrawupFillTextureImage and ...TexturePattern:** `cmp BYTE PTR [rsi+0xd],0x48`, `cmp DWORD PTR [rsi+0x38],0x1` and `cmp DWORD PTR [rsi+0x1c],0x0` lead into calls to `sceFontGraphicsDrawupFillTextureImageObject` and `...TexturePatternObject`. The image form's coordinate bound is the float 16834.0 at `[rip+...]`, probably a typo for 16384, kept as stored. - **sceFontGraphicsSequenceGetGnmCommandsForSubmit and ...ForChain:** `cmp eax,0xf80` on the sequence (`0x8046009a` otherwise), `test BYTE PTR [rdi+0x1b],0x1` (`0x804600b8`), a null inner pointer at 0x28 (`0x80460001`), and every error goes to `sceFontGraphicsReportError`. ForSubmit returns the inner qword 0x28 and dword 0x30; ForChain returns 0x28, 0x30 shifted right by 2, 0x38 and 0x34, as the console runs below show. The libSceFontGs entries come from a Gnm build; the PS5 exports with the same NIDs may take AGC descriptors, which the entry says. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Not tested with a title; documentation only. `python3 tools/check_conventions.py --base upstream/main` passes with no findings. `tools/pr_overlap.py` needs GitHub GraphQL, which was unavailable where this was prepared; a REST search found no open pull request naming any of these functions. Refresh — 2026-11-03 (Codex, AI-assisted): Merged main 086c068, preserving main's sceFontGetLibrary entry and these PS4 findings. Recorded BunnyFl's independent PS5 13.42 cross-check of OutlineVertexesInterfaceInit and SupportSystemUpdation. Documentation only; conventions and whitespace checks pass. No new console or runtime tests. Refresh — 2026-11-04 (AI-assisted): Merged main b11c7bf and restored two existing libSceFont lines whose em dash the previous merge had mis-encoded. Named the four libSceFontGs exports, recorded the two sequence queries' contract, and brought the first libSceFont entry under the 1000-character limit. Documentation only; conventions pass with no findings. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-02 12:03:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T12:03:55Z.

Review: APPROVED


I cross-checked two of the libSceFont readings against the PS5 module, firmware 13.42 system/common/lib/libSceFont.sprx (sha256 b96390d9b766c05f5db4f7710fe98117a5da31a1f394bd5e09b1d6ad0be6f6c4). Disassembly only, read to the returns. Both match your PS4 10.71 description exactly:

0x1bd0 sceFontSupportSystemUpdation (AkhU0Rszgmc)
  mov eax, 0x80460004 ; test rdi, rdi ; je ret          ; null -> INVALID_LIBRARY
  cmp word [rdi], 0x0f01 ; jne ret                      ; library magic
  spin: lock cmpxchg [rbx+4], ecx|0x80000000 ; sched_yield (0x1e) while held
  mov eax, 0x80460002 ; cmp r14d, 0x20230801 ; jne      ; other versions -> INVALID_PARAMETER
  or byte [rbx+3], 2 ; xor eax, eax                     ; sets bit 1 of byte 3
  mov [rbx+4], ecx                                      ; unlock
0x13040 sceFontOutlineVertexesInterfaceInit (wQ9IitfPED0)
  mov eax, 0x80460002 ; test rdi, rdi ; je ret
  mov qword [rdi], 0 ; vmovups [rdi+0x20], xmm0(0)
  p1 == NULL || count-1 >= 3  -> clear 0x08..0x1f, return 0x80460002
  else: mov word [rdi], 0x0f08 ; [rdi+8]=p1 ; [rdi+0x10]=p2 ; [rdi+0x18]=count ; return 0

So for these two, at least, the PS5 module behaves like the PS4 one, and the entry's "not from a PS5 module" caveat could say they match on 13.42. Both are self-contained, so they could be implemented exactly in a follow-up rather than left throwing. I didn't check the libSceFontFt/libSceFontGs readings against the PS5 modules. Conventions pass on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5736256677 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14879#pullrequestreview-5736256677). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T12:03:55Z. **Review:** APPROVED --- I cross-checked two of the libSceFont readings against the **PS5** module, firmware 13.42 `system/common/lib/libSceFont.sprx` (sha256 `b96390d9b766c05f5db4f7710fe98117a5da31a1f394bd5e09b1d6ad0be6f6c4`). Disassembly only, read to the returns. Both match your PS4 10.71 description exactly: ``` 0x1bd0 sceFontSupportSystemUpdation (AkhU0Rszgmc) mov eax, 0x80460004 ; test rdi, rdi ; je ret ; null -> INVALID_LIBRARY cmp word [rdi], 0x0f01 ; jne ret ; library magic spin: lock cmpxchg [rbx+4], ecx|0x80000000 ; sched_yield (0x1e) while held mov eax, 0x80460002 ; cmp r14d, 0x20230801 ; jne ; other versions -> INVALID_PARAMETER or byte [rbx+3], 2 ; xor eax, eax ; sets bit 1 of byte 3 mov [rbx+4], ecx ; unlock 0x13040 sceFontOutlineVertexesInterfaceInit (wQ9IitfPED0) mov eax, 0x80460002 ; test rdi, rdi ; je ret mov qword [rdi], 0 ; vmovups [rdi+0x20], xmm0(0) p1 == NULL || count-1 >= 3 -> clear 0x08..0x1f, return 0x80460002 else: mov word [rdi], 0x0f08 ; [rdi+8]=p1 ; [rdi+0x10]=p2 ; [rdi+0x18]=count ; return 0 ``` So for these two, at least, the PS5 module behaves like the PS4 one, and the entry's "not from a PS5 module" caveat could say they match on 13.42. Both are self-contained, so they could be implemented exactly in a follow-up rather than left throwing. I didn't check the libSceFontFt/libSceFontGs readings against the PS5 modules. Conventions pass on this head.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14879
No description provided.