From b2f99d72079542de421c4f2770d4e5a5b813bf7f Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 9 Jul 2025 13:36:57 +0600 Subject: [PATCH] Add CPU frame size option --- src/qt/qt_settingsmachine.cpp | 16 ++++ src/qt/qt_settingsmachine.hpp | 4 + src/qt/qt_settingsmachine.ui | 138 ++++++++++++++++++++++------------ 3 files changed, 111 insertions(+), 47 deletions(-) diff --git a/src/qt/qt_settingsmachine.cpp b/src/qt/qt_settingsmachine.cpp index fb5576f69..0063ac727 100644 --- a/src/qt/qt_settingsmachine.cpp +++ b/src/qt/qt_settingsmachine.cpp @@ -117,6 +117,9 @@ SettingsMachine::SettingsMachine(QWidget *parent) ui->comboBoxMachineType->setCurrentIndex(-1); ui->comboBoxMachineType->setCurrentIndex(selectedMachineType); + ui->radioButtonLargerFrames->setChecked(force_10ms); + ui->radioButtonSmallerFrames->setChecked(!force_10ms); + #ifndef USE_DYNAREC ui->checkBoxDynamicRecompiler->setEnabled(false); ui->checkBoxDynamicRecompiler->setVisible(false); @@ -137,6 +140,7 @@ SettingsMachine::save() fpu_type = ui->comboBoxFPU->currentData().toInt(); cpu_use_dynarec = ui->checkBoxDynamicRecompiler->isChecked() ? 1 : 0; fpu_softfloat = ui->checkBoxFPUSoftfloat->isChecked() ? 1 : 0; + force_10ms = ui->radioButtonLargerFrames->isChecked() ? 1 : 0; int64_t temp_mem_size; if (machine_get_ram_granularity(machine) < 1024) @@ -359,3 +363,15 @@ void SettingsMachine::on_checkBoxFPUSoftfloat_stateChanged(int state) { ui->softFloatWarningText->setVisible(false); } } + +void SettingsMachine::on_radioButtonSmallerFrames_clicked() +{ + ui->radioButtonLargerFrames->setChecked(false); +} + + +void SettingsMachine::on_radioButtonLargerFrames_clicked() +{ + ui->radioButtonSmallerFrames->setChecked(false); +} + diff --git a/src/qt/qt_settingsmachine.hpp b/src/qt/qt_settingsmachine.hpp index 864894447..36ece7f18 100644 --- a/src/qt/qt_settingsmachine.hpp +++ b/src/qt/qt_settingsmachine.hpp @@ -28,6 +28,10 @@ private slots: void on_comboBoxMachineType_currentIndexChanged(int index); void on_checkBoxFPUSoftfloat_stateChanged(int state); + void on_radioButtonSmallerFrames_clicked(); + + void on_radioButtonLargerFrames_clicked(); + private: Ui::SettingsMachine *ui; }; diff --git a/src/qt/qt_settingsmachine.ui b/src/qt/qt_settingsmachine.ui index e3b3cdbde..0cd15e749 100644 --- a/src/qt/qt_settingsmachine.ui +++ b/src/qt/qt_settingsmachine.ui @@ -41,7 +41,6 @@ 0 - @@ -49,7 +48,6 @@ - @@ -57,7 +55,6 @@ - @@ -65,7 +62,6 @@ - @@ -73,7 +69,6 @@ - @@ -84,7 +79,6 @@ - @@ -92,7 +86,6 @@ - @@ -100,7 +93,6 @@ - @@ -129,18 +121,16 @@ - Frequency: - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter - @@ -157,7 +147,6 @@ - @@ -165,7 +154,6 @@ - @@ -173,7 +161,6 @@ - @@ -196,7 +183,6 @@ - @@ -213,7 +199,6 @@ - @@ -268,7 +253,6 @@ - @@ -286,7 +270,6 @@ - @@ -302,7 +285,6 @@ - @@ -310,7 +292,6 @@ - @@ -321,7 +302,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -333,39 +314,102 @@ - - - - - 0 - 0 - - - - Time synchronization - - - - - - Disabled + + + + + + + 0 + 0 + + + Time synchronization + + + + + + Disabled + + + + + + + Enabled (UTC) + + + + + + + Enabled (local time) + + + + - - - - Enabled (local time) + + + + Qt::Orientation::Horizontal + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + CPU frame size + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + + + + + + Larger frames (less smooth) + + + + + + + Smaller frames (smoother) + + + + - - - - Enabled (UTC) + + + + Qt::Orientation::Vertical - + + + 20 + 40 + + + @@ -373,7 +417,7 @@ - Qt::Vertical + Qt::Orientation::Vertical