Dolphin, the GameCube and Wii emulator - Forums

Full Version: [Wii] Super Mario Galaxy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Infact the hack is not present at the origin and amounts to create added value in the code.

So infact what I have done is create a check box to enable or disable value.

The credit does not mean I create here thanks to the work of sl1nk3. (look to post:The "original")

Code:

Code:
Index: Core/VideoCommon/Src/VertexShaderManager.cpp
===================================================================
--- Core/VideoCommon/Src/VertexShaderManager.cpp    (revision 2940)
+++ Core/VideoCommon/Src/VertexShaderManager.cpp    (working copy)
@@ -69,7 +69,7 @@
// =======================================================================================
// Syncs the shader constant buffers with xfmem
// ----------------
-void VertexShaderManager::SetConstants(bool proj_hax_1)
+void VertexShaderManager::SetConstants(bool proj_hax_1,bool SMG_hack)
{
     //nTransformMatricesChanged[0] = 0; nTransformMatricesChanged[1] = 256;
     //nNormalMatricesChanged[0] = 0; nNormalMatricesChanged[1] = 96;
@@ -253,7 +253,15 @@
             g_fProjectionMatrix[8] = 0.0f;
             g_fProjectionMatrix[9] = 0.0f;
             g_fProjectionMatrix[10] = xfregs.rawProjection[4];
-            g_fProjectionMatrix[11] = xfregs.rawProjection[5] + (proj_hax_1 ? 0.1f : 0.0f);
+            
+            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[12] = 0.0f;
             g_fProjectionMatrix[13] = 0.0f;
Index: Core/VideoCommon/Src/VertexShaderManager.h
===================================================================
--- Core/VideoCommon/Src/VertexShaderManager.h    (revision 2940)
+++ Core/VideoCommon/Src/VertexShaderManager.h    (working copy)
@@ -28,7 +28,7 @@
     static void Shutdown();

     // constant management
-    static void SetConstants(bool proj_hax_1);
+    static void SetConstants(bool proj_hax_1,bool SMG_hack);

     static void SetViewport(float* _Viewport);
     static void SetViewportChanged();
Index: Plugins/Plugin_VideoOGL/Src/Config.cpp
===================================================================
--- Plugins/Plugin_VideoOGL/Src/Config.cpp    (revision 2940)
+++ Plugins/Plugin_VideoOGL/Src/Config.cpp    (working copy)
@@ -80,6 +80,7 @@
     iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
     iniFile.Get("Hacks", "ProjectionHax1", &bProjectionHax1, 0);
    iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToRAM, 0);
+    iniFile.Get("Hacks", "SMGhack", &bSMGhack, true);
}

void Config::GameIniLoad() {
Index: Plugins/Plugin_VideoOGL/Src/Config.h
===================================================================
--- Plugins/Plugin_VideoOGL/Src/Config.h    (revision 2940)
+++ Plugins/Plugin_VideoOGL/Src/Config.h    (working copy)
@@ -91,9 +91,10 @@
     bool bEFBCopyDisable;
     bool bEFBCopyDisableHotKey;
     bool bProjectionHax1;
+    bool bSMGhack;
    bool bCopyEFBToRAM;
     bool bSafeTextureCache;
-
+    
     int iLog; // CONF_ bits
     int iSaveTargetId;
    
Index: Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp
===================================================================
--- Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp    (revision 2940)
+++ Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp    (working copy)
@@ -60,6 +60,7 @@
    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_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged)
     EVT_CHECKBOX(ID_DSTALPHAPASS,ConfigDialog::AdvancedSettingsChanged)
    EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, ConfigDialog::AdvancedSettingsChanged)
@@ -353,14 +354,17 @@
    // 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);
+    
    // Disabled or enabled
    m_SafeTextureCache->Enable(true);
    m_ProjectionHax1->Enable(true);
-
+    m_SMGh->Enable(true);
+    
    // Default values
    m_SafeTextureCache->SetValue(g_Config.bSafeTextureCache);
    m_ProjectionHax1->SetValue(g_Config.bProjectionHax1);
-
+    m_SMGh->SetValue(g_Config.bSMGhack);
    // 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"
@@ -373,7 +377,8 @@
    // Sizers
    sHacks = new wxGridBagSizer(0, 0);
    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_SafeTextureCache, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
+    sHacks->Add(m_SMGh, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);

    sbHacks = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks"));
    sbHacks->Add(sHacks, 0, wxEXPAND | (wxTOP), 0);
@@ -567,7 +572,9 @@
    case ID_SAFETEXTURECACHE:
        g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked();
        break;
-
+    case ID_SMGHACK:
+        g_Config.bSMGhack = m_SMGh->IsChecked();
+        break;
    case ID_RADIO_COPYEFBTORAM:
        TextureMngr::ClearRenderTargets();
        g_Config.bCopyEFBToRAM = true;
Index: Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h
===================================================================
--- Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h    (revision 2940)
+++ Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h    (working copy)
@@ -113,6 +113,7 @@
        wxRadioButton *m_Radio_CopyEFBToRAM, *m_Radio_CopyEFBToGL;
        wxCheckBox *m_EFBCopyDisableHotKey;
        wxCheckBox *m_ProjectionHax1;
+        wxCheckBox *m_SMGh;
        wxCheckBox *m_SafeTextureCache;
        // Screen size
        wxStaticText *m_TextScreenWidth, *m_TextScreenHeight, *m_TextScreenLeft, *m_TextScreenTop;
@@ -170,6 +171,7 @@
            ID_CHECKBOX_DISABLECOPYEFB,
            ID_EFBCOPYDISABLEHOTKEY,
            ID_PROJECTIONHACK1,
+            ID_SMGHACK,
             ID_DSTALPHAPASS,
            ID_RADIO_COPYEFBTORAM,
            ID_RADIO_COPYEFBTOGL,
Index: Plugins/Plugin_VideoOGL/Src/VertexManager.cpp
===================================================================
--- Plugins/Plugin_VideoOGL/Src/VertexManager.cpp    (revision 2940)
+++ Plugins/Plugin_VideoOGL/Src/VertexManager.cpp    (working copy)
@@ -278,7 +278,7 @@
        Renderer::SetRenderMode(Renderer::RM_Normal);

    // set global constants
-    VertexShaderManager::SetConstants(g_Config.bProjectionHax1);
+    VertexShaderManager::SetConstants(g_Config.bProjectionHax1,g_Config.bSMGhack);
    PixelShaderManager::SetConstants();

    // finally bind

And a small image to show you what I said:

[Image: withoutbug.jpg]

The plugin
Excuse me for the double post but I just tested my hack with MarioKart wii and he withdrew with the black box but it is certain graphics disappear during a race and it must activate that during the race and not copy off EFB .

Against it by doing something good "we see the shadows under the kart".

I think it is still a problem of value and I will try another hack (a new value to change).
Wow, for the first time Galaxy is actually playable for me. That's quite neat.

I'm not sure what this "enter dome" crash is supposed to be, but I'm not getting it. I can enter domes just fine, but the Pull Star that's supposed to lift you up to view the Galaxies isn't working for some odd reason.. perhaps I need to use a real wiimote?

*tries that*

Nope, no luck. Galaxies from Lumas do work, of course, but no dome galaxies because the pull stars don't appear to be working for some odd reason.

coolcat12

Cutscenes are blue for anyone else with hack? Worked good until I flew from the first planet and collected star pieces it crashed. Thanks tho.
Worked mostly. Two things seem broken, and one of those things might not be related to the hack. Cutscenes show no video (all blue, as mentioned), and also the IR pointer doesn't seem to work ingame. It works for menus, but star bits and pull stars alike never "activate" when the pointer is over them, making it impossible to enter most galaxies or (without a save) unlock any luma galaxies. So it's quite broken. Looks better than usual though.

The *final* galaxy, however, is quite playable and beatable. To prove it, I did it, and took screenshots of the ending. So here.

[attachment=143][attachment=144][attachment=145][attachment=146]

Sadly, *most* of the ending sequence is made up of movies, which have sound, but otherwise look like this: [attachment=147]

During the portion where the credits were supposed to be rolling, it either hung, or showed nothing. It was "running" at 60FPS, so I'm leaning toward the showing nothing side of things.
Im gettting 10FPS Sad
Disable Other Audio. Speed should increase.
(04-10-2009, 11:56 AM)thegamefreak0134 Wrote: [ -> ]Wow, for the first time Galaxy is actually playable for me. That's quite neat.

I'm not sure what this "enter dome" crash is supposed to be, but I'm not getting it. I can enter domes just fine, but the Pull Star that's supposed to lift you up to view the Galaxies isn't working for some odd reason.. perhaps I need to use a real wiimote?

*tries that*

Nope, no luck. Galaxies from Lumas do work, of course, but no dome galaxies because the pull stars don't appear to be working for some odd reason.

If Domes work now, that's great! Remember, I've only tested the games on a really old revision, things could have been fixed of course. promising. I'm gonna test right now.

EDIT: Tested, yep domes are working, last Bowser Galaxy also. But not the pull star. A shame really, they're such a formality.
I don't think real wiimote will have an effect, but be free to test.
For graphical bug that you find in a sreen activate the option "Overlay Project Stats" I can see what happened (you never know it may be possible to resolve the problem).

Otherwise I think I'll see if I can not improve a bit my hack at the code and added a tooltip (for the configuration page).
And I started to look if I can not do something for MarioKart Wii.
That's really great, val532!
The pull star problem unfortunately is not graphical...
awesome, the Menus of Dragonball Z Budokai Tenkaichi 3 (Wii) work now !
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19