Make EnableBATs an option instead of disabling it entirely

This commit is contained in:
Fiora
2014-10-15 06:45:49 -07:00
parent 536b8d6695
commit 719326df65
6 changed files with 22 additions and 9 deletions

View File

@ -966,12 +966,14 @@ u32 TranslateAddress(const u32 _Address, const XCheckTLBFlag _Flag)
// Check MSR[DR] bit before translating data addresses
//if (((_Flag == FLAG_READ) || (_Flag == FLAG_WRITE)) && !(MSR & (1 << (31 - 27)))) return _Address;
// Technically we should do this, but no known games, even heavy MMU ones, use any custom BATs whatsoever,
// so it's a waste of time and should never succeed (given the default BATs are already handled in
// ReadFromHardware/WriteToHardware).
//u32 tlb_addr = TranslateBlockAddress(_Address, _Flag);
//if (!tlb_addr)
// return tlb_addr;
// Technically we should do this, but almost no games, even heavy MMU ones, use any custom BATs whatsoever,
// so only do it where it's really needed.
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bBAT)
{
u32 tlb_addr = TranslateBlockAddress(_Address, _Flag);
if (tlb_addr)
return tlb_addr;
}
return TranslatePageAddress(_Address, _Flag);
}
} // namespace