add support for configurable special pad type

This commit is contained in:
InvoxiPlayGames 2024-08-28 10:27:51 +01:00
parent c37679154e
commit 79e86a39fc
4 changed files with 66 additions and 2 deletions

View file

@ -4,6 +4,7 @@
// Generated By moduleGenerator
#include <common/assert.h>
#include <common/singleton.h>
#include "common/config.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
@ -25,6 +26,9 @@ int PS4_SYSV_ABI scePadConnectPort() {
int PS4_SYSV_ABI scePadDeviceClassGetExtendedInformation(
s32 handle, OrbisPadDeviceClassExtendedInformation* pExtInfo) {
LOG_ERROR(Lib_Pad, "(STUBBED) called");
if (Config::getUseSpecialPad()) {
pExtInfo->deviceClass = (OrbisPadDeviceClass)Config::getSpecialPadClass();
}
return ORBIS_OK;
}
@ -107,6 +111,10 @@ int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerIn
pInfo->connectedCount = 1;
pInfo->connected = true;
pInfo->deviceClass = ORBIS_PAD_DEVICE_CLASS_STANDARD;
if (Config::getUseSpecialPad()) {
pInfo->connectionType = ORBIS_PAD_PORT_TYPE_SPECIAL;
pInfo->deviceClass = (OrbisPadDeviceClass)Config::getSpecialPadClass();
}
return SCE_OK;
}
@ -239,11 +247,25 @@ 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 (Config::getUseSpecialPad()) {
if (type != ORBIS_PAD_PORT_TYPE_SPECIAL)
return -1;
} else {
if (type != ORBIS_PAD_PORT_TYPE_STANDARD)
return -1;
}
return 1; // dummy
}
int PS4_SYSV_ABI scePadOpenExt() {
int PS4_SYSV_ABI scePadOpenExt(s32 userId, s32 type, s32 index, const OrbisPadOpenExtParam* pParam) {
LOG_ERROR(Lib_Pad, "(STUBBED) called");
if (Config::getUseSpecialPad()) {
if (type != ORBIS_PAD_PORT_TYPE_SPECIAL)
return -1;
} else {
if (type != ORBIS_PAD_PORT_TYPE_STANDARD)
return -1;
}
return 1; // dummy
}