From 179a7aea8941c917db29ec7149f9aca4f076da1e Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 31 May 2021 03:48:38 +1000 Subject: [PATCH] GPU/HW: Assume 240/288p for auto scale on start with all borders --- src/core/gpu_hw.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index b2be7883f..3c90e6616 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -207,8 +207,12 @@ u32 GPU_HW::CalculateResolutionScale() const } else { - // auto scaling - const s32 height = (m_crtc_state.display_height != 0) ? static_cast(m_crtc_state.display_height) : 480; + // Auto scaling. When the system is starting and all borders crop is enabled, the registers are zero, and + // display_height therefore is also zero. Use the default size from the region in this case. + const s32 height = (m_crtc_state.display_height != 0) ? + 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)); const s32 preferred_scale = static_cast(std::ceil(static_cast(m_host_display->GetWindowHeight()) / height)); Log_InfoPrintf("Height = %d, preferred scale = %d", height, preferred_scale);