Loader, Frontends: Refactor loader creation and game loading

This allows frontends to keep a single loader and use it multiple times
e.g. for code loading and SMDH parsing.
This commit is contained in:
Emmanuel Gil Peyrot 2016-05-17 23:06:33 +01:00
parent 51ee2d2eb1
commit 8fc9c03126
6 changed files with 37 additions and 49 deletions

View file

@ -10,8 +10,10 @@
#include "common/string_util.h"
#include "common/swap.h"
#include "core/file_sys/archive_romfs.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/resource_limit.h"
#include "core/hle/service/fs/archive.h"
#include "core/loader/ncch.h"
#include "core/memory.h"
@ -303,7 +305,12 @@ ResultStatus AppLoader_NCCH::Load() {
is_loaded = true; // Set state to loaded
return LoadExec(); // Load the executable into memory for booting
result = LoadExec(); // Load the executable into memory for booting
if (ResultStatus::Success != result)
return result;
Service::FS::RegisterArchiveType(std::make_unique<FileSys::ArchiveFactory_RomFS>(*this), Service::FS::ArchiveIdCode::RomFS);
return ResultStatus::Success;
}
ResultStatus AppLoader_NCCH::ReadCode(std::vector<u8>& buffer) {