Merge pull request #1118 from TideOPL/feat/pad-is-remote-controller

feat(libScePad): implement scePadIsRemoteController
This commit is contained in:
Dean 2026-10-08 18:19:30 +13:00 committed by GitHub
commit 8180dc5b9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 3 deletions

View File

@ -260,8 +260,15 @@ int APS5_VABI scePadVrControllerRead() {
return 0;
}
APS5_EXPORT("fCWdlnmB1Ks", scePadUnknown_fCWdlnmB1Ks);
int APS5_VABI scePadUnknown_fCWdlnmB1Ks(void) {
int APS5_VABI scePadIsRemoteController(int handle, bool* remote) {
if (handle != PAD_HANDLE) return PAD_ERROR_INVALID_HANDLE;
if (remote == nullptr) return PAD_ERROR_INVALID_ARG;
*remote = false;
return 0;
}
int APS5_VABI scePadSetAngularVelocityBiasCorrectionState() {
NotImplemented_nid_no_patch(__func__);
return 0;
}

View File

@ -18,6 +18,7 @@ int APS5_VABI scePadReadState(int, PadData*);
int APS5_VABI scePadSetTiltCorrectionState(int, bool);
int APS5_VABI scePadResetOrientation(int);
int APS5_VABI scePadSetAngularVelocityDeadbandState(int, bool);
int APS5_VABI scePadIsRemoteController(int, bool*);
}
static void Require(bool value) { if (!value) std::abort(); }
@ -68,6 +69,15 @@ static void CheckReadStateHandle(int handle) {
Require(scePadReadState(handle, &data) == PAD_OK);
}
static void CheckRemoteController(int handle) {
bool remote = true;
Require(scePadIsRemoteController(handle + 1, &remote) == PAD_ERROR_INVALID_HANDLE);
Require(scePadIsRemoteController(handle, nullptr) == PAD_ERROR_INVALID_ARG);
Require(remote);
Require(scePadIsRemoteController(handle, &remote) == PAD_OK);
Require(!remote);
}
int main() {
constexpr int noHandle = static_cast<int>(0x80920008);
constexpr int user = 0x10000000;
@ -88,6 +98,7 @@ int main() {
CheckTiltCorrection(handle);
CheckTouchContact();
CheckReadStateHandle(handle);
CheckRemoteController(handle);
Require(scePadGetHandle(0xff, 16, 0) == handle);
Require(scePadGetHandle(user, 16, 0) == noHandle);
Require(scePadGetHandle(user, 0, 1) == noHandle);

View File

@ -142,7 +142,8 @@ Throughout the project, every function at every stage either **does exactly what
- [sceVoiceQoSInit](../../core/libs/prx/libSceVoiceQoS/Export.cpp) (libSceVoiceQoS) - the error codes are unknown: a null or empty memory block, an app type other than 0x20000000 (PPSA14632) or 0x10000000 (PPSA26344) and a second initialization throw. The minimum memory size is unknown; the app type and the block are not used, as no endpoint is implemented
- AudioIn and NpSessionSignaling exports added without an implementation have assumed signatures
- [vieBRwlh1Lw](../../core/libs/prx/libSceAgc/Unimplemented.cpp) (libSceAgc) - unknown name, signature
- [fCWdlnmB1Ks](../../core/libs/prx/libScePad/Export.cpp) (libScePad) - unknown name, signature
- [scePadIsRemoteController](../../core/libs/prx/libScePad/Export.cpp) (libScePad) - the name hashes to NID `fCWdlnmB1Ks`; the signature `(int handle, bool* remote)` comes from PPSA16064, which zeroes a byte, passes its address after `scePadGetControllerInformation` and ignores the result. The error codes follow the other pad calls. Controllers are local devices, so the answer is always false
- [scePadSetAngularVelocityBiasCorrectionState](../../core/libs/prx/libScePad/Export.cpp) (libScePad) - imported by PPSA16064 and not called during its start-up; unknown signature
- [sceKernelGetOperationMode](../../core/libs/prx/libkernel/System/src/Process.cpp) (libkernel) - the signature `(int* mode, int* submode)` comes from PPSA12544, which logs both values after the call; the values are unknown and 0 is reported for both, as in the [prosper](https://github.com/mattias800/prosper/pull/4153) reimplementation. Null outputs throw
- Font, Http2, Net, Ssl, SystemService and libkernel exports imported by PPSA12544 and added without an implementation have unknown signatures
- [libSceVrSetupDialog](../../core/libs/prx/libSceVrSetupDialog/Export.cpp), and the Share, NpTrophy2, NpEntitlementAccess and WebBrowserDialog exports imported by PPSA12544's Unity plugins and added without an implementation, have unknown signatures