PCem

changeset 83:a887728dc348

SVGA now handles vblank start < vertical total. Fixes The Incredible Machine.
author TomW
date Sun Mar 09 11:24:58 2014 +0000
parents 56d6d9b214ff
children b53e148867e5
files src/vid_svga.c src/vid_svga.h
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/src/vid_svga.c	Sat Mar 08 16:49:29 2014 +0000
     1.2 +++ b/src/vid_svga.c	Sun Mar 09 11:24:58 2014 +0000
     1.3 @@ -246,6 +246,7 @@
     1.4          svga->dispend = svga->crtc[0x12];
     1.5          svga->vsyncstart = svga->crtc[0x10];
     1.6          svga->split = svga->crtc[0x18];
     1.7 +        svga->vblankstart = svga->crtc[0x15];
     1.8  
     1.9          if (svga->crtc[7] & 1)  svga->vtotal |= 0x100;
    1.10          if (svga->crtc[7] & 32) svga->vtotal |= 0x200;
    1.11 @@ -262,6 +263,13 @@
    1.12          if (svga->crtc[7] & 0x10) svga->split|=0x100;
    1.13          if (svga->crtc[9] & 0x40) svga->split|=0x200;
    1.14          svga->split++;
    1.15 +        
    1.16 +        if (svga->crtc[7] & 0x08) svga->vblankstart |= 0x100;
    1.17 +        if (svga->crtc[9] & 0x20) svga->vblankstart |= 0x200;
    1.18 +        svga->vblankstart++;
    1.19 +        
    1.20 +        if (svga->vblankstart < svga->dispend)
    1.21 +                svga->dispend = svga->vblankstart;
    1.22  
    1.23          svga->hdisp = svga->crtc[1];
    1.24          svga->hdisp++;
     2.1 --- a/src/vid_svga.h	Sat Mar 08 16:49:29 2014 +0000
     2.2 +++ b/src/vid_svga.h	Sun Mar 09 11:24:58 2014 +0000
     2.3 @@ -38,7 +38,7 @@
     2.4          uint32_t pallook[256];
     2.5          PALETTE vgapal;
     2.6  
     2.7 -        int vtotal, dispend, vsyncstart, split;
     2.8 +        int vtotal, dispend, vsyncstart, split, vblankstart;
     2.9          int hdisp,  hdisp_old, htotal,  hdisp_time, rowoffset;
    2.10          int lowres, interlace;
    2.11          int linedbl, rowcount;