feat(libScePad): implement scePadIsRemoteController
NID fCWdlnmB1Ks was exported as an unknown function that threw. The name scePadIsRemoteController hashes to it. PPSA16064 (Minecraft Dungeons II) calls it once per controller after scePadGetControllerInformation, with the pad handle and the address of a byte it has just zeroed, and ignores the result. It reports whether the controller is connected through Remote Play. Controllers here are local devices, so the answer is always false. An invalid handle returns INVALID_HANDLE and a null output INVALID_ARG, as the other pad calls do. Without it the title aborted at the main menu. scePadSetAngularVelocityBiasCorrectionState, which the title imports but does not call during start-up, is added as an unimplemented export. guest_pad checks the handle and null-output errors and the result.
This commit is contained in:
parent
e79c971f99
commit
efceec9c56
|
|
@ -243,8 +243,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,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(); }
|
||||
|
|
@ -67,6 +68,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;
|
||||
|
|
@ -82,6 +92,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);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,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
|
||||
|
|
|
|||
Loading…
Reference in New Issue