Commit Graph
30 Commits
Author SHA1 Message Date
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
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 dfe41f1f45 fix: align merged hmd declarations and webapi tests 2026-10-21 21:56:08 +03: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 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 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
Adrià aed67d7e55 Merge pull request #8256 from YossiYad/feat/hmd-no-headset-queries
feat(libSceHmd): answer ten buffer and device queries the way the disconnected-headset path implies
2026-10-21 14:03:19 +02:00
hypermistandClaude Opus 5.5 db25758397 fix(libs): return what the firmware returns from 29 more calls it does not implement
The NetCtl ApRp calls, the SaveData debug calls, HttpDbgEnableProfile,
HttpDbgSetPrintf, PadEnableExtensionPort and VideoRecording Init, Term
and SendCommand return 0; ImeForTestFunction returns 0x80BC00FF; the Hmd
distortion work memory align and size are 0x400 and 0x20000 and
DistortionGetCompoundEyeCorrectionCommand returns 0x81110009;
AjmInstanceCodecType returns the instance id shifted right by 14.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-20 22:38:57 +13:00
Yossi Yadgar a569d075ec feat(libSceHmd): report the headset disconnected from sceHmdGetAssyError 2026-10-20 10:13:11 +03:00
Yossi Yadgar fe6aba89a8 feat(libSceHmd): refuse the field of view, eye offset and sensor queries without a headset
No handle is ever open, as sceHmdOpen reports the headset disconnected, so they return HANDLE_INVALID after initialization and NOT_INITIALIZED before it, without writing their outputs.
2026-10-20 10:13:11 +03:00
Yossi Yadgar fa916ae7bc feat(libSceHmd): return the distortion and reprojection buffer sizes and alignments 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
MarcZX100 49887893a4 test(hmd): register disconnected-device tests 2026-10-09 17:47:28 +00:00
julienlgy 0c4dace39e feat(libSceHmd): add a disconnected-headset HLE stub 2026-10-01 14:18:10 +02:00