diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index 5849635523..f9d2221e44 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -48,6 +48,7 @@ SCoreStartupParameter::SCoreStartupParameter() bEnableCheats(false), bRunCompareServer(false), bRunCompareClient(false), bMMU(false), bMMUBAT(false), iTLBHack(0), bAlternateRFI(false), + bMergeBlocks(false), SelectedLanguage(0), bWii(false), bConfirmStop(false), bHideCursor(false), bAutoHideCursor(false), bUsePanicHandlers(true), @@ -74,6 +75,7 @@ void SCoreStartupParameter::LoadDefaults() bMMUBAT = false; iTLBHack = 0; bAlternateRFI = false; + bMergeBlocks = false; SelectedLanguage = 0; bWii = false; diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index f714480989..04879eb552 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -74,6 +74,7 @@ struct SCoreStartupParameter bool bUseFastMem; bool bLockThreads; bool bEnableCheats; + bool bMergeBlocks; bool bRunCompareServer; bool bRunCompareClient; diff --git a/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp index 55a322a5e0..ccc9472333 100644 --- a/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp @@ -24,6 +24,7 @@ #include "PPCSymbolDB.h" #include "SignatureDB.h" #include "PPCAnalyst.h" +#include "../ConfigManager.h" // Analyzes PowerPC code in memory to find functions // After running, for each function we will know what functions it calls @@ -454,6 +455,10 @@ u32 Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Bloc if (numFollows > FUNCTION_FOLLOWING_THRESHOLD) follow = false; + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bMergeBlocks) { + follow = false; + } + if (!follow) { if (opinfo->flags & FL_ENDBLOCK) //right now we stop early diff --git a/Source/Core/DolphinWX/Src/BootManager.cpp b/Source/Core/DolphinWX/Src/BootManager.cpp index f0759ad7d5..5797939dac 100644 --- a/Source/Core/DolphinWX/Src/BootManager.cpp +++ b/Source/Core/DolphinWX/Src/BootManager.cpp @@ -110,6 +110,7 @@ bool BootCore(const std::string& _rFilename) game_ini.Get("Core", "BAT", &StartUp.bMMUBAT, StartUp.bMMUBAT); game_ini.Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack); game_ini.Get("Core", "AlternateRFI", &StartUp.bAlternateRFI, StartUp.bAlternateRFI); + game_ini.Get("Core", "BlockMerging", &StartUp.bMergeBlocks, StartUp.bMergeBlocks); // Wii settings if (StartUp.bWii) { diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 4d0b1aef8b..7df7bd6e78 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -298,6 +298,8 @@ void CISOProperties::CreateGUIControls(bool IsWad) TLBHack->SetToolTip(wxT("Fast version of the MMU. Does not work for every game.")); AlternateRFI = new wxCheckBox(m_GameConfig, ID_RFI, _("Alternate RFI"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); AlternateRFI->SetToolTip(wxT("If a game hangs, works only in the Interpreter or Dolphin crashes, this option may fix the game.")); + BlockMerging = new wxCheckBox(m_GameConfig, ID_MERGEBLOCKS, _("Enable Block Merging"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); + // Wii Console sbWiiOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Wii Console")); EnableProgressiveScan = new wxCheckBox(m_GameConfig, ID_ENABLEPROGRESSIVESCAN, _("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); @@ -325,6 +327,7 @@ void CISOProperties::CreateGUIControls(bool IsWad) UseXFB = new wxCheckBox(m_GameConfig, ID_USEXFB, _("Use XFB"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); UseZTPSpeedupHack = new wxCheckBox(m_GameConfig, ID_ZTP_SPEEDUP, _("ZTP hack"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); UseZTPSpeedupHack->SetToolTip(wxT("Enable this to speed up The Legend of Zelda: Twilight Princess. Disable for ANY other game.")); + DListCache = new wxCheckBox(m_GameConfig, ID_DLISTCACHE, _("DList Cache"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); // Hack Hacktext = new wxStaticText(m_GameConfig, ID_HACK_TEXT, _("Projection Hack for: "), wxDefaultPosition, wxDefaultSize); arrayStringFor_Hack.Add(_("None")); @@ -359,6 +362,7 @@ void CISOProperties::CreateGUIControls(bool IsWad) sbCoreOverrides->Add(MMUBAT, 0, wxEXPAND|wxLEFT, 5); sbCoreOverrides->Add(TLBHack, 0, wxEXPAND|wxLEFT, 5); sbCoreOverrides->Add(AlternateRFI, 0, wxEXPAND|wxLEFT, 5); + sbCoreOverrides->Add(BlockMerging, 0, wxEXPAND|wxLEFT, 5); sbWiiOverrides->Add(EnableProgressiveScan, 0, wxEXPAND|wxLEFT, 5); sbWiiOverrides->Add(EnableWideScreen, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(ForceFiltering, 0, wxEXPAND|wxLEFT, 5); @@ -368,6 +372,7 @@ void CISOProperties::CreateGUIControls(bool IsWad) sbVideoOverrides->Add(DstAlphaPass, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(UseXFB, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(UseZTPSpeedupHack, 0, wxEXPAND|wxLEFT, 5); + sbVideoOverrides->Add(DListCache, 0, wxEXPAND|wxLEFT, 5); wxFlexGridSizer* fifosizer = new wxFlexGridSizer(2, 2, 0, 0); fifosizer->Add(Hacktext, 0, wxLEFT, 5); @@ -842,6 +847,11 @@ void CISOProperties::LoadGameConfig() else AlternateRFI->Set3StateValue(wxCHK_UNDETERMINED); + if (GameIni.Get("Core", "BlockMerging", &bTemp)) + BlockMerging->Set3StateValue((wxCheckBoxState)bTemp); + else + BlockMerging->Set3StateValue(wxCHK_UNDETERMINED); + if (GameIni.Get("Wii", "ProgressiveScan", &bTemp)) EnableProgressiveScan->Set3StateValue((wxCheckBoxState)bTemp); else @@ -887,6 +897,11 @@ void CISOProperties::LoadGameConfig() else UseZTPSpeedupHack->Set3StateValue(wxCHK_UNDETERMINED); + if (GameIni.Get("Video", "DlistCachingEnable", &bTemp)) + DListCache->Set3StateValue((wxCheckBoxState)bTemp); + else + DListCache->Set3StateValue(wxCHK_UNDETERMINED); + if (GameIni.Get("Video", "FIFOWatermarkTightness", &sTemp)) WMTightness->SetValue(wxString(sTemp.c_str(), *wxConvCurrent)); else @@ -943,6 +958,11 @@ bool CISOProperties::SaveGameConfig() else GameIni.Set("Core", "AlternateRFI", AlternateRFI->Get3StateValue()); + if (BlockMerging->Get3StateValue() == wxCHK_UNDETERMINED) + GameIni.DeleteKey("Core", "BlockMerging"); + else + GameIni.Set("Core", "BlockMerging", BlockMerging->Get3StateValue()); + if (EnableProgressiveScan->Get3StateValue() == wxCHK_UNDETERMINED) GameIni.DeleteKey("Wii", "ProgressiveScan"); else @@ -988,6 +1008,11 @@ bool CISOProperties::SaveGameConfig() else GameIni.Set("Video", "ZTPSpeedupHack", UseZTPSpeedupHack->Get3StateValue()); + if (DListCache->Get3StateValue() == wxCHK_UNDETERMINED) + GameIni.DeleteKey("Video", "DlistCachingEnable"); + else + GameIni.Set("Video", "DlistCachingEnable", DListCache->Get3StateValue()); + if (Hack->GetSelection() == -1) GameIni.DeleteKey("Video", "ProjectionHack"); else diff --git a/Source/Core/DolphinWX/Src/ISOProperties.h b/Source/Core/DolphinWX/Src/ISOProperties.h index 076133db08..e3f040a542 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.h +++ b/Source/Core/DolphinWX/Src/ISOProperties.h @@ -85,13 +85,14 @@ class CISOProperties : public wxDialog wxStaticText *OverrideText; // Core wxCheckBox *CPUThread, *SkipIdle, *MMU, *MMUBAT, *TLBHack; - wxCheckBox *AlternateRFI; + wxCheckBox *AlternateRFI, *BlockMerging; // Wii wxCheckBox *EnableProgressiveScan, *EnableWideScreen; // Video wxCheckBox *ForceFiltering, *EFBCopyDisable, *EFBToTextureEnable, - *SafeTextureCache, *DstAlphaPass, *UseXFB, *UseZTPSpeedupHack; + *SafeTextureCache, *DstAlphaPass, *UseXFB, *UseZTPSpeedupHack, + *DListCache; wxStaticText *Hacktext; wxArrayString arrayStringFor_Hack; wxChoice *Hack; @@ -169,6 +170,7 @@ class CISOProperties : public wxDialog ID_MMUBAT, ID_TLBHACK, ID_RFI, + ID_MERGEBLOCKS, ID_FORCEFILTERING, ID_EFBCOPYDISABLE, ID_EFBTOTEXTUREENABLE, @@ -176,6 +178,7 @@ class CISOProperties : public wxDialog ID_DSTALPHAPASS, ID_USEXFB, ID_ZTP_SPEEDUP, + ID_DLISTCACHE, ID_HACK_TEXT, ID_HACK, ID_WMTIGHTNESS_TEXT, diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index daccd370b6..3483ac1b37 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -151,6 +151,8 @@ void VideoConfig::GameIniLoad(const char *ini_file) iniFile.Get("Video", "UseNativeMips", &bUseNativeMips); if (iniFile.Exists("Video", "ZTPSpeedupHack")) iniFile.Get("Video", "ZTPSpeedupHack", &bZTPSpeedHack); + if (iniFile.Exists("Video", "DlistCachingEnable")) + iniFile.Get("Video", "DlistCachingEnable", &bDlistCachingEnable); } void VideoConfig::Save(const char *ini_file)