Merge pull request #1283 from FioraAeterna/removebats

MMU: disable BAT resolution
This commit is contained in:
comex 2014-10-14 01:14:14 -04:00
commit 6650f8922d
1 changed files with 7 additions and 15 deletions

View File

@ -966,20 +966,12 @@ 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;
u32 tlb_addr = TranslateBlockAddress(_Address, _Flag);
if (tlb_addr == 0)
{
tlb_addr = TranslatePageAddress(_Address, _Flag);
if (tlb_addr != 0)
{
return tlb_addr;
}
}
else
{
return tlb_addr;
}
return 0;
// 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;
return TranslatePageAddress(_Address, _Flag);
}
} // namespace