feat(libSceFont): implement outline interface and updation contracts #15762

Merged
ntamas94 merged 2 commits from upstream-pr/15762 into main 2026-11-08 02:30:54 +00:00
ntamas94 commented 2026-11-04 13:18:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-11-04T13:18:12Z.


What

Implements two libSceFont exports that currently throw.

  • sceFontOutlineVertexesInterfaceInit clears a 48-byte interface, records the two supplied pointers and a 64-bit count for a non-null first pointer and counts 1..3, and returns INVALID_PARAMETER with a cleared interface otherwise.
  • sceFontSupportSystemUpdation validates and locks the library through the existing lock helper. Version 0x20230801 sets bit 1 of byte 3, preserving every other bit. Other versions return INVALID_PARAMETER and release the lock without changing the library.

The contracts were also exercised by a homebrew probe on PS4 Pro firmware 10.710.001, SDK 0x05050001, base mode: 14 outline cases and 5 system-updation cases passed with exact output/whole-library comparisons. Source sha256 9582eb04d35b9e159174fa946d54f74ef12c6475d72e4c5f4803d8376aee00fc.

The contracts come from PS4 10.71 libSceFont.sprx (entry offsets 0x11d40 and 0x1380) and BunnyFl's independent PS5 13.42 comparison in https://github.com/boykopovar/AnyPS5/pull/14879#pullrequestreview-5736256677. This is a separate implementation follow-up to documentation PR #14879. The remaining effect of the system-updation flag is recorded under Functional debt. No firmware or decrypted binary is attached.

Tested

Windows, Intel i9-9900K, WinLibs MinGW-w64 GCC 15.2.0 r7, C++20, -O2. Built the complete libSceFont source set from this branch into a PRX, linked the new focused test to its import library and ran it through the exported functions. It passed.

The test covers 21 guarded outline cases, including a null second pointer, null first pointer, counts 0..4, a high-32-bit count and UINT64_MAX. It checks all 48 output bytes and both guards. System-updation cases check null/invalid libraries, exact version matching, preservation of all library bytes except the specified bit, lock-word restoration and repeated enablement.

The same test executable linked at runtime to a separately built, unchanged main-b11c7bf libSceFont fails at the original OutlineVertexesInterfaceInit stub. Restoring the candidate PRX passes. Public-header audit and conventions check pass. No title run, rendering test, PS5 console measurement or complete project CMake build is claimed. The test is registered as guest_font_interface_contracts.

Overlap review: tools/pr_overlap.py was run against the open main PRs. It could not merge #13486 and #14212 cleanly into the base. I manually compared every reported shared file. At #13486 head 0bde10d243, both exports in Unimplemented.cpp are still parameterless throwing placeholders, and its Api.hpp/debt entries describe those placeholders. It does not implement either contract. #14212 changes debt spacing and derived counts; its shared FontFt hunk adds a blank line. The implementation does not depend on either PR. Whichever lands after #14212 must retain these functional-gap notes while applying its formatting. #14879 is already merged into this feature branch as the documented prerequisite.

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: #14879 (documentation prerequisite)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5154938747 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15762). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-11-04T13:18:12Z. --- ### What Implements two libSceFont exports that currently throw. - sceFontOutlineVertexesInterfaceInit clears a 48-byte interface, records the two supplied pointers and a 64-bit count for a non-null first pointer and counts 1..3, and returns INVALID_PARAMETER with a cleared interface otherwise. - sceFontSupportSystemUpdation validates and locks the library through the existing lock helper. Version 0x20230801 sets bit 1 of byte 3, preserving every other bit. Other versions return INVALID_PARAMETER and release the lock without changing the library. The contracts were also exercised by a homebrew probe on PS4 Pro firmware 10.710.001, SDK 0x05050001, base mode: 14 outline cases and 5 system-updation cases passed with exact output/whole-library comparisons. Source sha256 9582eb04d35b9e159174fa946d54f74ef12c6475d72e4c5f4803d8376aee00fc. The contracts come from PS4 10.71 libSceFont.sprx (entry offsets 0x11d40 and 0x1380) and BunnyFl's independent PS5 13.42 comparison in https://github.com/boykopovar/AnyPS5/pull/14879#pullrequestreview-5736256677. This is a separate implementation follow-up to documentation PR #14879. The remaining effect of the system-updation flag is recorded under Functional debt. No firmware or decrypted binary is attached. ### Tested Windows, Intel i9-9900K, WinLibs MinGW-w64 GCC 15.2.0 r7, C++20, -O2. Built the complete libSceFont source set from this branch into a PRX, linked the new focused test to its import library and ran it through the exported functions. It passed. The test covers 21 guarded outline cases, including a null second pointer, null first pointer, counts 0..4, a high-32-bit count and UINT64_MAX. It checks all 48 output bytes and both guards. System-updation cases check null/invalid libraries, exact version matching, preservation of all library bytes except the specified bit, lock-word restoration and repeated enablement. The same test executable linked at runtime to a separately built, unchanged main-b11c7bf libSceFont fails at the original OutlineVertexesInterfaceInit stub. Restoring the candidate PRX passes. Public-header audit and conventions check pass. No title run, rendering test, PS5 console measurement or complete project CMake build is claimed. The test is registered as guest_font_interface_contracts. <!-- 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. --> Overlap review: tools/pr_overlap.py was run against the open main PRs. It could not merge #13486 and #14212 cleanly into the base. I manually compared every reported shared file. At #13486 head 0bde10d243, both exports in Unimplemented.cpp are still parameterless throwing placeholders, and its Api.hpp/debt entries describe those placeholders. It does not implement either contract. #14212 changes debt spacing and derived counts; its shared FontFt hunk adds a blank line. The implementation does not depend on either PR. Whichever lands after #14212 must retain these functional-gap notes while applying its formatting. #14879 is already merged into this feature branch as the documented prerequisite. ### 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: #14879 (documentation prerequisite) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [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!15762
No description provided.