From 4eeececd37a5a86123d97618d7e87bb1f2bc02ae Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 5 Jan 2025 18:23:54 +0200 Subject: [PATCH] Fix internal buffer height calculation. --- custom.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.47.3