diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/core.cpp | 49 | ||||
| -rw-r--r-- | src/core/core.h | 39 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 22 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 16 |
7 files changed, 69 insertions, 67 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index ae1d56b27..3532839df 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -139,8 +139,8 @@ struct System::Impl { | |||
| 139 | : kernel{system}, fs_controller{system}, memory{system}, | 139 | : kernel{system}, fs_controller{system}, memory{system}, |
| 140 | cpu_manager{system}, reporter{system}, applet_manager{system}, time_manager{system} {} | 140 | cpu_manager{system}, reporter{system}, applet_manager{system}, time_manager{system} {} |
| 141 | 141 | ||
| 142 | ResultStatus Run() { | 142 | SystemResultStatus Run() { |
| 143 | status = ResultStatus::Success; | 143 | status = SystemResultStatus::Success; |
| 144 | 144 | ||
| 145 | kernel.Suspend(false); | 145 | kernel.Suspend(false); |
| 146 | core_timing.SyncPause(false); | 146 | core_timing.SyncPause(false); |
| @@ -149,8 +149,8 @@ struct System::Impl { | |||
| 149 | return status; | 149 | return status; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | ResultStatus Pause() { | 152 | SystemResultStatus Pause() { |
| 153 | status = ResultStatus::Success; | 153 | status = SystemResultStatus::Success; |
| 154 | 154 | ||
| 155 | core_timing.SyncPause(true); | 155 | core_timing.SyncPause(true); |
| 156 | kernel.Suspend(true); | 156 | kernel.Suspend(true); |
| @@ -159,7 +159,7 @@ struct System::Impl { | |||
| 159 | return status; | 159 | return status; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | ResultStatus Init(System& system, Frontend::EmuWindow& emu_window) { | 162 | SystemResultStatus Init(System& system, Frontend::EmuWindow& emu_window) { |
| 163 | LOG_DEBUG(Core, "initialized OK"); | 163 | LOG_DEBUG(Core, "initialized OK"); |
| 164 | 164 | ||
| 165 | device_memory = std::make_unique<Core::DeviceMemory>(); | 165 | device_memory = std::make_unique<Core::DeviceMemory>(); |
| @@ -197,7 +197,7 @@ struct System::Impl { | |||
| 197 | 197 | ||
| 198 | gpu_core = VideoCore::CreateGPU(emu_window, system); | 198 | gpu_core = VideoCore::CreateGPU(emu_window, system); |
| 199 | if (!gpu_core) { | 199 | if (!gpu_core) { |
| 200 | return ResultStatus::ErrorVideoCore; | 200 | return SystemResultStatus::ErrorVideoCore; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | service_manager = std::make_shared<Service::SM::ServiceManager>(kernel); | 203 | service_manager = std::make_shared<Service::SM::ServiceManager>(kernel); |
| @@ -217,21 +217,22 @@ struct System::Impl { | |||
| 217 | 217 | ||
| 218 | LOG_DEBUG(Core, "Initialized OK"); | 218 | LOG_DEBUG(Core, "Initialized OK"); |
| 219 | 219 | ||
| 220 | return ResultStatus::Success; | 220 | return SystemResultStatus::Success; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, const std::string& filepath, | 223 | SystemResultStatus Load(System& system, Frontend::EmuWindow& emu_window, |
| 224 | u64 program_id, std::size_t program_index) { | 224 | const std::string& filepath, u64 program_id, |
| 225 | std::size_t program_index) { | ||
| 225 | app_loader = Loader::GetLoader(system, GetGameFileFromPath(virtual_filesystem, filepath), | 226 | app_loader = Loader::GetLoader(system, GetGameFileFromPath(virtual_filesystem, filepath), |
| 226 | program_id, program_index); | 227 | program_id, program_index); |
| 227 | 228 | ||
| 228 | if (!app_loader) { | 229 | if (!app_loader) { |
| 229 | LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); | 230 | LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); |
| 230 | return ResultStatus::ErrorGetLoader; | 231 | return SystemResultStatus::ErrorGetLoader; |
| 231 | } | 232 | } |
| 232 | 233 | ||
| 233 | ResultStatus init_result{Init(system, emu_window)}; | 234 | SystemResultStatus init_result{Init(system, emu_window)}; |
| 234 | if (init_result != ResultStatus::Success) { | 235 | if (init_result != SystemResultStatus::Success) { |
| 235 | LOG_CRITICAL(Core, "Failed to initialize system (Error {})!", | 236 | LOG_CRITICAL(Core, "Failed to initialize system (Error {})!", |
| 236 | static_cast<int>(init_result)); | 237 | static_cast<int>(init_result)); |
| 237 | Shutdown(); | 238 | Shutdown(); |
| @@ -249,8 +250,8 @@ struct System::Impl { | |||
| 249 | LOG_CRITICAL(Core, "Failed to load ROM (Error {})!", load_result); | 250 | LOG_CRITICAL(Core, "Failed to load ROM (Error {})!", load_result); |
| 250 | Shutdown(); | 251 | Shutdown(); |
| 251 | 252 | ||
| 252 | return static_cast<ResultStatus>(static_cast<u32>(ResultStatus::ErrorLoader) + | 253 | return static_cast<SystemResultStatus>( |
| 253 | static_cast<u32>(load_result)); | 254 | static_cast<u32>(SystemResultStatus::ErrorLoader) + static_cast<u32>(load_result)); |
| 254 | } | 255 | } |
| 255 | AddGlueRegistrationForProcess(*app_loader, *main_process); | 256 | AddGlueRegistrationForProcess(*app_loader, *main_process); |
| 256 | kernel.MakeCurrentProcess(main_process.get()); | 257 | kernel.MakeCurrentProcess(main_process.get()); |
| @@ -282,7 +283,7 @@ struct System::Impl { | |||
| 282 | GetAndResetPerfStats(); | 283 | GetAndResetPerfStats(); |
| 283 | perf_stats->BeginSystemFrame(); | 284 | perf_stats->BeginSystemFrame(); |
| 284 | 285 | ||
| 285 | status = ResultStatus::Success; | 286 | status = SystemResultStatus::Success; |
| 286 | return status; | 287 | return status; |
| 287 | } | 288 | } |
| 288 | 289 | ||
| @@ -355,7 +356,7 @@ struct System::Impl { | |||
| 355 | arp_manager.Register(launch.title_id, launch, std::move(nacp_data)); | 356 | arp_manager.Register(launch.title_id, launch, std::move(nacp_data)); |
| 356 | } | 357 | } |
| 357 | 358 | ||
| 358 | void SetStatus(ResultStatus new_status, const char* details = nullptr) { | 359 | void SetStatus(SystemResultStatus new_status, const char* details = nullptr) { |
| 359 | status = new_status; | 360 | status = new_status; |
| 360 | if (details) { | 361 | if (details) { |
| 361 | status_details = details; | 362 | status_details = details; |
| @@ -411,7 +412,7 @@ struct System::Impl { | |||
| 411 | /// Network instance | 412 | /// Network instance |
| 412 | Network::NetworkInstance network_instance; | 413 | Network::NetworkInstance network_instance; |
| 413 | 414 | ||
| 414 | ResultStatus status = ResultStatus::Success; | 415 | SystemResultStatus status = SystemResultStatus::Success; |
| 415 | std::string status_details = ""; | 416 | std::string status_details = ""; |
| 416 | 417 | ||
| 417 | std::unique_ptr<Core::PerfStats> perf_stats; | 418 | std::unique_ptr<Core::PerfStats> perf_stats; |
| @@ -439,16 +440,16 @@ const CpuManager& System::GetCpuManager() const { | |||
| 439 | return impl->cpu_manager; | 440 | return impl->cpu_manager; |
| 440 | } | 441 | } |
| 441 | 442 | ||
| 442 | System::ResultStatus System::Run() { | 443 | SystemResultStatus System::Run() { |
| 443 | return impl->Run(); | 444 | return impl->Run(); |
| 444 | } | 445 | } |
| 445 | 446 | ||
| 446 | System::ResultStatus System::Pause() { | 447 | SystemResultStatus System::Pause() { |
| 447 | return impl->Pause(); | 448 | return impl->Pause(); |
| 448 | } | 449 | } |
| 449 | 450 | ||
| 450 | System::ResultStatus System::SingleStep() { | 451 | SystemResultStatus System::SingleStep() { |
| 451 | return ResultStatus::Success; | 452 | return SystemResultStatus::Success; |
| 452 | } | 453 | } |
| 453 | 454 | ||
| 454 | void System::InvalidateCpuInstructionCaches() { | 455 | void System::InvalidateCpuInstructionCaches() { |
| @@ -463,8 +464,8 @@ void System::Shutdown() { | |||
| 463 | impl->Shutdown(); | 464 | impl->Shutdown(); |
| 464 | } | 465 | } |
| 465 | 466 | ||
| 466 | System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath, | 467 | SystemResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath, |
| 467 | u64 program_id, std::size_t program_index) { | 468 | u64 program_id, std::size_t program_index) { |
| 468 | return impl->Load(*this, emu_window, filepath, program_id, program_index); | 469 | return impl->Load(*this, emu_window, filepath, program_id, program_index); |
| 469 | } | 470 | } |
| 470 | 471 | ||
| @@ -624,7 +625,7 @@ Loader::ResultStatus System::GetGameName(std::string& out) const { | |||
| 624 | return impl->GetGameName(out); | 625 | return impl->GetGameName(out); |
| 625 | } | 626 | } |
| 626 | 627 | ||
| 627 | void System::SetStatus(ResultStatus new_status, const char* details) { | 628 | void System::SetStatus(SystemResultStatus new_status, const char* details) { |
| 628 | impl->SetStatus(new_status, details); | 629 | impl->SetStatus(new_status, details); |
| 629 | } | 630 | } |
| 630 | 631 | ||
diff --git a/src/core/core.h b/src/core/core.h index cae578c69..c1234ef77 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -104,6 +104,18 @@ struct PerfStatsResults; | |||
| 104 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, | 104 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, |
| 105 | const std::string& path); | 105 | const std::string& path); |
| 106 | 106 | ||
| 107 | /// Enumeration representing the return values of the System Initialize and Load process. | ||
| 108 | enum class SystemResultStatus : u32 { | ||
| 109 | Success, ///< Succeeded | ||
| 110 | ErrorNotInitialized, ///< Error trying to use core prior to initialization | ||
| 111 | ErrorGetLoader, ///< Error finding the correct application loader | ||
| 112 | ErrorSystemFiles, ///< Error in finding system files | ||
| 113 | ErrorSharedFont, ///< Error in finding shared font | ||
| 114 | ErrorVideoCore, ///< Error in the video core | ||
| 115 | ErrorUnknown, ///< Any other error | ||
| 116 | ErrorLoader, ///< The base for loader errors (too many to repeat) | ||
| 117 | }; | ||
| 118 | |||
| 107 | class System { | 119 | class System { |
| 108 | public: | 120 | public: |
| 109 | using CurrentBuildProcessID = std::array<u8, 0x20>; | 121 | using CurrentBuildProcessID = std::array<u8, 0x20>; |
| @@ -118,35 +130,23 @@ public: | |||
| 118 | System(System&&) = delete; | 130 | System(System&&) = delete; |
| 119 | System& operator=(System&&) = delete; | 131 | System& operator=(System&&) = delete; |
| 120 | 132 | ||
| 121 | /// Enumeration representing the return values of the System Initialize and Load process. | ||
| 122 | enum class ResultStatus : u32 { | ||
| 123 | Success, ///< Succeeded | ||
| 124 | ErrorNotInitialized, ///< Error trying to use core prior to initialization | ||
| 125 | ErrorGetLoader, ///< Error finding the correct application loader | ||
| 126 | ErrorSystemFiles, ///< Error in finding system files | ||
| 127 | ErrorSharedFont, ///< Error in finding shared font | ||
| 128 | ErrorVideoCore, ///< Error in the video core | ||
| 129 | ErrorUnknown, ///< Any other error | ||
| 130 | ErrorLoader, ///< The base for loader errors (too many to repeat) | ||
| 131 | }; | ||
| 132 | |||
| 133 | /** | 133 | /** |
| 134 | * Run the OS and Application | 134 | * Run the OS and Application |
| 135 | * This function will start emulation and run the relevant devices | 135 | * This function will start emulation and run the relevant devices |
| 136 | */ | 136 | */ |
| 137 | [[nodiscard]] ResultStatus Run(); | 137 | [[nodiscard]] SystemResultStatus Run(); |
| 138 | 138 | ||
| 139 | /** | 139 | /** |
| 140 | * Pause the OS and Application | 140 | * Pause the OS and Application |
| 141 | * This function will pause emulation and stop the relevant devices | 141 | * This function will pause emulation and stop the relevant devices |
| 142 | */ | 142 | */ |
| 143 | [[nodiscard]] ResultStatus Pause(); | 143 | [[nodiscard]] SystemResultStatus Pause(); |
| 144 | 144 | ||
| 145 | /** | 145 | /** |
| 146 | * Step the CPU one instruction | 146 | * Step the CPU one instruction |
| 147 | * @return Result status, indicating whether or not the operation succeeded. | 147 | * @return Result status, indicating whether or not the operation succeeded. |
| 148 | */ | 148 | */ |
| 149 | [[nodiscard]] ResultStatus SingleStep(); | 149 | [[nodiscard]] SystemResultStatus SingleStep(); |
| 150 | 150 | ||
| 151 | /** | 151 | /** |
| 152 | * Invalidate the CPU instruction caches | 152 | * Invalidate the CPU instruction caches |
| @@ -166,10 +166,11 @@ public: | |||
| 166 | * input. | 166 | * input. |
| 167 | * @param filepath String path to the executable application to load on the host file system. | 167 | * @param filepath String path to the executable application to load on the host file system. |
| 168 | * @param program_index Specifies the index within the container of the program to launch. | 168 | * @param program_index Specifies the index within the container of the program to launch. |
| 169 | * @returns ResultStatus code, indicating if the operation succeeded. | 169 | * @returns SystemResultStatus code, indicating if the operation succeeded. |
| 170 | */ | 170 | */ |
| 171 | [[nodiscard]] ResultStatus Load(Frontend::EmuWindow& emu_window, const std::string& filepath, | 171 | [[nodiscard]] SystemResultStatus Load(Frontend::EmuWindow& emu_window, |
| 172 | u64 program_id = 0, std::size_t program_index = 0); | 172 | const std::string& filepath, u64 program_id = 0, |
| 173 | std::size_t program_index = 0); | ||
| 173 | 174 | ||
| 174 | /** | 175 | /** |
| 175 | * Indicates if the emulated system is powered on (all subsystems initialized and able to run an | 176 | * Indicates if the emulated system is powered on (all subsystems initialized and able to run an |
| @@ -295,7 +296,7 @@ public: | |||
| 295 | /// Gets the name of the current game | 296 | /// Gets the name of the current game |
| 296 | [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const; | 297 | [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const; |
| 297 | 298 | ||
| 298 | void SetStatus(ResultStatus new_status, const char* details); | 299 | void SetStatus(SystemResultStatus new_status, const char* details); |
| 299 | 300 | ||
| 300 | [[nodiscard]] const std::string& GetStatusDetails() const; | 301 | [[nodiscard]] const std::string& GetStatusDetails() const; |
| 301 | 302 | ||
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index c75f5e1ee..40fd47406 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -86,15 +86,15 @@ void EmuThread::run() { | |||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | running_guard = true; | 88 | running_guard = true; |
| 89 | Core::System::ResultStatus result = system.Run(); | 89 | Core::SystemResultStatus result = system.Run(); |
| 90 | if (result != Core::System::ResultStatus::Success) { | 90 | if (result != Core::SystemResultStatus::Success) { |
| 91 | running_guard = false; | 91 | running_guard = false; |
| 92 | this->SetRunning(false); | 92 | this->SetRunning(false); |
| 93 | emit ErrorThrown(result, system.GetStatusDetails()); | 93 | emit ErrorThrown(result, system.GetStatusDetails()); |
| 94 | } | 94 | } |
| 95 | running_wait.Wait(); | 95 | running_wait.Wait(); |
| 96 | result = system.Pause(); | 96 | result = system.Pause(); |
| 97 | if (result != Core::System::ResultStatus::Success) { | 97 | if (result != Core::SystemResultStatus::Success) { |
| 98 | running_guard = false; | 98 | running_guard = false; |
| 99 | this->SetRunning(false); | 99 | this->SetRunning(false); |
| 100 | emit ErrorThrown(result, system.GetStatusDetails()); | 100 | emit ErrorThrown(result, system.GetStatusDetails()); |
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index 8d7ab8c2e..9fc4116e6 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h | |||
| @@ -123,7 +123,7 @@ signals: | |||
| 123 | */ | 123 | */ |
| 124 | void DebugModeLeft(); | 124 | void DebugModeLeft(); |
| 125 | 125 | ||
| 126 | void ErrorThrown(Core::System::ResultStatus, std::string); | 126 | void ErrorThrown(Core::SystemResultStatus, std::string); |
| 127 | 127 | ||
| 128 | void LoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total); | 128 | void LoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total); |
| 129 | }; | 129 | }; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 00e649fd2..a381eed34 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -406,7 +406,7 @@ void GMainWindow::RegisterMetaTypes() { | |||
| 406 | qRegisterMetaType<Service::AM::Applets::WebExitReason>("Service::AM::Applets::WebExitReason"); | 406 | qRegisterMetaType<Service::AM::Applets::WebExitReason>("Service::AM::Applets::WebExitReason"); |
| 407 | 407 | ||
| 408 | // Register loader types | 408 | // Register loader types |
| 409 | qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus"); | 409 | qRegisterMetaType<Core::SystemResultStatus>("Core::SystemResultStatus"); |
| 410 | } | 410 | } |
| 411 | 411 | ||
| 412 | void GMainWindow::ControllerSelectorReconfigureControllers( | 412 | void GMainWindow::ControllerSelectorReconfigureControllers( |
| @@ -1252,13 +1252,13 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p | |||
| 1252 | std::make_unique<QtWebBrowser>(*this), // Web Browser | 1252 | std::make_unique<QtWebBrowser>(*this), // Web Browser |
| 1253 | }); | 1253 | }); |
| 1254 | 1254 | ||
| 1255 | const Core::System::ResultStatus result{ | 1255 | const Core::SystemResultStatus result{ |
| 1256 | system.Load(*render_window, filename.toStdString(), program_id, program_index)}; | 1256 | system.Load(*render_window, filename.toStdString(), program_id, program_index)}; |
| 1257 | 1257 | ||
| 1258 | const auto drd_callout = (UISettings::values.callout_flags.GetValue() & | 1258 | const auto drd_callout = (UISettings::values.callout_flags.GetValue() & |
| 1259 | static_cast<u32>(CalloutFlag::DRDDeprecation)) == 0; | 1259 | static_cast<u32>(CalloutFlag::DRDDeprecation)) == 0; |
| 1260 | 1260 | ||
| 1261 | if (result == Core::System::ResultStatus::Success && | 1261 | if (result == Core::SystemResultStatus::Success && |
| 1262 | system.GetAppLoader().GetFileType() == Loader::FileType::DeconstructedRomDirectory && | 1262 | system.GetAppLoader().GetFileType() == Loader::FileType::DeconstructedRomDirectory && |
| 1263 | drd_callout) { | 1263 | drd_callout) { |
| 1264 | UISettings::values.callout_flags = UISettings::values.callout_flags.GetValue() | | 1264 | UISettings::values.callout_flags = UISettings::values.callout_flags.GetValue() | |
| @@ -1273,14 +1273,14 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p | |||
| 1273 | "wiki</a>. This message will not be shown again.")); | 1273 | "wiki</a>. This message will not be shown again.")); |
| 1274 | } | 1274 | } |
| 1275 | 1275 | ||
| 1276 | if (result != Core::System::ResultStatus::Success) { | 1276 | if (result != Core::SystemResultStatus::Success) { |
| 1277 | switch (result) { | 1277 | switch (result) { |
| 1278 | case Core::System::ResultStatus::ErrorGetLoader: | 1278 | case Core::SystemResultStatus::ErrorGetLoader: |
| 1279 | LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filename.toStdString()); | 1279 | LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filename.toStdString()); |
| 1280 | QMessageBox::critical(this, tr("Error while loading ROM!"), | 1280 | QMessageBox::critical(this, tr("Error while loading ROM!"), |
| 1281 | tr("The ROM format is not supported.")); | 1281 | tr("The ROM format is not supported.")); |
| 1282 | break; | 1282 | break; |
| 1283 | case Core::System::ResultStatus::ErrorVideoCore: | 1283 | case Core::SystemResultStatus::ErrorVideoCore: |
| 1284 | QMessageBox::critical( | 1284 | QMessageBox::critical( |
| 1285 | this, tr("An error occurred initializing the video core."), | 1285 | this, tr("An error occurred initializing the video core."), |
| 1286 | tr("yuzu has encountered an error while running the video core, please see the " | 1286 | tr("yuzu has encountered an error while running the video core, please see the " |
| @@ -1294,8 +1294,8 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p | |||
| 1294 | break; | 1294 | break; |
| 1295 | 1295 | ||
| 1296 | default: | 1296 | default: |
| 1297 | if (result > Core::System::ResultStatus::ErrorLoader) { | 1297 | if (result > Core::SystemResultStatus::ErrorLoader) { |
| 1298 | const u16 loader_id = static_cast<u16>(Core::System::ResultStatus::ErrorLoader); | 1298 | const u16 loader_id = static_cast<u16>(Core::SystemResultStatus::ErrorLoader); |
| 1299 | const u16 error_id = static_cast<u16>(result) - loader_id; | 1299 | const u16 error_id = static_cast<u16>(result) - loader_id; |
| 1300 | const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id); | 1300 | const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id); |
| 1301 | LOG_CRITICAL(Frontend, "Failed to load ROM! {}", error_code); | 1301 | LOG_CRITICAL(Frontend, "Failed to load ROM! {}", error_code); |
| @@ -3052,7 +3052,7 @@ void GMainWindow::OnMouseActivity() { | |||
| 3052 | } | 3052 | } |
| 3053 | } | 3053 | } |
| 3054 | 3054 | ||
| 3055 | void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string details) { | 3055 | void GMainWindow::OnCoreError(Core::SystemResultStatus result, std::string details) { |
| 3056 | QMessageBox::StandardButton answer; | 3056 | QMessageBox::StandardButton answer; |
| 3057 | QString status_message; | 3057 | QString status_message; |
| 3058 | const QString common_message = | 3058 | const QString common_message = |
| @@ -3067,7 +3067,7 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det | |||
| 3067 | "back to the game list? Continuing emulation may result in crashes, corrupted save " | 3067 | "back to the game list? Continuing emulation may result in crashes, corrupted save " |
| 3068 | "data, or other bugs."); | 3068 | "data, or other bugs."); |
| 3069 | switch (result) { | 3069 | switch (result) { |
| 3070 | case Core::System::ResultStatus::ErrorSystemFiles: { | 3070 | case Core::SystemResultStatus::ErrorSystemFiles: { |
| 3071 | QString message; | 3071 | QString message; |
| 3072 | if (details.empty()) { | 3072 | if (details.empty()) { |
| 3073 | message = | 3073 | message = |
| @@ -3083,7 +3083,7 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det | |||
| 3083 | break; | 3083 | break; |
| 3084 | } | 3084 | } |
| 3085 | 3085 | ||
| 3086 | case Core::System::ResultStatus::ErrorSharedFont: { | 3086 | case Core::SystemResultStatus::ErrorSharedFont: { |
| 3087 | const QString message = | 3087 | const QString message = |
| 3088 | tr("yuzu was unable to locate the Switch shared fonts. %1").arg(common_message); | 3088 | tr("yuzu was unable to locate the Switch shared fonts. %1").arg(common_message); |
| 3089 | answer = QMessageBox::question(this, tr("Shared Fonts Not Found"), message, | 3089 | answer = QMessageBox::question(this, tr("Shared Fonts Not Found"), message, |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index f501cf400..b96ac8da3 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -280,7 +280,7 @@ private slots: | |||
| 280 | void ResetWindowSize900(); | 280 | void ResetWindowSize900(); |
| 281 | void ResetWindowSize1080(); | 281 | void ResetWindowSize1080(); |
| 282 | void OnCaptureScreenshot(); | 282 | void OnCaptureScreenshot(); |
| 283 | void OnCoreError(Core::System::ResultStatus, std::string); | 283 | void OnCoreError(Core::SystemResultStatus, std::string); |
| 284 | void OnReinitializeKeys(ReinitializeKeyBehavior behavior); | 284 | void OnReinitializeKeys(ReinitializeKeyBehavior behavior); |
| 285 | void OnLanguageChanged(const QString& locale); | 285 | void OnLanguageChanged(const QString& locale); |
| 286 | void OnMouseActivity(); | 286 | void OnMouseActivity(); |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 5c36a21a2..67587cc54 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -166,27 +166,27 @@ int main(int argc, char** argv) { | |||
| 166 | system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>()); | 166 | system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>()); |
| 167 | system.GetFileSystemController().CreateFactories(*system.GetFilesystem()); | 167 | system.GetFileSystemController().CreateFactories(*system.GetFilesystem()); |
| 168 | 168 | ||
| 169 | const Core::System::ResultStatus load_result{system.Load(*emu_window, filepath)}; | 169 | const Core::SystemResultStatus load_result{system.Load(*emu_window, filepath)}; |
| 170 | 170 | ||
| 171 | switch (load_result) { | 171 | switch (load_result) { |
| 172 | case Core::System::ResultStatus::ErrorGetLoader: | 172 | case Core::SystemResultStatus::ErrorGetLoader: |
| 173 | LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filepath); | 173 | LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filepath); |
| 174 | return -1; | 174 | return -1; |
| 175 | case Core::System::ResultStatus::ErrorLoader: | 175 | case Core::SystemResultStatus::ErrorLoader: |
| 176 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); | 176 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); |
| 177 | return -1; | 177 | return -1; |
| 178 | case Core::System::ResultStatus::ErrorNotInitialized: | 178 | case Core::SystemResultStatus::ErrorNotInitialized: |
| 179 | LOG_CRITICAL(Frontend, "CPUCore not initialized"); | 179 | LOG_CRITICAL(Frontend, "CPUCore not initialized"); |
| 180 | return -1; | 180 | return -1; |
| 181 | case Core::System::ResultStatus::ErrorVideoCore: | 181 | case Core::SystemResultStatus::ErrorVideoCore: |
| 182 | LOG_CRITICAL(Frontend, "Failed to initialize VideoCore!"); | 182 | LOG_CRITICAL(Frontend, "Failed to initialize VideoCore!"); |
| 183 | return -1; | 183 | return -1; |
| 184 | case Core::System::ResultStatus::Success: | 184 | case Core::SystemResultStatus::Success: |
| 185 | break; // Expected case | 185 | break; // Expected case |
| 186 | default: | 186 | default: |
| 187 | if (static_cast<u32>(load_result) > | 187 | if (static_cast<u32>(load_result) > |
| 188 | static_cast<u32>(Core::System::ResultStatus::ErrorLoader)) { | 188 | static_cast<u32>(Core::SystemResultStatus::ErrorLoader)) { |
| 189 | const u16 loader_id = static_cast<u16>(Core::System::ResultStatus::ErrorLoader); | 189 | const u16 loader_id = static_cast<u16>(Core::SystemResultStatus::ErrorLoader); |
| 190 | const u16 error_id = static_cast<u16>(load_result) - loader_id; | 190 | const u16 error_id = static_cast<u16>(load_result) - loader_id; |
| 191 | LOG_CRITICAL(Frontend, | 191 | LOG_CRITICAL(Frontend, |
| 192 | "While attempting to load the ROM requested, an error occurred. Please " | 192 | "While attempting to load the ROM requested, an error occurred. Please " |