This commit is contained in:
OBattler
2024-07-14 01:33:13 +02:00
7 changed files with 270 additions and 247 deletions

View File

@@ -431,6 +431,10 @@ load_video(void)
strcpy(p, "none"); strcpy(p, "none");
} }
free_p = 1; 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); gfxcard[0] = video_get_video_from_internal_name(p);
if (free_p) { if (free_p) {
@@ -554,36 +558,24 @@ load_sound(void)
char *p; char *p;
p = ini_section_get_string(cat, "sndcard", NULL); 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) if (p != NULL)
sound_card_current[0] = sound_card_get_from_internal_name(p); sound_card_current[0] = sound_card_get_from_internal_name(p);
else else
sound_card_current[0] = 0; sound_card_current[0] = 0;
p = ini_section_get_string(cat, "sndcard2", NULL); 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) if (p != NULL)
sound_card_current[1] = sound_card_get_from_internal_name(p); sound_card_current[1] = sound_card_get_from_internal_name(p);
else else
sound_card_current[1] = 0; sound_card_current[1] = 0;
p = ini_section_get_string(cat, "sndcard3", NULL); 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) if (p != NULL)
sound_card_current[2] = sound_card_get_from_internal_name(p); sound_card_current[2] = sound_card_get_from_internal_name(p);
else else
sound_card_current[2] = 0; sound_card_current[2] = 0;
p = ini_section_get_string(cat, "sndcard4", NULL); 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) if (p != NULL)
sound_card_current[3] = sound_card_get_from_internal_name(p); sound_card_current[3] = sound_card_get_from_internal_name(p);
else else

View File

@@ -365,13 +365,7 @@ gdbstub_break(void)
static void static void
gdbstub_jump(uint32_t new_pc) gdbstub_jump(uint32_t new_pc)
{ {
/* Nasty hack; qemu always uses the full 32-bit EIP internally... */ cpu_state.pc = new_pc - cs;
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;
}
flushmmucache(); flushmmucache();
} }

View File

@@ -50,6 +50,7 @@ public:
SettingsModel(QObject *parent) SettingsModel(QObject *parent)
: QAbstractListModel(parent) : QAbstractListModel(parent)
{ {
fontHeight = QApplication::fontMetrics().height();
} }
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
@@ -82,6 +83,7 @@ private:
"other_removable_devices", "other_removable_devices",
"other_peripherals", "other_peripherals",
}; };
int fontHeight;
}; };
QVariant QVariant
@@ -94,6 +96,8 @@ SettingsModel::data(const QModelIndex &index, int role) const
return tr(pages.at(index.row()).toUtf8().data()); return tr(pages.at(index.row()).toUtf8().data());
case Qt::DecorationRole: case Qt::DecorationRole:
return QIcon(QString("%1/%2.ico").arg(ProgSettings::getIconSetPath(), page_icons[index.row()])); return QIcon(QString("%1/%2.ico").arg(ProgSettings::getIconSetPath(), page_icons[index.row()]));
case Qt::SizeHintRole:
return QSize(-1, fontHeight * 2);
default: default:
return {}; return {};
} }
@@ -182,9 +186,6 @@ Settings::Settings(QWidget *parent)
[this](const QModelIndex &current, const QModelIndex &previous) { [this](const QModelIndex &current, const QModelIndex &previous) {
ui->stackedWidget->setCurrentIndex(current.row()); }); ui->stackedWidget->setCurrentIndex(current.row()); });
ui->listView->resizeColumnsToContents();
ui->listView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
ui->listView->setCurrentIndex(model->index(0, 0)); ui->listView->setCurrentIndex(model->index(0, 0));
Settings::settings = this; Settings::settings = this;

View File

@@ -36,25 +36,31 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QTableView" name="listView"> <widget class="QListView" name="listView">
<property name="editTriggers"> <property name="sizePolicy">
<set>QAbstractItemView::NoEditTriggers</set> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="selectionMode"> <property name="minimumSize">
<enum>QAbstractItemView::SingleSelection</enum> <size>
<width>200</width>
<height>0</height>
</size>
</property> </property>
<property name="selectionBehavior"> <property name="maximumSize">
<enum>QAbstractItemView::SelectRows</enum> <size>
<width>200</width>
<height>16777215</height>
</size>
</property> </property>
<property name="showGrid"> <property name="viewMode">
<bool>false</bool> <enum>QListView::ListMode</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property> </property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget> </widget>
</item> </item>
<item> <item>

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>544</width> <width>544</width>
<height>617</height> <height>363</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -35,6 +35,18 @@
</item> </item>
<item> <item>
<widget class="QTableView" name="tableViewFloppy"> <widget class="QTableView" name="tableViewFloppy">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="editTriggers"> <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
@@ -53,49 +65,38 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QWidget" name="floppyControls" native="true">
<item> <layout class="QHBoxLayout" name="horizontalLayout">
<widget class="QLabel" name="label_2"> <item>
<property name="text"> <widget class="QLabel" name="label_2">
<string>Type:</string> <property name="text">
</property> <string>Type:</string>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QComboBox" name="comboBoxFloppyType"> <item>
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxFloppyType">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QCheckBox" name="checkBoxTurboTimings"> <item>
<property name="text"> <widget class="QCheckBox" name="checkBoxTurboTimings">
<string>Turbo timings</string> <property name="text">
</property> <string>Turbo timings</string>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QCheckBox" name="checkBoxCheckBPB"> <item>
<property name="text"> <widget class="QCheckBox" name="checkBoxCheckBPB">
<string>Check BPB</string> <property name="text">
</property> <string>Check BPB</string>
</widget> </property>
</item> </widget>
</layout> </item>
</item> </layout>
<item> </widget>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
@@ -106,6 +107,18 @@
</item> </item>
<item> <item>
<widget class="QTableView" name="tableViewCDROM"> <widget class="QTableView" name="tableViewCDROM">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="editTriggers"> <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
@@ -124,64 +137,66 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <widget class="QWidget" name="cdControls" native="true">
<item row="0" column="0"> <layout class="QGridLayout" name="gridLayout">
<widget class="QLabel" name="label_3"> <item row="0" column="0">
<property name="text"> <widget class="QLabel" name="label_3">
<string>Bus:</string> <property name="text">
</property> <string>Bus:</string>
</widget> </property>
</item> </widget>
<item row="0" column="2"> </item>
<widget class="QLabel" name="label_7"> <item row="0" column="2">
<property name="text"> <widget class="QLabel" name="label_7">
<string>Channel:</string> <property name="text">
</property> <string>Channel:</string>
</widget> </property>
</item> </widget>
<item row="1" column="0"> </item>
<widget class="QLabel" name="label_4"> <item row="1" column="0">
<property name="text"> <widget class="QLabel" name="label_4">
<string>Speed:</string> <property name="text">
</property> <string>Speed:</string>
</widget> </property>
</item> </widget>
<item row="2" column="0"> </item>
<widget class="QLabel" name="label_5"> <item row="2" column="0">
<property name="text"> <widget class="QLabel" name="label_5">
<string>Type:</string> <property name="text">
</property> <string>Type:</string>
</widget> </property>
</item> </widget>
<item row="0" column="1"> </item>
<widget class="QComboBox" name="comboBoxBus"> <item row="0" column="1">
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxBus">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item row="0" column="3"> </item>
<widget class="QComboBox" name="comboBoxChannel"> <item row="0" column="3">
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxChannel">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item row="1" column="1"> </item>
<widget class="QComboBox" name="comboBoxSpeed"> <item row="1" column="1">
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxSpeed">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item row="2" column="1" colspan="3"> </item>
<widget class="QComboBox" name="comboBoxCDROMType"> <item row="2" column="1" colspan="3">
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxCDROMType">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
</layout> </item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>418</width> <width>418</width>
<height>433</height> <height>368</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -35,6 +35,18 @@
</item> </item>
<item> <item>
<widget class="QTableView" name="tableViewMO"> <widget class="QTableView" name="tableViewMO">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="editTriggers"> <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
@@ -53,63 +65,52 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <widget class="QWidget" name="moControls" native="true">
<item row="0" column="0"> <layout class="QGridLayout" name="gridLayout">
<widget class="QLabel" name="label_2"> <item row="0" column="0">
<property name="text"> <widget class="QLabel" name="label_2">
<string>Bus:</string> <property name="text">
</property> <string>Bus:</string>
</widget> </property>
</item> </widget>
<item row="0" column="2"> </item>
<widget class="QLabel" name="label_7"> <item row="0" column="2">
<property name="text"> <widget class="QLabel" name="label_7">
<string>Channel:</string> <property name="text">
</property> <string>Channel:</string>
</widget> </property>
</item> </widget>
<item row="0" column="1"> </item>
<widget class="QComboBox" name="comboBoxMOBus"> <item row="0" column="1">
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxMOBus">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item row="0" column="3"> </item>
<widget class="QComboBox" name="comboBoxMOChannel"> <item row="0" column="3">
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxMOChannel">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item row="1" column="0"> </item>
<widget class="QLabel" name="label_4"> <item row="1" column="0">
<property name="text"> <widget class="QLabel" name="label_4">
<string>Type:</string> <property name="text">
</property> <string>Type:</string>
</widget> </property>
</item> </widget>
<item row="1" column="1" colspan="3"> </item>
<widget class="QComboBox" name="comboBoxMOType"> <item row="1" column="1" colspan="3">
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxMOType">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
</layout> </item>
</item> </layout>
<item> </widget>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
@@ -120,6 +121,18 @@
</item> </item>
<item> <item>
<widget class="QTableView" name="tableViewZIP"> <widget class="QTableView" name="tableViewZIP">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="editTriggers"> <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
@@ -138,43 +151,45 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <widget class="QWidget" name="zipControls" native="true">
<item> <layout class="QHBoxLayout" name="horizontalLayout">
<widget class="QLabel" name="label_3"> <item>
<property name="text"> <widget class="QLabel" name="label_3">
<string>Bus:</string> <property name="text">
</property> <string>Bus:</string>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QComboBox" name="comboBoxZIPBus"> <item>
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxZIPBus">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QLabel" name="label_5"> <item>
<property name="text"> <widget class="QLabel" name="label_5">
<string>Channel:</string> <property name="text">
</property> <string>Channel:</string>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QComboBox" name="comboBoxZIPChannel"> <item>
<property name="maxVisibleItems"> <widget class="QComboBox" name="comboBoxZIPChannel">
<number>30</number> <property name="maxVisibleItems">
</property> <number>30</number>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QCheckBox" name="checkBoxZIP250"> <item>
<property name="text"> <widget class="QCheckBox" name="checkBoxZIP250">
<string>ZIP 250</string> <property name="text">
</property> <string>ZIP 250</string>
</widget> </property>
</item> </widget>
</layout> </item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@@ -156,7 +156,7 @@ typedef struct chips_69000_t {
rom_t bios_rom; rom_t bios_rom;
void* i2c_ddc, *ddc; void *i2c, *ddc;
uint8_t st01; uint8_t st01;
} chips_69000_t; } chips_69000_t;
@@ -1497,10 +1497,10 @@ chips_69000_read_ext_reg(chips_69000_t* chips)
{ {
val = chips->ext_regs[index]; val = chips->ext_regs[index];
if (!(chips->ext_regs[0x62] & 0x8)) 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)) 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; break;
} }
@@ -1560,14 +1560,14 @@ chips_69000_write_ext_reg(chips_69000_t* chips, uint8_t val)
if (chips->ext_regs[0x62] & 0x8) if (chips->ext_regs[0x62] & 0x8)
scl = !!(val & 8); scl = !!(val & 8);
else else
scl = i2c_gpio_get_scl(chips->i2c_ddc); scl = i2c_gpio_get_scl(chips->i2c);
if (chips->ext_regs[0x62] & 0x4) if (chips->ext_regs[0x62] & 0x4)
sda = !!(val & 4); sda = !!(val & 4);
else 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; chips->ext_regs[chips->ext_index] = val & 0x9F;
break; 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); 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.bpp = 8;
chips->svga.miscout = 1; 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_add(&chips->decrement_timer, chips_69000_decrement_timer, chips, 0);
timer_on_auto(&chips->decrement_timer, 1000000. / 2000.); timer_on_auto(&chips->decrement_timer, 1000000. / 2000.);
chips->i2c_ddc = i2c_gpio_init("c&t_69000_mga"); chips->i2c = i2c_gpio_init("chips_69000_ddc");
chips->ddc = ddc_init(i2c_gpio_get_bus(chips->i2c_ddc)); chips->ddc = ddc_init(i2c_gpio_get_bus(chips->i2c));
chips->flat_panel_regs[0x01] = 1; chips->flat_panel_regs[0x01] = 1;
@@ -2500,7 +2500,7 @@ chips_69000_close(void *p)
// thread_set_event(chips->fifo_event); // thread_set_event(chips->fifo_event);
// thread_wait(chips->accel_thread); // thread_wait(chips->accel_thread);
ddc_close(chips->ddc); ddc_close(chips->ddc);
i2c_gpio_close(chips->i2c_ddc); i2c_gpio_close(chips->i2c);
svga_close(&chips->svga); svga_close(&chips->svga);
free(chips); free(chips);
@@ -2524,7 +2524,7 @@ chips_69000_force_redraw(void *p)
const device_t chips_69000_device = { const device_t chips_69000_device = {
.name = "Chips & Technologies B69000", .name = "Chips & Technologies B69000",
.internal_name = "c&t_69000", .internal_name = "chips_69000",
.flags = DEVICE_PCI, .flags = DEVICE_PCI,
.local = 0, .local = 0,
.init = chips_69000_init, .init = chips_69000_init,
@@ -2537,8 +2537,8 @@ const device_t chips_69000_device = {
}; };
const device_t chips_69000_onboard_device = { const device_t chips_69000_onboard_device = {
.name = "Chips & Technologies B69000 (onboard)", .name = "Chips & Technologies B69000 On-Board",
.internal_name = "c&t_69000_onboard", .internal_name = "chips_69000_onboard",
.flags = DEVICE_PCI, .flags = DEVICE_PCI,
.local = 1, .local = 1,
.init = chips_69000_init, .init = chips_69000_init,