mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-23 00:53:02 -05:00
Merge pull request #9664 from krishalivaibhav/feat/pad-tracker-device-queries
feat(libScePad): answer the tracker DualShock 4, Blaster and Move queries
This commit is contained in:
3 files changed
+19
-6
No files matched your search
@@ -923,18 +923,18 @@ bool APS5_VABI scePadIsValidHandle(std::int32_t handle, std::int32_t portType) {
|
||||
}
|
||||
|
||||
bool APS5_VABI scePadIsDS4Connected(std::int32_t handle) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
(void)handle;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool APS5_VABI scePadIsBlasterConnected(std::int32_t handle) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
(void)handle;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool APS5_VABI scePadIsMoveConnected(std::int32_t handle) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
(void)handle;
|
||||
return false;
|
||||
}
|
||||
|
||||
int APS5_VABI scePadGetBluetoothAddress(std::int32_t handle, std::uint64_t* address) {
|
||||
|
||||
@@ -30,6 +30,9 @@ int APS5_VABI scePadSetAngularVelocityDeadbandState(int, bool);
|
||||
int APS5_VABI scePadSetAngularVelocityBiasCorrectionState(int, bool);
|
||||
int APS5_VABI scePadIsRemoteController(int, bool*);
|
||||
int APS5_VABI scePadGetAccessibilityControllerState(int, std::uint32_t*);
|
||||
bool APS5_VABI scePadIsDS4Connected(std::int32_t);
|
||||
bool APS5_VABI scePadIsBlasterConnected(std::int32_t);
|
||||
bool APS5_VABI scePadIsMoveConnected(std::int32_t);
|
||||
int APS5_VABI scePadGetControllerInformation(int, PadControllerInformation*);
|
||||
int APS5_VABI scePadGetExtControllerInformation(int, void*);
|
||||
int APS5_VABI scePadResetLightBar(int);
|
||||
@@ -316,6 +319,14 @@ static void CheckRemoteController(int handle) {
|
||||
Require(!remote);
|
||||
}
|
||||
|
||||
static void CheckTrackerDevices(int handle) {
|
||||
for (const int candidate : {handle, handle + 1}) {
|
||||
Require(!scePadIsDS4Connected(candidate));
|
||||
Require(!scePadIsBlasterConnected(candidate));
|
||||
Require(!scePadIsMoveConnected(candidate));
|
||||
}
|
||||
}
|
||||
|
||||
static void CheckAccessibilityControllerState(int handle) {
|
||||
std::uint32_t state = 7;
|
||||
Require(scePadGetAccessibilityControllerState(handle + 1, nullptr) == PAD_ERROR_INVALID_ARG);
|
||||
@@ -460,6 +471,7 @@ int main() {
|
||||
CheckLatchedPressLifetime(handle);
|
||||
CheckReadStateHandle(handle);
|
||||
CheckRemoteController(handle);
|
||||
CheckTrackerDevices(handle);
|
||||
CheckAccessibilityControllerState(handle);
|
||||
CheckInjectedState(commandPath);
|
||||
PadLightBarParam lightBar{255, 128, 64};
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
- [scePadVrControllerReadCombinedState](../../../core/libs/prx/libScePad/Export.cpp) - the two handle arguments and 128-byte output are recovered; output field semantics remain incomplete.
|
||||
- [scePadSetVibrationMode](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - modes 1 to 3 and 5 are accepted and stored. On a PS5 (firmware 13.60) the call returns `0x80920005` before `scePadInit`, then rejects a mode of 0 or below with `INVALID_ARG` before it checks the handle, and returns `INVALID_HANDLE` for a bad handle with any higher mode; whether an open handle accepts modes above 3 was not measured, since the payload could not open a pad; 5 is accepted because PPSA25286 passes it on its open handle at start-up; the meanings of modes 3 and 5 are unknown (PPSA21480 calls it with 3 right after `scePadOpen` and aborts on failure; [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Pad/Pad.cs) names only 1 and 2). The stored mode has no other effect
|
||||
- [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
|
||||
- [scePadIsDS4Connected, scePadIsBlasterConnected and scePadIsMoveConnected](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - the `bool (int handle)` signatures are recovered; the library reports one DualSense to every title (see Touchpad resolution below), so no DualShock 4, Blaster or Move controller is ever behind a handle and each call answers false for any handle. The console's answer for an invalid handle is not measured
|
||||
- [scePadSetAngularVelocityBiasCorrectionState](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - inferred signature `(int handle, bool enabled)` follows `scePadSetTiltCorrectionState` and `scePadSetAngularVelocityDeadbandState`; an invalid handle returns `PAD_ERROR_INVALID_HANDLE`, disabling is a no-op, and enabling throws because bias correction is not modelled
|
||||
- [scePadGetAccessibilityControllerState](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - the value a console reports for a DualSense is not measured; the emulated pad, which is not an Access controller, reports 0. The name hashes to NID `zBsgF0q8DIM`. In the OS 10.01 system module the `(int handle, uint32_t* state)` function returns `0x80920005` before `scePadInit`, then `INVALID_ARG` for a NULL `state` and `INVALID_HANDLE` for a bad handle, and otherwise asks the pad driver for a per-device value of the device behind the handle: 0 when no device is behind it, 1 when the driver has no answer, else the driver's value. What the values mean is unknown
|
||||
|
||||
|
||||
Reference in new issue
Block a user