diff options
Diffstat (limited to '')
-rw-r--r-- | src/citra/citra.cpp | 13 | ||||
-rw-r--r-- | src/citra/config.cpp | 3 | ||||
-rw-r--r-- | src/citra/default_ini.h | 8 | ||||
-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 |
10 files changed, 48 insertions, 31 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); diff --git a/src/citra/config.cpp b/src/citra/config.cpp index fd30bfc85..29462c982 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -59,7 +59,6 @@ void Config::ReadValues() { // Core Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); - Settings::values.frame_skip = sdl2_config->GetInteger("Core", "frame_skip", 0); // Renderer Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true); @@ -67,6 +66,8 @@ void Config::ReadValues() { Settings::values.use_scaled_resolution = sdl2_config->GetBoolean("Renderer", "use_scaled_resolution", false); Settings::values.use_vsync = sdl2_config->GetBoolean("Renderer", "use_vsync", false); + Settings::values.toggle_framelimit = + sdl2_config->GetBoolean("Renderer", "toggle_framelimit", true); Settings::values.bg_red = (float)sdl2_config->GetReal("Renderer", "bg_red", 1.0); Settings::values.bg_green = (float)sdl2_config->GetReal("Renderer", "bg_green", 1.0); diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index b22627a2f..001b18ac2 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -42,10 +42,6 @@ pad_circle_modifier_scale = # 0: Interpreter (slow), 1 (default): JIT (fast) use_cpu_jit = -# The applied frameskip amount. Must be a power of two. -# 0 (default): No frameskip, 1: x2 frameskip, 2: x4 frameskip, 3: x8 frameskip, etc. -frame_skip = - [Renderer] # Whether to use software or hardware rendering. # 0: Software, 1 (default): Hardware @@ -68,6 +64,10 @@ use_vsync = # 0 (default): Default Top Bottom Screen, 1: Single Screen Only, 2: Large Screen Small Screen layout_option = +#Whether to toggle frame limiter on or off. +# 0: Off , 1 (default): On +toggle_framelimit = + # Swaps the prominent screen with the other screen. # For example, if Single Screen is chosen, setting this to 1 will display the bottom screen instead of the top screen. # 0 (default): Top Screen is prominent, 1: Bottom Screen is prominent 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_ |