summaryrefslogtreecommitdiff
path: root/src/citra/citra.cpp
diff options
context:
space:
mode:
authorGravatar Subv2016-11-19 20:40:04 -0500
committerGravatar Subv2016-11-19 20:40:04 -0500
commit1323ab2f5f1627b39e48b6f970ad8208fa7af71e (patch)
tree6b3257864d76a4cdd3d8bb9847e55a2a51ff7573 /src/citra/citra.cpp
parentMerge pull request #2172 from jroweboy/fix-mingw (diff)
downloadyuzu-1323ab2f5f1627b39e48b6f970ad8208fa7af71e.tar.gz
yuzu-1323ab2f5f1627b39e48b6f970ad8208fa7af71e.tar.xz
yuzu-1323ab2f5f1627b39e48b6f970ad8208fa7af71e.zip
Kernel/Loader: Grab the system mode from the NCCH ExHeader.
3dsx and elf files default to system mode 2 (96MB allocated to the application). This allows Home Menu to boot without modifications. Closes #1849
Diffstat (limited to 'src/citra/citra.cpp')
-rw-r--r--src/citra/citra.cpp15
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;