diff --git a/pcsx2/Config.h b/pcsx2/Config.h index cc83918e92..b7feabfc61 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -50,6 +50,7 @@ enum GamefixId Fix_IpuWait, Fix_EETiming, Fix_SkipMpeg, + Fix_OPHFlag, GamefixId_COUNT }; @@ -457,7 +458,8 @@ struct Pcsx2Config XgKickHack :1, // Erementar Gerad, adds more delay to VU XGkick instructions. Corrects the color of some graphics, but breaks Tri-ace games and others. IPUWaitHack :1, // FFX FMV, makes GIF flush before doing IPU work. Fixes bad graphics overlay. EETimingHack :1, // General purpose timing hack. - SkipMPEGHack :1; // Skips MPEG videos (Katamari and other games need this) + SkipMPEGHack :1, // Skips MPEG videos (Katamari and other games need this) + OPHFlagHack :1; // Skips MPEG videos (Katamari and other games need this) BITFIELD_END // all gamefixes are disabled by default. @@ -603,6 +605,7 @@ TraceLogFilters& SetTraceConfig(); #define CHECK_IPUWAITHACK (EmuConfig.Gamefixes.IPUWaitHack) // Special Fix For FFX #define CHECK_EETIMINGHACK (EmuConfig.Gamefixes.EETimingHack) // Fix all scheduled events to happen in 1 cycle. #define CHECK_SKIPMPEGHACK (EmuConfig.Gamefixes.SkipMPEGHack) // Finds sceMpegIsEnd pattern to tell the game the mpeg is finished (Katamari and a lot of games need this) +#define CHECK_OPHFLAGHACK (EmuConfig.Gamefixes.OPHFlagHack) //------------ Advanced Options!!! --------------- #define CHECK_VU_OVERFLOW (EmuConfig.Cpu.Recompiler.vuOverflow) diff --git a/pcsx2/HwRead.cpp b/pcsx2/HwRead.cpp index edeb7f3cf0..0997bbb413 100644 --- a/pcsx2/HwRead.cpp +++ b/pcsx2/HwRead.cpp @@ -380,14 +380,21 @@ mem32_t __fastcall hwRead32_generic(u32 mem) switch( masked_mem>>12 ) // switch out as according to the 4k page of the access. { + case 0x03: + if(masked_mem >= 0x3800) HW_LOG("VIF%x Register Read32 at 0x%x, value=0x%x", (masked_mem < 0x3c00) ? 0 : 1, mem, psHu32(mem) ); + else HW_LOG("GIF Register Read32 at 0x%x, value=0x%x", mem, psHu32(mem) ); + + // Fixme: OPH hack. Toggle the flag on each GIF_STAT access. (rama) + if (CHECK_OPHFLAGHACK) + { + if (masked_mem == 0x3020) + gifRegs->stat.OPH = !gifRegs->stat.OPH; + } + break; /////////////////////////////////////////////////////// // Most of the following case handlers are for developer builds only (logging). // It'll all optimize to ziltch in public release builds. #ifdef PCSX2_DEVBUILD - case 0x03: - if(masked_mem >= 0x3800) HW_LOG("VIF%x Register Read32 at 0x%x, value=0x%x", (masked_mem < 0x3c00) ? 0 : 1, mem, psHu32(mem) ); - else HW_LOG("GIF Register Read32 at 0x%x, value=0x%x", mem, psHu32(mem) ); - break; case 0x04: case 0x05: case 0x06: diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index a1aa88f307..5ad3a55358 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -262,7 +262,8 @@ const wxChar *const tbl_GamefixNames[] = L"XGKick", L"IpuWait", L"EETiming", - L"SkipMpeg" + L"SkipMpeg", + L"OPHFlag" }; const __forceinline wxChar* EnumToString( GamefixId id ) @@ -306,6 +307,7 @@ void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled ) case Fix_IpuWait: IPUWaitHack = enabled; break; case Fix_EETiming: EETimingHack = enabled; break; case Fix_SkipMpeg: SkipMPEGHack = enabled; break; + case Fix_OPHFlag: OPHFlagHack = enabled; break; jNO_DEFAULT; } @@ -325,6 +327,7 @@ bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const case Fix_IpuWait: return IPUWaitHack; case Fix_EETiming: return EETimingHack; case Fix_SkipMpeg: return SkipMPEGHack; + case Fix_OPHFlag: return OPHFlagHack; jNO_DEFAULT } @@ -345,6 +348,7 @@ void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini ) IniBitBool( IPUWaitHack ); IniBitBool( EETimingHack ); IniBitBool( SkipMPEGHack ); + IniBitBool( OPHFlagHack ); } Pcsx2Config::Pcsx2Config() diff --git a/pcsx2/gui/Panels/GameFixesPanel.cpp b/pcsx2/gui/Panels/GameFixesPanel.cpp index 65edd85570..8b6d10005c 100644 --- a/pcsx2/gui/Panels/GameFixesPanel.cpp +++ b/pcsx2/gui/Panels/GameFixesPanel.cpp @@ -74,6 +74,15 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow* parent ) { _("Skip MPEG hack - Skips videos/FMVs in games to avoid game hanging/freezes."), wxEmptyString + }, + { + _("OPH Flag hack - Try if your game freezes showing the same frame."), + pxE( ".Tooltip:Gamefixes:OPH Flag hack", + L"Known to affect following games:\n" + L" * Bleach Blade Battler\n" + L" * Growlanser II and III\n" + L" * Wizardry" + ) } };