X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fplugins.c;h=9a3998236993a51a64ffeb19f0b954271a9b94b0;hb=1dc68512954094c1cd7bcc075e966925e3808108;hp=d7c2acb6e9eab64b271b47df77f488041ca5f18d;hpb=38b8a211aad8d2c485ccf0c0cbb58d965aac3483;p=pcsx_rearmed.git diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index d7c2acb6..9a399823 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -31,9 +31,6 @@ static s64 cdOpenCaseTime = 0; GPUupdateLace GPU_updateLace; GPUinit GPU_init; GPUshutdown GPU_shutdown; -GPUconfigure GPU_configure; -GPUtest GPU_test; -GPUabout GPU_about; GPUopen GPU_open; GPUclose GPU_close; GPUreadStatus GPU_readStatus; @@ -214,7 +211,6 @@ static int LoadGPUplugin(const char *GPUdll) { hGPUDriver = SysLoadLibrary(GPUdll); if (hGPUDriver == NULL) { - GPU_configure = NULL; SysMessage (_("Could not load GPU plugin %s!"), GPUdll); return -1; } drv = hGPUDriver; @@ -238,9 +234,6 @@ static int LoadGPUplugin(const char *GPUdll) { LoadGpuSym0(showScreenPic, "GPUshowScreenPic"); LoadGpuSym0(vBlank, "GPUvBlank"); LoadGpuSym0(getScreenInfo, "GPUgetScreenInfo"); - LoadGpuSym0(configure, "GPUconfigure"); - LoadGpuSym0(test, "GPUtest"); - LoadGpuSym0(about, "GPUabout"); return 0; } @@ -494,9 +487,28 @@ static void initBufForRequest(int padIndex, char value) { return; } - if ((u32)(frame_counter - pads[padIndex].ds.lastUseFrame) > 60u + if ((u32)(frame_counter - pads[padIndex].ds.lastUseFrame) > 2*60u + && pads[padIndex].ds.configModeUsed && !Config.hacks.dualshock_init_analog) + { + //SysPrintf("Pad reset\n"); pads[padIndex].ds.padMode = 0; // according to nocash + pads[padIndex].ds.autoAnalogTried = 0; + } + else if (pads[padIndex].ds.padMode == 0 && value == CMD_READ_DATA_AND_VIBRATE + && pads[padIndex].ds.configModeUsed + && !pads[padIndex].ds.configMode + && !pads[padIndex].ds.userToggled) + { + if (pads[padIndex].ds.autoAnalogTried == 16) { + // auto-enable for convenience + SysPrintf("Auto-enabling dualshock analog mode.\n"); + pads[padIndex].ds.padMode = 1; + pads[padIndex].ds.autoAnalogTried = 255; + } + else if (pads[padIndex].ds.autoAnalogTried < 16) + pads[padIndex].ds.autoAnalogTried++; + } pads[padIndex].ds.lastUseFrame = frame_counter; switch (value) { @@ -992,8 +1004,10 @@ int padToggleAnalog(unsigned int index) { int r = -1; - if (index < sizeof(pads) / sizeof(pads[0])) + if (index < sizeof(pads) / sizeof(pads[0])) { r = (pads[index].ds.padMode ^= 1); + pads[index].ds.userToggled = 1; + } return r; }