WiiUtils: Refactor InstallWAD
Allows using an existing instance of IOS and WiiWAD.
This commit is contained in:
parent
bc588948c9
commit
5976d3934d
|
@ -38,9 +38,8 @@
|
||||||
|
|
||||||
namespace WiiUtils
|
namespace WiiUtils
|
||||||
{
|
{
|
||||||
bool InstallWAD(const std::string& wad_path)
|
bool InstallWAD(IOS::HLE::Kernel& ios, const DiscIO::WiiWAD& wad)
|
||||||
{
|
{
|
||||||
const DiscIO::WiiWAD wad{wad_path};
|
|
||||||
if (!wad.IsValid())
|
if (!wad.IsValid())
|
||||||
{
|
{
|
||||||
PanicAlertT("WAD installation failed: The selected file is not a valid WAD.");
|
PanicAlertT("WAD installation failed: The selected file is not a valid WAD.");
|
||||||
|
@ -48,7 +47,6 @@ bool InstallWAD(const std::string& wad_path)
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto tmd = wad.GetTMD();
|
const auto tmd = wad.GetTMD();
|
||||||
IOS::HLE::Kernel ios;
|
|
||||||
const auto es = ios.GetES();
|
const auto es = ios.GetES();
|
||||||
|
|
||||||
IOS::HLE::Device::ES::Context context;
|
IOS::HLE::Device::ES::Context context;
|
||||||
|
@ -99,10 +97,19 @@ bool InstallWAD(const std::string& wad_path)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DiscIO::NANDContentManager::Access().ClearCache();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InstallWAD(const std::string& wad_path)
|
||||||
|
{
|
||||||
|
IOS::HLE::Kernel ios;
|
||||||
|
const DiscIO::WiiWAD wad{wad_path};
|
||||||
|
const bool result = InstallWAD(ios, wad);
|
||||||
|
|
||||||
|
DiscIO::NANDContentManager::Access().ClearCache();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// Common functionality for system updaters.
|
// Common functionality for system updaters.
|
||||||
class SystemUpdater
|
class SystemUpdater
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue