mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
A concurrent scePsmlMfsrReleaseSharedResources could pass its "still used by a context" check between the handle lookup and the context insertion. The technical debt entry now says how KytyPS5's layout differs from the calls in PPSA08330 and PPSA03016. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4.5 KiB
4.5 KiB
libScePsml_debug technical debt
Unknown function info
- scePsmlMfsrGetSharedResourcesInitRequirement, scePsmlMfsrCreateSharedResources, scePsmlMfsrReleaseSharedResources, scePsmlMfsrGetContextBufferRequirement800M3_2, scePsmlMfsrCreateContext800M3_2, scePsmlMfsrReleaseContext (libScePsml) - signatures from the calls in PPSA08330 (0x5724b6-0x5727e8, 0xc8697) and PPSA03016 (0x43dcf4d-0x43dd69a): a
{block bytes, alignment, block count}requirement, a 32-byte shared-resources parameter with the type at 0 and the{address, bytes}block list at 8 and 16, a context parameter with the block list at 8 and 16 and the shared-resources handle at 0x38, and 8-byte handles written through the first argument and passed back by value. The other context parameter fields (a 16-bit size pair at 0x18, two descriptor pointers at 0x20 and 0x28) are not read. The requirement of four 2 MiB blocks, 2 MiB aligned, is what PPSA08330 v06.006 allocates regardless of the returned count; Sony's values are unknown (KytyPS5 derives 52 blocks for type 0; its layout differs from these calls: it writes a 0x30-byte object through the first argument, where PPSA08330 passes one of two adjacent 8-byte handle globals, and reads the shared resources at context parameter offset 8, where both titles pass the block list). Only type 0 is accepted. The error codes for null pointers, short block lists and foreign handles are unknown, so those calls throw - scePsmlMfsr2CreateContext, scePsmlMfsr2CreateSharedResources, scePsmlMfsr2GetContextInitRequirement, scePsmlMfsr2GetDispatchPackets, scePsmlMfsr2GetDispatchPacketsSizeInDwords, scePsmlMfsr2GetSharedResourcesInitRequirement, scePsmlMfsr2Init, scePsmlMfsr2ReleaseContext, scePsmlMfsr2ReleaseSharedResources (libScePsml_mfsr2) - unknown signatures, imported by PPSA23566; declared without parameters
- scePsmlMfsrGetContextBufferRequirement1100, scePsmlMfsrCreateContext1100, scePsmlMfsrGetDispatchMfsrPacket1100 (libScePsml_debug) - argument layouts unknown; PPSA26344 imports but does not call the first two and at
0x87EFApasses(rdi, rsi=&stack, rdx)as three pointers toGetDispatchMfsrPacket1100; beforescePsmlMfsrInitthey return 0x8A810001 (not initialized) and after it they throw.scePsmlMfsrCreateContext1300andscePsmlMfsrGetDispatchMfsrPacket900,1000and1300take the same shapes (context slot and parameter; context, command buffer and parameter) and behave the same way. PPSA08330 and PPSA03016 passGetDispatchMfsrPacket900/1000the context handle, a{cursor, size in dwords}command buffer and the dispatch parameters, and advance their cursor by the sizescePsmlMfsrGetDispatchMfsrPacketSizeInDwordsreturned. Whether the 1100 and 1300 versions take these arguments, and the console's error, are unverified - scePsmlMfsrGetDispatchMfsrPacket1000 (libScePsml) - imported by PPSA25344. libScePsml and libScePsml_debug are built from the same source
- scePsmlMfsrCreateContext1300, scePsmlMfsrGetDispatchMfsrPacket1300 (libScePsml) - imported by PPSA28416 next to
scePsmlMfsrGetContextBufferRequirement1100. The names are not in the aerolib NID list; they hash to the imported NIDskLF7WtQ1-DgandDDVUyPyYHTA(tools/nid_names.py) - scePsmlMfsrEnableSpecularAA, scePsmlMfsrEnableQuality8K (libScePsml_specularAA and libScePsml_quality8K) - imported by PPSA01317, which fails to load without them; signatures unknown, so they throw. The names are not in the aerolib NID list; they hash to the imported NIDs
xNZM9Y5lf-MandlcZD9tJraAw(tools/nid_names.py)
Functional
- scePsmlMfsrInit (libScePsml) - succeeds and only sets the initialized state; the shared resources and contexts are bookkeeping objects that use none of the guest blocks. Whether Sony's library fails on hardware without PSSR is unknown. PPSA08330 calls the setup unconditionally and only uses a context when its cached
sceKernelIsTrinityModeresult is set (0x3c643d, 0x567f97; otherwise it stores a -0.25 mip bias itself at 0x567fe2), which AnyPS5 reports as 0, so the dispatch, mip bias and capture calls still throw