Merge pull request #5420 from JosJuice/elf-setupbat

Use SetupBAT in Boot_ELF
This commit is contained in:
Leo Lam 2017-05-14 15:29:27 +02:00 committed by GitHub
commit ad27e90263
2 changed files with 5 additions and 21 deletions

View File

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

View File

@ -67,28 +67,10 @@ bool CBoot::Boot_ELF(const std::string& filename)
if (!reader.LoadIntoMemory())
return false;
// Set up MSR and the BAT SPR registers.
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr);
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))
const bool is_wii = IsElfWii(filename);
if (is_wii)
HID4.SBE = 1;
PowerPC::DBATUpdated();
PowerPC::IBATUpdated();
SetupBAT(is_wii);
if (!reader.LoadSymbols())
{