From 04f131f97991508c9d0006d07498bf5e51e92913 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 26 May 2020 21:30:57 +1000 Subject: [PATCH] GPU/OpenGL: Fix 24-bit progressive scanout regression --- src/core/gpu_hw_opengl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index ce1401373..055c4bb8c 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -612,10 +612,10 @@ void GPU_HW_OpenGL::UpdateDisplay() m_display_texture.BindFramebuffer(GL_DRAW_FRAMEBUFFER); m_vram_texture.Bind(); - const u8 interleaved_shift = BoolToUInt8(!m_GPUSTAT.vertical_resolution); - const u32 flipped_vram_offset_y = VRAM_HEIGHT - vram_offset_y - (display_height >> interleaved_shift); + const u8 height_div2 = BoolToUInt8(interlaced == GPU_HW::InterlacedRenderMode::SeparateFields); + const u32 flipped_vram_offset_y = VRAM_HEIGHT - vram_offset_y - (display_height >> height_div2); const u32 scaled_flipped_vram_offset_y = - m_vram_texture.GetHeight() - scaled_vram_offset_y - (scaled_display_height >> interleaved_shift); + m_vram_texture.GetHeight() - scaled_vram_offset_y - (scaled_display_height >> height_div2); const u32 reinterpret_field_offset = GetInterlacedDisplayLineOffset(); const u32 reinterpret_start_x = m_crtc_state.regs.X * m_resolution_scale; const u32 reinterpret_crop_left = (m_crtc_state.display_vram_left - m_crtc_state.regs.X) * m_resolution_scale;