diff options
Diffstat (limited to 'src/citra/citra.cpp')
| -rw-r--r-- | src/citra/citra.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index e47375f88..c742be231 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp | |||
| @@ -129,16 +129,23 @@ int main(int argc, char** argv) { | |||
| 129 | 129 | ||
| 130 | std::unique_ptr<EmuWindow_SDL2> emu_window = std::make_unique<EmuWindow_SDL2>(); | 130 | std::unique_ptr<EmuWindow_SDL2> emu_window = std::make_unique<EmuWindow_SDL2>(); |
| 131 | 131 | ||
| 132 | System::Init(emu_window.get()); | ||
| 133 | SCOPE_EXIT({ System::Shutdown(); }); | ||
| 134 | |||
| 135 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(boot_filename); | 132 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(boot_filename); |
| 136 | if (!loader) { | 133 | if (!loader) { |
| 137 | LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", boot_filename.c_str()); | 134 | LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", boot_filename.c_str()); |
| 138 | return -1; | 135 | return -1; |
| 139 | } | 136 | } |
| 140 | 137 | ||
| 141 | Loader::ResultStatus load_result = loader->Load(); | 138 | u32 system_mode; |
| 139 | Loader::ResultStatus load_result = loader->LoadKernelSystemMode(system_mode); | ||
| 140 | if (Loader::ResultStatus::Success != load_result) { | ||
| 141 | LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result); | ||
| 142 | return -1; | ||
| 143 | } | ||
| 144 | |||
| 145 | System::Init(emu_window.get(), system_mode); | ||
| 146 | SCOPE_EXIT({ System::Shutdown(); }); | ||
| 147 | |||
| 148 | load_result = loader->Load(); | ||
| 142 | if (Loader::ResultStatus::Success != load_result) { | 149 | if (Loader::ResultStatus::Success != load_result) { |
| 143 | LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result); | 150 | LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result); |
| 144 | return -1; | 151 | return -1; |