From c60092671085154d020e053599208f25325e75d6 Mon Sep 17 00:00:00 2001 From: "sl1nk3.s" Date: Tue, 20 Oct 2009 23:09:44 +0000 Subject: [PATCH] Trying a fix to floating point single (issue 1556), Sonic Unleashed now have correct projections, also re-enabled color buffer clear on OpenGL plugin (was causing flickering in fullscreen and garbage on sides...) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4441 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../PowerPC/Interpreter/Interpreter_FPUtils.h | 7 ++- Source/Core/Core/Src/State.cpp | 15 +++-- .../Core/DebuggerWX/Src/BreakpointWindow.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 61 ------------------- 4 files changed, 13 insertions(+), 72 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FPUtils.h b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FPUtils.h index 62189d8528..2892006211 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FPUtils.h +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FPUtils.h @@ -87,8 +87,11 @@ inline double ForceSingle(double _x) // PanicAlert("RN = %d at %x", (int)FPSCR.RN, PC); if (FPSCR.NI) _x = FlushToZeroAsFloat(_x); - double x = static_cast(_x); - return x; + IntDouble single; + single.d = _x; + memset(&single.i, 0, 4); + + return single.d; } inline double ForceDouble(double d) diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index 13bd4a90ad..2190a90a1f 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -39,7 +39,6 @@ // TODO: Investigate a memory leak on save/load state - #if defined(__LZO_STRICT_16BIT) #define IN_LEN (8*1024u) #elif defined(LZO_ARCH_I086) && !defined(LZO_HAVE_MM_HUGE_ARRAY) @@ -71,18 +70,18 @@ static bool const bCompressed = true; static Common::Thread *saveThread = NULL; -enum -{ - version = 1, -}; + +// Don't forget to increase this after doing changes on the savestate system +#define STATE_VERSION 1 + void DoState(PointerWrap &p) { - u32 cookie = 0xBAADBABE + version; + u32 cookie = 0xBAADBABE + STATE_VERSION; p.Do(cookie); - if (cookie != 0xBAADBABE + version) + if (cookie != 0xBAADBABE + STATE_VERSION) { - PanicAlert("Can't load states from other versions."); + PanicAlert("Savestate version mismatch !\nSorry, you can't load states from others revisions."); return; } // Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM diff --git a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp index b6db6c54bd..f06ddfcde3 100644 --- a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp +++ b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp @@ -163,7 +163,7 @@ void CBreakPointWindow::OnAddBreakPointMany() } else { - wxMessageBox(_T("You have no GameIni/BreakPoints.ini file")); + wxMessageBox(_T("Couldn't find User/GameConfig/BreakPoints.ini file")); } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 5f04fd9449..16c49cfaaa 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -175,67 +175,6 @@ void HandleCgError(CGcontext ctx, CGerror err, void* appdata) void VideoConfig::UpdateProjectionHack() { ::UpdateProjectionHack(g_Config.iPhackvalue); - //switch(g_Config.iPhackvalue) - //{ - //case OGL_HACK_NONE: - // g_Config.bProjHack1 = 0; - // g_Config.bPhackvalue1 = 0; - // g_Config.bPhackvalue2 = 0; - // break; - //case OGL_HACK_ZELDA_TP_BLOOM_HACK: - // g_Config.bPhackvalue1 = 1; - // g_Config.bProjHack1 = 1; - // break; - //case OGL_HACK_SONIC_AND_THE_BLACK_KNIGHT: - // g_Config.bPhackvalue1 = 1; - // g_Config.fhackvalue1 = 0.00002f; - // g_Config.bPhackvalue2 = 1; - // g_Config.fhackvalue2 = 1.999980f; - // break; - //case OGL_HACK_BLEACH_VERSUS_CRUSADE: - // g_Config.bPhackvalue2 = 1; - // g_Config.fhackvalue2 = 0.5f; - // g_Config.bPhackvalue1 = 0; - // g_Config.bProjHack1 = 0; - // break; - //case OGL_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME: - // g_Config.bPhackvalue1 = 1; - // g_Config.fhackvalue1 = 0.8f; - // g_Config.bPhackvalue2 = 1; - // g_Config.fhackvalue2 = 1.2f; - // g_Config.bProjHack1 = 0; - // break; - //case OGL_HACK_HARVESTMOON_MM: - // g_Config.bPhackvalue1 = 1; - // g_Config.fhackvalue1 = 0.0075f; - // g_Config.bPhackvalue2 = 0; - // g_Config.bProjHack1 = 0; - //case OGL_HACK_BATEN_KAITOS: - // g_Config.bPhackvalue1 = 1; - // g_Config.fhackvalue1 = 0.0026f; - // g_Config.bPhackvalue2 = 1; - // g_Config.fhackvalue2 = 1.9974f; - // g_Config.bProjHack1 = 1; - // break; - //case OGL_HACK_BATEN_KAITOS_ORIGIN: - // g_Config.bPhackvalue1 = 1; - // g_Config.fhackvalue1 = 0.0012f; - // g_Config.bPhackvalue2 = 1; - // g_Config.fhackvalue2 = 1.9988f; - // g_Config.bProjHack1 = 1; - // break; - //case OGL_HACK_SKIES_OF_ARCADIA: - // g_Config.bPhackvalue1 = 1; - // g_Config.fhackvalue1 = 0.04f; - // g_Config.bPhackvalue2 = 0; - // g_Config.bProjHack1 = 0; - // break; - //} - - //// Set the projections hacks - //Projection_SetHack0(g_Config.bProjHack1); - //Projection_SetHack1(ProjectionHack(g_Config.bPhackvalue1 == 0 ? false : true, g_Config.fhackvalue1)); - //Projection_SetHack2(ProjectionHack(g_Config.bPhackvalue2 == 0 ? false : true, g_Config.fhackvalue2)); }