]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Autoscale and integer scale fixes and updates
authorToni Wilen <twilen@winuae.net>
Fri, 19 May 2023 18:57:13 +0000 (21:57 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 19 May 2023 18:57:13 +0000 (21:57 +0300)
custom.cpp
drawing.cpp
include/custom.h
od-win32/win32_scaler.cpp

index 8719083e083223cae7d8a30d904bcd31384e5245..d20801b0751c7171991e2baf8fd9271a329f6057 100644 (file)
@@ -307,7 +307,7 @@ int maxhpos_short = MAXHPOS_PAL;
 int maxvpos = MAXVPOS_PAL;
 int maxvpos_nom = MAXVPOS_PAL; // nominal value (same as maxvpos but "faked" maxvpos in fake 60hz modes)
 int maxvpos_display = MAXVPOS_PAL; // value used for display size
-static int maxhpos_display = AMIGA_WIDTH_MAX;
+int maxhpos_display = AMIGA_WIDTH_MAX;
 int maxvpos_display_vsync; // extra lines from top visible in bottom
 static int vblank_extraline;
 static int maxhposm1;
@@ -12576,24 +12576,26 @@ static void reset_autoscale(void)
        autoscale_bordercolors = 0;
 }
 
-static void hautoscale_check(void)
+static void hautoscale_check(int vp)
 {
+       int vp_start = vp;
+       int vp_end = vp + 1;
        // border detection/autoscale
        if (GET_PLANES(bplcon0) > 0 && dmaen(DMA_BITPLANE) && !vb_state && !vb_end_line && !vb_start_line) {
                if (first_bplcon0 == 0) {
                        first_bplcon0 = bplcon0;
                }
-               if (vpos > last_planes_vpos) {
-                       last_planes_vpos = vpos;
+               if (vp_end > last_planes_vpos) {
+                       last_planes_vpos = vp_end;
                }
-               if (vpos >= minfirstline && first_planes_vpos == 0) {
-                       first_planes_vpos = vpos;
-               } else if (vpos >= current_maxvpos() - 1) {
+               if (vp_start >= minfirstline && first_planes_vpos == 0) {
+                       first_planes_vpos = vp_start;
+               } else if (vp_end >= current_maxvpos() - 1) {
                        last_planes_vpos = current_maxvpos();
                }
        }
        if (diw_change == 0) {
-               if (vpos >= first_planes_vpos && vpos <= last_planes_vpos) {
+               if (vp_start >= first_planes_vpos && vp_end <= last_planes_vpos) {
                        int diwlastword_lores = diwlastword;
                        int diwfirstword_lores = diwfirstword;
                        if (diwlastword_lores > diwlastword_total) {
@@ -12619,7 +12621,7 @@ static void hautoscale_check(void)
                                ddflastword_total = plfstop + 2 * f;
                        }
                }
-               if ((plffirstline < plffirstline_total || (plffirstline_total == minfirstline && vpos > minfirstline)) && plffirstline < maxvpos / 2) {
+               if ((plffirstline < plffirstline_total || (plffirstline_total == minfirstline && vp_start > minfirstline)) && plffirstline < maxvpos / 2) {
                        firstword_bplcon1 = bplcon1;
                        if (plffirstline < minfirstline) {
                                plffirstline_total = minfirstline;
@@ -12654,7 +12656,7 @@ static void hsync_handlerh(bool onvsync)
 
                notice_resolution_seen(GET_RES_AGNUS(bplcon0), interlace_seen != 0);
 
-               hautoscale_check();
+               hautoscale_check(vposh);
 
                int lineno = calculate_lineno(vposh);
                next_lineno = lineno;
@@ -12662,6 +12664,7 @@ static void hsync_handlerh(bool onvsync)
        }
 
        vposh++;
+
        hpos_hsync_extra = 0;
        estimate_last_fetch_cycle(hpos);
 
index 007fcc895b37b5f38b835a665967ddcb93d49ce8..59cda0eee262f496563acdf94e6489862e25fd94 100644 (file)
@@ -856,11 +856,6 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
                if (!lof_display)
                        return ret;
                interlace_count = 0;
-               /* program may have set last visible line as last possible line (CD32 boot screen) */
-               if (last_planes_vpos < maxvpos)
-                       last_planes_vpos++;
-               if (plflastline_total < maxvpos)
-                       plflastline_total++;
        }
 
        if (plflastline_total < 4)
@@ -906,7 +901,7 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
                dbl2--;
        }
 
-       h = y2 - y1 + 1;
+       h = y2 - y1;
        dy = y1 - minfirstline;
 
        if (first_planes_vpos == 0) {
index 9e2986774e97941a0cfebacfb038b78f8b8f7343..86742083d2b2399626dbd1ae0f980d6c151604af 100644 (file)
@@ -147,7 +147,7 @@ extern uae_u16 INTREQR(void);
 #define OCS_DENISE_HBLANK_DISABLE_HPOS 0x2d
 
 extern int maxhpos, maxhposm0, maxhpos_short;
-extern int maxvpos, maxvpos_nom, maxvpos_display, maxvpos_display_vsync;
+extern int maxvpos, maxvpos_nom, maxvpos_display, maxvpos_display_vsync, maxhpos_display;
 extern int hsyncstartpos_hw, hsyncendpos_hw;
 extern int minfirstline, vblank_endline, numscrlines;
 extern float vblank_hz, fake_vblank_hz;
index ceb8ffe4ea6f9bc4fcf42608316e1c5731dd295d..c379f286fac2a727309eada0831f53a967c91632 100644 (file)
@@ -117,7 +117,12 @@ static void getmanualpos(int monid, int *cxp, int *cyp, int *cwp, int *chp)
                if (programmedmode && native) {
                        cw = avidinfo->outbuffer->outwidth << (RES_MAX - currprefs.gfx_resolution);
                } else {
-                       cw = native ? AMIGA_WIDTH_MAX << RES_MAX : avidinfo->outbuffer->outwidth;
+                       if (currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN) {
+                               // keep old version compatibility
+                               cw = native ? AMIGA_WIDTH_MAX << RES_MAX : avidinfo->outbuffer->outwidth;
+                       } else {
+                               cw = native ? maxhpos_display << RES_MAX : avidinfo->outbuffer->outwidth;
+                       }
                }
        } else {
                cw = v;
@@ -128,8 +133,11 @@ static void getmanualpos(int monid, int *cxp, int *cyp, int *cwp, int *chp)
        if (v <= 0) {
                if (programmedmode && native) {
                        ch = avidinfo->outbuffer->outheight << (VRES_MAX - currprefs.gfx_vresolution);
-               } else {
+               } else if (currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN) {
+                       // keep old version compatiblity
                        ch = native ? AMIGA_HEIGHT_MAX << VRES_MAX : avidinfo->outbuffer->outheight;
+               } else {
+                       ch = native ? (maxvpos_display + maxvpos_display_vsync - minfirstline) << VRES_MAX : avidinfo->outbuffer->outheight;
                }
        } else {
                ch = v;