aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl
diff options
context:
space:
mode:
authorAdrian Siekierka <kontakt@asie.pl>2021-10-02 12:06:22 +0200
committerGitHub <noreply@github.com>2021-10-02 12:06:22 +0200
commitb7992cc084dbf0c3f879797d3a879999bb6f0591 (patch)
tree8636926c8b951c10b8bd5e3258649ff7637c14bf /src/frontend/qt_sdl
parent243077722b4c292c424de680c13eacf9296fe552 (diff)
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>
Diffstat (limited to 'src/frontend/qt_sdl')
-rw-r--r--src/frontend/qt_sdl/EmuSettingsDialog.cpp13
-rw-r--r--src/frontend/qt_sdl/EmuSettingsDialog.h1
-rw-r--r--src/frontend/qt_sdl/EmuSettingsDialog.ui123
3 files changed, 79 insertions, 58 deletions
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 @@
<x>0</x>
<y>0</y>
<width>575</width>
- <height>254</height>
+ <height>260</height>
</rect>
</property>
<property name="sizePolicy">
@@ -26,7 +26,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@@ -89,105 +89,112 @@
<string>DS-mode</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
- <item row="1" column="1">
- <widget class="QPathInput" name="txtBIOS7Path">
- <property name="whatsThis">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DS-mode ARM7 BIOS&lt;/p&gt;&lt;p&gt;Size should be 16 KB&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <item row="3" column="2">
+ <widget class="QPushButton" name="btnFirmwareBrowse">
+ <property name="text">
+ <string>Browse...</string>
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QPathInput" name="txtFirmwarePath">
- <property name="whatsThis">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DS-mode firmware&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Possible firmwares:&lt;/p&gt;&lt;p&gt;* 128 KB: DS-mode firmware from a DSi or 3DS. Not bootable.&lt;/p&gt;&lt;p&gt;* 256 KB: regular DS firmware.&lt;/p&gt;&lt;p&gt;* 512 KB: iQue DS firmware.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <item row="4" column="0">
+ <spacer name="verticalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- </widget>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>DS firmware:</string>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>DS ARM7 BIOS:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QPushButton" name="btnBIOS7Browse">
- <property name="text">
- <string>Browse...</string>
- </property>
- </widget>
- </item>
<item row="2" column="2">
- <widget class="QPushButton" name="btnFirmwareBrowse">
+ <widget class="QPushButton" name="btnBIOS7Browse">
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QPushButton" name="btnBIOS9Browse">
+ <item row="1" column="1">
+ <widget class="QPathInput" name="txtBIOS9Path">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>290</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="statusTip">
+ <string/>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DS-mode ARM9 BIOS&lt;/p&gt;&lt;p&gt;Size should be 4 KB&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_2">
<property name="text">
- <string>Browse...</string>
+ <string>DS ARM7 BIOS:</string>
</property>
- <property name="autoDefault">
- <bool>true</bool>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QPathInput" name="txtBIOS7Path">
+ <property name="whatsThis">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DS-mode ARM7 BIOS&lt;/p&gt;&lt;p&gt;Size should be 16 KB&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
- <item row="0" column="0">
+ <item row="3" column="1">
+ <widget class="QPathInput" name="txtFirmwarePath">
+ <property name="whatsThis">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DS-mode firmware&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Possible firmwares:&lt;/p&gt;&lt;p&gt;* 128 KB: DS-mode firmware from a DSi or 3DS. Not bootable.&lt;/p&gt;&lt;p&gt;* 256 KB: regular DS firmware.&lt;/p&gt;&lt;p&gt;* 512 KB: iQue DS firmware.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>DS ARM9 BIOS:</string>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QPathInput" name="txtBIOS9Path">
+ <item row="1" column="2">
+ <widget class="QPushButton" name="btnBIOS9Browse">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
- <size>
- <width>290</width>
- <height>0</height>
- </size>
- </property>
- <property name="statusTip">
- <string/>
+ <property name="text">
+ <string>Browse...</string>
</property>
- <property name="whatsThis">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DS-mode ARM9 BIOS&lt;/p&gt;&lt;p&gt;Size should be 4 KB&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <property name="autoDefault">
+ <bool>true</bool>
</property>
</widget>
</item>
- <item row="3" column="0">
- <spacer name="verticalSpacer_5">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
+ <item row="0" column="0" colspan="3">
+ <widget class="QCheckBox" name="chkExternalBIOS">
+ <property name="text">
+ <string>Use external BIOS files</string>
</property>
- </spacer>
+ </widget>
</item>
</layout>
</widget>