From db6e74a3b9a94083fd47cada3b8a3325ad48dd06 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Mar 2025 01:47:34 +0100 Subject: [PATCH 01/10] NEAT/NEATsx: Fix the EMS enabled condition in the RAM remapping function, fixes 386 enhanced mode operations on the OKI IF386AX. --- src/chipset/neat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chipset/neat.c b/src/chipset/neat.c index f6a7fafb2..ffc25d6d9 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -686,9 +686,10 @@ remap_update(neat_t *dev, uint8_t val) mem_mapping_set_addr(&ram_low_mapping, 0x00000000, dev->remap_base << 10); if (dev->remap_base > 1024) { - mem_mapping_set_addr(&ram_high_mapping, 0x00100000, (dev->remap_base << 10) - 0x00100000); - mem_mapping_set_exec(&ram_high_mapping, &(ram[(val & RB7_EMSEN) ? 0x00100000 : - (0x00100000 + (dev->ems_size << 10))])); + uint32_t base = (val & RB7_EMSEN) ? (0x00100000 + (dev->ems_size << 10)) : 0x00100000; + + mem_mapping_set_addr(&ram_high_mapping, base, (dev->remap_base << 10) - 0x00100000); + mem_mapping_set_exec(&ram_high_mapping, &(ram[base])); } else mem_mapping_disable(&ram_high_mapping); From 3f6593f314f47607771395064e23b8bd3f4c3ed5 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Mar 2025 02:02:00 +0100 Subject: [PATCH 02/10] IF386AX: Set video card to fixed and make the power off function actually power off. --- src/machine/m_at_286_386sx.c | 4 ++-- src/machine/machine_table.c | 2 +- src/video/vid_jega.c | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index 136922a5c..033233955 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -658,8 +658,8 @@ machine_at_if386sx_init(const machine_t *model) device_add(&neat_sx_device); - if (gfxcard[0] == VID_INTERNAL) - device_add(&if386jega_device); + device_add(&if386jega_device); + if (fdc_current[0] == FDC_INTERNAL) device_add(&fdc_at_device); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index f3d39833e..9f2d0ce47 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -4768,7 +4768,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_VIDEO, + .flags = MACHINE_VIDEO_FIXED, .ram = { .min = 1024, .max = 4096, diff --git a/src/video/vid_jega.c b/src/video/vid_jega.c index 4d411c39c..4730b5142 100644 --- a/src/video/vid_jega.c +++ b/src/video/vid_jega.c @@ -28,6 +28,7 @@ #include <86box/timer.h> #include <86box/pic.h> #include <86box/pit.h> +#include <86box/plat.h> #include <86box/mem.h> #include <86box/rom.h> #include <86box/device.h> @@ -800,9 +801,11 @@ if386_p6x_write(uint16_t port, uint8_t val, void *priv) } jega_recalctimings(jega); } else if (p65idx == 0x05) { - if (val & 0x10) { /* Power off (instead this call hardware reset here) */ - resetx86(); - } + if (val & 0x10) + /* Power off (instead this call hardware reset here) */ + // resetx86(); + /* Actually, power off - we have a function for that! */ + plat_power_off(); } } return; From 260f91313a574a0d1f1254cb6252b4d6d3c76daf Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Mar 2025 02:08:35 +0100 Subject: [PATCH 03/10] JEGA: Bring back the reset for time being, the BIOS needs it to reboot. --- src/video/vid_jega.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/vid_jega.c b/src/video/vid_jega.c index 4730b5142..36cf04077 100644 --- a/src/video/vid_jega.c +++ b/src/video/vid_jega.c @@ -803,9 +803,9 @@ if386_p6x_write(uint16_t port, uint8_t val, void *priv) } else if (p65idx == 0x05) { if (val & 0x10) /* Power off (instead this call hardware reset here) */ - // resetx86(); + resetx86(); /* Actually, power off - we have a function for that! */ - plat_power_off(); + // plat_power_off(); } } return; From e71c30ce8457fae5dd3910780e64cca56d8225b6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Mar 2025 04:03:21 +0100 Subject: [PATCH 04/10] MMU: Fix behavior of 64-bit memory reads (used by FPU and MMX), should no longer waste host cycles on extra unnecessary MMU translations and should also no longer MMU translate already translated addresses which was causing unpredictable results. --- src/mem/mem.c | 24 +++++++++++++++++++++--- src/mem/mmu_2386.c | 44 +++++++++++++++++++++++++++++++------------- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/src/mem/mem.c b/src/mem/mem.c index 94c4ab788..074b44bda 100644 --- a/src/mem/mem.c +++ b/src/mem/mem.c @@ -1533,10 +1533,28 @@ readmemql(uint32_t addr) addr = addr64a[0] & rammask; map = read_mapping[addr >> MEM_GRANULARITY_BITS]; - if (map && map->read_l) - return map->read_l(addr, map->priv) | ((uint64_t) map->read_l(addr + 4, map->priv) << 32); - return readmemll(addr) | ((uint64_t) readmemll(addr + 4) << 32); + if (map && map->read_l) + return map->read_l(addr, map->priv) | + ((uint64_t) map->read_l(addr + 4, map->priv) << 32); + + if (map && map->read_w) + return map->read_w(addr, map->priv) | + ((uint64_t) map->read_w(addr + 2, map->priv) << 16) | + ((uint64_t) map->read_w(addr + 4, map->priv) << 32) | + ((uint64_t) map->read_w(addr + 6, map->priv) << 48); + + if (map && map->read_b) + return map->read_b(addr, map->priv) | + ((uint64_t) map->read_b(addr + 1, map->priv) << 8) | + ((uint64_t) map->read_b(addr + 2, map->priv) << 16) | + ((uint64_t) map->read_b(addr + 3, map->priv) << 24) | + ((uint64_t) map->read_b(addr + 4, map->priv) << 32) | + ((uint64_t) map->read_b(addr + 5, map->priv) << 40) | + ((uint64_t) map->read_b(addr + 6, map->priv) << 48) | + ((uint64_t) map->read_b(addr + 7, map->priv) << 56); + + return 0xffffffffffffffffULL; } void diff --git a/src/mem/mmu_2386.c b/src/mem/mmu_2386.c index 7418a88d8..1a2782237 100644 --- a/src/mem/mmu_2386.c +++ b/src/mem/mmu_2386.c @@ -102,8 +102,8 @@ mem_readw_map(uint32_t addr) if (((addr & MEM_GRANULARITY_MASK) <= MEM_GRANULARITY_HBOUND) && (map && map->read_w)) ret = map->read_w(addr, map->priv); else { - ret = mem_readb_phys(addr + 1) << 8; - ret |= mem_readb_phys(addr); + ret = mem_readb_map(addr); + ret |= ((uint16_t) mem_readb_map(addr + 1)) << 8; } return ret; @@ -120,8 +120,8 @@ mem_readl_map(uint32_t addr) if (!cpu_16bitbus && ((addr & MEM_GRANULARITY_MASK) <= MEM_GRANULARITY_QBOUND) && (map && map->read_l)) ret = map->read_l(addr, map->priv); else { - ret = mem_readw_phys(addr + 2) << 16; - ret |= mem_readw_phys(addr); + ret = mem_readw_map(addr); + ret |= ((uint32_t) mem_readw_map(addr + 2)) << 16; } return ret; @@ -148,8 +148,8 @@ mem_writew_map(uint32_t addr, uint16_t val) if (((addr & MEM_GRANULARITY_MASK) <= MEM_GRANULARITY_HBOUND) && (map && map->write_w)) map->write_w(addr, val, map->priv); else { - mem_writeb_phys(addr, val & 0xff); - mem_writeb_phys(addr + 1, val >> 8); + mem_writeb_map(addr, val & 0xff); + mem_writeb_map(addr + 1, val >> 8); } } @@ -161,10 +161,10 @@ mem_writel_map(uint32_t addr, uint32_t val) mem_logical_addr = 0xffffffff; if (!cpu_16bitbus && ((addr & MEM_GRANULARITY_MASK) <= MEM_GRANULARITY_QBOUND) && (map && map->write_l)) - map->write_l(addr, val, map->priv); + map->write_l(addr, val, map->priv); else { - mem_writew_phys(addr, val & 0xffff); - mem_writew_phys(addr + 2, val >> 16); + mem_writew_map(addr, val & 0xffff); + mem_writew_map(addr + 2, val >> 16); } } @@ -649,7 +649,7 @@ readmemll_2386(uint32_t addr) /* No need to waste precious CPU host cycles on mmutranslate's that were already done, just pass their result as a parameter to be used if needed. */ return readmemwl_no_mmut_2386(addr, addr64a) | - (((uint32_t) readmemwl_no_mmut(addr + 2, &(addr64a[2]))) << 16); + (((uint32_t) readmemwl_no_mmut_2386(addr + 2, &(addr64a[2]))) << 16); } } @@ -925,10 +925,28 @@ readmemql_2386(uint32_t addr) addr = addr64a[0] & rammask; map = read_mapping[addr >> MEM_GRANULARITY_BITS]; - if (map && map->read_l) - return map->read_l(addr, map->priv) | ((uint64_t) map->read_l(addr + 4, map->priv) << 32); - return readmemll(addr) | ((uint64_t) readmemll(addr + 4) << 32); + if (map && map->read_l) + return map->read_l(addr, map->priv) | + ((uint64_t) map->read_l(addr + 4, map->priv) << 32); + + if (map && map->read_w) + return map->read_w(addr, map->priv) | + ((uint64_t) map->read_w(addr + 2, map->priv) << 16) | + ((uint64_t) map->read_w(addr + 4, map->priv) << 32) | + ((uint64_t) map->read_w(addr + 6, map->priv) << 48); + + if (map && map->read_b) + return map->read_b(addr, map->priv) | + ((uint64_t) map->read_b(addr + 1, map->priv) << 8) | + ((uint64_t) map->read_b(addr + 2, map->priv) << 16) | + ((uint64_t) map->read_b(addr + 3, map->priv) << 24) | + ((uint64_t) map->read_b(addr + 4, map->priv) << 32) | + ((uint64_t) map->read_b(addr + 5, map->priv) << 40) | + ((uint64_t) map->read_b(addr + 6, map->priv) << 48) | + ((uint64_t) map->read_b(addr + 7, map->priv) << 56); + + return 0xffffffffffffffffULL; } void From 8da843bb0acc529bb3791aa41fcde385f5e21ae6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Mar 2025 06:29:11 +0100 Subject: [PATCH 05/10] DMA: Fix a long-standing nasty bug in bus master transfers that was potentially causing memory corruption. --- src/dma.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dma.c b/src/dma.c index 4edeb39f8..a730f1a1c 100644 --- a/src/dma.c +++ b/src/dma.c @@ -1877,15 +1877,15 @@ dma_bm_read(uint32_t PhysAddress, uint8_t *DataRead, uint32_t TotalSize, int Tra n2 = TotalSize - n; /* Do the divisible block, if there is one. */ - if (n) { - for (uint32_t i = 0; i < n; i += TransferSize) + if (n2) { + for (uint32_t i = 0; i < n2; i += TransferSize) mem_read_phys((void *) &(DataRead[i]), PhysAddress + i, TransferSize); } /* Do the non-divisible block, if there is one. */ - if (n2) { - mem_read_phys((void *) bytes, PhysAddress + n, TransferSize); - memcpy((void *) &(DataRead[n]), bytes, n2); + if (n) { + mem_read_phys((void *) bytes, PhysAddress + n2, TransferSize); + memcpy((void *) &(DataRead[n2]), bytes, n); } } @@ -1900,16 +1900,16 @@ dma_bm_write(uint32_t PhysAddress, const uint8_t *DataWrite, uint32_t TotalSize, n2 = TotalSize - n; /* Do the divisible block, if there is one. */ - if (n) { - for (uint32_t i = 0; i < n; i += TransferSize) + if (n2) { + for (uint32_t i = 0; i < n2; i += TransferSize) mem_write_phys((void *) &(DataWrite[i]), PhysAddress + i, TransferSize); } /* Do the non-divisible block, if there is one. */ - if (n2) { - mem_read_phys((void *) bytes, PhysAddress + n, TransferSize); - memcpy(bytes, (void *) &(DataWrite[n]), n2); - mem_write_phys((void *) bytes, PhysAddress + n, TransferSize); + if (n) { + mem_read_phys((void *) bytes, PhysAddress + n2, TransferSize); + memcpy(bytes, (void *) &(DataWrite[n2]), n); + mem_write_phys((void *) bytes, PhysAddress + n2, TransferSize); } if (dma_at) From d7529d4f5eb2ae4c8cbdbb1280ed2e4942b43da7 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Mar 2025 06:32:12 +0100 Subject: [PATCH 06/10] Reverted the fix because it turned out I had actually misread the code. --- src/dma.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dma.c b/src/dma.c index a730f1a1c..4edeb39f8 100644 --- a/src/dma.c +++ b/src/dma.c @@ -1877,15 +1877,15 @@ dma_bm_read(uint32_t PhysAddress, uint8_t *DataRead, uint32_t TotalSize, int Tra n2 = TotalSize - n; /* Do the divisible block, if there is one. */ - if (n2) { - for (uint32_t i = 0; i < n2; i += TransferSize) + if (n) { + for (uint32_t i = 0; i < n; i += TransferSize) mem_read_phys((void *) &(DataRead[i]), PhysAddress + i, TransferSize); } /* Do the non-divisible block, if there is one. */ - if (n) { - mem_read_phys((void *) bytes, PhysAddress + n2, TransferSize); - memcpy((void *) &(DataRead[n2]), bytes, n); + if (n2) { + mem_read_phys((void *) bytes, PhysAddress + n, TransferSize); + memcpy((void *) &(DataRead[n]), bytes, n2); } } @@ -1900,16 +1900,16 @@ dma_bm_write(uint32_t PhysAddress, const uint8_t *DataWrite, uint32_t TotalSize, n2 = TotalSize - n; /* Do the divisible block, if there is one. */ - if (n2) { - for (uint32_t i = 0; i < n2; i += TransferSize) + if (n) { + for (uint32_t i = 0; i < n; i += TransferSize) mem_write_phys((void *) &(DataWrite[i]), PhysAddress + i, TransferSize); } /* Do the non-divisible block, if there is one. */ - if (n) { - mem_read_phys((void *) bytes, PhysAddress + n2, TransferSize); - memcpy(bytes, (void *) &(DataWrite[n2]), n); - mem_write_phys((void *) bytes, PhysAddress + n2, TransferSize); + if (n2) { + mem_read_phys((void *) bytes, PhysAddress + n, TransferSize); + memcpy(bytes, (void *) &(DataWrite[n]), n2); + mem_write_phys((void *) bytes, PhysAddress + n, TransferSize); } if (dma_at) From 556aca0b4edbc24412b3a6ae0cca5243f4673389 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Mar 2025 07:13:50 +0100 Subject: [PATCH 07/10] NEAT/NEATsx: Fix the base of extended memory when EMS is enabled. --- src/chipset/neat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/chipset/neat.c b/src/chipset/neat.c index ffc25d6d9..1146ecbff 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -688,7 +688,7 @@ remap_update(neat_t *dev, uint8_t val) if (dev->remap_base > 1024) { uint32_t base = (val & RB7_EMSEN) ? (0x00100000 + (dev->ems_size << 10)) : 0x00100000; - mem_mapping_set_addr(&ram_high_mapping, base, (dev->remap_base << 10) - 0x00100000); + mem_mapping_set_addr(&ram_high_mapping, 0x00100000, (dev->remap_base << 10) - 0x00100000); mem_mapping_set_exec(&ram_high_mapping, &(ram[base])); } else mem_mapping_disable(&ram_high_mapping); @@ -942,6 +942,13 @@ neat_write(uint16_t port, uint8_t val, void *priv) break; } + if (mem_size < 1024) + /* No RAM left for EMS at all. */ + dev->ems_size = 0; + else if (mem_size < (dev->ems_size + 1024)) + /* Limit EMS size to the entirety of the remaining extended memory. */ + dev->ems_size = mem_size - 1024; + if (dev->regs[REG_RB7] & RB7_EMSEN) { remap_update(dev, dev->regs[REG_RB7]); From ce820df1d1df691780bd13e745322a127a670865 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 26 Mar 2025 02:08:12 +0600 Subject: [PATCH 08/10] Always make sure emulator is not off-screen when resizing --- src/qt/qt_mainwindow.cpp | 24 ++++++++++++++++++++++++ src/qt/qt_mainwindow.hpp | 1 + src/qt/qt_rendererstack.hpp | 23 +++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index ccaf6964f..b3d0d9fa9 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -798,6 +798,30 @@ MainWindow::closeEvent(QCloseEvent *event) event->accept(); } +void +MainWindow::resizeEvent(QResizeEvent *event) +{ + //qDebug() << pos().x() + event->size().width(); + //qDebug() << pos().y() + event->size().height(); + if (vid_resize == 1) + return; + + int newX = pos().x(); + int newY = pos().y(); + + if (((frameGeometry().x() + event->size().width() + 1) > util::screenOfWidget(this)->availableGeometry().right())) { + //move(util::screenOfWidget(this)->availableGeometry().right() - size().width() - 1, pos().y()); + newX = util::screenOfWidget(this)->availableGeometry().right() - frameGeometry().width() - 1; + if (newX < 1) newX = 1; + } + + if (((frameGeometry().y() + event->size().height() + 1) > util::screenOfWidget(this)->availableGeometry().bottom())) { + newY = util::screenOfWidget(this)->availableGeometry().bottom() - frameGeometry().height() - 1; + if (newY < 1) newY = 1; + } + move(newX, newY); +} + void MainWindow::initRendererMonitorSlot(int monitor_index) { diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 479ed38a4..f1c6cadf6 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -137,6 +137,7 @@ protected: void showEvent(QShowEvent *event) override; void closeEvent(QCloseEvent *event) override; void changeEvent(QEvent *event) override; + void resizeEvent(QResizeEvent *event) override; private slots: void on_actionPen_triggered(); diff --git a/src/qt/qt_rendererstack.hpp b/src/qt/qt_rendererstack.hpp index 54ea49bb9..172dc2fe6 100644 --- a/src/qt/qt_rendererstack.hpp +++ b/src/qt/qt_rendererstack.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -14,6 +15,7 @@ #include #include "qt_renderercommon.hpp" +#include "qt_util.hpp" #include @@ -21,6 +23,11 @@ namespace Ui { class RendererStack; } +extern "C" +{ + extern int vid_resize; +} + class RendererCommon; class RendererStack : public QStackedWidget { Q_OBJECT @@ -43,6 +50,22 @@ public: void changeEvent(QEvent *event) override; void resizeEvent(QResizeEvent *event) override { + if (this->m_monitor_index != 0 && vid_resize != 1) { + int newX = pos().x(); + int newY = pos().y(); + + if (((frameGeometry().x() + event->size().width() + 1) > util::screenOfWidget(this)->availableGeometry().right())) { + //move(util::screenOfWidget(this)->availableGeometry().right() - size().width() - 1, pos().y()); + newX = util::screenOfWidget(this)->availableGeometry().right() - frameGeometry().width() - 1; + if (newX < 1) newX = 1; + } + + if (((frameGeometry().y() + event->size().height() + 1) > util::screenOfWidget(this)->availableGeometry().bottom())) { + newY = util::screenOfWidget(this)->availableGeometry().bottom() - frameGeometry().height() - 1; + if (newY < 1) newY = 1; + } + move(newX, newY); + } onResize(event->size().width(), event->size().height()); } void keyPressEvent(QKeyEvent *event) override From e5aed7f9e6e13302203e2ac88fd5ff5234392c88 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 26 Mar 2025 16:37:59 +0600 Subject: [PATCH 09/10] Add confirmation dialog checkboxes in Preferences --- src/qt/qt_progsettings.cpp | 4 + src/qt/qt_progsettings.ui | 194 ++++++++++++++++++++----------------- 2 files changed, 108 insertions(+), 90 deletions(-) diff --git a/src/qt/qt_progsettings.cpp b/src/qt/qt_progsettings.cpp index 6ec76a290..059005ca4 100644 --- a/src/qt/qt_progsettings.cpp +++ b/src/qt/qt_progsettings.cpp @@ -116,6 +116,8 @@ ProgSettings::ProgSettings(QWidget *parent) ui->horizontalSlider->setValue(mouseSensitivity * 100.); ui->openDirUsrPath->setChecked(open_dir_usr_path > 0); ui->checkBoxMultimediaKeys->setChecked(inhibit_multimedia_keys); + ui->checkBoxConfirmExit->setChecked(confirm_exit); + ui->checkBoxConfirmSave->setChecked(confirm_save); #ifndef Q_OS_WINDOWS ui->checkBoxMultimediaKeys->setHidden(true); #endif @@ -127,6 +129,8 @@ ProgSettings::accept() strcpy(icon_set, ui->comboBox->currentData().toString().toUtf8().data()); lang_id = ui->comboBoxLanguage->currentData().toUInt(); open_dir_usr_path = ui->openDirUsrPath->isChecked() ? 1 : 0; + confirm_exit = ui->checkBoxConfirmExit->isChecked() ? 1 : 0; + confirm_save = ui->checkBoxConfirmSave->isChecked() ? 1 : 0; inhibit_multimedia_keys = ui->checkBoxMultimediaKeys->isChecked(); loadTranslators(QCoreApplication::instance()); diff --git a/src/qt/qt_progsettings.ui b/src/qt/qt_progsettings.ui index dc5674425..2dbaa739d 100644 --- a/src/qt/qt_progsettings.ui +++ b/src/qt/qt_progsettings.ui @@ -29,56 +29,25 @@ QLayout::SizeConstraint::SetFixedSize - - - - <html><head/><body><p>When selecting media images (CD-ROM, floppy, etc.) the open dialog will start in the same directory as the 86Box configuration file. This setting will likely only make a difference on macOS.</p></body></html> + + + + Qt::Orientation::Horizontal + + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok + + + + + - Select media images from program working directory + Default - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - 30 - - - - (System Default) - - - - - - + + Default @@ -97,13 +66,20 @@ - - - - Qt::Orientation::Horizontal + + + + Default - - QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok + + + + + + <html><head/><body><p>When selecting media images (CD-ROM, floppy, etc.) the open dialog will start in the same directory as the 86Box configuration file. This setting will likely only make a difference on macOS.</p></body></html> + + + Select media images from program working directory @@ -121,6 +97,80 @@ + + + + Ask for confirmation before saving settings + + + + + + + 30 + + + + (System Default) + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + Inhibit multimedia keys on Windows + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + false + + + 30 + + + + (Default) + + + + + + + + Mouse sensitivity: + + + @@ -143,46 +193,10 @@ - - - - false - - - 30 - - - - (Default) - - - - - - + + - Mouse sensitivity: - - - - - - - Default - - - - - - - Default - - - - - - - Inhibit multimedia keys on Windows + Ask for confirmation before quitting From 38de9b7a1b52a04f300b285bf0a7530d30a67d7d Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 26 Mar 2025 16:52:35 +0600 Subject: [PATCH 10/10] Add the other two confirmation dialog checkboxes in Preferences --- src/qt/qt_progsettings.cpp | 5 + src/qt/qt_progsettings.ui | 204 ++++++++++++++++++++----------------- 2 files changed, 114 insertions(+), 95 deletions(-) diff --git a/src/qt/qt_progsettings.cpp b/src/qt/qt_progsettings.cpp index 059005ca4..ce6c21dd6 100644 --- a/src/qt/qt_progsettings.cpp +++ b/src/qt/qt_progsettings.cpp @@ -118,6 +118,9 @@ ProgSettings::ProgSettings(QWidget *parent) ui->checkBoxMultimediaKeys->setChecked(inhibit_multimedia_keys); ui->checkBoxConfirmExit->setChecked(confirm_exit); ui->checkBoxConfirmSave->setChecked(confirm_save); + ui->checkBoxConfirmHardReset->setChecked(confirm_reset); + ui->checkBoxFullscreenFirst->setChecked(video_fullscreen_first); + #ifndef Q_OS_WINDOWS ui->checkBoxMultimediaKeys->setHidden(true); #endif @@ -131,6 +134,8 @@ ProgSettings::accept() open_dir_usr_path = ui->openDirUsrPath->isChecked() ? 1 : 0; confirm_exit = ui->checkBoxConfirmExit->isChecked() ? 1 : 0; confirm_save = ui->checkBoxConfirmSave->isChecked() ? 1 : 0; + confirm_reset = ui->checkBoxConfirmHardReset->isChecked() ? 1 : 0; + video_fullscreen_first = ui->checkBoxFullscreenFirst->isChecked() ? 1 : 0; inhibit_multimedia_keys = ui->checkBoxMultimediaKeys->isChecked(); loadTranslators(QCoreApplication::instance()); diff --git a/src/qt/qt_progsettings.ui b/src/qt/qt_progsettings.ui index 2dbaa739d..f7b32ce84 100644 --- a/src/qt/qt_progsettings.ui +++ b/src/qt/qt_progsettings.ui @@ -7,7 +7,7 @@ 0 0 458 - 374 + 391 @@ -29,43 +29,6 @@ QLayout::SizeConstraint::SetFixedSize - - - - Qt::Orientation::Horizontal - - - QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok - - - - - - - Default - - - - - - - Default - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - @@ -73,16 +36,6 @@ - - - - <html><head/><body><p>When selecting media images (CD-ROM, floppy, etc.) the open dialog will start in the same directory as the 86Box configuration file. This setting will likely only make a difference on macOS.</p></body></html> - - - Select media images from program working directory - - - @@ -90,32 +43,6 @@ - - - - Language: - - - - - - - Ask for confirmation before saving settings - - - - - - - 30 - - - - (System Default) - - - - @@ -129,10 +56,32 @@ - - + + + + 30 + + + + (System Default) + + + + + + + + <html><head/><body><p>When selecting media images (CD-ROM, floppy, etc.) the open dialog will start in the same directory as the 86Box configuration file. This setting will likely only make a difference on macOS.</p></body></html> + - Inhibit multimedia keys on Windows + Select media images from program working directory + + + + + + + Default @@ -149,25 +98,10 @@ - - - - false - - - 30 - - - - (Default) - - - - - - + + - Mouse sensitivity: + Default @@ -193,6 +127,79 @@ + + + + Language: + + + + + + + Ask for confirmation before saving settings + + + + + + + Qt::Orientation::Horizontal + + + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok + + + + + + + Inhibit multimedia keys on Windows + + + + + + + false + + + 30 + + + + (Default) + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + Mouse sensitivity: + + + + + + + Ask for confirmation before hard resetting + + + @@ -200,6 +207,13 @@ + + + + Display hotkey message when entering full-screen mode + + +