feat(libSceHmd2): report the uninitialized library from the device exports #3242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3242"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-11T03:11:59Z.
What
libSceHmd2 (PS VR2) keeps the model of #1347:
sceHmd2Initializefails because there is no PS VR2 runtime. The library therefore never leaves its uninitialized state, and the five device exports now report that state instead of throwing, with the signatures the console's library is called with:sceHmd2Open(int32_t userId, int32_t type, int32_t index, const OpenParam* param),sceHmd2Close(int32_t handle)andsceHmd2SetVibration(int32_t handle, int32_t strength)returnNOT_INITIALIZED(0x8A720002) for any arguments; as in libSceHmd, the initialization check comes before the argument and handle checks.sceHmd2GetDeviceInformation(DeviceInformation* info)andsceHmd2GetFieldOfViewWithoutHandle(FieldOfView* fieldOfView)returnPARAMETER_NULL(0x8A720008) for a null output andNOT_INITIALIZEDotherwise, leaving the output untouched.sceHmd2ReprojectionBeginFrame, 0x8A721003 from the internal camera opens).sceHmd2Initializemoves its placeholder into that facility: 0x8A720016 instead of libSceHmd's 0x81110016 (the low word is still libSceHmd'sUNSUPPORTED_FEATURE; the console's code is still unknown). PPSA01317 only tests the result for non-zero.Hmd2.hpp(followinglibSceHmd/Hmd.hpp) holds the error constants, theDeviceInformation(28 bytes),FieldOfView(four tangents) andSizeAlignlayouts with static_asserts, and the export declarations.ReprojectionInitialize(const void*, const void*),EnableVrMode(uint64_t),DisableVrMode(),BeginFrame(uint64_t),GetPredictedDisplayTime(uint64_t, uint64_t*), and the twoQuery*BufferSizeAlign()queries returning a size and alignment pair in rax:rdx) are declared with them and still throw: what the console reports for them without a headset is unknown (whetherReprojectionInitializeneedssceHmd2Initializeand what it fails with, whether the other calls fail withNOT_INITIALIZEDorREPROJECTION_NOT_INITIALIZED(0x8A72000B) before it, and the sizes the queries return).sceHmd2GazeGetResultForFoveatedRendering,sceHmd2ReprojectionSetAllowPositionalReprojection,sceHmd2ReprojectionSetParamWithBufferandsceHmd2ReprojectionSetRenderConfigstay declared without parameters and throw; no reference gives their signatures (PS5VR callsSetRenderConfigwith three integers, 1, 0, 0, for half-rate rendering, which does not settle the types).sceHmd2Initializeentry records the facility evidence; new entries record the sources of the five implemented exports (signatures, codes, check order, layouts) and of the seven declared reprojection exports and why they throw; the "declared without parameters" entry now names the four remaining exports.Sources: PS5VR (
app/src/app_vr.c,vr_system.c,vr_exports_1360.h: a homebrew that loads the console's libSceHmd2 and plays video in a PS VR2 with these calls), KytyPS5 (src/libs/libHmd2.cpp,hmd2.h, and PR #607), shadPS4's PS4libSceHmdfor the Hmd family's check order and documented error numbering, and ALVR-PS4 for the measured PS4FieldOfViewandDeviceInformationlayouts.Tested
Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Ninja, Release,
-DBUILD_TESTING=ON, this branch on currentmain(961b25fe2):cmake --build --parallel 6(full) and--target libspass with no warnings in the touched files;nid_patcherreportsOKforlibSceHmd2.prx, whose 17 exports keep their NIDs.ctest -R "guest_hmd2|patched_libraries": 2/2 pass.guest_hmd2checks initialization with and without a param,PARAMETER_NULLfor null outputs and untouched outputs onNOT_INITIALIZED,sceHmd2Openwith valid and invalid arguments,sceHmd2CloseandsceHmd2SetVibrationfor several handles and an invalid strength, that failed calls create no state, and thatsceHmd2ReprojectionInitializeandsceHmd2ReprojectionBeginFramestill throw.python tools/check_test_registration.pyandpython tools/check_conventions.py --base origin/mainpass;tools/progress.py --comparereports +5 implemented (system libraries 84.7%, +0.15%), the 11 throwing exports stay stubs.sceHmd2Initializefails.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T03:12:09Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Pull request closed