mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-29 14:53:18 +00:00
Merge pull request #626 from InvoxiPlayGames/special-pad
pad: add support for configurable special pad class
This commit is contained in:
commit
878fac7f94
4 changed files with 67 additions and 2 deletions
|
@ -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,26 @@ 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 ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED;
|
||||
} else {
|
||||
if (type != ORBIS_PAD_PORT_TYPE_STANDARD)
|
||||
return ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
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 ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED;
|
||||
} else {
|
||||
if (type != ORBIS_PAD_PORT_TYPE_STANDARD)
|
||||
return ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
return 1; // dummy
|
||||
}
|
||||
|
||||
|
|
|
@ -229,6 +229,13 @@ struct OrbisPadOpenParam {
|
|||
u8 reserve[8];
|
||||
};
|
||||
|
||||
struct OrbisPadOpenExtParam {
|
||||
u16 vendorId;
|
||||
u16 productId;
|
||||
u16 productId_2;
|
||||
u8 reserve[10];
|
||||
};
|
||||
|
||||
struct OrbisPadLightBarParam {
|
||||
u8 r;
|
||||
u8 g;
|
||||
|
@ -284,7 +291,7 @@ int PS4_SYSV_ABI scePadIsValidHandle();
|
|||
int PS4_SYSV_ABI scePadMbusInit();
|
||||
int PS4_SYSV_ABI scePadMbusTerm();
|
||||
int PS4_SYSV_ABI scePadOpen(s32 userId, s32 type, s32 index, const OrbisPadOpenParam* pParam);
|
||||
int PS4_SYSV_ABI scePadOpenExt();
|
||||
int PS4_SYSV_ABI scePadOpenExt(s32 userId, s32 type, s32 index, const OrbisPadOpenExtParam* pParam);
|
||||
int PS4_SYSV_ABI scePadOpenExt2();
|
||||
int PS4_SYSV_ABI scePadOutputReport();
|
||||
int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue