Added a speed hack for the MMU games. The speed hack is enabled by default. "Enable BAT" in the game properties enables the old accurate emulation behaviour.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6187 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2010-09-06 14:43:28 +00:00
parent 5948865bcc
commit c710ae7529
8 changed files with 24 additions and 4 deletions

View File

@ -294,6 +294,7 @@ void SConfig::LoadSettings()
ini.Get("Core", "MMU", &m_LocalCoreStartupParameter.bMMU, false);
ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0);
ini.Get("Core", "AlternateRFI", &m_LocalCoreStartupParameter.bAlternateRFI, false);
ini.Get("Core", "BAT", &m_LocalCoreStartupParameter.bMMUBAT, false);
ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default
ini.Get("Core", "UseFPS", &b_UseFPS, false); // use vps as default

View File

@ -47,7 +47,7 @@ SCoreStartupParameter::SCoreStartupParameter()
bLockThreads(false),
bEnableCheats(false),
bRunCompareServer(false), bRunCompareClient(false),
bMMU(false), iTLBHack(0), bAlternateRFI(false),
bMMU(false), bMMUBAT(false), iTLBHack(0), bAlternateRFI(false),
SelectedLanguage(0), bWii(false),
bConfirmStop(false), bHideCursor(false),
bAutoHideCursor(false), bUsePanicHandlers(true),
@ -71,6 +71,7 @@ void SCoreStartupParameter::LoadDefaults()
bLockThreads = true;
bEnableFPRF = false;
bMMU = false;
bMMUBAT = false;
iTLBHack = 0;
bAlternateRFI = false;
SelectedLanguage = 0;

View File

@ -79,6 +79,7 @@ struct SCoreStartupParameter
bool bRunCompareClient;
bool bMMU;
bool bMMUBAT;
int iTLBHack;
bool bAlternateRFI;

View File

@ -947,7 +947,7 @@ u32 TranslateBlockAddress(const u32 addr, const XCheckTLBFlag _Flag)
u32 TranslateAddress(const u32 _Address, const XCheckTLBFlag _Flag)
{
// TODO: Check for MSR data/instruction address translation flag before translating
u32 tlb_addr = TranslateBlockAddress(_Address, _Flag);
u32 tlb_addr = Core::g_CoreStartupParameter.bMMUBAT?TranslateBlockAddress(_Address, _Flag):0;
if (tlb_addr == 0)
{
tlb_addr = TranslatePageAddress(_Address, _Flag);

View File

@ -2798,6 +2798,7 @@ DEFINE_LUA_FUNCTION(emulua_loadrom, "filename")
game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
game_ini.Get("Core", "MMU", &StartUp.bMMU, StartUp.bMMU);
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);
// Wii settings

View File

@ -107,6 +107,7 @@ bool BootCore(const std::string& _rFilename)
game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
game_ini.Get("Core", "MMU", &StartUp.bMMU, StartUp.bMMU);
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);
// Wii settings

View File

@ -291,7 +291,9 @@ void CISOProperties::CreateGUIControls(bool IsWad)
CPUThread = new wxCheckBox(m_GameConfig, ID_USEDUALCORE, _("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
SkipIdle = new wxCheckBox(m_GameConfig, ID_IDLESKIP, _("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
MMU = new wxCheckBox(m_GameConfig, ID_MMU, _("Enable MMU"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
MMU->SetToolTip(wxT("Enables the Memory Management Unit, needed for some games (slow)."));
MMU->SetToolTip(wxT("Enables the Memory Management Unit, needed for some games. (ON = Compatible, OFF = Fast)"));
MMUBAT = new wxCheckBox(m_GameConfig, ID_MMUBAT, _("Enable BAT"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
MMUBAT->SetToolTip(wxT("Enables Block Address Translation (BAT); a function of the Memory Management Unit. Accurate to the hardware, but slow to emulate. (ON = Compatible, OFF = Fast)"));
TLBHack = new wxCheckBox(m_GameConfig, ID_TLBHACK, _("MMU Speed Hack"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
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);
@ -354,6 +356,7 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sbCoreOverrides->Add(CPUThread, 0, wxEXPAND|wxLEFT, 5);
sbCoreOverrides->Add(SkipIdle, 0, wxEXPAND|wxLEFT, 5);
sbCoreOverrides->Add(MMU, 0, wxEXPAND|wxLEFT, 5);
sbCoreOverrides->Add(MMUBAT, 0, wxEXPAND|wxLEFT, 5);
sbCoreOverrides->Add(TLBHack, 0, wxEXPAND|wxLEFT, 5);
sbCoreOverrides->Add(AlternateRFI, 0, wxEXPAND|wxLEFT, 5);
sbWiiOverrides->Add(EnableProgressiveScan, 0, wxEXPAND|wxLEFT, 5);
@ -824,6 +827,11 @@ void CISOProperties::LoadGameConfig()
else
MMU->Set3StateValue(wxCHK_UNDETERMINED);
if (GameIni.Get("Core", "BAT", &bTemp))
MMUBAT->Set3StateValue((wxCheckBoxState)bTemp);
else
MMUBAT->Set3StateValue(wxCHK_UNDETERMINED);
if (GameIni.Get("Core", "TLBHack", &bTemp))
TLBHack->Set3StateValue((wxCheckBoxState)bTemp);
else
@ -920,6 +928,11 @@ bool CISOProperties::SaveGameConfig()
else
GameIni.Set("Core", "MMU", MMU->Get3StateValue());
if (MMUBAT->Get3StateValue() == wxCHK_UNDETERMINED)
GameIni.DeleteKey("Core", "BAT");
else
GameIni.Set("Core", "BAT", MMUBAT->Get3StateValue());
if (TLBHack->Get3StateValue() == wxCHK_UNDETERMINED)
GameIni.DeleteKey("Core", "TLBHack");
else

View File

@ -84,7 +84,8 @@ class CISOProperties : public wxDialog
wxStaticText *OverrideText;
// Core
wxCheckBox *CPUThread, *SkipIdle, *MMU, *AlternateRFI, *TLBHack;
wxCheckBox *CPUThread, *SkipIdle, *MMU, *MMUBAT, *TLBHack;
wxCheckBox *AlternateRFI;
// Wii
wxCheckBox *EnableProgressiveScan, *EnableWideScreen;
// Video
@ -165,6 +166,7 @@ class CISOProperties : public wxDialog
ID_USEDUALCORE,
ID_IDLESKIP,
ID_MMU,
ID_MMUBAT,
ID_TLBHACK,
ID_RFI,
ID_FORCEFILTERING,