From e42d5fed75dfd7affb48299f86b12610e9280672 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Sat, 4 Jul 2020 17:59:14 -0700 Subject: [PATCH] GPU: Adjust 4-pixel boundary alignment formula Fixes missing edge in Tenchi wo Kurau II: Sekiheki no Tatakai. --- src/core/gpu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 0ff451064..6c4bd284a 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -612,7 +612,8 @@ void GPU::UpdateCRTCDisplayParameters() } // align to 4-pixel boundary - cs.display_vram_width = ((horizontal_active_ticks / cs.dot_clock_divider) + 2u) & ~3u; + cs.display_vram_width = + (static_cast(std::round(horizontal_active_ticks / static_cast(cs.dot_clock_divider))) + 2u) & ~3u; // apply the crop from the start (usually overscan) cs.display_vram_width -= std::min(cs.display_vram_width, horizontal_skip_pixels);