feat(libSceAgc): implement sceAgcCbCondWrite #975
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/975"
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-06T20:58:10Z.
What
sceAgcCbCondWriteandsceAgcCbCondWriteGetSizethrew.sceAgcCbCondWrite(buf, compareFunction, writeSpace, writeAddress, writeData, pollAddress, reference, mask)now writes the 9-dword COND_WRITE packet (opcode 0x45):sceAgcCbCondWriteGetSizereturns 36.Sources:
Emit(0x45, ...)produces here.Validation follows
sceAgcDcbWaitRegMem: compare function 0-6, 4-byte aligned non-null 48-bit addresses. The write space is accepted only as 1 (memory): OpenAGC shifts the raw value into bits 8-9, while sharpemu maps 2 to a register write, so 0 and 2 throw. Invalid input leaves the buffer untouched.On
mainthe AGC driver rejects a submitted COND_WRITE as an unknown opcode. #977 adds its validation and execution; the two PRs are independent. The sources and the write space limit are under "Unknown function info" in TechnicalDebt.Tested
Linux (Arch, GCC), Release with
BUILD_TESTING=ON, on currentmain. Newagc_cb_cond_write_tests, built from sources likeagc_cond_exec_patch_tests:GetSizereturns 9 dwords.Seven mutations each make the test fail: compare 7 allowed, other write spaces allowed, addresses swapped, reference and mask swapped, the 48-bit check removed, the wrong size, and the poll-memory bit dropped.
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.07% (+0.07%, +2 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
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-06T21:41:42Z.
Usage by titles:
game_compat.c, the AGC functions "identified from analysis of New Joe & Mac Caveman Ninja (PPSA02801) eboot.bin", containssceAgcCbCondWriteandsceAgcCbCondWriteGetSize. The import analysis it cites is not published, so this rests on that header.agc_table.zig, "generated from the identifiers a shipped title imports", binds both, without naming the title.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:02:57Z.
Thanks. The argument mapping is well sourced (OpenAGC and sharpemu agree), and accepting only write space 1 while the others throw is the right call.
Which title calls
sceAgcCbCondWrite, or submits COND_WRITE? The description and #977's both say it wasn't tested with a title. If you have one, please name it here; it would also give #977's drain ordering a real case to check against.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:40:34Z.
Thanks, and sorry: I asked before I'd seen your note above. New Joe & Mac Caveman Ninja (PPSA02801) in OpenAGC's import list is enough of a caller for me, and the PS5PCEM table backs it up.
Next steps on my side: approve the CI run, then check it on Dreaming Sarah together with #977. No changes needed from you for now.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T22:40:50Z.
Progress report (
e323c1f→d8b775e)📈 System libraries: 86.82% (+0.07%, +2 implemented functions)
✅ 2 implemented
sceAgcCbCondWritesceAgcCbCondWriteGetSize