Repository navigation
feat(libSceAgc): implement the marker span builders - #971
hugodearaujo wants to merge 1 commit into
Conversation
72c17ab to
3607738
Compare
sceAgcDcbPushMarkerSpan, sceAgcDcbSetMarkerSpan, sceAgcAcbPushMarkerSpan and sceAgcAcbSetMarkerSpan write the same packets as the push and set markers, with the text taken from an explicit length instead of a NUL-terminated string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3607738 to
3e9f71c
Compare
|
Usage by titles: PS5PCEM |
|
Thanks for the clear write-up, and for recording the OpenAGC layout difference in TechnicalDebt. Which title calls the marker span builders? The description says it wasn't tested with a title, and none of the four is imported by the titles we test with. If you know of a caller (an executable or engine module that imports one of these NIDs), please name it, since that's the main reason to replace a throw with a guessed packet layout. Separately, the description says |
|
Thanks, and sorry: I asked before I'd seen your note. The PS5PCEM table doesn't name the title, so this one is weaker than #975: today a title that calls a marker span builder stops with a clear message. If you come across the title (or an engine module that imports one of the four NIDs), please add it here. The |
|
More on callers. I found two observations of real executables importing them, but neither names the title:
REmu also builds them, and keeps its payload compatible with the markers that take a NUL-terminated string, as this PR does. So at least one shipped executable imports each of the four NIDs, but I still can't give a title ID. I'll leave it here unless I find one. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
I checked a dump of Propagation: Paradise Hotel (PPSA15878), the title the PS5PCEM table seemed to point to. It doesn't support this PR:
So this title would never stop at a marker span function, and the PS5PCEM table only shows imports. I have no title that calls them. Feel free to close this. I'll reopen it with the title ID and the log line if I find one that stops here. |
|
Closing as agreed: PPSA15878 imports the four span builders but never calls them, and no other title is known to. If you find one that stops at one of them on main, comment here with the title ID and the log line. |
What
sceAgcDcbPushMarkerSpan,sceAgcDcbSetMarkerSpan,sceAgcAcbPushMarkerSpanandsceAgcAcbSetMarkerSpanthrew. They now write the same packets as the existing push and set markers, but take the text as(text, length)instead of a NUL-terminated string:lengthbytes, NUL-terminated and zero-padded to a dword.sceAgcDcbSetMarkerdoes.Agc::Marker::Pushnow calls a newAgc::Marker::PushSpanwithstrlen, so its packets are unchanged.Invalid input throws and leaves the buffer untouched: a null buffer, null text with a non-zero length, or a span over 0xfffc bytes (the existing 0x4000-dword payload limit).
The signature
(buffer, text, length, color)comes from the clean-room OpenAGC, the only reference that has these functions. OpenAGC's packet layout differs from the one AnyPS5 uses for markers: it writes the color as the first payload dword and no terminator. I kept AnyPS5's layout so all markers stay consistent. Both points are under "Unknown function info" in TechnicalDebt.Tested
Linux (Arch, GCC), Release with
BUILD_TESTING=ON, on currentmain.agc_command_testsonly runs itsdefaultsmode under ctest, and its full mode already fails onmain("expected an exception"). The new cases therefore go in a separateagc_marker_span_tests, built from sources likeagc_cond_exec_patch_tests. For the DCB and ACB variants it checks:sceAgcDcbPushMarkerwith the same text;Six mutations each make the test fail: the whole string copied instead of the span, the null check removed, the length limit removed, the pop dropped from DCB Set, the pop dropped from ACB Set, and ACB Push ignoring the length.
Full
ctest: 360/360 passed. A simulated merge with every open PR shows no conflict caused by this branch. Not tested with a title.tools/progress.py --compareagainstmain: System libraries 87.14% (+0.14%, +4 implemented functions).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