summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-08-25 19:05:22 -0400
committerGravatar Zach Hilman2018-09-04 16:23:44 -0400
commitf5e03b9173268d2607b9db379fef93170212328a (patch)
treead2386139dd70f3ac9e1b2ae72837ca745b6f6d2 /src
parentloader: Ignore patches on NRO and DRD (diff)
downloadyuzu-f5e03b9173268d2607b9db379fef93170212328a.tar.gz
yuzu-f5e03b9173268d2607b9db379fef93170212328a.tar.xz
yuzu-f5e03b9173268d2607b9db379fef93170212328a.zip
loader: Add BKTR-specific error messages and codes
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/loader/loader.cpp11
-rw-r--r--src/core/loader/loader.h20
3 files changed, 28 insertions, 7 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 54afa6a87..7ddc87539 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -35,8 +35,12 @@ add_library(core STATIC
35 file_sys/mode.h 35 file_sys/mode.h
36 file_sys/nca_metadata.cpp 36 file_sys/nca_metadata.cpp
37 file_sys/nca_metadata.h 37 file_sys/nca_metadata.h
38 file_sys/nca_patch.cpp
39 file_sys/nca_patch.h
38 file_sys/partition_filesystem.cpp 40 file_sys/partition_filesystem.cpp
39 file_sys/partition_filesystem.h 41 file_sys/partition_filesystem.h
42 file_sys/patch_manager.cpp
43 file_sys/patch_manager.h
40 file_sys/program_metadata.cpp 44 file_sys/program_metadata.cpp
41 file_sys/program_metadata.h 45 file_sys/program_metadata.h
42 file_sys/registered_cache.cpp 46 file_sys/registered_cache.cpp
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 446adf557..729b1ca08 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -93,7 +93,7 @@ std::string GetFileTypeString(FileType type) {
93 return "unknown"; 93 return "unknown";
94} 94}
95 95
96constexpr std::array<const char*, 50> RESULT_MESSAGES{ 96constexpr std::array<const char*, 57> RESULT_MESSAGES{
97 "The operation completed successfully.", 97 "The operation completed successfully.",
98 "The loader requested to load is already loaded.", 98 "The loader requested to load is already loaded.",
99 "The operation is not implemented.", 99 "The operation is not implemented.",
@@ -144,6 +144,15 @@ constexpr std::array<const char*, 50> RESULT_MESSAGES{
144 "The SD Save Key Source could not be found.", 144 "The SD Save Key Source could not be found.",
145 "The SD NCA Key Source could not be found.", 145 "The SD NCA Key Source could not be found.",
146 "The NSP file is missing a Program-type NCA."}; 146 "The NSP file is missing a Program-type NCA."};
147 "The BKTR-type NCA has a bad BKTR header.",
148 "The BKTR Subsection entry is not located immediately after the Relocation entry.",
149 "The BKTR Subsection entry is not at the end of the media block.",
150 "The BKTR-type NCA has a bad Relocation block.",
151 "The BKTR-type NCA has a bad Subsection block.",
152 "The BKTR-type NCA has a bad Relocation bucket.",
153 "The BKTR-type NCA has a bad Subsection bucket.",
154 "The BKTR-type NCA is missing the base RomFS.",
155};
147 156
148std::ostream& operator<<(std::ostream& os, ResultStatus status) { 157std::ostream& operator<<(std::ostream& os, ResultStatus status) {
149 os << RESULT_MESSAGES.at(static_cast<size_t>(status)); 158 os << RESULT_MESSAGES.at(static_cast<size_t>(status));
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index be66b2257..b4a3a6573 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -107,6 +107,14 @@ enum class ResultStatus : u16 {
107 ErrorMissingSDSaveKeySource, 107 ErrorMissingSDSaveKeySource,
108 ErrorMissingSDNCAKeySource, 108 ErrorMissingSDNCAKeySource,
109 ErrorNSPMissingProgramNCA, 109 ErrorNSPMissingProgramNCA,
110 ErrorBadBKTRHeader,
111 ErrorBKTRSubsectionNotAfterRelocation,
112 ErrorBKTRSubsectionNotAtEnd,
113 ErrorBadRelocationBlock,
114 ErrorBadSubsectionBlock,
115 ErrorBadRelocationBuckets,
116 ErrorBadSubsectionBuckets,
117 ErrorMissingBKTRBaseRomFS,
110}; 118};
111 119
112std::ostream& operator<<(std::ostream& os, ResultStatus status); 120std::ostream& operator<<(std::ostream& os, ResultStatus status);
@@ -197,13 +205,13 @@ public:
197 } 205 }
198 206
199 /** 207 /**
200 * Get the update RomFS of the application 208 * Get whether or not updates can be applied to the RomFS.
201 * Since the RomFS can be huge, we return a file reference instead of copying to a buffer 209 * By default, this is true, however for formats where it cannot be guaranteed that the RomFS is
202 * @param file The file containing the RomFS 210 * the base game it should be set to false.
203 * @return ResultStatus result of function 211 * @return bool whether or not updatable.
204 */ 212 */
205 virtual ResultStatus ReadUpdateRomFS(FileSys::VirtualFile& file) { 213 virtual bool IsRomFSUpdatable() {
206 return ResultStatus::ErrorNotImplemented; 214 return true;
207 } 215 }
208 216
209 /** 217 /**