diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index 86afe2ac4..ce1401373 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -612,9 +612,10 @@ void GPU_HW_OpenGL::UpdateDisplay() m_display_texture.BindFramebuffer(GL_DRAW_FRAMEBUFFER); m_vram_texture.Bind(); - const u32 flipped_vram_offset_y = VRAM_HEIGHT - vram_offset_y - display_height; + 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 u32 scaled_flipped_vram_offset_y = - m_vram_texture.GetHeight() - scaled_vram_offset_y - scaled_display_height; + m_vram_texture.GetHeight() - scaled_vram_offset_y - (scaled_display_height >> interleaved_shift); 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; @@ -623,7 +624,7 @@ void GPU_HW_OpenGL::UpdateDisplay() UploadUniformBuffer(uniforms, sizeof(uniforms)); m_batch_ubo_dirty = true; - glViewport(0, reinterpret_field_offset, scaled_display_width, scaled_display_height); + glViewport(0, 0, scaled_display_width, scaled_display_height); glBindVertexArray(m_attributeless_vao_id); glDrawArrays(GL_TRIANGLES, 0, 3); diff --git a/src/core/gpu_hw_shadergen.cpp b/src/core/gpu_hw_shadergen.cpp index 63951cabe..c40ad9531 100644 --- a/src/core/gpu_hw_shadergen.cpp +++ b/src/core/gpu_hw_shadergen.cpp @@ -1026,7 +1026,7 @@ std::string GPU_HW_ShaderGen::GenerateDisplayFragmentShader(bool depth_24bit, GP uint2 icoords = uint2(v_pos.xy); #if INTERLACED - if (((icoords.y / RESOLUTION_SCALE) & 1u) != u_field_offset) + if (((fixYCoord(icoords.y) / RESOLUTION_SCALE) & 1u) != u_field_offset) discard; #if !INTERLEAVED