Fixed cursor in interlaced modes on S3 Vision864/Trio32/Trio64.

This commit is contained in:
TomW 2014-07-09 22:12:59 +01:00
commit 0c2efae9c3
3 changed files with 29 additions and 0 deletions

View file

@ -1725,6 +1725,9 @@ void s3_hwcursor_draw(svga_t *svga, int displine)
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 @@ void s3_hwcursor_draw(svga_t *svga, int displine)
}
svga->hwcursor_latch.addr += 4;
}
if (svga->interlace && !svga->hwcursor_oddeven)
svga->hwcursor_latch.addr += 16;
}

View file

@ -403,10 +403,27 @@ void svga_poll(void *p)
{
// 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 @@ void svga_poll(void *p)
{
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)

View file

@ -90,6 +90,9 @@ typedef struct svga_t
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);