]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Scaling updates
authorToni Wilen <twilen@winuae.net>
Fri, 13 Mar 2026 19:14:57 +0000 (21:14 +0200)
committerToni Wilen <twilen@winuae.net>
Fri, 13 Mar 2026 19:14:57 +0000 (21:14 +0200)
custom.cpp
drawing.cpp
od-win32/win32_scaler.cpp

index ae9ab65614aeb4226a2ab516956207776a5f8780..1df9651ae2888e0a90f6e51335c8f0db48ff7ba2 100644 (file)
@@ -2210,6 +2210,11 @@ static void init_beamcon0(void)
        }
 
        int hpixels = maxhpos_display * 2;
+       if (currprefs.gfx_resolution == RES_LORES) {
+               hpixels /= 2;
+       } else if (currprefs.gfx_resolution == RES_SUPERHIRES) {
+               hpixels *= 2;
+       }
        int vpixels = vsync_lines - minfirstline;
        int hpixelsd = hpixels * 80 / 100;
        if (hpixelsd < vpixels) {
@@ -2231,6 +2236,9 @@ static void init_beamcon0(void)
                }
        } else if (hpixelsd > vpixels * 2) {
                doublescan2x = -1;
+               if (hpixelsd > vpixels * 4) {
+                       doublescan2x = -2;
+               }
        }
 
        if (maxvpos_nom >= MAXVPOS) {
index 821ad32975e753f10b5ed3f77fefe54872b1173f..abb89fe34a0c56129299a7086611ea12560a3160 100644 (file)
@@ -3246,7 +3246,7 @@ int getvresolution(void)
 
 int gethresolution(void)
 {
-       int h = currprefs.gfx_resolution - doublescan2x - doublescan2xx;
+       int h = currprefs.gfx_resolution - doublescan2xx;
        if (h < 0) {
                h = 0;
        }
index abb79070050224613f9617afaddfe88a979d17ea..80847b502bc489eeadc4ca63e2297041eee6b3eb 100644 (file)
@@ -272,6 +272,22 @@ void getfilterdata(int monid, struct displayscale *ds)
        float xmult = filter_horiz_zoom_mult;
        float ymult = filter_vert_zoom_mult;
 
+       if (doublescan2x > 0) {
+               float ds = 2.0f * doublescan2x;
+               if (ymult >= ds) {
+                       ymult /= ds;
+               } else {
+                       xmult *= ds;
+               }
+       } else if (doublescan2x < 0) {
+               float ds = 2.0f * (-doublescan2x);
+               if (xmult >= ds) {
+                       xmult /= ds;
+               } else {
+                       ymult *= ds;
+               }
+       }
+
        int scalemode = currprefs.gf[idx].gfx_filter_autoscale;
        int oscalemode = changed_prefs.gf[idx].gfx_filter_autoscale;
        if (scalemode == AUTOSCALE_OVERSCAN_BLANK) {
@@ -414,6 +430,9 @@ void getfilterdata(int monid, struct displayscale *ds)
                                }
 #endif
 
+                               vres = 2 + (doublescan2x > 0 ? doublescan2x : 0);
+                               hres = 2 + (doublescan2x < 0 ? -doublescan2x : 0);
+
                                int cw2 = cw + (int)(cw * filter_horiz_zoom);
                                int ch2 = ch + (int)(ch * filter_vert_zoom);
                                int adjw = cw2 * 5 / 100;
@@ -529,19 +548,12 @@ void getfilterdata(int monid, struct displayscale *ds)
 
                                float scalex = ds->scale;
                                float scaley = ds->scale;
-                               float scale2x = 1.0;
-                               float scale2y = 1.0;
-                               if (doublescan2x > 0) {
-                                       scale2x = 0.5 / doublescan2x;
-                               } else if (doublescan2x < 0) {
-                                       scale2y = 0.5 / (-doublescan2x);
-                               }
 
                                int ww = cw * scalex;
                                int hh = ch * scaley;
 
-                               ds->outwidth = ds->dstwidth * scalex * scale2x;
-                               ds->outheight = ds->dstheight * scaley * scale2y;
+                               ds->outwidth = ds->dstwidth * scalex;
+                               ds->outheight = ds->dstheight * scaley;
                                ds->xoffset += cx * scalex - (ds->outwidth - ww) / 2;
                                ds->yoffset += cy * scaley - (ds->outheight - hh) / 2;
 
@@ -690,11 +702,6 @@ void getfilterdata(int monid, struct displayscale *ds)
 
                int dw = ds->dstwidth;
                int dh = ds->dstheight;
-               if (doublescan2x > 0) {
-                       dw >>= doublescan2x;
-               } else if (doublescan2x < 0) {
-                       dh >>= -doublescan2x;
-               }
 
                ds->outwidth = dw;
                ds->outheight = dh;