From: Toni Wilen Date: Sun, 5 Jan 2025 16:23:54 +0000 (+0200) Subject: Fix internal buffer height calculation. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=4eeececd37a5a86123d97618d7e87bb1f2bc02ae;p=francis%2Fwinuae.git Fix internal buffer height calculation. --- diff --git a/custom.cpp b/custom.cpp index f29e9eca..c3bfc3c2 100644 --- a/custom.cpp +++ b/custom.cpp @@ -1565,8 +1565,9 @@ void compute_framesync(void) if (vidinfo->drawbuffer.extrawidth == -2 && ((new_beamcon0 & (BEAMCON0_VARVBEN | bemcon0_vsync_mask)) || currprefs.gfx_overscanmode >= OVERSCANMODE_EXTREME)) { vidinfo->drawbuffer.extrawidth = -1; } - int maxv = current_linear_vpos - (minfirstline > vsync_startline ? minfirstline - vsync_startline : 0); - vidinfo->drawbuffer.inheight = (maxv + 1) << vres2; + int mfl = minfirstline + 1; + int maxv = current_linear_vpos - (mfl > vsync_startline ? mfl - vsync_startline : 0); + vidinfo->drawbuffer.inheight = maxv << vres2; vidinfo->drawbuffer.inheight2 = vidinfo->drawbuffer.inheight; vidinfo->drawbuffer.inxoffset = 0;