From 7779a54bc5c0a097ca60cd73c64cda589435d7f4 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 11 Apr 2020 16:37:51 +1000 Subject: [PATCH] GPU: Rename 'Force Progressive Scan' to 'Disable Interlacing' It affects rendering as well as display/scanout now, after all. --- src/core/gpu.cpp | 4 ++-- src/core/gpu_hw_shadergen.cpp | 2 -- src/core/host_interface.cpp | 8 ++++---- src/core/settings.cpp | 8 ++++---- src/core/settings.h | 4 ++-- src/duckstation-qt/gpusettingswidget.cpp | 3 +-- src/duckstation-qt/gpusettingswidget.ui | 4 ++-- src/duckstation-sdl/sdl_host_interface.cpp | 2 +- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index cb9273bb1..2537efe13 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -27,7 +27,7 @@ bool GPU::Initialize(HostDisplay* host_display, System* system, DMA* dma, Interr m_dma = dma; m_interrupt_controller = interrupt_controller; m_timers = timers; - m_force_progressive_scan = m_system->GetSettings().display_force_progressive_scan; + m_force_progressive_scan = m_system->GetSettings().gpu_disable_interlacing; m_force_ntsc_timings = m_system->GetSettings().gpu_force_ntsc_timings; m_crtc_state.display_aspect_ratio = Settings::GetDisplayAspectRatioValue(m_system->GetSettings().display_aspect_ratio); @@ -38,7 +38,7 @@ bool GPU::Initialize(HostDisplay* host_display, System* system, DMA* dma, Interr void GPU::UpdateSettings() { - m_force_progressive_scan = m_system->GetSettings().display_force_progressive_scan; + m_force_progressive_scan = m_system->GetSettings().gpu_disable_interlacing; if (m_force_ntsc_timings != m_system->GetSettings().gpu_force_ntsc_timings) { diff --git a/src/core/gpu_hw_shadergen.cpp b/src/core/gpu_hw_shadergen.cpp index 386eab304..0b65932ba 100644 --- a/src/core/gpu_hw_shadergen.cpp +++ b/src/core/gpu_hw_shadergen.cpp @@ -783,8 +783,6 @@ std::string GPU_HW_ShaderGen::GenerateDisplayFragmentShader(bool depth_24bit, bo discard; #endif - //icoords.y = uint(fixYCoord(int(icoords.y))); - #if DEPTH_24BIT // relative to start of scanout uint relative_x = (icoords.x - u_vram_offset.x) / uint(RESOLUTION_SCALE); diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 3f12af2c2..c83af9a5a 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -873,15 +873,15 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si) si.SetStringValue("GPU", "Renderer", Settings::GetRendererName(Settings::DEFAULT_GPU_RENDERER)); si.SetIntValue("GPU", "ResolutionScale", 1); + si.SetBoolValue("GPU", "UseDebugDevice", false); si.SetBoolValue("GPU", "TrueColor", true); si.SetBoolValue("GPU", "ScaledDithering", false); si.SetBoolValue("GPU", "TextureFiltering", false); - si.SetBoolValue("GPU", "UseDebugDevice", false); + si.SetBoolValue("GPU", "DisableInterlacing", true); si.SetBoolValue("GPU", "ForceNTSCTimings", false); si.SetStringValue("Display", "CropMode", "Overscan"); si.SetStringValue("Display", "PixelAspectRatio", "4:3"); - si.SetBoolValue("Display", "ForceProgressiveScan", true); si.SetBoolValue("Display", "LinearFiltering", true); si.SetBoolValue("Display", "ShowOSDMessages", true); si.SetBoolValue("Display", "ShowFPS", false); @@ -928,8 +928,8 @@ void HostInterface::UpdateSettings(const std::function& apply_callback) const bool old_gpu_true_color = m_settings.gpu_true_color; const bool old_gpu_scaled_dithering = m_settings.gpu_scaled_dithering; const bool old_gpu_texture_filtering = m_settings.gpu_texture_filtering; + const bool old_gpu_disable_interlacing = m_settings.gpu_disable_interlacing; const bool old_gpu_force_ntsc_timings = m_settings.gpu_force_ntsc_timings; - const bool old_display_force_progressive_scan = m_settings.display_force_progressive_scan; const bool old_gpu_debug_device = m_settings.gpu_use_debug_device; const bool old_vsync_enabled = m_settings.video_sync_enabled; const bool old_audio_sync_enabled = m_settings.audio_sync_enabled; @@ -983,8 +983,8 @@ void HostInterface::UpdateSettings(const std::function& apply_callback) m_settings.gpu_true_color != old_gpu_true_color || m_settings.gpu_scaled_dithering != old_gpu_scaled_dithering || m_settings.gpu_texture_filtering != old_gpu_texture_filtering || + m_settings.gpu_disable_interlacing != old_gpu_disable_interlacing || m_settings.gpu_force_ntsc_timings != old_gpu_force_ntsc_timings || - m_settings.display_force_progressive_scan != old_display_force_progressive_scan || m_settings.display_crop_mode != old_display_crop_mode || m_settings.display_aspect_ratio != old_display_aspect_ratio) { diff --git a/src/core/settings.cpp b/src/core/settings.cpp index a1a780118..054275bdb 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -23,10 +23,11 @@ void Settings::Load(SettingsInterface& si) gpu_renderer = ParseRendererName(si.GetStringValue("GPU", "Renderer", GetRendererName(DEFAULT_GPU_RENDERER)).c_str()) .value_or(DEFAULT_GPU_RENDERER); gpu_resolution_scale = static_cast(si.GetIntValue("GPU", "ResolutionScale", 1)); + gpu_use_debug_device = si.GetBoolValue("GPU", "UseDebugDevice", false); gpu_true_color = si.GetBoolValue("GPU", "TrueColor", true); gpu_scaled_dithering = si.GetBoolValue("GPU", "ScaledDithering", false); gpu_texture_filtering = si.GetBoolValue("GPU", "TextureFiltering", false); - gpu_use_debug_device = si.GetBoolValue("GPU", "UseDebugDevice", false); + gpu_disable_interlacing = si.GetBoolValue("GPU", "DisableInterlacing", true); gpu_force_ntsc_timings = si.GetBoolValue("GPU", "ForceNTSCTimings", false); display_crop_mode = ParseDisplayCropMode( @@ -36,7 +37,6 @@ void Settings::Load(SettingsInterface& si) ParseDisplayAspectRatio( si.GetStringValue("Display", "AspectRatio", GetDisplayAspectRatioName(DisplayAspectRatio::R4_3)).c_str()) .value_or(DisplayAspectRatio::R4_3); - display_force_progressive_scan = si.GetBoolValue("Display", "ForceProgressiveScan", true); display_linear_filtering = si.GetBoolValue("Display", "LinearFiltering", true); display_show_osd_messages = si.GetBoolValue("Display", "ShowOSDMessages", true); display_show_fps = si.GetBoolValue("Display", "ShowFPS", false); @@ -90,15 +90,15 @@ void Settings::Save(SettingsInterface& si) const si.SetStringValue("GPU", "Renderer", GetRendererName(gpu_renderer)); si.SetIntValue("GPU", "ResolutionScale", static_cast(gpu_resolution_scale)); + si.SetBoolValue("GPU", "UseDebugDevice", gpu_use_debug_device); si.SetBoolValue("GPU", "TrueColor", gpu_true_color); si.SetBoolValue("GPU", "ScaledDithering", gpu_scaled_dithering); si.SetBoolValue("GPU", "TextureFiltering", gpu_texture_filtering); - si.SetBoolValue("GPU", "UseDebugDevice", gpu_use_debug_device); + si.SetBoolValue("GPU", "DisableInterlacing", gpu_disable_interlacing); si.SetBoolValue("GPU", "ForceNTSCTimings", gpu_force_ntsc_timings); si.SetStringValue("Display", "CropMode", GetDisplayCropModeName(display_crop_mode)); si.SetStringValue("Display", "AspectRatio", GetDisplayAspectRatioName(display_aspect_ratio)); - si.SetBoolValue("Display", "ForceProgressiveScan", display_force_progressive_scan); si.SetBoolValue("Display", "LinearFiltering", display_linear_filtering); si.SetBoolValue("Display", "ShowOSDMessages", display_show_osd_messages); si.SetBoolValue("Display", "ShowFPS", display_show_fps); diff --git a/src/core/settings.h b/src/core/settings.h index be495d70f..e4306f5e4 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -47,14 +47,14 @@ struct Settings GPURenderer gpu_renderer = GPURenderer::Software; u32 gpu_resolution_scale = 1; + bool gpu_use_debug_device = false; bool gpu_true_color = true; bool gpu_scaled_dithering = false; bool gpu_texture_filtering = false; - bool gpu_use_debug_device = false; + bool gpu_disable_interlacing = false; bool gpu_force_ntsc_timings = false; DisplayCropMode display_crop_mode = DisplayCropMode::None; DisplayAspectRatio display_aspect_ratio = DisplayAspectRatio::R4_3; - bool display_force_progressive_scan = false; bool display_linear_filtering = true; bool display_show_osd_messages = false; bool display_show_fps = false; diff --git a/src/duckstation-qt/gpusettingswidget.cpp b/src/duckstation-qt/gpusettingswidget.cpp index c0721e13f..a071eb327 100644 --- a/src/duckstation-qt/gpusettingswidget.cpp +++ b/src/duckstation-qt/gpusettingswidget.cpp @@ -17,14 +17,13 @@ GPUSettingsWidget::GPUSettingsWidget(QtHostInterface* host_interface, QWidget* p &Settings::GetDisplayAspectRatioName); SettingWidgetBinder::BindWidgetToEnumSetting(m_host_interface, m_ui.displayCropMode, "Display/CropMode", &Settings::ParseDisplayCropMode, &Settings::GetDisplayCropModeName); - SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.forceProgressiveScan, - "Display/ForceProgressiveScan"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.displayLinearFiltering, "Display/LinearFiltering"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.vsync, "Display/VSync"); SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.resolutionScale, "GPU/ResolutionScale"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.trueColor, "GPU/TrueColor"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.scaledDithering, "GPU/ScaledDithering"); + SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.disableInterlacing, "GPU/DisableInterlacing"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.forceNTSCTimings, "GPU/ForceNTSCTimings"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.linearTextureFiltering, "GPU/TextureFiltering"); diff --git a/src/duckstation-qt/gpusettingswidget.ui b/src/duckstation-qt/gpusettingswidget.ui index a42d62ffb..d8c8a6e69 100644 --- a/src/duckstation-qt/gpusettingswidget.ui +++ b/src/duckstation-qt/gpusettingswidget.ui @@ -126,9 +126,9 @@ - + - Force Progressive Scan + Disable Interlacing (force progressive render/scan) diff --git a/src/duckstation-sdl/sdl_host_interface.cpp b/src/duckstation-sdl/sdl_host_interface.cpp index 9c1afdd1c..5d0b904f8 100644 --- a/src/duckstation-sdl/sdl_host_interface.cpp +++ b/src/duckstation-sdl/sdl_host_interface.cpp @@ -1166,8 +1166,8 @@ void SDLHostInterface::DrawSettingsWindow() settings_changed |= ImGui::Checkbox("True 24-bit Color (disables dithering)", &m_settings_copy.gpu_true_color); settings_changed |= ImGui::Checkbox("Texture Filtering", &m_settings_copy.gpu_texture_filtering); + settings_changed |= ImGui::Checkbox("Disable Interlacing", &m_settings_copy.gpu_disable_interlacing); settings_changed |= ImGui::Checkbox("Force NTSC Timings", &m_settings_copy.gpu_force_ntsc_timings); - settings_changed |= ImGui::Checkbox("Force Progressive Scan", &m_settings_copy.display_force_progressive_scan); } ImGui::EndTabItem();