From 94d8f5b1a15d187d44985492481ebe20e94f4c15 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 7 Jan 2024 11:44:12 +0200 Subject: [PATCH] Fix right overscan corruption in NTSC modes if hblank started earlier than end of screen (for example TV overscan modes) --- drawing.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drawing.cpp b/drawing.cpp index 9990f132..bafccb0a 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -638,7 +638,7 @@ static void set_hblanking_limits(void) // horizontal blanking bool hardwired = !dp_for_drawing || !ce_is_extblankset(colors_for_drawing.extra); bool doblank = false; - int hbstrt = ((maxhpos + 8) << CCK_SHRES_SHIFT) - 3; + int hbstrt = ((maxhpos_short + 8) << CCK_SHRES_SHIFT) - 3; int hbstop = (47 << CCK_SHRES_SHIFT) - 7; if (currprefs.gfx_overscanmode < OVERSCANMODE_OVERSCAN) { @@ -3749,7 +3749,7 @@ static void do_color_changes(line_draw_func worker_border, line_draw_func worker int hblank_right = exthblankon ? hblank_right_stop : hblank_right_stop_hard; // right border (playfield end to hblank start) - if (nextpos_in_range > lastpos && lastpos >= playfield_end_pre) { + if (nextpos_in_range > lastpos && lastpos >= playfield_end_pre && lastpos < hblank_right) { int t = nextpos_in_range <= hblank_right ? nextpos_in_range : hblank_right; (*worker_border)(lastpos, t, 0); lastpos = t; @@ -3757,7 +3757,7 @@ static void do_color_changes(line_draw_func worker_border, line_draw_func worker // right hblank (hblank start to right edge, hblank start may be earlier than playfield end) if (nextpos_in_range > hblank_right) { - (*worker_border) (hblank_right, nextpos_in_range, 1); + (*worker_border)(hblank_right, nextpos_in_range, 1); lastpos = nextpos_in_range; } } -- 2.47.3