Add Fixed60FPShack for GOW, should work smoother than the ForceMax60FPS.

Also more stable than it's CWCheat version, unfortunately because of that,
still causes softlock in GOW:GOS vortex stage.
This commit is contained in:
LunaMoo 2022-07-02 19:14:05 +02:00
parent 99eef2b4f6
commit 0dcf8242f5
7 changed files with 25 additions and 5 deletions

View File

@ -66,6 +66,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "YugiohSaveFix", &flags_.YugiohSaveFix);
CheckSetting(iniFile, gameID, "ForceUMDDelay", &flags_.ForceUMDDelay);
CheckSetting(iniFile, gameID, "ForceMax60FPS", &flags_.ForceMax60FPS);
CheckSetting(iniFile, gameID, "Fixed60FPShack", &flags_.Fixed60FPShack);
CheckSetting(iniFile, gameID, "JitInvalidationHack", &flags_.JitInvalidationHack);
CheckSetting(iniFile, gameID, "HideISOFiles", &flags_.HideISOFiles);
CheckSetting(iniFile, gameID, "MoreAccurateVMMUL", &flags_.MoreAccurateVMMUL);

View File

@ -65,6 +65,7 @@ struct CompatFlags {
bool YugiohSaveFix;
bool ForceUMDDelay;
bool ForceMax60FPS;
bool Fixed60FPShack;
bool JitInvalidationHack;
bool HideISOFiles;
bool MoreAccurateVMMUL;

View File

@ -25,6 +25,7 @@
#include "Common/Log.h"
#include "Common/Swap.h"
#include "Core/Config.h"
#include "Core/System.h"
#include "Core/Debugger/Breakpoints.h"
#include "Core/Debugger/MemBlockInfo.h"
#include "Core/Debugger/SymbolMap.h"
@ -34,6 +35,7 @@
#include "Core/MIPS/MIPSAnalyst.h"
#include "Core/HLE/ReplaceTables.h"
#include "Core/HLE/FunctionWrappers.h"
#include "Core/HLE/sceDisplay.h"
#include "GPU/Math3D.h"
#include "GPU/GPU.h"
@ -1338,6 +1340,13 @@ static int Hook_soltrigger_render_ucschar() {
return 0;
}
static int Hook_gow_fps_hack() {
if (PSP_CoreParameter().compat.flags().Fixed60FPShack) {
__DisplayWaitForVblanks("vblank start waited", 1);
}
return 0;
}
#define JITFUNC(f) (&MIPSComp::MIPSFrontendInterface::f)
// Can either replace with C functions or functions emitted in Asm/ArmAsm.
@ -1454,6 +1463,7 @@ static const ReplacementTableEntry entries[] = {
{ "worms_copy_normalize_alpha", &Hook_worms_copy_normalize_alpha, 0, REPFLAG_HOOKENTER, 0x0CC },
{ "openseason_data_decode", &Hook_openseason_data_decode, 0, REPFLAG_HOOKENTER, 0x2F0 },
{ "soltrigger_render_ucschar", &Hook_soltrigger_render_ucschar, 0, REPFLAG_HOOKENTER, 0 },
{ "gow_fps_hack", &Hook_gow_fps_hack, 0, REPFLAG_HOOKEXIT , 0 },
{}
};

View File

@ -730,6 +730,10 @@ static int DisplayWaitForVblanks(const char *reason, int vblanks, bool callbacks
return hleLogSuccessVerboseI(SCEDISPLAY, 0, "waiting for %d vblanks", vblanks);
}
void __DisplayWaitForVblanks(const char* reason, int vblanks, bool callbacks) {
DisplayWaitForVblanks(reason, vblanks, callbacks);
}
static u32 sceDisplaySetMode(int displayMode, int displayWidth, int displayHeight) {
if (displayMode != PSP_DISPLAY_MODE_LCD || displayWidth != 480 || displayHeight != 272) {
WARN_LOG_REPORT(SCEDISPLAY, "Video out requested, not supported: mode=%d size=%d,%d", displayMode, displayWidth, displayHeight);

View File

@ -33,3 +33,4 @@ void __DisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync);
void __DisplaySetWasPaused();
void Register_sceDisplay_driver();
void __DisplayWaitForVblanks(const char* reason, int vblanks, bool callbacks = false);

View File

@ -507,6 +507,7 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0xfe5dd338ab862291, 216, "memset", }, // Metal Gear Solid: Peace Walker demo
{ 0xffc8f5f8f946152c, 192, "dl_write_light_color", },
{ 0x249a3c5981c73480, 1472, "openseason_data_decode", }, // Open Season
{ 0x795d940ad0a605f8, 40, "gow_fps_hack", }, // God of War (all)
};
namespace MIPSAnalyst {

View File

@ -802,11 +802,9 @@ ULJS00119 = true
ULKS46167 = true
NPJH50017 = true
[ForceMax60FPS]
# The GOW games are very heavy and render as fast as they can. They benefit greatly from
# capping the framerate at 60fps.
# Unfortunately causes softlock in GOW:GOS , see #8299
[Fixed60FPShack]
# Replaces ForceMax60FPS for GOW games, should provide smoother experience
# Unfortunately just like the latter still causes softlock in GOW:GOS , see #8299
# GOW : Ghost of Sparta
# UCUS98737 = true
# UCAS40323 = true
@ -840,6 +838,10 @@ UCUS98705 = true
UCED00971 = true
UCUS98713 = true
[ForceMax60FPS]
# Some games are very heavy and render as fast as they can. They benefit greatly from
# capping the framerate at 60fps.
# F1 2006 has extremely long loading times if we don't limit the framerate.
UCES00238 = true
UCJS10045 = true