From cc9f7e723a5ae21ff65dddfd52ed39b2d0d5f620 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:47:28 +0700 Subject: [PATCH] Qt/Patches: Get rid of the global WS/NI toggle --- pcsx2-qt/Settings/GraphicsSettingsWidget.cpp | 33 ++++++++----------- pcsx2-qt/Settings/GraphicsSettingsWidget.ui | 34 ++++++-------------- pcsx2/Config.h | 2 -- pcsx2/ImGui/FullscreenUI.cpp | 9 ------ pcsx2/ImGui/ImGuiOverlays.cpp | 5 ++- pcsx2/Patch.cpp | 21 ------------ pcsx2/Pcsx2Config.cpp | 2 -- pcsx2/VMManager.cpp | 2 -- 8 files changed, 25 insertions(+), 83 deletions(-) diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp index 311143fd46f22..32fcd4da06b31 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp @@ -88,8 +88,6 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.interlacing, "EmuCore/GS", "deinterlace_mode", DEFAULT_INTERLACE_MODE); SettingWidgetBinder::BindWidgetToIntSetting( sif, m_ui.bilinearFiltering, "EmuCore/GS", "linear_present_mode", static_cast(GSPostBilinearMode::BilinearSmooth)); - SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.widescreenPatches, "EmuCore", "EnableWideScreenPatches", false); - SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.noInterlacingPatches, "EmuCore", "EnableNoInterlacingPatches", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.integerScaling, "EmuCore/GS", "IntegerScaling", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.PCRTCOffsets, "EmuCore/GS", "pcrtc_offsets", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.PCRTCOverscan, "EmuCore/GS", "pcrtc_overscan", false); @@ -321,24 +319,22 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* } #endif - // Get rid of widescreen/no-interlace checkboxes from per-game settings, unless the user previously had them set. - if (m_dialog->isPerGameSettings()) + // Prompt user to get rid of widescreen/no-interlace config from the ini if the user has enabled them before. + if ((m_dialog->getBoolValue("EmuCore", "EnableWideScreenPatches", false) == true || + m_dialog->getBoolValue("EmuCore", "EnableWideScreenPatches", false) == true) && + !m_dialog->containsSettingValue("UI", "UserHasDeniedWSPatchWarning")) { - if ((m_dialog->containsSettingValue("EmuCore", "EnableWideScreenPatches") || m_dialog->containsSettingValue("EmuCore", "EnableNoInterlacingPatches")) && - QMessageBox::question(QtUtils::GetRootWidget(this), tr("Remove Unsupported Settings"), - tr("You currently have the Enable Widescreen Patches or Enable No-Interlacing Patches options enabled for this game.

" - "We no longer support these options, instead you should select the \"Patches\" section, and explicitly enable the patches you want.

" - "Do you want to remove these options from your game configuration now?"), + if (QMessageBox::question(QtUtils::GetRootWidget(this), tr("Remove Unsupported Settings"), + tr("You previously had the Enable Widescreen Patches or Enable No-Interlacing Patches options enabled.

" + "We no longer provide these options, instead you should go to the \"Patches\" section on the per-game settings, and explicitly enable the patches that you want.

" + "Do you want to remove these options from your configuration now?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { m_dialog->removeSettingValue("EmuCore", "EnableWideScreenPatches"); m_dialog->removeSettingValue("EmuCore", "EnableNoInterlacingPatches"); } - - m_ui.displayGridLayout->removeWidget(m_ui.widescreenPatches); - m_ui.displayGridLayout->removeWidget(m_ui.noInterlacingPatches); - safe_delete(m_ui.widescreenPatches); - safe_delete(m_ui.noInterlacingPatches); + else + m_dialog->setBoolSettingValue("UI", "UserHasDeniedWSPatchWarning", true); } // Hide advanced options by default. @@ -350,10 +346,13 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* m_ui.advancedTab = nullptr; m_ui.gsDownloadMode = nullptr; m_ui.gsDumpCompression = nullptr; + m_ui.texturePreloading = nullptr; m_ui.exclusiveFullscreenControl = nullptr; m_ui.useBlitSwapChain = nullptr; m_ui.disableMailboxPresentation = nullptr; m_ui.extendedUpscales = nullptr; + m_ui.spinCPUDuringReadbacks = nullptr; + m_ui.spinGPUDuringReadbacks = nullptr; m_ui.skipPresentingDuplicateFrames = nullptr; m_ui.overrideTextureBarriers = nullptr; m_ui.disableFramebufferFetch = nullptr; @@ -428,12 +427,6 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* // Display tab { - dialog->registerWidgetHelp(m_ui.widescreenPatches, tr("Enable Widescreen Patches"), tr("Unchecked"), - tr("Automatically loads and applies widescreen patches on game start. Can cause issues.")); - - dialog->registerWidgetHelp(m_ui.noInterlacingPatches, tr("Enable No-Interlacing Patches"), tr("Unchecked"), - tr("Automatically loads and applies no-interlacing patches on game start. Can cause issues.")); - dialog->registerWidgetHelp(m_ui.DisableInterlaceOffset, tr("Disable Interlace Offset"), tr("Unchecked"), tr("Disables interlacing offset which may reduce blurring in some situations.")); diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.ui b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui index d1b6a9031d041..d7994633de4b6 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.ui +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui @@ -404,28 +404,28 @@ - + Integer Scaling - - + + - Apply Widescreen Patches + Show Overscan - - + + - Apply No-Interlacing Patches + Screen Offsets - + Anti-Blur @@ -435,27 +435,13 @@ - + Disable Interlace Offset - - - - Screen Offsets - - - - - - - Show Overscan - - - @@ -2125,7 +2111,7 @@ - + diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 403900ff2c7ea..5d59e799774b4 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -1268,8 +1268,6 @@ struct Pcsx2Config EnablePatches : 1, // enables patch detection and application EnableCheats : 1, // enables cheat detection and application EnablePINE : 1, // enables inter-process communication - EnableWideScreenPatches : 1, - EnableNoInterlacingPatches : 1, EnableFastBoot : 1, EnableFastBootFastForward : 1, EnableThreadPinning : 1, diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index 44afb555a5366..aab00bec5f006 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -3705,15 +3705,6 @@ void FullscreenUI::DrawGraphicsSettingsPage(SettingsInterface* bsi, bool show_ad "EmuCore/GS", "StretchY", 100, 10, 300, FSUI_CSTR("%d%%")); DrawIntRectSetting(bsi, FSUI_CSTR("Crop"), FSUI_CSTR("Crops the image, while respecting aspect ratio."), "EmuCore/GS", "CropLeft", 0, "CropTop", 0, "CropRight", 0, "CropBottom", 0, 0, 720, 1, FSUI_CSTR("%dpx")); - - if (!IsEditingGameSettings(bsi)) - { - DrawToggleSetting(bsi, FSUI_CSTR("Enable Widescreen Patches"), FSUI_CSTR("Enables loading widescreen patches from pnach files."), - "EmuCore", "EnableWideScreenPatches", false); - DrawToggleSetting(bsi, FSUI_CSTR("Enable No-Interlacing Patches"), - FSUI_CSTR("Enables loading no-interlacing patches from pnach files."), "EmuCore", "EnableNoInterlacingPatches", false); - } - DrawIntListSetting(bsi, FSUI_CSTR("Bilinear Upscaling"), FSUI_CSTR("Smooths out the image when upscaling the console to the screen."), "EmuCore/GS", "linear_present_mode", static_cast(GSPostBilinearMode::BilinearSharp), s_bilinear_present_options, std::size(s_bilinear_present_options), true); diff --git a/pcsx2/ImGui/ImGuiOverlays.cpp b/pcsx2/ImGui/ImGuiOverlays.cpp index e67c3184c22f9..3224fafea0a9d 100644 --- a/pcsx2/ImGui/ImGuiOverlays.cpp +++ b/pcsx2/ImGui/ImGuiOverlays.cpp @@ -397,10 +397,9 @@ __ri void ImGuiManager::DrawSettingsOverlay(float scale, float margin, float spa EmuConfig.Cpu.Recompiler.GetEEClampMode(), static_cast(EmuConfig.Cpu.VU0FPCR.GetRoundMode()), EmuConfig.Cpu.Recompiler.GetVUClampMode(), EmuConfig.GS.VsyncQueueSize); - if (EmuConfig.EnableCheats || EmuConfig.EnableWideScreenPatches || EmuConfig.EnableNoInterlacingPatches) + if (EmuConfig.EnableCheats) { - APPEND("C={}{}{} ", EmuConfig.EnableCheats ? "C" : "", EmuConfig.EnableWideScreenPatches ? "W" : "", - EmuConfig.EnableNoInterlacingPatches ? "N" : ""); + APPEND("CHT "); } if (GSIsHardwareRenderer()) diff --git a/pcsx2/Patch.cpp b/pcsx2/Patch.cpp index 599bd74024a9f..7e63d1db6e577 100644 --- a/pcsx2/Patch.cpp +++ b/pcsx2/Patch.cpp @@ -163,9 +163,6 @@ namespace Patch static void writeCheat(); static void handle_extended_t(const PatchCommand* p); - // Name of patches which will be auto-enabled based on global options. - static constexpr std::string_view WS_PATCH_NAME = "Widescreen 16:9"; - static constexpr std::string_view NI_PATCH_NAME = "No-Interlacing"; static constexpr std::string_view PATCHES_ZIP_NAME = "patches.zip"; const char* PATCHES_CONFIG_SECTION = "Patches"; @@ -588,24 +585,6 @@ void Patch::ReloadEnabledLists() s_enabled_cheats = {}; s_enabled_patches = Host::GetStringListSetting(PATCHES_CONFIG_SECTION, PATCH_ENABLE_CONFIG_KEY); - - // Name based matching for widescreen/NI settings. - if (EmuConfig.EnableWideScreenPatches) - { - if (std::none_of(s_enabled_patches.begin(), s_enabled_patches.end(), - [](const std::string& it) { return (it == WS_PATCH_NAME); })) - { - s_enabled_patches.emplace_back(WS_PATCH_NAME); - } - } - if (EmuConfig.EnableNoInterlacingPatches) - { - if (std::none_of(s_enabled_patches.begin(), s_enabled_patches.end(), - [](const std::string& it) { return (it == NI_PATCH_NAME); })) - { - s_enabled_patches.emplace_back(NI_PATCH_NAME); - } - } } u32 Patch::EnablePatches(const PatchList& patches, const EnablePatchList& enable_list) diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 655c11af5885f..8763f6ab348e4 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -1922,8 +1922,6 @@ void Pcsx2Config::LoadSaveCore(SettingsWrapper& wrap) SettingsWrapBitBool(EnablePatches); SettingsWrapBitBool(EnableCheats); SettingsWrapBitBool(EnablePINE); - SettingsWrapBitBool(EnableWideScreenPatches); - SettingsWrapBitBool(EnableNoInterlacingPatches); SettingsWrapBitBool(EnableFastBoot); SettingsWrapBitBool(EnableFastBootFastForward); SettingsWrapBitBool(EnableThreadPinning); diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index 55fb77d761a59..340bde8e42475 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -2885,8 +2885,6 @@ void VMManager::CheckForEmulationSpeedConfigChanges(const Pcsx2Config& old_confi void VMManager::CheckForPatchConfigChanges(const Pcsx2Config& old_config) { if (EmuConfig.EnableCheats == old_config.EnableCheats && - EmuConfig.EnableWideScreenPatches == old_config.EnableWideScreenPatches && - EmuConfig.EnableNoInterlacingPatches == old_config.EnableNoInterlacingPatches && EmuConfig.EnablePatches == old_config.EnablePatches) { return;