ISA ROM Board Support
This commit is contained in:
@@ -24,6 +24,7 @@ extern "C" {
|
||||
#include <86box/device.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/isamem.h>
|
||||
#include <86box/isarom.h>
|
||||
#include <86box/isartc.h>
|
||||
#include <86box/unittester.h>
|
||||
#include <86box/novell_cardkey.h>
|
||||
@@ -65,6 +66,10 @@ SettingsOtherPeripherals::onCurrentMachineChanged(int machineId)
|
||||
if (auto *cb = findChild<QComboBox *>(QString("comboBoxIsaMemCard%1").arg(i + 1)))
|
||||
cb->clear();
|
||||
|
||||
for (uint8_t i = 0; i < ISAROM_MAX; ++i)
|
||||
if (auto *cb = findChild<QComboBox *>(QString("comboBoxIsaRomCard%1").arg(i + 1)))
|
||||
cb->clear();
|
||||
|
||||
int c = 0;
|
||||
int selectedRow = 0;
|
||||
|
||||
@@ -127,6 +132,47 @@ SettingsOtherPeripherals::onCurrentMachineChanged(int machineId)
|
||||
findChild<QPushButton *>(QString("pushButtonConfigureIsaMemCard%1").arg(i + 1))->setEnabled((isamem_type[i] != 0) &&
|
||||
isamem_has_config(isamem_type[i]) && machineHasIsa);
|
||||
}
|
||||
|
||||
// ISA ROM Expansion Cards
|
||||
QComboBox *isarom_cbox[ISAROM_MAX] = { 0 };
|
||||
QAbstractItemModel *isarom_models[ISAROM_MAX] = { 0 };
|
||||
int isarom_removeRows_[ISAROM_MAX] = { 0 };
|
||||
int isarom_selectedRows[ISAROM_MAX] = { 0 };
|
||||
|
||||
for (uint8_t i = 0; i < ISAROM_MAX; ++i) {
|
||||
isarom_cbox[i] = findChild<QComboBox *>(QString("comboBoxIsaRomCard%1").arg(i + 1));
|
||||
isarom_models[i] = isarom_cbox[i]->model();
|
||||
isarom_removeRows_[i] = isarom_models[i]->rowCount();
|
||||
}
|
||||
|
||||
c = 0;
|
||||
while (true) {
|
||||
const QString name = DeviceConfig::DeviceName(isarom_get_device(c),
|
||||
isarom_get_internal_name(c), 0);
|
||||
|
||||
if (name.isEmpty())
|
||||
break;
|
||||
|
||||
if (device_is_valid(isarom_get_device(c), machineId)) {
|
||||
for (uint8_t i = 0; i < ISAROM_MAX; ++i) {
|
||||
int row = Models::AddEntry(isarom_models[i], name, c);
|
||||
|
||||
if (c == isarom_type[i])
|
||||
isarom_selectedRows[i] = row - isarom_removeRows_[i];
|
||||
}
|
||||
}
|
||||
|
||||
c++;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < ISAROM_MAX; ++i) {
|
||||
isarom_models[i]->removeRows(0, isarom_removeRows_[i]);
|
||||
isarom_cbox[i]->setEnabled(isarom_models[i]->rowCount() > 1);
|
||||
isarom_cbox[i]->setCurrentIndex(-1);
|
||||
isarom_cbox[i]->setCurrentIndex(isarom_selectedRows[i]);
|
||||
findChild<QPushButton *>(QString("pushButtonConfigureIsaRomCard%1").arg(i + 1))->setEnabled((isarom_type[i] != 0) &&
|
||||
isarom_has_config(isarom_type[i]) && machineHasIsa);
|
||||
}
|
||||
}
|
||||
|
||||
SettingsOtherPeripherals::~SettingsOtherPeripherals()
|
||||
@@ -149,6 +195,12 @@ SettingsOtherPeripherals::save()
|
||||
auto *cbox = findChild<QComboBox *>(QString("comboBoxIsaMemCard%1").arg(i + 1));
|
||||
isamem_type[i] = cbox->currentData().toInt();
|
||||
}
|
||||
|
||||
/* ISA ROM boards. */
|
||||
for (int i = 0; i < ISAROM_MAX; i++) {
|
||||
auto *cbox = findChild<QComboBox *>(QString("comboBoxIsaRomCard%1").arg(i + 1));
|
||||
isarom_type[i] = cbox->currentData().toInt();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -226,6 +278,66 @@ SettingsOtherPeripherals::on_pushButtonConfigureIsaMemCard4_clicked()
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxIsaMemCard4->currentData().toInt()), 4);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxIsaRomCard1_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
ui->pushButtonConfigureIsaRomCard1->setEnabled((index != 0) && isarom_has_config(index) && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureIsaRomCard1_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isarom_get_device(ui->comboBoxIsaRomCard1->currentData().toInt()), 1);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxIsaRomCard2_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
ui->pushButtonConfigureIsaRomCard2->setEnabled((index != 0) && isarom_has_config(index) && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureIsaRomCard2_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isarom_get_device(ui->comboBoxIsaRomCard2->currentData().toInt()), 2);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxIsaRomCard3_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
ui->pushButtonConfigureIsaRomCard3->setEnabled((index != 0) && isarom_has_config(index) && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureIsaRomCard3_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isarom_get_device(ui->comboBoxIsaRomCard3->currentData().toInt()), 3);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxIsaRomCard4_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
ui->pushButtonConfigureIsaRomCard4->setEnabled((index != 0) && isarom_has_config(index) && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureIsaRomCard4_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isarom_get_device(ui->comboBoxIsaRomCard4->currentData().toInt()), 4);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsOtherPeripherals::on_checkBoxUnitTester_stateChanged(int arg1)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,15 @@ private slots:
|
||||
void on_comboBoxIsaMemCard4_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureIsaMemCard4_clicked();
|
||||
|
||||
void on_comboBoxIsaRomCard1_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureIsaRomCard1_clicked();
|
||||
void on_comboBoxIsaRomCard2_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureIsaRomCard2_clicked();
|
||||
void on_comboBoxIsaRomCard3_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureIsaRomCard3_clicked();
|
||||
void on_comboBoxIsaRomCard4_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureIsaRomCard4_clicked();
|
||||
|
||||
void on_checkBoxUnitTester_stateChanged(int arg1);
|
||||
void on_pushButtonConfigureUT_clicked();
|
||||
|
||||
|
||||
@@ -174,6 +174,123 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxRom">
|
||||
<property name="title">
|
||||
<string>ISA ROM Cards</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayoutRom">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelIsaRomCard1">
|
||||
<property name="text">
|
||||
<string>Card 1:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBoxIsaRomCard1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureIsaRomCard1">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelIsaRomCard2">
|
||||
<property name="text">
|
||||
<string>Card 2:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBoxIsaRomCard2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureIsaRomCard2">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelIsaRomCard3">
|
||||
<property name="text">
|
||||
<string>Card 3:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="comboBoxIsaRomCard3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureIsaRomCard3">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelIsaRomCard4">
|
||||
<property name="text">
|
||||
<string>Card 4:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="comboBoxIsaRomCard4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureIsaRomCard4">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutIBPC">
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user