From fbd1268e644880ed8d499447f7b38536927077f6 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Mon, 5 Oct 2009 06:25:56 +0000 Subject: [PATCH] Added a gamefix that should fix the messed up camera views in Gundam games like "Mobile Suit Gundam Seed Destiny: Rengou vs. ZAFT II Plus" and the other ones that had this problem. No need to set roundmode to nearest anymore, just use the gamefix. also i think i also have to add this fix to iFPUD.cpp stuff, i'll do it tomorrow. btw, this fix is untested because i don't have the time today to test it w/o working saved states. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1961 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Config.h | 4 +++- pcsx2/Pcsx2Config.cpp | 1 + pcsx2/gui/Panels/GameFixesPanel.cpp | 4 ++++ pcsx2/x86/iFPU.cpp | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 39704bf8ac..1d11bc7e15 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -212,6 +212,7 @@ public: VuClipFlagHack:1, // Fix for Persona games, maybe others. It's to do with the VU clip flag (again). FpuCompareHack:1, // Fix for Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu. FpuMulHack:1, // Fix for Tales of Destiny hangs. + FpuNegDivHack:1, // Fix for Gundam games messed up camera-view. DMAExeHack:1, // Fix for Fatal Frame; breaks Gust and Tri-Ace games. XgKickHack:1, // Fix for Erementar Gerad, adds more delay to VU XGkick instructions. Corrects the color of some graphics, but breaks Tri-ace games and others. MpegHack:1; // Fix for Mana Khemia 1, breaks Digital Devil Saga. @@ -348,12 +349,13 @@ extern SessionOverrideFlags g_Session; #define CHECK_VU1REC (!g_Session.ForceDisableVU1rec && EmuConfig.Cpu.Recompiler.EnableVU1) //------------ SPECIAL GAME FIXES!!! --------------- -#define NUM_OF_GAME_FIXES 7 +#define NUM_OF_GAME_FIXES 8 #define CHECK_VUADDSUBHACK (EmuConfig.Gamefixes.VuAddSubHack) // Special Fix for Tri-ace games, they use an encryption algorithm that requires VU addi opcode to be bit-accurate. #define CHECK_FPUCOMPAREHACK (EmuConfig.Gamefixes.FpuCompareHack) // Special Fix for Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu. #define CHECK_VUCLIPFLAGHACK (EmuConfig.Gamefixes.VuClipFlagHack) // Special Fix for Persona games, maybe others. It's to do with the VU clip flag (again). #define CHECK_FPUMULHACK (EmuConfig.Gamefixes.FpuMulHack) // Special Fix for Tales of Destiny hangs. +#define CHECK_FPUNEGDIVHACK (EmuConfig.Gamefixes.FpuNegDivHack) // Special Fix for Gundam games messed up camera-view. #define CHECK_DMAEXECHACK (EmuConfig.Gamefixes.DMAExeHack) // Special Fix for Fatal Frame; breaks Gust and Tri-Ace games. #define CHECK_XGKICKHACK (EmuConfig.Gamefixes.XgKickHack) // Special Fix for Erementar Gerad, adds more delay to VU XGkick instructions. Corrects the color of some graphics. #define CHECK_MPEGHACK (EmuConfig.Gamefixes.MpegHack) // Special Fix for Mana Khemia 1; breaks Digital Devil Saga. diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index c65972bb70..b29286619d 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -136,6 +136,7 @@ void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini ) IniBitBool( VuClipFlagHack ); IniBitBool( FpuCompareHack ); IniBitBool( FpuMulHack ); + IniBitBool( FpuNegDivHack ); IniBitBool( DMAExeHack ); IniBitBool( XgKickHack ); IniBitBool( MpegHack ); diff --git a/pcsx2/gui/Panels/GameFixesPanel.cpp b/pcsx2/gui/Panels/GameFixesPanel.cpp index 9964eb5512..f831c9b0c6 100644 --- a/pcsx2/gui/Panels/GameFixesPanel.cpp +++ b/pcsx2/gui/Panels/GameFixesPanel.cpp @@ -52,6 +52,10 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow& parent, int idealWidth ) : _("FPU Multiply Hack - for Tales of Destiny."), wxEmptyString }, + { + _("FPU Negative Div Hack - for Gundam games."), + wxEmptyString + }, { _("DMA Execution Hack - for Fatal Frame."), wxEmptyString diff --git a/pcsx2/x86/iFPU.cpp b/pcsx2/x86/iFPU.cpp index 445a4f1dd2..9432f67e2d 100644 --- a/pcsx2/x86/iFPU.cpp +++ b/pcsx2/x86/iFPU.cpp @@ -1111,8 +1111,9 @@ void recDIV_S_xmm(int info) if ((g_sseMXCSR & 0x00006000) != 0x00000000) { // Set roundmode to nearest if it isn't already //Console.WriteLn("div to nearest"); - roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF); // Set new roundmode + roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF); // Set new roundmode to nearest roundmode_temp[1] = g_sseMXCSR; // Backup old Roundmode + if (CHECK_FPUNEGDIVHACK) roundmode_temp[0] |= 0x2000; // Negative Roundmode SSE_LDMXCSR ((uptr)&roundmode_temp[0]); // Recompile Roundmode Change roundmodeFlag = 1; }