Commit Graph
26 Commits
Author SHA1 Message Date
Yunus Shaikh 32a95a35dd fix(hmd): answer handle 0 before sceHmdInitialize only below SDK 4.50
BunnyFl's firmware 13.42 check shows that the distortion, wide-near and
2D VR command queries give NOT_INITIALIZED for handle 0 before
sceHmdInitialize only when the title's compiled SDK version is below
4.50. From 4.50 the library first checks state it sets up when it
starts, which isn't measured, so handle 0 before initialization now
throws there, as it does after initialization and as all six queries
do on main. The SDK version is read from the process parameters, as
libSceHmd2 does.

guest_hmd checks handle 0 before initialization at SDK 0x044fffff and
0x04500000.

Source: https://github.com/boykopovar/AnyPS5/pull/9577#issuecomment-6343495321 (BunnyFl)
2026-10-22 08:19:34 -07:00
Yunus Shaikh 030ef8f772 fix(hmd): check the command queries' handle and 2D VR arguments in libSceHmd's order
BunnyFl ran firmware 13.42's libSceHmd exports under an emulator. The
distortion and wide-near correction queries look the handle up before
checking initialization: a handle other than the one sceHmdOpen stored,
which stays 0 without a headset, returns HANDLE_INVALID even before
sceHmdInitialize. sceHmdGet2dVrCommand checks its arguments first:
PARAMETER_NULL for a null descriptor or command buffer or a null
pointer at descriptor offset 0, 8 or 0x20, and PARAMETER_INVALID for a
non-zero field at 0x34 or 0x38.

The queries and their sceHmdDistortion* aliases now answer in that
order. What handle 0 gets after initialization isn't measured, so it
throws NotImplemented_nid_no_patch instead of returning HANDLE_INVALID.
2026-10-22 02:38:45 -07:00
Yunus Shaikh a644459114 feat(hmd): report no VR2D session without a headset
Nothing runs in VR2D without a headset, so sceHmdInternalIsGameVr2d,
IsMiniAppVr2d, IsCommonDlgVr2d and IsCommonDlgMiniAppVr2d return false,
the answer the console gives to the same four queries in libSceHmd2.
2026-10-22 01:34:36 +00:00
Yunus Shaikh 8e462a6bcc feat(hmd): refuse distortion and 2D VR command queries without a headset
sceHmdOpen never issues a handle without a headset, so the distortion
correction, wide-near correction and 2D VR command queries, and their
sceHmdDistortion* export aliases, answer as the other handle queries:
NOT_INITIALIZED before sceHmdInitialize and HANDLE_INVALID after it,
leaving the command buffer unwritten.
2026-10-22 01:33:53 +00:00
boykopovar 6f70da5412 fix(hmd): restore default led output signature 2026-10-21 21:53:00 +03:00
boykopovar cd175c3aad fix(hmd): restore default led data setter arguments 2026-10-21 21:51:40 +03:00
boykopovar 6703b32a37 fix(hmd): restore distortion command output and export aliases 2026-10-21 21:51:36 +03:00
boykopovar eede658723 fix(hmd): restore reprojection submission argument slots 2026-10-21 21:51:34 +03:00
boykopovar 7b97d7552c fix(hmd): restore device queries and reprojection setup signatures 2026-10-21 21:51:32 +03:00
boykopovar 8d202ee697 fix(hmd): restore device screen and capture signatures 2026-10-21 21:50:47 +03:00
boykopovar 7ede27cc9c fix(hmd): recover sensor calibration buffer signature 2026-10-21 21:47:52 +03:00
boykopovar 9773ed9724 docs(hmd): close verified capture cleanup signatures 2026-10-21 21:47:46 +03:00
boykopovar bea25c3189 fix(hmd): recover audio port and event callback signatures 2026-10-21 21:47:45 +03:00
boykopovar 027ec5453c fix(hmd): recover crash report and separate screen signatures 2026-10-21 21:47:44 +03:00
boykopovar 4e3f7647e8 fix(hmd): recover device control and capability signatures 2026-10-21 21:47:43 +03:00
boykopovar 09d851b315 fix(hmd): recover device update transfer signatures 2026-10-21 21:47:41 +03:00
boykopovar 0b9b261a7a fix(hmd): recover screen transfer and eye status signatures 2026-10-21 21:47:40 +03:00
boykopovar 763dcfe88d fix(hmd): recover led and device status signatures 2026-10-21 21:47:35 +03:00
boykopovar 9e87228eaf docs(debt): close verified hmd and pad parameterless signatures 2026-10-21 21:47:15 +03:00
boykopovar fe0540a4e5 fix(hmd): recover eye geometry and led control signatures 2026-10-21 21:47:02 +03:00
boykopovar 0dd86fcff7 fix(hmd): recover reprojection event and color signatures 2026-10-21 21:45:03 +03:00
boykopovar 91c3ff3041 fix(hmd): recover device setting and scalar query signatures 2026-10-21 21:45:03 +03:00
Yossi Yadgar fd178d9021 docs(debt): note where the Hmd field of view query leaves shadPS4's order 2026-10-21 09:32:28 +03:00
Yossi Yadgar 6cedb6a5fd docs(debt): note where the headset-less Hmd results come from 2026-10-20 10:13:11 +03:00
Yuri Olive 6ce3940a7f feat(libSceHmd): export missing firmware HMD interfaces 2026-10-19 15:01:38 -03:00
Adrià FranchandClaude 342a8c4590 docs(debt): move library entries to one file per library
Co-Authored-By: Claude <[email protected]>
2026-10-12 20:38:29 +02:00