PIT type selection, CD-ROM model filtering by bus, and translation updates - closes #3354.

This commit is contained in:
OBattler
2023-08-16 05:23:03 +02:00
parent 21b8b992b5
commit 6fae975a72
28 changed files with 886 additions and 464 deletions

View File

@@ -1868,10 +1868,8 @@ cdrom_insert(uint8_t id)
{
cdrom_t *dev = &cdrom[id];
if (dev->bus_type) {
if (dev->insert)
dev->insert(dev->priv);
}
if (dev->bus_type && dev->insert)
dev->insert(dev->priv);
}
/* The mechanics of ejecting a CD-ROM from a drive. */

View File

@@ -63,7 +63,8 @@ enum {
#define KNOWN_CDROM_DRIVE_TYPES 35
#define BUS_TYPE_IDE CDROM_BUS_ATAPI
#define BUS_TYPE_SCSI CDROM_BUS_SCSI
#define BUS_TYPE_BOTH -1
#define BUS_TYPE_BOTH -2
#define BUS_TYPE_NONE -1
static const struct
{
@@ -109,7 +110,7 @@ static const struct
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "(SCSI) TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI }, /*33*/
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "(SCSI) TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI }, /*34*/
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "(SCSI) TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI }, /*35*/
{ "", "", "", "", "", -1 },
{ "", "", "", "", "", BUS_TYPE_NONE },
};
/* To shut up the GCC compilers. */

View File

@@ -166,7 +166,7 @@ machine_common_init(UNUSED(const machine_t *model))
int pit_type = IS_AT(machine) ? PIT_8254 : PIT_8253;
/* Select fast PIT if needed */
if ((pit_mode == -1 && is486) || pit_mode == 1)
if (((pit_mode == -1) && is486) || (pit_mode == 1))
pit_type += 2;
pit_common_init(pit_type, pit_irq0_timer, NULL);

View File

@@ -656,7 +656,7 @@ msgid "(empty)"
msgstr "(prázdné)"
msgid "All files"
msgstr "All files"
msgstr "Všechny soubory"
msgid "Turbo"
msgstr "Turbo"
@@ -932,10 +932,10 @@ msgid "Cartridge images"
msgstr "Obrazy cartridge"
msgid "Error initializing renderer"
msgstr "Error initializing renderer"
msgstr "Chyba při inicializaci vykreslovače"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "Vykreslovač OpenGL (3.0 Core) se nepodařilo inicializovat. Použijte jiný renderer."
msgid "Resume execution"
msgstr "Obnovit"
@@ -1196,8 +1196,19 @@ msgid "(System Default)"
msgstr "(Výchozí nastavení systému)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Nepodařilo se inicializovat síťový ovladač"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Konfigurace sítě bude přepnuta na nulový ovladač"
msgid "PIT mode:"
msgstr "Režim PIT:"
msgid "Auto"
msgstr "Automatický"
msgid "Slow"
msgstr "Pomalý"
msgid "Fast"
msgstr "Rychlý"

View File

@@ -98,7 +98,7 @@ msgid "Filter method"
msgstr "Filteringmethode"
msgid "&Nearest"
msgstr "&Nearest"
msgstr "&Nächst"
msgid "&Linear"
msgstr "&Linear"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Systemstandard)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Netzwerktreiber konnte nicht initialisiert werden"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Die Netzwerkkonfiguration wird auf den Nulltreiber umgestellt"
msgid "PIT mode:"
msgstr "PIT-Modus:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Langsam"
msgid "Fast"
msgstr "Schnell"

View File

@@ -1201,3 +1201,15 @@ msgstr "Failed to initialize network driver"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgid "PIT mode:"
msgstr "PIT mode:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Slow"
msgid "Fast"
msgstr "Fast"

View File

@@ -1201,3 +1201,15 @@ msgstr "Failed to initialize network driver"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgid "PIT mode:"
msgstr "PIT mode:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Slow"
msgid "Fast"
msgstr "Fast"

View File

@@ -932,28 +932,28 @@ msgid "Cartridge images"
msgstr "Imágenes de Cartucho"
msgid "Error initializing renderer"
msgstr "Error initializing renderer"
msgstr "Error al inicializar el renderizador"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "No se ha podido inicializar el renderizador OpenGL (3.0 Core). Utilice otro renderizador."
msgid "Resume execution"
msgstr "Resume execution"
msgstr "Retomar la ejecución"
msgid "Pause execution"
msgstr "Pause execution"
msgstr "Pausar la ejecución"
msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del"
msgstr "Pulsar Ctrl+Alt+Supr"
msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc"
msgstr "Pulsar Ctrl+Alt+Esc"
msgid "Hard reset"
msgstr "Hard reset"
msgid "ACPI shutdown"
msgstr "ACPI shutdown"
msgstr "Parada ACPI"
msgid "Hard disk (%s)"
msgstr "Disco duro (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Por defecto del sistema)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Error al inicializar el controlador de red"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "La configuración de red se cambiará al controlador nulo"
msgid "PIT mode:"
msgstr "Modalidad PIT:"
msgid "Auto"
msgstr "Automática"
msgid "Slow"
msgstr "Lenta"
msgid "Fast"
msgstr "Rápida"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Järjestelmän oletus)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Verkkoajurin alustaminen epäonnistui"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Verkkokokoonpano vaihtuu nolla-ajuriin"
msgid "PIT mode:"
msgstr "PIT-tila:"
msgid "Auto"
msgstr "Automaattinen"
msgid "Slow"
msgstr "Hidas"
msgid "Fast"
msgstr "Nopea"

View File

@@ -932,28 +932,28 @@ msgid "Cartridge images"
msgstr "Images cartouche"
msgid "Error initializing renderer"
msgstr "Error initializing renderer"
msgstr "Erreur d'initialisation du moteur de rendu"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "Le moteur de rendu OpenGL (3.0 Core) n'a pas pu être initialisé. Utilisez un autre moteur de rendu."
msgid "Resume execution"
msgstr "Resume execution"
msgstr "Reprendre l'exécution"
msgid "Pause execution"
msgstr "Pause execution"
msgstr "Pause de l'exécution"
msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del"
msgstr "Appuyer sur Ctrl+Alt+Suppr."
msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc"
msgstr "Appuyer sur Ctrl+Alt+Esc"
msgid "Hard reset"
msgstr "Hard reset"
msgid "ACPI shutdown"
msgstr "ACPI shutdown"
msgstr "Arrêt ACPI"
msgid "Hard disk (%s)"
msgstr "Disque dur (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Défaut du système)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Échec de l'initialisation du pilote réseau"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "La configuration du réseau passera au pilote nul"
msgid "PIT mode:"
msgstr "Mode PIT:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Lent"
msgid "Fast"
msgstr "Rapide"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Zadana postavka operativnog sustava)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Neuspješno pokretanje mrežnog upravljačkog programa"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Konfiguracija mreže bit će prebačena na nulti upravljački program"
msgid "PIT mode:"
msgstr "PIT način:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Spori"
msgid "Fast"
msgstr "Brzi"

View File

@@ -938,22 +938,22 @@ msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer
msgstr "Az OpenGL (3.0 Core) megjelenítő-motort nem sikerült inicializálni. Kérem használjon másik renderelőt."
msgid "Resume execution"
msgstr "Resume execution"
msgstr "Folytassa a végrehajtást"
msgid "Pause execution"
msgstr "Pause execution"
msgstr "Kivitelezés szüneteltetése"
msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del"
msgstr "Nyomja meg a Ctrl+Alt+Del"
msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc"
msgstr "Nyomja meg a Ctrl+Alt+Esc"
msgid "Hard reset"
msgstr "Hard reset"
msgstr "Hardveres újraindítás"
msgid "ACPI shutdown"
msgstr "ACPI shutdown"
msgstr "ACPI leállítás"
msgid "Hard disk (%s)"
msgstr "Merevlemez (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(A rendszer nyelve)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Nem sikerült inicializálni a hálózati illesztőprogramot"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "A hálózati konfiguráció átvált a null illesztőprogramra"
msgid "PIT mode:"
msgstr "PIT üzemmód:"
msgid "Auto"
msgstr "Automatikus"
msgid "Slow"
msgstr "Lassú"
msgid "Fast"
msgstr "Gyors"

View File

@@ -866,7 +866,7 @@ msgid "libpcap"
msgstr "libpcap"
msgid "Make sure libpcap is installed and that you are on a libpcap-compatible network connection."
msgstr "Controlla se libpcap è installato e che tu sia connesso ad una connessione libpcap compatibile."
msgstr "Controllare se libpcap è installato e che tu sia connesso ad una connessione libpcap compatibile."
msgid "Invalid configuration"
msgstr "Configurazione invalida"
@@ -932,28 +932,28 @@ msgid "Cartridge images"
msgstr "Immagini cartuccia"
msgid "Error initializing renderer"
msgstr "Error initializing renderer"
msgstr "Errore nell'inizializzazione del renderer"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "Non è stato possibile inizializzare il renderer OpenGL (3.0 Core). Utilizzare un altro renderer."
msgid "Resume execution"
msgstr "Resume execution"
msgstr "Riprendere l'esecuzione"
msgid "Pause execution"
msgstr "Pause execution"
msgstr "Sospendere l'esecuzione"
msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del"
msgstr "Premere Ctrl+Alt+Canc"
msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc"
msgstr "Premere Ctrl+Alt+Esc"
msgid "Hard reset"
msgstr "Hard reset"
msgstr "Riavvia"
msgid "ACPI shutdown"
msgstr "ACPI shutdown"
msgstr "Arresto ACPI"
msgid "Hard disk (%s)"
msgstr "Hard disk (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Predefinito del sistema)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Impossibile inizializzare il driver di rete"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "La configurazione di rete verrà commutata sul driver nullo"
msgid "PIT mode:"
msgstr "Modalità PIT:"
msgid "Auto"
msgstr "Automatica"
msgid "Slow"
msgstr "Lenta"
msgid "Fast"
msgstr "Veloce"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(システム既定値)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "ネットワークドライバの初期化に失敗しました"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "ネットワーク設定がヌル・ドライバに切り替わる"
msgid "PIT mode:"
msgstr "PITモード:"
msgid "Auto"
msgstr "オート"
msgid "Slow"
msgstr "遅い"
msgid "Fast"
msgstr "速い"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(시스템 기본값)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "네트워크 드라이버를 초기화하지 못했습니다"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "네트워크 구성이 널 드라이버로 전환됩니다"
msgid "PIT mode:"
msgstr "PIT 모드:"
msgid "Auto"
msgstr "자동"
msgid "Slow"
msgstr "느린"
msgid "Fast"
msgstr "빠른"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Domyślne ustawienie systemowe)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Nie udało się zainicjować sterownika sieciowego"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Konfiguracja sieci zostanie przełączona na sterownik null"
msgid "PIT mode:"
msgstr "Tryb PIT:"
msgid "Auto"
msgstr "Automatyczny"
msgid "Slow"
msgstr "Powolny"
msgid "Fast"
msgstr "Szybki"

View File

@@ -1201,3 +1201,15 @@ msgstr "Falha ao inicializar o driver de rede"
msgid "The network configuration will be switched to the null driver"
msgstr "A configuração de rede será alterada para o driver nulo"
msgid "PIT mode:"
msgstr "Modo PIT:"
msgid "Auto"
msgstr "Automático"
msgid "Slow"
msgstr "Lento"
msgid "Fast"
msgstr "Rápido"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Padrão do sistema)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Falha ao inicializar o driver de rede"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "A configuração da rede será alterada para o controlador nulo"
msgid "PIT mode:"
msgstr "Modo PIT:"
msgid "Auto"
msgstr "Automático"
msgid "Slow"
msgstr "Lento"
msgid "Fast"
msgstr "Rápido"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Системный)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Не удалось инициализировать сетевой драйвер"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Сетевая конфигурация будет переключена на нулевой драйвер"
msgid "PIT mode:"
msgstr "Режим PIT:"
msgid "Auto"
msgstr "Авто"
msgid "Slow"
msgstr "Медленный"
msgid "Fast"
msgstr "Быстрый"

View File

@@ -944,10 +944,10 @@ msgid "Pause execution"
msgstr "Prekini izvajanje"
msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del"
msgstr "Pritisni Ctrl+Alt+Del"
msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc"
msgstr "Pritisni Ctrl+Alt+Esc"
msgid "Hard reset"
msgstr "Ponovni zagon"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Sistemsko privzeto)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Ni uspelo inicializirati omrežnega gonilnika"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Omrežne nastavitve bodo preklopljene na ničelni gonilnik"
msgid "PIT mode:"
msgstr "Način PIT:"
msgid "Auto"
msgstr "Samodejni"
msgid "Slow"
msgstr "Počasni"
msgid "Fast"
msgstr "Hitri"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Sistem Varsayılanı)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Ağ sürücüsü başlatılamadı"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Ağ yapılandırması null sürücüye geçirilecektir"
msgid "PIT mode:"
msgstr "PIT modu:"
msgid "Auto"
msgstr "Otomatik"
msgid "Slow"
msgstr "Yavaş"
msgid "Fast"
msgstr "Hızlı"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Системний)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "Не вдалося ініціалізувати мережевий драйвер"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "Конфігурацію мережі буде змінено на нульовий драйвер"
msgid "PIT mode:"
msgstr "Режим PIT:"
msgid "Auto"
msgstr "Авто"
msgid "Slow"
msgstr "Повільний"
msgid "Fast"
msgstr "Швидкий"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(系统默认)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "网络驱动程序初始化失败"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "网络配置将切换为空驱动程序"
msgid "PIT mode:"
msgstr "PIT 模式:"
msgid "Auto"
msgstr "汽车"
msgid "Slow"
msgstr "慢"
msgid "Fast"
msgstr "快速"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(系統預設)"
msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver"
msgstr "初始化網絡驅動程序失敗"
msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver"
msgstr "網絡配置將切換為空驅動程序"
msgid "PIT mode:"
msgstr "點模式:"
msgid "Auto"
msgstr "汽車"
msgid "Slow"
msgstr "慢的"
msgid "Fast"
msgstr "快速地"

View File

@@ -45,13 +45,12 @@ static void
setFloppyType(QAbstractItemModel *model, const QModelIndex &idx, int type)
{
QIcon icon;
if (type == 0) {
if (type == 0)
icon = ProgSettings::loadIcon("/floppy_disabled.ico");
} else if (type >= 1 && type <= 6) {
else if (type >= 1 && type <= 6)
icon = ProgSettings::loadIcon("/floppy_525.ico");
} else {
else
icon = ProgSettings::loadIcon("/floppy_35.ico");
}
model->setData(idx, QObject::tr(fdd_getname(type)));
model->setData(idx, type, Qt::UserRole);
@@ -62,6 +61,7 @@ static void
setCDROMBus(QAbstractItemModel *model, const QModelIndex &idx, uint8_t bus, uint8_t channel)
{
QIcon icon;
switch (bus) {
case CDROM_BUS_DISABLED:
icon = ProgSettings::loadIcon("/cdrom_disabled.ico");
@@ -94,11 +94,10 @@ static void
setCDROMType(QAbstractItemModel *model, const QModelIndex &idx, int type)
{
auto i = idx.siblingAtColumn(2);
if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == CDROM_BUS_DISABLED) {
if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == CDROM_BUS_DISABLED)
model->setData(i, QCoreApplication::translate("", "None"));
} else if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() != CDROM_BUS_MITSUMI) {
else if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() != CDROM_BUS_MITSUMI)
model->setData(i, QObject::tr(cdrom_getname(type)));
}
model->setData(i, type, Qt::UserRole);
}
@@ -112,9 +111,8 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
int i = 0;
while (true) {
QString name = tr(fdd_getname(i));
if (name.isEmpty()) {
if (name.isEmpty())
break;
}
Models::AddEntry(model, name, i);
++i;
@@ -139,26 +137,27 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
ui->tableViewFloppy->resizeColumnsToContents();
ui->tableViewFloppy->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
connect(ui->tableViewFloppy->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &SettingsFloppyCDROM::onFloppyRowChanged);
connect(ui->tableViewFloppy->selectionModel(), &QItemSelectionModel::currentRowChanged,
this, &SettingsFloppyCDROM::onFloppyRowChanged);
ui->tableViewFloppy->setCurrentIndex(model->index(0, 0));
Harddrives::populateRemovableBuses(ui->comboBoxBus->model());
model = ui->comboBoxSpeed->model();
for (int i = 0; i < 72; i++) {
for (int i = 0; i < 72; i++)
Models::AddEntry(model, QString("%1x").arg(i + 1), i + 1);
}
#if 0
model = ui->comboBoxCDROMType->model();
i = 0;
while (true) {
QString name = tr(cdrom_getname(i));
if (name.isEmpty()) {
if (name.isEmpty())
break;
}
Models::AddEntry(model, name, i);
++i;
}
#endif
model = new QStandardItemModel(0, 3, this);
ui->tableViewCDROM->setModel(model);
@@ -175,15 +174,43 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
if (cdrom[i].bus_type == CDROM_BUS_ATAPI)
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].ide_channel);
else if (cdrom[i].bus_type == CDROM_BUS_SCSI)
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].scsi_device_id);
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type,
cdrom[i].scsi_device_id);
else if (cdrom[i].bus_type == CDROM_BUS_MITSUMI)
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, 0);
}
ui->tableViewCDROM->resizeColumnsToContents();
ui->tableViewCDROM->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
connect(ui->tableViewCDROM->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &SettingsFloppyCDROM::onCDROMRowChanged);
connect(ui->tableViewCDROM->selectionModel(), &QItemSelectionModel::currentRowChanged,
this, &SettingsFloppyCDROM::onCDROMRowChanged);
ui->tableViewCDROM->setCurrentIndex(model->index(0, 0));
uint8_t bus_type = ui->comboBoxBus->currentData().toUInt();
int cdromIdx = ui->tableViewCDROM->selectionModel()->currentIndex().data().toInt();
auto *modelType = ui->comboBoxCDROMType->model();
int removeRows = modelType->rowCount();
int j = 0;
int selectedTypeRow = 0;
int eligibleRows = 0;
while (cdrom_drive_types[j].bus_type != BUS_TYPE_NONE) {
if (((bus_type == CDROM_BUS_ATAPI) || (bus_type == CDROM_BUS_SCSI)) &&
((cdrom_drive_types[j].bus_type == bus_type) ||
(cdrom_drive_types[j].bus_type == BUS_TYPE_BOTH))) {
QString name = tr(cdrom_getname(j));
Models::AddEntry(modelType, name, j);
if ((cdrom[cdromIdx].bus_type == bus_type) && (cdrom[cdromIdx].type == j))
selectedTypeRow = eligibleRows;
++eligibleRows;
}
++j;
}
modelType->removeRows(0, removeRows);
ui->comboBoxCDROMType->setEnabled(eligibleRows > 1);
ui->comboBoxCDROMType->setCurrentIndex(-1);
ui->comboBoxCDROMType->setCurrentIndex(selectedTypeRow);
}
SettingsFloppyCDROM::~SettingsFloppyCDROM()
@@ -234,20 +261,18 @@ SettingsFloppyCDROM::onCDROMRowChanged(const QModelIndex &current)
uint8_t bus = current.siblingAtColumn(0).data(Qt::UserRole).toUInt();
uint8_t channel = current.siblingAtColumn(0).data(Qt::UserRole + 1).toUInt();
uint8_t speed = current.siblingAtColumn(1).data(Qt::UserRole).toUInt();
int type = current.siblingAtColumn(2).data(Qt::UserRole).toInt();
int type = current.siblingAtColumn(2).data(Qt::UserRole).toInt();
ui->comboBoxBus->setCurrentIndex(-1);
auto* model = ui->comboBoxBus->model();
auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
if (! match.isEmpty()) {
if (! match.isEmpty())
ui->comboBoxBus->setCurrentIndex(match.first().row());
}
model = ui->comboBoxChannel->model();
match = model->match(model->index(0, 0), Qt::UserRole, channel);
if (!match.isEmpty()) {
if (!match.isEmpty())
ui->comboBoxChannel->setCurrentIndex(match.first().row());
}
ui->comboBoxSpeed->setCurrentIndex(speed == 0 ? 7 : speed - 1);
ui->comboBoxCDROMType->setCurrentIndex(type);
@@ -257,36 +282,37 @@ void
SettingsFloppyCDROM::on_checkBoxTurboTimings_stateChanged(int arg1)
{
auto idx = ui->tableViewFloppy->selectionModel()->currentIndex();
ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(1), arg1 == Qt::Checked ? tr("On") : tr("Off"));
ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(1), arg1 == Qt::Checked ?
tr("On") : tr("Off"));
}
void
SettingsFloppyCDROM::on_checkBoxCheckBPB_stateChanged(int arg1)
{
auto idx = ui->tableViewFloppy->selectionModel()->currentIndex();
ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(2), arg1 == Qt::Checked ? tr("On") : tr("Off"));
ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(2), arg1 == Qt::Checked ?
tr("On") : tr("Off"));
}
void
SettingsFloppyCDROM::on_comboBoxFloppyType_activated(int index)
{
setFloppyType(ui->tableViewFloppy->model(), ui->tableViewFloppy->selectionModel()->currentIndex(), index);
setFloppyType(ui->tableViewFloppy->model(),
ui->tableViewFloppy->selectionModel()->currentIndex(), index);
}
void
SettingsFloppyCDROM::on_comboBoxBus_currentIndexChanged(int index)
{
if (index < 0) {
return;
if (index >= 0) {
int bus = ui->comboBoxBus->currentData().toInt();
bool enabled = (bus != CDROM_BUS_DISABLED);
ui->comboBoxChannel->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled);
ui->comboBoxSpeed->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled);
ui->comboBoxCDROMType->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled);
Harddrives::populateBusChannels(ui->comboBoxChannel->model(), bus);
}
int bus = ui->comboBoxBus->currentData().toInt();
bool enabled = (bus != CDROM_BUS_DISABLED);
ui->comboBoxChannel->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled);
ui->comboBoxSpeed->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled);
ui->comboBoxCDROMType->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled);
Harddrives::populateBusChannels(ui->comboBoxChannel->model(), bus);
}
void
@@ -299,10 +325,13 @@ SettingsFloppyCDROM::on_comboBoxSpeed_activated(int index)
void
SettingsFloppyCDROM::on_comboBoxBus_activated(int)
{
auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0);
uint8_t bus_type = ui->comboBoxBus->currentData().toUInt();
auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0);
uint8_t bus_type = ui->comboBoxBus->currentData().toUInt();
int cdromIdx = ui->tableViewCDROM->selectionModel()->currentIndex().data().toInt();
Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt());
Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
Qt::UserRole + 1).toInt());
if (bus_type == CDROM_BUS_ATAPI)
ui->comboBoxChannel->setCurrentIndex(Harddrives::busTrackClass->next_free_ide_channel());
else if (bus_type == CDROM_BUS_SCSI)
@@ -310,38 +339,64 @@ SettingsFloppyCDROM::on_comboBoxBus_activated(int)
else if (bus_type == CDROM_BUS_MITSUMI)
ui->comboBoxChannel->setCurrentIndex(0);
setCDROMBus(
ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
bus_type,
ui->comboBoxChannel->currentData().toUInt());
setCDROMType(
ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxCDROMType->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt());
setCDROMBus(ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
bus_type,
ui->comboBoxChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
Qt::UserRole + 1).toInt());
auto *modelType = ui->comboBoxCDROMType->model();
int removeRows = modelType->rowCount();
int j = 0;
int selectedTypeRow = 0;
int eligibleRows = 0;
while (cdrom_drive_types[j].bus_type != BUS_TYPE_NONE) {
if (((bus_type == CDROM_BUS_ATAPI) || (bus_type == CDROM_BUS_SCSI)) &&
((cdrom_drive_types[j].bus_type == bus_type) ||
(cdrom_drive_types[j].bus_type == BUS_TYPE_BOTH))) {
QString name = tr(cdrom_getname(j));
Models::AddEntry(modelType, name, j);
if ((cdrom[cdromIdx].bus_type == bus_type) && (cdrom[cdromIdx].type == j))
selectedTypeRow = eligibleRows;
++eligibleRows;
}
++j;
}
modelType->removeRows(0, removeRows);
ui->comboBoxCDROMType->setEnabled(eligibleRows > 1);
ui->comboBoxCDROMType->setCurrentIndex(-1);
ui->comboBoxCDROMType->setCurrentIndex(selectedTypeRow);
setCDROMType(ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxCDROMType->currentData().toUInt());
}
void
SettingsFloppyCDROM::on_comboBoxChannel_activated(int)
{
auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt());
setCDROMBus(
ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxBus->currentData().toUInt(),
ui->comboBoxChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt());
Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
Qt::UserRole + 1).toInt());
setCDROMBus(ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxBus->currentData().toUInt(),
ui->comboBoxChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
Qt::UserRole + 1).toInt());
}
void
SettingsFloppyCDROM::on_comboBoxCDROMType_activated(int)
{
setCDROMType(
ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxCDROMType->currentData().toUInt());
setCDROMType(ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxCDROMType->currentData().toUInt());
ui->tableViewCDROM->resizeColumnsToContents();
ui->tableViewCDROM->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
}

View File

@@ -72,6 +72,21 @@ SettingsMachine::SettingsMachine(QWidget *parent)
waitStatesModel->setData(idx, i + 1, Qt::UserRole);
}
auto *pitModeModel = ui->comboBoxPitMode->model();
pitModeModel->insertRows(0, 3);
idx = pitModeModel->index(0, 0);
pitModeModel->setData(idx, tr("Auto"), Qt::DisplayRole);
pitModeModel->setData(idx, -1, Qt::UserRole);
idx = pitModeModel->index(1, 0);
pitModeModel->setData(idx, tr("Slow"), Qt::DisplayRole);
pitModeModel->setData(idx, 0, Qt::UserRole);
idx = pitModeModel->index(2, 0);
pitModeModel->setData(idx, tr("Fast"), Qt::DisplayRole);
pitModeModel->setData(idx, 1, Qt::UserRole);
ui->comboBoxPitMode->setCurrentIndex(-1);
ui->comboBoxPitMode->setCurrentIndex(pit_mode + 1);
int selectedMachineType = 0;
auto *machineTypesModel = ui->comboBoxMachineType->model();
for (int i = 1; i < MACHINE_TYPE_MAX; ++i) {
@@ -79,9 +94,8 @@ SettingsMachine::SettingsMachine(QWidget *parent)
while (machine_get_internal_name_ex(j) != nullptr) {
if (machine_available(j) && (machine_get_type(j) == i)) {
int row = Models::AddEntry(machineTypesModel, machine_types[i].name, machine_types[i].id);
if (machine_types[i].id == machine_get_type(machine)) {
if (machine_types[i].id == machine_get_type(machine))
selectedMachineType = row;
}
break;
}
j++;
@@ -113,202 +127,191 @@ SettingsMachine::save()
fpu_softfloat = ui->checkBoxFPUSoftfloat->isChecked() ? 1 : 0;
int64_t temp_mem_size;
if (machine_get_ram_granularity(machine) < 1024) {
if (machine_get_ram_granularity(machine) < 1024)
temp_mem_size = ui->spinBoxRAM->value();
} else {
else
temp_mem_size = ui->spinBoxRAM->value() * 1024;
}
temp_mem_size &= ~(machine_get_ram_granularity(machine) - 1);
if (temp_mem_size < machine_get_min_ram(machine)) {
if (temp_mem_size < machine_get_min_ram(machine))
temp_mem_size = machine_get_min_ram(machine);
} else if (temp_mem_size > machine_get_max_ram(machine)) {
else if (temp_mem_size > machine_get_max_ram(machine))
temp_mem_size = machine_get_max_ram(machine);
}
mem_size = static_cast<uint32_t>(temp_mem_size);
if (ui->comboBoxWaitStates->isEnabled()) {
if (ui->comboBoxWaitStates->isEnabled())
cpu_waitstates = ui->comboBoxWaitStates->currentData().toInt();
} else {
else
cpu_waitstates = 0;
}
pit_mode = ui->comboBoxPitMode->currentData().toInt();
time_sync = 0;
if (ui->radioButtonLocalTime->isChecked()) {
if (ui->radioButtonLocalTime->isChecked())
time_sync = TIME_SYNC_ENABLED;
}
if (ui->radioButtonUTC->isChecked()) {
if (ui->radioButtonUTC->isChecked())
time_sync = TIME_SYNC_ENABLED | TIME_SYNC_UTC;
}
}
void
SettingsMachine::on_comboBoxMachineType_currentIndexChanged(int index)
{
if (index < 0) {
return;
}
if (index >= 0) {
auto *model = ui->comboBoxMachine->model();
int removeRows = model->rowCount();
auto *model = ui->comboBoxMachine->model();
int removeRows = model->rowCount();
int selectedMachineRow = 0;
for (int i = 0; i < machine_count(); ++i) {
if ((machine_get_type(i) == ui->comboBoxMachineType->currentData().toInt()) && machine_available(i)) {
int row = Models::AddEntry(model, machines[i].name, i);
if (i == machine) {
selectedMachineRow = row - removeRows;
int selectedMachineRow = 0;
for (int i = 0; i < machine_count(); ++i) {
if ((machine_get_type(i) == ui->comboBoxMachineType->currentData().toInt()) &&
machine_available(i)) {
int row = Models::AddEntry(model, machines[i].name, i);
if (i == machine)
selectedMachineRow = row - removeRows;
}
}
}
model->removeRows(0, removeRows);
model->removeRows(0, removeRows);
ui->comboBoxMachine->setCurrentIndex(-1);
ui->comboBoxMachine->setCurrentIndex(selectedMachineRow);
ui->comboBoxMachine->setCurrentIndex(-1);
ui->comboBoxMachine->setCurrentIndex(selectedMachineRow);
}
}
void
SettingsMachine::on_comboBoxMachine_currentIndexChanged(int index)
{
// win_settings_machine_recalc_machine
if (index < 0) {
return;
}
if (index >= 0) {
int machineId = ui->comboBoxMachine->currentData().toInt();
const auto *device = machine_get_device(machineId);
ui->pushButtonConfigure->setEnabled((device != nullptr) && (device->config != nullptr));
int machineId = ui->comboBoxMachine->currentData().toInt();
const auto *device = machine_get_device(machineId);
ui->pushButtonConfigure->setEnabled((device != nullptr) && (device->config != nullptr));
auto *modelCpu = ui->comboBoxCPU->model();
int removeRows = modelCpu->rowCount();
auto *modelCpu = ui->comboBoxCPU->model();
int removeRows = modelCpu->rowCount();
int i = 0;
int eligibleRows = 0;
int selectedCpuFamilyRow = 0;
while (cpu_families[i].package != 0) {
if (cpu_family_is_eligible(&cpu_families[i], machineId)) {
Models::AddEntry(modelCpu, QString("%1 %2").arg(cpu_families[i].manufacturer, cpu_families[i].name), i);
if (&cpu_families[i] == cpu_f) {
selectedCpuFamilyRow = eligibleRows;
int i = 0;
int eligibleRows = 0;
int selectedCpuFamilyRow = 0;
while (cpu_families[i].package != 0) {
if (cpu_family_is_eligible(&cpu_families[i], machineId)) {
Models::AddEntry(modelCpu, QString("%1 %2").arg(cpu_families[i].manufacturer,
cpu_families[i].name), i);
if (&cpu_families[i] == cpu_f)
selectedCpuFamilyRow = eligibleRows;
++eligibleRows;
}
++eligibleRows;
++i;
}
++i;
}
modelCpu->removeRows(0, removeRows);
ui->comboBoxCPU->setEnabled(eligibleRows > 1);
ui->comboBoxCPU->setCurrentIndex(-1);
ui->comboBoxCPU->setCurrentIndex(selectedCpuFamilyRow);
modelCpu->removeRows(0, removeRows);
ui->comboBoxCPU->setEnabled(eligibleRows > 1);
ui->comboBoxCPU->setCurrentIndex(-1);
ui->comboBoxCPU->setCurrentIndex(selectedCpuFamilyRow);
int divisor;
if (machine_get_ram_granularity(machineId) < 1024) {
divisor = 1;
ui->spinBoxRAM->setSuffix(QCoreApplication::translate("", "KB").prepend(' '));
} else {
divisor = 1024;
ui->spinBoxRAM->setSuffix(QCoreApplication::translate("", "MB").prepend(' '));
}
ui->spinBoxRAM->setMinimum(machine_get_min_ram(machineId) / divisor);
ui->spinBoxRAM->setMaximum(machine_get_max_ram(machineId) / divisor);
ui->spinBoxRAM->setSingleStep(machine_get_ram_granularity(machineId) / divisor);
ui->spinBoxRAM->setValue(mem_size / divisor);
ui->spinBoxRAM->setEnabled(machine_get_min_ram(machineId) != machine_get_max_ram(machineId));
int divisor;
if (machine_get_ram_granularity(machineId) < 1024) {
divisor = 1;
ui->spinBoxRAM->setSuffix(QCoreApplication::translate("", "KB").prepend(' '));
} else {
divisor = 1024;
ui->spinBoxRAM->setSuffix(QCoreApplication::translate("", "MB").prepend(' '));
}
ui->spinBoxRAM->setMinimum(machine_get_min_ram(machineId) / divisor);
ui->spinBoxRAM->setMaximum(machine_get_max_ram(machineId) / divisor);
ui->spinBoxRAM->setSingleStep(machine_get_ram_granularity(machineId) / divisor);
ui->spinBoxRAM->setValue(mem_size / divisor);
ui->spinBoxRAM->setEnabled(machine_get_min_ram(machineId) != machine_get_max_ram(machineId));
emit currentMachineChanged(machineId);
emit currentMachineChanged(machineId);
}
}
void
SettingsMachine::on_comboBoxCPU_currentIndexChanged(int index)
{
if (index < 0) {
return;
}
if (index >= 0) {
int machineId = ui->comboBoxMachine->currentData().toInt();
int cpuFamilyId = ui->comboBoxCPU->currentData().toInt();
const auto *cpuFamily = &cpu_families[cpuFamilyId];
int machineId = ui->comboBoxMachine->currentData().toInt();
int cpuFamilyId = ui->comboBoxCPU->currentData().toInt();
const auto *cpuFamily = &cpu_families[cpuFamilyId];
auto *modelSpeed = ui->comboBoxSpeed->model();
int removeRows = modelSpeed->rowCount();
auto *modelSpeed = ui->comboBoxSpeed->model();
int removeRows = modelSpeed->rowCount();
// win_settings_machine_recalc_cpu_m
int i = 0;
int eligibleRows = 0;
int selectedSpeedRow = 0;
while (cpuFamily->cpus[i].cpu_type != 0) {
if (cpu_is_eligible(cpuFamily, i, machineId)) {
Models::AddEntry(modelSpeed, QString("%1").arg(cpuFamily->cpus[i].name), i);
if (cpu == i) {
selectedSpeedRow = eligibleRows;
// win_settings_machine_recalc_cpu_m
int i = 0;
int eligibleRows = 0;
int selectedSpeedRow = 0;
while (cpuFamily->cpus[i].cpu_type != 0) {
if (cpu_is_eligible(cpuFamily, i, machineId)) {
Models::AddEntry(modelSpeed, QString("%1").arg(cpuFamily->cpus[i].name), i);
if (cpu == i)
selectedSpeedRow = eligibleRows;
++eligibleRows;
}
++eligibleRows;
++i;
}
++i;
modelSpeed->removeRows(0, removeRows);
ui->comboBoxSpeed->setEnabled(eligibleRows > 1);
ui->comboBoxSpeed->setCurrentIndex(-1);
ui->comboBoxSpeed->setCurrentIndex(selectedSpeedRow);
}
modelSpeed->removeRows(0, removeRows);
ui->comboBoxSpeed->setEnabled(eligibleRows > 1);
ui->comboBoxSpeed->setCurrentIndex(-1);
ui->comboBoxSpeed->setCurrentIndex(selectedSpeedRow);
}
void
SettingsMachine::on_comboBoxSpeed_currentIndexChanged(int index)
{
if (index < 0) {
return;
}
if (index >= 0) {
// win_settings_machine_recalc_cpu
int cpuFamilyId = ui->comboBoxCPU->currentData().toInt();
const auto *cpuFamily = &cpu_families[cpuFamilyId];
int cpuId = ui->comboBoxSpeed->currentData().toInt();
uint cpuType = cpuFamily->cpus[cpuId].cpu_type;
// win_settings_machine_recalc_cpu
int cpuFamilyId = ui->comboBoxCPU->currentData().toInt();
const auto *cpuFamily = &cpu_families[cpuFamilyId];
int cpuId = ui->comboBoxSpeed->currentData().toInt();
uint cpuType = cpuFamily->cpus[cpuId].cpu_type;
if ((cpuType >= CPU_286) && (cpuType <= CPU_386DX)) {
ui->comboBoxWaitStates->setEnabled(true);
ui->comboBoxWaitStates->setCurrentIndex(cpu_waitstates);
} else {
ui->comboBoxWaitStates->setCurrentIndex(0);
ui->comboBoxWaitStates->setEnabled(false);
}
if ((cpuType >= CPU_286) && (cpuType <= CPU_386DX)) {
ui->comboBoxWaitStates->setEnabled(true);
ui->comboBoxWaitStates->setCurrentIndex(cpu_waitstates);
} else {
ui->comboBoxWaitStates->setCurrentIndex(0);
ui->comboBoxWaitStates->setEnabled(false);
}
#ifdef USE_DYNAREC
uint8_t flags = cpuFamily->cpus[cpuId].cpu_flags;
if (!(flags & CPU_SUPPORTS_DYNAREC)) {
ui->checkBoxDynamicRecompiler->setChecked(false);
ui->checkBoxDynamicRecompiler->setEnabled(false);
} else if (flags & CPU_REQUIRES_DYNAREC) {
ui->checkBoxDynamicRecompiler->setChecked(true);
ui->checkBoxDynamicRecompiler->setEnabled(false);
} else {
ui->checkBoxDynamicRecompiler->setChecked(cpu_use_dynarec);
ui->checkBoxDynamicRecompiler->setEnabled(true);
}
uint8_t flags = cpuFamily->cpus[cpuId].cpu_flags;
if (!(flags & CPU_SUPPORTS_DYNAREC)) {
ui->checkBoxDynamicRecompiler->setChecked(false);
ui->checkBoxDynamicRecompiler->setEnabled(false);
} else if (flags & CPU_REQUIRES_DYNAREC) {
ui->checkBoxDynamicRecompiler->setChecked(true);
ui->checkBoxDynamicRecompiler->setEnabled(false);
} else {
ui->checkBoxDynamicRecompiler->setChecked(cpu_use_dynarec);
ui->checkBoxDynamicRecompiler->setEnabled(true);
}
#endif
// win_settings_machine_recalc_fpu
int machineId = ui->comboBoxMachine->currentData().toInt();
auto *modelFpu = ui->comboBoxFPU->model();
int removeRows = modelFpu->rowCount();
// win_settings_machine_recalc_fpu
int machineId = ui->comboBoxMachine->currentData().toInt();
auto *modelFpu = ui->comboBoxFPU->model();
int removeRows = modelFpu->rowCount();
int i = 0;
int selectedFpuRow = 0;
for (const char *fpuName = fpu_get_name_from_index(cpuFamily, cpuId, i); fpuName != nullptr; fpuName = fpu_get_name_from_index(cpuFamily, cpuId, ++i)) {
auto fpuType = fpu_get_type_from_index(cpuFamily, cpuId, i);
Models::AddEntry(modelFpu, QString("%1").arg(fpuName), fpuType);
if (fpu_type == fpuType) {
selectedFpuRow = i;
int i = 0;
int selectedFpuRow = 0;
for (const char *fpuName = fpu_get_name_from_index(cpuFamily, cpuId, i);
fpuName != nullptr; fpuName = fpu_get_name_from_index(cpuFamily, cpuId, ++i)) {
auto fpuType = fpu_get_type_from_index(cpuFamily, cpuId, i);
Models::AddEntry(modelFpu, QString("%1").arg(fpuName), fpuType);
if (fpu_type == fpuType)
selectedFpuRow = i;
}
modelFpu->removeRows(0, removeRows);
ui->comboBoxFPU->setEnabled(modelFpu->rowCount() > 1);
ui->comboBoxFPU->setCurrentIndex(-1);
ui->comboBoxFPU->setCurrentIndex(selectedFpuRow);
ui->checkBoxFPUSoftfloat->setChecked(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ?
true : fpu_softfloat);
ui->checkBoxFPUSoftfloat->setEnabled(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ?
false : true);
}
modelFpu->removeRows(0, removeRows);
ui->comboBoxFPU->setEnabled(modelFpu->rowCount() > 1);
ui->comboBoxFPU->setCurrentIndex(-1);
ui->comboBoxFPU->setCurrentIndex(selectedFpuRow);
ui->checkBoxFPUSoftfloat->setChecked(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ? true : fpu_softfloat);
ui->checkBoxFPUSoftfloat->setEnabled(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ? false : true);
}
void

View File

@@ -41,6 +41,192 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>CPU type:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxCPU">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Speed:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxSpeed">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="6" column="1">
<widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxFPU">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Wait states:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxWaitStates">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>PIT mode:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxPitMode">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Memory:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxRAM">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxMachineType"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>FPU:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@@ -48,9 +234,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxMachineType"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@@ -92,125 +275,51 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>CPU type:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxCPU">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Speed:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxSpeed">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>FPU:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxFPU"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Wait states:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxWaitStates"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Memory:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="spinBoxRAM">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDynamicRecompiler">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>2</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Dynamic Recompiler</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxFPUSoftfloat">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>3</horstretch>
<verstretch>3</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Softfloat FPU</string>
</property>
<widget class="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="checkBoxDynamicRecompiler">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>2</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Dynamic Recompiler</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxFPUSoftfloat">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>3</horstretch>
<verstretch>3</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>SoftFloat FPU</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>

View File

@@ -36,7 +36,8 @@ extern "C" {
static QString
moDriveTypeName(int i)
{
return QString("%1 %2 %3").arg(mo_drive_types[i].vendor, mo_drive_types[i].model, mo_drive_types[i].revision);
return QString("%1 %2 %3").arg(mo_drive_types[i].vendor, mo_drive_types[i].model,
mo_drive_types[i].revision);
}
static void
@@ -64,11 +65,10 @@ static void
setMOType(QAbstractItemModel *model, const QModelIndex &idx, uint32_t type)
{
auto i = idx.siblingAtColumn(1);
if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == MO_BUS_DISABLED) {
if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == MO_BUS_DISABLED)
model->setData(i, QCoreApplication::translate("", "None"));
} else {
else
model->setData(i, moDriveTypeName(type));
}
model->setData(i, type, Qt::UserRole);
}
@@ -187,15 +187,13 @@ SettingsOtherRemovable::onMORowChanged(const QModelIndex &current)
ui->comboBoxMOBus->setCurrentIndex(-1);
auto *model = ui->comboBoxMOBus->model();
auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
if (!match.isEmpty()) {
if (!match.isEmpty())
ui->comboBoxMOBus->setCurrentIndex(match.first().row());
}
model = ui->comboBoxMOChannel->model();
match = model->match(model->index(0, 0), Qt::UserRole, channel);
if (!match.isEmpty()) {
if (!match.isEmpty())
ui->comboBoxMOChannel->setCurrentIndex(match.first().row());
}
ui->comboBoxMOType->setCurrentIndex(type);
}
@@ -209,73 +207,75 @@ SettingsOtherRemovable::onZIPRowChanged(const QModelIndex &current)
ui->comboBoxZIPBus->setCurrentIndex(-1);
auto *model = ui->comboBoxZIPBus->model();
auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
if (!match.isEmpty()) {
if (!match.isEmpty())
ui->comboBoxZIPBus->setCurrentIndex(match.first().row());
}
model = ui->comboBoxZIPChannel->model();
match = model->match(model->index(0, 0), Qt::UserRole, channel);
if (!match.isEmpty()) {
if (!match.isEmpty())
ui->comboBoxZIPChannel->setCurrentIndex(match.first().row());
}
ui->checkBoxZIP250->setChecked(is250);
}
void
SettingsOtherRemovable::on_comboBoxMOBus_currentIndexChanged(int index)
{
if (index < 0) {
return;
if (index >= 0) {
int bus = ui->comboBoxMOBus->currentData().toInt();
bool enabled = (bus != MO_BUS_DISABLED);
ui->comboBoxMOChannel->setEnabled(enabled);
ui->comboBoxMOType->setEnabled(enabled);
Harddrives::populateBusChannels(ui->comboBoxMOChannel->model(), bus);
}
int bus = ui->comboBoxMOBus->currentData().toInt();
bool enabled = (bus != MO_BUS_DISABLED);
ui->comboBoxMOChannel->setEnabled(enabled);
ui->comboBoxMOType->setEnabled(enabled);
Harddrives::populateBusChannels(ui->comboBoxMOChannel->model(), bus);
}
void
SettingsOtherRemovable::on_comboBoxMOBus_activated(int)
{
auto i = ui->tableViewMO->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt());
ui->comboBoxMOChannel->setCurrentIndex(ui->comboBoxMOBus->currentData().toUInt() == MO_BUS_ATAPI ? Harddrives::busTrackClass->next_free_ide_channel() : Harddrives::busTrackClass->next_free_scsi_id());
Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
Qt::UserRole + 1).toInt());
ui->comboBoxMOChannel->setCurrentIndex(ui->comboBoxMOBus->currentData().toUInt() ==
MO_BUS_ATAPI ? Harddrives::busTrackClass->next_free_ide_channel() :
Harddrives::busTrackClass->next_free_scsi_id());
ui->tableViewMO->model()->data(i, Qt::UserRole + 1);
setMOBus(
ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOBus->currentData().toUInt(),
ui->comboBoxMOChannel->currentData().toUInt());
setMOType(
ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOType->currentData().toUInt());
setMOBus(ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOBus->currentData().toUInt(),
ui->comboBoxMOChannel->currentData().toUInt());
setMOType(ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOType->currentData().toUInt());
ui->tableViewMO->resizeColumnsToContents();
ui->tableViewMO->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt());
Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
Qt::UserRole + 1).toInt());
}
void
SettingsOtherRemovable::on_comboBoxMOChannel_activated(int)
{
auto i = ui->tableViewMO->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt());
setMOBus(
ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOBus->currentData().toUInt(),
ui->comboBoxMOChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt());
Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
Qt::UserRole + 1).toInt());
setMOBus(ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOBus->currentData().toUInt(),
ui->comboBoxMOChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
Qt::UserRole + 1).toInt());
}
void
SettingsOtherRemovable::on_comboBoxMOType_activated(int)
{
setMOType(
ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOType->currentData().toUInt());
setMOType(ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOType->currentData().toUInt());
ui->tableViewMO->resizeColumnsToContents();
ui->tableViewMO->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
}
@@ -283,49 +283,54 @@ SettingsOtherRemovable::on_comboBoxMOType_activated(int)
void
SettingsOtherRemovable::on_comboBoxZIPBus_currentIndexChanged(int index)
{
if (index < 0) {
return;
if (index >= 0) {
int bus = ui->comboBoxZIPBus->currentData().toInt();
bool enabled = (bus != ZIP_BUS_DISABLED);
ui->comboBoxZIPChannel->setEnabled(enabled);
ui->checkBoxZIP250->setEnabled(enabled);
Harddrives::populateBusChannels(ui->comboBoxZIPChannel->model(), bus);
}
int bus = ui->comboBoxZIPBus->currentData().toInt();
bool enabled = (bus != ZIP_BUS_DISABLED);
ui->comboBoxZIPChannel->setEnabled(enabled);
ui->checkBoxZIP250->setEnabled(enabled);
Harddrives::populateBusChannels(ui->comboBoxZIPChannel->model(), bus);
}
void
SettingsOtherRemovable::on_comboBoxZIPBus_activated(int)
{
auto i = ui->tableViewZIP->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt());
ui->comboBoxZIPChannel->setCurrentIndex(ui->comboBoxZIPBus->currentData().toUInt() == ZIP_BUS_ATAPI ? Harddrives::busTrackClass->next_free_ide_channel() : Harddrives::busTrackClass->next_free_scsi_id());
setZIPBus(
ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(),
ui->comboBoxZIPBus->currentData().toUInt(),
ui->comboBoxZIPChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt());
Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i,
Qt::UserRole + 1).toInt());
ui->comboBoxZIPChannel->setCurrentIndex(ui->comboBoxZIPBus->currentData().toUInt() == ZIP_BUS_ATAPI ?
Harddrives::busTrackClass->next_free_ide_channel() :
Harddrives::busTrackClass->next_free_scsi_id());
setZIPBus(ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(),
ui->comboBoxZIPBus->currentData().toUInt(),
ui->comboBoxZIPChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i,
Qt::UserRole + 1).toInt());
}
void
SettingsOtherRemovable::on_comboBoxZIPChannel_activated(int)
{
auto i = ui->tableViewZIP->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt());
setZIPBus(
ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(),
ui->comboBoxZIPBus->currentData().toUInt(),
ui->comboBoxZIPChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt());
Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i,
Qt::UserRole + 1).toInt());
setZIPBus(ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(),
ui->comboBoxZIPBus->currentData().toUInt(),
ui->comboBoxZIPChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i,
Qt::UserRole).toInt(),
ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt());
}
void
SettingsOtherRemovable::on_checkBoxZIP250_stateChanged(int state)
{
setZIPType(
ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(),
state == Qt::Checked);
setZIPType(ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(),
state == Qt::Checked);
}