]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix right overscan corruption in NTSC modes if hblank started earlier than end of...
authorToni Wilen <twilen@winuae.net>
Sun, 7 Jan 2024 09:44:12 +0000 (11:44 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 7 Jan 2024 09:44:12 +0000 (11:44 +0200)
drawing.cpp

index 9990f132d8b2b8def618552f8c6b1dcaae71e156..bafccb0a731edcd09fd6a2ae2cc93bcc1ab717a3 100644 (file)
@@ -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;
                                }
                        }