mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-27 03:50:04 +00:00
minor improvements to the design
This commit is contained in:
parent
1b3c91e2f3
commit
acc46884ff
@ -123,7 +123,6 @@ 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.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,22 +135,17 @@ resolution_factor =
|
|||||||
# Texture filter name
|
# Texture filter name
|
||||||
texture_filter_name =
|
texture_filter_name =
|
||||||
|
|
||||||
# Turns off the frame limiter, which will make the game speed go as high as it can.
|
|
||||||
# 0: Off (default), 1: On
|
|
||||||
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.
|
# 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. 0 for unthrottled. 100 (default)
|
||||||
frame_limit =
|
frame_limit =
|
||||||
|
|
||||||
# Overrides the frame limiter to use frame_limit_alternate instead of frame_limit. Will not have an
|
# Overrides the frame limiter to use frame_limit_alternate instead of frame_limit.
|
||||||
# effect if unthrottled is enabled.
|
|
||||||
# 0: Off (default), 1: On
|
# 0: Off (default), 1: On
|
||||||
use_frame_limit_alternate =
|
use_frame_limit_alternate =
|
||||||
|
|
||||||
# Alternate speed limit to be used instead of frame_limit if use_frame_limit_alternate is enabled
|
# Alternate speed limit to be used instead of frame_limit if use_frame_limit_alternate is enabled
|
||||||
# 1 - 9999: Speed limit as a percentage of target game speed. 200 (default)
|
# 1 - 9999: Speed limit as a percentage of target game speed. 0 for unthrottled. 200 (default)
|
||||||
frame_limit_alternate =
|
frame_limit_alternate =
|
||||||
|
|
||||||
# The clear color for the renderer. What shows up on the sides of the bottom screen.
|
# The clear color for the renderer. What shows up on the sides of the bottom screen.
|
||||||
|
@ -57,7 +57,7 @@ const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config:
|
|||||||
// This must be in alphabetical order according to action name as it must have the same order as
|
// This must be in alphabetical order according to action name as it must have the same order as
|
||||||
// UISetting::values.shortcuts, which is alphabetically ordered.
|
// UISetting::values.shortcuts, which is alphabetically ordered.
|
||||||
// clang-format off
|
// clang-format off
|
||||||
const std::array<UISettings::Shortcut, 24> default_hotkeys{
|
const std::array<UISettings::Shortcut, 23> default_hotkeys{
|
||||||
{{QStringLiteral("Advance Frame"), QStringLiteral("Main Window"), {QStringLiteral("\\"), Qt::ApplicationShortcut}},
|
{{QStringLiteral("Advance Frame"), QStringLiteral("Main Window"), {QStringLiteral("\\"), Qt::ApplicationShortcut}},
|
||||||
{QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}},
|
{QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}},
|
||||||
{QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}},
|
{QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}},
|
||||||
@ -78,8 +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("Unthrottle"), QStringLiteral("Main Window"), {QStringLiteral("Tab"), Qt::ApplicationShortcut}},
|
{QStringLiteral("Toggle Alternate Speed"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Z"), 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}}}};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
@ -446,7 +445,6 @@ 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.unthrottled = ReadSetting(QStringLiteral("unthrottled"), false).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();
|
||||||
@ -933,12 +931,11 @@ 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("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);
|
||||||
WriteSetting(QStringLiteral("frame_limit_alternate"),
|
WriteSetting(QStringLiteral("frame_limit_alternate"), Settings::values.frame_limit_alternate,
|
||||||
Settings::values.frame_limit_alternate, 200);
|
200);
|
||||||
|
|
||||||
// Cast to double because Qt's written float values are not human-readable
|
// Cast to double because Qt's written float values are not human-readable
|
||||||
WriteSetting(QStringLiteral("bg_red"), (double)Settings::values.bg_red, 0.0);
|
WriteSetting(QStringLiteral("bg_red"), (double)Settings::values.bg_red, 0.0);
|
||||||
|
@ -9,6 +9,17 @@
|
|||||||
#include "core/settings.h"
|
#include "core/settings.h"
|
||||||
#include "ui_configure_general.h"
|
#include "ui_configure_general.h"
|
||||||
|
|
||||||
|
// The QSlider doesn't have an easy way to set a custom step amount,
|
||||||
|
// so we can just convert from the sliders range (0 - 198) to the expected
|
||||||
|
// settings range (5 - 995) with simple math.
|
||||||
|
static constexpr int SliderToSettings(int value) {
|
||||||
|
return 5 * value + 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr int SettingsToSlider(int value) {
|
||||||
|
return (value - 5) / 5;
|
||||||
|
}
|
||||||
|
|
||||||
ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
||||||
: QWidget(parent), ui(new Ui::ConfigureGeneral) {
|
: QWidget(parent), ui(new Ui::ConfigureGeneral) {
|
||||||
|
|
||||||
@ -18,6 +29,24 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
|||||||
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);
|
||||||
|
|
||||||
|
connect(ui->frame_limit, &QSlider::valueChanged, [&](int value) {
|
||||||
|
if (value == ui->frame_limit->maximum()) {
|
||||||
|
ui->game_speed_display_label->setText(tr("unthrottled"));
|
||||||
|
} else {
|
||||||
|
ui->game_speed_display_label->setText(
|
||||||
|
QStringLiteral("%1%").arg(SliderToSettings(value)).rightJustified(11));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->frame_limit_alternate, &QSlider::valueChanged, [&](int value) {
|
||||||
|
if (value == ui->frame_limit_alternate->maximum()) {
|
||||||
|
ui->game_speed_alternate_display_label->setText(tr("unthrottled"));
|
||||||
|
} else {
|
||||||
|
ui->game_speed_alternate_display_label->setText(
|
||||||
|
QStringLiteral("%1%").arg(SliderToSettings(value)).rightJustified(11));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigureGeneral::~ConfigureGeneral() = default;
|
ConfigureGeneral::~ConfigureGeneral() = default;
|
||||||
@ -33,14 +62,36 @@ 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_alternate_speed->setChecked(Settings::values.use_frame_limit_alternate);
|
if (Settings::values.frame_limit == 0) {
|
||||||
if (Settings::values.unthrottled) {
|
ui->frame_limit->setValue(ui->frame_limit->maximum());
|
||||||
ui->frame_limit_alternate->setValue(0);
|
|
||||||
} else {
|
} else {
|
||||||
ui->frame_limit_alternate->setValue(Settings::values.frame_limit_alternate);
|
ui->frame_limit->setValue(SettingsToSlider(Settings::values.frame_limit));
|
||||||
}
|
}
|
||||||
|
if (ui->frame_limit->value() == ui->frame_limit->maximum()) {
|
||||||
|
ui->game_speed_display_label->setText(tr("unthrottled"));
|
||||||
|
} else {
|
||||||
|
ui->game_speed_display_label->setText(QStringLiteral("%1%")
|
||||||
|
.arg(SliderToSettings(ui->frame_limit->value()))
|
||||||
|
.rightJustified(11));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->toggle_alternate_speed->setChecked(Settings::values.use_frame_limit_alternate);
|
||||||
|
|
||||||
|
if (Settings::values.frame_limit_alternate == 0) {
|
||||||
|
ui->frame_limit_alternate->setValue(ui->frame_limit_alternate->maximum());
|
||||||
|
} else {
|
||||||
|
ui->frame_limit_alternate->setValue(
|
||||||
|
SettingsToSlider(Settings::values.frame_limit_alternate));
|
||||||
|
}
|
||||||
|
if (ui->frame_limit_alternate->value() == ui->frame_limit_alternate->maximum()) {
|
||||||
|
ui->game_speed_alternate_display_label->setText(tr("unthrottled"));
|
||||||
|
} else {
|
||||||
|
ui->game_speed_alternate_display_label->setText(
|
||||||
|
QStringLiteral("%1%")
|
||||||
|
.arg(SliderToSettings(ui->frame_limit_alternate->value()))
|
||||||
|
.rightJustified(11));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureGeneral::ResetDefaults() {
|
void ConfigureGeneral::ResetDefaults() {
|
||||||
QMessageBox::StandardButton answer = QMessageBox::question(
|
QMessageBox::StandardButton answer = QMessageBox::question(
|
||||||
@ -65,14 +116,17 @@ 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_alternate = ui->toggle_alternate_speed->isChecked();
|
if (ui->frame_limit->value() == ui->frame_limit->maximum()) {
|
||||||
if (!ui->toggle_alternate_speed->isChecked()) {
|
Settings::values.frame_limit = 0;
|
||||||
if (ui->frame_limit_alternate->value() == 0)
|
|
||||||
Settings::values.unthrottled = true;
|
|
||||||
} else {
|
} else {
|
||||||
Settings::values.unthrottled = false;
|
Settings::values.frame_limit = SliderToSettings(ui->frame_limit->value());
|
||||||
if (!ui->frame_limit_alternate->value() == 0)
|
}
|
||||||
Settings::values.frame_limit_alternate = ui->frame_limit_alternate->value();
|
Settings::values.use_frame_limit_alternate = ui->toggle_alternate_speed->isChecked();
|
||||||
|
if (ui->frame_limit_alternate->value() == ui->frame_limit_alternate->maximum()) {
|
||||||
|
Settings::values.frame_limit_alternate = 0;
|
||||||
|
} else {
|
||||||
|
Settings::values.frame_limit_alternate =
|
||||||
|
SliderToSettings(ui->frame_limit_alternate->value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>345</width>
|
<width>408</width>
|
||||||
<height>358</height>
|
<height>396</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -75,21 +75,7 @@
|
|||||||
<string>Emulation</string>
|
<string>Emulation</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="0">
|
<item row="0" column="2">
|
||||||
<widget class="QCheckBox" name="toggle_alternate_speed">
|
|
||||||
<property name="text">
|
|
||||||
<string>Alternate Speed Percent</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Region:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="region_combobox">
|
<widget class="QComboBox" name="region_combobox">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -133,25 +119,94 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="0">
|
||||||
<widget class="QSpinBox" name="frame_limit_alternate">
|
<widget class="QLabel" name="label_game_speed">
|
||||||
<property name="suffix">
|
<property name="text">
|
||||||
<string>%</string>
|
<string>Game Speed:</string>
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="toggle_alternate_speed">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use Alternate Speed:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QSlider" name="frame_limit">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>9999</number>
|
<number>199</number>
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>200</number>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="specialValueText">
|
<property name="pageStep">
|
||||||
<string>Unthrottled</string>
|
<number>15</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>25</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="tickPosition">
|
||||||
|
<enum>QSlider::TicksBelow</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="game_speed_display_label">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Region:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QSlider" name="frame_limit_alternate">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>199</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>15</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>25</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="tickPosition">
|
||||||
|
<enum>QSlider::TicksBelow</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="game_speed_alternate_display_label">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -491,11 +491,6 @@ void GMainWindow::InitializeHotkeys() {
|
|||||||
ToggleFullscreen();
|
ToggleFullscreen();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Unthrottle"), this),
|
|
||||||
&QShortcut::activated, this, [&] {
|
|
||||||
Settings::values.unthrottled = !Settings::values.unthrottled;
|
|
||||||
UpdateStatusBar();
|
|
||||||
});
|
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Alternate Speed"), this),
|
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Alternate Speed"), this),
|
||||||
&QShortcut::activated, this, [&] {
|
&QShortcut::activated, this, [&] {
|
||||||
Settings::values.use_frame_limit_alternate =
|
Settings::values.use_frame_limit_alternate =
|
||||||
@ -510,17 +505,44 @@ 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.frame_limit_alternate < 9999 - SPEED_LIMIT_STEP) {
|
if (Settings::values.use_frame_limit_alternate) {
|
||||||
Settings::values.frame_limit_alternate += SPEED_LIMIT_STEP;
|
if (Settings::values.frame_limit_alternate == 0) {
|
||||||
UpdateStatusBar();
|
return;
|
||||||
}
|
}
|
||||||
|
if (Settings::values.frame_limit_alternate < 995 - SPEED_LIMIT_STEP) {
|
||||||
|
Settings::values.frame_limit_alternate += SPEED_LIMIT_STEP;
|
||||||
|
} else {
|
||||||
|
Settings::values.frame_limit_alternate = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Settings::values.frame_limit == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Settings::values.frame_limit < 995 - SPEED_LIMIT_STEP) {
|
||||||
|
Settings::values.frame_limit += SPEED_LIMIT_STEP;
|
||||||
|
} else {
|
||||||
|
Settings::values.frame_limit = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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.frame_limit_alternate > SPEED_LIMIT_STEP) {
|
if (Settings::values.use_frame_limit_alternate) {
|
||||||
|
if (Settings::values.frame_limit_alternate == 0) {
|
||||||
|
Settings::values.frame_limit_alternate = 995;
|
||||||
|
} else 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;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Settings::values.frame_limit == 0) {
|
||||||
|
Settings::values.frame_limit = 995;
|
||||||
|
} else if (Settings::values.frame_limit > SPEED_LIMIT_STEP) {
|
||||||
|
Settings::values.frame_limit -= SPEED_LIMIT_STEP;
|
||||||
UpdateStatusBar();
|
UpdateStatusBar();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
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);
|
||||||
@ -2027,20 +2049,23 @@ void GMainWindow::UpdateStatusBar() {
|
|||||||
|
|
||||||
auto results = Core::System::GetInstance().GetAndResetPerfStats();
|
auto results = Core::System::GetInstance().GetAndResetPerfStats();
|
||||||
|
|
||||||
if (!Settings::values.unthrottled) {
|
if (Settings::values.use_frame_limit_alternate) {
|
||||||
if (Settings::values.use_frame_limit_alternate)
|
if (Settings::values.frame_limit_alternate == 0) {
|
||||||
{
|
emu_speed_label->setText(
|
||||||
|
tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0));
|
||||||
|
|
||||||
|
} else {
|
||||||
emu_speed_label->setText(tr("Speed: %1% / %2%")
|
emu_speed_label->setText(tr("Speed: %1% / %2%")
|
||||||
.arg(results.emulation_speed * 100.0, 0, 'f', 0)
|
.arg(results.emulation_speed * 100.0, 0, 'f', 0)
|
||||||
.arg(Settings::values.frame_limit_alternate));
|
.arg(Settings::values.frame_limit_alternate));
|
||||||
|
}
|
||||||
|
} else if (Settings::values.frame_limit == 0) {
|
||||||
|
emu_speed_label->setText(tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0));
|
||||||
} else {
|
} else {
|
||||||
emu_speed_label->setText(tr("Speed: %1% / %2%")
|
emu_speed_label->setText(tr("Speed: %1% / %2%")
|
||||||
.arg(results.emulation_speed * 100.0, 0, 'f', 0)
|
.arg(results.emulation_speed * 100.0, 0, 'f', 0)
|
||||||
.arg(Settings::values.frame_limit));
|
.arg(Settings::values.frame_limit));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
emu_speed_label->setText(tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0));
|
|
||||||
}
|
|
||||||
game_fps_label->setText(tr("Game: %1 FPS").arg(results.game_fps, 0, 'f', 0));
|
game_fps_label->setText(tr("Game: %1 FPS").arg(results.game_fps, 0, 'f', 0));
|
||||||
emu_frametime_label->setText(tr("Frame: %1 ms").arg(results.frametime * 1000.0, 0, 'f', 2));
|
emu_frametime_label->setText(tr("Frame: %1 ms").arg(results.frametime * 1000.0, 0, 'f', 2));
|
||||||
|
|
||||||
|
@ -133,15 +133,16 @@ void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings::values.unthrottled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto now = Clock::now();
|
auto now = Clock::now();
|
||||||
double sleep_scale = Settings::values.frame_limit / 100.0;
|
double sleep_scale = Settings::values.frame_limit / 100.0;
|
||||||
|
|
||||||
if (Settings::values.use_frame_limit_alternate) {
|
if (Settings::values.use_frame_limit_alternate) {
|
||||||
|
if (Settings::values.frame_limit_alternate == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
sleep_scale = Settings::values.frame_limit_alternate / 100.0;
|
sleep_scale = Settings::values.frame_limit_alternate / 100.0;
|
||||||
|
} else if (Settings::values.frame_limit == 0) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Max lag caused by slow frames. Shouldn't be more than the length of a frame at the current
|
// Max lag caused by slow frames. Shouldn't be more than the length of a frame at the current
|
||||||
|
@ -81,7 +81,6 @@ 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_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,6 @@ 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 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,6 @@ 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_Unthrottled",
|
|
||||||
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 New Issue
Block a user