From cc4fa2418992698c815447b866ed2877210f59b2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 22 Dec 2022 06:17:07 +0100 Subject: [PATCH 01/11] Minor SiS 50x initialization/reset fixes. --- src/chipset/sis_85c50x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chipset/sis_85c50x.c b/src/chipset/sis_85c50x.c index 1aa5daead..24fdd7788 100644 --- a/src/chipset/sis_85c50x.c +++ b/src/chipset/sis_85c50x.c @@ -359,10 +359,10 @@ sis_85c50x_reset(void *priv) dev->pci_conf_sb[0x09] = 0x00; dev->pci_conf_sb[0x0a] = 0x01; dev->pci_conf_sb[0x0b] = 0x06; - sis_85c50x_write(0, 0x41, 0x80, dev); - sis_85c50x_write(0, 0x42, 0x80, dev); - sis_85c50x_write(0, 0x43, 0x80, dev); - sis_85c50x_write(0, 0x44, 0x80, dev); + sis_85c50x_sb_write(0, 0x41, 0x80, dev); + sis_85c50x_sb_write(0, 0x42, 0x80, dev); + sis_85c50x_sb_write(0, 0x43, 0x80, dev); + sis_85c50x_sb_write(0, 0x44, 0x80, dev); } static void From e4ff9d87a58d0169612af7872d0a8d2f319aa877 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 22 Dec 2022 06:33:15 +0100 Subject: [PATCH 02/11] Win32 UI builds now correctly build with RTMIDI enabled. --- src/win/Makefile.mingw | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 869ccefd4..b20dd86db 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -765,6 +765,11 @@ else SNDOBJ += xaudio2.o endif +ifeq ($(RTMIDI), y) + SNDOBJ += midi_rtmidi.o + OPTS += -DUSE_RTMIDI +endif + OBJ := $(MAINOBJ) $(CPUOBJ) $(CHIPSETOBJ) $(MCHOBJ) $(DEVOBJ) $(MEMOBJ) \ $(FDDOBJ) $(GAMEOBJ) $(CDROMOBJ) $(ZIPOBJ) $(MOOBJ) $(HDDOBJ) $(MINIVHDOBJ) \ $(NETOBJ) $(PRINTOBJ) $(SCSIOBJ) $(SIOOBJ) $(SNDOBJ) $(VIDOBJ) $(VOODOOOBJ) \ @@ -784,9 +789,7 @@ else endif ifeq ($(RTMIDI), y) - SNDOBJ += midi_rtmidi.o - OPTS += -DUSE_RTMIDI - LIBS += -lrtmidi + LIBS += -lrtmidi -lwinmm endif ifeq ($(VNC), y) From fc74cd9656ce40654fdcdb176eacedf5ad7c9331 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 22 Dec 2022 06:46:52 +0100 Subject: [PATCH 03/11] And another fix for Win32 UI + RTMIDI. --- src/win/Makefile.mingw | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index b20dd86db..040b14aee 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -511,6 +511,10 @@ ifeq ($(DEV_BRANCH), y) endif endif +ifeq ($(RTMIDI), y) + OPTS += -DUSE_RTMIDI +endif + # Final versions of the toolchain flags. CFLAGS := $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ @@ -767,7 +771,6 @@ endif ifeq ($(RTMIDI), y) SNDOBJ += midi_rtmidi.o - OPTS += -DUSE_RTMIDI endif OBJ := $(MAINOBJ) $(CPUOBJ) $(CHIPSETOBJ) $(MCHOBJ) $(DEVOBJ) $(MEMOBJ) \ From 522b06bd0885ee13143684daf2f30ad5f7e0f090 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 22 Dec 2022 13:21:28 +0600 Subject: [PATCH 04/11] qt_mcadevicelist: device IDs are always 4 hex digits long --- src/qt/qt_mcadevicelist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/qt_mcadevicelist.cpp b/src/qt/qt_mcadevicelist.cpp index 95ae17f45..b8c3ed3c9 100644 --- a/src/qt/qt_mcadevicelist.cpp +++ b/src/qt/qt_mcadevicelist.cpp @@ -22,7 +22,7 @@ MCADeviceList::MCADeviceList(QWidget *parent) for (int i = 0; i < mca_get_nr_cards(); i++) { uint32_t deviceId = (mca_read_index(0x00, i) | (mca_read_index(0x01, i) << 8)); if (deviceId != 0xFFFF) { - QString hexRepresentation = QString::number(deviceId, 16).toUpper(); + QString hexRepresentation = QString::asprintf("%04X", deviceId); ui->listWidget->addItem(QString("Slot %1: 0x%2 (@%3.ADF)").arg(i + 1).arg(hexRepresentation, hexRepresentation)); } } From a2dcf9e12fd93473c7cc5621daada0d82183f2c8 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 23 Dec 2022 20:49:13 +0600 Subject: [PATCH 05/11] qt_settingsdisplay: Changes are not lost on machine switch anymore --- src/qt/qt_settingsdisplay.cpp | 16 ++++++++++------ src/qt/qt_settingsdisplay.hpp | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/qt/qt_settingsdisplay.cpp b/src/qt/qt_settingsdisplay.cpp index 6ed9e7094..f01d7fc4d 100644 --- a/src/qt/qt_settingsdisplay.cpp +++ b/src/qt/qt_settingsdisplay.cpp @@ -36,6 +36,8 @@ SettingsDisplay::SettingsDisplay(QWidget *parent) { ui->setupUi(this); + videoCard = gfxcard; + videoCard_2 = gfxcard_2; onCurrentMachineChanged(machine); } @@ -59,6 +61,7 @@ SettingsDisplay::onCurrentMachineChanged(int machineId) { // win_settings_video_proc, WM_INITDIALOG this->machineId = machineId; + auto curVideoCard = videoCard; auto *model = ui->comboBoxVideo->model(); auto removeRows = model->rowCount(); @@ -80,7 +83,7 @@ SettingsDisplay::onCurrentMachineChanged(int machineId) if (video_card_available(c) && device_is_valid(video_dev, machineId)) { int row = Models::AddEntry(model, name, c); - if (c == gfxcard) { + if (c == curVideoCard) { selectedRow = row - removeRows; } } @@ -133,7 +136,8 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) if (index < 0) { return; } - int videoCard = ui->comboBoxVideo->currentData().toInt(); + auto curVideoCard_2 = videoCard_2; + videoCard = ui->comboBoxVideo->currentData().toInt(); ui->pushButtonConfigure->setEnabled(video_card_has_config(videoCard) > 0); bool machineHasPci = machine_has_bus(machineId, MACHINE_BUS_PCI) > 0; @@ -176,14 +180,14 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) if (video_card_available(c) && device_is_valid(video_dev, machineId) && !(video_card_get_flags(c) == video_card_get_flags(videoCard))) { ui->comboBoxVideoSecondary->addItem(name, c); - if (c == gfxcard_2) + if (c == curVideoCard_2) ui->comboBoxVideoSecondary->setCurrentIndex(ui->comboBoxVideoSecondary->count() - 1); } c++; } - if (gfxcard_2 == 0 || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0)) { + if (videoCard_2 == 0 || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0)) { ui->comboBoxVideoSecondary->setCurrentIndex(0); ui->pushButtonConfigureSecondary->setEnabled(false); } @@ -208,8 +212,8 @@ SettingsDisplay::on_comboBoxVideoSecondary_currentIndexChanged(int index) ui->pushButtonConfigureSecondary->setEnabled(false); return; } - int videoCard = ui->comboBoxVideoSecondary->currentData().toInt(); - ui->pushButtonConfigureSecondary->setEnabled(index != 0 && video_card_has_config(videoCard) > 0); + videoCard_2 = ui->comboBoxVideoSecondary->currentData().toInt(); + ui->pushButtonConfigureSecondary->setEnabled(index != 0 && video_card_has_config(videoCard_2) > 0); } void diff --git a/src/qt/qt_settingsdisplay.hpp b/src/qt/qt_settingsdisplay.hpp index 0aab5c161..c02e55ce0 100644 --- a/src/qt/qt_settingsdisplay.hpp +++ b/src/qt/qt_settingsdisplay.hpp @@ -35,7 +35,9 @@ private slots: private: Ui::SettingsDisplay *ui; - int machineId = 0; + int machineId = 0; + int videoCard = 0; + int videoCard_2 = 0; }; #endif // QT_SETTINGSDISPLAY_HPP From c2af20302936d264802c8b06eb441ca3aff6028b Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 23 Dec 2022 21:53:22 +0600 Subject: [PATCH 06/11] gdbstub: explicitly define FS_BASE and GS_BASE in features description --- src/gdbstub.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gdbstub.c b/src/gdbstub.c index dc638cd07..92aa93cf1 100644 --- a/src/gdbstub.c +++ b/src/gdbstub.c @@ -213,6 +213,9 @@ static char target_xml[] = /* QEMU gdb-xml/i386-32bit.xml with modificati "" "" "" + "" + "" + "" "" "" "" From b2cf2a604975a6ac08ca644d099e1e5a598fd68f Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sun, 25 Dec 2022 11:25:15 +0600 Subject: [PATCH 07/11] RTMidi support is now available on Haiku --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3f74da8f..74b2ad4b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ cmake_policy(SET CMP0079 NEW) if(HAIKU) set(OPENAL ON) - set(RTMIDI OFF) endif() if(NOT DEFINED QT OR QT) From fd82e523a0cecdc841664b60412e561c8c365563 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 27 Dec 2022 05:27:13 +0100 Subject: [PATCH 08/11] Fixed hercules video_process_8() width, fixes #2997. --- src/video/vid_hercules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index 401166f54..550f05338 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -367,7 +367,7 @@ hercules_poll(void *priv) else x = dev->crtc[1] * 9; - video_process_8(x, dev->displine + 14); + video_process_8(x + 16, dev->displine + 14); } dev->sc = oldsc; From cfa6f64716dd54f87aa25874021c3bf5cc8d3002 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 27 Dec 2022 13:49:10 -0500 Subject: [PATCH 09/11] Initial P2 Covington support --- src/cpu/cpu_table.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index 6fc922b1e..6f4d06399 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -1066,6 +1066,16 @@ const cpu_family_t cpu_families[] = { {"450", CPU_PENTIUM2D, fpus_internal, 450000000, 4.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41,41,14,14, 54}, {"", 0} } + }, { + .package = CPU_PKG_SLOT1, + .manufacturer = "Intel", + .name = "Celeron (Covington)", + .internal_name = "celeron_covington", + .cpus = (const CPU[]) { + {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x650, 0x650, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, + {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,12,12, 36}, + {"", 0} + } }, { .package = CPU_PKG_SLOT2, .manufacturer = "Intel", From bde453160606469de5a9313b544b8edb7c1e79d8 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 27 Dec 2022 14:03:16 -0500 Subject: [PATCH 10/11] Fix timings, as the Covington doesn't have L2 cache --- src/cpu/cpu_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index 6f4d06399..01576decb 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -1072,8 +1072,8 @@ const cpu_family_t cpu_families[] = { .name = "Celeron (Covington)", .internal_name = "celeron_covington", .cpus = (const CPU[]) { - {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x650, 0x650, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, - {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,12,12, 36}, + {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x650, 0x650, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,24,24, 32}, + {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,25,25, 36}, {"", 0} } }, { From 239294b6e39d2750b7ea4a6984de8469bfc9be12 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 27 Dec 2022 15:27:06 -0500 Subject: [PATCH 11/11] Add out of spec underclocked models Matches how we handle the Deschutes --- src/cpu/cpu_table.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index 01576decb..f9e86541c 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -1072,6 +1072,12 @@ const cpu_family_t cpu_families[] = { .name = "Celeron (Covington)", .internal_name = "celeron_covington", .cpus = (const CPU[]) { + {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 6, 6, 8}, /* out of spec */ + {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 9, 9, 12}, /* out of spec */ + {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,12,12, 16}, /* out of spec */ + {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,15,15, 20}, /* out of spec */ + {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18,18,18, 24}, /* out of spec */ + {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,21,21, 28}, /* out of spec */ {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x650, 0x650, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,24,24, 32}, {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,25,25, 36}, {"", 0}