Remove useless ES wrappers from the main IOS file

This removes wrappers for ES_DIVerify and ES::LoadWAD. They are not
really useful as we can simply call the ES function directly, and
it is actually somewhat confusing because both functions are static
and are not tied to a particular ES instance.
This commit is contained in:
Léo Lam 2017-02-27 21:51:07 +01:00
parent 5a74343d06
commit d97ae1054f
6 changed files with 9 additions and 27 deletions

View File

@ -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];

View File

@ -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;

View File

@ -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<u8> 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;

View File

@ -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();

View File

@ -737,18 +737,6 @@ bool BootstrapPPC(const DiscIO::CNANDContentLoader& content_loader)
return true;
}
void SetDefaultContentFile(const std::string& file_name)
{
std::lock_guard<std::mutex> 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

View File

@ -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<Device::Device> GetDeviceByName(const std::string& device_name);