diff options
Diffstat (limited to 'src/citra_qt')
| -rw-r--r-- | src/citra_qt/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 4 | ||||
| -rw-r--r-- | src/citra_qt/configure_graphics.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/configure_graphics.ui | 7 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 23 | ||||
| -rw-r--r-- | src/citra_qt/main.h | 7 | ||||
| -rw-r--r-- | src/citra_qt/version.h | 11 |
7 files changed, 32 insertions, 23 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 384875450..a9dacd5f1 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -65,7 +65,6 @@ set(HEADERS hotkeys.h main.h ui_settings.h - version.h ) set(UIS diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 3d2312619..06a4e9d25 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -39,7 +39,6 @@ void Config::ReadValues() { qt_config->beginGroup("Core"); Settings::values.use_cpu_jit = qt_config->value("use_cpu_jit", true).toBool(); - Settings::values.frame_skip = qt_config->value("frame_skip", 0).toInt(); qt_config->endGroup(); qt_config->beginGroup("Renderer"); @@ -48,6 +47,7 @@ void Config::ReadValues() { Settings::values.use_scaled_resolution = qt_config->value("use_scaled_resolution", false).toBool(); Settings::values.use_vsync = qt_config->value("use_vsync", false).toBool(); + Settings::values.toggle_framelimit = qt_config->value("toggle_framelimit", true).toBool(); Settings::values.bg_red = qt_config->value("bg_red", 1.0).toFloat(); Settings::values.bg_green = qt_config->value("bg_green", 1.0).toFloat(); @@ -146,7 +146,6 @@ void Config::SaveValues() { qt_config->beginGroup("Core"); qt_config->setValue("use_cpu_jit", Settings::values.use_cpu_jit); - qt_config->setValue("frame_skip", Settings::values.frame_skip); qt_config->endGroup(); qt_config->beginGroup("Renderer"); @@ -154,6 +153,7 @@ void Config::SaveValues() { qt_config->setValue("use_shader_jit", Settings::values.use_shader_jit); qt_config->setValue("use_scaled_resolution", Settings::values.use_scaled_resolution); qt_config->setValue("use_vsync", Settings::values.use_vsync); + qt_config->setValue("toggle_framelimit", Settings::values.toggle_framelimit); // Cast to double because Qt's written float values are not human-readable qt_config->setValue("bg_red", (double)Settings::values.bg_red); diff --git a/src/citra_qt/configure_graphics.cpp b/src/citra_qt/configure_graphics.cpp index 29834e11b..36f10c8d7 100644 --- a/src/citra_qt/configure_graphics.cpp +++ b/src/citra_qt/configure_graphics.cpp @@ -23,6 +23,7 @@ void ConfigureGraphics::setConfiguration() { ui->toggle_shader_jit->setChecked(Settings::values.use_shader_jit); ui->toggle_scaled_resolution->setChecked(Settings::values.use_scaled_resolution); ui->toggle_vsync->setChecked(Settings::values.use_vsync); + ui->toggle_framelimit->setChecked(Settings::values.toggle_framelimit); ui->layout_combobox->setCurrentIndex(static_cast<int>(Settings::values.layout_option)); ui->swap_screen->setChecked(Settings::values.swap_screen); } @@ -32,6 +33,7 @@ void ConfigureGraphics::applyConfiguration() { Settings::values.use_shader_jit = ui->toggle_shader_jit->isChecked(); Settings::values.use_scaled_resolution = ui->toggle_scaled_resolution->isChecked(); Settings::values.use_vsync = ui->toggle_vsync->isChecked(); + Settings::values.toggle_framelimit = ui->toggle_framelimit->isChecked(); Settings::values.layout_option = static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex()); Settings::values.swap_screen = ui->swap_screen->isChecked(); diff --git a/src/citra_qt/configure_graphics.ui b/src/citra_qt/configure_graphics.ui index af16a4292..964aa0bbd 100644 --- a/src/citra_qt/configure_graphics.ui +++ b/src/citra_qt/configure_graphics.ui @@ -50,6 +50,13 @@ </property> </widget> </item> + <item> + <widget class="QCheckBox" name="toggle_framelimit"> + <property name="text"> + <string>Limit framerate</string> + </property> + </widget> + </item> </layout> </widget> </item> 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) { } } -bool GMainWindow::InitializeSystem() { +bool GMainWindow::InitializeSystem(u32 system_mode) { // Shutdown previous session if the emu thread is still active... if (emu_thread != nullptr) ShutdownGame(); @@ -270,7 +270,7 @@ bool GMainWindow::InitializeSystem() { } // Initialize the core emulation - System::Result system_result = System::Init(render_window); + System::Result system_result = System::Init(render_window, system_mode); if (System::Result::Success != system_result) { switch (system_result) { case System::Result::ErrorInitVideoCore: @@ -299,8 +299,20 @@ bool GMainWindow::LoadROM(const std::string& filename) { return false; } + boost::optional<u32> system_mode = app_loader->LoadKernelSystemMode(); + if (!system_mode) { + LOG_CRITICAL(Frontend, "Failed to load ROM!"); + QMessageBox::critical(this, tr("Error while loading ROM!"), + tr("Could not determine the system mode.")); + return false; + } + + if (!InitializeSystem(system_mode.get())) + return false; + Loader::ResultStatus result = app_loader->Load(); if (Loader::ResultStatus::Success != result) { + System::Shutdown(); LOG_CRITICAL(Frontend, "Failed to load ROM!"); switch (result) { @@ -338,13 +350,8 @@ void GMainWindow::BootGame(const std::string& filename) { LOG_INFO(Frontend, "Citra starting..."); StoreRecentFile(filename); // Put the filename on top of the list - if (!InitializeSystem()) - return; - - if (!LoadROM(filename)) { - System::Shutdown(); + if (!LoadROM(filename)) return; - } // Create and start the emulation thread emu_thread = std::make_unique<EmuThread>(render_window); diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 82eb90aae..f87178227 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -60,7 +60,12 @@ signals: void EmulationStopping(); private: - bool InitializeSystem(); + /** + * Initializes the emulation system. + * @param system_mode The system mode with which to intialize the kernel. + * @returns Whether the system was properly initialized. + */ + bool InitializeSystem(u32 system_mode); bool LoadROM(const std::string& filename); void BootGame(const std::string& filename); void ShutdownGame(); diff --git a/src/citra_qt/version.h b/src/citra_qt/version.h deleted file mode 100644 index 9d5a2b1a2..000000000 --- a/src/citra_qt/version.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -// TODO: Supposed to be generated... -// GENERATED - Do not edit! -#ifndef VERSION_H_ -#define VERSION_H_ -#define __BUILD__ "40" -#define VERSION __BUILD__ -#endif // VERSION_H_ |
