mirror of
https://github.com/reactos/reactos.git
synced 2024-08-06 11:24:58 +00:00
[NTVDM:SVGA]
Fix the refresh rate calculation, again. svn path=/trunk/; revision=72489
This commit is contained in:
parent
75ece18c55
commit
493ad03e52
|
@ -1118,6 +1118,22 @@ static BYTE WINAPI VgaReadPort(USHORT Port)
|
||||||
|
|
||||||
VerticalRetraceEnd = VerticalRetraceStart + (VgaCrtcRegisters[VGA_CRTC_END_VERT_RETRACE_REG] & 0x0F);
|
VerticalRetraceEnd = VerticalRetraceStart + (VgaCrtcRegisters[VGA_CRTC_END_VERT_RETRACE_REG] & 0x0F);
|
||||||
|
|
||||||
|
if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA)
|
||||||
|
{
|
||||||
|
BYTE MaximumScanLine = 1 + (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & 0x1F);
|
||||||
|
|
||||||
|
if (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & VGA_CRTC_MAXSCANLINE_DOUBLE)
|
||||||
|
{
|
||||||
|
VerticalRetraceStart <<= 1;
|
||||||
|
VerticalRetraceEnd <<= 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VerticalRetraceStart *= MaximumScanLine;
|
||||||
|
VerticalRetraceEnd *= MaximumScanLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Calculate the horizontal blanking duration in cycles */
|
/* Calculate the horizontal blanking duration in cycles */
|
||||||
HblankStart = VgaCrtcRegisters[VGA_CRTC_START_HORZ_BLANKING_REG] & 0x1F;
|
HblankStart = VgaCrtcRegisters[VGA_CRTC_START_HORZ_BLANKING_REG] & 0x1F;
|
||||||
HblankEnd = VgaCrtcRegisters[VGA_CRTC_END_HORZ_BLANKING_REG] & 0x1F;
|
HblankEnd = VgaCrtcRegisters[VGA_CRTC_END_HORZ_BLANKING_REG] & 0x1F;
|
||||||
|
@ -1644,15 +1660,18 @@ static VOID FASTCALL VgaHorizontalRetrace(ULONGLONG ElapsedTime)
|
||||||
VerticalRetraceStart |= (VgaCrtcRegisters[VGA_CRTC_OVERFLOW_REG] & VGA_CRTC_OVERFLOW_VRS8) << 6;
|
VerticalRetraceStart |= (VgaCrtcRegisters[VGA_CRTC_OVERFLOW_REG] & VGA_CRTC_OVERFLOW_VRS8) << 6;
|
||||||
VerticalRetraceStart |= (VgaCrtcRegisters[VGA_CRTC_OVERFLOW_REG] & VGA_CRTC_OVERFLOW_VRS9) << 2;
|
VerticalRetraceStart |= (VgaCrtcRegisters[VGA_CRTC_OVERFLOW_REG] & VGA_CRTC_OVERFLOW_VRS9) << 2;
|
||||||
|
|
||||||
if (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & VGA_CRTC_MAXSCANLINE_DOUBLE)
|
if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA)
|
||||||
{
|
{
|
||||||
VerticalRetraceStart <<= 1;
|
if (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & VGA_CRTC_MAXSCANLINE_DOUBLE)
|
||||||
VerticalTotal <<= 1;
|
{
|
||||||
}
|
VerticalRetraceStart <<= 1;
|
||||||
else
|
VerticalTotal <<= 1;
|
||||||
{
|
}
|
||||||
VerticalRetraceStart *= MaximumScanLine;
|
else
|
||||||
VerticalTotal *= MaximumScanLine;
|
{
|
||||||
|
VerticalRetraceStart *= MaximumScanLine;
|
||||||
|
VerticalTotal *= MaximumScanLine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the cycle */
|
/* Set the cycle */
|
||||||
|
|
Loading…
Reference in a new issue