diff options
| author | 2018-08-16 16:57:00 -0400 | |
|---|---|---|
| committer | 2018-08-23 11:52:44 -0400 | |
| commit | a9dc5a3c1058d22873a201c08bd6d095405789ae (patch) | |
| tree | daa6c23dcc4f3b3367eaf254689e427865b9e84e /src/core/file_sys | |
| parent | Merge pull request #1157 from lioncash/vec (diff) | |
| download | yuzu-a9dc5a3c1058d22873a201c08bd6d095405789ae.tar.gz yuzu-a9dc5a3c1058d22873a201c08bd6d095405789ae.tar.xz yuzu-a9dc5a3c1058d22873a201c08bd6d095405789ae.zip | |
xci: Fix error masking issue
Prevents NCA-related errors from being masked into MissingProgramNCA or MissingKeyFile
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 9 | ||||
| -rw-r--r-- | src/core/file_sys/card_image.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 1d7c7fb10..508f09e56 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -43,6 +43,8 @@ XCI::XCI(VirtualFile file_) : file(std::move(file_)), partitions(0x4) { | |||
| 43 | partitions[static_cast<size_t>(partition)] = std::make_shared<PartitionFilesystem>(raw); | 43 | partitions[static_cast<size_t>(partition)] = std::make_shared<PartitionFilesystem>(raw); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | program_nca_status = Loader::ResultStatus::ErrorXCIMissingProgramNCA; | ||
| 47 | |||
| 46 | auto result = AddNCAFromPartition(XCIPartition::Secure); | 48 | auto result = AddNCAFromPartition(XCIPartition::Secure); |
| 47 | if (result != Loader::ResultStatus::Success) { | 49 | if (result != Loader::ResultStatus::Success) { |
| 48 | status = result; | 50 | status = result; |
| @@ -76,6 +78,10 @@ Loader::ResultStatus XCI::GetStatus() const { | |||
| 76 | return status; | 78 | return status; |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 81 | Loader::ResultStatus XCI::GetProgramNCAStatus() const { | ||
| 82 | return program_nca_status; | ||
| 83 | } | ||
| 84 | |||
| 79 | VirtualDir XCI::GetPartition(XCIPartition partition) const { | 85 | VirtualDir XCI::GetPartition(XCIPartition partition) const { |
| 80 | return partitions[static_cast<size_t>(partition)]; | 86 | return partitions[static_cast<size_t>(partition)]; |
| 81 | } | 87 | } |
| @@ -143,6 +149,9 @@ Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { | |||
| 143 | if (file->GetExtension() != "nca") | 149 | if (file->GetExtension() != "nca") |
| 144 | continue; | 150 | continue; |
| 145 | auto nca = std::make_shared<NCA>(file); | 151 | auto nca = std::make_shared<NCA>(file); |
| 152 | if (nca->GetType() == NCAContentType::Program) { | ||
| 153 | program_nca_status = nca->GetStatus(); | ||
| 154 | } | ||
| 146 | if (nca->GetStatus() == Loader::ResultStatus::Success) { | 155 | if (nca->GetStatus() == Loader::ResultStatus::Success) { |
| 147 | ncas.push_back(std::move(nca)); | 156 | ncas.push_back(std::move(nca)); |
| 148 | } else { | 157 | } else { |
diff --git a/src/core/file_sys/card_image.h b/src/core/file_sys/card_image.h index a03d5264e..54ab828d1 100644 --- a/src/core/file_sys/card_image.h +++ b/src/core/file_sys/card_image.h | |||
| @@ -59,6 +59,7 @@ public: | |||
| 59 | explicit XCI(VirtualFile file); | 59 | explicit XCI(VirtualFile file); |
| 60 | 60 | ||
| 61 | Loader::ResultStatus GetStatus() const; | 61 | Loader::ResultStatus GetStatus() const; |
| 62 | Loader::ResultStatus GetProgramNCAStatus() const; | ||
| 62 | 63 | ||
| 63 | u8 GetFormatVersion() const; | 64 | u8 GetFormatVersion() const; |
| 64 | 65 | ||
| @@ -90,6 +91,7 @@ private: | |||
| 90 | GamecardHeader header{}; | 91 | GamecardHeader header{}; |
| 91 | 92 | ||
| 92 | Loader::ResultStatus status; | 93 | Loader::ResultStatus status; |
| 94 | Loader::ResultStatus program_nca_status; | ||
| 93 | 95 | ||
| 94 | std::vector<VirtualDir> partitions; | 96 | std::vector<VirtualDir> partitions; |
| 95 | std::vector<std::shared_ptr<NCA>> ncas; | 97 | std::vector<std::shared_ptr<NCA>> ncas; |