X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fplugins.c;h=d44442b01d0c838b09f670618b454c47a666b915;hb=3de08a09ec3cd4d9573b2c5826dc3c05fe7f5852;hp=868493bb6c63a2a45536a304ef07227ca5b77b06;hpb=86459dfc29c5c5f78c79d649d297a98d7212cc7f;p=pcsx_rearmed.git diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index 868493bb..d44442b0 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -622,6 +622,15 @@ static void log_pad(int port, int pos) #endif } +static void adjust_analog(unsigned char *b) +{ + // ff8 hates 0x80 for whatever reason (broken in 2d area menus), + // or is this caused by something else we do wrong?? + // Also S.C.A.R.S. treats 0x7f as turning left. + if (b[6] == 0x7f || b[6] == 0x80) + b[6] = 0x81; +} + // Build response for 0x42 request Pad in port static void PADstartPoll_(PadDataS *pad) { switch (pad->controllerType) { @@ -699,6 +708,7 @@ static void PADstartPoll_(PadDataS *pad) { stdpar[5] = pad->rightJoyY; stdpar[6] = pad->leftJoyX; stdpar[7] = pad->leftJoyY; + adjust_analog(stdpar); memcpy(buf, stdpar, 8); respSize = 8; break; @@ -711,6 +721,7 @@ static void PADstartPoll_(PadDataS *pad) { stdpar[5] = pad->rightJoyY; stdpar[6] = pad->leftJoyX; stdpar[7] = pad->leftJoyY; + adjust_analog(stdpar); memcpy(buf, stdpar, 8); respSize = 8; break;