From: notaz Date: Fri, 20 Oct 2023 23:45:06 +0000 (+0300) Subject: try a workaround for ff8 analogs X-Git-Tag: r24~99 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=4426590d5e20e054247a65334547e5a25037b36c try a workaround for ff8 analogs notaz/pcsx_rearmed#54 --- diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index 868493bb..a6171879 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -622,6 +622,14 @@ 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?? + if (b[6] == 0x80) + b[6] = 0x7f; +} + // Build response for 0x42 request Pad in port static void PADstartPoll_(PadDataS *pad) { switch (pad->controllerType) { @@ -699,6 +707,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 +720,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;