]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix autoscale filter.
authorToni Wilen <twilen@winuae.net>
Mon, 13 Jan 2025 19:34:20 +0000 (21:34 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 13 Jan 2025 19:34:20 +0000 (21:34 +0200)
custom.cpp
drawing.cpp

index d38f9a64cc12c4d6008bf6d1489976dd604c2ab9..8b99e24a6f71c085e0d99f7775b8ab00afb8a662 100644 (file)
@@ -10284,7 +10284,7 @@ static void decide_line_end(void)
 
 static void draw_line(int hpos)
 {
-       hdisplay_left_border = (get_cck_cycles() - agnus_trigger_cck) - REFRESH_FIRST_HPOS;
+       hdisplay_left_border = (get_cck_cycles() - agnus_trigger_cck) - REFRESH_FIRST_HPOS + display_hstart_cyclewait_skip;
        int dvp = calculate_linetype(linear_display_vpos);
 
        int wclks = hpos - (display_hstart_cyclewait_skip - display_hstart_cyclewait_skip2);
index ca636e28d0d4292f9688400cc784a48422262c1e..694f86f9544e523368696d2df62e1bc3d6e026c9 100644 (file)
@@ -578,7 +578,7 @@ void set_custom_limits (int w, int h, int dx, int dy, bool blank)
        check_custom_limits();
 }
 
-void store_custom_limits (int w, int h, int x, int y)
+void store_custom_limits(int w, int h, int x, int y)
 {
        stored_left_start = x;
        stored_top_start = y;
@@ -594,14 +594,14 @@ void store_custom_limits (int w, int h, int x, int y)
 #endif
 }
 
-int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
+int get_custom_limits(int *pw, int *ph, int *pdx, int *pdy, int *prealh)
 {
        struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
        int w, h, dx, dy, y1, y2, dbl1, dbl2;
        int ret = 0;
 
        if (!pw || !ph || !pdx || !pdy) {
-               reset_custom_limits ();
+               reset_custom_limits();
                return 0;
        }
 
@@ -666,16 +666,20 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
        }
 
        w = diwlast - diwfirst;
-       dx = diwfirst - (hdisplay_left_border << (RES_MAX + 1));
+       dx = diwfirst - (hdisplay_left_border << (RES_MAX + 1)) + (1 << RES_MAX);
 
-       w >>= (RES_MAX - currprefs.gfx_resolution);
-       dx >>= (RES_MAX - currprefs.gfx_resolution);
+       w >>= (RES_MAX - hresolution);
+       dx >>= (RES_MAX - hresolution);
 
        y2 = plflastline_total;
        y1 = plffirstline_total;
+       if (exthblankon_ecs) {
+               y1--;
+       }
 
-       if (minfirstline_linear > y1)
+       if (minfirstline_linear > y1) {
                y1 = minfirstline_linear;
+       }
 
        dbl2 = dbl1 = currprefs.gfx_vresolution;
        if (doublescan > 0 && interlace_seen <= 0) {
@@ -691,7 +695,7 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
                if (ret < 0)
                        return 1;
                h = currprefs.ntscmode ? 200 : 240;
-               w = 320 << currprefs.gfx_resolution;
+               w = 320 << hresolution;
                dy = 36 / 2;
                dx = 58;
        }
@@ -703,13 +707,13 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
        if (programmedmode != 1 && plffirstline_total < 30000) {
                int th = (current_linear_vpos - minfirstline_linear) * 95 / 100;
                if (th > h) {
-                       th = xshift (th, dbl1);
+                       th = xshift(th, dbl1);
                        *prealh = th;
                }
        }
 
-       dy = xshift (dy, dbl2);
-       h = xshift (h, dbl1);
+       dy = xshift(dy, dbl2);
+       h = xshift(h, dbl1);
 
        if (w == 0 || h == 0)
                return 0;
@@ -757,8 +761,8 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
        *pdx = dx;
        *pdy = dy;
 #if 1
-       write_log (_T("Display Size: %dx%d Offset: %dx%d\n"), w, h, dx, dy);
-       write_log (_T("First: %d Last: %d Min: %d\n"),
+       write_log(_T("Display Size: %dx%d Offset: %dx%d\n"), w, h, dx, dy);
+       write_log(_T("First: %d Last: %d Min: %d\n"),
                plffirstline_total, plflastline_total,
                minfirstline);
 #endif