From eeb8af91f596985f8adf95c369f31ae9caf7e7ed Mon Sep 17 00:00:00 2001 From: cold-brewed <47337035+cold-brewed@users.noreply.github.com> Date: Sat, 13 Jul 2024 09:30:36 -0400 Subject: [PATCH 1/4] qt: Fix settings on mac and linux --- src/qt/qt_settings.cpp | 7 +- src/qt/qt_settings.ui | 36 +++-- src/qt/qt_settingsfloppycdrom.ui | 219 +++++++++++++++------------- src/qt/qt_settingsotherremovable.ui | 205 ++++++++++++++------------ 4 files changed, 252 insertions(+), 215 deletions(-) diff --git a/src/qt/qt_settings.cpp b/src/qt/qt_settings.cpp index caabdbfca..67064b73a 100644 --- a/src/qt/qt_settings.cpp +++ b/src/qt/qt_settings.cpp @@ -50,6 +50,7 @@ public: SettingsModel(QObject *parent) : QAbstractListModel(parent) { + fontHeight = QApplication::fontMetrics().height(); } QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; @@ -82,6 +83,7 @@ private: "other_removable_devices", "other_peripherals", }; + int fontHeight; }; QVariant @@ -94,6 +96,8 @@ SettingsModel::data(const QModelIndex &index, int role) const return tr(pages.at(index.row()).toUtf8().data()); case Qt::DecorationRole: return QIcon(QString("%1/%2.ico").arg(ProgSettings::getIconSetPath(), page_icons[index.row()])); + case Qt::SizeHintRole: + return QSize(-1, fontHeight * 2); default: return {}; } @@ -182,9 +186,6 @@ Settings::Settings(QWidget *parent) [this](const QModelIndex ¤t, const QModelIndex &previous) { ui->stackedWidget->setCurrentIndex(current.row()); }); - ui->listView->resizeColumnsToContents(); - ui->listView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); - ui->listView->setCurrentIndex(model->index(0, 0)); Settings::settings = this; diff --git a/src/qt/qt_settings.ui b/src/qt/qt_settings.ui index fd92f7f58..da31b98c4 100644 --- a/src/qt/qt_settings.ui +++ b/src/qt/qt_settings.ui @@ -36,25 +36,31 @@ 0 - - - QAbstractItemView::NoEditTriggers + + + + 0 + 0 + - - QAbstractItemView::SingleSelection + + + 200 + 0 + - - QAbstractItemView::SelectRows + + + 200 + 16777215 + - - false + + QListView::ListMode + + + true - - false - - - false - diff --git a/src/qt/qt_settingsfloppycdrom.ui b/src/qt/qt_settingsfloppycdrom.ui index d7ad853b3..b9a937d8d 100644 --- a/src/qt/qt_settingsfloppycdrom.ui +++ b/src/qt/qt_settingsfloppycdrom.ui @@ -7,7 +7,7 @@ 0 0 544 - 617 + 363 @@ -35,6 +35,18 @@ + + + 0 + 0 + + + + + 16777215 + 150 + + QAbstractItemView::NoEditTriggers @@ -53,49 +65,38 @@ - - - - - Type: - - - - - - - 30 - - - - - - - Turbo timings - - - - - - - Check BPB - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + + + + + Type: + + + + + + + 30 + + + + + + + Turbo timings + + + + + + + Check BPB + + + + + @@ -106,6 +107,18 @@ + + + 0 + 0 + + + + + 16777215 + 150 + + QAbstractItemView::NoEditTriggers @@ -124,64 +137,66 @@ - - - - - Bus: - - - - - - - Channel: - - - - - - - Speed: - - - - - - - Type: - - - - - - - 30 - - - - - - - 30 - - - - - - - 30 - - - - - - - 30 - - - - + + + + + + Bus: + + + + + + + Channel: + + + + + + + Speed: + + + + + + + Type: + + + + + + + 30 + + + + + + + 30 + + + + + + + 30 + + + + + + + 30 + + + + + diff --git a/src/qt/qt_settingsotherremovable.ui b/src/qt/qt_settingsotherremovable.ui index 219333376..8962184fc 100644 --- a/src/qt/qt_settingsotherremovable.ui +++ b/src/qt/qt_settingsotherremovable.ui @@ -7,7 +7,7 @@ 0 0 418 - 433 + 368 @@ -35,6 +35,18 @@ + + + 0 + 0 + + + + + 16777215 + 150 + + QAbstractItemView::NoEditTriggers @@ -53,63 +65,52 @@ - - - - - Bus: - - - - - - - Channel: - - - - - - - 30 - - - - - - - 30 - - - - - - - Type: - - - - - - - 30 - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + + + + + Bus: + + + + + + + Channel: + + + + + + + 30 + + + + + + + 30 + + + + + + + Type: + + + + + + + 30 + + + + + @@ -120,6 +121,18 @@ + + + 0 + 0 + + + + + 16777215 + 150 + + QAbstractItemView::NoEditTriggers @@ -138,43 +151,45 @@ - - - - - Bus: - - - - - - - 30 - - - - - - - Channel: - - - - - - - 30 - - - - - - - ZIP 250 - - - - + + + + + + Bus: + + + + + + + 30 + + + + + + + Channel: + + + + + + + 30 + + + + + + + ZIP 250 + + + + + From 44be6a0dbfd8b081bd0e3f5ef719b3452a4f2970 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 13 Jul 2024 19:14:12 -0300 Subject: [PATCH 2/4] C&T 69000: Fix PCI slot assignment and internal name --- src/config.c | 4 ++++ src/video/vid_chips_69000.c | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/config.c b/src/config.c index bc4341b0d..3548fdf2d 100644 --- a/src/config.c +++ b/src/config.c @@ -431,6 +431,10 @@ load_video(void) strcpy(p, "none"); } free_p = 1; + } else if (!strcmp(p, "c&t_69000")) { + p = (char *) malloc((strlen("chips_69000") + 1) * sizeof(char)); + strcpy(p, "chips_69000"); + free_p = 1; } gfxcard[0] = video_get_video_from_internal_name(p); if (free_p) { diff --git a/src/video/vid_chips_69000.c b/src/video/vid_chips_69000.c index d91ab1a8b..2caefd413 100644 --- a/src/video/vid_chips_69000.c +++ b/src/video/vid_chips_69000.c @@ -156,7 +156,7 @@ typedef struct chips_69000_t { rom_t bios_rom; - void* i2c_ddc, *ddc; + void *i2c, *ddc; uint8_t st01; } chips_69000_t; @@ -1497,10 +1497,10 @@ chips_69000_read_ext_reg(chips_69000_t* chips) { val = chips->ext_regs[index]; if (!(chips->ext_regs[0x62] & 0x8)) - val = (val & ~8) | (i2c_gpio_get_scl(chips->i2c_ddc) << 3); + val = (val & ~8) | (i2c_gpio_get_scl(chips->i2c) << 3); if (!(chips->ext_regs[0x62] & 0x4)) - val = (val & ~4) | (i2c_gpio_get_sda(chips->i2c_ddc) << 2); + val = (val & ~4) | (i2c_gpio_get_sda(chips->i2c) << 2); break; } @@ -1560,14 +1560,14 @@ chips_69000_write_ext_reg(chips_69000_t* chips, uint8_t val) if (chips->ext_regs[0x62] & 0x8) scl = !!(val & 8); else - scl = i2c_gpio_get_scl(chips->i2c_ddc); + scl = i2c_gpio_get_scl(chips->i2c); if (chips->ext_regs[0x62] & 0x4) sda = !!(val & 4); else - scl = i2c_gpio_get_sda(chips->i2c_ddc); + scl = i2c_gpio_get_sda(chips->i2c); - i2c_gpio_set(chips->i2c_ddc, scl, sda); + i2c_gpio_set(chips->i2c, scl, sda); chips->ext_regs[chips->ext_index] = val & 0x9F; break; @@ -2455,7 +2455,7 @@ chips_69000_init(const device_t *info) io_sethandler(0x03c0, 0x0020, chips_69000_in, NULL, NULL, chips_69000_out, NULL, NULL, chips); - pci_add_card(PCI_ADD_VIDEO, chips_69000_pci_read, chips_69000_pci_write, chips, &chips->slot); + pci_add_card(info->local ? PCI_ADD_VIDEO : PCI_ADD_NORMAL, chips_69000_pci_read, chips_69000_pci_write, chips, &chips->slot); chips->svga.bpp = 8; chips->svga.miscout = 1; @@ -2477,8 +2477,8 @@ chips_69000_init(const device_t *info) timer_add(&chips->decrement_timer, chips_69000_decrement_timer, chips, 0); timer_on_auto(&chips->decrement_timer, 1000000. / 2000.); - chips->i2c_ddc = i2c_gpio_init("c&t_69000_mga"); - chips->ddc = ddc_init(i2c_gpio_get_bus(chips->i2c_ddc)); + chips->i2c = i2c_gpio_init("chips_69000_ddc"); + chips->ddc = ddc_init(i2c_gpio_get_bus(chips->i2c)); chips->flat_panel_regs[0x01] = 1; @@ -2500,7 +2500,7 @@ chips_69000_close(void *p) // thread_set_event(chips->fifo_event); // thread_wait(chips->accel_thread); ddc_close(chips->ddc); - i2c_gpio_close(chips->i2c_ddc); + i2c_gpio_close(chips->i2c); svga_close(&chips->svga); free(chips); @@ -2524,7 +2524,7 @@ chips_69000_force_redraw(void *p) const device_t chips_69000_device = { .name = "Chips & Technologies B69000", - .internal_name = "c&t_69000", + .internal_name = "chips_69000", .flags = DEVICE_PCI, .local = 0, .init = chips_69000_init, @@ -2537,8 +2537,8 @@ const device_t chips_69000_device = { }; const device_t chips_69000_onboard_device = { - .name = "Chips & Technologies B69000 (onboard)", - .internal_name = "c&t_69000_onboard", + .name = "Chips & Technologies B69000 On-Board", + .internal_name = "chips_69000_onboard", .flags = DEVICE_PCI, .local = 1, .init = chips_69000_init, From 869b4813715d395500ca9dbeeb609b8c639c448b Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 13 Jul 2024 19:15:31 -0300 Subject: [PATCH 3/4] config: Remove ancient Sound Blaster PCI 128 migration path --- src/config.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/config.c b/src/config.c index 3548fdf2d..8a837cf56 100644 --- a/src/config.c +++ b/src/config.c @@ -558,36 +558,24 @@ load_sound(void) char *p; p = ini_section_get_string(cat, "sndcard", NULL); - /* FIXME: Hack to not break configs with the Sound Blaster 128 PCI set. */ - if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) - p = "es1371"; if (p != NULL) sound_card_current[0] = sound_card_get_from_internal_name(p); else sound_card_current[0] = 0; p = ini_section_get_string(cat, "sndcard2", NULL); - /* FIXME: Hack to not break configs with the Sound Blaster 128 PCI set. */ - if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) - p = "es1371"; if (p != NULL) sound_card_current[1] = sound_card_get_from_internal_name(p); else sound_card_current[1] = 0; p = ini_section_get_string(cat, "sndcard3", NULL); - /* FIXME: Hack to not break configs with the Sound Blaster 128 PCI set. */ - if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) - p = "es1371"; if (p != NULL) sound_card_current[2] = sound_card_get_from_internal_name(p); else sound_card_current[2] = 0; p = ini_section_get_string(cat, "sndcard4", NULL); - /* FIXME: Hack to not break configs with the Sound Blaster 128 PCI set. */ - if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) - p = "es1371"; if (p != NULL) sound_card_current[3] = sound_card_get_from_internal_name(p); else From f247fa84acbc1512dc13384975fae88b27467cff Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 13 Jul 2024 19:17:48 -0300 Subject: [PATCH 4/4] gdbstub: Don't reload CS on jump --- src/gdbstub.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/gdbstub.c b/src/gdbstub.c index 703637422..8322c5ef6 100644 --- a/src/gdbstub.c +++ b/src/gdbstub.c @@ -365,13 +365,7 @@ gdbstub_break(void) static void gdbstub_jump(uint32_t new_pc) { - /* Nasty hack; qemu always uses the full 32-bit EIP internally... */ - if (cpu_state.op32 || ((new_pc >= cs) && (new_pc < (cs + 65536)))) { - cpu_state.pc = new_pc - cs; - } else { - loadseg((new_pc >> 4) & 0xf000, &cpu_state.seg_cs); - cpu_state.pc = new_pc & 0xffff; - } + cpu_state.pc = new_pc - cs; flushmmucache(); }