summaryrefslogtreecommitdiff
path: root/src/citra/citra.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-11-27 17:04:11 -0800
committerGravatar GitHub2016-11-27 17:04:11 -0800
commit3174bfd50c69dfa523671b96448113996a0bc42c (patch)
tree89575620a506d18c6fea2f8570c09bc0e9864263 /src/citra/citra.cpp
parentMerge pull request #2222 from linkmauve/die-frameskip-die (diff)
parentKernel/Loader: Grab the system mode from the NCCH ExHeader. (diff)
downloadyuzu-3174bfd50c69dfa523671b96448113996a0bc42c.tar.gz
yuzu-3174bfd50c69dfa523671b96448113996a0bc42c.tar.xz
yuzu-3174bfd50c69dfa523671b96448113996a0bc42c.zip
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.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) {
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
138 boost::optional<u32> system_mode = loader->LoadKernelSystemMode();
139
140 if (!system_mode) {
141 LOG_CRITICAL(Frontend, "Failed to load ROM (Could not determine system mode)!");
142 return -1;
143 }
144
145 System::Init(emu_window.get(), system_mode.get());
146 SCOPE_EXIT({ System::Shutdown(); });
147
141 Loader::ResultStatus load_result = loader->Load(); 148 Loader::ResultStatus 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);