fix(libSceAgc): accept register range values at any byte address, as the console does #7606
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7606"
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 hugodearaujo on 2026-10-18T16:42:13Z.
What
On a PS5,
sceAgcCbSetShRegisterRangeDirect,sceAgcCbSetUcRegisterRangeDirectandsceAgcDcbSetCfRegisterRangeDirecttake the register values from whatever byte address the title passes and copy them into the packet. HereWriteRegisterRangerequiredvaluesto be 4-byte aligned and threwnull or misaligned addressotherwise.This PR copies the values with
memcpyfrom any address. Nothing else changes: a nullvaluesstill reserves the payload without writing it, which is what the console does in the SH and UC calls, and the single register setters (which pass the address of their own field) and the register list writers keep their checks.Title
EA SPORTS FC 25 (PPSA20049, 01.000.028), on
maine5f18ea99with #6343, stops 8 s after start with:Its render module
Engine.Render.Core2.PlatformPs5.prxpasses four SH register values that start 0x68 bytes into one of its objects, which sits at an odd address (the call is at module offset 0x8adea, count 4). With this PR it gets past that call: it shows its splash screen, the EA SPORTS intro video and its notice that online features need PlayStation Network and the EA servers, then stops 230 s after start on a compute shader table call that #7413 links (computed/data-dependent s_swappc_b64 call target at program counter 0x000004c4 is not statically resolvable). With #7413 as well, it reaches its main menu and was still there when the 620 s run ended. All runs usedAPS5_LAZY_SHADER_PREPARE=1andANYPS5_NO_SHADER_CACHE=1; the runs with and without this PR differed only inlibSceAgc.prx.Without #6343 it stops 32 s after start at
kevent: EVFILT_READ on a descriptor that is neither a socket nor the read end of a pipe not implemented, without reaching this call.Measured
PS5, firmware 13.60, from a homebrew payload process that calls the system's own
libSceAgcthroughdlopen/dlsym. Each function was called withvaluesat byte offsets 0 to 8, 12 and 13 from a 64-byte aligned buffer whose bytes are0x10 + i, with 1 and 4 values, each time on a fresh 64-word command buffer filled with0xCCCCCCCC; a second payload called each one with a nullvalues.values0xCCCCCCCC)This PR changes only the first row; the null CF case is left as it is.
Probe output (PS5 firmware 13.60, payload process)
Tested
agc_register_command_testsnow calls the three functions withvaluesat byte offsets 1, 2, 3 and 13 and checks the words the console wrote;agc_commandsexpects the bytes at offset 1 to be copied where it expected the throw. WithPacket.cppas onmainboth tests fail.-j8, 1441 of 1443 pass.agc_driver_tessellationsegfaults the same way without this PR.agc_driver_bda_devicefails withan anchored BDA read differs from the same read through the lookups; it does not build or loadPacket.cpp, whose only users arelibSceAgcand its tests.BUILD_TESTING=ON, no GPU: full CTest, no failures out of 1485;agc_driver_gated_dispatch_capture_short_timeoutis skipped there.tools/check_conventions.pypasses.tools/pr_overlap.pyfinds no overlap with open pull requests; #6747 also changesPacket.cpp(it conflicts withmain, so the tool could not compare it): it adds a call inAllocate, andgit merge-treemerges the twoPacket.cppchanges without a conflict.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)9d4966c26)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T16:55:03Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgc/Command/src/Packet.cppImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T10:56:02Z.
Checked the diff against the PS5 measurements in the description (66 of 66 calls at byte offsets, null handling for SH/UC unchanged), and that the new tests fail with the old
Packet.cpp(they expected the misaligned throw). The expected words intestRegisterRange(0x02000000,0x03000000,0x04000000) match a 1-byte shift of{1,2,3,4}; merged.