From 4044b5a073909727d450de0397be3049d23726c4 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 14 Apr 2018 10:31:06 +0300 Subject: [PATCH] Fix vertical centering in low latency mode. --- drawing.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drawing.cpp b/drawing.cpp index 37a4ae9c..3fba5c67 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -3712,6 +3712,12 @@ void draw_lines(int end, int section) if (end < 0) return; end <<= linedbl; + if (min_ypos_for_screen > 0 && thisframe_y_adjust_real > 0) { + end += min_ypos_for_screen; + end -= thisframe_y_adjust_real; + if (end < 0) + return; + } vidinfo->outbuffer = vb; if (!lockscr(vb, false, vb->last_drawn_line ? false : true)) @@ -3722,12 +3728,15 @@ void draw_lines(int end, int section) int line = i + thisframe_y_adjust_real; int whereline = amiga2aspect_line_map[i1]; int wherenext = amiga2aspect_line_map[i1 + 1]; - if (whereline >= vb->inheight) + if (whereline >= vb->inheight) { + y_end = vb->inheight - 1; break; + } if (whereline < 0) continue; - if (y_start < 0) + if (y_start < 0) { y_start = whereline; + } hposblank = 0; pfield_draw_line(vb, line, whereline, wherenext); -- 2.47.3