diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index 3ec28c61ae..e99d606fdb 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -51,6 +51,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "ClearToRAM", &flags_.ClearToRAM); CheckSetting(iniFile, gameID, "Force04154000Download", &flags_.Force04154000Download); CheckSetting(iniFile, gameID, "DrawSyncEatCycles", &flags_.DrawSyncEatCycles); + CheckSetting(iniFile, gameID, "DelayDelayThreadHack", &flags_.DelayDelayThreadHack); CheckSetting(iniFile, gameID, "FakeMipmapChange", &flags_.FakeMipmapChange); CheckSetting(iniFile, gameID, "HackFixVideo", &flags_.HackFixVideo); CheckSetting(iniFile, gameID, "HackFixHangs", &flags_.HackFixHangs); diff --git a/Core/Compatibility.h b/Core/Compatibility.h index 3f241651ea..438de9fb8f 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -51,6 +51,7 @@ struct CompatFlags { bool ClearToRAM; bool Force04154000Download; bool DrawSyncEatCycles; + bool DelayDelayThreadHack; bool FakeMipmapChange; bool RequireBufferedRendering; bool RequireBlockTransfer; diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 29a0168df6..b3a8aba2c6 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -32,6 +32,7 @@ #include "Core/CoreTiming.h" #include "Core/MemMapHelpers.h" #include "Core/Reporting.h" +#include "Core/System.h" #include "Common/ChunkFile.h" #include "Core/HLE/sceAudio.h" @@ -2463,7 +2464,12 @@ int sceKernelDelayThread(u32 usec) { s64 delayUs = __KernelDelayThreadUs(usec); __KernelScheduleWakeup(curThread, delayUs); __KernelWaitCurThread(WAITTYPE_DELAY, curThread, 0, 0, false, "thread delayed"); - return hleLogSuccessI(SCEKERNEL, 0, "delaying %lld usecs", delayUs); + int result = 0; + if (PSP_CoreParameter().compat.flags().DelayDelayThreadHack) + result = hleDelayResult(hleLogSuccessI(SCEKERNEL, 0, "delaying %lld usecs", delayUs), "hack", 6000); + else + result = hleLogSuccessI(SCEKERNEL, 0, "delaying %lld usecs", delayUs); + return result; } int sceKernelDelaySysClockThreadCB(u32 sysclockAddr) { diff --git a/assets/compat.ini b/assets/compat.ini index 3026a75905..e21686863b 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -176,6 +176,17 @@ UCJS18036 = true UCAS40292 = true UCJS18053 = true +[DelayDelayThreadHack] +# Dumb hack specially for Resistance Retribution +# Probably the game would work by delaying in any other place that affects FPS +# ...oh well it's a hackish playground branch, didn't even tested this much yet;p. +# At least it's not as bad with dropping FPS like reducing cpu clock, +# mostly drops it to 40-50 fps in places that would otherwise crash. +UCJS10090 = true +NPJG00018 = true +UCUS98668 = true +UCES01184 = true + [FakeMipmapChange] # This hacks separates each mipmap to independent textures to display wrong-size mipmaps. # For example this requires games like Tactics Ogre(Japanese) to display multi bytes fonts stored in mipmaps. @@ -268,6 +279,10 @@ ULKS46009 = true ULJM05160 = true ULES00042 = true ULJM05363 = true +# DTM Race Driver 3 / TOCA Race Driver 3: Challenge / V8 Supercars 3 +ULES00613 = true +ULES00614 = true +ULES00615 = true # might also be useful for Outrun and Brave Story? [RequireBufferedRendering]