fix(prx): implement sceFontSupportGlyphs and the Ft glyph-selection record #16640

Merged
akkadbakkad89 merged 2 commits from upstream-pr/16640 into main 2026-11-09 13:30:31 +00:00
akkadbakkad89 commented 2026-11-07 11:54:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-11-07T11:54:12Z.


What

Implements two decoded contracts across libSceFont and libSceFontFt, verified against the PS5 4.03 module disassembly (ps5_prx_dump_403):

  • sceFontSelectGlyphsFt — returns the static 8-byte record 0x0F1F, 0xF200, 0x0F03, 0xF8F0 (u16s) for selector 0, null otherwise. The record bytes are taken verbatim from the module's data segment.
  • sceFontSupportGlyphs — u16 tag checks (0x0F1F at 0 → INVALID_PARAMETER, 0x0F03 at 4 → FATAL), then under a global lock stores the table in the first free of two slots and counts it. Both slots holding other tables returns 0; a table already registered returns 0 without releasing the lock (the firmware bug is replicated — the next call spins).

This PR previously also implemented sceFontSupportSystemUpdation and sceFontOutlineVertexesInterfaceInit; upstream landed equivalent implementations of both in a6b15fb1 (PS4 10.71 decode confirmed on PS5 13.42 by BunnyFl, #14879), so they were dropped on rebase. sceFontFtSupportSystemFonts was already landed upstream (identical {"cff", "truetype"} module list — the PS5 body is the same code as sceFontFtSupportOpenType), so this PR only adds the debt-note verification for it.

Not implemented (still throws, debt updated): sceFontFtSupportFontFormats — its PS5 4.03 body is fully decoded (mask builder + imported FTA_Support_Modules @ oM0zMNCfXKM in libSceFreeTypeOt), but what each mask bit selects inside that callee was not read. sceFontGetCharVariationGlyphCode — lookup internals unread and absent from the 4.03 module.

Tested

guest_font_support test exe against the built .prx files: SelectGlyphsFt selector/table tags, SupportGlyphs tag errors + two-slot registry + full + duplicate-quirk ordering. The SupportSystemUpdation/OutlineVertexesInterfaceInit cases previously in this test are covered by upstream's guest_font_interface_contracts and were removed. Neighboring suites (guest_font, guest_font_interface_contracts, font_render_surface, guest_font_ft_*) still pass. Windows 11, MinGW build; all checks pass.

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 (host-side library functions; no AGC/shader/VideoOut changes)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5201350964 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16640). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-11-07T11:54:12Z. --- ### What Implements two decoded contracts across `libSceFont` and `libSceFontFt`, verified against the PS5 4.03 module disassembly (`ps5_prx_dump_403`): - `sceFontSelectGlyphsFt` — returns the static 8-byte record `0x0F1F, 0xF200, 0x0F03, 0xF8F0` (u16s) for selector 0, null otherwise. The record bytes are taken verbatim from the module's data segment. - `sceFontSupportGlyphs` — u16 tag checks (`0x0F1F` at 0 → `INVALID_PARAMETER`, `0x0F03` at 4 → `FATAL`), then under a global lock stores the table in the first free of two slots and counts it. Both slots holding other tables returns 0; a table already registered returns 0 *without releasing the lock* (the firmware bug is replicated — the next call spins). This PR previously also implemented `sceFontSupportSystemUpdation` and `sceFontOutlineVertexesInterfaceInit`; upstream landed equivalent implementations of both in a6b15fb1 (PS4 10.71 decode confirmed on PS5 13.42 by BunnyFl, #14879), so they were dropped on rebase. `sceFontFtSupportSystemFonts` was already landed upstream (identical `{"cff", "truetype"}` module list — the PS5 body is the same code as `sceFontFtSupportOpenType`), so this PR only adds the debt-note verification for it. Not implemented (still throws, debt updated): `sceFontFtSupportFontFormats` — its PS5 4.03 body is fully decoded (mask builder + imported `FTA_Support_Modules` @ `oM0zMNCfXKM` in `libSceFreeTypeOt`), but what each mask bit selects inside that callee was not read. `sceFontGetCharVariationGlyphCode` — lookup internals unread and absent from the 4.03 module. ### Tested `guest_font_support` test exe against the built `.prx` files: SelectGlyphsFt selector/table tags, SupportGlyphs tag errors + two-slot registry + full + duplicate-quirk ordering. The SupportSystemUpdation/OutlineVertexesInterfaceInit cases previously in this test are covered by upstream's `guest_font_interface_contracts` and were removed. Neighboring suites (`guest_font`, `guest_font_interface_contracts`, `font_render_surface`, `guest_font_ft_*`) still pass. Windows 11, MinGW build; all checks pass. ### Checklist - [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 (host-side library functions; no AGC/shader/VideoOut changes) - [x] AI-assisted: yes
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!16640
No description provided.