Dolphin, the GameCube and Wii emulator - Forums

Full Version: Plug-in OGL hacks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3

LuisR14

what files? Smile
uhh nvm i fixed my problem
but can you tell me how to install patches?

cmccmc

use tortoise svn to insert the source code patches to dolphin's source. Then just compile it. A very simple process.
alright ill try
omg i didnt even notice the opengl advanced menu...im such a noob :p
what is better in this hack?
The newest svn should already have the hacks in it Tongue

Ki-Saru

(04-30-2009, 02:24 AM)val532 Wrote: [ -> ]Hi,

I have made a new version of my SMGhack but in this new version I added something that you are all loved.

A spetial hack for Super Mario Galaxy, Mario Kart Wii, Final Fantasy CC echo of time, Sonic and the black knight, and Bleach Versus Crusade.

You just have to select game on OGL config and it's works.

Up

Dolphin R3103 x32 with hack

Dolphin R3103 x64 with hack

Update 10/05/09 : my source

Code:
Index: Source/Core/VideoCommon/Src/VertexShaderManager.cpp
===================================================================
--- Source/Core/VideoCommon/Src/VertexShaderManager.cpp    (revision 3190)
+++ Source/Core/VideoCommon/Src/VertexShaderManager.cpp    (working copy)
@@ -77,7 +77,7 @@
// =======================================================================================
// Syncs the shader constant buffers with xfmem
// ----------------
-void VertexShaderManager::SetConstants(bool proj_hax_1,bool SMG_hack, 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;
@@ -261,10 +261,10 @@

             g_fProjectionMatrix[8] = 0.0f;
             g_fProjectionMatrix[9] = 0.0f;
-            g_fProjectionMatrix[10] = xfregs.rawProjection[4];
+            g_fProjectionMatrix[10] = (Hack_hack1 ? -(Hack_value1 + xfregs.rawProjection[4]) : xfregs.rawProjection[4]);
            
-            g_fProjectionMatrix[11] = (SMG_hack ? -(0.512505f + xfregs.rawProjection[5]) : xfregs.rawProjection[5]) + (proj_hax_1 ? 0.1f : 0.0f);
-
+            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;
             g_fProjectionMatrix[14] = 0.0f;
Index: Source/Core/VideoCommon/Src/VertexShaderManager.h
===================================================================
--- Source/Core/VideoCommon/Src/VertexShaderManager.h    (revision 3190)
+++ Source/Core/VideoCommon/Src/VertexShaderManager.h    (working copy)
@@ -28,7 +28,7 @@
     static void Shutdown();

     // constant management
-    static void SetConstants(bool proj_hax_1, bool SMG_hack, 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();
Index: Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
===================================================================
--- Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp    (revision 3190)
+++ Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp    (working copy)
@@ -235,7 +235,7 @@
        if (numVertices)
        {
            // set global constants
-            VertexShaderManager::SetConstants(false, false, false);
+            VertexShaderManager::SetConstants(false, false, 0, false, 0, false);
            PixelShaderManager::SetConstants();

            PixelShaderCache::SetShader();
Index: Source/Plugins/Plugin_VideoOGL/Src/Config.cpp
===================================================================
--- Source/Plugins/Plugin_VideoOGL/Src/Config.cpp    (revision 3190)
+++ Source/Plugins/Plugin_VideoOGL/Src/Config.cpp    (working copy)
@@ -80,9 +80,9 @@
    
     iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, 0);
     iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
-    iniFile.Get("Hacks", "ProjectionHax1", &bProjectionHax1, 0);
+    //iniFile.Get("Hacks", "ProjectionHax1", &bProjectionHax1, 0);
    iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToRAM, 0);
-    iniFile.Get("Hacks", "SMGhack", &bSMGhack, false);
+    //iniFile.Get("Hacks", "Hack", &bHack, false);
}

void Config::GameIniLoad() {
@@ -102,8 +102,8 @@
    if (iniFile->Exists("Video", "EFBCopyDisableHotKey"))
        iniFile->Get("Video", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);

-    if (iniFile->Exists("Video", "ProjectionHax1"))
-        iniFile->Get("Video", "ProjectionHax1", &bProjectionHax1, 0);
+    //if (iniFile->Exists("Video", "ProjectionHax1"))
+    //    iniFile->Get("Video", "ProjectionHax1", &bProjectionHax1, 0);

    if (iniFile->Exists("Video", "EFBToTextureEnable"))
        iniFile->Get("Video", "EFBToTextureEnable", &bCopyEFBToRAM, 0);
@@ -111,8 +111,8 @@
    if (iniFile->Exists("Video", "SafeTextureCache"))
        iniFile->Get("Video", "SafeTextureCache", &bSafeTextureCache, false);

-    if (iniFile->Exists("Video", "SMGhack"))
-        iniFile->Get("Video", "SMGhack", &bSMGhack, false);
+   // if (iniFile->Exists("Video", "SMGhack"))
+   //     iniFile->Get("Video", "SMGhack", &bSMGhack, false);

    if (iniFile->Exists("Video", "MSAA"))
        iniFile->Get("Video", "MSAA", &iMultisampleMode, 0);
@@ -170,9 +170,9 @@
    
     iniFile.Set("Hacks", "EFBCopyDisable", bEFBCopyDisable);
     iniFile.Set("Hacks", "EFBCopyDisableHotKey", bEFBCopyDisableHotKey);
-    iniFile.Set("Hacks", "ProjectionHax1", bProjectionHax1);
+    //iniFile.Set("Hacks", "ProjectionHax1", bProjectionHax1);
    iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToRAM);
-    iniFile.Set("Hacks", "SMGhack", bSMGhack);
+    //iniFile.Set("Hacks", "SMGhack", bSMGhack);

     iniFile.Save(FULL_CONFIG_DIR "gfx_opengl.ini");
}
Index: Source/Plugins/Plugin_VideoOGL/Src/Config.h
===================================================================
--- Source/Plugins/Plugin_VideoOGL/Src/Config.h    (revision 3190)
+++ Source/Plugins/Plugin_VideoOGL/Src/Config.h    (working copy)
@@ -93,9 +93,12 @@
     bool bEFBCopyDisable;
     bool bEFBCopyDisableHotKey;
     bool bProjectionHax1;
-    bool bSMGhack;
+    bool bHack;
    bool bCopyEFBToRAM;
     bool bSafeTextureCache;
+    int iPhackvalue;
+    bool bPhackvalue1, bPhackvalue2;
+    float fhackvalue1, fhackvalue2;

     int iLog; // CONF_ bits
     int iSaveTargetId;
Index: Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp
===================================================================
--- Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp    (revision 3190)
+++ Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp    (working copy)
@@ -62,13 +62,14 @@
    EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged)
    EVT_CHECKBOX(ID_DISABLEFOG, ConfigDialog::AdvancedSettingsChanged)
    EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged)
-    EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged)
-    EVT_CHECKBOX(ID_SMGHACK, ConfigDialog::AdvancedSettingsChanged)
+    //EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged)
+    EVT_CHECKBOX(ID_HACK, ConfigDialog::AdvancedSettingsChanged)
    EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged)
     EVT_CHECKBOX(ID_DSTALPHAPASS,ConfigDialog::AdvancedSettingsChanged)
    EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, ConfigDialog::AdvancedSettingsChanged)
    EVT_RADIOBUTTON(ID_RADIO_COPYEFBTORAM, ConfigDialog::AdvancedSettingsChanged)
    EVT_RADIOBUTTON(ID_RADIO_COPYEFBTOGL, ConfigDialog::AdvancedSettingsChanged)
+    EVT_CHOICE(ID_PHACKVALUE, ConfigDialog::GeneralSettingsChanged)
END_EVENT_TABLE()

ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
@@ -361,29 +362,41 @@

    // Hacks controls
    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_ProjectionHax1 = new wxCheckBox(m_PageAdvanced, ID_PROJECTIONHACK1, wxT("ZTP Bloom hack"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);

+    //m_Hack = new wxCheckBox(m_PageAdvanced, ID_HACK, wxT("Mario Galaxy Hack"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
+    m_PhackvalueCB = new wxChoice(m_PageAdvanced, ID_PHACKVALUE, wxDefaultPosition, wxDefaultSize, arrayStringFor_PhackvalueCB, 0, wxDefaultValidator);
+    m_PhackvalueCB->Append(wxT("Zero"));
+    m_PhackvalueCB->Append(wxT("ZTP Bloom hack"));
+    m_PhackvalueCB->Append(wxT("SMG"));
+    m_PhackvalueCB->Append(wxT("MK"));
+    m_PhackvalueCB->Append(wxT("Sonic and Black"));
+    m_PhackvalueCB->Append(wxT("Bleach"));
+    m_PhackvalueCB->Append(wxT("FFCC-OE"));
+    m_PhackvalueCB->SetSelection(g_Config.iPhackvalue);
+
    // Default values
    m_SafeTextureCache->SetValue(g_Config.bSafeTextureCache);
-    m_ProjectionHax1->SetValue(g_Config.bProjectionHax1);
-    m_SMGh->SetValue(g_Config.bSMGhack);
+    //m_ProjectionHax1->SetValue(g_Config.bProjectionHax1);
+    //m_Hack->SetValue(g_Config.bHack);

    // Tool tips
    m_SafeTextureCache->SetToolTip(wxT("This is useful to prevent Metroid Prime from crashing, but can cause problems in other games."
        "\n[This option will apply immediately and does not require a restart. However it may not"
        " be entirely safe to change it midgames.]"));
-    m_ProjectionHax1->SetToolTip(wxT("This should get ZTP's Bloom to show"));
+    //m_ProjectionHax1->SetToolTip(wxT("This should get ZTP's Bloom to show"));
     m_DstAlphaPass->SetToolTip(wxT("This renders a second time to set alpha to a constant value,"
        "\nDisabling it may speed up some games, but could also cause glitches."));
    m_DisableFog->SetToolTip(wxT("This option should not require a restart."));
-    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 M key to turn this option on or off"));
+    //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 M key to turn this option on or off"));

    // Sizers
    sHacks = new wxGridBagSizer(0, 0);
-    sHacks->Add(m_ProjectionHax1, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
-    sHacks->Add(m_SafeTextureCache, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
-    sHacks->Add(m_SMGh, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
+    //sHacks->Add(m_ProjectionHax1, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
+    sHacks->Add(m_SafeTextureCache, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
+
+    //sHacks->Add(m_Hack, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
+    sHacks->Add(m_PhackvalueCB, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
    
    sbHacks = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks"));
    sbHacks->Add(sHacks, 0, wxEXPAND | (wxTOP), 0);
@@ -509,6 +522,53 @@
    case ID_MSAAMODECB:
        g_Config.iMultisampleMode = m_MSAAModeCB->GetSelection();
        break;
+        case ID_PHACKVALUE:
+        g_Config.iPhackvalue = m_PhackvalueCB->GetSelection();
+    if (g_Config.iPhackvalue >= 0)
+        {
+            if (g_Config.iPhackvalue == 0)
+            {
+                g_Config.bPhackvalue1 = 0;
+                g_Config.bPhackvalue2 = 0;
+            }
+            if (g_Config.iPhackvalue == 1)
+            {
+                g_Config.bProjectionHax1 = 1;
+            }
+            if (g_Config.iPhackvalue == 2)
+            {
+                g_Config.bPhackvalue1 = 1;
+                g_Config.fhackvalue1 = 0.00006f;
+                g_Config.bPhackvalue2 = 0;
+            }
+            if (g_Config.iPhackvalue == 3)
+            {
+                g_Config.bPhackvalue1 = 1;
+                g_Config.fhackvalue1 = 0.0006f;
+                g_Config.bPhackvalue2 = 0;
+            }
+            if (g_Config.iPhackvalue == 4)
+            {
+                g_Config.bPhackvalue1 = 1;
+                g_Config.fhackvalue1 = 0.00002f;
+                g_Config.bPhackvalue2 = 1;
+                g_Config.fhackvalue2 = 1.999980f;
+            }
+            if (g_Config.iPhackvalue == 5)
+            {
+                g_Config.bPhackvalue2 = 1;
+                g_Config.fhackvalue2 = 0.5f;
+                g_Config.bPhackvalue1 = 0;
+            }
+            if (g_Config.iPhackvalue == 6)
+            {
+                g_Config.bPhackvalue1 = 1;
+                g_Config.fhackvalue1 = 0.8f;
+                g_Config.bPhackvalue2 = 1;
+                g_Config.fhackvalue2 = 1.2f;
+            }
+        }
+        break;
    }

    UpdateGUI();
@@ -551,8 +611,7 @@
        break;
    case ID_DISABLEFOG:
        g_Config.bDisableFog = m_DisableFog->IsChecked();
-        break;
-        
+        break;        
     case ID_DSTALPHAPASS:
        g_Config.bDstAlphaPass = m_DstAlphaPass->IsChecked();
        break;
@@ -580,14 +639,14 @@
        g_Config.bEFBCopyDisableHotKey = m_EFBCopyDisableHotKey->IsChecked();
        break;
    // Hacks
-    case ID_PROJECTIONHACK1:
+    /*case ID_PROJECTIONHACK1:
        g_Config.bProjectionHax1 = m_ProjectionHax1->IsChecked();
-        break;
+        break;*/
    case ID_SAFETEXTURECACHE:
        g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked();
        break;
-    case ID_SMGHACK:
-        g_Config.bSMGhack = m_SMGh->IsChecked();
+    case ID_HACK:
+        g_Config.bHack = m_Hack->IsChecked();
        break;
    case ID_RADIO_COPYEFBTORAM:
        TextureMngr::ClearRenderTargets();
Index: Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h
===================================================================
--- Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h    (revision 3190)
+++ Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h    (working copy)
@@ -89,8 +89,8 @@
        wxComboBox *m_WindowResolutionCB;
        wxArrayString arrayStringFor_MaxAnisotropyCB;
        wxChoice *m_MaxAnisotropyCB;
-        wxArrayString arrayStringFor_MSAAModeCB;
-        wxChoice *m_MSAAModeCB;
+        wxArrayString arrayStringFor_MSAAModeCB, arrayStringFor_PhackvalueCB;
+        wxChoice *m_MSAAModeCB, *m_PhackvalueCB;

        wxCheckBox *m_ShowFPS;
        wxCheckBox *m_ShaderErrors;
@@ -114,8 +114,8 @@
        wxCheckBox *m_CheckBox_DisableCopyEFB;
        wxRadioButton *m_Radio_CopyEFBToRAM, *m_Radio_CopyEFBToGL;
        wxCheckBox *m_EFBCopyDisableHotKey;
-        wxCheckBox *m_ProjectionHax1;
-        wxCheckBox *m_SMGh;
+        //wxCheckBox *m_ProjectionHax1;
+        wxCheckBox *m_Hack;
        wxCheckBox *m_SafeTextureCache;
        // Screen size
        wxStaticText *m_TextScreenWidth, *m_TextScreenHeight, *m_TextScreenLeft, *m_TextScreenTop;
@@ -165,7 +165,8 @@
            ID_DISABLEFOG,
            ID_STATICBOX_EFB,
            ID_SAFETEXTURECACHE,
-            ID_SMGHACK,
+            ID_HACK,
+            ID_PHACKVALUE,

            ID_DUMPTEXTURES,
            ID_HIRESTEXTURES,
@@ -176,7 +177,7 @@

            ID_CHECKBOX_DISABLECOPYEFB,
            ID_EFBCOPYDISABLEHOTKEY,
-            ID_PROJECTIONHACK1,
+            //ID_PROJECTIONHACK1,
             ID_DSTALPHAPASS,
            ID_RADIO_COPYEFBTORAM,
            ID_RADIO_COPYEFBTOGL,
Index: Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp
===================================================================
--- Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp    (revision 3190)
+++ Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp    (working copy)
@@ -281,7 +281,7 @@
        Renderer::SetRenderMode(Renderer::RM_Normal);

    // set global constants
-    VertexShaderManager::SetConstants(g_Config.bProjectionHax1, g_Config.bSMGhack, g_Config.bFreeLook);
+    VertexShaderManager::SetConstants(g_Config.bProjectionHax1, g_Config.bPhackvalue1, g_Config.fhackvalue1, g_Config.bPhackvalue2, g_Config.fhackvalue2, g_Config.bFreeLook);
    PixelShaderManager::SetConstants();

    // finally bind

Hack.patch

it wont let me download, what am i doing wrong?
Pages: 1 2 3