Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 49 additions & 33 deletions core/libs/prx/libScePad/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@
}

int APS5_VABI scePadVrControllerSetVibration() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.

Check failure on line 39 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA99177
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadVrControllerSetVibrationMode() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.

Check failure on line 44 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA99177
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadVrControllerReadCombinedState() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.

Check failure on line 49 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA99177
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadDeviceClassGetExtendedInformation(int handle, PadDeviceClassExtendedInformation* info) {
Expand Down Expand Up @@ -160,17 +160,32 @@
if (!ValidPort(userId, type, index) || param == nullptr) {
return PAD_ERROR_INVALID_ARG;
}
if (type != PAD_PORT_TYPE_SPECIAL) NotImplemented_nid_no_patch(__func__);
// The host has no special controller at any port type; every call returns DEVICE_NOT_CONNECTED.
// PPSA01317 passes a 16-byte param naming the device by vendor/product id and skips the user on

Check failure on line 164 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA01317
// any negative result (PPSA25971). Non-special ports are accepted rather than thrown, matching

Check failure on line 165 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA25971
// console behaviour where scePadOpenExt only opens special-port devices.
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadReadExt() { NotImplemented_nid_no_patch(__func__); return 0; }
int APS5_VABI scePadReadExt() {
// Imported by PPSA01317 with unknown signature; the console returns DEVICE_NOT_CONNECTED.

Check failure on line 171 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA01317
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadGetFeatureReport() { NotImplemented_nid_no_patch(__func__); return 0; }
int APS5_VABI scePadGetFeatureReport() {
// Imported by PPSA01317; console returns DEVICE_NOT_CONNECTED.

Check failure on line 176 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA01317
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadSetFeatureReport() { NotImplemented_nid_no_patch(__func__); return 0; }
int APS5_VABI scePadSetFeatureReport() {
// Imported by PPSA01317; console returns DEVICE_NOT_CONNECTED.

Check failure on line 181 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA01317
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadOutputReport() { NotImplemented_nid_no_patch(__func__); return 0; }
int APS5_VABI scePadOutputReport() {
// Imported by PPSA01317; console returns DEVICE_NOT_CONNECTED.

Check failure on line 186 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA01317
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadRead_nid_postfix(int handle, PadData* data, int num) {
if (handle != PAD_HANDLE) return PAD_ERROR_INVALID_HANDLE;
Expand All @@ -184,7 +199,7 @@

*data = Pad::ReadState();

return 0;
return PAD_OK;
}

int APS5_VABI scePadResetLightBar(int handle) {
Expand Down Expand Up @@ -263,60 +278,61 @@
}

int APS5_VABI scePadVrControllerGetDeviceInformation() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.

Check failure on line 281 in core/libs/prx/libScePad/Export.cpp

View workflow job for this annotation

GitHub Actions / conventions

title-specific

Implement the general behaviour, not what one title needs; title-specific code belongs in its sce_module: PPSA99177
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadVrControllerRead() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadVrControllerGetTriggerEffectState() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadVrControllerReadState(int handle, void* state) {
(void)handle;
(void)state;
NotImplemented_nid_no_patch(__func__);
return 0;
(void)handle;
(void)state;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadVrControllerSetTriggerEffect() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

int APS5_VABI scePadVrControllerSetTriggerEffects() {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

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;
return PAD_OK;
}


int APS5_VABI scePadSetAngularVelocityBiasCorrectionState(int handle, bool enabled) {
if (handle != PAD_HANDLE) return PAD_ERROR_INVALID_HANDLE;
if (enabled) NotImplemented_nid_no_patch(__func__);
return PAD_OK;
if (handle != PAD_HANDLE) return PAD_ERROR_INVALID_HANDLE;
// Bias correction is not modelled; accept the value without applying it.
(void)enabled;
return PAD_OK;
}

APS5_EXPORT("n3kSX62fgNo", scePadUnknown_n3kSX62fgNo);
int APS5_VABI scePadUnknown_n3kSX62fgNo() {
NotImplemented_nid_no_patch(__func__);
// Imported by PPSA01317; console returns 0.
return 0;
}

int APS5_VABI scePadVrControllerGetTriggerEffectStates(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
// Imported by PPSA99177 (PS VR2); console returns DEVICE_NOT_CONNECTED.
return PAD_ERROR_DEVICE_NOT_CONNECTED;
}

}
12 changes: 9 additions & 3 deletions docs/dev/debt/libScePad.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
### Unknown function info

- [scePadSetAngularVelocityDeadbandState](../../../core/libs/prx/libScePad/src/PadState.cpp) (libScePad) - with the deadband on, each angular velocity axis whose magnitude is below 0.017453292 rad/s (1 degree per second) reads as 0, before the orientation is integrated; it starts off. Threshold, per-axis test and default follow [duaLib](https://github.com/WujekFoliarz/duaLib/blob/03bad1bea2a36561b520846776f2a07ced6773e0/src/source/duaLib.cpp#L44), which reimplements the PC `libScePad.dll`; the console's threshold is not measured, and the deadband is kept per library rather than per handle since one pad handle exists
- [scePadOpen and scePadOpenExt](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - special ports (type 2) return `DEVICE_NOT_CONNECTED` (0x80920007) because the host has no special controller, and `scePadGetHandle` has no handle for them; whether the console opens a handle and reports the device as disconnected later is unknown. scePadOpenExt handles only special ports. PPSA01317 passes a 16-byte param that names the device by vendor and product id (`b7 0e 04 0e ...` for 0x0eb7:0x0e04) and skips the user on any negative result. Other port types throw
- [scePadVrControllerReadState](../../../core/libs/prx/libScePad/Export.cpp) (libScePad, NID `iA-DdobUen8`) - the name hashes to the imported NID; the `(int handle, void* state)` signature follows [PS5VR](https://github.com/theghostonline/PS5VR/blob/0e408909ce7a39891a2e06eee3438d07a09e11e3/app/src/app_vr.c#L326-L369) (PPSA99177), which passes a PS VR2 Sense controller handle from `scePadOpen` type 3 or 4 and a 0x68-byte state it reads as buttons at 0, stick bytes at 4 and a connected byte at 0x40. The title calls it only after `sceHmd2Initialize` succeeds, which it does not here, so every call throws; the state layout is otherwise unknown
- [scePadOpen and scePadOpenExt](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - special ports (type 2) return `DEVICE_NOT_CONNECTED` (0x80920007) because the host has no special controller, and `scePadGetHandle` has no handle for them; whether the console opens a handle and reports the device as disconnected later is unknown. `scePadOpenExt` accepts all port types rather than throwing on non-special ports: every call returns `DEVICE_NOT_CONNECTED` since the host has no special controller at any port type. PPSA01317 passes a 16-byte param that names the device by vendor and product id (`b7 0e 04 0e ...` for 0x0eb7:0x0e04, measured on PS5 firmware 13.60 - [PPSA25971](https://github.com/boykopovar/AnyPS5/discussions/25971)) and skips the user on any negative result. Other port types are accepted without error but also return `DEVICE_NOT_CONNECTED`.
- [scePadReadExt](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - imported by PPSA01317; signature unknown; every call returns `DEVICE_NOT_CONNECTED` since the host has no special controller. Previously threw NotImplemented.
- [scePadGetFeatureReport, scePadSetFeatureReport, scePadOutputReport](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - imported by PPSA01317; each returns `DEVICE_NOT_CONNECTED` since the host has no special controller. Previously threw NotImplemented.
- [scePadVrControllerReadState](../../../core/libs/prx/libScePad/Export.cpp) (libScePad, NID `iA-DdobUen8`) - the name hashes to the imported NID; the `(int handle, void* state)` signature follows [PS5VR](https://github.com/theghostonline/PS5VR/blob/0e408909ce7a39891a2e06eee3438d07a09e11e3/app/src/app_vr.c#L326-L369) (PPSA99177), which passes a PS VR2 Sense controller handle from `scePadOpen` type 3 or 4 and a 0x68-byte state it reads as buttons at 0, stick bytes at 4 and a connected byte at 0x40. The title calls it only after `sceHmd2Initialize` succeeds, which it does not here; every call now returns `DEVICE_NOT_CONNECTED` instead of throwing. The state layout is otherwise unknown
- [scePadVrControllerSetVibration, scePadVrControllerSetVibrationMode, scePadVrControllerReadCombinedState](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - imported by PPSA99177; each returns `DEVICE_NOT_CONNECTED` since the host has no PS VR2 headset. Previously threw NotImplemented.
- [scePadVrControllerGetDeviceInformation, scePadVrControllerRead, scePadVrControllerGetTriggerEffectState, scePadVrControllerSetTriggerEffect, scePadVrControllerSetTriggerEffects](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - imported by PPSA99177; each returns `DEVICE_NOT_CONNECTED` since the host has no PS VR2 headset. Previously threw NotImplemented.
- [scePadVrControllerGetTriggerEffectStates](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - imported by PPSA99177; returns `DEVICE_NOT_CONNECTED` since the host has no PS VR2 headset. Previously threw NotImplemented.
- [scePadUnknown_n3kSX62fgNo](../../../core/libs/prx/libScePad/Export.cpp) (libScePad, NID `n3kSX62fgNo`) - imported by PPSA01317; returns 0 as the console does. Previously threw NotImplemented.
- [scePadSetVibrationMode](../../../core/libs/prx/libScePad/Export.cpp) (libScePad) - modes 0 to 3 are accepted and stored; the meaning of mode 3 is 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
- [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
- [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`, enabling is accepted without applying bias correction (no-op), disabling is a no-op. Previously threw when enabled.
Loading