mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 15:55:31 +01:00
Split SetupBAT into SetupMSR and SetupBAT
This commit is contained in:
parent
651340826d
commit
4726c9075f
@ -358,6 +358,7 @@ bool CBoot::BootUp()
|
|||||||
if (dolWii)
|
if (dolWii)
|
||||||
{
|
{
|
||||||
HID4.SBE = 1;
|
HID4.SBE = 1;
|
||||||
|
SetupMSR();
|
||||||
SetupBAT(dolWii);
|
SetupBAT(dolWii);
|
||||||
|
|
||||||
// Because there is no TMD to get the requested system (IOS) version from,
|
// Because there is no TMD to get the requested system (IOS) version from,
|
||||||
|
@ -54,6 +54,7 @@ private:
|
|||||||
static bool Boot_ELF(const std::string& filename);
|
static bool Boot_ELF(const std::string& filename);
|
||||||
static bool Boot_WiiWAD(const std::string& filename);
|
static bool Boot_WiiWAD(const std::string& filename);
|
||||||
|
|
||||||
|
static void SetupMSR();
|
||||||
static void SetupBAT(bool is_wii);
|
static void SetupBAT(bool is_wii);
|
||||||
static bool RunApploader(bool is_wii, const DiscIO::IVolume& volume);
|
static bool RunApploader(bool is_wii, const DiscIO::IVolume& volume);
|
||||||
static bool EmulatedBS2_GC(const DiscIO::IVolume* volume, bool skip_app_loader = false);
|
static bool EmulatedBS2_GC(const DiscIO::IVolume* volume, bool skip_app_loader = false);
|
||||||
|
@ -51,13 +51,17 @@ void CBoot::RunFunction(u32 address)
|
|||||||
PowerPC::SingleStep();
|
PowerPC::SingleStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBoot::SetupBAT(bool is_wii)
|
void CBoot::SetupMSR()
|
||||||
{
|
{
|
||||||
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr);
|
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr);
|
||||||
m_MSR.FP = 1;
|
m_MSR.FP = 1;
|
||||||
m_MSR.DR = 1;
|
m_MSR.DR = 1;
|
||||||
m_MSR.IR = 1;
|
m_MSR.IR = 1;
|
||||||
m_MSR.EE = 1;
|
m_MSR.EE = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CBoot::SetupBAT(bool is_wii)
|
||||||
|
{
|
||||||
PowerPC::ppcState.spr[SPR_IBAT0U] = 0x80001fff;
|
PowerPC::ppcState.spr[SPR_IBAT0U] = 0x80001fff;
|
||||||
PowerPC::ppcState.spr[SPR_IBAT0L] = 0x00000002;
|
PowerPC::ppcState.spr[SPR_IBAT0L] = 0x00000002;
|
||||||
PowerPC::ppcState.spr[SPR_DBAT0U] = 0x80001fff;
|
PowerPC::ppcState.spr[SPR_DBAT0U] = 0x80001fff;
|
||||||
@ -155,6 +159,7 @@ bool CBoot::EmulatedBS2_GC(const DiscIO::IVolume* volume, bool skip_app_loader)
|
|||||||
{
|
{
|
||||||
INFO_LOG(BOOT, "Faking GC BS2...");
|
INFO_LOG(BOOT, "Faking GC BS2...");
|
||||||
|
|
||||||
|
SetupMSR();
|
||||||
SetupBAT(/*is_wii*/ false);
|
SetupBAT(/*is_wii*/ false);
|
||||||
|
|
||||||
// Write necessary values
|
// Write necessary values
|
||||||
@ -346,6 +351,7 @@ bool CBoot::EmulatedBS2_Wii(const DiscIO::IVolume* volume)
|
|||||||
// after this check during booting.
|
// after this check during booting.
|
||||||
DVDRead(*volume, 0, 0x3180, 4, true);
|
DVDRead(*volume, 0, 0x3180, 4, true);
|
||||||
|
|
||||||
|
SetupMSR();
|
||||||
SetupBAT(/*is_wii*/ true);
|
SetupBAT(/*is_wii*/ true);
|
||||||
|
|
||||||
Memory::Write_U32(0x4c000064, 0x00000300); // Write default DSI Handler: rfi
|
Memory::Write_U32(0x4c000064, 0x00000300); // Write default DSI Handler: rfi
|
||||||
|
@ -70,6 +70,7 @@ bool CBoot::Boot_ELF(const std::string& filename)
|
|||||||
const bool is_wii = IsElfWii(filename);
|
const bool is_wii = IsElfWii(filename);
|
||||||
if (is_wii)
|
if (is_wii)
|
||||||
HID4.SBE = 1;
|
HID4.SBE = 1;
|
||||||
|
SetupMSR();
|
||||||
SetupBAT(is_wii);
|
SetupBAT(is_wii);
|
||||||
|
|
||||||
if (!reader.LoadSymbols())
|
if (!reader.LoadSymbols())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user