diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 7 | ||||
| -rw-r--r-- | src/core/loader/loader.cpp | 12 | ||||
| -rw-r--r-- | src/core/loader/loader.h | 4 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 5 | ||||
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 4 |
5 files changed, 18 insertions, 14 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 8e05b9d0e..060948f9e 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -4,11 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | #include <array> | 5 | #include <array> |
| 6 | #include <string> | 6 | #include <string> |
| 7 | #include <core/loader/loader.h> | 7 | |
| 8 | #include <fmt/ostream.h> | ||
| 9 | |||
| 8 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 9 | #include "core/file_sys/card_image.h" | 11 | #include "core/file_sys/card_image.h" |
| 10 | #include "core/file_sys/partition_filesystem.h" | 12 | #include "core/file_sys/partition_filesystem.h" |
| 11 | #include "core/file_sys/vfs_offset.h" | 13 | #include "core/file_sys/vfs_offset.h" |
| 14 | #include "core/loader/loader.h" | ||
| 12 | 15 | ||
| 13 | namespace FileSys { | 16 | namespace FileSys { |
| 14 | 17 | ||
| @@ -142,7 +145,7 @@ Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { | |||
| 142 | const u16 error_id = static_cast<u16>(nca->GetStatus()); | 145 | const u16 error_id = static_cast<u16>(nca->GetStatus()); |
| 143 | LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})", | 146 | LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})", |
| 144 | partition_names[static_cast<size_t>(part)], nca->GetName(), error_id, | 147 | partition_names[static_cast<size_t>(part)], nca->GetName(), error_id, |
| 145 | Loader::GetMessageForResultStatus(nca->GetStatus())); | 148 | nca->GetStatus()); |
| 146 | } | 149 | } |
| 147 | } | 150 | } |
| 148 | 151 | ||
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index b143f043c..5e07a3f10 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <memory> | 5 | #include <memory> |
| 6 | #include <ostream> | ||
| 6 | #include <string> | 7 | #include <string> |
| 7 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 8 | #include "common/string_util.h" | 9 | #include "common/string_util.h" |
| @@ -119,14 +120,9 @@ constexpr std::array<const char*, 36> RESULT_MESSAGES{ | |||
| 119 | "There is no control data available.", | 120 | "There is no control data available.", |
| 120 | }; | 121 | }; |
| 121 | 122 | ||
| 122 | std::string GetMessageForResultStatus(ResultStatus status) { | 123 | std::ostream& operator<<(std::ostream& os, ResultStatus status) { |
| 123 | return GetMessageForResultStatus(static_cast<u16>(status)); | 124 | os << RESULT_MESSAGES.at(static_cast<size_t>(status)); |
| 124 | } | 125 | return os; |
| 125 | |||
| 126 | std::string GetMessageForResultStatus(u16 status) { | ||
| 127 | if (status >= 36) | ||
| 128 | return ""; | ||
| 129 | return RESULT_MESSAGES[status]; | ||
| 130 | } | 126 | } |
| 131 | 127 | ||
| 132 | /** | 128 | /** |
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 6dffe451a..b74cfbf8a 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <algorithm> | 7 | #include <algorithm> |
| 8 | #include <iosfwd> | ||
| 8 | #include <memory> | 9 | #include <memory> |
| 9 | #include <string> | 10 | #include <string> |
| 10 | #include <utility> | 11 | #include <utility> |
| @@ -94,8 +95,7 @@ enum class ResultStatus : u16 { | |||
| 94 | ErrorNoControl, | 95 | ErrorNoControl, |
| 95 | }; | 96 | }; |
| 96 | 97 | ||
| 97 | std::string GetMessageForResultStatus(ResultStatus status); | 98 | std::ostream& operator<<(std::ostream& os, ResultStatus status); |
| 98 | std::string GetMessageForResultStatus(u16 status); | ||
| 99 | 99 | ||
| 100 | /// Interface for loading an application | 100 | /// Interface for loading an application |
| 101 | class AppLoader : NonCopyable { | 101 | class AppLoader : NonCopyable { |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 94fb8ae6a..4bbea3f3c 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -6,7 +6,10 @@ | |||
| 6 | #include <clocale> | 6 | #include <clocale> |
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <thread> | 8 | #include <thread> |
| 9 | |||
| 10 | #include <fmt/ostream.h> | ||
| 9 | #include <glad/glad.h> | 11 | #include <glad/glad.h> |
| 12 | |||
| 10 | #define QT_NO_OPENGL | 13 | #define QT_NO_OPENGL |
| 11 | #include <QDesktopWidget> | 14 | #include <QDesktopWidget> |
| 12 | #include <QFileDialog> | 15 | #include <QFileDialog> |
| @@ -454,7 +457,7 @@ bool GMainWindow::LoadROM(const QString& filename) { | |||
| 454 | "While attempting to load the ROM requested, an error occured. Please " | 457 | "While attempting to load the ROM requested, an error occured. Please " |
| 455 | "refer to the yuzu wiki for more information or the yuzu discord for " | 458 | "refer to the yuzu wiki for more information or the yuzu discord for " |
| 456 | "additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", | 459 | "additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", |
| 457 | loader_id, error_id, Loader::GetMessageForResultStatus(error_id)))); | 460 | loader_id, error_id, static_cast<Loader::ResultStatus>(error_id)))); |
| 458 | } else { | 461 | } else { |
| 459 | QMessageBox::critical( | 462 | QMessageBox::critical( |
| 460 | this, tr("Error while loading ROM!"), | 463 | this, tr("Error while loading ROM!"), |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index e44a98311..9095cf27d 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include <string> | 7 | #include <string> |
| 8 | #include <thread> | 8 | #include <thread> |
| 9 | 9 | ||
| 10 | #include <fmt/ostream.h> | ||
| 11 | |||
| 10 | #include "common/common_paths.h" | 12 | #include "common/common_paths.h" |
| 11 | #include "common/logging/backend.h" | 13 | #include "common/logging/backend.h" |
| 12 | #include "common/logging/filter.h" | 14 | #include "common/logging/filter.h" |
| @@ -194,7 +196,7 @@ int main(int argc, char** argv) { | |||
| 194 | "While attempting to load the ROM requested, an error occured. Please " | 196 | "While attempting to load the ROM requested, an error occured. Please " |
| 195 | "refer to the yuzu wiki for more information or the yuzu discord for " | 197 | "refer to the yuzu wiki for more information or the yuzu discord for " |
| 196 | "additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", | 198 | "additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", |
| 197 | loader_id, error_id, Loader::GetMessageForResultStatus(error_id)); | 199 | loader_id, error_id, static_cast<Loader::ResultStatus>(error_id)); |
| 198 | } | 200 | } |
| 199 | } | 201 | } |
| 200 | 202 | ||