mirror of
https://github.com/reactos/reactos.git
synced 2024-08-05 02:50:55 +00:00
[NTVDM]
Simplify code. svn path=/branches/ntvdm/; revision=59681
This commit is contained in:
parent
431f16ab22
commit
2f3827d040
|
@ -569,7 +569,7 @@ DWORD VgaGetVideoLimitAddress(VOID)
|
|||
COORD VgaGetDisplayResolution(VOID)
|
||||
{
|
||||
COORD Resolution;
|
||||
BYTE TextSize = 1 + (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & 0x1F);
|
||||
BYTE MaximumScanLine = 1 + (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & 0x1F);
|
||||
|
||||
/* The low 8 bits are in the display registers */
|
||||
Resolution.X = VgaCrtcRegisters[VGA_CRTC_END_HORZ_DISP_REG];
|
||||
|
@ -597,15 +597,10 @@ COORD VgaGetDisplayResolution(VOID)
|
|||
|
||||
/* The horizontal resolution is halved in 8-bit mode */
|
||||
if (VgaAcRegisters[VGA_AC_CONTROL_REG] & VGA_AC_CONTROL_8BIT) Resolution.X /= 2;
|
||||
}
|
||||
|
||||
/* Divide the vertical resolution by the maximum scan line */
|
||||
Resolution.Y /= ((DWORD)VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & 0x1F) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Divide the number of scanlines by the font size */
|
||||
Resolution.Y /= TextSize;
|
||||
}
|
||||
/* Divide the vertical resolution by the maximum scan line (== font size in text mode) */
|
||||
Resolution.Y /= MaximumScanLine;
|
||||
|
||||
/* Return the resolution */
|
||||
return Resolution;
|
||||
|
|
Loading…
Reference in a new issue