diff options
Diffstat (limited to 'src/citra_qt/main.cpp')
| -rw-r--r-- | src/citra_qt/main.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 0bf9f48d6..a3887f9ab 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -253,7 +253,7 @@ void GMainWindow::OnDisplayTitleBars(bool show) { | |||
| 253 | } | 253 | } |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | bool GMainWindow::InitializeSystem() { | 256 | bool GMainWindow::InitializeSystem(u32 system_mode) { |
| 257 | // Shutdown previous session if the emu thread is still active... | 257 | // Shutdown previous session if the emu thread is still active... |
| 258 | if (emu_thread != nullptr) | 258 | if (emu_thread != nullptr) |
| 259 | ShutdownGame(); | 259 | ShutdownGame(); |
| @@ -270,7 +270,7 @@ bool GMainWindow::InitializeSystem() { | |||
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | // Initialize the core emulation | 272 | // Initialize the core emulation |
| 273 | System::Result system_result = System::Init(render_window); | 273 | System::Result system_result = System::Init(render_window, system_mode); |
| 274 | if (System::Result::Success != system_result) { | 274 | if (System::Result::Success != system_result) { |
| 275 | switch (system_result) { | 275 | switch (system_result) { |
| 276 | case System::Result::ErrorInitVideoCore: | 276 | case System::Result::ErrorInitVideoCore: |
| @@ -299,8 +299,20 @@ bool GMainWindow::LoadROM(const std::string& filename) { | |||
| 299 | return false; | 299 | return false; |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | boost::optional<u32> system_mode = app_loader->LoadKernelSystemMode(); | ||
| 303 | if (!system_mode) { | ||
| 304 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); | ||
| 305 | QMessageBox::critical(this, tr("Error while loading ROM!"), | ||
| 306 | tr("Could not determine the system mode.")); | ||
| 307 | return false; | ||
| 308 | } | ||
| 309 | |||
| 310 | if (!InitializeSystem(system_mode.get())) | ||
| 311 | return false; | ||
| 312 | |||
| 302 | Loader::ResultStatus result = app_loader->Load(); | 313 | Loader::ResultStatus result = app_loader->Load(); |
| 303 | if (Loader::ResultStatus::Success != result) { | 314 | if (Loader::ResultStatus::Success != result) { |
| 315 | System::Shutdown(); | ||
| 304 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); | 316 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); |
| 305 | 317 | ||
| 306 | switch (result) { | 318 | switch (result) { |
| @@ -338,13 +350,8 @@ void GMainWindow::BootGame(const std::string& filename) { | |||
| 338 | LOG_INFO(Frontend, "Citra starting..."); | 350 | LOG_INFO(Frontend, "Citra starting..."); |
| 339 | StoreRecentFile(filename); // Put the filename on top of the list | 351 | StoreRecentFile(filename); // Put the filename on top of the list |
| 340 | 352 | ||
| 341 | if (!InitializeSystem()) | 353 | if (!LoadROM(filename)) |
| 342 | return; | ||
| 343 | |||
| 344 | if (!LoadROM(filename)) { | ||
| 345 | System::Shutdown(); | ||
| 346 | return; | 354 | return; |
| 347 | } | ||
| 348 | 355 | ||
| 349 | // Create and start the emulation thread | 356 | // Create and start the emulation thread |
| 350 | emu_thread = std::make_unique<EmuThread>(render_window); | 357 | emu_thread = std::make_unique<EmuThread>(render_window); |