aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornegativeExponent2020-10-30 19:33:23 +0800
committernegativeExponent2020-10-30 19:39:26 +0800
commit8822f8b13ece6d070070aa5eef6d93d0340509a0 (patch)
tree59147aa5557ab25af8bdb35863016658392c4d4e
parent4e007d06843dd3a9422fee41953641eeaec2b93d (diff)
downloadpcsx_rearmed-8822f8b13ece6d070070aa5eef6d93d0340509a0.tar.gz
pcsx_rearmed-8822f8b13ece6d070070aa5eef6d93d0340509a0.tar.bz2
pcsx_rearmed-8822f8b13ece6d070070aa5eef6d93d0340509a0.zip
Fix input not responding
Pad mode set was missing that cause a few games which queries for an analog-type controller to fail or causes no inputs at all. This also change the "standard" input type to behave like one, which means it does not have rumble or analog inputs. A required input type is necessary to set the desired input effects. Probably needs some cleanup but it works for now. Fixes https://github.com/libretro/pcsx_rearmed/issues/161 and probably other input related issues.
-rw-r--r--libpcsxcore/plugins.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c
index 67fe835..8015232 100644
--- a/libpcsxcore/plugins.c
+++ b/libpcsxcore/plugins.c
@@ -366,6 +366,8 @@ static int LoadSPUplugin(const char *SPUdll) {
return 0;
}
+extern int in_type[8];
+
void *hPAD1Driver = NULL;
void *hPAD2Driver = NULL;
@@ -376,6 +378,7 @@ static PadDataS pad[8];
static int reqPos, respSize, req;
static int ledStateReq44[8];
+static int PadMode[8]; /* 0 : digital 1: analog */
static unsigned char buf[256];
static unsigned char bufMulti[34] = { 0x80, 0x5a,
@@ -529,6 +532,7 @@ void initBufForRequest(int padIndex, char value){
break;
case CMD_QUERY_MODEL_AND_MODE :
memcpy(buf, resp45, 8);
+ buf[4] = PadMode[padIndex];
break;
case CMD_QUERY_ACT :
memcpy(buf, resp46_00, 8);
@@ -584,6 +588,7 @@ void reqIndex2Treatment(int padIndex, char value){
//0x01 analog ON
//0x00 analog OFF
ledStateReq44[padIndex] = value;
+ PadMode[padIndex] = value;
break;
case CMD_QUERY_ACT :
//0x46
@@ -741,8 +746,16 @@ unsigned char _PADpoll(int port, unsigned char value) {
if (reqPos == 0) {
//mem the request number
req = value;
- //copy the default value of request response in buffer instead of the keystate
- initBufForRequest(port, value);
+
+ // Don't enable Analog/Vibration for a standard pad
+ if (in_type[port] == PSE_PAD_TYPE_STANDARD) {
+ ; // Pad keystate already in buffer
+ }
+ else
+ {
+ //copy the default value of request response in buffer instead of the keystate
+ initBufForRequest(port, value);
+ }
}
//if no new request the pad return 0xff, for signaling connected
@@ -761,7 +774,8 @@ unsigned char _PADpoll(int port, unsigned char value) {
//mem the vibration value for Large motor;
pad[port].Vib[1] = value;
//vibration
- vibrate(port);
+ if (in_type[port] != PSE_PAD_TYPE_STANDARD)
+ vibrate(port);
break;
}
break;