From: Toni Wilen Date: Fri, 13 Mar 2026 19:14:57 +0000 (+0200) Subject: Scaling updates X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=0631643106282a2698e994f35effd5f800de20eb;p=francis%2Fwinuae.git Scaling updates --- diff --git a/custom.cpp b/custom.cpp index ae9ab656..1df9651a 100644 --- a/custom.cpp +++ b/custom.cpp @@ -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) { diff --git a/drawing.cpp b/drawing.cpp index 821ad329..abb89fe3 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -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; } diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index abb79070..80847b50 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -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;