Merge pull request #5419 from leoetlino/import-code-reuse

Reuse the IOS code for WAD installation
This commit is contained in:
Leo Lam 2017-05-14 23:35:43 +02:00 committed by GitHub
commit ed5e98c3cc
18 changed files with 531 additions and 401 deletions

View file

@ -983,13 +983,10 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2)
DiscIO::CNANDContentManager::Access().GetNANDLoader(m_strFilename);
const IOS::ES::TMDReader& tmd = content_loader.GetTMD();
if (content_loader.GetContentByIndex(tmd.GetBootIndex()) == nullptr)
if (!IOS::ES::IsChannel(tmd.GetTitleId()))
{
// WAD is valid yet cannot be booted. Install instead.
u64 installed = DiscIO::CNANDContentManager::Access().Install_WiiWAD(m_strFilename);
if (installed)
SuccessAlertT("The WAD has been installed successfully");
return false; // do not boot
PanicAlertT("This WAD is not bootable.");
return false;
}
SetRegion(tmd.GetRegion(), &set_region_dir);