mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-08 13:50:20 +00:00
7.8 KiB
7.8 KiB
libScePsml_debug technical debt
Unknown function info
- scePsmlMfsrGetSharedResourcesInitRequirement, scePsmlMfsrCreateSharedResources, scePsmlMfsrReleaseSharedResources, scePsmlMfsrGetContextBufferRequirement800M3_2, scePsmlMfsrCreateContext800M3_2, scePsmlMfsrReleaseContext (libScePsml) - verified from the firmware disassembly: resource type 0 is always allowed, types 1 and 2 need a flag set by
scePsmlMfsrEnableQuality8K/scePsmlMfsrEnableLightWeight(disallowed returns 0x8A81000D), and only one shared-resources object may exist at a time (a second create returns 0x8A810015).- The bundled
libScePsml.sprx(PPSA13197) fills the shared requirement as{0x200000, 0x200000, blocks}whereblocks = ceil(size_table[type]/0x200000)plus 3 whensize_table[type] + (type==1 ? 0x40000000 : 0x10000000)stays 2-MiB-aligned, forsize_table = {0x7C00000000, 0x100000000, 0x8A6C003E00000004}— type 0 reports 0x3E003 blocks vs the 52 a 13.40 console library was measured returning; the type-2 entry yields a nonsense count and appears unreachable.scePsmlMfsrCreateSharedResourcesstill demands the console-measured 52 blocks; the bundled create body is version-gated (SDK 0x11000000) and undecoded. - The context requirement reports four 2 MiB blocks regardless of its parameters, while the system calculation depends on the context configuration. The descriptor pointer at 0x28 is not read. Validation throws for null pointers, short block lists and foreign handles instead of reproducing the system error and fault behaviour.
- The bundled
- scePsmlMfsr2Init and the other MFSR2 calls (libScePsml) - only a console without PSSR is modelled. In firmware 13.60
libScePsml.sprx(read from disassembly, not measured on a console),scePsmlMfsr2Initreturns 0x8A8A0012 whensceKernelIsTrinityModereturns 0, and untilInitsucceeds every other MFSR2 call returns 0x8A8A0001 without touching its arguments. AnyPS5 reports 0, soInitthrows only if that changes: the initialization after the check, the shared resource and context requirements, and the 0x800-dword size thatGetDispatchPacketsSizeInDwordswrites through its second argument are not implemented - 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; they return 0x8A810001 (not initialized) and theNotImplementedarm is unreachable whilescePsmlMfsrInitcannot succeed on the modelled console.scePsmlMfsrCreateContext1300andscePsmlMfsrGetDispatchMfsrPacket900,1000and1300take the same shapes (context slot and parameter; context, command buffer and parameter). PPSA08330 and PPSA03016 advance a command-buffer cursor by thescePsmlMfsrGetDispatchMfsrPacketSizeInDwordssize. Firmware 13.60 copies a 0x158-byte template per variant into a shared writer that rotates eight ring slots and emits AGC packets; the 1100/1300 arguments and console errors are unverified - scePsmlMfsrGetDispatchMfsrPacket1000 (libScePsml) - imported by PPSA25344. libScePsml and libScePsml_debug are built from the same source. The bundled module copies the 0x158-byte parameter into a 0x1D8-byte dispatch descriptor (forcing +0x134 = 1.0f, +0x148/+0x40 = 0, masking +0x120 with 0x80018000, zeroing +0x128 when context byte +0x1A8C bit 0 is clear plus +0x158, +0x15C, +0x160..+0x1A4 and +0x1A8) and submits it to the shared writer: uninitialized returns 0x8A810001, an engine id other than 0xA9C4/0x9231 returns 0x8A810005, a null command buffer returns 0x8A810009, and a module-param low-latency flag combined with a sync-submit flag and an always-zero readiness flag returns 0x8A810016. Its AGC packet emission into the command buffer (ring slots at context +0x4A8, PM4 writes at 0x4E0) is not implemented and throws; the validation that precedes it is ported.
- 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). Measured on a 13.40 base console (#11140):scePsmlMfsrCreateContext1300checks the resolution before the init flag — a parameter whose first dword is 0 and whose 16-bit width at 0x18 is above 3840 or height at 0x1a above 2160 returns 0x8A810013 (3841x2160, 3840x2161 and 7680x4320 all do; 3840x2160 and 1920x1080 pass through to the init check), a type-1 parameter skips the check, and everything else reachesscePsmlMfsrCreateContext1100's init check. The width/height offsets are the measured ones; whether they are the same fieldsMfsrContextParamuses is unverified - scePsmlMfsrEnableSpecularAA, scePsmlMfsrEnableQuality8K, scePsmlMfsrEnableLightWeight (libScePsml) - measured on a 13.40 base console (#11140): all three return 0 before and after a failed init and ignore their argument, setting a byte (SpecularAA) and bits 0 and 1 of a flags word (Quality8K, LightWeight) — those bits gate
scePsmlMfsrGetSharedResourcesInitRequirementtypes 1 and 2. Whether the argument is stored or the flag set unconditionally is not distinguished by the measurement; the model sets it unconditionally.scePsmlMfsrEnableLightWeightwas not previously declared
Functional
- scePsmlMfsrGetDispatchMfsrPacketSizeInDwords, scePsmlMfsrGetMipmapBias, scePsmlMfsrSelectConfig, scePsmlMfsrRequestCapture, scePsmlMfsrIsCaptureInProgress (libScePsml) - semantics verified against the real Sony
libScePsml.sprxin PPSA20397'sfakelib. Guards:0x8A810001uninitialized,0x8A810005null/foreign handle (the binary checks an engine id0xA9C4/0x9231; our map check is the equivalent),0x8A810009null output.GetDispatchMfsrPacketSizeInDwordswrites0x600;GetMipmapBias(context, bias, dimension)writeslog2f(dimension / context->inputWidth) - 1.0f(the binary reads the recorded width at context+0x1920), width recorded atCreateContext800M3_2from the parameter pair at 0x18 ordescriptor0 + 0x20(zero width returns0x8A810005).SelectConfig,IsCaptureInProgressvalidate then return 0;RequestCapturevalidates, logs a one-shot message and returns 0. - scePsmlMfsrInit (libScePsml) - mirrors the bundled
libScePsml.sprx(PPSA13197) and the console library: it logs the release banner, then returns 0x8A810012 whensceKernelIsTrinityModereturns 0 — ahead of the initialized-state check, so repeated calls also return 0x8A810012 — and every later MFSR call returns 0x8A810001.- On a Trinity console the module then probes AGC capability (0x8A810010 on failure), registers its dispatch components (0x8A810011), starts a worker and sets the initialized flag, after which a repeated call returns 0x8A810002. The model applies the two guest-visible checks and sets the flag; the AGC probe, component registration, worker and the fwrite banner/
isn't supportedmessages are not reproduced. AnyPS5 reports 0 forsceKernelIsTrinityMode, so this stays unreachable until that changes. PPSA08330 calls the setup unconditionally and only uses a context when its cachedsceKernelIsTrinityModeresult is set (0x3c643d, 0x567f97; otherwise it stores a -0.25 mip bias itself at 0x567fe2)
- On a Trinity console the module then probes AGC capability (0x8A810010 on failure), registers its dispatch components (0x8A810011), starts a worker and sets the initialized flag, after which a repeated call returns 0x8A810002. The model applies the two guest-visible checks and sets the flag; the AGC probe, component registration, worker and the fwrite banner/