|
|
@ -237,6 +237,10 @@ void GMainWindow::InitializeHotkeys() {
|
|
|
|
Qt::ApplicationShortcut);
|
|
|
|
Qt::ApplicationShortcut);
|
|
|
|
hotkey_registry.RegisterHotkey("Main Window", "Toggle Speed Limit", QKeySequence("CTRL+Z"),
|
|
|
|
hotkey_registry.RegisterHotkey("Main Window", "Toggle Speed Limit", QKeySequence("CTRL+Z"),
|
|
|
|
Qt::ApplicationShortcut);
|
|
|
|
Qt::ApplicationShortcut);
|
|
|
|
|
|
|
|
hotkey_registry.RegisterHotkey("Main Window", "Increase Speed Limit", QKeySequence("+"),
|
|
|
|
|
|
|
|
Qt::ApplicationShortcut);
|
|
|
|
|
|
|
|
hotkey_registry.RegisterHotkey("Main Window", "Decrease Speed Limit", QKeySequence("-"),
|
|
|
|
|
|
|
|
Qt::ApplicationShortcut);
|
|
|
|
hotkey_registry.LoadHotkeys();
|
|
|
|
hotkey_registry.LoadHotkeys();
|
|
|
|
|
|
|
|
|
|
|
|
connect(hotkey_registry.GetHotkey("Main Window", "Load File", this), &QShortcut::activated,
|
|
|
|
connect(hotkey_registry.GetHotkey("Main Window", "Load File", this), &QShortcut::activated,
|
|
|
@ -272,9 +276,24 @@ void GMainWindow::InitializeHotkeys() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
connect(hotkey_registry.GetHotkey("Main Window", "Toggle Speed Limit", this),
|
|
|
|
connect(hotkey_registry.GetHotkey("Main Window", "Toggle Speed Limit", this),
|
|
|
|
&QShortcut::activated, this, [&] {
|
|
|
|
&QShortcut::activated, this, [&] {
|
|
|
|
Settings::values.toggle_framelimit = !Settings::values.toggle_framelimit;
|
|
|
|
Settings::values.use_frame_limit = !Settings::values.use_frame_limit;
|
|
|
|
UpdateStatusBar();
|
|
|
|
UpdateStatusBar();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
constexpr u16 SPEED_LIMIT_STEP = 5;
|
|
|
|
|
|
|
|
connect(hotkey_registry.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(hotkey_registry.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::SetDefaultUIGeometry() {
|
|
|
|
void GMainWindow::SetDefaultUIGeometry() {
|
|
|
@ -934,7 +953,13 @@ void GMainWindow::UpdateStatusBar() {
|
|
|
|
|
|
|
|
|
|
|
|
auto results = Core::System::GetInstance().GetAndResetPerfStats();
|
|
|
|
auto results = Core::System::GetInstance().GetAndResetPerfStats();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
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));
|
|
|
|
|
|
|
|
|
|
|
|