Skip to content

libScePad: replace NotImplemented stubs and fix return-0 consistency - #34

Open
Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/5038
Open

Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/5038

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#5038, originally opened by coptergui-ops.

Source commit: 3dadad70c7417c50848ba2b231a0eaeb5f04ede1. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


Replace all remaining NotImplemented_nid_no_patch stubs in libScePad with proper return values, and fix two functions returning bare 0 instead of PAD_OK.

Changes to core/libs/prx/libScePad/Export.cpp

17 NotImplemented stubs replaced with proper error codes:

  • scePadOpenExt accepts all port types, returns DEVICE_NOT_CONNECTED instead of throwing on non-special ports (PPSA01317)
  • scePadReadExt, GetFeatureReport, SetFeatureReport, OutputReport return DEVICE_NOT_CONNECTED (imported by PPSA01317)
  • All 8 scePadVrController* functions return DEVICE_NOT_CONNECTED (imported by PPSA99177 for PS VR2)
  • scePadUnknown_n3kSX62fgNo returns 0 as the console does (imported by PPSA01317)
  • scePadSetAngularVelocityBiasCorrectionState accepts enabled value without throwing (bias correction not modelled, no-op)

Consistency fix:

  • scePadReadState and scePadIsRemoteController return PAD_OK explicitly instead of bare 0

Changes to docs/dev/debt/libScePad.md

Each function's new behaviour documented with PPSA references. "Other port types throw" changed to "all port types return DEVICE_NOT_CONNECTED". Added entries for each previously-thrown function.

State

  • 0 NotImplemented stubs remaining (was 17)
  • All functions return proper error codes or PAD_OK
  • Conventions check passes clean

…TED returns

Replace 17 NotImplemented_nid_no_patch calls in libScePad with
DEVICE_NOT_CONNECTED (0x80920007), matching console behaviour where
the host has no special controller at any port type.

Changes:
- scePadOpenExt: accept all port types, return DEVICE_NOT_CONNECTED
  instead of throwing on non-special ports
- scePadReadExt, GetFeatureReport, SetFeatureReport, OutputReport:
  return DEVICE_NOT_CONNECTED (imported by PPSA01317)
- All scePadVrController* functions: return DEVICE_NOT_CONNECTED
  (imported by PPSA99177 for PS VR2)
- scePadUnknown_n3kSX62fgNo: return 0 (imported by PPSA01317)
- scePadSetAngularVelocityBiasCorrectionState: accept enabled value
  without throwing (bias correction not modelled)

Update docs/dev/debt/libScePad.md to reflect each function's new
behaviour and cite the PPSA references.

Signed-off-by: Sebastian <coptergui@gmail.com>
scePadReadState and scePadIsRemoteController returned bare 0 instead of
PAD_OK, inconsistent with the rest of the library. Both now return PAD_OK
explicitly. All other functions already use proper error/success codes.
@Thimo188 Thimo188 closed this Dec 2, 2026
@Thimo188 Thimo188 reopened this Dec 2, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants