mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Add's a little hack to try and reduce flicking in some games.
Can also break some games or cause them to have flickering so I made it so it can be turned on and off :P Original fix by orbb then modified by LuisR14 and me. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3274 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
8ee7cfa6c6
commit
d6b86232e0
@ -81,6 +81,7 @@ void Config::Load()
|
|||||||
iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, 0);
|
iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, 0);
|
||||||
iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
|
iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
|
||||||
iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToRAM, 0);
|
iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToRAM, 0);
|
||||||
|
iniFile.Get("Hacks", "RemoveFlicker", &bRemoveFlicker, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::GameIniLoad() {
|
void Config::GameIniLoad() {
|
||||||
@ -117,7 +118,6 @@ void Config::GameIniLoad() {
|
|||||||
|
|
||||||
if (iniFile->Exists("Video", "Hack"))
|
if (iniFile->Exists("Video", "Hack"))
|
||||||
iniFile->Get("Video", "Hack", &iPhackvalue, 0);
|
iniFile->Get("Video", "Hack", &iPhackvalue, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::Save()
|
void Config::Save()
|
||||||
@ -167,6 +167,8 @@ void Config::Save()
|
|||||||
iniFile.Set("Hacks", "EFBCopyDisableHotKey", bEFBCopyDisableHotKey);
|
iniFile.Set("Hacks", "EFBCopyDisableHotKey", bEFBCopyDisableHotKey);
|
||||||
iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToRAM);
|
iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToRAM);
|
||||||
|
|
||||||
|
iniFile.Set("Hacks", "RemoveFlicker", bRemoveFlicker);
|
||||||
|
|
||||||
iniFile.Save(FULL_CONFIG_DIR "gfx_opengl.ini");
|
iniFile.Save(FULL_CONFIG_DIR "gfx_opengl.ini");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,7 @@ struct Config
|
|||||||
bool bPhackvalue1, bPhackvalue2;
|
bool bPhackvalue1, bPhackvalue2;
|
||||||
float fhackvalue1, fhackvalue2;
|
float fhackvalue1, fhackvalue2;
|
||||||
bool bProjHack1;
|
bool bProjHack1;
|
||||||
|
bool bRemoveFlicker;
|
||||||
|
|
||||||
int iLog; // CONF_ bits
|
int iLog; // CONF_ bits
|
||||||
int iSaveTargetId;
|
int iSaveTargetId;
|
||||||
|
@ -62,7 +62,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
|||||||
EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged)
|
EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_DISABLEFOG, ConfigDialog::AdvancedSettingsChanged)
|
EVT_CHECKBOX(ID_DISABLEFOG, ConfigDialog::AdvancedSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged)
|
EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged)
|
||||||
//EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged)
|
EVT_CHECKBOX(ID_REMOVEFLICKER, ConfigDialog::AdvancedSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_HACK, ConfigDialog::AdvancedSettingsChanged)
|
EVT_CHECKBOX(ID_HACK, ConfigDialog::AdvancedSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged)
|
EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_DSTALPHAPASS,ConfigDialog::AdvancedSettingsChanged)
|
EVT_CHECKBOX(ID_DSTALPHAPASS,ConfigDialog::AdvancedSettingsChanged)
|
||||||
@ -364,7 +364,7 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
|
|
||||||
// Hacks controls
|
// Hacks controls
|
||||||
m_SafeTextureCache = new wxCheckBox(m_PageAdvanced, ID_SAFETEXTURECACHE, wxT("Use Safe texture cache"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_SafeTextureCache = new wxCheckBox(m_PageAdvanced, ID_SAFETEXTURECACHE, wxT("Use Safe texture cache"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
m_RemoveFlicker = new wxCheckBox(m_PageAdvanced, ID_REMOVEFLICKER, wxT("Remove Flicker"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_PhackvalueCB = new wxChoice(m_PageAdvanced, ID_PHACKVALUE, wxDefaultPosition, wxDefaultSize, arrayStringFor_PhackvalueCB, 0, wxDefaultValidator);
|
m_PhackvalueCB = new wxChoice(m_PageAdvanced, ID_PHACKVALUE, wxDefaultPosition, wxDefaultSize, arrayStringFor_PhackvalueCB, 0, wxDefaultValidator);
|
||||||
m_PhackvalueCB->Append(wxT("None"));
|
m_PhackvalueCB->Append(wxT("None"));
|
||||||
m_PhackvalueCB->Append(wxT("Zelda Twilight Princess Bloom hack"));
|
m_PhackvalueCB->Append(wxT("Zelda Twilight Princess Bloom hack"));
|
||||||
@ -377,19 +377,23 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
|
|
||||||
// Default values
|
// Default values
|
||||||
m_SafeTextureCache->SetValue(g_Config.bSafeTextureCache);
|
m_SafeTextureCache->SetValue(g_Config.bSafeTextureCache);
|
||||||
|
m_RemoveFlicker->SetValue(g_Config.bRemoveFlicker);
|
||||||
|
|
||||||
// Tool tips
|
// Tool tips
|
||||||
m_SafeTextureCache->SetToolTip(wxT("This is useful to prevent Metroid Prime from crashing, but can cause problems in other games."
|
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"
|
"\n[This option will apply immediately and does not require a restart. However it may not"
|
||||||
" be entirely safe to change it midgames.]"));
|
" be entirely safe to change it midgames.]"));
|
||||||
|
|
||||||
m_DstAlphaPass->SetToolTip(wxT("This renders a second time to set alpha to a constant value,"
|
m_RemoveFlicker->SetToolTip(wxT("This is used to try and removing flickering in some games."));
|
||||||
|
|
||||||
|
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."));
|
"\nDisabling it may speed up some games, but could also cause glitches."));
|
||||||
m_DisableFog->SetToolTip(wxT("This option should not require a restart."));
|
m_DisableFog->SetToolTip(wxT("This option should not require a restart."));
|
||||||
|
|
||||||
// Sizers
|
// Sizers
|
||||||
sHacks = new wxGridBagSizer(0, 0);
|
sHacks = new wxGridBagSizer(0, 0);
|
||||||
sHacks->Add(m_SafeTextureCache, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
|
sHacks->Add(m_SafeTextureCache, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||||
|
sHacks->Add(m_RemoveFlicker,wxGBPosition(1, 1),wxGBSpan(1, 1), wxALL, 5);
|
||||||
sHacks->Add(m_PhackvalueCB, wxGBPosition(0, 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 = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks"));
|
||||||
@ -520,7 +524,7 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
|||||||
g_Config.iPhackvalue = m_PhackvalueCB->GetSelection();
|
g_Config.iPhackvalue = m_PhackvalueCB->GetSelection();
|
||||||
if (g_Config.iPhackvalue >= 0)
|
if (g_Config.iPhackvalue >= 0)
|
||||||
{
|
{
|
||||||
g_Config.UpdateHack();
|
g_Config.UpdateHack();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -596,6 +600,9 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event)
|
|||||||
case ID_SAFETEXTURECACHE:
|
case ID_SAFETEXTURECACHE:
|
||||||
g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked();
|
g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked();
|
||||||
break;
|
break;
|
||||||
|
case ID_REMOVEFLICKER:
|
||||||
|
g_Config.bRemoveFlicker = m_RemoveFlicker->IsChecked();
|
||||||
|
break;
|
||||||
case ID_HACK:
|
case ID_HACK:
|
||||||
g_Config.bHack = m_Hack->IsChecked();
|
g_Config.bHack = m_Hack->IsChecked();
|
||||||
break;
|
break;
|
||||||
|
@ -119,6 +119,7 @@ class ConfigDialog : public wxDialog
|
|||||||
wxCheckBox *m_DumpTextures;
|
wxCheckBox *m_DumpTextures;
|
||||||
wxCheckBox *m_HiresTextures;
|
wxCheckBox *m_HiresTextures;
|
||||||
wxCheckBox *m_DumpEFBTarget;
|
wxCheckBox *m_DumpEFBTarget;
|
||||||
|
wxCheckBox *m_RemoveFlicker;
|
||||||
wxCheckBox *m_DumpFrames;
|
wxCheckBox *m_DumpFrames;
|
||||||
wxCheckBox *m_FreeLook;
|
wxCheckBox *m_FreeLook;
|
||||||
wxStaticBox * m_StaticBox_EFB;
|
wxStaticBox * m_StaticBox_EFB;
|
||||||
@ -184,6 +185,7 @@ class ConfigDialog : public wxDialog
|
|||||||
ID_DUMPFRAMES,
|
ID_DUMPFRAMES,
|
||||||
ID_FREELOOK,
|
ID_FREELOOK,
|
||||||
ID_TEXTUREPATH,
|
ID_TEXTUREPATH,
|
||||||
|
ID_REMOVEFLICKER,
|
||||||
|
|
||||||
ID_CHECKBOX_DISABLECOPYEFB,
|
ID_CHECKBOX_DISABLECOPYEFB,
|
||||||
ID_EFBCOPYDISABLEHOTKEY,
|
ID_EFBCOPYDISABLEHOTKEY,
|
||||||
|
@ -1218,7 +1218,37 @@ void Renderer::SwapBuffers()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Copy the rendered frame to the real window
|
// Copy the rendered frame to the real window
|
||||||
OpenGL_SwapBuffers();
|
// [ fix for Fragile by kamui_kun ...
|
||||||
|
// TODO get the fix to read the whole screen not just 5 pixels
|
||||||
|
if (g_Config.bRemoveFlicker)
|
||||||
|
{
|
||||||
|
BOOL pass = FALSE;
|
||||||
|
char pixels [15];
|
||||||
|
short color[] = {GL_RED, GL_GREEN, GL_BLUE};
|
||||||
|
|
||||||
|
for( int i = 0; i < 14; i)
|
||||||
|
{
|
||||||
|
for( int c = 0; c < 3; c++,i+=5)
|
||||||
|
{
|
||||||
|
glReadPixels(300, 200, 1, 1, color[c], GL_BYTE, &pixels[i]);
|
||||||
|
glReadPixels(300, 400, 1, 1, color[c], GL_BYTE, &pixels[i+1]);
|
||||||
|
glReadPixels(700, 200, 1, 1, color[c], GL_BYTE, &pixels[i+2]);
|
||||||
|
glReadPixels(700, 400, 1, 1, color[c], GL_BYTE, &pixels[i+3]);
|
||||||
|
glReadPixels(500, 300, 1, 1, color[c], GL_BYTE, &pixels[i+4]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for( int p = 0; p < 14; p++ )
|
||||||
|
{
|
||||||
|
if( pixels[p] != 0 )
|
||||||
|
pass = TRUE;
|
||||||
|
}
|
||||||
|
if( pass )
|
||||||
|
OpenGL_SwapBuffers();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OpenGL_SwapBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
glClearColor(0, 0, 0, 0);
|
glClearColor(0, 0, 0, 0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
Loading…
Reference in New Issue
Block a user