X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fplugins.c;h=75e1f5fbef3d8c9d40d30003d104fb7667d85dce;hb=e5241564f4444496f51f4de9bf533b1d910449ec;hp=d44442b01d0c838b09f670618b454c47a666b915;hpb=5338a93079458c4437138830ef711f61c2feabe6;p=pcsx_rearmed.git diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index d44442b0..75e1f5fb 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -490,15 +490,8 @@ static void initBufForRequest(int padIndex, char value) { return; } - // switch to analog mode automatically after the game finishes init - if (value == 0x42 && pads[padIndex].ds.padMode == 0) - pads[padIndex].ds.digitalModeFrames++; - if (pads[padIndex].ds.digitalModeFrames == 60*4) { - pads[padIndex].ds.padMode = 1; - pads[padIndex].ds.digitalModeFrames = 0; - } - - if ((u32)(frame_counter - pads[padIndex].ds.lastUseFrame) > 60u) + if ((u32)(frame_counter - pads[padIndex].ds.lastUseFrame) > 60u + && !Config.hacks.dualshock_init_analog) pads[padIndex].ds.padMode = 0; // according to nocash pads[padIndex].ds.lastUseFrame = frame_counter; @@ -991,6 +984,15 @@ int padFreeze(void *f, int Mode) { return 0; } +int padToggleAnalog(unsigned int index) +{ + int r = -1; + + if (index < sizeof(pads) / sizeof(pads[0])) + r = (pads[index].ds.padMode ^= 1); + return r; +} + void *hNETDriver = NULL;