MKE CD-ROM: Fix disc change detection, move model selection to CD-ROM type, and properly implement support for the up to 4 drives supported by the controller.

This commit is contained in:
OBattler
2025-07-29 22:40:02 +02:00
parent 12deafbe1d
commit c675da4de7
15 changed files with 521 additions and 300 deletions

View File

@@ -32,6 +32,7 @@ Harddrives::populateBuses(QAbstractItemModel *model)
{
model->removeRows(0, model->rowCount());
model->insertRows(0, 6);
model->setData(model->index(0, 0), "MFM/RLL");
model->setData(model->index(1, 0), "XTA");
model->setData(model->index(2, 0), "ESDI");
@@ -48,7 +49,7 @@ Harddrives::populateBuses(QAbstractItemModel *model)
}
void
Harddrives::populateRemovableBuses(QAbstractItemModel *model)
Harddrives::populateCDROMBuses(QAbstractItemModel *model)
{
model->removeRows(0, model->rowCount());
#ifdef USE_CDROM_MITSUMI
@@ -56,6 +57,7 @@ Harddrives::populateRemovableBuses(QAbstractItemModel *model)
#else
model->insertRows(0, 4);
#endif
model->setData(model->index(0, 0), QObject::tr("Disabled"));
model->setData(model->index(1, 0), QObject::tr("ATAPI"));
model->setData(model->index(2, 0), QObject::tr("SCSI"));
@@ -77,6 +79,21 @@ Harddrives::populateRemovableBuses(QAbstractItemModel *model)
#endif
}
void
Harddrives::populateRemovableBuses(QAbstractItemModel *model)
{
model->removeRows(0, model->rowCount());
model->insertRows(0, 3);
model->setData(model->index(0, 0), QObject::tr("Disabled"));
model->setData(model->index(1, 0), QObject::tr("ATAPI"));
model->setData(model->index(2, 0), QObject::tr("SCSI"));
model->setData(model->index(0, 0), HDD_BUS_DISABLED, Qt::UserRole);
model->setData(model->index(1, 0), HDD_BUS_ATAPI, Qt::UserRole);
model->setData(model->index(2, 0), HDD_BUS_SCSI, Qt::UserRole);
}
void
Harddrives::populateSpeeds(QAbstractItemModel *model, int bus)
{
@@ -144,6 +161,12 @@ Harddrives::populateBusChannels(QAbstractItemModel *model, int bus, SettingsBusT
subChannelWidth = 2;
busesToCheck.append(HDD_BUS_SCSI);
break;
case CDROM_BUS_MKE:
shifter = 2;
orer = 3;
busRows = 4;
busesToCheck.append(CDROM_BUS_MKE);
break;
default:
break;
}
@@ -192,11 +215,11 @@ Harddrives::BusChannelName(uint8_t bus, uint8_t channel)
case HDD_BUS_SCSI:
busName = QString("SCSI (%1:%2)").arg(channel >> 4).arg(channel & 15, 2, 10, QChar('0'));
break;
case CDROM_BUS_MITSUMI:
busName = QString("Mitsumi");
break;
case CDROM_BUS_MITSUMI:
busName = QString("Mitsumi");
break;
case CDROM_BUS_MKE:
busName = QString("Panasonic/MKE");
busName = QString("Panasonic/MKE (%1:%2)").arg(channel >> 2).arg(channel & 3);
break;
}