From f6a7c335597d01c65b46fa5c5f701fa1247946b0 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sun, 26 Sep 2010 19:51:54 +0000 Subject: [PATCH] Bugfix for rounding/clamping mode patches not being applied (and possibly some other obscure cpu settings bugs as well). Cause: there were accidentally 2 instances of 'Recompiler' in the Pcsx2 emulator settings structure. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3843 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Config.h | 2 +- pcsx2/System/SysCoreThread.cpp | 3 +-- pcsx2/gui/AppCoreThread.cpp | 12 ++++++------ pcsx2/gui/AppInit.cpp | 22 ++++++++++++---------- pcsx2/x86/ix86-32/iR5900-32.cpp | 4 ++-- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 32d2188532..ec765c2f0c 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -240,7 +240,7 @@ struct Pcsx2Config return !OpEqu( bitset ); } - } Recompiler; + }; // ------------------------------------------------------------------------ struct CpuOptions diff --git a/pcsx2/System/SysCoreThread.cpp b/pcsx2/System/SysCoreThread.cpp index aa933601e0..1238275900 100644 --- a/pcsx2/System/SysCoreThread.cpp +++ b/pcsx2/System/SysCoreThread.cpp @@ -128,8 +128,7 @@ void SysCoreThread::ApplySettings( const Pcsx2Config& src ) if( !pxAssertDev( IsPaused(), "CoreThread is not paused; settings cannot be applied." ) ) return; - m_resetRecompilers = ( src.Cpu != EmuConfig.Cpu ) || ( src.Recompiler != EmuConfig.Recompiler ) || - ( src.Gamefixes != EmuConfig.Gamefixes ) || ( src.Speedhacks != EmuConfig.Speedhacks ); + m_resetRecompilers = ( src.Cpu != EmuConfig.Cpu ) || ( src.Gamefixes != EmuConfig.Gamefixes ) || ( src.Speedhacks != EmuConfig.Speedhacks ); m_resetProfilers = ( src.Profiler != EmuConfig.Profiler ); m_resetVsyncTimers = ( src.GS != EmuConfig.GS ); diff --git a/pcsx2/gui/AppCoreThread.cpp b/pcsx2/gui/AppCoreThread.cpp index 0bc992126b..bb0e9f7bbf 100644 --- a/pcsx2/gui/AppCoreThread.cpp +++ b/pcsx2/gui/AppCoreThread.cpp @@ -221,18 +221,18 @@ static int loadGameSettings(Pcsx2Config& dest, const Game_Data& game, bool verbo if (game.keyExists("eeClampMode")) { int clampMode = game.getInt("eeClampMode"); if(verbose) Console.WriteLn("(GameDB) Changing EE/FPU clamp mode [mode=%d]", clampMode); - dest.Recompiler.fpuOverflow = (clampMode >= 1); - dest.Recompiler.fpuExtraOverflow = (clampMode >= 2); - dest.Recompiler.fpuFullMode = (clampMode >= 3); + dest.Cpu.Recompiler.fpuOverflow = (clampMode >= 1); + dest.Cpu.Recompiler.fpuExtraOverflow = (clampMode >= 2); + dest.Cpu.Recompiler.fpuFullMode = (clampMode >= 3); gf++; } if (game.keyExists("vuClampMode")) { int clampMode = game.getInt("vuClampMode"); if(verbose) Console.WriteLn("(GameDB) Changing VU0/VU1 clamp mode [mode=%d]", clampMode); - dest.Recompiler.vuOverflow = (clampMode >= 1); - dest.Recompiler.vuExtraOverflow = (clampMode >= 2); - dest.Recompiler.vuSignOverflow = (clampMode >= 3); + dest.Cpu.Recompiler.vuOverflow = (clampMode >= 1); + dest.Cpu.Recompiler.vuExtraOverflow = (clampMode >= 2); + dest.Cpu.Recompiler.vuSignOverflow = (clampMode >= 3); gf++; } diff --git a/pcsx2/gui/AppInit.cpp b/pcsx2/gui/AppInit.cpp index cfda51321b..e064df29cf 100644 --- a/pcsx2/gui/AppInit.cpp +++ b/pcsx2/gui/AppInit.cpp @@ -280,44 +280,46 @@ void Pcsx2App::AllocateCoreStuffs() exconf += 6; exconf += scrollableTextArea | pxExpand.Border(wxALL, 16); + Pcsx2Config::RecompilerOptions& recOps = g_Conf->EmuOptions.Cpu.Recompiler; + if( BaseException* ex = m_CpuProviders->GetException_EE() ) { scrollableTextArea->AppendText( L"* R5900 (EE)\n\t" + ex->FormatDiagnosticMessage() + L"\n\n" ); - g_Conf->EmuOptions.Recompiler.EnableEE = false; + recOps.EnableEE = false; } if( BaseException* ex = m_CpuProviders->GetException_IOP() ) { scrollableTextArea->AppendText( L"* R3000A (IOP)\n\t" + ex->FormatDiagnosticMessage() + L"\n\n" ); - g_Conf->EmuOptions.Recompiler.EnableIOP = false; + recOps.EnableIOP = false; } if( BaseException* ex = m_CpuProviders->GetException_MicroVU0() ) { scrollableTextArea->AppendText( L"* microVU0\n\t" + ex->FormatDiagnosticMessage() + L"\n\n" ); - g_Conf->EmuOptions.Recompiler.UseMicroVU0 = false; - g_Conf->EmuOptions.Recompiler.EnableVU0 = g_Conf->EmuOptions.Recompiler.EnableVU0 && m_CpuProviders->IsRecAvailable_SuperVU0(); + recOps.UseMicroVU0 = false; + recOps.EnableVU0 = recOps.EnableVU0 && m_CpuProviders->IsRecAvailable_SuperVU0(); } if( BaseException* ex = m_CpuProviders->GetException_MicroVU1() ) { scrollableTextArea->AppendText( L"* microVU1\n\t" + ex->FormatDiagnosticMessage() + L"\n\n" ); - g_Conf->EmuOptions.Recompiler.UseMicroVU1 = false; - g_Conf->EmuOptions.Recompiler.EnableVU1 = g_Conf->EmuOptions.Recompiler.EnableVU1 && m_CpuProviders->IsRecAvailable_SuperVU1(); + recOps.UseMicroVU1 = false; + recOps.EnableVU1 = recOps.EnableVU1 && m_CpuProviders->IsRecAvailable_SuperVU1(); } if( BaseException* ex = m_CpuProviders->GetException_SuperVU0() ) { scrollableTextArea->AppendText( L"* SuperVU0\n\t" + ex->FormatDiagnosticMessage() + L"\n\n" ); - g_Conf->EmuOptions.Recompiler.UseMicroVU0 = m_CpuProviders->IsRecAvailable_MicroVU0(); - g_Conf->EmuOptions.Recompiler.EnableVU0 = g_Conf->EmuOptions.Recompiler.EnableVU0 && g_Conf->EmuOptions.Recompiler.UseMicroVU0; + recOps.UseMicroVU0 = m_CpuProviders->IsRecAvailable_MicroVU0(); + recOps.EnableVU0 = recOps.EnableVU0 && recOps.UseMicroVU0; } if( BaseException* ex = m_CpuProviders->GetException_SuperVU1() ) { scrollableTextArea->AppendText( L"* SuperVU1\n\t" + ex->FormatDiagnosticMessage() + L"\n\n" ); - g_Conf->EmuOptions.Recompiler.UseMicroVU1 = m_CpuProviders->IsRecAvailable_MicroVU1(); - g_Conf->EmuOptions.Recompiler.EnableVU1 = g_Conf->EmuOptions.Recompiler.EnableVU1 && g_Conf->EmuOptions.Recompiler.UseMicroVU1; + recOps.UseMicroVU1 = m_CpuProviders->IsRecAvailable_MicroVU1(); + recOps.EnableVU1 = recOps.EnableVU1 && recOps.UseMicroVU1; } exconf += exconf.Heading( pxE(".Popup:RecompilerInit:Footer", diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 2a4521b51c..abeea05fe5 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -370,7 +370,7 @@ static void __fastcall StackFrameCheckFailed( int espORebp, int regval ) static void _DynGen_StackFrameCheck() { - if( !EmuConfig.Recompiler.StackFrameChecks ) return; + if( !EmuConfig.Cpu.Recompiler.StackFrameChecks ) return; // --------- EBP Here ----------- @@ -1400,7 +1400,7 @@ static void __fastcall recRecompile( const u32 startpc ) _initXMMregs(); _initMMXregs(); - if( EmuConfig.Recompiler.PreBlockCheckEE ) + if( EmuConfig.Cpu.Recompiler.PreBlockCheckEE ) { // per-block dump checks, for debugging purposes. // [TODO] : These must be enabled from the GUI or INI to be used, otherwise the