From b7992cc084dbf0c3f879797d3a879999bb6f0591 Mon Sep 17 00:00:00 2001 From: Adrian Siekierka Date: Sat, 2 Oct 2021 12:06:22 +0200 Subject: Fallback to FreeBIOS when BIOS files are not found. (v2) (#1174) * Fallback to FreeBIOS when BIOS files are not found. * Add sources of drastic bios files. * Move FreeBIOS/external BIOS choice to configuration option/checkbox. * Fix indentation Co-authored-by: Filippo Scognamiglio Co-authored-by: Filippo Scognamiglio --- src/frontend/qt_sdl/EmuSettingsDialog.cpp | 13 ++++ src/frontend/qt_sdl/EmuSettingsDialog.h | 1 + src/frontend/qt_sdl/EmuSettingsDialog.ui | 123 ++++++++++++++++-------------- 3 files changed, 79 insertions(+), 58 deletions(-) (limited to 'src/frontend/qt_sdl') diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.cpp b/src/frontend/qt_sdl/EmuSettingsDialog.cpp index dd8ec1e..b7de274 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.cpp +++ b/src/frontend/qt_sdl/EmuSettingsDialog.cpp @@ -41,9 +41,11 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); + ui->chkExternalBIOS->setChecked(Config::ExternalBIOSEnable != 0); ui->txtBIOS9Path->setText(Config::BIOS9Path); ui->txtBIOS7Path->setText(Config::BIOS7Path); ui->txtFirmwarePath->setText(Config::FirmwarePath); + ui->cbDLDIEnable->setChecked(Config::DLDIEnable != 0); ui->txtDLDISDPath->setText(Config::DLDISDPath); @@ -78,6 +80,7 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new #endif on_chkEnableJIT_toggled(); + on_chkExternalBIOS_toggled(); } EmuSettingsDialog::~EmuSettingsDialog() @@ -145,6 +148,7 @@ void EmuSettingsDialog::done(int r) int jitLiteralOptimisations = ui->chkJITLiteralOptimisations->isChecked() ? 1:0; int jitFastMemory = ui->chkJITFastMemory->isChecked() ? 1:0; + int externalBiosEnable = ui->chkExternalBIOS->isChecked() ? 1:0; std::string bios9Path = ui->txtBIOS9Path->text().toStdString(); std::string bios7Path = ui->txtBIOS7Path->text().toStdString(); std::string firmwarePath = ui->txtFirmwarePath->text().toStdString(); @@ -166,6 +170,7 @@ void EmuSettingsDialog::done(int r) || jitLiteralOptimisations != Config::JIT_LiteralOptimisations || jitFastMemory != Config::JIT_FastMemory #endif + || externalBiosEnable != Config::ExternalBIOSEnable || strcmp(Config::BIOS9Path, bios9Path.c_str()) != 0 || strcmp(Config::BIOS7Path, bios7Path.c_str()) != 0 || strcmp(Config::FirmwarePath, firmwarePath.c_str()) != 0 @@ -184,6 +189,7 @@ void EmuSettingsDialog::done(int r) QMessageBox::Ok, QMessageBox::Cancel) != QMessageBox::Ok) return; + Config::ExternalBIOSEnable = externalBiosEnable; strncpy(Config::BIOS9Path, bios9Path.c_str(), 1023); Config::BIOS9Path[1023] = '\0'; strncpy(Config::BIOS7Path, bios7Path.c_str(), 1023); Config::BIOS7Path[1023] = '\0'; strncpy(Config::FirmwarePath, firmwarePath.c_str(), 1023); Config::FirmwarePath[1023] = '\0'; @@ -337,3 +343,10 @@ void EmuSettingsDialog::on_chkEnableJIT_toggled() #endif ui->spnJITMaximumBlockSize->setDisabled(disabled); } + +void EmuSettingsDialog::on_chkExternalBIOS_toggled() +{ + bool disabled = !ui->chkExternalBIOS->isChecked(); + ui->txtBIOS7Path->setDisabled(disabled); + ui->txtBIOS9Path->setDisabled(disabled); +} diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.h b/src/frontend/qt_sdl/EmuSettingsDialog.h index d24a9f2..b650959 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.h +++ b/src/frontend/qt_sdl/EmuSettingsDialog.h @@ -67,6 +67,7 @@ private slots: void on_btnDSiSDBrowse_clicked(); void on_chkEnableJIT_toggled(); + void on_chkExternalBIOS_toggled(); private: void verifyFirmware(); diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.ui b/src/frontend/qt_sdl/EmuSettingsDialog.ui index e670c88..41b6e6e 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.ui +++ b/src/frontend/qt_sdl/EmuSettingsDialog.ui @@ -7,7 +7,7 @@ 0 0 575 - 254 + 260 @@ -26,7 +26,7 @@ - 0 + 1 @@ -89,105 +89,112 @@ DS-mode - - - - <html><head/><body><p>DS-mode ARM7 BIOS</p><p>Size should be 16 KB</p></body></html> + + + + Browse... - - - - <html><head/><body><p>DS-mode firmware</p><p><br/></p><p>Possible firmwares:</p><p>* 128 KB: DS-mode firmware from a DSi or 3DS. Not bootable.</p><p>* 256 KB: regular DS firmware.</p><p>* 512 KB: iQue DS firmware.</p></body></html> + + + + Qt::Vertical - + + + 20 + 40 + + + - + DS firmware: - - - - DS ARM7 BIOS: - - - - - - - Browse... - - - - + Browse... - - + + - + 0 0 + + + 290 + 0 + + + + + + + <html><head/><body><p>DS-mode ARM9 BIOS</p><p>Size should be 4 KB</p></body></html> + + + + + - Browse... + DS ARM7 BIOS: - - true + + + + + + <html><head/><body><p>DS-mode ARM7 BIOS</p><p>Size should be 16 KB</p></body></html> - + + + + <html><head/><body><p>DS-mode firmware</p><p><br/></p><p>Possible firmwares:</p><p>* 128 KB: DS-mode firmware from a DSi or 3DS. Not bootable.</p><p>* 256 KB: regular DS firmware.</p><p>* 512 KB: iQue DS firmware.</p></body></html> + + + + DS ARM9 BIOS: - - + + - + 0 0 - - - 290 - 0 - - - - + + Browse... - - <html><head/><body><p>DS-mode ARM9 BIOS</p><p>Size should be 4 KB</p></body></html> + + true - - - - Qt::Vertical - - - - 20 - 40 - + + + + Use external BIOS files - + -- cgit v1.2.3