From fbb41bd73db13d6ae062f6aeee129e8036459b89 Mon Sep 17 00:00:00 2001
From: PoroCYon <3253268+PoroCYon@users.noreply.github.com>
Date: Sun, 16 Jul 2023 02:40:50 +0200
Subject: DSi: add option to boot the full boot ROMs (#1581)
* DSi: add option to boot the full boot ROMs
added a config option for this so that this can be enabled or disabled
also added IO regs for DSi GPIO, but those don't do anything yet.
* reset GPIO regs on reset
---
src/frontend/qt_sdl/Config.cpp | 4 +
src/frontend/qt_sdl/Config.h | 2 +
src/frontend/qt_sdl/EmuSettingsDialog.cpp | 5 +
src/frontend/qt_sdl/EmuSettingsDialog.ui | 180 ++++++++++++++++--------------
src/frontend/qt_sdl/Platform.cpp | 1 +
5 files changed, 107 insertions(+), 85 deletions(-)
(limited to 'src/frontend/qt_sdl')
diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp
index a32e172..afdaaee 100644
--- a/src/frontend/qt_sdl/Config.cpp
+++ b/src/frontend/qt_sdl/Config.cpp
@@ -143,6 +143,8 @@ bool DSBatteryLevelOkay;
int DSiBatteryLevel;
bool DSiBatteryCharging;
+bool DSiFullBIOSBoot;
+
CameraConfig Camera[2];
@@ -332,6 +334,8 @@ ConfigEntry ConfigFile[] =
{"DSiBatteryLevel", 0, &DSiBatteryLevel, 0xF, true},
{"DSiBatteryCharging", 1, &DSiBatteryCharging, true, true},
+ {"DSiFullBIOSBoot", 1, &DSiFullBIOSBoot, false, true},
+
// TODO!!
// we need a more elegant way to deal with this
{"Camera0_InputType", 0, &Camera[0].InputType, 0, false},
diff --git a/src/frontend/qt_sdl/Config.h b/src/frontend/qt_sdl/Config.h
index c6fd297..b2b56f2 100644
--- a/src/frontend/qt_sdl/Config.h
+++ b/src/frontend/qt_sdl/Config.h
@@ -199,6 +199,8 @@ extern bool DSBatteryLevelOkay;
extern int DSiBatteryLevel;
extern bool DSiBatteryCharging;
+extern bool DSiFullBIOSBoot;
+
extern CameraConfig Camera[2];
diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.cpp b/src/frontend/qt_sdl/EmuSettingsDialog.cpp
index 78d2ac3..b984e05 100644
--- a/src/frontend/qt_sdl/EmuSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/EmuSettingsDialog.cpp
@@ -122,6 +122,8 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new
ui->txtDLDIFolder->setText(QString::fromStdString(Config::DLDIFolderPath));
on_cbDLDIEnable_toggled();
+ ui->cbDSiFullBIOSBoot->setChecked(Config::DSiFullBIOSBoot);
+
ui->cbDSiSDEnable->setChecked(Config::DSiSDEnable);
ui->txtDSiSDPath->setText(QString::fromStdString(Config::DSiSDPath));
ui->cbxDSiSDSize->setCurrentIndex(Config::DSiSDSize);
@@ -211,6 +213,7 @@ void EmuSettingsDialog::done(int r)
std::string dsiBios7Path = ui->txtDSiBIOS7Path->text().toStdString();
std::string dsiFirmwarePath = ui->txtDSiFirmwarePath->text().toStdString();
std::string dsiNANDPath = ui->txtDSiNANDPath->text().toStdString();
+ bool dsiFullBiosBoot = ui->cbDSiFullBIOSBoot->isChecked();
bool dsiSDEnable = ui->cbDSiSDEnable->isChecked();
std::string dsiSDPath = ui->txtDSiSDPath->text().toStdString();
@@ -242,6 +245,7 @@ void EmuSettingsDialog::done(int r)
|| dsiBios7Path != Config::DSiBIOS7Path
|| dsiFirmwarePath != Config::DSiFirmwarePath
|| dsiNANDPath != Config::DSiNANDPath
+ || dsiFullBiosBoot != Config::DSiFullBIOSBoot
|| dsiSDEnable != Config::DSiSDEnable
|| dsiSDPath != Config::DSiSDPath
|| dsiSDSize != Config::DSiSDSize
@@ -271,6 +275,7 @@ void EmuSettingsDialog::done(int r)
Config::DSiBIOS7Path = dsiBios7Path;
Config::DSiFirmwarePath = dsiFirmwarePath;
Config::DSiNANDPath = dsiNANDPath;
+ Config::DSiFullBIOSBoot = dsiFullBiosBoot;
Config::DSiSDEnable = dsiSDEnable;
Config::DSiSDPath = dsiSDPath;
diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.ui b/src/frontend/qt_sdl/EmuSettingsDialog.ui
index 2eb76d0..b434bbe 100644
--- a/src/frontend/qt_sdl/EmuSettingsDialog.ui
+++ b/src/frontend/qt_sdl/EmuSettingsDialog.ui
@@ -7,7 +7,7 @@
0
0
575
- 370
+ 416
@@ -206,31 +206,34 @@
DSi-mode
- -
-
-
- <html><head/><body><p>Make the emulated SD card read-only.</p></body></html>
-
+
-
+
- Read-only SD
+ DSi NAND:
- -
-
-
- Browse...
+
-
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>DSi-mode ARM9 BIOS</p><p><br/></p><p>Size should be 64 KB</p></body></html>
- -
-
-
-
+
-
+
+
+ <html><head/><body><p>Sync the emulated SD card to the given folder. The folder's contents will be copied to the SD image, and any change made to the SD image will be reflected to the folder.</p></body></html>
- -
+
-
<html><head/><body><p>Sync the emulated SD card to the given folder. The folder's contents will be copied to the SD image, and any change made to the SD image will be reflected to the folder.</p></body></html>
@@ -240,31 +243,45 @@
- -
-
-
- <html><head/><body><p>Size of the SD image.</p><p><br/></p><p>If set to Auto:</p><p>* if an image file exists, the volume size will be that of the image file</p><p>* if no image file exists and folder sync is enabled, the volume size will be determined from the synced folder's contents</p><p>* otherwise, the volume size will default to 512 MB</p></body></html>
+
-
+
+
+
- -
-
+
-
+
+
+ DSi ARM9 BIOS:
+
+
+
+ -
+
+
+ Browse...
+
+
+
+ -
+
- <html><head/><body><p>Sync the emulated SD card to the given folder. The folder's contents will be copied to the SD image, and any change made to the SD image will be reflected to the folder.</p></body></html>
+ <html><head/><body><p>DSi-mode ARM7 BIOS</p><p><br/></p><p>Size should be 64 KB</p></body></html>
- -
-
+
-
+
- DSi firmware:
+ DSi mode requires external DSi BIOS/firmware/NAND
- -
-
+
-
+
- Browse...
+ Image size:
@@ -275,42 +292,38 @@
- -
-
-
- <html><head/><body><p>DSi NAND dump</p><p><br/></p><p>Should have 'nocash footer' at the end</p></body></html>
-
-
-
- -
-
-
- <html><head/><body><p>SD image file for emulating the DSi's SD card. A blank image file will be created if it doesn't already exist.</p></body></html>
+
-
+
+
+ Browse...
- -
-
-
- <html><head/><body><p>DSi-mode firmware (used for DS-mode backwards compatibility)</p><p><br/></p><p>Size should be 128 KB</p></body></html>
+
-
+
+
+ Browse...
- -
-
+
-
+
- DSi ARM9 BIOS:
+ DSi firmware:
- -
-
+
-
+
+
+ <html><head/><body><p>Make the emulated SD card read-only.</p></body></html>
+
- Image size:
+ Read-only SD
- -
+
-
<html><head/><body><p>Simulate a SD card being inserted in the DSi's SD slot.</p></body></html>
@@ -320,72 +333,69 @@
- -
-
+
-
+
Browse...
- -
-
+
-
+
Browse...
- -
-
+
-
+
- <html><head/><body><p>DSi-mode ARM7 BIOS</p><p><br/></p><p>Size should be 64 KB</p></body></html>
+ <html><head/><body><p>SD image file for emulating the DSi's SD card. A blank image file will be created if it doesn't already exist.</p></body></html>
- -
-
-
- SD card image:
+
-
+
+
+ <html><head/><body><p>DSi-mode firmware (used for DS-mode backwards compatibility)</p><p><br/></p><p>Size should be 128 KB</p></body></html>
- -
-
-
- Browse...
+
-
+
+
+ <html><head/><body><p>DSi NAND dump</p><p><br/></p><p>Should have 'nocash footer' at the end</p></body></html>
- -
-
-
- DSi NAND:
+
-
+
+
+ <html><head/><body><p>Size of the SD image.</p><p><br/></p><p>If set to Auto:</p><p>* if an image file exists, the volume size will be that of the image file</p><p>* if no image file exists and folder sync is enabled, the volume size will be determined from the synced folder's contents</p><p>* otherwise, the volume size will default to 512 MB</p></body></html>
- -
-
-
-
- 0
- 0
-
-
-
- <html><head/><body><p>DSi-mode ARM9 BIOS</p><p><br/></p><p>Size should be 64 KB</p></body></html>
+
-
+
+
+ SD card image:
- -
-
+
-
+
Browse...
- -
-
+
-
+
+
+ <html><head/><body><p>Boot the system from scratch by running the full boot ROMs, instead of starting with the second-stage loader. Requires a full BIOS/bootROM dump.</p></body></html>
+
- DSi mode requires external DSi BIOS/firmware/NAND
+ Full BIOS boot
diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp
index be6b6f6..eef9934 100644
--- a/src/frontend/qt_sdl/Platform.cpp
+++ b/src/frontend/qt_sdl/Platform.cpp
@@ -219,6 +219,7 @@ bool GetConfigBool(ConfigEntry entry)
case DSiSD_FolderSync: return Config::DSiSDFolderSync != 0;
case Firm_OverrideSettings: return Config::FirmwareOverrideSettings != 0;
+ case DSi_FullBIOSBoot: return Config::DSiFullBIOSBoot != 0;
}
return false;
--
cgit v1.2.3