From 13d58d8ed0b5fdfd116885de1383e85447c7f100 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 15 Feb 2025 12:32:21 +1000 Subject: [PATCH] Qt: Move fast boot/fast forward to console settings Makes more sense there, and matches Android. --- src/core/fullscreen_ui.cpp | 20 ++--- src/duckstation-qt/biossettingswidget.cpp | 52 ++++-------- src/duckstation-qt/biossettingswidget.h | 1 - src/duckstation-qt/biossettingswidget.ui | 88 ++++++++------------ src/duckstation-qt/consolesettingswidget.cpp | 35 +++++--- src/duckstation-qt/consolesettingswidget.h | 1 + src/duckstation-qt/consolesettingswidget.ui | 16 +++- src/duckstation-qt/settingswindow.cpp | 8 +- 8 files changed, 106 insertions(+), 115 deletions(-) diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index bfc658d97..9f31ba86d 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -3960,18 +3960,10 @@ void FullscreenUI::DrawBIOSSettingsPage() } } + MenuHeading(FSUI_CSTR("Options")); + DrawFolderSetting(bsi, FSUI_ICONSTR(ICON_FA_FOLDER, "BIOS Directory"), "BIOS", "SearchDirectory", EmuFolders::Bios); - MenuHeading(FSUI_CSTR("Patches")); - - DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_BOLT, "Enable Fast Boot"), - FSUI_CSTR("Patches the BIOS to skip the boot animation. Safe to enable."), "BIOS", "PatchFastBoot", - Settings::DEFAULT_FAST_BOOT_VALUE); - DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_FAST_FORWARD, "Fast Forward Boot"), - FSUI_CSTR("Fast forwards through the early loading process when fast booting, saving time. Results " - "may vary between games."), - "BIOS", "FastForwardBoot", false, - GetEffectiveBoolSetting(bsi, "BIOS", "PatchFastBoot", Settings::DEFAULT_FAST_BOOT_VALUE)); DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_SCROLL, "Enable TTY Logging"), FSUI_CSTR("Logs BIOS calls to printf(). Not all games contain debugging messages."), "BIOS", "TTYLogging", false); @@ -4016,6 +4008,14 @@ void FullscreenUI::DrawConsoleSettingsPage() DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_MAGIC, "Safe Mode"), FSUI_CSTR("Temporarily disables all enhancements, useful when testing."), "Main", "DisableAllEnhancements", false); + DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_BOLT, "Enable Fast Boot"), + FSUI_CSTR("Patches the BIOS to skip the boot animation. Safe to enable."), "BIOS", "PatchFastBoot", + Settings::DEFAULT_FAST_BOOT_VALUE); + DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_FAST_FORWARD, "Fast Forward Boot"), + FSUI_CSTR("Fast forwards through the early loading process when fast booting, saving time. Results " + "may vary between games."), + "BIOS", "FastForwardBoot", false, + GetEffectiveBoolSetting(bsi, "BIOS", "PatchFastBoot", Settings::DEFAULT_FAST_BOOT_VALUE)); DrawToggleSetting( bsi, FSUI_ICONSTR(ICON_FA_MEMORY, "Enable 8MB RAM"), FSUI_CSTR("Enables an additional 6MB of RAM to obtain a total of 2+6 = 8MB, usually present on dev consoles."), diff --git a/src/duckstation-qt/biossettingswidget.cpp b/src/duckstation-qt/biossettingswidget.cpp index 76f1effcd..33ca48ec0 100644 --- a/src/duckstation-qt/biossettingswidget.cpp +++ b/src/duckstation-qt/biossettingswidget.cpp @@ -21,10 +21,6 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) m_ui.setupUi(this); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableTTYLogging, "BIOS", "TTYLogging", false); - SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.fastBoot, "BIOS", "PatchFastBoot", false); - SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.fastForwardBoot, "BIOS", "FastForwardBoot", false); - - connect(m_ui.fastBoot, &QCheckBox::checkStateChanged, this, &BIOSSettingsWidget::onFastBootChanged); SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.pioDeviceType, "PIO", "DeviceType", &Settings::ParsePIODeviceTypeName, &Settings::GetPIODeviceTypeModeName, @@ -36,28 +32,8 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) connect(m_ui.pioDeviceType, QOverload::of(&QComboBox::currentIndexChanged), this, &BIOSSettingsWidget::onPIODeviceTypeChanged); connect(m_ui.pioImagePathBrowse, &QPushButton::clicked, this, &BIOSSettingsWidget::onPIOImagePathBrowseClicked); - - onFastBootChanged(); onPIODeviceTypeChanged(); - dialog->registerWidgetHelp(m_ui.fastBoot, tr("Fast Boot"), tr("Unchecked"), - tr("Patches the BIOS to skip the console's boot animation. Does not work with all games, " - "but usually safe to enable.")); - dialog->registerWidgetHelp(m_ui.enableTTYLogging, tr("Enable TTY Logging"), tr("Unchecked"), - tr("Logs BIOS calls to printf(). Not all games contain debugging messages.")); - dialog->registerWidgetHelp(m_ui.pioDeviceType, tr("Device Type"), tr("None"), - tr("Simulates a device plugged into the console's parallel port. Usually these are flash " - "cartridges, and require some sort of image dump to function.")); - dialog->registerWidgetHelp(m_ui.pioImagePath, tr("Image Path"), tr("Empty"), - tr("Sets the path to the image used for flash cartridges.")); - dialog->registerWidgetHelp(m_ui.pioSwitchActive, tr("Cartridge Switch On"), tr("Checked"), - tr("Simulates the position of the switch on the cartridge. Most cartridges require the " - "switch to be on for it to activate on startup.")); - dialog->registerWidgetHelp( - m_ui.pioImageWrites, tr("Allow Image Writes"), tr("Unchecked"), - tr("Stores any images made to the cartridge's flash storage back to the host's file system. This will " - "overwrite your cartridge dump, you should ensure you have a backup first.")); - connect(m_ui.imageNTSCJ, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { if (m_dialog->isPerGameSettings() && index == 0) { @@ -115,13 +91,20 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) refreshList(); - m_dialog->registerWidgetHelp(m_ui.fastBoot, tr("Fast Boot"), tr("Unchecked"), - tr("Patches the BIOS to skip the boot animation. Safe to enable.")); - m_dialog->registerWidgetHelp(m_ui.fastForwardBoot, tr("Fast Forward Boot"), tr("Unchecked"), - tr("Fast forwards through the early loading process when fast booting, saving time. " - "Results may vary between games.")); - m_dialog->registerWidgetHelp(m_ui.enableTTYLogging, tr("Enable TTY Logging"), tr("Unchecked"), - tr("Logs BIOS calls to printf(). Not all games contain debugging messages.")); + dialog->registerWidgetHelp(m_ui.pioDeviceType, tr("Device Type"), tr("None"), + tr("Simulates a device plugged into the console's parallel port. Usually these are flash " + "cartridges, and require some sort of image dump to function.")); + dialog->registerWidgetHelp(m_ui.pioImagePath, tr("Image Path"), tr("Empty"), + tr("Sets the path to the image used for flash cartridges.")); + dialog->registerWidgetHelp(m_ui.pioSwitchActive, tr("Cartridge Switch On"), tr("Checked"), + tr("Simulates the position of the switch on the cartridge. Most cartridges require the " + "switch to be on for it to activate on startup.")); + dialog->registerWidgetHelp( + m_ui.pioImageWrites, tr("Allow Image Writes"), tr("Unchecked"), + tr("Stores any images made to the cartridge's flash storage back to the host's file system. This will " + "overwrite your cartridge dump, you should ensure you have a backup first.")); + dialog->registerWidgetHelp(m_ui.enableTTYLogging, tr("Enable TTY Logging"), tr("Unchecked"), + tr("Logs BIOS calls to printf(). Not all games contain debugging messages.")); } BIOSSettingsWidget::~BIOSSettingsWidget() = default; @@ -141,13 +124,6 @@ void BIOSSettingsWidget::refreshList() m_dialog->isPerGameSettings()); } -void BIOSSettingsWidget::onFastBootChanged() -{ - const bool fast_boot_enabled = - m_dialog->getEffectiveBoolValue("BIOS", "PatchFastBoot", Settings::DEFAULT_FAST_BOOT_VALUE); - m_ui.fastForwardBoot->setEnabled(fast_boot_enabled); -} - void BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion region, QComboBox* cb, std::vector>& images, bool per_game) diff --git a/src/duckstation-qt/biossettingswidget.h b/src/duckstation-qt/biossettingswidget.h index e2ea9304a..53249f419 100644 --- a/src/duckstation-qt/biossettingswidget.h +++ b/src/duckstation-qt/biossettingswidget.h @@ -29,7 +29,6 @@ public: private Q_SLOTS: void refreshList(); - void onFastBootChanged(); void onPIODeviceTypeChanged(); void onPIOImagePathBrowseClicked(); diff --git a/src/duckstation-qt/biossettingswidget.ui b/src/duckstation-qt/biossettingswidget.ui index f6df5ffa6..82519a2ea 100644 --- a/src/duckstation-qt/biossettingswidget.ui +++ b/src/duckstation-qt/biossettingswidget.ui @@ -29,20 +29,6 @@ BIOS Selection - - - - NTSC-J (Japan): - - - - - - - NTSC-U/C (US/Canada): - - - @@ -53,13 +39,10 @@ - - - - - 0 - 0 - + + + + NTSC-U/C (US/Canada): @@ -80,6 +63,23 @@ + + + + NTSC-J (Japan): + + + + + + + + 0 + 0 + + + + @@ -140,36 +140,6 @@ - - - - Options and Patches - - - - - - Fast Boot - - - - - - - Enable TTY Logging - - - - - - - Fast Forward Boot - - - - - - @@ -228,6 +198,22 @@ + + + + Options + + + + + + Enable TTY Logging + + + + + + diff --git a/src/duckstation-qt/consolesettingswidget.cpp b/src/duckstation-qt/consolesettingswidget.cpp index 43a6693ab..b4c199224 100644 --- a/src/duckstation-qt/consolesettingswidget.cpp +++ b/src/duckstation-qt/consolesettingswidget.cpp @@ -48,7 +48,12 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.region, "Console", "Region", &Settings::ParseConsoleRegionName, &Settings::GetConsoleRegionName, Settings::DEFAULT_CONSOLE_REGION); + SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.fastBoot, "BIOS", "PatchFastBoot", false); + SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.fastForwardBoot, "BIOS", "FastForwardBoot", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enable8MBRAM, "Console", "Enable8MBRAM", false); + connect(m_ui.fastBoot, &QCheckBox::checkStateChanged, this, &ConsoleSettingsWidget::onFastBootChanged); + onFastBootChanged(); + SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.cpuExecutionMode, "CPU", "ExecutionMode", &Settings::ParseCPUExecutionMode, &Settings::GetCPUExecutionModeName, Settings::DEFAULT_CPU_EXECUTION_MODE); @@ -76,6 +81,18 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa dialog->registerWidgetHelp(m_ui.region, tr("Region"), tr("Auto-Detect"), tr("Determines the emulated hardware type.")); + m_dialog->registerWidgetHelp(m_ui.fastBoot, tr("Fast Boot"), tr("Unchecked"), + tr("Skips the boot animation. Safe to enable.")); + m_dialog->registerWidgetHelp(m_ui.fastForwardBoot, tr("Fast Forward Boot"), tr("Unchecked"), + tr("Fast forwards through the early loading process when fast booting, saving time. " + "Results may vary between games.")); + dialog->registerWidgetHelp( + m_ui.enable8MBRAM, tr("Enable 8MB RAM (Dev Console)"), tr("Unchecked"), + tr("Enables an additional 6MB of RAM to obtain a total of 2+6 = 8MB, usually present on dev consoles. Games have " + "to use a larger heap size for " + "this additional RAM to be usable. Titles which rely on memory mirrors may break, so it should only be used " + "with compatible mods.")); + dialog->registerWidgetHelp(m_ui.cpuExecutionMode, tr("Execution Mode"), tr("Recompiler (Fastest)"), tr("Determines how the emulated CPU executes instructions.")); dialog->registerWidgetHelp(m_ui.enableCPUClockSpeedControl, @@ -87,16 +104,7 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa tr("Simulates stalls in the recompilers when the emulated CPU would have to fetch " "instructions into its cache. Makes games run closer to their console framerate, at a " "small cost to performance. Interpreter mode always simulates the instruction cache.")); - dialog->registerWidgetHelp( - m_ui.enable8MBRAM, tr("Enable 8MB RAM (Dev Console)"), tr("Unchecked"), - tr("Enables an additional 6MB of RAM to obtain a total of 2+6 = 8MB, usually present on dev consoles. Games have " - "to use a larger heap size for " - "this additional RAM to be usable. Titles which rely on memory mirrors may break, so it should only be used " - "with compatible mods.")); - dialog->registerWidgetHelp( - m_ui.cdromLoadImageToRAM, tr("Preload Image to RAM"), tr("Unchecked"), - tr("Loads the game image into RAM. Useful for network paths that may become unreliable during gameplay. In some " - "cases also eliminates stutter when games initiate audio track playback.")); + dialog->registerWidgetHelp( m_ui.cdromReadSpeedup, tr("CD-ROM Read Speedup"), tr("None (Double Speed)"), tr("Speeds up CD-ROM reads by the specified factor. Only applies to double-speed reads, and is ignored when audio " @@ -137,6 +145,13 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa ConsoleSettingsWidget::~ConsoleSettingsWidget() = default; +void ConsoleSettingsWidget::onFastBootChanged() +{ + const bool fast_boot_enabled = + m_dialog->getEffectiveBoolValue("BIOS", "PatchFastBoot", Settings::DEFAULT_FAST_BOOT_VALUE); + m_ui.fastForwardBoot->setEnabled(fast_boot_enabled); +} + void ConsoleSettingsWidget::updateRecompilerICacheEnabled() { const CPUExecutionMode mode = diff --git a/src/duckstation-qt/consolesettingswidget.h b/src/duckstation-qt/consolesettingswidget.h index 3edca7303..29d59ad28 100644 --- a/src/duckstation-qt/consolesettingswidget.h +++ b/src/duckstation-qt/consolesettingswidget.h @@ -18,6 +18,7 @@ public: ~ConsoleSettingsWidget(); private Q_SLOTS: + void onFastBootChanged(); void updateRecompilerICacheEnabled(); void onEnableCPUClockSpeedControlChecked(int state); void onCPUClockSpeedValueChanged(int value); diff --git a/src/duckstation-qt/consolesettingswidget.ui b/src/duckstation-qt/consolesettingswidget.ui index 496e5ab26..eba0d6d12 100644 --- a/src/duckstation-qt/consolesettingswidget.ui +++ b/src/duckstation-qt/consolesettingswidget.ui @@ -7,7 +7,7 @@ 0 0 648 - 456 + 459 @@ -42,6 +42,20 @@ + + + Fast Boot + + + + + + + Fast Forward Boot + + + + Enable 8MB RAM (Dev Console) diff --git a/src/duckstation-qt/settingswindow.cpp b/src/duckstation-qt/settingswindow.cpp index ad3112930..944af6235 100644 --- a/src/duckstation-qt/settingswindow.cpp +++ b/src/duckstation-qt/settingswindow.cpp @@ -99,10 +99,10 @@ void SettingsWindow::addPages() "recursive/non-recursive.")); } - addWidget( - m_bios_settings = new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"), QStringLiteral("chip-line"), - tr("BIOS Settings
These options control which BIOS is used and how it will be " - "patched.

Mouse over an option for additional information, and Shift+Wheel to scroll this panel.")); + addWidget(m_bios_settings = new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"), + QStringLiteral("chip-line"), + tr("BIOS Settings
These options control which BIOS and expansion port is " + "used.

Mouse over an option for additional information, and Shift+Wheel to scroll this panel.")); addWidget( m_console_settings = new ConsoleSettingsWidget(this, m_ui.settingsContainer), tr("Console"), QStringLiteral("chip-2-line"),