Core: Move Emulation IOS instance to System.

This commit is contained in:
Admiral H. Curtiss committed 2024-02-07 22:07:30 +01:00
1 parent ca81d8b8a6
commit e6ee217a7c
21 files changed
+65 -51

No files matched your search

+3 -3
View File
@@ -573,7 +573,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(Titles::IOS(58));
system.GetIOS()->BootIOS(Titles::IOS(58));
}
else
{
@@ -701,7 +701,7 @@ void UpdateStateFlags(std::function<void(StateFlags*)> update_function)
{
CreateSystemMenuTitleDirs();
const std::string file_path = Common::GetTitleDataPath(Titles::SYSTEM_MENU) + "/" WII_STATE;
const auto fs = IOS::HLE::GetIOS()->GetFS();
const auto fs = Core::System::GetInstance().GetIOS()->GetFS();
constexpr IOS::HLE::FS::Mode rw_mode = IOS::HLE::FS::Mode::ReadWrite;
const auto file = fs->CreateAndOpenFile(IOS::SYSMENU_UID, IOS::SYSMENU_GID, file_path,
{rw_mode, rw_mode, rw_mode});
@@ -721,7 +721,7 @@ void UpdateStateFlags(std::function<void(StateFlags*)> update_function)
void CreateSystemMenuTitleDirs()
{
const auto& es = IOS::HLE::GetIOS()->GetESCore();
const auto& es = Core::System::GetInstance().GetIOS()->GetESCore();
es.CreateTitleDirectories(Titles::SYSTEM_MENU, IOS::SYSMENU_GID);
}
+5 -5
View File
@@ -362,7 +362,7 @@ bool CBoot::SetupWiiMemory(Core::System& system, IOS::HLE::IOSC::ConsoleType con
const std::string settings_file_path(Common::GetTitleDataPath(Titles::SYSTEM_MENU) +
"/" WII_SETTING);
const auto fs = IOS::HLE::GetIOS()->GetFS();
const auto fs = system.GetIOS()->GetFS();
{
Common::SettingsHandler::Buffer data;
const auto file = fs->OpenFile(IOS::SYSMENU_UID, IOS::SYSMENU_GID, settings_file_path,
@@ -502,7 +502,7 @@ static void WriteEmptyPlayRecord()
{
CreateSystemMenuTitleDirs();
const std::string file_path = Common::GetTitleDataPath(Titles::SYSTEM_MENU) + "/play_rec.dat";
const auto fs = IOS::HLE::GetIOS()->GetFS();
const auto fs = Core::System::GetInstance().GetIOS()->GetFS();
constexpr IOS::HLE::FS::Mode rw_mode = IOS::HLE::FS::Mode::ReadWrite;
const auto playrec_file = fs->CreateAndOpenFile(IOS::SYSMENU_UID, IOS::SYSMENU_GID, file_path,
{rw_mode, rw_mode, rw_mode});
@@ -559,11 +559,11 @@ 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(ios))
if (!SetupWiiMemory(system, console_type) || !system.GetIOS()->BootIOS(ios))
return false;
auto di =
std::static_pointer_cast<IOS::HLE::DIDevice>(IOS::HLE::GetIOS()->GetDeviceByName("/dev/di"));
std::static_pointer_cast<IOS::HLE::DIDevice>(system.GetIOS()->GetDeviceByName("/dev/di"));
di->InitializeIfFirstTime();
di->ChangePartition(data_partition);
@@ -596,7 +596,7 @@ bool CBoot::EmulatedBS2_Wii(Core::System& system, const Core::CPUThreadGuard& gu
// Warning: This call will set incorrect running game metadata if our volume parameter
// doesn't point to the same disc as the one that's inserted in the emulated disc drive!
IOS::HLE::GetIOS()->GetESDevice()->DIVerify(tmd, volume.GetTicket(partition));
system.GetIOS()->GetESDevice()->DIVerify(tmd, volume.GetTicket(partition));
return true;
}
+3 -2
View File
@@ -12,6 +12,7 @@
#include "Core/IOS/ES/Formats.h"
#include "Core/IOS/IOS.h"
#include "Core/IOS/IOSC.h"
#include "Core/System.h"
#include "Core/WiiUtils.h"
#include "DiscIO/VolumeWad.h"
@@ -21,7 +22,7 @@ bool CBoot::BootNANDTitle(Core::System& system, const u64 title_id)
state->type = 0x04; // TYPE_NANDBOOT
});
auto es = IOS::HLE::GetIOS()->GetESDevice();
auto es = system.GetIOS()->GetESDevice();
const IOS::ES::TicketReader ticket = es->GetCore().FindSignedTicket(title_id);
auto console_type = IOS::HLE::IOSC::ConsoleType::Retail;
if (ticket.IsValid())
@@ -34,7 +35,7 @@ bool CBoot::BootNANDTitle(Core::System& system, const u64 title_id)
bool CBoot::Boot_WiiWAD(Core::System& system, const DiscIO::VolumeWAD& wad)
{
if (!WiiUtils::InstallWAD(*IOS::HLE::GetIOS(), wad, WiiUtils::InstallType::Temporary))
if (!WiiUtils::InstallWAD(*system.GetIOS(), wad, WiiUtils::InstallType::Temporary))
{
PanicAlertFmtT("Cannot boot this WAD because it could not be installed to the NAND.");
return false;