Use SetupBAT in Boot_ELF

Sigh...
This commit is contained in:
JosJuice 2017-05-14 15:18:58 +02:00
parent 460459fb7d
commit 41b3b05cfe
2 changed files with 5 additions and 21 deletions

View File

@ -393,6 +393,8 @@ bool CBoot::BootUp()
if (!Boot_ELF(_StartupPara.m_strFilename)) if (!Boot_ELF(_StartupPara.m_strFilename))
return false; return false;
// Note: Boot_ELF calls HLE::PatchFunctions()
UpdateDebugger_MapLoaded(); UpdateDebugger_MapLoaded();
Dolphin_Debugger::AddAutoBreakpoints(); Dolphin_Debugger::AddAutoBreakpoints();
break; break;

View File

@ -67,28 +67,10 @@ bool CBoot::Boot_ELF(const std::string& filename)
if (!reader.LoadIntoMemory()) if (!reader.LoadIntoMemory())
return false; return false;
// Set up MSR and the BAT SPR registers. const bool is_wii = IsElfWii(filename);
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr); if (is_wii)
m_MSR.FP = 1;
m_MSR.DR = 1;
m_MSR.IR = 1;
m_MSR.EE = 1;
PowerPC::ppcState.spr[SPR_IBAT0U] = 0x80001fff;
PowerPC::ppcState.spr[SPR_IBAT0L] = 0x00000002;
PowerPC::ppcState.spr[SPR_IBAT4U] = 0x90001fff;
PowerPC::ppcState.spr[SPR_IBAT4L] = 0x10000002;
PowerPC::ppcState.spr[SPR_DBAT0U] = 0x80001fff;
PowerPC::ppcState.spr[SPR_DBAT0L] = 0x00000002;
PowerPC::ppcState.spr[SPR_DBAT1U] = 0xc0001fff;
PowerPC::ppcState.spr[SPR_DBAT1L] = 0x0000002a;
PowerPC::ppcState.spr[SPR_DBAT4U] = 0x90001fff;
PowerPC::ppcState.spr[SPR_DBAT4L] = 0x10000002;
PowerPC::ppcState.spr[SPR_DBAT5U] = 0xd0001fff;
PowerPC::ppcState.spr[SPR_DBAT5L] = 0x1000002a;
if (IsElfWii(filename))
HID4.SBE = 1; HID4.SBE = 1;
PowerPC::DBATUpdated(); SetupBAT(is_wii);
PowerPC::IBATUpdated();
if (!reader.LoadSymbols()) if (!reader.LoadSymbols())
{ {