Skip to content

Commit

Permalink
Disable ForceMax60FPS for GOW games and replace it with fixed 60 fps …
Browse files Browse the repository at this point in the history
…hack.
  • Loading branch information
LunaMoo committed Jul 1, 2022
1 parent 4196928 commit f48c939
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
6 changes: 6 additions & 0 deletions Core/HLE/ReplaceTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "Core/MIPS/MIPSAnalyst.h"
#include "Core/HLE/ReplaceTables.h"
#include "Core/HLE/FunctionWrappers.h"
#include "Core/HLE/sceDisplay.cpp"

#include "GPU/Math3D.h"
#include "GPU/GPU.h"
Expand Down Expand Up @@ -1338,6 +1339,10 @@ static int Hook_soltrigger_render_ucschar() {
return 0;
}

static int Hook_gow_fps_hack() {
return DisplayWaitForVblanks("vblank start waited", 1); // Change to 2 for 30 FPS hack
}

#define JITFUNC(f) (&MIPSComp::MIPSFrontendInterface::f)

// Can either replace with C functions or functions emitted in Asm/ArmAsm.
Expand Down Expand Up @@ -1454,6 +1459,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 },
{}
};

Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/MIPSAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
57 changes: 29 additions & 28 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -805,39 +805,40 @@ 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.
# Replaced by gow_fps_hack to avoid bugging the game, see #8299

# GOW : Ghost of Sparta
UCUS98737 = true
UCAS40323 = true
NPHG00092 = true
NPEG00044 = true
NPEG00045 = true
NPJG00120 = true
NPUG80508 = true
UCJS10114 = true
UCES01401 = true
UCES01473 = true
# UCUS98737 = true
# UCAS40323 = true
# NPHG00092 = true
# NPEG00044 = true
# NPEG00045 = true
# NPJG00120 = true
# NPUG80508 = true
# UCJS10114 = true
# UCES01401 = true
# UCES01473 = true
# GOW : Ghost of Sparta Demo
NPEG90035 = true
NPUG70125 = true
NPJG90095 = true
# NPEG90035 = true
# NPUG70125 = true
# NPJG90095 = true
# GOW : Chains Of Olympus
UCAS40198 = true
UCUS98653 = true
UCES00842 = true
ULJM05438 = true
ULJM05348 = true
UCKS45084 = true
NPUG80325 = true
NPEG00023 = true
NPHG00027 = true
NPHG00028 = true
NPJH50170 = true
UCET00844 = true
# UCAS40198 = true
# UCUS98653 = true
# UCES00842 = true
# ULJM05438 = true
# ULJM05348 = true
# UCKS45084 = true
# NPUG80325 = true
# NPEG00023 = true
# NPHG00027 = true
# NPHG00028 = true
# NPJH50170 = true
# UCET00844 = true
# GOW: Chains of Olympus Demo
UCUS98705 = true
UCED00971 = true
UCUS98713 = true
# UCUS98705 = true
# UCED00971 = true
# UCUS98713 = true

# F1 2006 has extremely long loading times if we don't limit the framerate.
UCES00238 = true
Expand Down

0 comments on commit f48c939

Please sign in to comment.