feat(libSceVrSetupDialog): implement sceVrSetupDialogInitialize, Open, UpdateStatus, GetResult, Close, Terminate #1638

Closed
Deses wants to merge 1 commit from upstream-pr/1638 into main
Deses commented 2026-10-08 15:24:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deses on 2026-10-08T15:24:40Z.


What

Implements the six libSceVrSetupDialog exports (core/libs/prx/libSceVrSetupDialog/Export.cpp), which were declared without parameters and threw. The library is the common dialog that sets up a VR headset. The host has none, so the dialog behaves like the other common dialogs here (LoginDialog, CdlgPlayerReview, WebBrowserDialog): it shows nothing, finishes when opened and reports that the user canceled.

  • int sceVrSetupDialogInitialize(void) (NID sTFqbfXJGG4): none -> initialized; a second call returns ALREADY_INITIALIZED (0x80B80004).
  • int sceVrSetupDialogOpen(const void* param) (loE6cNuCUtk): NOT_INITIALIZED (0x80B80003) before Initialize, ARG_NULL (0x80B8000D) for a null param, otherwise the dialog is finished. The param is not read. Opening again after it finished is allowed, as ALVR-PS4 reports for the PS4 dialog.
  • int sceVrSetupDialogUpdateStatus(void) (KHfpjj9Pucg): returns the status (0 none, 1 initialized, 3 finished).
  • int sceVrSetupDialogGetResult(void* result) (-umGRHNUiZU): NOT_INITIALIZED, ARG_NULL, and NOT_FINISHED (0x80B80005) before Open; once finished it writes USER_CANCELED (1) to the first 32 bits and leaves the rest untouched.
  • int sceVrSetupDialogClose(void) (ZeYpKhsLfG0): NOT_INITIALIZED before Initialize, otherwise 0.
  • int sceVrSetupDialogTerminate(void) (zdgiIPRqET4): back to none; NOT_INITIALIZED when not initialized.

The dialog never reaches the running state, so there is no BUSY path (the 0x80B80007 question from #1583 does not arise here).

The library was built by the fallback in core/libs/CMakeLists.txt; it now has its own CMakeLists.txt, which registers the test guest_vr_setup_dialog (core/libs/tests/GuestVrSetupDialog.cpp). The test covers every call before Initialize, a double Initialize, GetResult with a null pointer and before Open, Open with a null param, Close and Terminate from the initialized state, Open, the finished status, the USER_CANCELED result with the following 32 bytes untouched, a second Open, Close, Terminate, and Terminate and Close after Terminate. It catches no exceptions, so it does not link libc.

TechnicalDebt: libSceVrSetupDialog is removed from the PPSA12544 "added without an implementation" entry. One new "Unknown function info" entry (signatures taken from PS4, param not read, result layout assumed, source of ALREADY_INITIALIZED, the PS5VR report) and one new "Functional" entry (the dialog shows nothing and reports USER_CANCELED).

Not settled: no reference gives the PS5 signatures, the param or result layouts, or what the console returns without a headset. Recorded in TechnicalDebt. Not added: sceVrSetupDialogGetStatus (qRUACYyUNFA), which the PS5 library also exports and no known title imports.

Sources:

Text conflict: the TechnicalDebt line edited here (exports imported by PPSA12544's Unity plugins) is also edited by #1544 (removes Share) and #1583 (removes WebBrowserDialog). Whichever merges later needs a rebase; the conflict is in text only.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, built in this branch's own tree on 4b005b22: full build, the libs target (the patched libSceVrSetupDialog.prx exports the six NIDs above) and ctest -R "vr_setup|dialog" (9 tests, guest_vr_setup_dialog included) pass; check_conventions.py and check_test_registration.py pass, and progress.py reports libSceVrSetupDialog 6/6. No title run.

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:4789062464 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1638). Originally posted by [Deses](https://github.com/Deses) on 2026-10-08T15:24:40Z. --- ### What Implements the six `libSceVrSetupDialog` exports (`core/libs/prx/libSceVrSetupDialog/Export.cpp`), which were declared without parameters and threw. The library is the common dialog that sets up a VR headset. The host has none, so the dialog behaves like the other common dialogs here (LoginDialog, CdlgPlayerReview, WebBrowserDialog): it shows nothing, finishes when opened and reports that the user canceled. - `int sceVrSetupDialogInitialize(void)` (NID `sTFqbfXJGG4`): none -> initialized; a second call returns `ALREADY_INITIALIZED` (0x80B80004). - `int sceVrSetupDialogOpen(const void* param)` (`loE6cNuCUtk`): `NOT_INITIALIZED` (0x80B80003) before Initialize, `ARG_NULL` (0x80B8000D) for a null param, otherwise the dialog is finished. The param is not read. Opening again after it finished is allowed, as ALVR-PS4 reports for the PS4 dialog. - `int sceVrSetupDialogUpdateStatus(void)` (`KHfpjj9Pucg`): returns the status (0 none, 1 initialized, 3 finished). - `int sceVrSetupDialogGetResult(void* result)` (`-umGRHNUiZU`): `NOT_INITIALIZED`, `ARG_NULL`, and `NOT_FINISHED` (0x80B80005) before Open; once finished it writes `USER_CANCELED` (1) to the first 32 bits and leaves the rest untouched. - `int sceVrSetupDialogClose(void)` (`ZeYpKhsLfG0`): `NOT_INITIALIZED` before Initialize, otherwise 0. - `int sceVrSetupDialogTerminate(void)` (`zdgiIPRqET4`): back to none; `NOT_INITIALIZED` when not initialized. The dialog never reaches the running state, so there is no `BUSY` path (the 0x80B80007 question from #1583 does not arise here). The library was built by the fallback in `core/libs/CMakeLists.txt`; it now has its own `CMakeLists.txt`, which registers the test `guest_vr_setup_dialog` (`core/libs/tests/GuestVrSetupDialog.cpp`). The test covers every call before Initialize, a double Initialize, GetResult with a null pointer and before Open, Open with a null param, Close and Terminate from the initialized state, Open, the finished status, the `USER_CANCELED` result with the following 32 bytes untouched, a second Open, Close, Terminate, and Terminate and Close after Terminate. It catches no exceptions, so it does not link `libc`. TechnicalDebt: libSceVrSetupDialog is removed from the PPSA12544 "added without an implementation" entry. One new "Unknown function info" entry (signatures taken from PS4, param not read, result layout assumed, source of `ALREADY_INITIALIZED`, the PS5VR report) and one new "Functional" entry (the dialog shows nothing and reports `USER_CANCELED`). Not settled: no reference gives the PS5 signatures, the param or result layouts, or what the console returns without a headset. Recorded in TechnicalDebt. Not added: `sceVrSetupDialogGetStatus` (`qRUACYyUNFA`), which the PS5 library also exports and no known title imports. Sources: - NIDs: the PS5 stub list in claimore22/ps5rs `data/stubs/by_library/libSceVrSetupDialog.txt` lines 1-9 (seven names, GetStatus included), which also match the names hashed: https://github.com/claimore22/ps5rs/blob/2304be5131221bae0dac24b9767cabffda33f747/data/stubs/by_library/libSceVrSetupDialog.txt - PS4 prototypes (`sceHmdSetupDialog*`, the PS4 ancestor): shadPS4 `src/core/libraries/hmd/hmd_setup_dialog.h` lines 16-35 (0x68-byte param: common base param, size, user id, `disable_handover_screen`, 40 reserved bytes; 36-byte result: common result and 32 reserved bytes): https://github.com/shadps4-emu/shadPS4/blob/0fe263a4760dfbfa973366890061749b4af0de97/src/core/libraries/hmd/hmd_setup_dialog.h, and orbital `tools/ida/db_types.json` lines 932-938: https://github.com/AlexAltea/orbital/blob/cc408367da6a6ebbf5ac1ac559fefeadc73b2831/tools/ida/db_types.json - PS4 behaviour measured on hardware: ALVR-PS4 `docs/psvr-technical-reference.md` lines 251-285 (`0x80B80004` from a second `...Initialize()`; with a ready headset the dialog finishes at once, a cancel finishes with result 1, re-opening without a new Initialize shows it again): https://github.com/nicolas-riera/ALVR-PS4/blob/3889e303b9365422397c6570f0fde27aabf4b25f/docs/psvr-technical-reference.md - Common dialog codes: shadPS4 `src/core/libraries/system/commondialog.h` lines 14-44: https://github.com/shadps4-emu/shadPS4/blob/0fe263a4760dfbfa973366890061749b4af0de97/src/core/libraries/system/commondialog.h - PS5: theghostonline/PS5VR `app/src/vr_system.h` lines 5-7 report that the system refuses the dialog with "invalid video out" whatever the param holds, and that it is the original PS VR set-up, not PS VR2 (no error code given): https://github.com/theghostonline/PS5VR/blob/0e408909ce7a39891a2e06eee3438d07a09e11e3/app/src/vr_system.h - Another PS5 reimplementation, Raeen `crates/raeen-hle/src/libsce_dialog_misc.rs` lines 1-34, also finishes the dialog at once with a canceled outcome and notes that Blasphemous II (PPSA13580) imports the same six calls: https://github.com/Whoisraeen/Raeen/blob/2db56923204b89719916b95e29c2f3c4e1d9f90b/crates/raeen-hle/src/libsce_dialog_misc.rs - Sony's PS5 SDK 12.000 has a "VrSetupDialog Library Reference" (listed in peterpuppy/bm `features/ps5/document/docs/sdk_12_catalog.md` lines 865-871); the mirror does not include the page. Text conflict: the TechnicalDebt line edited here (exports imported by PPSA12544's Unity plugins) is also edited by #1544 (removes Share) and #1583 (removes WebBrowserDialog). Whichever merges later needs a rebase; the conflict is in text only. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, built in this branch's own tree on `4b005b22`: full build, the `libs` target (the patched `libSceVrSetupDialog.prx` exports the six NIDs above) and `ctest -R "vr_setup|dialog"` (9 tests, `guest_vr_setup_dialog` included) pass; `check_conventions.py` and `check_test_registration.py` pass, and `progress.py` reports libSceVrSetupDialog 6/6. No title run. ### 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
klosixgaming-arch commented 2026-10-08 15:32:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T15:32:16Z.

Review: COMMENTED


This is a draft PR claiming the libSceVrSetupDialog exports for future implementation. Good to reserve these NIDs early to avoid conflicts. Keep as draft until the actual implementation is ready - no code changes yet, just export declarations.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5459110419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1638#pullrequestreview-5459110419). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T15:32:16Z. **Review:** COMMENTED --- This is a draft PR claiming the libSceVrSetupDialog exports for future implementation. Good to reserve these NIDs early to avoid conflicts. Keep as draft until the actual implementation is ready - no code changes yet, just export declarations.
github-actions[bot] commented 2026-10-08 17:08:16 +00:00 (Migrated from github.com)

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


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
#1713 docs/dev/TechnicalDebt.md L235
#1775 docs/dev/TechnicalDebt.md L235
#1908 docs/dev/TechnicalDebt.md L235
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6065078799 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1638#issuecomment-6065078799). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T17:08:16Z. --- <!-- 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 | |---|---|---|---| | #1713 | `docs/dev/TechnicalDebt.md` [L235](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/docs/dev/TechnicalDebt.md#L235) | | | | #1775 | `docs/dev/TechnicalDebt.md` [L235](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/docs/dev/TechnicalDebt.md#L235) | | | | #1908 | `docs/dev/TechnicalDebt.md` [L235](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/docs/dev/TechnicalDebt.md#L235) | | |
oneandonlydean commented 2026-10-09 09:22:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:22:23Z.


Which title reaches the VR setup dialog on main? An ID and the log line where it stops would settle it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078121974 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1638#issuecomment-6078121974). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T09:22:23Z. --- Which title reaches the VR setup dialog on main? An ID and the log line where it stops would settle it.

Pull request closed

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!1638
No description provided.