diff options
author | Arisotura <thetotalworm@gmail.com> | 2020-06-01 19:11:44 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2020-06-01 19:11:44 +0200 |
commit | d7b846619b7f1d392b7b5644ddf856290b44e7e1 (patch) | |
tree | 64cc4dc804151e88fc880772a0dd1795c2c20b5a /src/frontend | |
parent | b84edfb3219d1610aa59a4f00f9695746bcfd391 (diff) |
add DSi-mode settings
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/qt_sdl/EmuSettingsDialog.cpp | 66 | ||||
-rw-r--r-- | src/frontend/qt_sdl/EmuSettingsDialog.h | 5 | ||||
-rw-r--r-- | src/frontend/qt_sdl/EmuSettingsDialog.ui | 129 | ||||
-rw-r--r-- | src/frontend/qt_sdl/PlatformConfig.cpp | 14 | ||||
-rw-r--r-- | src/frontend/qt_sdl/PlatformConfig.h | 7 | ||||
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 1 |
6 files changed, 220 insertions, 2 deletions
diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.cpp b/src/frontend/qt_sdl/EmuSettingsDialog.cpp index 5c2efc0..7760a88 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.cpp +++ b/src/frontend/qt_sdl/EmuSettingsDialog.cpp @@ -42,6 +42,16 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new ui->txtBIOS9Path->setText(Config::BIOS9Path); ui->txtBIOS7Path->setText(Config::BIOS7Path); ui->txtFirmwarePath->setText(Config::FirmwarePath); + + ui->txtDSiBIOS9Path->setText(Config::DSiBIOS9Path); + ui->txtDSiBIOS7Path->setText(Config::DSiBIOS7Path); + ui->txtDSiFirmwarePath->setText(Config::DSiFirmwarePath); + ui->txtDSiNANDPath->setText(Config::DSiNANDPath); + + ui->cbxConsoleType->addItem("DS"); + ui->cbxConsoleType->addItem("DSi"); + ui->cbxConsoleType->setCurrentIndex(Config::ConsoleType); + ui->chkDirectBoot->setChecked(Config::DirectBoot != 0); } @@ -99,7 +109,15 @@ void EmuSettingsDialog::on_EmuSettingsDialog_accepted() strncpy(Config::BIOS9Path, ui->txtBIOS9Path->text().toStdString().c_str(), 1023); Config::BIOS9Path[1023] = '\0'; strncpy(Config::BIOS7Path, ui->txtBIOS7Path->text().toStdString().c_str(), 1023); Config::BIOS7Path[1023] = '\0'; strncpy(Config::FirmwarePath, ui->txtFirmwarePath->text().toStdString().c_str(), 1023); Config::FirmwarePath[1023] = '\0'; + + strncpy(Config::DSiBIOS9Path, ui->txtDSiBIOS9Path->text().toStdString().c_str(), 1023); Config::DSiBIOS9Path[1023] = '\0'; + strncpy(Config::DSiBIOS7Path, ui->txtDSiBIOS7Path->text().toStdString().c_str(), 1023); Config::DSiBIOS7Path[1023] = '\0'; + strncpy(Config::DSiFirmwarePath, ui->txtDSiFirmwarePath->text().toStdString().c_str(), 1023); Config::DSiFirmwarePath[1023] = '\0'; + strncpy(Config::DSiNANDPath, ui->txtDSiNANDPath->text().toStdString().c_str(), 1023); Config::DSiNANDPath[1023] = '\0'; + + Config::ConsoleType = ui->cbxConsoleType->currentIndex(); Config::DirectBoot = ui->chkDirectBoot->isChecked() ? 1:0; + Config::Save(); closeDlg(); @@ -145,3 +163,51 @@ void EmuSettingsDialog::on_btnFirmwareBrowse_clicked() ui->txtFirmwarePath->setText(file); } + +void EmuSettingsDialog::on_btnDSiBIOS9Browse_clicked() +{ + QString file = QFileDialog::getOpenFileName(this, + "Select DSi-mode ARM9 BIOS...", + EmuDirectory, + "BIOS files (*.bin *.rom);;Any file (*.*)"); + + if (file.isEmpty()) return; + + ui->txtDSiBIOS9Path->setText(file); +} + +void EmuSettingsDialog::on_btnDSiBIOS7Browse_clicked() +{ + QString file = QFileDialog::getOpenFileName(this, + "Select DSi-mode ARM7 BIOS...", + EmuDirectory, + "BIOS files (*.bin *.rom);;Any file (*.*)"); + + if (file.isEmpty()) return; + + ui->txtDSiBIOS7Path->setText(file); +} + +void EmuSettingsDialog::on_btnDSiFirmwareBrowse_clicked() +{ + QString file = QFileDialog::getOpenFileName(this, + "Select DSi DS-mode firmware...", + EmuDirectory, + "Firmware files (*.bin *.rom);;Any file (*.*)"); + + if (file.isEmpty()) return; + + ui->txtDSiFirmwarePath->setText(file); +} + +void EmuSettingsDialog::on_btnDSiNANDBrowse_clicked() +{ + QString file = QFileDialog::getOpenFileName(this, + "Select DSi NAND...", + EmuDirectory, + "NAND files (*.bin *.rom);;Any file (*.*)"); + + if (file.isEmpty()) return; + + ui->txtDSiNANDPath->setText(file); +} diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.h b/src/frontend/qt_sdl/EmuSettingsDialog.h index 7378641..f604ba5 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.h +++ b/src/frontend/qt_sdl/EmuSettingsDialog.h @@ -58,6 +58,11 @@ private slots: void on_btnBIOS7Browse_clicked(); void on_btnFirmwareBrowse_clicked(); + void on_btnDSiBIOS9Browse_clicked(); + void on_btnDSiBIOS7Browse_clicked(); + void on_btnDSiFirmwareBrowse_clicked(); + void on_btnDSiNANDBrowse_clicked(); + private: void verifyFirmware(); diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.ui b/src/frontend/qt_sdl/EmuSettingsDialog.ui index c70c3a2..4894fa5 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>490</width> - <height>217</height> + <height>392</height> </rect> </property> <property name="sizePolicy"> @@ -120,12 +120,137 @@ </widget> </item> <item> + <widget class="QGroupBox" name="groupBox_3"> + <property name="title"> + <string>DSi mode</string> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="2"> + <widget class="QPushButton" name="btnDSiBIOS9Browse"> + <property name="text"> + <string>Browse...</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>DSi ARM9 BIOS:</string> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QPushButton" name="btnDSiFirmwareBrowse"> + <property name="text"> + <string>Browse...</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLineEdit" name="txtDSiBIOS7Path"> + <property name="whatsThis"> + <string><html><head/><body><p>DSi-mode ARM7 BIOS</p><p><br/></p><p>Size should be 64 KB</p></body></html></string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="txtDSiFirmwarePath"> + <property name="whatsThis"> + <string><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></string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>DSi ARM7 BIOS:</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_7"> + <property name="text"> + <string>DSi firmware:</string> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QPushButton" name="btnDSiBIOS7Browse"> + <property name="text"> + <string>Browse...</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="txtDSiBIOS9Path"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="whatsThis"> + <string><html><head/><body><p>DSi-mode ARM9 BIOS</p><p><br/></p><p>Size should be 64 KB</p></body></html></string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>DSi NAND:</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="txtDSiNANDPath"> + <property name="whatsThis"> + <string><html><head/><body><p>DSi NAND dump</p><p><br/></p><p>Should have 'nocash footer' at the end</p></body></html></string> + </property> + </widget> + </item> + <item row="3" column="2"> + <widget class="QPushButton" name="btnDSiNANDBrowse"> + <property name="text"> + <string>Browse...</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="groupBox_2"> <property name="title"> - <string>Startup</string> + <string>General</string> </property> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="0"> + <widget class="QLabel" name="label_4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Console type:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="cbxConsoleType"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="whatsThis"> + <string><html><head/><body><p>The type of console to emulate</p></body></html></string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="2"> <widget class="QCheckBox" name="chkDirectBoot"> <property name="whatsThis"> <string><html><head/><body><p>When loading a ROM, completely skip the regular boot process (&quot;Nintendo DS&quot; screen) to boot the ROM directly.</p><p><br/></p><p>Note: if your firmware dump isn't bootable, the ROM will be booted directly regardless of this setting.</p></body></html></string> diff --git a/src/frontend/qt_sdl/PlatformConfig.cpp b/src/frontend/qt_sdl/PlatformConfig.cpp index 03fd2ac..06128d7 100644 --- a/src/frontend/qt_sdl/PlatformConfig.cpp +++ b/src/frontend/qt_sdl/PlatformConfig.cpp @@ -47,10 +47,17 @@ int ScreenUseGL; int ScreenVSync; int ScreenVSyncInterval; +int _3DRenderer; +int Threaded3D; + +int GL_ScaleFactor; +int GL_Antialias; + int LimitFPS; int AudioSync; int ShowOSD; +int ConsoleType; int DirectBoot; int SocketBindAnyAddr; @@ -129,10 +136,17 @@ ConfigEntry PlatformConfigFile[] = {"ScreenVSync", 0, &ScreenVSync, 0, NULL, 0}, {"ScreenVSyncInterval", 0, &ScreenVSyncInterval, 1, NULL, 0}, + {"3DRenderer", 0, &_3DRenderer, 1, NULL, 0}, + {"Threaded3D", 0, &Threaded3D, 1, NULL, 0}, + + {"GL_ScaleFactor", 0, &GL_ScaleFactor, 1, NULL, 0}, + {"GL_Antialias", 0, &GL_Antialias, 0, NULL, 0}, + {"LimitFPS", 0, &LimitFPS, 0, NULL, 0}, {"AudioSync", 0, &AudioSync, 1, NULL, 0}, {"ShowOSD", 0, &ShowOSD, 1, NULL, 0}, + {"ConsoleType", 0, &ConsoleType, 0, NULL, 0}, {"DirectBoot", 0, &DirectBoot, 1, NULL, 0}, {"SockBindAnyAddr", 0, &SocketBindAnyAddr, 0, NULL, 0}, diff --git a/src/frontend/qt_sdl/PlatformConfig.h b/src/frontend/qt_sdl/PlatformConfig.h index cc288b6..791bb07 100644 --- a/src/frontend/qt_sdl/PlatformConfig.h +++ b/src/frontend/qt_sdl/PlatformConfig.h @@ -60,10 +60,17 @@ extern int ScreenUseGL; extern int ScreenVSync; extern int ScreenVSyncInterval; +extern int _3DRenderer; +extern int Threaded3D; + +extern int GL_ScaleFactor; +extern int GL_Antialias; + extern int LimitFPS; extern int AudioSync; extern int ShowOSD; +extern int ConsoleType; extern int DirectBoot; extern int SocketBindAnyAddr; diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index a3207c7..ef21bc7 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -1889,6 +1889,7 @@ int main(int argc, char** argv) Config::Load(); #define SANITIZE(var, min, max) { if (var < min) var = min; else if (var > max) var = max; } + SANITIZE(Config::ConsoleType, 0, 1); SANITIZE(Config::_3DRenderer, 0, 1); SANITIZE(Config::ScreenVSyncInterval, 1, 20); SANITIZE(Config::GL_ScaleFactor, 1, 16); |