Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11825 from AdmiralCurtiss/ios-split-es-fs
IOS: Further deglobalization and emulation/maintainance code splitting.
  • Loading branch information
leoetlino committed May 15, 2023
2 parents 361a8b2 + 28b82ff commit e0ef474
Show file tree
Hide file tree
Showing 29 changed files with 654 additions and 570 deletions.
6 changes: 3 additions & 3 deletions Source/Android/jni/WiiUtils.cpp
Expand Up @@ -160,7 +160,7 @@ JNIEXPORT jboolean JNICALL
Java_org_dolphinemu_dolphinemu_utils_WiiUtils_isSystemMenuInstalled(JNIEnv* env, jclass)
{
IOS::HLE::Kernel ios;
const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);
const auto tmd = ios.GetESCore().FindInstalledTMD(Titles::SYSTEM_MENU);

return tmd.IsValid();
}
Expand All @@ -169,7 +169,7 @@ JNIEXPORT jboolean JNICALL
Java_org_dolphinemu_dolphinemu_utils_WiiUtils_isSystemMenuvWii(JNIEnv* env, jclass)
{
IOS::HLE::Kernel ios;
const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);
const auto tmd = ios.GetESCore().FindInstalledTMD(Titles::SYSTEM_MENU);

return tmd.IsvWii();
}
Expand All @@ -178,7 +178,7 @@ JNIEXPORT jstring JNICALL
Java_org_dolphinemu_dolphinemu_utils_WiiUtils_getSystemMenuVersion(JNIEnv* env, jclass)
{
IOS::HLE::Kernel ios;
const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);
const auto tmd = ios.GetESCore().FindInstalledTMD(Titles::SYSTEM_MENU);

if (!tmd.IsValid())
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Boot/Boot.cpp
Expand Up @@ -690,8 +690,8 @@ void UpdateStateFlags(std::function<void(StateFlags*)> update_function)

void CreateSystemMenuTitleDirs()
{
const auto es = IOS::HLE::GetIOS()->GetES();
es->CreateTitleDirectories(Titles::SYSTEM_MENU, IOS::SYSMENU_GID);
const auto& es = IOS::HLE::GetIOS()->GetESCore();
es.CreateTitleDirectories(Titles::SYSTEM_MENU, IOS::SYSMENU_GID);
}

void AddRiivolutionPatches(BootParameters* boot_params,
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Boot/Boot_BS2Emu.cpp
Expand Up @@ -595,7 +595,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()->GetES()->DIVerify(tmd, volume.GetTicket(partition));
IOS::HLE::GetIOS()->GetESDevice()->DIVerify(tmd, volume.GetTicket(partition));

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Boot/Boot_WiiWAD.cpp
Expand Up @@ -21,8 +21,8 @@ bool CBoot::BootNANDTitle(Core::System& system, const u64 title_id)
state->type = 0x04; // TYPE_NANDBOOT
});

auto es = IOS::HLE::GetIOS()->GetES();
const IOS::ES::TicketReader ticket = es->FindSignedTicket(title_id);
auto es = IOS::HLE::GetIOS()->GetESDevice();
const IOS::ES::TicketReader ticket = es->GetCore().FindSignedTicket(title_id);
auto console_type = IOS::HLE::IOSC::ConsoleType::Retail;
if (ticket.IsValid())
console_type = ticket.GetConsoleType();
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/ConfigManager.cpp
Expand Up @@ -286,7 +286,7 @@ struct SetGameMetadata
bool operator()(const BootParameters::NANDTitle& nand_title) const
{
IOS::HLE::Kernel ios;
const IOS::ES::TMDReader tmd = ios.GetES()->FindInstalledTMD(nand_title.id);
const IOS::ES::TMDReader tmd = ios.GetESCore().FindInstalledTMD(nand_title.id);
if (!tmd.IsValid() || !IOS::ES::IsChannel(nand_title.id))
{
PanicAlertFmtT("This title cannot be booted.");
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/HW/WiiSave.cpp
Expand Up @@ -553,7 +553,7 @@ CopyResult Import(const std::string& data_bin_path, std::function<bool()> can_ov
return CopyResult::CorruptedSource;
}

if (!WiiUtils::EnsureTMDIsImported(*ios.GetFS(), *ios.GetES(), header->tid))
if (!WiiUtils::EnsureTMDIsImported(*ios.GetFS(), ios.GetESCore(), header->tid))
{
ERROR_LOG_FMT(CORE, "WiiSave::Import: Failed to find or import TMD for title {:16x}",
header->tid);
Expand Down Expand Up @@ -585,7 +585,7 @@ size_t ExportAll(std::string_view export_path)
{
IOS::HLE::Kernel ios;
size_t exported_save_count = 0;
for (const u64 title : ios.GetES()->GetInstalledTitles())
for (const u64 title : ios.GetESCore().GetInstalledTitles())
{
if (Export(title, export_path, &ios) == CopyResult::Success)
++exported_save_count;
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/IOS/DI/DI.cpp
Expand Up @@ -736,7 +736,8 @@ std::optional<IPCReply> DIDevice::IOCtlV(const IOCtlVRequest& request)
const std::vector<u8>& raw_tmd = tmd.GetBytes();
memory.CopyToEmu(request.io_vectors[0].address, raw_tmd.data(), raw_tmd.size());

ReturnCode es_result = m_ios.GetES()->DIVerify(tmd, dvd_thread.GetTicket(m_current_partition));
ReturnCode es_result = GetEmulationKernel().GetESDevice()->DIVerify(
tmd, dvd_thread.GetTicket(m_current_partition));
memory.Write_U32(es_result, request.io_vectors[1].address);

return_value = DIResult::Success;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/IOS/Device.cpp
Expand Up @@ -28,7 +28,7 @@ OpenRequest::OpenRequest(Core::System& system, const u32 address_) : Request(sys
auto& memory = system.GetMemory();
path = memory.GetString(memory.Read_U32(address + 0xc));
flags = static_cast<OpenMode>(memory.Read_U32(address + 0x10));
const Kernel* ios = GetIOS();
const EmulationKernel* ios = GetIOS();
if (ios)
{
uid = ios->GetUidForPPC();
Expand Down

0 comments on commit e0ef474

Please sign in to comment.