Core/IOS/IOS: Remove system parameters from BootstrapPPC() and BootIOS()

An EmulationKernel instance already houses a reference to the currently active system instance.
This commit is contained in:
Lioncache 2023-12-18 11:43:49 -05:00
parent 715a551dac
commit 0d75d658b1
5 changed files with 15 additions and 16 deletions

View File

@ -572,7 +572,7 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
// Because there is no TMD to get the requested system (IOS) version from,
// we default to IOS58, which is the version used by the Homebrew Channel.
SetupWiiMemory(system, IOS::HLE::IOSC::ConsoleType::Retail);
IOS::HLE::GetIOS()->BootIOS(system, Titles::IOS(58));
IOS::HLE::GetIOS()->BootIOS(Titles::IOS(58));
}
else
{

View File

@ -559,7 +559,7 @@ bool CBoot::EmulatedBS2_Wii(Core::System& system, const Core::CPUThreadGuard& gu
const u64 ios = ios_override >= 0 ? Titles::IOS(static_cast<u32>(ios_override)) : tmd.GetIOSId();
const auto console_type = volume.GetTicket(data_partition).GetConsoleType();
if (!SetupWiiMemory(system, console_type) || !IOS::HLE::GetIOS()->BootIOS(system, ios))
if (!SetupWiiMemory(system, console_type) || !IOS::HLE::GetIOS()->BootIOS(ios))
return false;
auto di =

View File

@ -374,7 +374,7 @@ bool ESDevice::LaunchIOS(u64 ios_title_id, HangPPC hang_ppc)
const ES::TicketReader ticket = m_core.FindSignedTicket(ios_title_id);
ES::Content content;
if (!tmd.IsValid() || !ticket.IsValid() || !tmd.GetContent(tmd.GetBootIndex(), &content) ||
!GetEmulationKernel().BootIOS(GetSystem(), ios_title_id, hang_ppc,
!GetEmulationKernel().BootIOS(ios_title_id, hang_ppc,
m_core.GetContentPath(ios_title_id, content)))
{
PanicAlertFmtT("Could not launch IOS {0:016x} because it is missing from the NAND.\n"
@ -385,7 +385,7 @@ bool ESDevice::LaunchIOS(u64 ios_title_id, HangPPC hang_ppc)
return true;
}
return GetEmulationKernel().BootIOS(GetSystem(), ios_title_id, hang_ppc);
return GetEmulationKernel().BootIOS(ios_title_id, hang_ppc);
}
s32 ESDevice::WriteLaunchFile(const ES::TMDReader& tmd, Ticks ticks)
@ -490,8 +490,7 @@ bool ESDevice::LaunchPPCTitle(u64 title_id)
bool ESDevice::BootstrapPPC()
{
const bool result =
GetEmulationKernel().BootstrapPPC(GetSystem(), m_pending_ppc_boot_content_path);
const bool result = GetEmulationKernel().BootstrapPPC(m_pending_ppc_boot_content_path);
m_pending_ppc_boot_content_path = {};
return result;
}

View File

@ -434,7 +434,7 @@ static std::vector<u8> ReadBootContent(FSCore& fs, const std::string& path, size
// This corresponds to syscall 0x41, which loads a binary from the NAND and bootstraps the PPC.
// Unlike 0x42, IOS will set up some constants in memory before booting the PPC.
bool EmulationKernel::BootstrapPPC(Core::System& system, const std::string& boot_content_path)
bool EmulationKernel::BootstrapPPC(const std::string& boot_content_path)
{
// Seeking and processing overhead is ignored as most time is spent reading from the NAND.
u64 ticks = 0;
@ -453,11 +453,11 @@ bool EmulationKernel::BootstrapPPC(Core::System& system, const std::string& boot
if (dol.IsAncast())
INFO_LOG_FMT(IOS, "BootstrapPPC: Loading ancast image");
if (!dol.LoadIntoMemory(system))
if (!dol.LoadIntoMemory(m_system))
return false;
INFO_LOG_FMT(IOS, "BootstrapPPC: {}", boot_content_path);
system.GetCoreTiming().ScheduleEvent(ticks, s_event_finish_ppc_bootstrap, dol.IsAncast());
m_system.GetCoreTiming().ScheduleEvent(ticks, s_event_finish_ppc_bootstrap, dol.IsAncast());
return true;
}
@ -508,7 +508,7 @@ static constexpr SystemTimers::TimeBaseTick GetIOSBootTicks(u32 version)
// Passing a boot content path is optional because we do not require IOSes
// to be installed at the moment. If one is passed, the boot binary must exist
// on the NAND, or the call will fail like on a Wii.
bool EmulationKernel::BootIOS(Core::System& system, const u64 ios_title_id, HangPPC hang_ppc,
bool EmulationKernel::BootIOS(const u64 ios_title_id, HangPPC hang_ppc,
const std::string& boot_content_path)
{
// IOS suspends regular PPC<->ARM IPC before loading a new IOS.
@ -525,7 +525,7 @@ bool EmulationKernel::BootIOS(Core::System& system, const u64 ios_title_id, Hang
return false;
ElfReader elf{binary.GetElf()};
if (!elf.LoadIntoMemory(system, true))
if (!elf.LoadIntoMemory(m_system, true))
return false;
}
@ -534,12 +534,12 @@ bool EmulationKernel::BootIOS(Core::System& system, const u64 ios_title_id, Hang
if (Core::IsRunningAndStarted())
{
system.GetCoreTiming().ScheduleEvent(GetIOSBootTicks(GetVersion()), s_event_finish_ios_boot,
ios_title_id);
m_system.GetCoreTiming().ScheduleEvent(GetIOSBootTicks(GetVersion()), s_event_finish_ios_boot,
ios_title_id);
}
else
{
FinishIOSBoot(system, ios_title_id);
FinishIOSBoot(m_system, ios_title_id);
}
return true;

View File

@ -177,8 +177,8 @@ public:
void SetGidForPPC(u16 gid);
u16 GetGidForPPC() const;
bool BootstrapPPC(Core::System& system, const std::string& boot_content_path);
bool BootIOS(Core::System& system, u64 ios_title_id, HangPPC hang_ppc = HangPPC::No,
bool BootstrapPPC(const std::string& boot_content_path);
bool BootIOS(u64 ios_title_id, HangPPC hang_ppc = HangPPC::No,
const std::string& boot_content_path = {});
void InitIPC();