diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index e3f95967d..d8f81fff4 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -525,8 +525,17 @@ u32 GPU_HW::CalculateResolutionScale() const static_cast(m_crtc_state.display_height) : (m_console_is_pal ? (PAL_VERTICAL_ACTIVE_END - PAL_VERTICAL_ACTIVE_START) : (NTSC_VERTICAL_ACTIVE_END - NTSC_VERTICAL_ACTIVE_START)); + + float widescreen_multiplier = 1.0f; + if (g_settings.gpu_widescreen_hack) { + // Multiply scale factor by aspect ratio relative to 4:3, so that widescreen resolution is as close as possible to native screen resolution. + // Otherwise, anamorphic stretching would result in increasingly less horizontal resolution (relative to native screen resolution) + // as the aspect ratio gets wider. + widescreen_multiplier = std::max(1.0, (float(g_gpu_device->GetWindowWidth()) / g_gpu_device->GetWindowHeight()) / (4.0 / 3.0)); + } + const s32 preferred_scale = - static_cast(std::ceil(static_cast(g_gpu_device->GetWindowHeight()) / height)); + static_cast(std::ceil(static_cast(g_gpu_device->GetWindowHeight() * widescreen_multiplier) / height)); Log_VerboseFmt("Height = {}, preferred scale = {}", height, preferred_scale); scale = static_cast(std::clamp(preferred_scale, 1, max_resolution_scale));