mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
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 <flscogna@gmail.com> Co-authored-by: Filippo Scognamiglio <filippo.scognamiglio@felgo.com>
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user