summaryrefslogtreecommitdiff
path: root/src/core/loader/nca.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-11 19:25:30 -0400
committerGravatar GitHub2018-08-11 19:25:30 -0400
commitbc286c169fb8b07d21e082e05152cfd6bc611b33 (patch)
tree512bc4cca3adbe98a16cae454377c2ec2638b5e3 /src/core/loader/nca.cpp
parentMerge pull request #1018 from Subv/ssy_sync (diff)
parentgame_list: Reorder error checks (diff)
downloadyuzu-bc286c169fb8b07d21e082e05152cfd6bc611b33.tar.gz
yuzu-bc286c169fb8b07d21e082e05152cfd6bc611b33.tar.xz
yuzu-bc286c169fb8b07d21e082e05152cfd6bc611b33.zip
Merge pull request #970 from DarkLordZach/loader-errors
loader: Add more descriptive errors
Diffstat (limited to 'src/core/loader/nca.cpp')
-rw-r--r--src/core/loader/nca.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/loader/nca.cpp b/src/core/loader/nca.cpp
index 46f5cd393..8498cc94b 100644
--- a/src/core/loader/nca.cpp
+++ b/src/core/loader/nca.cpp
@@ -46,12 +46,12 @@ ResultStatus AppLoader_NCA::Load(Kernel::SharedPtr<Kernel::Process>& process) {
46 } 46 }
47 47
48 if (nca->GetType() != FileSys::NCAContentType::Program) 48 if (nca->GetType() != FileSys::NCAContentType::Program)
49 return ResultStatus::ErrorInvalidFormat; 49 return ResultStatus::ErrorNCANotProgram;
50 50
51 const auto exefs = nca->GetExeFS(); 51 const auto exefs = nca->GetExeFS();
52 52
53 if (exefs == nullptr) 53 if (exefs == nullptr)
54 return ResultStatus::ErrorInvalidFormat; 54 return ResultStatus::ErrorNoExeFS;
55 55
56 directory_loader = std::make_unique<AppLoader_DeconstructedRomDirectory>(exefs); 56 directory_loader = std::make_unique<AppLoader_DeconstructedRomDirectory>(exefs);
57 57
@@ -69,16 +69,16 @@ ResultStatus AppLoader_NCA::Load(Kernel::SharedPtr<Kernel::Process>& process) {
69 69
70ResultStatus AppLoader_NCA::ReadRomFS(FileSys::VirtualFile& dir) { 70ResultStatus AppLoader_NCA::ReadRomFS(FileSys::VirtualFile& dir) {
71 if (nca == nullptr) 71 if (nca == nullptr)
72 return ResultStatus::ErrorNotLoaded; 72 return ResultStatus::ErrorNotInitialized;
73 if (nca->GetRomFS() == nullptr || nca->GetRomFS()->GetSize() == 0) 73 if (nca->GetRomFS() == nullptr || nca->GetRomFS()->GetSize() == 0)
74 return ResultStatus::ErrorNotUsed; 74 return ResultStatus::ErrorNoRomFS;
75 dir = nca->GetRomFS(); 75 dir = nca->GetRomFS();
76 return ResultStatus::Success; 76 return ResultStatus::Success;
77} 77}
78 78
79ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) { 79ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) {
80 if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) 80 if (nca == nullptr || nca->GetStatus() != ResultStatus::Success)
81 return ResultStatus::ErrorInvalidFormat; 81 return ResultStatus::ErrorNotInitialized;
82 out_program_id = nca->GetTitleId(); 82 out_program_id = nca->GetTitleId();
83 return ResultStatus::Success; 83 return ResultStatus::Success;
84} 84}