]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
VGA mode resolution autoswitch update
authorToni Wilen <twilen@winuae.net>
Mon, 10 Apr 2023 13:48:03 +0000 (16:48 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 10 Apr 2023 13:48:03 +0000 (16:48 +0300)
drawing.cpp
od-win32/win32_scaler.cpp

index 3e48f3817c452fb17ed8bb6be34df330ae02d472..4909cef50347598907f3dbe7242afd566835af87 100644 (file)
@@ -4138,13 +4138,19 @@ static void init_drawing_frame (void)
                                vidinfo->gfx_vresolution_reserved = VRES_DOUBLE;
                                graphics_reset(false);
                        }
-                       int newres = largest_res;
-                       if (htotal < 190)
-                               newres = largest_res + 1;
-                       if (newres < RES_HIRES)
+                       int newres = RES_HIRES;
+                       int hres = (2 * htotal) << largest_res;
+                       if (hres > 1000) {
+                               newres = RES_SUPERHIRES;
+                       } else {
+                               newres = RES_HIRES;
+                       }
+                       if (newres < RES_HIRES) {
                                newres = RES_HIRES;
-                       if (newres > RES_MAX)
+                       }
+                       if (newres > RES_MAX) {
                                newres = RES_MAX;
+                       }
                        if (changed_prefs.gfx_resolution != newres) {
                                autoswitch_old_resolution = RES_HIRES;
                                write_log(_T("Programmed mode autores = %d -> %d (%d)\n"), changed_prefs.gfx_resolution, newres, largest_res);
index 13b5e3060d40a5522b1eb446ac3d9266975f78bc..574383fdb70e16b9c7fcb196af8fe23d53227e04 100644 (file)
@@ -451,15 +451,23 @@ void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int
 
                                float multadd = 1.0f / (1 << currprefs.gf[idx].gfx_filter_integerscalelimit);
                                if (cw2 > maxw || ch2 > maxh) {
-                                       while (cw2 / mult - adjw > maxw || ch2 / mult - adjh > maxh)
+                                       while (cw2 / mult - adjw > maxw || ch2 / mult - adjh > maxh) {
                                                mult += multadd;
-                                       maxw = (int)(maxw * mult);
-                                       maxh = (int)(maxh * mult);
+                                       }
+                                       float multx = mult, multy = mult;
+                                       maxw = (int)(maxw * multx);
+                                       maxh = (int)(maxh * multy);
                                } else {
-                                       while (cw2 * (mult + multadd) - adjw <= maxw && ch2 * (mult + multadd) - adjh <= maxh)
+                                       while (cw2 * (mult + multadd) - adjw <= maxw && ch2 * (mult + multadd) - adjh <= maxh) {
                                                mult += multadd;
-                                       maxw = (int)((maxw + mult - multadd) / mult);
-                                       maxh = (int)((maxh + mult - multadd) / mult);
+                                       }
+                                       float multx = mult, multy = mult;
+                                       // if width is smaller than height, double width (programmed modes)
+                                       if (cw2 * (mult + multadd) - adjw <= maxw && cw2 < ch2) {
+                                               multx += multadd;
+                                       }
+                                       maxw = (int)((maxw + multx - multadd) / multx);
+                                       maxh = (int)((maxh + multy - multadd) / multy);
                                }
 
                                *mode = 1;