diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index cd263d0fee..73927c7265 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -77,7 +77,7 @@ void VertexShaderManager::Shutdown() // ======================================================================================= // Syncs the shader constant buffers with xfmem // ---------------- -void VertexShaderManager::SetConstants(bool Hack_hack1 ,float Hack_value1 ,bool Hack_hack2 ,float Hack_value2 ,bool freeLook) +void VertexShaderManager::SetConstants(bool proj_hax_1,bool Hack_hack1 ,float Hack_value1 ,bool Hack_hack2 ,float Hack_value2 ,bool freeLook) { //nTransformMatricesChanged[0] = 0; nTransformMatricesChanged[1] = 256; //nNormalMatricesChanged[0] = 0; nNormalMatricesChanged[1] = 96; @@ -262,7 +262,7 @@ void VertexShaderManager::SetConstants(bool Hack_hack1 ,float Hack_value1 ,bool g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[10] = (Hack_hack1 ? -(Hack_value1 + xfregs.rawProjection[4]) : xfregs.rawProjection[4]); - g_fProjectionMatrix[11] = (Hack_hack2 ? -(Hack_value2 + xfregs.rawProjection[5]) : xfregs.rawProjection[5]); + g_fProjectionMatrix[11] = (Hack_hack2 ? -(Hack_value2 + xfregs.rawProjection[5]) : xfregs.rawProjection[5]) + (proj_hax_1 ? 0.1f : 0.0f); g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.h b/Source/Core/VideoCommon/Src/VertexShaderManager.h index 2d01471a8d..b872fc9c5c 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.h +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.h @@ -28,7 +28,7 @@ public: static void Shutdown(); // constant management - static void SetConstants(bool Hack_hack1, float Hack_value1, bool Hack_hack2, float Hack_value2, bool freeLook); + static void SetConstants(bool proj_hax_1,bool Hack_hack1, float Hack_value1, bool Hack_hack2, float Hack_value2, bool freeLook); static void SetViewport(float* _Viewport); static void SetViewportChanged(); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp index ce34b2c4b9..961b8d8446 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp @@ -359,14 +359,9 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize) k=0; } - const u16 updpar = Memory_Read_U16(updaddr + k); const u16 upddata = Memory_Read_U16(updaddr + k + 2); - - - - // some safety checks, I hope it's enough if(updaddr > 0x80000000 && updaddr < 0x817fffff && updpar < 63 && updpar > 3 && upddata >= 0 // updpar > 3 because we don't want to change diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp index 77e1a62f6a..f974ccf604 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp @@ -235,7 +235,7 @@ void Flush() if (numVertices) { // set global constants - VertexShaderManager::SetConstants( false, 0, false, 0, false); + VertexShaderManager::SetConstants(false, false, 0, false, 0, false); PixelShaderManager::SetConstants(); PixelShaderCache::SetShader(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Config.h b/Source/Plugins/Plugin_VideoOGL/Src/Config.h index 045778c461..37ebb0a2e9 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Config.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Config.h @@ -99,6 +99,7 @@ struct Config int iPhackvalue; bool bPhackvalue1, bPhackvalue2; float fhackvalue1, fhackvalue2; + bool bProjHack1; int iLog; // CONF_ bits int iSaveTargetId; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp index 802937f7bf..606d4b0ef1 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp @@ -644,42 +644,48 @@ void ConfigDialog::UpdateGUI() void Config::UpdateHack() { switch(g_Config.iPhackvalue) - { - case OGL_HACK_NONE: - g_Config.bPhackvalue1 = false; - g_Config.bPhackvalue2 = false; + { + 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_SUPER_MARIO_GALAXY: + g_Config.bPhackvalue1 = 1; + g_Config.fhackvalue1 = 0.00006f; + g_Config.bPhackvalue2 = 0; + g_Config.bProjHack1 = 0; + break; + case OGL_HACK_MARIO_KART_WII: + g_Config.bPhackvalue1 = 1; + g_Config.fhackvalue1 = 0.00006f; + g_Config.bPhackvalue2 = 0; + g_Config.bProjHack1 = 0; + 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_ZELDA_TP_BLOOM_HACK: - g_Config.bPhackvalue1 = true; + 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_SUPER_MARIO_GALAXY: - g_Config.bPhackvalue1 = true; - g_Config.fhackvalue1 = 0.00006f; - g_Config.bPhackvalue2 = false; + 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_MARIO_KART_WII: - g_Config.bPhackvalue1 = true; - g_Config.fhackvalue1 = 0.00006f; - g_Config.bPhackvalue2 = false; - break; - case OGL_HACK_SONIC_AND_THE_BLACK_KNIGHT: - g_Config.bPhackvalue1 = true; - g_Config.fhackvalue1 = 0.00002f; - g_Config.bPhackvalue2 = true; - g_Config.fhackvalue2 = 1.999980f; - break; - case OGL_HACK_BLEACH_VERSUS_CRUSADE: - g_Config.bPhackvalue2 = true; - g_Config.fhackvalue2 = 0.5f; - g_Config.bPhackvalue1 = false; - break; - case OGL_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME: - g_Config.bPhackvalue1 = true; - g_Config.fhackvalue1 = 0.8f; - g_Config.bPhackvalue2 = true; - g_Config.fhackvalue2 = 1.2f; - break; - } + } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp index 48b3b99939..cd5452634e 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp @@ -281,7 +281,7 @@ void Flush() Renderer::SetRenderMode(Renderer::RM_Normal); // set global constants - VertexShaderManager::SetConstants(g_Config.bPhackvalue1, g_Config.fhackvalue1, g_Config.bPhackvalue2, g_Config.fhackvalue2, g_Config.bFreeLook); + VertexShaderManager::SetConstants(g_Config.bProjHack1,g_Config.bPhackvalue1, g_Config.fhackvalue1, g_Config.bPhackvalue2, g_Config.fhackvalue2, g_Config.bFreeLook); PixelShaderManager::SetConstants(); // finally bind