mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
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:
@ -86,7 +86,7 @@ void PPCSymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const std::string& nam
|
||||
|
||||
Symbol *PPCSymbolDB::GetSymbolFromAddr(u32 addr)
|
||||
{
|
||||
if (!Memory::IsRAMAddress(addr))
|
||||
if (!PowerPC::HostIsRAMAddress(addr))
|
||||
return nullptr;
|
||||
|
||||
XFuncMap::iterator it = functions.find(addr);
|
||||
@ -333,11 +333,11 @@ bool PPCSymbolDB::LoadMap(const std::string& filename, bool bad)
|
||||
if (!good)
|
||||
{
|
||||
// check for BLR before function
|
||||
u32 opcode = Memory::Read_Instruction(vaddress - 4);
|
||||
u32 opcode = PowerPC::HostRead_Instruction(vaddress - 4);
|
||||
if (opcode == 0x4e800020)
|
||||
{
|
||||
// check for BLR at end of function
|
||||
opcode = Memory::Read_Instruction(vaddress + size - 4);
|
||||
opcode = PowerPC::HostRead_Instruction(vaddress + size - 4);
|
||||
if (opcode == 0x4e800020)
|
||||
good = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user