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.
+extern int in_type[8];
+
void *hPAD1Driver = NULL;
void *hPAD2Driver = NULL;
void *hPAD1Driver = NULL;
void *hPAD2Driver = NULL;
static int reqPos, respSize, req;
static int ledStateReq44[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,
static unsigned char buf[256];
static unsigned char bufMulti[34] = { 0x80, 0x5a,
break;
case CMD_QUERY_MODEL_AND_MODE :
memcpy(buf, resp45, 8);
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);
break;
case CMD_QUERY_ACT :
memcpy(buf, resp46_00, 8);
//0x01 analog ON
//0x00 analog OFF
ledStateReq44[padIndex] = value;
//0x01 analog ON
//0x00 analog OFF
ledStateReq44[padIndex] = value;
+ PadMode[padIndex] = value;
break;
case CMD_QUERY_ACT :
//0x46
break;
case CMD_QUERY_ACT :
//0x46
if (reqPos == 0) {
//mem the request number
req = 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
}
//if no new request the pad return 0xff, for signaling connected
//mem the vibration value for Large motor;
pad[port].Vib[1] = value;
//vibration
//mem the vibration value for Large motor;
pad[port].Vib[1] = value;
//vibration
+ if (in_type[port] != PSE_PAD_TYPE_STANDARD)
+ vibrate(port);