# HG changeset patch # User TomW # Date 1404940379 -3600 # Node ID 173e1f0585664eac54a101ca0acda3c030413b92 # Parent 47132154ffe78f5aeadccc9d66cf379374800c51 Fixed cursor in interlaced modes on S3 Vision864/Trio32/Trio64. diff -r 47132154ffe7 -r 173e1f058566 src/vid_s3.c --- a/src/vid_s3.c Wed Jul 09 21:45:42 2014 +0100 +++ b/src/vid_s3.c Wed Jul 09 22:12:59 2014 +0100 @@ -1725,6 +1725,9 @@ int xx; int offset = svga->hwcursor_latch.x - svga->hwcursor_latch.xoff; + if (svga->interlace && svga->hwcursor_oddeven) + svga->hwcursor_latch.addr += 16; + // pclog("HWcursor %i %i\n", svga->hwcursor_latch.x, svga->hwcursor_latch.y); for (x = 0; x < 64; x += 16) { @@ -1747,6 +1750,8 @@ } svga->hwcursor_latch.addr += 4; } + if (svga->interlace && !svga->hwcursor_oddeven) + svga->hwcursor_latch.addr += 16; } diff -r 47132154ffe7 -r 173e1f058566 src/vid_svga.c --- a/src/vid_svga.c Wed Jul 09 21:45:42 2014 +0100 +++ b/src/vid_svga.c Wed Jul 09 22:12:59 2014 +0100 @@ -403,10 +403,27 @@ { // if (!(vc & 15)) pclog("VC %i %i\n", vc, GetTickCount()); if (svga->displine == svga->hwcursor_latch.y && svga->hwcursor_latch.ena) + { svga->hwcursor_on = 64 - svga->hwcursor_latch.yoff; + svga->hwcursor_oddeven = 0; + } + + if (svga->displine == svga->hwcursor_latch.y+1 && svga->hwcursor_latch.ena && svga->interlace) + { + svga->hwcursor_on = 64 - svga->hwcursor_latch.yoff; + svga->hwcursor_oddeven = 1; + } if (svga->displine == svga->overlay_latch.y && svga->overlay_latch.ena) + { svga->overlay_on = svga->overlay_latch.ysize - svga->overlay_latch.yoff; + svga->overlay_oddeven = 0; + } + if (svga->displine == svga->overlay_latch.y+1 && svga->overlay_latch.ena && svga->interlace) + { + svga->overlay_on = svga->overlay_latch.ysize - svga->overlay_latch.yoff; + svga->overlay_oddeven = 1; + } svga->vidtime += svga->dispofftime; // if (output) printf("Display off %f\n",vidtime); @@ -430,12 +447,16 @@ { svga->overlay_draw(svga, svga->displine); svga->overlay_on--; + if (svga->overlay_on && svga->interlace) + svga->overlay_on--; } if (svga->hwcursor_on) { svga->hwcursor_draw(svga, svga->displine); svga->hwcursor_on--; + if (svga->hwcursor_on && svga->interlace) + svga->hwcursor_on--; } if (svga->lastline < svga->displine) diff -r 47132154ffe7 -r 173e1f058566 src/vid_svga.h --- a/src/vid_svga.h Wed Jul 09 21:45:42 2014 +0100 +++ b/src/vid_svga.h Wed Jul 09 22:12:59 2014 +0100 @@ -90,6 +90,9 @@ int hwcursor_on; int overlay_on; + int hwcursor_oddeven; + int overlay_oddeven; + void (*render)(struct svga_t *svga); void (*recalctimings_ex)(struct svga_t *svga);