Dolphin, the GameCube and Wii emulator - Forums
My SMGHack - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Support (https://forums.dolphin-emu.org/Forum-support)
+--- Thread: My SMGHack (/Thread-my-smghack)



My SMGHack - val532 - 04-11-2009

My SMGhack Final version.

This is a complement to R2949/50 it add the HotKey M for enable or disable the hack and correct the hack so if it not work for you, you could apply this patch.

Code:
Index: Core/DolphinWX/Src/Frame.cpp
===================================================================
--- Core/DolphinWX/Src/Frame.cpp    (revision 2950)
+++ Core/DolphinWX/Src/Frame.cpp    (working copy)
@@ -498,7 +509,7 @@
        UpdateGUI();
    }
#ifdef _WIN32
-    if(event.GetKeyCode() == 'E') // Send this to the video plugin WndProc
+    if(event.GetKeyCode() == 'E','M') // Send this to the video plugin WndProc
    {
        PostMessage((HWND)Core::GetWindowHandle(), WM_KEYDOWN, event.GetKeyCode(), 0);
        event.Skip(); // Don't block the E key
Index: Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
===================================================================
--- Plugins/Plugin_VideoDX9/Src/VertexManager.cpp    (revision 2950)
+++ Plugins/Plugin_VideoDX9/Src/VertexManager.cpp    (working copy)
@@ -235,7 +235,7 @@
        if (numVertices)
        {
            // set global constants
-            VertexShaderManager::SetConstants(false);
+            VertexShaderManager::SetConstants(false,false);
            PixelShaderManager::SetConstants();

            PixelShaderCache::SetShader();
Index: Core/VideoCommon/Src/VertexShaderManager.cpp
===================================================================
--- Core/VideoCommon/Src/VertexShaderManager.cpp    (revision 2950)
+++ Core/VideoCommon/Src/VertexShaderManager.cpp    (working copy)
@@ -255,13 +255,8 @@
             g_fProjectionMatrix[9] = 0.0f;
             g_fProjectionMatrix[10] = xfregs.rawProjection[4];
            
-            if (SMG_hack) {
-                g_fProjectionMatrix[11] = -(0.512505 + xfregs.rawProjection[5]) + (proj_hax_1 ? 0.1f : 0.0f);
-            }
-            else {
-                g_fProjectionMatrix[11] = xfregs.rawProjection[5] + (proj_hax_1 ? 0.1f : 0.0f);
-            }
-
+            g_fProjectionMatrix[11] = (SMG_hack ? -(0.812505f + xfregs.rawProjection[5]) : xfregs.rawProjection[5]) + (proj_hax_1 ? 0.1f : 0.0f);
+  
             g_fProjectionMatrix[12] = 0.0f;
             g_fProjectionMatrix[13] = 0.0f;
             g_fProjectionMatrix[14] = 0.0f;
Index: Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp
===================================================================
--- Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp    (revision 2950)
+++ Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp    (working copy)
@@ -355,6 +355,7 @@
    m_SafeTextureCache = new wxCheckBox(m_PageAdvanced, ID_SAFETEXTURECACHE, wxT("Use Safe texture cache"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
    m_ProjectionHax1 = new wxCheckBox(m_PageAdvanced, ID_PROJECTIONHACK1, wxT("ZTP Bloom hack"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
    m_SMGh = new wxCheckBox(m_PageAdvanced, ID_SMGHACK, wxT("Mario Galaxy Hack"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
+    m_SMGh->SetToolTip(wxT("SMG hack for Super Mario Galaxy, Mario Kart Wii and other game probably  it will be disable for other game and during SMG ending sequence or movies use the P key to turn this option on or off"));

    // Disabled or enabled
    m_SafeTextureCache->Enable(true);
Index: Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp
===================================================================
--- Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp    (revision 2950)
+++ Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp    (working copy)
@@ -231,6 +231,14 @@
                    g_Config.bEFBCopyDisable ? "off" : "on").c_str(), 5000);
            }
            break;
+        case 'M': // SMGhack hotkey
+            if (true)
+            {
+                g_Config.bSMGhack = !g_Config.bSMGhack;
+                OSD::AddMessage(StringFromFormat("SMGhack was turned %s",
+                    g_Config.bSMGhack ? "on" : "off").c_str(), 5000);
+            }
+            break;        
        }
        g_VideoInitialize.pKeyPress(LOWORD(wParam), GetAsyncKeyState(VK_SHIFT) != 0, GetAsyncKeyState(VK_CONTROL) != 0);
        break;



RE: My SMGHack - BlackLionPT - 04-21-2009

How can i implement it?


RE: My SMGHack - DacoTaco - 04-21-2009

(04-21-2009, 12:30 AM)Palito Wrote: How can i implement it?
by applying the patch to the source and build dolphin yourself


RE: My SMGHack - BlackLionPT - 04-21-2009

Okay, thats it, time to learn some more new thinks, head straight to the Windows build wiki page!
(thx daco)

EDIT:
Oh, and by the way, Val532, can yuy create a fix to Sonic and the Black Knight too?
I think than it's only needed than mario galaxy hack stais in back of ZTP bloom hack, to the game runs almost perfectly.