diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp index fa60ba4ab4..e320d93e71 100644 --- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp +++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp @@ -21,6 +21,7 @@ #include "Core/HW/DVDInterface.h" #include "Core/HW/EXI/EXI_DeviceIPL.h" #include "Core/HW/Memmap.h" +#include "Core/IOS/ES/ES.h" #include "Core/IOS/ES/Formats.h" #include "Core/IOS/IPC.h" #include "Core/PatchEngine.h" @@ -406,7 +407,7 @@ bool CBoot::EmulatedBS2_Wii() DEBUG_LOG(BOOT, "Run iAppLoaderClose"); RunFunction(iAppLoaderClose); - IOS::HLE::ES_DIVerify(tmd, DVDInterface::GetVolume().GetTicket()); + IOS::HLE::Device::ES::DIVerify(tmd, DVDInterface::GetVolume().GetTicket()); // return PC = PowerPC::ppcState.gpr[3]; diff --git a/Source/Core/Core/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Boot/Boot_WiiWAD.cpp index 612ddc8fe8..eff9775006 100644 --- a/Source/Core/Core/Boot/Boot_WiiWAD.cpp +++ b/Source/Core/Core/Boot/Boot_WiiWAD.cpp @@ -11,6 +11,7 @@ #include "Common/NandPaths.h" #include "Core/Boot/Boot.h" +#include "Core/IOS/ES/ES.h" #include "Core/IOS/FS/FileIO.h" #include "Core/IOS/IPC.h" #include "Core/PatchEngine.h" @@ -87,7 +88,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename) if (!SetupWiiMemory(ContentLoader.GetTMD().GetIOSId())) return false; - IOS::HLE::SetDefaultContentFile(_pFilename); + IOS::HLE::Device::ES::LoadWAD(_pFilename); if (!IOS::HLE::BootstrapPPC(ContentLoader)) return false; diff --git a/Source/Core/Core/IOS/DI/DI.cpp b/Source/Core/Core/IOS/DI/DI.cpp index 59c0de4b52..4dc743b81c 100644 --- a/Source/Core/Core/IOS/DI/DI.cpp +++ b/Source/Core/Core/IOS/DI/DI.cpp @@ -14,8 +14,8 @@ #include "Core/HW/DVDInterface.h" #include "Core/HW/Memmap.h" #include "Core/IOS/DI/DI.h" +#include "Core/IOS/ES/ES.h" #include "Core/IOS/ES/Formats.h" -#include "Core/IOS/IPC.h" #include "DiscIO/Volume.h" namespace IOS @@ -106,10 +106,10 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request) INFO_LOG(IOS_DI, "DVDLowOpenPartition: partition_offset 0x%016" PRIx64, partition_offset); // Read TMD to the buffer - const ES::TMDReader tmd = DVDInterface::GetVolume().GetTMD(); + const IOS::ES::TMDReader tmd = DVDInterface::GetVolume().GetTMD(); const std::vector raw_tmd = tmd.GetRawTMD(); Memory::CopyToEmu(request.io_vectors[0].address, raw_tmd.data(), raw_tmd.size()); - ES_DIVerify(tmd, DVDInterface::GetVolume().GetTicket()); + ES::DIVerify(tmd, DVDInterface::GetVolume().GetTicket()); return_value = 1; break; diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp index 9cf977f439..e2cb1ce188 100644 --- a/Source/Core/Core/IOS/ES/ES.cpp +++ b/Source/Core/Core/IOS/ES/ES.cpp @@ -1491,6 +1491,8 @@ const DiscIO::CNANDContentLoader& ES::AccessContentDevice(u64 title_id) return DiscIO::CNANDContentManager::Access().GetNANDLoader(title_id, Common::FROM_SESSION_ROOT); } +// This is technically an ioctlv in IOS's ES, but it is an internal API which cannot be +// used from the PowerPC (for unpatched IOSes anyway). s32 ES::DIVerify(const IOS::ES::TMDReader& tmd, const IOS::ES::TicketReader& ticket) { s_title_context.Clear(); diff --git a/Source/Core/Core/IOS/IPC.cpp b/Source/Core/Core/IOS/IPC.cpp index 8dff5a90a6..e8bb80f1aa 100644 --- a/Source/Core/Core/IOS/IPC.cpp +++ b/Source/Core/Core/IOS/IPC.cpp @@ -737,18 +737,6 @@ bool BootstrapPPC(const DiscIO::CNANDContentLoader& content_loader) return true; } -void SetDefaultContentFile(const std::string& file_name) -{ - std::lock_guard lock(s_device_map_mutex); - s_es_handles[0]->LoadWAD(file_name); -} - -// XXX: also pass certificate chains? -void ES_DIVerify(const ES::TMDReader& tmd, const ES::TicketReader& ticket) -{ - Device::ES::DIVerify(tmd, ticket); -} - void SDIO_EventNotify() { // TODO: Potential race condition: If IsRunning() becomes false after diff --git a/Source/Core/Core/IOS/IPC.h b/Source/Core/Core/IOS/IPC.h index 901699c545..9bf4f9a24a 100644 --- a/Source/Core/Core/IOS/IPC.h +++ b/Source/Core/Core/IOS/IPC.h @@ -21,12 +21,6 @@ class CNANDContentLoader; namespace IOS { -namespace ES -{ -class TMDReader; -class TicketReader; -} - namespace HLE { namespace Device @@ -72,10 +66,6 @@ bool BootstrapPPC(const DiscIO::CNANDContentLoader& content_loader); // Do State void DoState(PointerWrap& p); -// Set default content file -void SetDefaultContentFile(const std::string& file_name); -void ES_DIVerify(const ES::TMDReader& tmd, const ES::TicketReader& ticket); - void SDIO_EventNotify(); std::shared_ptr GetDeviceByName(const std::string& device_name);