summaryrefslogtreecommitdiff
path: root/src/core/loader/xci.cpp
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-08-09 21:06:44 -0400
committerGravatar Zach Hilman2018-08-09 21:06:59 -0400
commitec3bef7b4c21931918f3a84ad79a53d31b02aeaf (patch)
treee9da97be14d9474910faa1cfde851aa5b2383bc0 /src/core/loader/xci.cpp
parentMerge pull request #995 from bunnei/gl-buff-bounds (diff)
downloadyuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar.gz
yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar.xz
yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.zip
loader: Add more descriptive errors
Full list of new errors and descriptions in core/loader/loader.h
Diffstat (limited to 'src/core/loader/xci.cpp')
-rw-r--r--src/core/loader/xci.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp
index d3fe24419..5d67fb186 100644
--- a/src/core/loader/xci.cpp
+++ b/src/core/loader/xci.cpp
@@ -66,10 +66,13 @@ ResultStatus AppLoader_XCI::Load(Kernel::SharedPtr<Kernel::Process>& process) {
66 return ResultStatus::ErrorAlreadyLoaded; 66 return ResultStatus::ErrorAlreadyLoaded;
67 } 67 }
68 68
69 if (xci->GetStatus() != ResultStatus::Success)
70 return xci->GetStatus();
71
69 if (xci->GetNCAFileByType(FileSys::NCAContentType::Program) == nullptr) { 72 if (xci->GetNCAFileByType(FileSys::NCAContentType::Program) == nullptr) {
70 if (!Core::Crypto::KeyManager::KeyFileExists(false)) 73 if (!Core::Crypto::KeyManager::KeyFileExists(false))
71 return ResultStatus::ErrorMissingKeys; 74 return ResultStatus::ErrorMissingProductionKeyFile;
72 return ResultStatus::ErrorDecrypting; 75 return ResultStatus::ErrorXCIMissingProgramNCA;
73 } 76 }
74 77
75 auto result = nca_loader->Load(process); 78 auto result = nca_loader->Load(process);
@@ -91,14 +94,14 @@ ResultStatus AppLoader_XCI::ReadProgramId(u64& out_program_id) {
91 94
92ResultStatus AppLoader_XCI::ReadIcon(std::vector<u8>& buffer) { 95ResultStatus AppLoader_XCI::ReadIcon(std::vector<u8>& buffer) {
93 if (icon_file == nullptr) 96 if (icon_file == nullptr)
94 return ResultStatus::ErrorInvalidFormat; 97 return ResultStatus::ErrorNoControl;
95 buffer = icon_file->ReadAllBytes(); 98 buffer = icon_file->ReadAllBytes();
96 return ResultStatus::Success; 99 return ResultStatus::Success;
97} 100}
98 101
99ResultStatus AppLoader_XCI::ReadTitle(std::string& title) { 102ResultStatus AppLoader_XCI::ReadTitle(std::string& title) {
100 if (nacp_file == nullptr) 103 if (nacp_file == nullptr)
101 return ResultStatus::ErrorInvalidFormat; 104 return ResultStatus::ErrorNoControl;
102 title = nacp_file->GetApplicationName(); 105 title = nacp_file->GetApplicationName();
103 return ResultStatus::Success; 106 return ResultStatus::Success;
104} 107}