diff options
| author | 2017-06-02 22:24:29 -0400 | |
|---|---|---|
| committer | 2017-06-02 22:24:29 -0400 | |
| commit | 81449f025a190cd9f931d73cf959ddbfebff497a (patch) | |
| tree | 24a15888dd6ebc515a09eaf00623fa23e2d4665d /src/core/core.cpp | |
| parent | Merge pull request #2722 from wwylele/cam-ipc-helper (diff) | |
| parent | Addressed Bunnei's review comments, and made some other tweaks: (diff) | |
| download | yuzu-81449f025a190cd9f931d73cf959ddbfebff497a.tar.gz yuzu-81449f025a190cd9f931d73cf959ddbfebff497a.tar.xz yuzu-81449f025a190cd9f931d73cf959ddbfebff497a.zip | |
Merge pull request #2611 from TheKoopaKingdom/missing-file-dialogs
Display QMessageBox Dialogs For Errors
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 450e7566d..5429bcb26 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -3,7 +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 | 6 | #include <utility> | |
| 7 | #include "audio_core/audio_core.h" | 7 | #include "audio_core/audio_core.h" |
| 8 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 9 | #include "core/arm/arm_interface.h" | 9 | #include "core/arm/arm_interface.h" |
| @@ -26,6 +26,7 @@ namespace Core { | |||
| 26 | /*static*/ System System::s_instance; | 26 | /*static*/ System System::s_instance; |
| 27 | 27 | ||
| 28 | System::ResultStatus System::RunLoop(int tight_loop) { | 28 | System::ResultStatus System::RunLoop(int tight_loop) { |
| 29 | status = ResultStatus::Success; | ||
| 29 | if (!cpu_core) { | 30 | if (!cpu_core) { |
| 30 | return ResultStatus::ErrorNotInitialized; | 31 | return ResultStatus::ErrorNotInitialized; |
| 31 | } | 32 | } |
| @@ -59,7 +60,7 @@ System::ResultStatus System::RunLoop(int tight_loop) { | |||
| 59 | HW::Update(); | 60 | HW::Update(); |
| 60 | Reschedule(); | 61 | Reschedule(); |
| 61 | 62 | ||
| 62 | return ResultStatus::Success; | 63 | return status; |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 65 | System::ResultStatus System::SingleStep() { | 66 | System::ResultStatus System::SingleStep() { |
| @@ -73,14 +74,25 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file | |||
| 73 | LOG_CRITICAL(Core, "Failed to obtain loader for %s!", filepath.c_str()); | 74 | LOG_CRITICAL(Core, "Failed to obtain loader for %s!", filepath.c_str()); |
| 74 | return ResultStatus::ErrorGetLoader; | 75 | return ResultStatus::ErrorGetLoader; |
| 75 | } | 76 | } |
| 77 | std::pair<boost::optional<u32>, Loader::ResultStatus> system_mode = | ||
| 78 | app_loader->LoadKernelSystemMode(); | ||
| 79 | |||
| 80 | if (system_mode.second != Loader::ResultStatus::Success) { | ||
| 81 | LOG_CRITICAL(Core, "Failed to determine system mode (Error %i)!", | ||
| 82 | static_cast<int>(system_mode.second)); | ||
| 83 | System::Shutdown(); | ||
| 76 | 84 | ||
| 77 | boost::optional<u32> system_mode{app_loader->LoadKernelSystemMode()}; | 85 | switch (system_mode.second) { |
| 78 | if (!system_mode) { | 86 | case Loader::ResultStatus::ErrorEncrypted: |
| 79 | LOG_CRITICAL(Core, "Failed to determine system mode!"); | 87 | return ResultStatus::ErrorLoader_ErrorEncrypted; |
| 80 | return ResultStatus::ErrorSystemMode; | 88 | case Loader::ResultStatus::ErrorInvalidFormat: |
| 89 | return ResultStatus::ErrorLoader_ErrorInvalidFormat; | ||
| 90 | default: | ||
| 91 | return ResultStatus::ErrorSystemMode; | ||
| 92 | } | ||
| 81 | } | 93 | } |
| 82 | 94 | ||
| 83 | ResultStatus init_result{Init(emu_window, system_mode.get())}; | 95 | ResultStatus init_result{Init(emu_window, system_mode.first.get())}; |
| 84 | if (init_result != ResultStatus::Success) { | 96 | if (init_result != ResultStatus::Success) { |
| 85 | LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", init_result); | 97 | LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", init_result); |
| 86 | System::Shutdown(); | 98 | System::Shutdown(); |
| @@ -101,7 +113,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file | |||
| 101 | return ResultStatus::ErrorLoader; | 113 | return ResultStatus::ErrorLoader; |
| 102 | } | 114 | } |
| 103 | } | 115 | } |
| 104 | return ResultStatus::Success; | 116 | status = ResultStatus::Success; |
| 117 | return status; | ||
| 105 | } | 118 | } |
| 106 | 119 | ||
| 107 | void System::PrepareReschedule() { | 120 | void System::PrepareReschedule() { |