Calculate the text height instead of using a hardcoded value.


svn path=/branches/ntvdm/; revision=59674
This commit is contained in:
Aleksandar Andrejevic 2013-08-09 09:24:40 +00:00
parent bd75425efd
commit 2f908ec723

View file

@ -569,6 +569,7 @@ DWORD VgaGetVideoLimitAddress(VOID)
COORD VgaGetDisplayResolution(VOID) COORD VgaGetDisplayResolution(VOID)
{ {
COORD Resolution; COORD Resolution;
BYTE TextSize = 1 + (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & 0x1F);
/* The low 8 bits are in the display registers */ /* The low 8 bits are in the display registers */
Resolution.X = VgaCrtcRegisters[VGA_CRTC_END_HORZ_DISP_REG]; Resolution.X = VgaCrtcRegisters[VGA_CRTC_END_HORZ_DISP_REG];
@ -603,7 +604,7 @@ COORD VgaGetDisplayResolution(VOID)
else else
{ {
/* Divide the number of scanlines by the font size */ /* Divide the number of scanlines by the font size */
Resolution.Y /= 16; Resolution.Y /= TextSize;
} }
/* Return the resolution */ /* Return the resolution */