Add fast forward option

This commit is contained in:
Cacodemon345
2026-01-08 18:46:23 +06:00
parent 06c3186858
commit 75cfe2bc7d
10 changed files with 48 additions and 9 deletions

View File

@@ -3002,3 +3002,6 @@ msgstr ""
msgid "&Allow recompilation"
msgstr ""
msgid "&Fast forward"
msgstr ""

View File

@@ -100,6 +100,7 @@ extern int qt_nvr_save(void);
extern void exit_pause(void);
bool cpu_thread_running = false;
bool fast_forward = false;
}
#include <locale.h>
@@ -452,7 +453,7 @@ main_thread_fn()
#endif
drawits += static_cast<int>(new_time - old_time);
old_time = new_time;
if (drawits > 0 && !dopause) {
if ((drawits > 0 || fast_forward) && !dopause) {
/* Yes, so run frames now. */
do {
#ifdef USE_INSTRUMENT
@@ -478,8 +479,9 @@ main_thread_fn()
}
drawits -= force_10ms ? 10 : 1;
if (drawits > 50)
if (drawits > 50 || fast_forward)
drawits = 0;
} while (drawits > 0);
} else {
/* Just so we dont overload the host OS. */

View File

@@ -65,6 +65,7 @@ extern int qt_nvr_save(void);
#endif
extern bool cpu_thread_running;
extern bool fast_forward;
};
#include <QGuiApplication>
@@ -2135,6 +2136,12 @@ MainWindow::on_actionUpdate_mouse_every_CPU_frame_triggered()
config_save();
}
void
MainWindow::on_action_Fast_forward_triggered()
{
fast_forward ^= 1;
}
void
MainWindow::on_actionRemember_size_and_position_triggered()
{

View File

@@ -141,6 +141,7 @@ private slots:
void on_actionPreferences_triggered();
void on_actionEnable_Discord_integration_triggered(bool checked);
void on_actionRenderer_options_triggered();
void on_action_Fast_forward_triggered();
void refreshMediaMenu();
void showMessage_(int flags, const QString &header, const QString &message, bool richText, std::atomic_bool *done = nullptr);

View File

@@ -78,6 +78,8 @@
<addaction name="actionAuto_pause"/>
<addaction name="actionPause"/>
<addaction name="separator"/>
<addaction name="action_Fast_forward"/>
<addaction name="separator"/>
<addaction name="actionForce_interpretation"/>
<addaction name="separator"/>
<addaction name="actionHard_Reset"/>
@@ -311,6 +313,8 @@
<addaction name="separator"/>
<addaction name="actionTake_screenshot"/>
<addaction name="actionCopy_screenshot"/>
<addaction name="separator"/>
<addaction name="action_Fast_forward"/>
</widget>
<action name="actionForce_interpretation">
<property name="icon">
@@ -1069,6 +1073,18 @@
<string>&amp;8x</string>
</property>
</action>
<action name="action_Fast_forward">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../qt_resources.qrc">
<normaloff>:/settings/qt/icons/fast_forward.ico</normaloff>:/settings/qt/icons/fast_forward.ico</iconset>
</property>
<property name="text">
<string>&amp;Fast forward</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>