mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 03:16:54 +02:00
controller: enable the DualSense HIDAPI driver, light bar and adaptive triggers (#437)
* controller: enable the DualSense HIDAPI driver, light bar and adaptive triggers Three additions. SDL was opening a DualSense through the generic gamepad path, so SDL_GameControllerHasLED and SDL_GameControllerGetNumTouchpads both reported nothing and no touchpad events ever arrived - enabling the PS5 HIDAPI driver before SDL_InitSubSystem is what makes the light bar and the existing touchpad support reachable. PadSetLightBar validated its arguments and returned OK without touching the pad; it now drives the LED. PadSetTriggerEffect did the same; it now translates the mode and parameters into a DualSense trigger block and sends it. * controller: fix DualSense effects --------- Co-authored-by: nmzik <Nmzik@mail.ru>
This commit is contained in:
+1
-18
@@ -42,23 +42,6 @@ static int KYTY_SYSV_ABI PadGetTriggerEffectState(int
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int KYTY_SYSV_ABI PadSetTriggerEffect(int handle, const void* param) {
|
||||
PRINT_NAME();
|
||||
|
||||
LOGF("\t handle = %d\n"
|
||||
"\t param = 0x%016" PRIx64 "\n",
|
||||
handle, reinterpret_cast<uint64_t>(param));
|
||||
|
||||
if (handle != 1) {
|
||||
return -2137915389; /* 0x80920003 */
|
||||
}
|
||||
if (param == nullptr) {
|
||||
return -2137915391; /* 0x80920001 */
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int KYTY_SYSV_ABI PadSetVibrationTriggerEffectWeakWhileEmbeddedMicInUse(bool enabled) {
|
||||
PRINT_NAME();
|
||||
|
||||
@@ -198,7 +181,7 @@ LIB_DEFINE(InitPad_1) {
|
||||
LIB_FUNC("rIZnR6eSpvk", Controller::PadResetOrientation);
|
||||
LIB_FUNC("vDLMoJLde8I", PadSetTiltCorrectionState);
|
||||
LIB_FUNC("gjP9-KQzoUk", Controller::PadGetControllerInformation);
|
||||
LIB_FUNC("2JgFB2n9oUM", PadSetTriggerEffect);
|
||||
LIB_FUNC("2JgFB2n9oUM", Controller::PadSetTriggerEffect);
|
||||
LIB_FUNC("YndgXqQVV7c", Controller::PadReadState);
|
||||
LIB_FUNC("q1cHNfGycLI", Controller::PadRead);
|
||||
LIB_FUNC("yFVnOdGxvZY", Controller::PadSetVibration);
|
||||
|
||||
Reference in New Issue
Block a user