Skip to content

Commit

Permalink
Merge pull request #15687 from LunaMoo/Zettai
Browse files Browse the repository at this point in the history
Add Zettai Zetsumei Toshi 3 bypass for softlock
  • Loading branch information
hrydgard committed Jul 15, 2022
2 parents b98fff3 + 4b959c6 commit e4128cb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "BlueToAlpha", &flags_.BlueToAlpha);
CheckSetting(iniFile, gameID, "CenteredLines", &flags_.CenteredLines);
CheckSetting(iniFile, gameID, "MaliDepthStencilBugWorkaround", &flags_.MaliDepthStencilBugWorkaround);
CheckSetting(iniFile, gameID, "ZZT3SelectHack", &flags_.ZZT3SelectHack);
}

void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct CompatFlags {
bool BlueToAlpha;
bool CenteredLines;
bool MaliDepthStencilBugWorkaround;
bool ZZT3SelectHack;
};

class IniFile;
Expand Down
10 changes: 10 additions & 0 deletions Core/HLE/ReplaceTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,15 @@ static int Hook_gow_vortex_hack() {
return 0;
}

static int Hook_ZZT3_select_hack() {
if (PSP_CoreParameter().compat.flags().ZZT3SelectHack) {
if (currentMIPS->r[MIPS_REG_V0] == 0) {
currentMIPS->r[MIPS_REG_V0] = 1;
}
}
return 0;
}

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

// Can either replace with C functions or functions emitted in Asm/ArmAsm.
Expand Down Expand Up @@ -1479,6 +1488,7 @@ static const ReplacementTableEntry entries[] = {
{ "soltrigger_render_ucschar", &Hook_soltrigger_render_ucschar, 0, REPFLAG_HOOKENTER, 0 },
{ "gow_fps_hack", &Hook_gow_fps_hack, 0, REPFLAG_HOOKEXIT , 0 },
{ "gow_vortex_hack", &Hook_gow_vortex_hack, 0, REPFLAG_HOOKENTER, 0x60 },
{ "ZZT3_select_hack", &Hook_ZZT3_select_hack, 0, REPFLAG_HOOKENTER, 0xC4 },
{}
};

Expand Down
3 changes: 2 additions & 1 deletion Core/MIPS/MIPSAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0xffc8f5f8f946152c, 192, "dl_write_light_color", },
{ 0x249a3c5981c73480, 1472, "openseason_data_decode", }, // Open Season
{ 0x795d940ad0a605f8, 40, "gow_fps_hack", }, // God of War (all)
{ 0x4c75043b7b0c643b, 512, "gow_vortex_hack", } // God of War: Ghost of Sparta vortex timer hack, avoids softlock #8299
{ 0x4c75043b7b0c643b, 512, "gow_vortex_hack", }, // God of War: Ghost of Sparta vortex timer hack, avoids softlock #8299
{ 0x7624dde603717640, 288, "ZZT3_select_hack", }, // Zettai Zetsumei Toshi 3 - bypasses softlock on character select screen #4901
};

namespace MIPSAnalyst {
Expand Down
11 changes: 11 additions & 0 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1228,3 +1228,14 @@ UCES01011 = true
UCAS40197 = true
NPEG00006 = true
NPUG80135 = true

[ZZT3SelectHack]
# Bypass softlock on Zettai Zetsumei Toshi 3 character select screen #4901
# This problem affects the game also on PS3
ULJS00191 = true
UCAS40252 = true
UCKS45119 = true
NPJH50907 = true
UCAS40328 = true
ULJS19050 = true
NPJH50907 = true

0 comments on commit e4128cb

Please sign in to comment.