Boot: Unify the ELF and DOL code paths

They're essentially the same. To achieve this, this commit unifies
DolReader and ElfReader into a common interface for boot executable
readers, so the only remaining difference between ELF and DOL is
how which volume is inserted.
This commit is contained in:
Léo Lam 2017-05-28 17:12:38 +02:00
commit 065261dbad
13 changed files with 195 additions and 233 deletions

View file

@ -23,7 +23,6 @@
#include "Core/Analytics.h"
#include "Core/Boot/Boot.h"
#include "Core/Boot/Boot_DOL.h"
#include "Core/Config/Config.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
@ -896,10 +895,10 @@ struct SetGameMetadata
bool operator()(const BootParameters::Executable& executable) const
{
if (executable.type == BootParameters::Executable::Type::DOL)
config->bWii = CDolLoader{executable.path}.IsWii();
if (executable.type == BootParameters::Executable::Type::ELF)
config->bWii = CBoot::IsElfWii(executable.path);
if (!executable.reader->IsValid())
return false;
config->bWii = executable.reader->IsWii();
// TODO: Right now GC homebrew boots in NTSC and Wii homebrew in PAL.
// This is intentional so that Wii homebrew can boot in both 50Hz and 60Hz,