feat(agc): implement the Sh and Uc RegistersDirect size queries #575
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/575"
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 DotDebian on 2026-10-04T23:08:02Z.
What
sceAgcCbSetShRegistersDirectGetSizeandsceAgcCbSetUcRegistersDirectGetSizethrewnot implemented. Their writers go throughAgc::Command::WriteRegisters, which emits one SET_SH_REG (0x76) or SET_UCONFIG_REG (0x79) range packet per run of adjacent offsets: a run ofkregisters takesk + 2dwords. The query only receives the register count, so it returns the size of the longest output for that count, when no two registers are adjacent: 3 dwords, 12 bytes, per register. A count whose byte size does not fit 32 bits throws.The size is derived from the existing writer, not from the console library: it is an upper bound whenever the writer merges adjacent registers.
agc_register_command_tests(core/libs/prx/libSceAgc/tests/RegisterCommands.cpp) gains a case for both commands:0xfffffffc, larger counts throw.Tested
Windows 11, MinGW-w64 GCC 15.2.0,
ctest: 213/213 pass.agc_register_command_testsfails onmainwith the new case (sceAgcCbSetShRegistersDirectGetSize not implemented) and passes with the change. No title run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T23:08:24Z.
Progress report (
28e7799→dd9a62f)📈 System libraries: 78.78% (+0.07%, +2 implemented functions)
✅ 2 implemented
sceAgcCbSetShRegistersDirectGetSizesceAgcCbSetUcRegistersDirectGetSizeImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:44:04Z.
Thanks. Both names recompute to their NIDs (yUBESvCCJ4I and TGEZzUWLbrc). Since the query only gets the register count, a fixed 12 bytes per register is the only value it can return that is always large enough: a register that isn't adjacent to the previous one needs its own SET_SH_REG (0x76) or SET_UCONFIG_REG (0x79) packet of 3 dwords (header, offset, value; opcodes as in Mesa's
sid.h), and the writer's merged runs of k registers take k + 2 dwords, never more than 3k. So the value is right whether the console's writer merges adjacent registers or not. The overflow bound is right too: 0x15555555 * 12 = 0xfffffffc.The test checks the exact fit with a dword less rejected, the merged and split runs, and the overflow throws. It fails on main ("sceAgcCbSetShRegistersDirectGetSize not implemented") and passes here. Ready to merge from my side.
PPSA21564 calls
sceAgcCbSetShRegistersDirectbut not the size queries, so this doesn't change anything in my runs.