From: Toni Wilen Date: Sat, 16 Sep 2023 18:23:22 +0000 (+0300) Subject: Fix VideoDAC18 X-Git-Tag: 5.1.0~116 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c58eee00c1c36eee44482ee42da64c4807d9d441;p=francis%2Fwinuae.git Fix VideoDAC18 --- diff --git a/specialmonitors.cpp b/specialmonitors.cpp index bf2e3472..43311a3e 100755 --- a/specialmonitors.cpp +++ b/specialmonitors.cpp @@ -1580,10 +1580,11 @@ static bool videodac18(struct vidbuffer *src, struct vidbuffer *dst, bool double return false; getsyncregisters(&hsstrt, &hsstop, &vsstrt, &vsstop); - if (hsstop >= (maxhpos & ~1)) - hsstrt = 0; - xstart = ((hsstrt * 2) << RES_MAX) - src->xoffset; - xstop = ((hsstop * 2) << RES_MAX) - src->xoffset; + if (hsstop < hsstrt) { + hsstop += maxhpos + 1; + } + xstart = (hsstrt << RES_MAX) - src->xoffset; + xstop = (hsstop << RES_MAX) - src->xoffset; isntsc = (beamcon0 & 0x20) ? 0 : 1; if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS)) @@ -1631,7 +1632,7 @@ static bool videodac18(struct vidbuffer *src, struct vidbuffer *dst, bool double } else { g = data; } - if (y >= vsstrt && y < vsstop && x >= xstart && y < xstop) { + if (y >= vsstrt && y < vsstop && x >= xstart && x < xstop) { PUT_PRGB(d, d2, dst, r, g, b, xaddpix, doublelines, true); } else { PUT_AMIGARGB(d, s, d2, s2, dst, xaddpix, doublelines, true);