feat(libSceHmd2): answer the gaze results without an open headset as the console does #8907
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8907"
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 hypermoist on 2026-10-21T05:33:54Z.
What
sceHmd2GazeGetResultandsceHmd2GazeGetResultForFoveatedRenderingwere parameterless stubs that threw. Horizon Call of the Mountain (PPSA05666) imports both; discussion #6214 lists them among its throwinglibSceHmd2imports.In the decrypted PS5 12.00
libSceHmd2.sprx(lAoFUedcfqAat 0x35510,retc+-uRMhkat 0x35FE0), both take(const param*, result*)and run these checks:0x8A720008.sizeother than 0x10, or a resultsizeother than 0x38 (or 0x18 for the foveated form) →0x8A720009. Nothing is written.param + 4is not the module's open headset handle (or no headset is open), the result is filled with an invalid record and0x8A720003returned:GazeGetResult: offset 4 = -1, offset 0x14 = -0.0f, offset 0x1C = -1.0f, everything else from offset 4 to 0x37 zero; offset 0 (size) is kept.GazeGetResultForFoveatedRendering: offset 4 = -1, offset 8 = -0.0f, offset 0xC = 0.0f, offset 0x10 = -1.0f; offset 0x14 is not written.Both return that code unchanged after the module's optional trace hook.
Upstream's
sceHmd2Initializereports no headset, solibSceHmd2never has an open handle here, and step 3 always applies. This PR does exactly that, using upstream's existingopenHandlestate. If a headset handle is ever open, the calls still throwNotImplementedrather than invent gaze data. The firmware's SDK-version special case for a stale handle is not reachable without an open headset and is not modelled.The bodies are written from this observed behaviour; nothing from the module is copied.
Tested
Linux (CachyOS, GCC, Release): full build. All 543
guest_*, kernel and Ampr tests pass. Newguest_hmd2_gaze(a separate file, since #7658 and #8645 editGuestHmd2.cpp) checks:Writing 0.0f in place of -1.0f makes the test fail. The existing
guest_hmd2still passes.tools/check_conventions.pyis clean. No open PR implements these two calls. A three-way merge against every open PR touching these files, including #7658 and #8645, adds no conflicts:Hmd2.hppis untouched, and the new types sit at the stubs they replace.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:39:20Z.
I compiled the exact PR
Export.cppandGuestHmd2Gaze.cppon Linux with GCC 12.2 under-Wall -Wextra -Werror; the focused executable passes. The standalone link used stubs for the unrelated NotImplemented and process-parameter helpers, which this no-headset test does not call.git diff --checkagainst upstream/main also passes. This is focused host validation, not a full project build or independent console measurement.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T05:42:36Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceHmd2/CMakeLists.txtcore/libs/prx/libSceHmd2/Export.cppImported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-22T09:11:03Z.
@MarcZX10 thanks for compiling it with
-Wall -Wextra -Werror. Since your run I mergedmain, and the exports now use the sharedHmd2::GazeResultParameter,GazeResultandFoveatedRenderingResulttypes frommaininstead of this PR's own copies. The behaviour hasn't changed.