From 4a12ec6fc05d4546866e7854dbaf087d78a4611a Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Fri, 20 May 2022 18:17:35 +0100 Subject: [PATCH] GS: Add option to disable Interlace Offset --- pcsx2-qt/Settings/GraphicsSettingsWidget.cpp | 1 + pcsx2-qt/Settings/GraphicsSettingsWidget.ui | 38 ++++++++++++-------- pcsx2/Config.h | 1 + pcsx2/GS/GS.cpp | 1 + pcsx2/GS/Renderers/Common/GSDevice.cpp | 2 +- pcsx2/GS/Window/GSSetting.cpp | 4 +++ pcsx2/GS/Window/GSSetting.h | 1 + pcsx2/GS/Window/GSwxDialog.cpp | 1 + pcsx2/Pcsx2Config.cpp | 3 +- 9 files changed, 36 insertions(+), 16 deletions(-) diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp index 276ce295c4..48e63305df 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp @@ -99,6 +99,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.bilinearFiltering, "EmuCore/GS", "linear_present", true); 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.DisableInterlaceOffset, "EmuCore/GS", "disable_interlace_offset", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.internalResolutionScreenshots, "EmuCore/GS", "InternalResolutionScreenshots", false); SettingWidgetBinder::BindWidgetToFloatSetting(sif, m_ui.zoom, "EmuCore/GS", "Zoom", 100.0f); SettingWidgetBinder::BindWidgetToFloatSetting(sif, m_ui.stretchY, "EmuCore/GS", "StretchY", 100.0f); diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.ui b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui index 1437de9935..4f39277ed5 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.ui +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui @@ -271,10 +271,17 @@ - - + + - Bilinear Filtering + Internal Resolution Screenshots + + + + + + + Screen Offsets @@ -285,13 +292,6 @@ - - - - Internal Resolution Screenshots - - - @@ -299,10 +299,20 @@ - - + + - Screen Offsets + Bilinear Filtering + + + + + + + Disables interlacing offset which may reduce blurring in some situations. + + + Disable Interlace Offset @@ -1197,7 +1207,7 @@ LZMA (xz) - + Zstandard (zst) diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 7120b3b814..fc8a014164 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -431,6 +431,7 @@ struct Pcsx2Config struct { bool + DisableInterlaceOffset: 1, PCRTCOffsets : 1, IntegerScaling : 1, LinearPresent : 1, diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index d864112067..2f9130d901 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -1325,6 +1325,7 @@ void GSApp::Init() m_default_configuration["fxaa"] = "0"; m_default_configuration["GSDumpCompression"] = "0"; m_default_configuration["HWDisableReadbacks"] = "0"; + m_default_configuration["disable_interlace_offset"] = "0"; m_default_configuration["pcrtc_offsets"] = "0"; m_default_configuration["IntegerScaling"] = "0"; m_default_configuration["deinterlace"] = "7"; diff --git a/pcsx2/GS/Renderers/Common/GSDevice.cpp b/pcsx2/GS/Renderers/Common/GSDevice.cpp index 5380c55c25..6e665ff260 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.cpp +++ b/pcsx2/GS/Renderers/Common/GSDevice.cpp @@ -360,7 +360,7 @@ void GSDevice::Interlace(const GSVector2i& ds, int field, int mode, float yoffse // weave first const int offset = static_cast(yoffset) * (1 - field); - DoInterlace(m_merge, m_weavebob, field, false, offset); + DoInterlace(m_merge, m_weavebob, field, false, GSConfig.DisableInterlaceOffset ? 0 : offset); if (mode == 2) { diff --git a/pcsx2/GS/Window/GSSetting.cpp b/pcsx2/GS/Window/GSSetting.cpp index 38cf4c5aea..413acaf20f 100644 --- a/pcsx2/GS/Window/GSSetting.cpp +++ b/pcsx2/GS/Window/GSSetting.cpp @@ -93,6 +93,10 @@ const char* dialog_message(int ID, bool* updateText) return cvtString("Enable: Takes in to account offsets in the analogue circuits.\n" "This will use the intended aspect ratios and screen offsets, may cause odd black borders.\n" "Used for screen positioning and screen shake in Wipeout Fusion."); + case IDC_DISABLE_INTERLACE_OFFSETS: + return cvtString("Enable: Removes the offset for interlacing when upscaling.\n" + "Can reduce blurring in some games, where the opposite is true most of the time.\n" + "Used for ICO to reduce blur."); case IDC_ACCURATE_DATE: return cvtString("Implement a more accurate algorithm to compute GS destination alpha testing.\n" "It improves shadow and transparency rendering.\n\n" diff --git a/pcsx2/GS/Window/GSSetting.h b/pcsx2/GS/Window/GSSetting.h index 0c2de522a7..bd08c19b52 100644 --- a/pcsx2/GS/Window/GSSetting.h +++ b/pcsx2/GS/Window/GSSetting.h @@ -43,6 +43,7 @@ enum // Renderer IDC_FILTER, IDC_PCRTC_OFFSETS, + IDC_DISABLE_INTERLACE_OFFSETS, // Hardware Renderer IDC_PRELOAD_TEXTURES, IDC_ACCURATE_DATE, diff --git a/pcsx2/GS/Window/GSwxDialog.cpp b/pcsx2/GS/Window/GSwxDialog.cpp index 9fb7002e46..d29d3b3798 100644 --- a/pcsx2/GS/Window/GSwxDialog.cpp +++ b/pcsx2/GS/Window/GSwxDialog.cpp @@ -322,6 +322,7 @@ RendererTab::RendererTab(wxWindow* parent) auto* pcrtc_checks_box = new wxWrapSizer(wxHORIZONTAL); m_ui.addCheckBox(pcrtc_checks_box, "Screen Offsets", "pcrtc_offsets", IDC_PCRTC_OFFSETS); + m_ui.addCheckBox(pcrtc_checks_box, "Disable Interlace Offset", "disable_interlace_offset", IDC_DISABLE_INTERLACE_OFFSETS); general_box->Add(pcrtc_checks_box, wxSizerFlags().Center()); diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 3b3d759b3a..5d2f946f74 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -296,6 +296,7 @@ Pcsx2Config::GSOptions::GSOptions() { bitset = 0; + DisableInterlaceOffset = false; PCRTCOffsets = false; IntegerScaling = false; LinearPresent = true; @@ -509,7 +510,7 @@ void Pcsx2Config::GSOptions::ReloadIniSettings() // Unfortunately, because code in the GS still reads the setting by key instead of // using these variables, we need to use the old names. Maybe post 2.0 we can change this. - + GSSettingBoolEx(DisableInterlaceOffset, "disable_interlace_offset"); GSSettingBoolEx(PCRTCOffsets, "pcrtc_offsets"); GSSettingBool(IntegerScaling); GSSettingBoolEx(LinearPresent, "linear_present");