summaryrefslogtreecommitdiffstats
path: root/src/citra/citra.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra/citra.cpp')
-rw-r--r--src/citra/citra.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index e47375f88..f9387e61c 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -129,15 +129,22 @@ int main(int argc, char** argv) {
std::unique_ptr<EmuWindow_SDL2> emu_window = std::make_unique<EmuWindow_SDL2>();
- System::Init(emu_window.get());
- SCOPE_EXIT({ System::Shutdown(); });
-
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(boot_filename);
if (!loader) {
LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", boot_filename.c_str());
return -1;
}
+ boost::optional<u32> system_mode = loader->LoadKernelSystemMode();
+
+ if (!system_mode) {
+ LOG_CRITICAL(Frontend, "Failed to load ROM (Could not determine system mode)!");
+ return -1;
+ }
+
+ System::Init(emu_window.get(), system_mode.get());
+ SCOPE_EXIT({ System::Shutdown(); });
+
Loader::ResultStatus load_result = loader->Load();
if (Loader::ResultStatus::Success != load_result) {
LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result);