diff options
| author | 2018-08-09 21:06:44 -0400 | |
|---|---|---|
| committer | 2018-08-09 21:06:59 -0400 | |
| commit | ec3bef7b4c21931918f3a84ad79a53d31b02aeaf (patch) | |
| tree | e9da97be14d9474910faa1cfde851aa5b2383bc0 /src/core/loader/loader.cpp | |
| parent | Merge pull request #995 from bunnei/gl-buff-bounds (diff) | |
| download | yuzu-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/loader.cpp')
| -rw-r--r-- | src/core/loader/loader.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index a288654df..2f5bfc67c 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp | |||
| @@ -86,6 +86,55 @@ std::string GetFileTypeString(FileType type) { | |||
| 86 | return "unknown"; | 86 | return "unknown"; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | constexpr std::array<const char*, 36> RESULT_MESSAGES{ | ||
| 90 | "The operation completed successfully.", | ||
| 91 | "The loader requested to load is already loaded.", | ||
| 92 | "The operation is not implemented.", | ||
| 93 | "The loader is not initialized properly.", | ||
| 94 | "The NPDM file has a bad header.", | ||
| 95 | "The NPDM has a bad ACID header.", | ||
| 96 | "The NPDM has a bad ACI header,", | ||
| 97 | "The NPDM file has a bad file access control.", | ||
| 98 | "The NPDM has a bad file access header.", | ||
| 99 | "The PFS/HFS partition has a bad header.", | ||
| 100 | "The PFS/HFS partition has incorrect size as determined by the header.", | ||
| 101 | "The NCA file has a bad header.", | ||
| 102 | "The general keyfile could not be found.", | ||
| 103 | "The NCA Header key could not be found.", | ||
| 104 | "The NCA Header key is incorrect or the header is invalid.", | ||
| 105 | "Support for NCA2-type NCAs is not implemented.", | ||
| 106 | "Support for NCA0-type NCAs is not implemented.", | ||
| 107 | "The titlekey for this Rights ID could not be found.", | ||
| 108 | "The titlekek for this crypto revision could not be found.", | ||
| 109 | "The Rights ID in the header is invalid.", | ||
| 110 | "The key area key for this application type and crypto revision could not be found.", | ||
| 111 | "The key area key is incorrect or the section header is invalid.", | ||
| 112 | "The titlekey and/or titlekek is incorrect or the section header is invalid.", | ||
| 113 | "The XCI file is missing a Program-type NCA.", | ||
| 114 | "The NCA file is not an application.", | ||
| 115 | "The ExeFS partition could not be found.", | ||
| 116 | "The XCI file has a bad header.", | ||
| 117 | "The XCI file is missing a partition.", | ||
| 118 | "The file could not be found or does not exist.", | ||
| 119 | "The game is missing a program metadata file (main.npdm).", | ||
| 120 | "The game uses the currently-unimplemented 32-bit architecture.", | ||
| 121 | "The RomFS could not be found.", | ||
| 122 | "The ELF file has incorrect size as determined by the header.", | ||
| 123 | "There was a general error loading the NRO into emulated memory.", | ||
| 124 | "There is no icon available.", | ||
| 125 | "There is no control data available.", | ||
| 126 | }; | ||
| 127 | |||
| 128 | std::string GetMessageForResultStatus(ResultStatus status) { | ||
| 129 | return GetMessageForResultStatus(static_cast<size_t>(status)); | ||
| 130 | } | ||
| 131 | |||
| 132 | std::string GetMessageForResultStatus(u16 status) { | ||
| 133 | if (status >= 36) | ||
| 134 | return ""; | ||
| 135 | return RESULT_MESSAGES[status]; | ||
| 136 | } | ||
| 137 | |||
| 89 | /** | 138 | /** |
| 90 | * Get a loader for a file with a specific type | 139 | * Get a loader for a file with a specific type |
| 91 | * @param file The file to load | 140 | * @param file The file to load |