diff --git a/src/vid_svga.c b/src/vid_svga.c index 260da3c..5193abc 100644 --- a/src/vid_svga.c +++ b/src/vid_svga.c @@ -246,6 +246,7 @@ void svga_recalctimings(svga_t *svga) svga->dispend = svga->crtc[0x12]; svga->vsyncstart = svga->crtc[0x10]; svga->split = svga->crtc[0x18]; + svga->vblankstart = svga->crtc[0x15]; if (svga->crtc[7] & 1) svga->vtotal |= 0x100; if (svga->crtc[7] & 32) svga->vtotal |= 0x200; @@ -262,6 +263,13 @@ void svga_recalctimings(svga_t *svga) if (svga->crtc[7] & 0x10) svga->split|=0x100; if (svga->crtc[9] & 0x40) svga->split|=0x200; svga->split++; + + if (svga->crtc[7] & 0x08) svga->vblankstart |= 0x100; + if (svga->crtc[9] & 0x20) svga->vblankstart |= 0x200; + svga->vblankstart++; + + if (svga->vblankstart < svga->dispend) + svga->dispend = svga->vblankstart; svga->hdisp = svga->crtc[1]; svga->hdisp++; diff --git a/src/vid_svga.h b/src/vid_svga.h index 405a187..209502e 100644 --- a/src/vid_svga.h +++ b/src/vid_svga.h @@ -38,7 +38,7 @@ typedef struct svga_t uint32_t pallook[256]; PALETTE vgapal; - int vtotal, dispend, vsyncstart, split; + int vtotal, dispend, vsyncstart, split, vblankstart; int hdisp, hdisp_old, htotal, hdisp_time, rowoffset; int lowres, interlace; int linedbl, rowcount;