]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Hide NTSC artifacts in normal overscan mode
authorToni Wilen <twilen@winuae.net>
Sun, 5 Jan 2025 11:11:21 +0000 (13:11 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 5 Jan 2025 11:11:21 +0000 (13:11 +0200)
custom.cpp
drawing.cpp

index 4ceb3fcbe784b039afdece34a084426119f4c9e7..f29e9ecaabb3500975cb6a31c3b14136fc52f254 100644 (file)
@@ -1701,7 +1701,7 @@ static void init_beamcon0(void)
                        display_hstart_cyclewait_end = 6;
                } else if (currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN) {
                        display_hstart_cyclewait = 32;
-                       display_hstart_cyclewait_end = 8;
+                       display_hstart_cyclewait_end = 7;
                } else if (currprefs.gfx_overscanmode == OVERSCANMODE_EXTREME) {
                        display_hstart_cyclewait = 22;
                        display_hstart_cyclewait_end = 0;
index d90199cb29b848f27a45eb50286e0752db1309f8..467f2a197563c8073d89204e2ad187187ec4c189 100644 (file)
@@ -306,7 +306,7 @@ static uae_u32 *buf1, *buf2, *buf_d;
 static uae_u16 *gbuf;
 static uae_u8 pixx0, pixx1, pixx2, pixx3;
 static uae_u32 debug_buf[256 * 2 * 4], debug_bufx[256 * 2 * 4];
-
+static uae_u32 *hbstrt_ptr1, *hbstrt_ptr2;
 
 void set_inhibit_frame(int monid, int bit)
 {
@@ -3992,6 +3992,8 @@ static uae_u32 denise_render_sprites_ecs_shres(void)
 static void do_hbstrt(int cnt)
 {
        denise_hblank = true;
+       hbstrt_ptr1 = buf1;
+       hbstrt_ptr2 = buf2;
        if (!exthblankon_ecs) {
                if (delayed_vblank_ecs > 0) {
 #ifdef DEBUGGER
@@ -4814,6 +4816,7 @@ void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, int start
        }
 
        get_line(gfx_ypos, how);
+       hbstrt_ptr1 = NULL;
 
        if (dtotal < 0 && currprefs.gfx_overscanmode < OVERSCANMODE_ULTRA) {
 
@@ -4873,6 +4876,17 @@ void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, int start
                        lts_changed = false;
                }
 
+               // blank last pixel row if normal overscan mode, it might have NTSC artifacts
+               if (hbstrt_ptr1 && currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN) {
+                       int add = 1 << hresolution;
+                       hbstrt_ptr1 -= denise_lol_shift_prev;
+                       hbstrt_ptr2 -= denise_lol_shift_prev;
+                       for (int i = 0; i < add; i++) {
+                               *hbstrt_ptr1++ = 0x000000;
+                               *hbstrt_ptr2++ = 0x000000;
+                       }
+               }
+
                if (currprefs.display_calibration && xlinebuffer) {
                        emulate_black_level_calibration(buf1t, buf2t, bufdt, total, calib_start, calib_len);
                }