From f802d0fd51557a9ce9f8314c68761bad8ffdecaa Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 9 Apr 2020 15:17:59 +0930 Subject: [PATCH] GLideNUI-wtl: Add dithering options --- src/GLideNUI-wtl/GLideNUI.rc | Bin 51378 -> 51378 bytes src/GLideNUI-wtl/Settings.cpp | 15 ++++++++++++--- src/GLideNUI-wtl/config-video.cpp | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/GLideNUI-wtl/GLideNUI.rc b/src/GLideNUI-wtl/GLideNUI.rc index f811aad826b34941b461a37cf88caf0b293cae4f..edb8725487ae3cb17f5fdb7c71b92aa1bf2509c4 100644 GIT binary patch delta 120 zcmdlqk$KZZ<_%q{lh+k0ZO%}OW1ifg!7|xEQEPIU&6UX)6qPo=&|Jklc|)7hig*t7Ycoe1OPf7*PTne5~kCkr{8 T0IE>goMUx|5p1B1Q&}4T*~T$; delta 131 zcmdlqk$KZZ<_%q{lQ+01O+FCGGx-4*+hiWSRh!qS#xYO+$EUPePiqzP* z@Jzm-sIuA4;SS?u1AB;i3(YH&*A*&F&aqAdi@kH>+iYSd$2i%<_S57XV~)vD_6L9x aER!cV=}d03=>eHJ`HOWD*lZi8vNiyk`83f0 diff --git a/src/GLideNUI-wtl/Settings.cpp b/src/GLideNUI-wtl/Settings.cpp index f587dea5..17d11ac6 100644 --- a/src/GLideNUI-wtl/Settings.cpp +++ b/src/GLideNUI-wtl/Settings.cpp @@ -41,7 +41,10 @@ void _loadSettings(GlSettings & settings) settings.endGroup(); settings.beginGroup("generalEmulation"); - config.generalEmulation.enableNoise = settings.value("enableNoise", config.generalEmulation.enableNoise).toInt(); + config.generalEmulation.enableDitheringPattern = settings.value("enableDitheringPattern", config.generalEmulation.enableDitheringPattern).toInt(); + config.generalEmulation.enableDitheringQuantization = settings.value("enableDitheringQuantization", config.generalEmulation.enableDitheringQuantization).toInt(); + config.generalEmulation.enableHiresNoiseDithering = settings.value("enableHiresNoiseDithering", config.generalEmulation.enableHiresNoiseDithering).toInt(); + config.generalEmulation.rdramImageDitheringMode = settings.value("rdramImageDitheringMode", config.generalEmulation.rdramImageDitheringMode).toInt(); config.generalEmulation.enableLOD = settings.value("enableLOD", config.generalEmulation.enableLOD).toInt(); config.generalEmulation.enableHWLighting = settings.value("enableHWLighting", config.generalEmulation.enableHWLighting).toInt(); config.generalEmulation.enableShadersStorage = settings.value("enableShadersStorage", config.generalEmulation.enableShadersStorage).toInt(); @@ -217,7 +220,10 @@ void writeSettings(const char * _strIniFolder) settings.endGroup(); settings.beginGroup("generalEmulation"); - settings.setValue("enableNoise", config.generalEmulation.enableNoise); + settings.setValue("enableDitheringPattern", config.generalEmulation.enableDitheringPattern); + settings.setValue("enableDitheringQuantization", config.generalEmulation.enableDitheringQuantization); + settings.setValue("enableHiresNoiseDithering", config.generalEmulation.enableHiresNoiseDithering); + settings.setValue("rdramImageDitheringMode", config.generalEmulation.rdramImageDitheringMode); settings.setValue("enableLOD", config.generalEmulation.enableLOD); settings.setValue("enableHWLighting", config.generalEmulation.enableHWLighting); settings.setValue("enableShadersStorage", config.generalEmulation.enableShadersStorage); @@ -413,7 +419,10 @@ void saveCustomRomSettings(const char * _strIniFolder, const char * _strRomName) settings.endGroup(); settings.beginGroup("generalEmulation"); - WriteCustomSetting(generalEmulation, enableNoise); + WriteCustomSetting(generalEmulation, enableDitheringPattern); + WriteCustomSetting(generalEmulation, enableDitheringQuantization); + WriteCustomSetting(generalEmulation, enableHiresNoiseDithering); + WriteCustomSetting(generalEmulation, rdramImageDitheringMode); WriteCustomSetting(generalEmulation, enableLOD); WriteCustomSetting(generalEmulation, enableHWLighting); WriteCustomSetting(generalEmulation, enableShadersStorage); diff --git a/src/GLideNUI-wtl/config-video.cpp b/src/GLideNUI-wtl/config-video.cpp index ad1d534d..0aba46cd 100644 --- a/src/GLideNUI-wtl/config-video.cpp +++ b/src/GLideNUI-wtl/config-video.cpp @@ -63,6 +63,12 @@ BOOL CVideoTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/) aspectComboBox.AddString(L"Stretch"); aspectComboBox.AddString(L"Try to adjust game to fit"); + CComboBox ditheringModeComboBox(GetDlgItem(IDC_CMB_PATTERN)); + ditheringModeComboBox.AddString(L"disable"); + ditheringModeComboBox.AddString(L"Bayer"); + ditheringModeComboBox.AddString(L"Magic square"); + ditheringModeComboBox.AddString(L"Blue noise"); + SIZE iconSz = { ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON) }; m_AAInfoIcon.SubclassWindow(GetDlgItem(IDC_AA_INFO_ICON)); m_AAInfoIcon.SetIcon(MAKEINTRESOURCE(IDI_ICON_INFO), iconSz.cx, iconSz.cy); @@ -260,6 +266,11 @@ void CVideoTab::LoadSettings(bool /*blockCustomSettings*/) aspectComboBox.SetCurSel(3); break; } + + CComboBox(GetDlgItem(IDC_CMB_PATTERN)).SetCurSel(config.generalEmulation.rdramImageDitheringMode); + CButton(GetDlgItem(IDC_CHK_APPLY_TO_OUTPUT)).SetCheck(config.generalEmulation.enableDitheringPattern == 0 ? BST_CHECKED : BST_UNCHECKED); + CButton(GetDlgItem(IDC_CHK_5BIT_QUANTIZATION)).SetCheck(config.generalEmulation.enableDitheringQuantization == 0 ? BST_CHECKED : BST_UNCHECKED); + CButton(GetDlgItem(IDC_CHK_HIRES_NOISE)).SetCheck(config.generalEmulation.enableHiresNoiseDithering == 0 ? BST_CHECKED : BST_UNCHECKED); } void CVideoTab::SaveSettings() @@ -332,4 +343,9 @@ void CVideoTab::SaveSettings() { config.texture.screenShotFormat = 1; } + + config.generalEmulation.rdramImageDitheringMode = CComboBox(GetDlgItem(IDC_CMB_PATTERN)).GetCurSel(); + config.generalEmulation.enableDitheringPattern = CButton(GetDlgItem(IDC_CHK_APPLY_TO_OUTPUT)).GetCheck() == BST_CHECKED ? 1 : 0; + config.generalEmulation.enableDitheringQuantization = CButton(GetDlgItem(IDC_CHK_5BIT_QUANTIZATION)).GetCheck() == BST_CHECKED ? 1 : 0; + config.generalEmulation.enableHiresNoiseDithering = CButton(GetDlgItem(IDC_CHK_HIRES_NOISE)).GetCheck() == BST_CHECKED ? 1 : 0; }