diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-11-27 17:04:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-27 17:04:11 -0800 |
commit | 3174bfd50c69dfa523671b96448113996a0bc42c (patch) | |
tree | 89575620a506d18c6fea2f8570c09bc0e9864263 /src/citra/citra.cpp | |
parent | e279a6955edf644cf832dd329ac72931aea8add7 (diff) | |
parent | d171409f29ce3d8bcf7ed6ce16392b4b4ec97c4b (diff) |
Merge pull request #2196 from Subv/system_mode
Kernel/Loader: Grab the system mode from the NCCH ExHeader.
Diffstat (limited to 'src/citra/citra.cpp')
-rw-r--r-- | src/citra/citra.cpp | 13 |
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); |