Commit Graph
9 Commits
Author SHA1 Message Date
T3cm0andClaude Fable 5.1 289fd5d7c3 feat(libSceHmd2): answer 18 slot and output-writing exports before initialization as the console does
The hmd2s and hmd2n sweeps left 19 libSceHmd2 exports that either write
into their arguments or take a slot number rather than a pointer first.
A third probe called the writers with zero-filled and with 0xAA-filled
buffers, dumping every byte that changed, and the slot exports with a
first argument of 0, 1, 2, 3, 4, 5, 8, 16, 255 and -1. Before
sceHmd2Initialize, six writers put fixed bytes in their output (a 2 and
a zero byte; 0x2000 and 0x100 as 64-bit sizes; four floats; six or
twelve floats of 0 and 0.5 followed by 0x8a720003), and twelve exports
accept a slot of 0 to 1, 2 or 3 and answer 0x8a720009 above it, with
0, -1, 0x8a721002, 0x8a721003, 0x8a72002c or 0x8a72100f for a valid
slot. They are bound here, by NID, to 14 handlers with the measured
checks, returning their value while the library is not initialized and
throwing if sceHmd2Initialize ever succeeds.

The one export whose answer depends on the contents of an in-out
structure stays unimplemented and is described in the debt file.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-20 08:36:40 -05:00
T3cm0andClaude Fable 5.1 e29cefad8e feat(libSceHmd2): answer 62 pointer-checking exports before initialization as the console does
The hmd2s sweep left 81 libSceHmd2 exports that answer 0x8a720008 to
all-null arguments but something else to zeroed buffers. A second probe
called each of them six times before sceHmd2Initialize, every argument
pointing at a zeroed 16 KiB buffer except one, to find which arguments
are the checked pointers. 62 exports answer 0x8a720008 exactly when one
of a fixed set of arguments is null and their all-present code otherwise:
48 check the first argument, 10 the second, 6 the first two, 2 the first
and third, 2 all six. They are bound here, by NID, to 18 handlers with
that many pointer parameters, each returning ParameterNull for a null
checked pointer and otherwise the measured code (0x8a720004 for 20 of
them, 0 for 11, 0x8a721002 for 10, -1 for 5, 0x8a720009 for 7,
0x8a72002c for 3, and 0x8a720003, 0x8a721003, 0x8a721010 and 0x800d0203
for the rest) while the library is not initialized, throwing if
sceHmd2Initialize ever succeeds.

Left out: 7 exports that write output and 12 whose first argument is a
handle or slot number rather than a pointer. The debt entries list every
NID with its aerolib name where one exists.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-20 08:36:40 -05:00
T3cm0andClaude Fable 5.1 0cf58b569d feat(libSceHmd2): answer 125 exports before initialization as the console does
A sweep of the 281 libSceHmd2 exports on a PS5 (firmware 13.60), each
called from a payload before sceHmd2Initialize once with every argument
null and once with every argument pointing at a zeroed 16 KiB buffer,
found 127 that answer the same code both ways and write nothing. 125 of
them are bound here, by NID, to one handler per answer: 45 return 0, 16
return 0x8a720008, 15 return 0x8a720004, 12 return -1, 10 reprojection
exports return 0x8a72000b, 9 return 0x8a720002, 9 return 0x8a720009, 5
return 0x8a721002 and one each returns 0x8a72002c, 0x8a721003, 0x400 and
0x20000. Each handler returns its measured value while the library is not
initialized and throws if sceHmd2Initialize ever succeeds, because the
initialized behaviour is not measured; since b378541e79 it fails with
UnsupportedFeature here, so these are the answers titles get.

Left out: the export that returns a pointer-like value, the one answering
0x8a72000a (which sceHmd2Initialize also returns for some applications),
the exports that answer differently to null and to zeroed arguments or
write output, the 16 that crashed the probe, and the exports that main,
its aerolib name where one exists.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-20 08:36:21 -05:00
Dean Galvin f26445217f Merge main into pr-7690
# Conflicts:
#	docs/dev/debt/libSceHmd2.md
2026-10-20 16:54:12 +13:00
al3w0f205 05bdd6aeb0 feat(libSceHmd2): export missing firmware functions from database 2026-10-19 12:16:20 +02:00
MontyMcK b378541e79 fix(libSceHmd2): report the PS VR2 runtime as unavailable again
Since #7323 sceHmd2Initialize succeeds and sceHmd2Open returns a handle,
so PPSA01317 runs its PS VR2 set-up and aborts on
sceHmd2ReprojectionQueryBufferSizeAlign, which is not implemented
(reported in #6350). AnyPS5 has no PS VR2 or PC VR support, so
initialization returns libSceHmd's UNSUPPORTED_FEATURE (0x81110016)
again, as before #7323, and titles skip their VR set-up. sceHmd2Open
then returns NotInitialized. The reprojection size queries stay
unimplemented.

Refs #6350
2026-10-19 19:25:30 +13:00
T3cm0andClaude Fable 5.1 e191a132ab feat(libSceHmd2): return the console's display and mirroring buffer sizes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-18 18:57:14 -05:00
MontyMcK 4d741c26de feat(libSceHmd2): report a console without a PS VR2 headset 2026-10-18 12:31:32 +13:00
Gjon Gojcevic a988b8b1d0 feat(libSceHmd2): add PS VR2 modules that report the runtime as unavailable
sceHmd2Initialize fails, so titles skip their VR set-up; the other libSceHmd2 and libSceVrTracker2 exports throw.
2026-10-07 19:58:01 -04:00