From cdd01eceea9fa63f779187c87b16580c86ab9156 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 24 Aug 2024 04:24:06 +0200 Subject: [PATCH] QT: Restore RichardG's hard reset workaround. --- src/include/86box/86box.h | 1 + src/qt/qt_main.cpp | 9 +++++++++ src/qt/qt_mainwindow.cpp | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index c91b8d406..7d5709d30 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -153,6 +153,7 @@ extern int enable_discord; /* (C) enable Discord integration */ extern int other_ide_present; /* IDE controllers from non-IDE cards are present */ extern int other_scsi_present; /* SCSI controllers from non-SCSI cards are present */ +extern int hard_reset_pending; extern int fixed_size_x; extern int fixed_size_y; extern int do_auto_pause; /* (C) Auto-pause the emulator on focus loss */ diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index c39007864..a50c53820 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -138,8 +138,17 @@ main_thread_fn() } } else { /* Just so we dont overload the host OS. */ + + /* Trigger a hard reset if one is pending. */ + if (hard_reset_pending) { + hard_reset_pending = 0; + pc_reset_hard_close(); + pc_reset_hard_init(); + } + if (dopause) ack_pause(); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); } } diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 32720c48b..57efc7ce7 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -946,10 +946,9 @@ MainWindow::on_actionSettings_triggered() default: break; case QDialog::Accepted: - pc_reset_hard_close(); settings.save(); config_changed = 2; - pc_reset_hard_init(); + pc_reset_hard(); break; case QDialog::Rejected: break;