From 35dae6abb4fb2a3da61e4f1f74e124b6bfa4de12 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 12 Dec 2024 22:46:20 +0200 Subject: [PATCH] fix for detecting more that 2 players and play both with player 1 keys (#1750) --- src/core/libraries/pad/pad.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index ec4186f1..98f086dd 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -155,6 +155,9 @@ int PS4_SYSV_ABI scePadGetFeatureReport() { } int PS4_SYSV_ABI scePadGetHandle(s32 userId, s32 type, s32 index) { + if (userId == -1) { + return ORBIS_PAD_ERROR_DEVICE_NO_HANDLE; + } LOG_DEBUG(Lib_Pad, "(DUMMY) called"); return 1; } @@ -246,6 +249,9 @@ int PS4_SYSV_ABI scePadMbusTerm() { int PS4_SYSV_ABI scePadOpen(s32 userId, s32 type, s32 index, const OrbisPadOpenParam* pParam) { LOG_INFO(Lib_Pad, "(DUMMY) called user_id = {} type = {} index = {}", userId, type, index); + if (userId == -1) { + return ORBIS_PAD_ERROR_DEVICE_NO_HANDLE; + } if (Config::getUseSpecialPad()) { if (type != ORBIS_PAD_PORT_TYPE_SPECIAL) return ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED; @@ -346,6 +352,9 @@ int PS4_SYSV_ABI scePadReadHistory() { } int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) { + if (handle == ORBIS_PAD_ERROR_DEVICE_NO_HANDLE) { + return ORBIS_PAD_ERROR_INVALID_HANDLE; + } auto* controller = Common::Singleton::Instance(); int connectedCount = 0; bool isConnected = false;