diff --git a/pcsx2/Misc.h b/pcsx2/Misc.h index 325f6bb69b..aaa2defcb3 100644 --- a/pcsx2/Misc.h +++ b/pcsx2/Misc.h @@ -90,6 +90,7 @@ extern SessionOverrideFlags g_Session; //------------ SPECIAL GAME FIXES!!! --------------- #define CHECK_VUADDSUBHACK (Config.GameFixes & 0x1) // Special Fix for Tri-ace games, they use an encryption algorithm that requires VU addi opcode to be bit-accurate. #define CHECK_FPUCOMPAREHACK (Config.GameFixes & 0x4) // Special Fix for Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu. +#define CHECK_VUCLIPFLAGHACK (Config.GameFixes & 0x2) // Special Fix for God of War, fixes SPS. //------------ Advanced Options!!! --------------- #define CHECK_VU_OVERFLOW (Config.vuOptions & 0x1) #define CHECK_VU_EXTRA_OVERFLOW (Config.vuOptions & 0x2) // If enabled, Operands are clamped before being used in the VU recs diff --git a/pcsx2/VUops.cpp b/pcsx2/VUops.cpp index cb0e3a3161..9114776b26 100644 --- a/pcsx2/VUops.cpp +++ b/pcsx2/VUops.cpp @@ -2224,7 +2224,7 @@ void _vuRegs##OP(VURegs * VU, _VURegsNum *VUregsn) { \ VUregsn->cycles = 0; \ } -#define VUREGS_PFS(OP, _cycles) \ +#define VUREGS_PFS_xyzw(OP, _cycles) \ void _vuRegs##OP(VURegs * VU, _VURegsNum *VUregsn) { \ VUregsn->pipe = VUPIPE_EFU; \ VUregsn->VFwrite = 0; \ @@ -2236,6 +2236,18 @@ void _vuRegs##OP(VURegs * VU, _VURegsNum *VUregsn) { \ VUregsn->cycles = _cycles; \ } +#define VUREGS_PFS_fsf(OP, _cycles) \ +void _vuRegs##OP(VURegs * VU, _VURegsNum *VUregsn) { \ + VUregsn->pipe = VUPIPE_EFU; \ + VUregsn->VFwrite = 0; \ + VUregsn->VFread0 = _Fs_; \ + VUregsn->VFr0xyzw= 1 << (3-_Fsf_); \ + VUregsn->VFread1 = 0; \ + VUregsn->VIwrite = 1 << REG_P; \ + VUregsn->VIread = GET_VF0_FLAG(_Fs_); \ + VUregsn->cycles = _cycles; \ +} + VUREGS_FTFS(ABS); @@ -2891,19 +2903,19 @@ void _vuRegsWAITP(VURegs * VU, _VURegsNum *VUregsn) { VUregsn->VIread = 0; } -VUREGS_PFS(ESADD, 10); -VUREGS_PFS(ERSADD, 17); -VUREGS_PFS(ELENG, 17); -VUREGS_PFS(ERLENG, 23); -VUREGS_PFS(EATANxy, 53); -VUREGS_PFS(EATANxz, 53); -VUREGS_PFS(ESUM, 11); -VUREGS_PFS(ERCPR, 11); -VUREGS_PFS(ESQRT, 11); -VUREGS_PFS(ERSQRT, 17); -VUREGS_PFS(ESIN, 28); -VUREGS_PFS(EATAN, 53); -VUREGS_PFS(EEXP, 43); +VUREGS_PFS_xyzw(ESADD, 10); +VUREGS_PFS_xyzw(ERSADD, 17); +VUREGS_PFS_xyzw(ELENG, 17); +VUREGS_PFS_xyzw(ERLENG, 23); +VUREGS_PFS_xyzw(EATANxy, 53); +VUREGS_PFS_xyzw(EATANxz, 53); +VUREGS_PFS_xyzw(ESUM, 11); +VUREGS_PFS_fsf(ERCPR, 11); +VUREGS_PFS_fsf(ESQRT, 11); +VUREGS_PFS_fsf(ERSQRT, 17); +VUREGS_PFS_fsf(ESIN, 28); +VUREGS_PFS_fsf(EATAN, 53); +VUREGS_PFS_fsf(EEXP, 43); void _vuRegsXITOP(VURegs * VU, _VURegsNum *VUregsn) { VUregsn->pipe = VUPIPE_IALU; diff --git a/pcsx2/windows/WinMain.cpp b/pcsx2/windows/WinMain.cpp index 7d64b6de3f..20714bf3ed 100644 --- a/pcsx2/windows/WinMain.cpp +++ b/pcsx2/windows/WinMain.cpp @@ -539,6 +539,7 @@ BOOL APIENTRY GameFixes(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: if(Config.GameFixes & 0x1) CheckDlgButton(hDlg, IDC_GAMEFIX2, TRUE);//Tri-Ace fix if(Config.GameFixes & 0x4) CheckDlgButton(hDlg, IDC_GAMEFIX3, TRUE);//Digimon FPU compare fix + if(Config.GameFixes & 0x2) CheckDlgButton(hDlg, IDC_GAMEFIX4, TRUE);//GoW fix return TRUE; case WM_COMMAND: @@ -547,6 +548,7 @@ BOOL APIENTRY GameFixes(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) uint newfixes = 0; newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX2) ? 0x1 : 0; newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX3) ? 0x4 : 0; + newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX4) ? 0x2 : 0; EndDialog(hDlg, TRUE); diff --git a/pcsx2/windows/pcsx2.rc b/pcsx2/windows/pcsx2.rc index 5acaed1080..2fcc599feb 100644 --- a/pcsx2/windows/pcsx2.rc +++ b/pcsx2/windows/pcsx2.rc @@ -84,9 +84,11 @@ BEGIN CTEXT "Some games need special settings.\nConfigure them here.",IDC_STATIC,7,7,264,17 GROUPBOX "PCSX2 Gamefixes",IDC_STATIC,7,31,264,89 CONTROL "FPU Compare Hack - Special fix for Digimon Rumble Arena 2.",IDC_GAMEFIX3, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,51,249,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,47,249,10 CONTROL "VU Add / Sub Hack - Special fix for Tri-Ace games!",IDC_GAMEFIX2, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,65,252,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,61,252,10 + CONTROL "VU Clip Hack - Special fix for God of War",IDC_GAMEFIX4, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,75,144,10 END diff --git a/pcsx2/x86/iVUmicro.cpp b/pcsx2/x86/iVUmicro.cpp index 7a8dc12597..34b0450912 100644 --- a/pcsx2/x86/iVUmicro.cpp +++ b/pcsx2/x86/iVUmicro.cpp @@ -405,12 +405,12 @@ void _recvuFlushEFU(VURegs * VU) { } void _recvuTestFDIVStalls(VURegs * VU, _VURegsNum *VUregsn) { -// _vuTestFMACStalls(VURegs * VU, _VURegsNum *VUregsn); + _recvuTestFMACStalls(VU,VUregsn, false); _recvuFlushFDIV(VU); } void _recvuTestEFUStalls(VURegs * VU, _VURegsNum *VUregsn) { -// _vuTestFMACStalls(VURegs * VU, _VURegsNum *VUregsn); + _recvuTestFMACStalls(VU,VUregsn, false); _recvuFlushEFU(VU); } diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 6e7bce2e8e..1ea2e87c1b 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -3009,7 +3009,7 @@ void VuInstruction::Recompile(list::iterator& itinst, u32 vuxyz) if( type & INST_CLIP_WRITE ) { if( nParentPc < s_pCurBlock->startpc || nParentPc >= (int)pc ) { - if( pparentinst != NULL ) { + if( !CHECK_VUCLIPFLAGHACK && pparentinst != NULL ) { if( pparentinst->pClipWrite == 0 ) { pparentinst->pClipWrite = (uptr)SuperVUStaticAlloc(4);