feat(libScePad): declare the VR controller exports #905

Merged
gookie-dev merged 1 commit from upstream-pr/905 into main 2026-10-06 22:07:02 +00:00
gookie-dev commented 2026-10-06 15:18:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gookie-dev on 2026-10-06T15:18:02Z.


What

scePadVrControllerRead (306mCg0ibh8) and scePadVrControllerGetDeviceInformation (mbJHDdjhVeY) were not exported by any library, so a title that imports them fails eager binding before main.

Balatro (PPSA21402, 01.015.000) imports both from libScePad. It opens its pads in a loop over the port types and calls the two VR entry points only for the PSVR2 Sense controller types: at 0x1cc4c9 the converted executable computes type - 3 and skips the call when it is above 1, and the scePadOpen result is checked for an error first. ValidPort accepts only PAD_PORT_TYPE_STANDARD, PAD_PORT_TYPE_SPECIAL and the system PAD_PORT_TYPE_REMOTE, so those opens already fail and the VR path is never entered.

The two exports are declared as throwing stubs, as the VR controller port types are not supported. Parameters are left off, as in #734: no title here calls them, so their signatures are unverified.

Tested

Pop!_OS 24.04 (kernel 7.1.5), GCC 13.3.0, CMake 3.28.3, Ninja, Release, BUILD_TESTING=ON, SPIRV-Tools validation off.

  • Default build and libs packaging pass. libScePad.prx is NID-patched and exports 306mCg0ibh8 and mbJHDdjhVeY.
  • ctest: 359 of 359 pass, the same as on unmodified main in this environment.
  • Balatro PPSA21402 relinked for Linux with --to-intel: the two imports resolve and startup no longer stops on them. The title does not reach the menu; it stops later for unrelated reasons, so no rendering, audio, input or gameplay claim is made. Neither stub was reached (no NotImplemented output).
  • No tests added: these are throwing stubs, and a missing export already fails at startup.

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
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4760839290 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/905). Originally posted by [gookie-dev](https://github.com/gookie-dev) on 2026-10-06T15:18:02Z. --- ### What `scePadVrControllerRead` (`306mCg0ibh8`) and `scePadVrControllerGetDeviceInformation` (`mbJHDdjhVeY`) were not exported by any library, so a title that imports them fails eager binding before `main`. Balatro (PPSA21402, 01.015.000) imports both from `libScePad`. It opens its pads in a loop over the port types and calls the two VR entry points only for the PSVR2 Sense controller types: at `0x1cc4c9` the converted executable computes `type - 3` and skips the call when it is above 1, and the `scePadOpen` result is checked for an error first. `ValidPort` accepts only `PAD_PORT_TYPE_STANDARD`, `PAD_PORT_TYPE_SPECIAL` and the system `PAD_PORT_TYPE_REMOTE`, so those opens already fail and the VR path is never entered. The two exports are declared as throwing stubs, as the VR controller port types are not supported. Parameters are left off, as in #734: no title here calls them, so their signatures are unverified. ### Tested Pop!_OS 24.04 (kernel 7.1.5), GCC 13.3.0, CMake 3.28.3, Ninja, Release, `BUILD_TESTING=ON`, SPIRV-Tools validation off. - Default build and `libs` packaging pass. `libScePad.prx` is NID-patched and exports `306mCg0ibh8` and `mbJHDdjhVeY`. - `ctest`: 359 of 359 pass, the same as on unmodified `main` in this environment. - Balatro PPSA21402 relinked for Linux with `--to-intel`: the two imports resolve and startup no longer stops on them. The title does not reach the menu; it stops later for unrelated reasons, so no rendering, audio, input or gameplay claim is made. Neither stub was reached (no `NotImplemented` output). - No tests added: these are throwing stubs, and a missing export already fails at startup. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-06 21:19:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T21:19:33Z.


Progress report (5895ea7 → c80d01c)

📉 System libraries: 86.94% (-0.06%, +2 declared functions)

🆕 2 declared as stubs
Library Name
libScePad scePadVrControllerGetDeviceInformation
libScePad scePadVrControllerRead
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6025654688 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/905#issuecomment-6025654688). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-06T21:19:33Z. --- <!-- progress-report --> ### Progress report (5895ea7 → c80d01c) 📉 **System libraries**: 86.94% (-0.06%, +2 declared functions) <details> <summary>🆕 2 declared as stubs</summary> | Library | Name | | - | - | | libScePad | `scePadVrControllerGetDeviceInformation` | | libScePad | `scePadVrControllerRead` | </details>
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!905
No description provided.