From 2f3827d0403b2e89c898c3d0bb609d3cd52b5edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 9 Aug 2013 14:01:43 +0000 Subject: [PATCH] [NTVDM] Simplify code. svn path=/branches/ntvdm/; revision=59681 --- subsystems/ntvdm/vga.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/subsystems/ntvdm/vga.c b/subsystems/ntvdm/vga.c index a535048a680..4522a86109d 100644 --- a/subsystems/ntvdm/vga.c +++ b/subsystems/ntvdm/vga.c @@ -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;