From 9a36682b3a7ebae8ba1578b997968acb062bd8e0 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 8 Jun 2007 08:26:37 +0000 Subject: [PATCH] patch by h-a-l-9000 to exclude the overscan area when dealing with the blanking period. makes the scanline count 400 instead of 415. Should improve scrolling. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2877 --- src/hardware/vga_misc.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/hardware/vga_misc.cpp b/src/hardware/vga_misc.cpp index 9306acf9..6ef43451 100644 --- a/src/hardware/vga_misc.cpp +++ b/src/hardware/vga_misc.cpp @@ -38,10 +38,9 @@ static Bitu vga_read_p3da(Bitu port,Bitu iolen) { vga.internal.attrindex=false; vga.tandy.pcjr_flipflop=false; - double timeInLine=fmod(timeInFrame,vga.draw.delay.htotal); - switch (machine) { case MCH_HERC: + { // 3BAh (R): Status Register // bit 0 Horizontal sync // 3 Video signal @@ -49,11 +48,13 @@ static Bitu vga_read_p3da(Bitu port,Bitu iolen) { if(timeInFrame >= vga.draw.delay.vrstart && timeInFrame <= vga.draw.delay.vrend) retval |= 0x80; + double timeInLine=fmod(timeInFrame,vga.draw.delay.htotal); if(timeInLine >= vga.draw.delay.hrstart && timeInLine <= vga.draw.delay.hrend) retval |= 1; retval |= 0x10; //Hercules ident break; + } default: // 3DAh (R): Status Register // bit 0 Horizontal or Vertical blanking @@ -62,12 +63,15 @@ static Bitu vga_read_p3da(Bitu port,Bitu iolen) { if(timeInFrame >= vga.draw.delay.vrstart && timeInFrame <= vga.draw.delay.vrend) retval |= 8; - if(timeInFrame >= vga.draw.delay.vblkstart && - timeInFrame <= vga.draw.delay.vblkend) - retval |= 1; - else if(timeInLine >= vga.draw.delay.hblkstart && - timeInLine <= vga.draw.delay.hblkend) + if(timeInFrame >= vga.draw.delay.vdend) retval |= 1; + else { + double timeInLine=fmod(timeInFrame,vga.draw.delay.htotal); + if(timeInLine >= (vga.draw.delay.hblkstart) && + timeInLine <= vga.draw.delay.hblkend){ + retval |= 1; + } + } } return retval; }