This commit addresses the Hyrule field slowdown issue in Zelda: Twilight Princess, as discussed in Xtreme2damax's thread: http://forums.dolphin-emu.com/thread-10638.html. It can be activated in the DX9, DX11, and OpenGL plugin GUI's. Enabling the hack while playing other games besides ZTP will likely have either an undesirable or no(more likely) effect.

The code changes disable the usual pipeline flush for certain BP Writes that occur while the minimap is being drawn in Zelda: twilight princess. This significantly increases speed while in hyrule field. The way this is accomplished is described more in depth on page 42 of Xtreme's thread. Big thanks to Xtreme for doing a great job hosting that thread, and Kiesel-stein for initial work on the hack

Also, I used the resource editor in Visual studio to generate the GUI code for the DX11 plugin, and some code appeared to be removed, although the behavior of the GUI did not seem to change. Hopefully someone more experienced with resource files (forms?) can double check that no code was damaged


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6057 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Fircrestsk8 2010-08-05 03:24:13 +00:00
parent 9e4ff175ec
commit 040a6e1eb3
10 changed files with 86 additions and 72 deletions

View File

@ -34,10 +34,18 @@
using namespace BPFunctions; using namespace BPFunctions;
u32 mapTexAddress;
bool mapTexFound;
int numWrites;
void BPInit() void BPInit()
{ {
memset(&bpmem, 0, sizeof(bpmem)); memset(&bpmem, 0, sizeof(bpmem));
bpmem.bpMask = 0xFFFFFF; bpmem.bpMask = 0xFFFFFF;
mapTexAddress = 0;
numWrites = 0;
mapTexFound = false;
} }
void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, float yScale, float xfbLines, u32 xfbAddr, const u32 dstWidth, const u32 dstHeight) void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, float yScale, float xfbLines, u32 xfbAddr, const u32 dstWidth, const u32 dstHeight)
@ -83,7 +91,40 @@ void BPWritten(const BPCmd& bp)
// FIXME: Hangs load-state, but should fix graphic-heavy games state loading // FIXME: Hangs load-state, but should fix graphic-heavy games state loading
//s_bpCritical.Enter(); //s_bpCritical.Enter();
//BEGIN ZTP SPEEDUP HACK CHANGES
//This hunk of code disables the usual pipeline flush for certain BP Writes
//that occur while the minimap is being drawn in Zelda: twilight princess.
//This significantly increases speed while in hyrule field. In depth discussion
//on how this Hack came to be can be found at:http://forums.dolphin-emu.com/thread-10638.html
//-fircrestsk8
if (g_ActiveConfig.bZTPSpeedHack)
{
if (!mapTexFound)
{
if (bp.address == BPMEM_TEV_COLOR_ENV || bp.address == BPMEM_TEV_ALPHA_ENV)
{
numWrites++;
if (numWrites >= 100) //seem that if 100 consecutive BP writes are called to either of these addresses in ZTP,
{ //then it is safe to assume the map texture address is currently loaded into the BP memory
mapTexAddress = (bpmem.tex[0].texImage3[0].hex << 5);
mapTexFound = true;
WARN_LOG(VIDEO, "\nZTP map texture found at address %08x\n", mapTexAddress);
}
}
else
numWrites = 0;
FlushPipeline(); FlushPipeline();
}
else
{
if ( ((bpmem.tex[0].texImage3[0].hex << 5) != mapTexAddress) || !(bpmem.tevorders[0].getEnable(0)) || bp.address == BPMEM_TREF )
FlushPipeline();
}
}
else
FlushPipeline();
//END ZTP SPEEDUP HACK CHANGES
((u32*)&bpmem)[bp.address] = bp.newvalue; ((u32*)&bpmem)[bp.address] = bp.newvalue;
switch (bp.address) switch (bp.address)

View File

@ -96,6 +96,7 @@ void VideoConfig::Load(const char *ini_file)
iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true); iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
iniFile.Get("Hacks", "FIFOWatermarkTightness", &iFIFOWatermarkTightness, 50); iniFile.Get("Hacks", "FIFOWatermarkTightness", &iFIFOWatermarkTightness, 50);
iniFile.Get("Hacks", "ProjectionHack", &iPhackvalue, 0); iniFile.Get("Hacks", "ProjectionHack", &iPhackvalue, 0);
iniFile.Get("Hacks", "ZTPSpeedHack", &bZTPSpeedHack, false);
iniFile.Get("Hardware", "Adapter", &iAdapter, 0); iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
if (iAdapter == -1) if (iAdapter == -1)
@ -201,6 +202,7 @@ void VideoConfig::Save(const char *ini_file)
iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToTexture); iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToTexture);
iniFile.Set("Hacks", "EFBScaledCopy", bCopyEFBScaled); iniFile.Set("Hacks", "EFBScaledCopy", bCopyEFBScaled);
iniFile.Set("Hacks", "ProjectionHack", iPhackvalue); iniFile.Set("Hacks", "ProjectionHack", iPhackvalue);
iniFile.Set("Hacks", "ZTPSpeedHack", bZTPSpeedHack);
iniFile.Set("Hardware", "Adapter", iAdapter); iniFile.Set("Hardware", "Adapter", iAdapter);

View File

@ -125,6 +125,7 @@ struct VideoConfig
float fhackvalue1, fhackvalue2; float fhackvalue1, fhackvalue2;
bool bProjHack1; bool bProjHack1;
float fAspectRatioHackW, fAspectRatioHackH; float fAspectRatioHackW, fAspectRatioHackH;
bool bZTPSpeedHack;
int iLog; // CONF_ bits int iLog; // CONF_ bits
int iSaveTargetId; int iSaveTargetId;

View File

@ -182,6 +182,7 @@ struct TabAdvanced : public W32Util::Tab
Button_SetCheck(GetDlgItem(hDlg, IDC_WIREFRAME), g_Config.bWireFrame); Button_SetCheck(GetDlgItem(hDlg, IDC_WIREFRAME), g_Config.bWireFrame);
Button_SetCheck(GetDlgItem(hDlg, IDC_DISABLEFOG), g_Config.bDisableFog); Button_SetCheck(GetDlgItem(hDlg, IDC_DISABLEFOG), g_Config.bDisableFog);
Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLEEFBCOPY), !g_Config.bEFBCopyDisable); Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLEEFBCOPY), !g_Config.bEFBCopyDisable);
Button_SetCheck(GetDlgItem(hDlg, IDC_ZTPSPEEDUP), g_Config.bZTPSpeedHack);
Button_SetCheck(GetDlgItem(hDlg, IDC_TEXFMT_OVERLAY), g_Config.bTexFmtOverlayEnable); Button_SetCheck(GetDlgItem(hDlg, IDC_TEXFMT_OVERLAY), g_Config.bTexFmtOverlayEnable);
Button_SetCheck(GetDlgItem(hDlg, IDC_TEXFMT_CENTER), g_Config.bTexFmtOverlayCenter); Button_SetCheck(GetDlgItem(hDlg, IDC_TEXFMT_CENTER), g_Config.bTexFmtOverlayCenter);
@ -226,6 +227,7 @@ struct TabAdvanced : public W32Util::Tab
g_Config.bDumpFrames = false; g_Config.bDumpFrames = false;
g_Config.bShowShaderErrors = true; g_Config.bShowShaderErrors = true;
g_Config.bUseNativeMips = true; g_Config.bUseNativeMips = true;
g_Config.bZTPSpeedHack = Button_GetCheck(GetDlgItem(hDlg, IDC_ZTPSPEEDUP)) ? true : false;
g_Config.iMaxAnisotropy = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY)) ? 16 : 1; g_Config.iMaxAnisotropy = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY)) ? 16 : 1;
g_Config.bForceFiltering = false; g_Config.bForceFiltering = false;

View File

@ -6,8 +6,6 @@
#define IDD_SETTINGS 103 #define IDD_SETTINGS 103
#define IDD_ADVANCED 105 #define IDD_ADVANCED 105
#define IDC_ADAPTER 1001 #define IDC_ADAPTER 1001
//#define IDC_ANTIALIASMODE 1002
//#define IDC_RESOLUTION 1003
#define IDC_VSYNC 1006 #define IDC_VSYNC 1006
#define IDC_ASPECT_16_9 1008 #define IDC_ASPECT_16_9 1008
#define IDC_ASPECT_4_3 1009 #define IDC_ASPECT_4_3 1009
@ -20,15 +18,10 @@
#define IDC_OVERLAYSTATS 1016 #define IDC_OVERLAYSTATS 1016
#define IDC_OVERLAYPROJSTATS 1017 #define IDC_OVERLAYPROJSTATS 1017
#define IDC_ENABLEEFBCOPY 1018 #define IDC_ENABLEEFBCOPY 1018
//#define IDC_EFBTORAM 1019
//#define IDC_EFBTOTEX 1020
#define IDC_TEXFMT_OVERLAY 1024 #define IDC_TEXFMT_OVERLAY 1024
#define IDC_TEXFMT_CENTER 1025 #define IDC_TEXFMT_CENTER 1025
#define IDC_ENABLEXFB 1026 #define IDC_ENABLEXFB 1026
#define IDC_FORCEANISOTROPY 1027 #define IDC_FORCEANISOTROPY 1027
//#define IDC_ENABLEXFB2 1027
//#define IDC_ENABLEREALXFB 1027
//#define IDC_LOADHIRESTEXTURE 1028
#define IDC_EFBSCALEDCOPY 1029 #define IDC_EFBSCALEDCOPY 1029
#define IDC_OSDHOTKEY 1030 #define IDC_OSDHOTKEY 1030
#define IDC_COMBO2 1040 #define IDC_COMBO2 1040
@ -37,7 +30,7 @@
#define IDC_SAFE_TEXTURE_CACHE_NORMAL 1042 #define IDC_SAFE_TEXTURE_CACHE_NORMAL 1042
#define IDC_RADIO3 1043 #define IDC_RADIO3 1043
#define IDC_SAFE_TEXTURE_CACHE_FAST 1043 #define IDC_SAFE_TEXTURE_CACHE_FAST 1043
//#define IDC_DISABLEMIPS 1100 #define IDC_ZTPSPEEDUP 1050
#define IDC_STATIC -1 #define IDC_STATIC -1
// Next default values for new objects // Next default values for new objects
@ -46,7 +39,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106 #define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1044 #define _APS_NEXT_CONTROL_VALUE 1045
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 102
#endif #endif
#endif #endif

View File

@ -46,7 +46,8 @@ BEGIN
LTEXT "&Aspect Ratio:",IDC_STATIC,9,40,48,8 LTEXT "&Aspect Ratio:",IDC_STATIC,9,40,48,8
COMBOBOX IDC_ASPECTRATIO,60,38,89,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_ASPECTRATIO,60,38,89,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "&Enable CPU->EFB access ",IDC_EFB_ACCESS_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,60,94,11 CONTROL "&Enable CPU->EFB access ",IDC_EFB_ACCESS_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,60,94,11
CONTROL "Enable &Safe Texture Cache",IDC_SAFE_TEXTURE_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,74,108,11 CONTROL "Enable &Safe Texture Cache",IDC_SAFE_TEXTURE_CACHE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,74,108,11
CONTROL "Safe",IDC_SAFE_TEXTURE_CACHE_SAFE,"Button",BS_AUTORADIOBUTTON,20,87,32,10 CONTROL "Safe",IDC_SAFE_TEXTURE_CACHE_SAFE,"Button",BS_AUTORADIOBUTTON,20,87,32,10
CONTROL "Normal",IDC_SAFE_TEXTURE_CACHE_NORMAL,"Button",BS_AUTORADIOBUTTON,52,87,40,10 CONTROL "Normal",IDC_SAFE_TEXTURE_CACHE_NORMAL,"Button",BS_AUTORADIOBUTTON,52,87,40,10
CONTROL "Fast",IDC_SAFE_TEXTURE_CACHE_FAST,"Button",BS_AUTORADIOBUTTON,92,87,32,10 CONTROL "Fast",IDC_SAFE_TEXTURE_CACHE_FAST,"Button",BS_AUTORADIOBUTTON,92,87,32,10
@ -56,76 +57,22 @@ IDD_ADVANCED DIALOGEX 0, 0, 244, 200
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
GROUPBOX "&Settings",IDC_STATIC,6,7,228,74 GROUPBOX "&Settings",IDC_STATIC,6,7,228,84
CONTROL "Overlay FPS counter",IDC_OVERLAYFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,18,82,8 CONTROL "Overlay FPS counter",IDC_OVERLAYFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,18,82,8
CONTROL "Disable Fog",IDC_DISABLEFOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,18,78,8 CONTROL "Disable Fog",IDC_DISABLEFOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,18,78,8
CONTROL "Enable Hotkey",IDC_OSDHOTKEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,33,87,8 CONTROL "Enable Hotkey",IDC_OSDHOTKEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,33,87,8
CONTROL "Enable EFB copy",IDC_ENABLEEFBCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,33,81,8 CONTROL "Enable EFB copy",IDC_ENABLEEFBCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,33,81,8
CONTROL "EFB Scaled Copy",IDC_EFBSCALEDCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,64,8 CONTROL "EFB Scaled Copy",IDC_EFBSCALEDCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,64,8
CONTROL "Enable &Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,48,87,8 CONTROL "Enable &Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,48,87,8
CONTROL "Enable 16x &anisotropy filtering",IDC_FORCEANISOTROPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,63,110,8 CONTROL "Enable 16x &anisotropy filtering",IDC_FORCEANISOTROPY,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,63,110,8
GROUPBOX "Debugging Tools",IDC_STATIC,7,148,228,46 GROUPBOX "Debugging Tools",IDC_STATIC,7,148,228,46
CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,159,90,8 CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,159,90,8
CONTROL "Enable TexFmt Overlay",IDC_TEXFMT_OVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,174,92,10 CONTROL "Enable TexFmt Overlay",IDC_TEXFMT_OVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,174,92,10
CONTROL "Centered",IDC_TEXFMT_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,174,52,10 CONTROL "Centered",IDC_TEXFMT_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,174,52,10
CONTROL "ZTP Speed-up Hack",IDC_ZTPSPEEDUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,76,78,10
END END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 181
TOPMARGIN, 7
BOTTOMMARGIN, 74
END
IDD_SETTINGS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 237
VERTGUIDE, 7
VERTGUIDE, 68
VERTGUIDE, 81
VERTGUIDE, 87
TOPMARGIN, 7
BOTTOMMARGIN, 176
END
IDD_ADVANCED, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 237
VERTGUIDE, 14
VERTGUIDE, 29
VERTGUIDE, 114
TOPMARGIN, 7
BOTTOMMARGIN, 195
HORZGUIDE, 18
HORZGUIDE, 33
HORZGUIDE, 49
HORZGUIDE, 156
END
IDD_ENHANCEMENTS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 217
VERTGUIDE, 16
VERTGUIDE, 74
TOPMARGIN, 7
BOTTOMMARGIN, 168
END
END
#endif // APSTUDIO_INVOKED
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View File

@ -54,6 +54,7 @@ BEGIN_EVENT_TABLE(GFXConfigDialogDX,wxDialog)
EVT_CHECKBOX(ID_FORCEANISOTROPY, GFXConfigDialogDX::EnhancementsSettingsChanged) EVT_CHECKBOX(ID_FORCEANISOTROPY, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_LOADHIRESTEXTURES, GFXConfigDialogDX::EnhancementsSettingsChanged) EVT_CHECKBOX(ID_LOADHIRESTEXTURES, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_EFBSCALEDCOPY, GFXConfigDialogDX::EnhancementsSettingsChanged) EVT_CHECKBOX(ID_EFBSCALEDCOPY, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_ZTPSPEEDHACK, GFXConfigDialogDX::EnhancementsSettingsChanged)
//Advanced Tab //Advanced Tab
EVT_CHECKBOX(ID_DISABLEFOG, GFXConfigDialogDX::AdvancedSettingsChanged) EVT_CHECKBOX(ID_DISABLEFOG, GFXConfigDialogDX::AdvancedSettingsChanged)
@ -131,6 +132,7 @@ void GFXConfigDialogDX::InitializeGUIValues()
m_HiresTextures->SetValue(g_Config.bHiresTextures); m_HiresTextures->SetValue(g_Config.bHiresTextures);
m_MSAAModeCB->SetSelection(g_Config.iMultisampleMode); m_MSAAModeCB->SetSelection(g_Config.iMultisampleMode);
m_EFBScaledCopy->SetValue(g_Config.bCopyEFBScaled); m_EFBScaledCopy->SetValue(g_Config.bCopyEFBScaled);
m_ZTPSpeedHack->SetValue(g_Config.bZTPSpeedHack);
//Advance //Advance
m_DisableFog->SetValue(g_Config.bDisableFog); m_DisableFog->SetValue(g_Config.bDisableFog);
@ -265,6 +267,10 @@ void GFXConfigDialogDX::CreateGUIControls()
sbEFBHacks = new wxStaticBoxSizer( new wxStaticBox( m_PageEnhancements, wxID_ANY, wxT("EFB hacks") ), wxVERTICAL ); sbEFBHacks = new wxStaticBoxSizer( new wxStaticBox( m_PageEnhancements, wxID_ANY, wxT("EFB hacks") ), wxVERTICAL );
m_EFBScaledCopy = new wxCheckBox( m_PageEnhancements, ID_EFBSCALEDCOPY, wxT("EFB scaled copy"), wxDefaultPosition, wxDefaultSize, 0 ); m_EFBScaledCopy = new wxCheckBox( m_PageEnhancements, ID_EFBSCALEDCOPY, wxT("EFB scaled copy"), wxDefaultPosition, wxDefaultSize, 0 );
wxStaticBoxSizer* sbOtherHacks;
sbOtherHacks = new wxStaticBoxSizer( new wxStaticBox( m_PageEnhancements, wxID_ANY, wxT("Other Hacks") ), wxVERTICAL );
m_ZTPSpeedHack = new wxCheckBox( m_PageEnhancements, ID_ZTPSPEEDHACK, wxT("ZTP Speed-Up Hack"), wxDefaultPosition, wxDefaultSize, 0 );
// Sizers // Sizers
wxBoxSizer* sEnhancements; wxBoxSizer* sEnhancements;
wxGridBagSizer* sTextureFilter; wxGridBagSizer* sTextureFilter;
@ -286,6 +292,14 @@ void GFXConfigDialogDX::CreateGUIControls()
sbEFBHacks->Add( sEFBHacks, 1, wxEXPAND, 5 ); sbEFBHacks->Add( sEFBHacks, 1, wxEXPAND, 5 );
sEnhancements->Add( sbEFBHacks, 0, wxEXPAND|wxALL, 5 ); sEnhancements->Add( sbEFBHacks, 0, wxEXPAND|wxALL, 5 );
wxGridBagSizer* sOtherHacks;
sOtherHacks = new wxGridBagSizer( 0, 0 );
sOtherHacks->SetFlexibleDirection( wxBOTH );
sOtherHacks->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
sOtherHacks->Add( m_ZTPSpeedHack, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sbOtherHacks->Add( sOtherHacks, 1, wxEXPAND, 5 );
sEnhancements->Add( sbOtherHacks, 0, wxEXPAND|wxALL, 5 );
m_PageEnhancements->SetSizer( sEnhancements ); m_PageEnhancements->SetSizer( sEnhancements );
m_PageEnhancements->Layout(); m_PageEnhancements->Layout();
sEnhancements->Fit( m_PageEnhancements ); sEnhancements->Fit( m_PageEnhancements );
@ -443,6 +457,9 @@ void GFXConfigDialogDX::EnhancementsSettingsChanged(wxCommandEvent& event)
case ID_EFBSCALEDCOPY: case ID_EFBSCALEDCOPY:
g_Config.bCopyEFBScaled = m_EFBScaledCopy->IsChecked(); g_Config.bCopyEFBScaled = m_EFBScaledCopy->IsChecked();
break; break;
case ID_ZTPSPEEDHACK:
g_Config.bZTPSpeedHack = m_ZTPSpeedHack->IsChecked();
break;
} }
UpdateGUI(); UpdateGUI();
} }

View File

@ -106,6 +106,7 @@ class GFXConfigDialogDX : public wxDialog
wxCheckBox *m_MaxAnisotropy; wxCheckBox *m_MaxAnisotropy;
wxCheckBox *m_HiresTextures; wxCheckBox *m_HiresTextures;
wxCheckBox *m_EFBScaledCopy; wxCheckBox *m_EFBScaledCopy;
wxCheckBox *m_ZTPSpeedHack;
//Advanced Tab //Advanced Tab
wxCheckBox *m_DisableFog; wxCheckBox *m_DisableFog;
@ -172,7 +173,8 @@ class GFXConfigDialogDX : public wxDialog
ID_ABOUT, ID_ABOUT,
ID_DIRERCT3D, ID_DIRERCT3D,
ID_PAGEENHANCEMENTS, ID_PAGEENHANCEMENTS,
ID_PAGEADVANCED ID_PAGEADVANCED,
ID_ZTPSPEEDHACK
}; };
void InitializeAdapters(); void InitializeAdapters();
void OnClose(wxCloseEvent& event); void OnClose(wxCloseEvent& event);

View File

@ -68,6 +68,7 @@ BEGIN_EVENT_TABLE(GFXConfigDialogOGL,wxDialog)
EVT_CHECKBOX(ID_DISABLEFOG, GFXConfigDialogOGL::AdvancedSettingsChanged) EVT_CHECKBOX(ID_DISABLEFOG, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_OSDHOTKEY, GFXConfigDialogOGL::AdvancedSettingsChanged) EVT_CHECKBOX(ID_OSDHOTKEY, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_HACK, GFXConfigDialogOGL::AdvancedSettingsChanged) EVT_CHECKBOX(ID_HACK, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_ZTPSPEEDHACK, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SAFETEXTURECACHE,GFXConfigDialogOGL::AdvancedSettingsChanged) EVT_CHECKBOX(ID_SAFETEXTURECACHE,GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_SAFE, GFXConfigDialogOGL::AdvancedSettingsChanged) EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_SAFE, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_NORMAL, GFXConfigDialogOGL::AdvancedSettingsChanged) EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_NORMAL, GFXConfigDialogOGL::AdvancedSettingsChanged)
@ -204,6 +205,7 @@ void GFXConfigDialogOGL::InitializeGUIValues()
m_WidescreenHack->SetValue(g_Config.bWidescreenHack); m_WidescreenHack->SetValue(g_Config.bWidescreenHack);
m_UseNativeMips->SetValue(g_Config.bUseNativeMips); m_UseNativeMips->SetValue(g_Config.bUseNativeMips);
m_EFBScaledCopy->SetValue(g_Config.bCopyEFBScaled); m_EFBScaledCopy->SetValue(g_Config.bCopyEFBScaled);
m_ZTPSpeedHack->SetValue(g_Config.bZTPSpeedHack);
// Enhancements // Enhancements
m_MaxAnisotropyCB->SetSelection(g_Config.iMaxAnisotropy - 1); m_MaxAnisotropyCB->SetSelection(g_Config.iMaxAnisotropy - 1);
m_ForceFiltering->SetValue(g_Config.bForceFiltering); m_ForceFiltering->SetValue(g_Config.bForceFiltering);
@ -291,7 +293,7 @@ void GFXConfigDialogOGL::InitializeGUITooltips()
wxT(" But it may also cause graphical errors and missing graphics.")); wxT(" But it may also cause graphical errors and missing graphics."));
m_Radio_CopyEFBToRAM->SetToolTip(wxT("[This option will apply immediately and does not require a restart to take effect.]")); m_Radio_CopyEFBToRAM->SetToolTip(wxT("[This option will apply immediately and does not require a restart to take effect.]"));
m_Radio_CopyEFBToGL->SetToolTip(wxT("[This option will apply immediately and does not require a restart to take effect.]")); m_Radio_CopyEFBToGL->SetToolTip(wxT("[This option will apply immediately and does not require a restart to take effect.]"));
m_ZTPSpeedHack->SetToolTip(wxT("Speeds up Hyrule Field in Zelda: Twilight Princess"));
// Utility // Utility
#ifdef _WIN32 #ifdef _WIN32
m_DumpFrames->SetToolTip( m_DumpFrames->SetToolTip(
@ -468,6 +470,7 @@ void GFXConfigDialogOGL::CreateGUIControls()
m_Radio_SafeTextureCache_Safe = new wxRadioButton(m_PageAdvanced, ID_RADIO_SAFETEXTURECACHE_SAFE, wxT("Safe"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); m_Radio_SafeTextureCache_Safe = new wxRadioButton(m_PageAdvanced, ID_RADIO_SAFETEXTURECACHE_SAFE, wxT("Safe"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_Radio_SafeTextureCache_Normal = new wxRadioButton(m_PageAdvanced, ID_RADIO_SAFETEXTURECACHE_NORMAL, wxT("Normal")); m_Radio_SafeTextureCache_Normal = new wxRadioButton(m_PageAdvanced, ID_RADIO_SAFETEXTURECACHE_NORMAL, wxT("Normal"));
m_Radio_SafeTextureCache_Fast = new wxRadioButton(m_PageAdvanced, ID_RADIO_SAFETEXTURECACHE_FAST, wxT("Fast")); m_Radio_SafeTextureCache_Fast = new wxRadioButton(m_PageAdvanced, ID_RADIO_SAFETEXTURECACHE_FAST, wxT("Fast"));
m_ZTPSpeedHack = new wxCheckBox( m_PageAdvanced, ID_ZTPSPEEDHACK, wxT("ZTP Speed-Up Hack"), wxDefaultPosition, wxDefaultSize, 0 );
// Sizers // Sizers
sHacks->Add(m_PhackvalueCB, 0, wxTOP, 0); sHacks->Add(m_PhackvalueCB, 0, wxTOP, 0);
@ -478,6 +481,7 @@ void GFXConfigDialogOGL::CreateGUIControls()
sbHacks->Add(m_Radio_SafeTextureCache_Normal, 0, wxALL, 5); sbHacks->Add(m_Radio_SafeTextureCache_Normal, 0, wxALL, 5);
sbHacks->Add(m_Radio_SafeTextureCache_Fast, 0, wxALL, 5); sbHacks->Add(m_Radio_SafeTextureCache_Fast, 0, wxALL, 5);
sHacks->Add(sbHacks, 0, wxEXPAND | (wxTOP), 5); sHacks->Add(sbHacks, 0, wxEXPAND | (wxTOP), 5);
sHacks->Add(m_ZTPSpeedHack, 0, wxEXPAND | (wxTOP), 0);
// Sizers // Sizers
sAdvanced = new wxBoxSizer(wxVERTICAL); sAdvanced = new wxBoxSizer(wxVERTICAL);
@ -704,6 +708,9 @@ void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
g_Config.bOSDHotKey = m_OSDHotKey->IsChecked(); g_Config.bOSDHotKey = m_OSDHotKey->IsChecked();
break; break;
// Hacks // Hacks
case ID_ZTPSPEEDHACK:
g_Config.bZTPSpeedHack = m_ZTPSpeedHack->IsChecked();
break;
case ID_SAFETEXTURECACHE: case ID_SAFETEXTURECACHE:
g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked(); g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked();
break; break;

View File

@ -128,6 +128,7 @@ class GFXConfigDialogOGL : public wxDialog
wxRadioButton *m_Radio_SafeTextureCache_Safe; wxRadioButton *m_Radio_SafeTextureCache_Safe;
wxRadioButton *m_Radio_SafeTextureCache_Normal; wxRadioButton *m_Radio_SafeTextureCache_Normal;
wxRadioButton *m_Radio_SafeTextureCache_Fast; wxRadioButton *m_Radio_SafeTextureCache_Fast;
wxCheckBox *m_ZTPSpeedHack;
// Screen size // Screen size
wxStaticText *m_TextScreenWidth, *m_TextScreenHeight, *m_TextScreenLeft, *m_TextScreenTop; wxStaticText *m_TextScreenWidth, *m_TextScreenHeight, *m_TextScreenLeft, *m_TextScreenTop;
wxSlider *m_SliderWidth, *m_SliderHeight, *m_SliderLeft, *m_SliderTop; wxSlider *m_SliderWidth, *m_SliderHeight, *m_SliderLeft, *m_SliderTop;
@ -182,6 +183,7 @@ class GFXConfigDialogOGL : public wxDialog
ID_RADIO_SAFETEXTURECACHE_FAST, ID_RADIO_SAFETEXTURECACHE_FAST,
ID_HACK, ID_HACK,
ID_PHACKVALUE, ID_PHACKVALUE,
ID_ZTPSPEEDHACK,
ID_DUMPTEXTURES, ID_DUMPTEXTURES,
ID_HIRESTEXTURES, ID_HIRESTEXTURES,