Make FIFO watermark tightness configurable instead of hardcoding it.

To change it, right click the affected game in the iso list, select Properties, and enter some constant for "Watermark tightness". Reasonable values range from 20 to 200.

FIFO seems unoverflowable on my computer no matter what I set this value to, so test whether tuning the value helps you ;P


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5907 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX 2010-07-18 15:47:28 +00:00
parent e8ed50854a
commit 378d3aaa52
6 changed files with 38 additions and 4 deletions

View File

@ -71,6 +71,8 @@ struct SConfig
// framelimit choose
int m_Framelimit;
bool b_UseFPS;
// FIFO watermark tightness
int m_WatermarkTightness;
// other interface settings
bool m_InterfaceToolbar;
bool m_InterfaceStatusbar;

View File

@ -321,6 +321,10 @@ void CISOProperties::CreateGUIControls(bool IsWad)
arrayStringFor_Hack.Add(_("Skies of Arcadia"));
Hack = new wxChoice(m_GameConfig, ID_HACK, wxDefaultPosition, wxDefaultSize, arrayStringFor_Hack, 0, wxDefaultValidator);
WMTightnessText = new wxStaticText(m_GameConfig, ID_WMTIGHTNESS_TEXT, wxT("Watermark tightness: "), wxDefaultPosition, wxDefaultSize);
WMTightness = new wxTextCtrl(m_GameConfig, ID_WMTIGHTNESS, wxT(""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC));
WMTightness->SetToolTip(wxT("Change this if you get lots of FIFO overflow errors. Reasonable values range from 0 to 200."));
// Emulation State
sEmuState = new wxBoxSizer(wxHORIZONTAL);
EmuStateText = new wxStaticText(m_GameConfig, ID_EMUSTATE_TEXT, _("Emulation State: "), wxDefaultPosition, wxDefaultSize);
@ -348,8 +352,14 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sbVideoOverrides->Add(DstAlphaPass, 0, wxEXPAND|wxLEFT, 5);
sbVideoOverrides->Add(UseXFB, 0, wxEXPAND|wxLEFT, 5);
sbVideoOverrides->Add(BPHack, 0, wxEXPAND|wxLEFT, 5);
sbVideoOverrides->Add(Hacktext, 0, wxEXPAND|wxLEFT, 5);
sbVideoOverrides->Add(Hack, 0, wxEXPAND|wxLEFT, 5);
wxFlexGridSizer* fifosizer = new wxFlexGridSizer(2, 2, 0, 0);
fifosizer->Add(Hacktext, 0, wxLEFT, 5);
fifosizer->Add(Hack, 0, wxEXPAND|wxLEFT, 5);
fifosizer->Add(WMTightnessText, 0, wxLEFT, 5);
fifosizer->Add(WMTightness, 0, wxEXPAND|wxLEFT, 5);
sbVideoOverrides->Add(fifosizer);
sbGameConfig->Add(sbCoreOverrides, 0, wxEXPAND);
sbGameConfig->Add(sbWiiOverrides, 0, wxEXPAND);
sbGameConfig->Add(sbVideoOverrides, 0, wxEXPAND);
@ -846,6 +856,11 @@ void CISOProperties::LoadGameConfig()
else
BPHack->Set3StateValue(wxCHK_UNDETERMINED);
if (GameIni.Get("Video", "FIFOWatermarkTightness", &sTemp))
WMTightness->SetValue(wxString(sTemp.c_str(), *wxConvCurrent));
else
WMTightness->SetValue(wxT("50"));
GameIni.Get("Video", "ProjectionHack", &iTemp, -1);
Hack->SetSelection(iTemp);
@ -931,6 +946,15 @@ bool CISOProperties::SaveGameConfig()
else
GameIni.Set("Video", "ProjectionHack", Hack->GetSelection());
if (WMTightness->GetValue().size() == 0)
GameIni.DeleteKey("Video", "FIFOWatermarkTightness");
else
{
long val;
WMTightness->GetValue().ToLong(&val);
GameIni.Set("Video", "FIFOWatermarkTightness", (int)val);
}
if (EmuState->GetSelection() == -1)
GameIni.DeleteKey("EmuState", "EmulationStateId");
else

View File

@ -93,6 +93,8 @@ class CISOProperties : public wxDialog
wxStaticText *Hacktext;
wxArrayString arrayStringFor_Hack;
wxChoice *Hack;
wxStaticText *WMTightnessText;
wxTextCtrl *WMTightness;
wxButton *EditConfig;
wxStaticText *EmuStateText;
@ -169,6 +171,8 @@ class CISOProperties : public wxDialog
ID_USEXFB,
ID_HACK_TEXT,
ID_HACK,
ID_WMTIGHTNESS_TEXT,
ID_WMTIGHTNESS,
ID_ENABLEPROGRESSIVESCAN,
ID_ENABLEWIDESCREEN,
ID_EDITCONFIG,

View File

@ -495,7 +495,7 @@ void Write16(const u16 _Value, const u32 _Address)
case FIFO_HI_WATERMARK_HI:
WriteHigh((u32 &)fifo.CPHiWatermark, _Value);
// Tune this when you see lots of FIFO overflown by GatherPipe
HiWatermark_Tighter = fifo.CPHiWatermark - 32 * 20;
HiWatermark_Tighter = fifo.CPHiWatermark - 32 * g_ActiveConfig.iFIFOWatermarkTightness;
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_HI : %04x", _Value);
break;
@ -616,7 +616,7 @@ void STACKALIGN GatherPipeBursted()
}
_assert_msg_(COMMANDPROCESSOR, fifo.CPReadWriteDistance <= fifo.CPEnd - fifo.CPBase,
"FIFO is overflown by GatherPipe !\nCPU thread is too fast, lower the HiWatermark may help.");
"FIFO is overflown by GatherPipe !\nCPU thread is too fast, try changing the watermark tightness in the game properties.");
// check if we are in sync
_assert_msg_(COMMANDPROCESSOR, fifo.CPWritePointer == *(g_VideoInitialize.Fifo_CPUWritePointer), "FIFOs linked but out of sync");

View File

@ -95,6 +95,7 @@ void VideoConfig::Load(const char *ini_file)
iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToTexture, false);
iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
iniFile.Get("Hacks", "FIFOBPHack", &bFIFOBPhack, false);
iniFile.Get("Hacks", "FIFOWatermarkTightness", &iFIFOWatermarkTightness, 50);
iniFile.Get("Hacks", "ProjectionHack", &iPhackvalue, 0);
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
@ -145,6 +146,8 @@ void VideoConfig::GameIniLoad(const char *ini_file)
iniFile.Get("Video", "UseRealXFB", &bUseRealXFB);
if (iniFile.Exists("Video", "FIFOBPHack"))
iniFile.Get("Video", "FIFOBPHack", &bFIFOBPhack);
if (iniFile.Exists("Video", "FIFOWatermarkTightness"))
iniFile.Get("Video", "FIFOWatermarkTightness", &iFIFOWatermarkTightness);
if (iniFile.Exists("Video", "ProjectionHack"))
iniFile.Get("Video", "ProjectionHack", &iPhackvalue);
if (iniFile.Exists("Video", "UseNativeMips"))

View File

@ -120,6 +120,7 @@ struct VideoConfig
bool bSafeTextureCache;
int iSafeTextureCache_ColorSamples;
bool bFIFOBPhack;
int iFIFOWatermarkTightness;
int iPhackvalue;
bool bPhackvalue1, bPhackvalue2;
float fhackvalue1, fhackvalue2;