From 864a4b38aaa0a7268a278fb5821e230182337a84 Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Wed, 18 Sep 2024 11:51:07 +0200 Subject: [PATCH] Work around Brothers in Arms speed issue via compat hack (#18513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henrik RydgÄrd --- Core/Compatibility.cpp | 1 + Core/Compatibility.h | 1 + Core/HLE/sceKernelTime.cpp | 2 ++ assets/compat.ini | 6 ++++++ 4 files changed, 10 insertions(+) diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index f0d00747a6..e9a6f1a201 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -136,6 +136,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "LoadCLUTFromCurrentFrameOnly", &flags_.LoadCLUTFromCurrentFrameOnly); CheckSetting(iniFile, gameID, "ForceUMDReadSpeed", &flags_.ForceUMDReadSpeed); CheckSetting(iniFile, gameID, "AllowDelayedReadbacks", &flags_.AllowDelayedReadbacks); + CheckSetting(iniFile, gameID, "KernelGetSystemTimeLowEatMoreCycles", &flags_.KernelGetSystemTimeLowEatMoreCycles); CheckSetting(iniFile, gameID, "TacticsOgreEliminateDebugReadback", &flags_.TacticsOgreEliminateDebugReadback); CheckSetting(iniFile, gameID, "FramebufferAllowLargeVerticalOffset", &flags_.FramebufferAllowLargeVerticalOffset); CheckSetting(iniFile, gameID, "DisableMemcpySlicing", &flags_.DisableMemcpySlicing); diff --git a/Core/Compatibility.h b/Core/Compatibility.h index 75939a5340..bf6bca0295 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -106,6 +106,7 @@ struct CompatFlags { bool LoadCLUTFromCurrentFrameOnly; bool ForceUMDReadSpeed; bool AllowDelayedReadbacks; + bool KernelGetSystemTimeLowEatMoreCycles; bool TacticsOgreEliminateDebugReadback; bool FramebufferAllowLargeVerticalOffset; bool DisableMemcpySlicing; diff --git a/Core/HLE/sceKernelTime.cpp b/Core/HLE/sceKernelTime.cpp index 5c300283ac..60f16286d8 100644 --- a/Core/HLE/sceKernelTime.cpp +++ b/Core/HLE/sceKernelTime.cpp @@ -83,6 +83,8 @@ u32 sceKernelGetSystemTimeLow() u64 t = CoreTiming::GetGlobalTimeUs(); VERBOSE_LOG(Log::sceKernel,"%08x=sceKernelGetSystemTimeLow()",(u32)t); hleEatCycles(165); + if (PSP_CoreParameter().compat.flags().KernelGetSystemTimeLowEatMoreCycles) + hleEatCycles(70000); hleReSchedule("system time"); return (u32)t; } diff --git a/assets/compat.ini b/assets/compat.ini index bf5aa82d1e..beabb9aa6b 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -264,6 +264,12 @@ ULJM06365 = true # ULJM05036 = true # ULUS10044 = true +[KernelGetSystemTimeLowEatMoreCycles] +# Brothers in Arms: D-Day works around weird FPS(falling under 100% even on powerful hardware) as well as it's animation speed #18509 +# recommend to OC PSP CPU to at least twice as much as real PSP to get constant 60 fps +ULES00608 = true +ULUS10193 = true + [DrawSyncInstant] # Bizarre timing issue in Sakura-sou no Pet na Kanojo, see issue #15224. Note that an instant DrawSync is not logical. NPJH50745 = true