citra-qt: Add customizable speed limit target (#3353)
citra-qt: Add customizable speed limit target * Update SDL config for the new frame_limit option * Made max lag time a function of target speed percent. * Added a checkbox to enable/disable frame limiter * UI: Prevent frame_limit from under/overflowing * UI: Hide target speed percent when frame limiter is off * Disable frame limit spin box when framelimit isn't enabled
This commit is contained in:
parent
33b0b5163f
commit
b002511df0
12 changed files with 155 additions and 96 deletions
|
@ -269,6 +269,10 @@ void GMainWindow::InitializeHotkeys() {
|
|||
RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen);
|
||||
RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape),
|
||||
Qt::ApplicationShortcut);
|
||||
RegisterHotkey("Main Window", "Increase Speed Limit", QKeySequence("+"),
|
||||
Qt::ApplicationShortcut);
|
||||
RegisterHotkey("Main Window", "Decrease Speed Limit", QKeySequence("-"),
|
||||
Qt::ApplicationShortcut);
|
||||
LoadHotkeys();
|
||||
|
||||
connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this,
|
||||
|
@ -287,6 +291,21 @@ void GMainWindow::InitializeHotkeys() {
|
|||
ToggleFullscreen();
|
||||
}
|
||||
});
|
||||
constexpr u16 SPEED_LIMIT_STEP = 5;
|
||||
connect(GetHotkey("Main Window", "Increase Speed Limit", this), &QShortcut::activated, this,
|
||||
[&] {
|
||||
if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) {
|
||||
Settings::values.frame_limit += SPEED_LIMIT_STEP;
|
||||
UpdateStatusBar();
|
||||
}
|
||||
});
|
||||
connect(GetHotkey("Main Window", "Decrease Speed Limit", this), &QShortcut::activated, this,
|
||||
[&] {
|
||||
if (Settings::values.frame_limit > SPEED_LIMIT_STEP) {
|
||||
Settings::values.frame_limit -= SPEED_LIMIT_STEP;
|
||||
UpdateStatusBar();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void GMainWindow::ShowUpdaterWidgets() {
|
||||
|
@ -912,7 +931,14 @@ void GMainWindow::UpdateStatusBar() {
|
|||
|
||||
auto results = Core::System::GetInstance().GetAndResetPerfStats();
|
||||
|
||||
emu_speed_label->setText(tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0));
|
||||
if (Settings::values.use_frame_limit) {
|
||||
emu_speed_label->setText(tr("Speed: %1% / %2%")
|
||||
.arg(results.emulation_speed * 100.0, 0, 'f', 0)
|
||||
.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));
|
||||
emu_frametime_label->setText(tr("Frame: %1 ms").arg(results.frametime * 1000.0, 0, 'f', 2));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue