Make address translation respect the CPU translation mode.

The PowerPC CPU has bits in MSR (DR and IR) which control whether
addresses are translated. We should respect these instead of mixing
physical addresses and translated addresses into the same address space.

This is mostly mass-renaming calls to memory accesses APIs from places
which expect address translation to use a different version from those
which do not expect address translation.

This does very little on its own, but it's the first step to a correct BAT
implementation.
This commit is contained in:
magumagu
2015-01-17 13:17:36 -08:00
parent d9988ee9b5
commit ac54c6a4e2
59 changed files with 816 additions and 617 deletions

View File

@ -298,7 +298,7 @@ void CCodeWindow::StepOver()
{
if (CCPU::IsStepping())
{
UGeckoInstruction inst = Memory::Read_Instruction(PC);
UGeckoInstruction inst = PowerPC::HostRead_Instruction(PC);
if (inst.LK)
{
PowerPC::breakpoints.ClearAllTemporary();
@ -329,7 +329,7 @@ void CCodeWindow::StepOut()
u64 steps = 0;
PowerPC::CoreMode oldMode = PowerPC::GetMode();
PowerPC::SetMode(PowerPC::MODE_INTERPRETER);
UGeckoInstruction inst = Memory::Read_Instruction(PC);
UGeckoInstruction inst = PowerPC::HostRead_Instruction(PC);
while (inst.hex != 0x4e800020 && steps < timeout) // check for blr
{
if (inst.LK)
@ -347,7 +347,7 @@ void CCodeWindow::StepOut()
PowerPC::SingleStep();
++steps;
}
inst = Memory::Read_Instruction(PC);
inst = PowerPC::HostRead_Instruction(PC);
}
PowerPC::SingleStep();
@ -604,7 +604,7 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event)
bool found = false;
for (u32 addr = 0x80000000; addr < 0x80180000; addr += 4)
{
const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr));
const char *name = PPCTables::GetInstructionName(PowerPC::HostRead_U32(addr));
if (name && (wx_name == name))
{
NOTICE_LOG(POWERPC, "Found %s at %08x", wx_name.c_str(), addr);