diff options
author | Lioncash <mathew1800@gmail.com> | 2019-04-09 23:03:04 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-04-12 04:11:41 +0200 |
commit | 612e1388df3bed64081488f2a99cce522c80c76d (patch) | |
tree | 2d2782d0df46e9458ec2a2728f5cd66f27963ea9 /src/core/loader/nax.cpp | |
parent | core/process: Remove unideal page table setting from LoadFromMetadata() (diff) | |
download | yuzu-612e1388df3bed64081488f2a99cce522c80c76d.tar yuzu-612e1388df3bed64081488f2a99cce522c80c76d.tar.gz yuzu-612e1388df3bed64081488f2a99cce522c80c76d.tar.bz2 yuzu-612e1388df3bed64081488f2a99cce522c80c76d.tar.lz yuzu-612e1388df3bed64081488f2a99cce522c80c76d.tar.xz yuzu-612e1388df3bed64081488f2a99cce522c80c76d.tar.zst yuzu-612e1388df3bed64081488f2a99cce522c80c76d.zip |
Diffstat (limited to 'src/core/loader/nax.cpp')
-rw-r--r-- | src/core/loader/nax.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/core/loader/nax.cpp b/src/core/loader/nax.cpp index 93a970d10..34efef09a 100644 --- a/src/core/loader/nax.cpp +++ b/src/core/loader/nax.cpp @@ -41,31 +41,37 @@ FileType AppLoader_NAX::GetFileType() const { return IdentifyTypeImpl(*nax); } -ResultStatus AppLoader_NAX::Load(Kernel::Process& process) { +AppLoader_NAX::LoadResult AppLoader_NAX::Load(Kernel::Process& process) { if (is_loaded) { - return ResultStatus::ErrorAlreadyLoaded; + return {ResultStatus::ErrorAlreadyLoaded, {}}; } - if (nax->GetStatus() != ResultStatus::Success) - return nax->GetStatus(); + const auto nax_status = nax->GetStatus(); + if (nax_status != ResultStatus::Success) { + return {nax_status, {}}; + } const auto nca = nax->AsNCA(); if (nca == nullptr) { - if (!Core::Crypto::KeyManager::KeyFileExists(false)) - return ResultStatus::ErrorMissingProductionKeyFile; - return ResultStatus::ErrorNAXInconvertibleToNCA; + if (!Core::Crypto::KeyManager::KeyFileExists(false)) { + return {ResultStatus::ErrorMissingProductionKeyFile, {}}; + } + + return {ResultStatus::ErrorNAXInconvertibleToNCA, {}}; } - if (nca->GetStatus() != ResultStatus::Success) - return nca->GetStatus(); + const auto nca_status = nca->GetStatus(); + if (nca_status != ResultStatus::Success) { + return {nca_status, {}}; + } const auto result = nca_loader->Load(process); - if (result != ResultStatus::Success) + if (result.first != ResultStatus::Success) { return result; + } is_loaded = true; - - return ResultStatus::Success; + return result; } ResultStatus AppLoader_NAX::ReadRomFS(FileSys::VirtualFile& dir) { |