Rewrite to keep only a single QSpinBox
* Second rewrite * set Unthrottled to 0 in the Qspinbox * Hotkey for Unthrottle
This commit is contained in:
parent
4af028bb0d
commit
1b3c91e2f3
10 changed files with 47 additions and 79 deletions
|
@ -123,7 +123,7 @@ void Config::ReadValues() {
|
||||||
Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true);
|
Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true);
|
||||||
Settings::values.resolution_factor =
|
Settings::values.resolution_factor =
|
||||||
static_cast<u16>(sdl2_config->GetInteger("Renderer", "resolution_factor", 1));
|
static_cast<u16>(sdl2_config->GetInteger("Renderer", "resolution_factor", 1));
|
||||||
Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true);
|
Settings::values.unthrottled = sdl2_config->GetBoolean("Renderer", "unthrottled", false);
|
||||||
Settings::values.use_disk_shader_cache =
|
Settings::values.use_disk_shader_cache =
|
||||||
sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", true);
|
sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", true);
|
||||||
Settings::values.frame_limit =
|
Settings::values.frame_limit =
|
||||||
|
|
|
@ -135,16 +135,17 @@ resolution_factor =
|
||||||
# Texture filter name
|
# Texture filter name
|
||||||
texture_filter_name =
|
texture_filter_name =
|
||||||
|
|
||||||
# Turns on the frame limiter, which will limit frames output to the target game speed
|
# Turns off the frame limiter, which will make the game speed go as high as it can.
|
||||||
# 0: Off, 1: On (default)
|
# 0: Off (default), 1: On
|
||||||
use_frame_limit =
|
unthrottled =
|
||||||
|
|
||||||
# Limits the speed of the game to run no faster than this value as a percentage of target speed
|
# Limits the speed of the game to run no faster than this value as a percentage of target speed.
|
||||||
|
# Will not have an effect if unthrottled is enabled.
|
||||||
# 1 - 9999: Speed limit as a percentage of target game speed. 100 (default)
|
# 1 - 9999: Speed limit as a percentage of target game speed. 100 (default)
|
||||||
frame_limit =
|
frame_limit =
|
||||||
|
|
||||||
# Overrides the frame limiter to use frame_limit_alternate instead of frame_limit. Will only have
|
# Overrides the frame limiter to use frame_limit_alternate instead of frame_limit. Will not have an
|
||||||
# an effect if use_frame_limit is enabled
|
# effect if unthrottled is enabled.
|
||||||
# 0: Off (default), 1: On
|
# 0: Off (default), 1: On
|
||||||
use_frame_limit_alternate =
|
use_frame_limit_alternate =
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ const std::array<UISettings::Shortcut, 24> default_hotkeys{
|
||||||
{QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}},
|
{QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Toggle Frame Advancing"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+A"), Qt::ApplicationShortcut}},
|
{QStringLiteral("Toggle Frame Advancing"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+A"), Qt::ApplicationShortcut}},
|
||||||
{QStringLiteral("Toggle Screen Layout"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::WindowShortcut}},
|
{QStringLiteral("Toggle Screen Layout"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Toggle Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Z"), Qt::ApplicationShortcut}},
|
{QStringLiteral("Unthrottle"), QStringLiteral("Main Window"), {QStringLiteral("Tab"), Qt::ApplicationShortcut}},
|
||||||
{QStringLiteral("Toggle Alternate Speed"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+X"), Qt::ApplicationShortcut}},
|
{QStringLiteral("Toggle Alternate Speed"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+X"), Qt::ApplicationShortcut}},
|
||||||
{QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), Qt::WindowShortcut}},
|
{QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Toggle Texture Dumping"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+D"), Qt::ApplicationShortcut}}}};
|
{QStringLiteral("Toggle Texture Dumping"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+D"), Qt::ApplicationShortcut}}}};
|
||||||
|
@ -446,8 +446,7 @@ void Config::ReadRendererValues() {
|
||||||
Settings::values.use_vsync_new = ReadSetting(QStringLiteral("use_vsync_new"), true).toBool();
|
Settings::values.use_vsync_new = ReadSetting(QStringLiteral("use_vsync_new"), true).toBool();
|
||||||
Settings::values.resolution_factor =
|
Settings::values.resolution_factor =
|
||||||
static_cast<u16>(ReadSetting(QStringLiteral("resolution_factor"), 1).toInt());
|
static_cast<u16>(ReadSetting(QStringLiteral("resolution_factor"), 1).toInt());
|
||||||
Settings::values.use_frame_limit =
|
Settings::values.unthrottled = ReadSetting(QStringLiteral("unthrottled"), false).toBool();
|
||||||
ReadSetting(QStringLiteral("use_frame_limit"), true).toBool();
|
|
||||||
Settings::values.frame_limit = ReadSetting(QStringLiteral("frame_limit"), 100).toInt();
|
Settings::values.frame_limit = ReadSetting(QStringLiteral("frame_limit"), 100).toInt();
|
||||||
Settings::values.use_frame_limit_alternate =
|
Settings::values.use_frame_limit_alternate =
|
||||||
ReadSetting(QStringLiteral("use_frame_limit_alternate"), false).toBool();
|
ReadSetting(QStringLiteral("use_frame_limit_alternate"), false).toBool();
|
||||||
|
@ -934,7 +933,7 @@ void Config::SaveRendererValues() {
|
||||||
WriteSetting(QStringLiteral("use_shader_jit"), Settings::values.use_shader_jit, true);
|
WriteSetting(QStringLiteral("use_shader_jit"), Settings::values.use_shader_jit, true);
|
||||||
WriteSetting(QStringLiteral("use_vsync_new"), Settings::values.use_vsync_new, true);
|
WriteSetting(QStringLiteral("use_vsync_new"), Settings::values.use_vsync_new, true);
|
||||||
WriteSetting(QStringLiteral("resolution_factor"), Settings::values.resolution_factor, 1);
|
WriteSetting(QStringLiteral("resolution_factor"), Settings::values.resolution_factor, 1);
|
||||||
WriteSetting(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true);
|
WriteSetting(QStringLiteral("unthrottled"), Settings::values.unthrottled, false);
|
||||||
WriteSetting(QStringLiteral("frame_limit"), Settings::values.frame_limit, 100);
|
WriteSetting(QStringLiteral("frame_limit"), Settings::values.frame_limit, 100);
|
||||||
WriteSetting(QStringLiteral("use_frame_limit_alternate"),
|
WriteSetting(QStringLiteral("use_frame_limit_alternate"),
|
||||||
Settings::values.use_frame_limit_alternate, false);
|
Settings::values.use_frame_limit_alternate, false);
|
||||||
|
|
|
@ -15,11 +15,6 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
SetConfiguration();
|
SetConfiguration();
|
||||||
|
|
||||||
connect(ui->toggle_frame_limit, &QCheckBox::toggled, ui->frame_limit, &QSpinBox::setEnabled);
|
|
||||||
|
|
||||||
connect(ui->toggle_alternate_speed, &QCheckBox::toggled, ui->frame_limit_alternate,
|
|
||||||
&QSpinBox::setEnabled);
|
|
||||||
|
|
||||||
ui->updateBox->setVisible(UISettings::values.updater_found);
|
ui->updateBox->setVisible(UISettings::values.updater_found);
|
||||||
connect(ui->button_reset_defaults, &QPushButton::clicked, this,
|
connect(ui->button_reset_defaults, &QPushButton::clicked, this,
|
||||||
&ConfigureGeneral::ResetDefaults);
|
&ConfigureGeneral::ResetDefaults);
|
||||||
|
@ -38,14 +33,14 @@ void ConfigureGeneral::SetConfiguration() {
|
||||||
// The first item is "auto-select" with actual value -1, so plus one here will do the trick
|
// The first item is "auto-select" with actual value -1, so plus one here will do the trick
|
||||||
ui->region_combobox->setCurrentIndex(Settings::values.region_value + 1);
|
ui->region_combobox->setCurrentIndex(Settings::values.region_value + 1);
|
||||||
|
|
||||||
ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit);
|
|
||||||
ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked());
|
|
||||||
ui->frame_limit->setValue(Settings::values.frame_limit);
|
|
||||||
|
|
||||||
ui->toggle_alternate_speed->setChecked(Settings::values.use_frame_limit_alternate);
|
ui->toggle_alternate_speed->setChecked(Settings::values.use_frame_limit_alternate);
|
||||||
ui->frame_limit_alternate->setEnabled(ui->toggle_alternate_speed->isChecked());
|
if (Settings::values.unthrottled) {
|
||||||
|
ui->frame_limit_alternate->setValue(0);
|
||||||
|
} else {
|
||||||
ui->frame_limit_alternate->setValue(Settings::values.frame_limit_alternate);
|
ui->frame_limit_alternate->setValue(Settings::values.frame_limit_alternate);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ConfigureGeneral::ResetDefaults() {
|
void ConfigureGeneral::ResetDefaults() {
|
||||||
QMessageBox::StandardButton answer = QMessageBox::question(
|
QMessageBox::StandardButton answer = QMessageBox::question(
|
||||||
|
@ -70,12 +65,16 @@ void ConfigureGeneral::ApplyConfiguration() {
|
||||||
|
|
||||||
Settings::values.region_value = ui->region_combobox->currentIndex() - 1;
|
Settings::values.region_value = ui->region_combobox->currentIndex() - 1;
|
||||||
|
|
||||||
Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked();
|
|
||||||
Settings::values.frame_limit = ui->frame_limit->value();
|
|
||||||
|
|
||||||
Settings::values.use_frame_limit_alternate = ui->toggle_alternate_speed->isChecked();
|
Settings::values.use_frame_limit_alternate = ui->toggle_alternate_speed->isChecked();
|
||||||
|
if (!ui->toggle_alternate_speed->isChecked()) {
|
||||||
|
if (ui->frame_limit_alternate->value() == 0)
|
||||||
|
Settings::values.unthrottled = true;
|
||||||
|
} else {
|
||||||
|
Settings::values.unthrottled = false;
|
||||||
|
if (!ui->frame_limit_alternate->value() == 0)
|
||||||
Settings::values.frame_limit_alternate = ui->frame_limit_alternate->value();
|
Settings::values.frame_limit_alternate = ui->frame_limit_alternate->value();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureGeneral::RetranslateUI() {
|
void ConfigureGeneral::RetranslateUI() {
|
||||||
ui->retranslateUi(this);
|
ui->retranslateUi(this);
|
||||||
|
|
|
@ -76,16 +76,9 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="toggle_frame_limit">
|
|
||||||
<property name="text">
|
|
||||||
<string>Limit Speed Percent</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QCheckBox" name="toggle_alternate_speed">
|
<widget class="QCheckBox" name="toggle_alternate_speed">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Alternate Speed Limit</string>
|
<string>Alternate Speed Percent</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -141,28 +134,12 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="frame_limit">
|
|
||||||
<property name="suffix">
|
|
||||||
<string>%</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>9999</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>100</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QSpinBox" name="frame_limit_alternate">
|
<widget class="QSpinBox" name="frame_limit_alternate">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>%</string>
|
<string>%</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>9999</number>
|
<number>9999</number>
|
||||||
|
@ -170,6 +147,12 @@
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>200</number>
|
<number>200</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="specialValueText">
|
||||||
|
<string>Unthrottled</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -491,9 +491,9 @@ void GMainWindow::InitializeHotkeys() {
|
||||||
ToggleFullscreen();
|
ToggleFullscreen();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Speed Limit"), this),
|
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Unthrottle"), this),
|
||||||
&QShortcut::activated, this, [&] {
|
&QShortcut::activated, this, [&] {
|
||||||
Settings::values.use_frame_limit = !Settings::values.use_frame_limit;
|
Settings::values.unthrottled = !Settings::values.unthrottled;
|
||||||
UpdateStatusBar();
|
UpdateStatusBar();
|
||||||
});
|
});
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Alternate Speed"), this),
|
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Alternate Speed"), this),
|
||||||
|
@ -510,31 +510,17 @@ void GMainWindow::InitializeHotkeys() {
|
||||||
static constexpr u16 SPEED_LIMIT_STEP = 5;
|
static constexpr u16 SPEED_LIMIT_STEP = 5;
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this),
|
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this),
|
||||||
&QShortcut::activated, this, [&] {
|
&QShortcut::activated, this, [&] {
|
||||||
if (Settings::values.use_frame_limit_alternate) {
|
|
||||||
if (Settings::values.frame_limit_alternate < 9999 - SPEED_LIMIT_STEP) {
|
if (Settings::values.frame_limit_alternate < 9999 - SPEED_LIMIT_STEP) {
|
||||||
Settings::values.frame_limit_alternate += SPEED_LIMIT_STEP;
|
Settings::values.frame_limit_alternate += SPEED_LIMIT_STEP;
|
||||||
UpdateStatusBar();
|
UpdateStatusBar();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) {
|
|
||||||
Settings::values.frame_limit += SPEED_LIMIT_STEP;
|
|
||||||
UpdateStatusBar();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Decrease Speed Limit"), this),
|
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Decrease Speed Limit"), this),
|
||||||
&QShortcut::activated, this, [&] {
|
&QShortcut::activated, this, [&] {
|
||||||
if (Settings::values.use_frame_limit_alternate) {
|
|
||||||
if (Settings::values.frame_limit_alternate > SPEED_LIMIT_STEP) {
|
if (Settings::values.frame_limit_alternate > SPEED_LIMIT_STEP) {
|
||||||
Settings::values.frame_limit_alternate -= SPEED_LIMIT_STEP;
|
Settings::values.frame_limit_alternate -= SPEED_LIMIT_STEP;
|
||||||
UpdateStatusBar();
|
UpdateStatusBar();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (Settings::values.frame_limit > SPEED_LIMIT_STEP) {
|
|
||||||
Settings::values.frame_limit -= SPEED_LIMIT_STEP;
|
|
||||||
UpdateStatusBar();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Frame Advancing"), this),
|
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Frame Advancing"), this),
|
||||||
&QShortcut::activated, ui.action_Enable_Frame_Advancing, &QAction::trigger);
|
&QShortcut::activated, ui.action_Enable_Frame_Advancing, &QAction::trigger);
|
||||||
|
@ -2041,7 +2027,7 @@ void GMainWindow::UpdateStatusBar() {
|
||||||
|
|
||||||
auto results = Core::System::GetInstance().GetAndResetPerfStats();
|
auto results = Core::System::GetInstance().GetAndResetPerfStats();
|
||||||
|
|
||||||
if (Settings::values.use_frame_limit) {
|
if (!Settings::values.unthrottled) {
|
||||||
if (Settings::values.use_frame_limit_alternate)
|
if (Settings::values.use_frame_limit_alternate)
|
||||||
{
|
{
|
||||||
emu_speed_label->setText(tr("Speed: %1% / %2%")
|
emu_speed_label->setText(tr("Speed: %1% / %2%")
|
||||||
|
|
|
@ -133,7 +133,7 @@ void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Settings::values.use_frame_limit) {
|
if (Settings::values.unthrottled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ void LogSettings() {
|
||||||
LogSetting("Renderer_ShadersAccurateMul", Settings::values.shaders_accurate_mul);
|
LogSetting("Renderer_ShadersAccurateMul", Settings::values.shaders_accurate_mul);
|
||||||
LogSetting("Renderer_UseShaderJit", Settings::values.use_shader_jit);
|
LogSetting("Renderer_UseShaderJit", Settings::values.use_shader_jit);
|
||||||
LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor);
|
LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor);
|
||||||
LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit);
|
LogSetting("Renderer_Unthrottled", Settings::values.unthrottled);
|
||||||
LogSetting("Renderer_FrameLimit", Settings::values.frame_limit);
|
LogSetting("Renderer_FrameLimit", Settings::values.frame_limit);
|
||||||
LogSetting("Renderer_UseFrameLimitAlternate", Settings::values.use_frame_limit_alternate);
|
LogSetting("Renderer_UseFrameLimitAlternate", Settings::values.use_frame_limit_alternate);
|
||||||
LogSetting("Renderer_FrameLimitAlternate", Settings::values.frame_limit_alternate);
|
LogSetting("Renderer_FrameLimitAlternate", Settings::values.frame_limit_alternate);
|
||||||
|
|
|
@ -146,7 +146,7 @@ struct Values {
|
||||||
bool shaders_accurate_mul;
|
bool shaders_accurate_mul;
|
||||||
bool use_shader_jit;
|
bool use_shader_jit;
|
||||||
u16 resolution_factor;
|
u16 resolution_factor;
|
||||||
bool use_frame_limit;
|
bool unthrottled;
|
||||||
bool use_frame_limit_alternate;
|
bool use_frame_limit_alternate;
|
||||||
u16 frame_limit;
|
u16 frame_limit;
|
||||||
u16 frame_limit_alternate;
|
u16 frame_limit_alternate;
|
||||||
|
|
|
@ -165,8 +165,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) {
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Core_UseCpuJit", Settings::values.use_cpu_jit);
|
AddField(Telemetry::FieldType::UserConfig, "Core_UseCpuJit", Settings::values.use_cpu_jit);
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Renderer_ResolutionFactor",
|
AddField(Telemetry::FieldType::UserConfig, "Renderer_ResolutionFactor",
|
||||||
Settings::values.resolution_factor);
|
Settings::values.resolution_factor);
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Renderer_UseFrameLimit",
|
AddField(Telemetry::FieldType::UserConfig, "Renderer_Unthrottled",
|
||||||
Settings::values.use_frame_limit);
|
Settings::values.unthrottled);
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Renderer_FrameLimit", Settings::values.frame_limit);
|
AddField(Telemetry::FieldType::UserConfig, "Renderer_FrameLimit", Settings::values.frame_limit);
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Renderer_UseFrameLimitAlternate",
|
AddField(Telemetry::FieldType::UserConfig, "Renderer_UseFrameLimitAlternate",
|
||||||
Settings::values.use_frame_limit_alternate);
|
Settings::values.use_frame_limit_alternate);
|
||||||
|
|
Loading…
Reference in a new issue