PCem

changeset 121:173e1f058566

Fixed cursor in interlaced modes on S3 Vision864/Trio32/Trio64.
author TomW
date Wed Jul 09 22:12:59 2014 +0100
parents 47132154ffe7
children 84742b645324
files src/vid_s3.c src/vid_svga.c src/vid_svga.h
diffstat 3 files changed, 29 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/src/vid_s3.c	Wed Jul 09 21:45:42 2014 +0100
     1.2 +++ b/src/vid_s3.c	Wed Jul 09 22:12:59 2014 +0100
     1.3 @@ -1725,6 +1725,9 @@
     1.4          int xx;
     1.5          int offset = svga->hwcursor_latch.x - svga->hwcursor_latch.xoff;
     1.6          
     1.7 +        if (svga->interlace && svga->hwcursor_oddeven)
     1.8 +                svga->hwcursor_latch.addr += 16;
     1.9 +
    1.10  //        pclog("HWcursor %i %i\n", svga->hwcursor_latch.x, svga->hwcursor_latch.y);
    1.11          for (x = 0; x < 64; x += 16)
    1.12          {
    1.13 @@ -1747,6 +1750,8 @@
    1.14                  }
    1.15                  svga->hwcursor_latch.addr += 4;
    1.16          }
    1.17 +        if (svga->interlace && !svga->hwcursor_oddeven)
    1.18 +                svga->hwcursor_latch.addr += 16;
    1.19  }
    1.20  
    1.21  
     2.1 --- a/src/vid_svga.c	Wed Jul 09 21:45:42 2014 +0100
     2.2 +++ b/src/vid_svga.c	Wed Jul 09 22:12:59 2014 +0100
     2.3 @@ -403,10 +403,27 @@
     2.4          {
     2.5  //                if (!(vc & 15)) pclog("VC %i %i\n", vc, GetTickCount());
     2.6                  if (svga->displine == svga->hwcursor_latch.y && svga->hwcursor_latch.ena)
     2.7 +                {
     2.8                          svga->hwcursor_on = 64 - svga->hwcursor_latch.yoff;
     2.9 +                        svga->hwcursor_oddeven = 0;
    2.10 +                }
    2.11 +
    2.12 +                if (svga->displine == svga->hwcursor_latch.y+1 && svga->hwcursor_latch.ena && svga->interlace)
    2.13 +                {
    2.14 +                        svga->hwcursor_on = 64 - svga->hwcursor_latch.yoff;
    2.15 +                        svga->hwcursor_oddeven = 1;
    2.16 +                }
    2.17  
    2.18                  if (svga->displine == svga->overlay_latch.y && svga->overlay_latch.ena)
    2.19 +                {
    2.20                          svga->overlay_on = svga->overlay_latch.ysize - svga->overlay_latch.yoff;
    2.21 +                        svga->overlay_oddeven = 0;
    2.22 +                }
    2.23 +                if (svga->displine == svga->overlay_latch.y+1 && svga->overlay_latch.ena && svga->interlace)
    2.24 +                {
    2.25 +                        svga->overlay_on = svga->overlay_latch.ysize - svga->overlay_latch.yoff;
    2.26 +                        svga->overlay_oddeven = 1;
    2.27 +                }
    2.28  
    2.29                  svga->vidtime += svga->dispofftime;
    2.30  //                if (output) printf("Display off %f\n",vidtime);
    2.31 @@ -430,12 +447,16 @@
    2.32                          {
    2.33                                  svga->overlay_draw(svga, svga->displine);
    2.34                                  svga->overlay_on--;
    2.35 +                                if (svga->overlay_on && svga->interlace)
    2.36 +                                        svga->overlay_on--;
    2.37                          }
    2.38  
    2.39                          if (svga->hwcursor_on)
    2.40                          {
    2.41                                  svga->hwcursor_draw(svga, svga->displine);
    2.42                                  svga->hwcursor_on--;
    2.43 +                                if (svga->hwcursor_on && svga->interlace)
    2.44 +                                        svga->hwcursor_on--;
    2.45                          }
    2.46  
    2.47                          if (svga->lastline < svga->displine) 
     3.1 --- a/src/vid_svga.h	Wed Jul 09 21:45:42 2014 +0100
     3.2 +++ b/src/vid_svga.h	Wed Jul 09 22:12:59 2014 +0100
     3.3 @@ -90,6 +90,9 @@
     3.4          int hwcursor_on;
     3.5          int overlay_on;
     3.6          
     3.7 +        int hwcursor_oddeven;
     3.8 +        int overlay_oddeven;
     3.9 +        
    3.10          void (*render)(struct svga_t *svga);
    3.11          void (*recalctimings_ex)(struct svga_t *svga);
    3.12