feat(libSceHmd2): add PS VR2 modules that report the runtime as unavailable #1347

Merged
gjonn merged 1 commit from upstream-pr/1347 into main 2026-10-08 02:18:06 +00:00
gjonn commented 2026-10-07 23:59:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-07T23:59:31Z.


What

A title links libSceHmd2.prx (PS VR2) and libSceVrTracker2.prx, which did not exist, so the title could not load. This adds both modules with the path where no PS VR2 runtime is available:

  • sceHmd2Initialize fails. The console's error code for that case is unknown; it returns libSceHmd's UNSUPPORTED_FEATURE (0x81110016), recorded in TechnicalDebt.
  • Every other export the title imports (16 in libSceHmd2, 6 in libSceVrTracker2) throws NotImplemented; signatures are unknown.

The title calls sceSysmoduleLoadModule(0x12a) and then sceHmd2Initialize with a pointer to 16 zeroed bytes, and only tests the result for non-zero. On failure it skips its whole VR set-up (reprojection, VrTracker2, the flag that guards every later Hmd2 call), so none of the throwing exports is reached.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0: new guest_hmd2 test (initialization reports the unsupported feature with and without a param, and an export after it throws) passes.
  • A title that links both modules loads them, skips VR and continues start-up into its frame and sound threads.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4779929257 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1347). Originally posted by [gjonn](https://github.com/gjonn) on 2026-10-07T23:59:31Z. --- ### What A title links `libSceHmd2.prx` (PS VR2) and `libSceVrTracker2.prx`, which did not exist, so the title could not load. This adds both modules with the path where no PS VR2 runtime is available: - `sceHmd2Initialize` fails. The console's error code for that case is unknown; it returns libSceHmd's `UNSUPPORTED_FEATURE` (0x81110016), recorded in TechnicalDebt. - Every other export the title imports (16 in libSceHmd2, 6 in libSceVrTracker2) throws `NotImplemented`; signatures are unknown. The title calls `sceSysmoduleLoadModule(0x12a)` and then `sceHmd2Initialize` with a pointer to 16 zeroed bytes, and only tests the result for non-zero. On failure it skips its whole VR set-up (reprojection, VrTracker2, the flag that guards every later Hmd2 call), so none of the throwing exports is reached. ### Tested - Windows 11, MinGW-w64 GCC 15.2.0: new `guest_hmd2` test (initialization reports the unsupported feature with and without a param, and an export after it throws) passes. - A title that links both modules loads them, skips VR and continues start-up into its frame and sound threads. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-07 23:59:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T23:59:52Z.


Progress report (df16c4c → a988b8b)

📉 System libraries: 85.51% (-0.63%, +1 implemented, +22 declared functions)

✅ 1 implemented
Library Name
libSceHmd2 sceHmd2Initialize
🆕 22 declared as stubs
Library Name
libSceHmd2 sceHmd2Close
libSceHmd2 sceHmd2GazeGetResultForFoveatedRendering
libSceHmd2 sceHmd2GetDeviceInformation
libSceHmd2 sceHmd2GetFieldOfViewWithoutHandle
libSceHmd2 sceHmd2Open
libSceHmd2 sceHmd2ReprojectionBeginFrame
libSceHmd2 sceHmd2ReprojectionDisableVrMode
libSceHmd2 sceHmd2ReprojectionEnableVrMode
libSceHmd2 sceHmd2ReprojectionGetPredictedDisplayTime
libSceHmd2 sceHmd2ReprojectionInitialize
libSceHmd2 sceHmd2ReprojectionQueryBufferSizeAlign
libSceHmd2 sceHmd2ReprojectionQueryDisplayBufferSizeAlign
libSceHmd2 sceHmd2ReprojectionSetAllowPositionalReprojection
libSceHmd2 sceHmd2ReprojectionSetParamWithBuffer
libSceHmd2 sceHmd2ReprojectionSetRenderConfig
libSceHmd2 sceHmd2SetVibration
libSceVrTracker2 sceVrTracker2GetResult
libSceVrTracker2 sceVrTracker2Initialize
libSceVrTracker2 sceVrTracker2QueryMemory
libSceVrTracker2 sceVrTracker2RegisterDevice
libSceVrTracker2 sceVrTracker2SetCoordinateSystem
libSceVrTracker2 sceVrTracker2UnregisterDevice
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6049283921 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1347#issuecomment-6049283921). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T23:59:52Z. --- <!-- progress-report --> ### Progress report (df16c4c → a988b8b) 📉 **System libraries**: 85.51% (-0.63%, +1 implemented, +22 declared functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceHmd2 | `sceHmd2Initialize` | </details> <details> <summary>🆕 22 declared as stubs</summary> | Library | Name | | - | - | | libSceHmd2 | `sceHmd2Close` | | libSceHmd2 | `sceHmd2GazeGetResultForFoveatedRendering` | | libSceHmd2 | `sceHmd2GetDeviceInformation` | | libSceHmd2 | `sceHmd2GetFieldOfViewWithoutHandle` | | libSceHmd2 | `sceHmd2Open` | | libSceHmd2 | `sceHmd2ReprojectionBeginFrame` | | libSceHmd2 | `sceHmd2ReprojectionDisableVrMode` | | libSceHmd2 | `sceHmd2ReprojectionEnableVrMode` | | libSceHmd2 | `sceHmd2ReprojectionGetPredictedDisplayTime` | | libSceHmd2 | `sceHmd2ReprojectionInitialize` | | libSceHmd2 | `sceHmd2ReprojectionQueryBufferSizeAlign` | | libSceHmd2 | `sceHmd2ReprojectionQueryDisplayBufferSizeAlign` | | libSceHmd2 | `sceHmd2ReprojectionSetAllowPositionalReprojection` | | libSceHmd2 | `sceHmd2ReprojectionSetParamWithBuffer` | | libSceHmd2 | `sceHmd2ReprojectionSetRenderConfig` | | libSceHmd2 | `sceHmd2SetVibration` | | libSceVrTracker2 | `sceVrTracker2GetResult` | | libSceVrTracker2 | `sceVrTracker2Initialize` | | libSceVrTracker2 | `sceVrTracker2QueryMemory` | | libSceVrTracker2 | `sceVrTracker2RegisterDevice` | | libSceVrTracker2 | `sceVrTracker2SetCoordinateSystem` | | libSceVrTracker2 | `sceVrTracker2UnregisterDevice` | </details>
github-actions[bot] commented 2026-10-08 01:03:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T01:03:23Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1299 docs/dev/TechnicalDebt.md L34
#1300 docs/dev/TechnicalDebt.md L34
#1301 docs/dev/TechnicalDebt.md L34
#1302 docs/dev/TechnicalDebt.md L34
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6050010424 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1347#issuecomment-6050010424). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T01:03:23Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1299 | `docs/dev/TechnicalDebt.md` [L34](https://github.com/boykopovar/AnyPS5/blob/39dd0b6cf01d968b86cee7e6050a08a8cb8f816c/docs/dev/TechnicalDebt.md#L34) | | | | #1300 | `docs/dev/TechnicalDebt.md` [L34](https://github.com/boykopovar/AnyPS5/blob/39dd0b6cf01d968b86cee7e6050a08a8cb8f816c/docs/dev/TechnicalDebt.md#L34) | | | | #1301 | `docs/dev/TechnicalDebt.md` [L34](https://github.com/boykopovar/AnyPS5/blob/39dd0b6cf01d968b86cee7e6050a08a8cb8f816c/docs/dev/TechnicalDebt.md#L34) | | | | #1302 | `docs/dev/TechnicalDebt.md` [L34](https://github.com/boykopovar/AnyPS5/blob/39dd0b6cf01d968b86cee7e6050a08a8cb8f816c/docs/dev/TechnicalDebt.md#L34) | | |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1347
No description provided.