feat(libSceFontGs): implement the Gnm surface, drawup and sequence exports #16125
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16125"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-11-05T18:15:19Z.
What
Implement four PS4
libSceFontGs(Gnm) exports from the PS4 10.71libSceFontGs.sprxbodies, plussceFontGraphicsReportErrorinlibSceFont, which their error path calls. Library coverage: libSceFontGs 0/6 to 5/6, libSceFont 150/240.sceFontGraphicsGnmDrawupFillTextureImage(UsBLoyXsQZs) andsceFontGraphicsGnmDrawupFillTexturePattern(uksHKVEsxu4): thelibSceFontGs.nativeAGC bridge logic with surface tag 0x48. They check the surface (tag, head, initialized, busy) and, for the image form, the extents against 16834.0, forward to thelibSceFontfill-object functions and mark the record.sceFontGraphicsSequenceGetGnmCommandsForSubmit(DI4LrTUrD04) andsceFontGraphicsSequenceGetGnmCommandsForChain(NtbMKwRg6qg): clear their outputs, then return0x8046009afor a null or untagged sequence,INVALID_PARAMETERfor a null output,0x804600b8for a locked sequence andFATALwithout commands. Unlike the AGC bridges, every error goes tosceFontGraphicsReportError.sceFontGraphicsReportError: passes the error to the callback set bysceFontSetGraphicsErrorCallbackand returns 0, or returns 0x80460020 when none is set.sceFontGraphicsGnmSurfaceInit: ported with the statically linked Gnm code it uses (DataFormat builder,Texture::init, GCN surface tiling, base-address setters). It writes the 0x40-byte surface header and the Gnm texture at +0x40; the GPU mode comes fromsceKernelIsNeoMode, so libSceFontGs now linkslibkernel_sys.sceFontSelectGraphicsGnmreturnsnullptrfor indices other than 0. Index 0 still throws: it returns the module's Gnm rendering backend (a table of 21 command-builder handlers), which is a follow-up.The PS4 names hash to the four NIDs, and
sceKernelDlsymon PS4 10.71 resolved them at those offsets (#14879 has the details). The PS5 exports with these NIDs were not checked.Tested
Windows (MSYS2 UCRT64), on current
main: newguest_font_gs_gnm, all 16guest_font*tests andpublic_headerspass;check_conventions.pypasses. The sequence getters match earlier single PS4 10.71 runs on prepared sequences, without a GPU submission. The drawup bridges were not run on a console. SurfaceInit matched the original 10.71 machine code, run off-console, byte for byte on about 55 million base and Neo configurations; on a PS4 Pro with firmware 10.71 in base mode the console's own function returned the same code and all 0x100 bytes for the six test configurations. Neo mode was not measured on the console. No title tested.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-05T18:36:44Z.
Review: COMMENTED
Tests run: checks incomplete
Nothing that ran failed, but 1431 tests could not run on this machine. The build passed and nothing that ran failed; 1255 of 2686 passed; 1431 could not run because this CPU lacks instructions the guest tests need.
What I ran
Head
df99d607e39b3da93665fe64fe41758f79e0625c; based48f11ab16be932ef6c28f0d887a3c92af61f52e.I built and tested this head on this machine, on Linux. Full build and tests (the head merged onto the base tip): passed. The Test logs section at the end has the details.
Hosted CI results are read from GitHub as they are now; I did not run them.
Results
Not verified
To get this to a good state
Run the remaining tests on a machine that supports them, or point to a hosted run of this head.
Test logs (2 entries; open to read)
Full build and tests (the head merged onto the base tip): passed
Result:
Steps:
What did not run, and why:
All tests:
Complete output: 24,649 lines, 2.7 MB: https://gist.github.com/MarcZX10/c7a3a6e48330b0d94cd8eef48e8c68c7
Hosted CI as GitHub shows it: passed
Jobs, newest run of each:
Overall: