feat(libSceAjm): build control and split-run batch jobs as firmware 13.42 does #12613
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12613"
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 zaryabzip on 2026-10-28T23:00:02Z.
What
Makes
sceAjmBatchJobControlBufferRaandsceAjmBatchJobRunSplitBufferRawrite the bytes firmware 13.42 writes. It also adds both to libSceAjmi, which exports them too. #12372, which did the same forsceAjmBatchJobRunBufferRaand which this branch was built on, has merged. With it, all three PS4 batch builders match the firmware in both modules.BunnyFl ran both routines from 13.42's
libSceAjm.sprx(0xac0 and 0xc60) andlibSceAjmi.sprx(0xb80 and 0xd20) in an x86-64 emulator on a 0xCC-filled buffer. The runs covered:Both modules wrote identical bytes and called no import. Nothing was measured on a console. Against
main:0x000060000000e7ff. That's prosper's control mask, and every row in the table matches it. Run flags are masked to0x0000e00000001fff, the masksceAjmBatchJobRunBufferRauses.mainkeeps every bit.All three builders now share the firmware-exact helpers.
sceAjmBatchJobRunBufferRaforwards to the split builder again, as it did onmain, through an internal function that doesn't throw.sceAjmBatchJobRunSplitBufferRaitself still throws for a null buffer list with a nonzero count, which the runs didn't cover.In libSceAjmi the two exports are
_nid_disambig1names, like the other two there. They call the same internal builder, never each other's exported names, so the patched names can't bind to libSceAjm's exports.The test checks both builders in both libraries against BunnyFl's bytes, flags table included.
TestConsoleBufferJobsnow expects the kept bits fromsceAjmBatchJobControlBufferRa, and its batch still decodes throughsceAjmBatchStartBuffer.Merge order with #3205, which also changes
core/libs/tests/GuestAjm.cpp: #11238 and #12372 (both merged), this PR, then #3205 rebased on top (proposed on #3205).Tested
Rebased onto
main578b8311acfor the review; the rebase was clean and only context lines changed. Windows 11 Home 25H2 (i7-11800H, WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2, Release,BUILD_TESTING=ON) atfbfcfcc63e, and Ubuntu 24.04.5 on WSL2 (GCC 13.3.0, CMake 3.28.3) with it merged intomain1db077e876:ctest -R "guest_ajm|atrac9":100% tests passed, 0 tests failed out of 7on Windows, andout of 8on Linux (Linux addsguest_ajm_teardown).guest_ajmwith--repeat until-fail:3: 3 of 3 on both hosts.6a7a2c7ccfwith only thisGuestAjm.cpp,guest_ajmbuilds and then aborts on both hosts (Windows exit 0xc0000409). The return address maps toTestConsoleBufferJobs, at the control-word checks this PR changes.libSceAjmi.prx,libSceAjm.prxandlibSceAjm.native.prxeach exportstlghnic3Jc,ElslOCpOIns,7jdAXK+2fMoanddmDybN--Fn8once.tools/check_conventions.pypasses.tools/pr_overlap.pylists only #3205, whose order is above.fbfcfcc63emerged ontomain990481cdbf, a clean merge (comment). Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release:guest_ajmpasses 3 of 3, none skipped.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 BunnyFl on 2026-11-02T03:44:52Z.
Review: APPROVED
Windows 11, WinLibs GCC 15.2.0 r7, Release. Head
fbfcfcc63emerged into upstream/main93dbd0f82a:guest_ajm,guest_ajm_aac_multichannel,guest_ajm_vibration,guest_ajm_wvorbisandpublic_headerspass, withlibSceAjmibuilt.CONSOLE_CONTROL_FLAGSset to all ones,guest_ajmfails, so the flags table pins the control mask.Cross-checked the masks in firmware 13.42 independently:
libSceAjm.sprx0xac0,libSceAjmi.sprx0xb80) load0x60000000e7ff;0xe00000001fff;0x3ffffc0,0xfc000030,0xffffffe0,0xfffffff0) match the kept-bits description;One thing in the description: "ran both routines" has an unfilled link placeholder instead of the comment URL.