From fde960954271070e9473b4ba61b79694c59f09e2 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Sat, 2 Nov 2013 01:51:27 +0000 Subject: [PATCH] [NTVDM] Fix resolution calculation when scanline doubling is enabled. svn path=/branches/ntvdm/; revision=60827 --- subsystems/ntvdm/vga.c | 6 ++++++ subsystems/ntvdm/vga.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/subsystems/ntvdm/vga.c b/subsystems/ntvdm/vga.c index d4616a789b2..d788b84e669 100644 --- a/subsystems/ntvdm/vga.c +++ b/subsystems/ntvdm/vga.c @@ -802,6 +802,12 @@ COORD VgaGetDisplayResolution(VOID) if (VgaAcRegisters[VGA_AC_CONTROL_REG] & VGA_AC_CONTROL_8BIT) Resolution.X /= 2; } + if (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & VGA_CRTC_MAXSCANLINE_DOUBLE) + { + /* Halve the vertical resolution */ + Resolution.Y >>= 1; + } + /* Divide the vertical resolution by the maximum scan line (== font size in text mode) */ Resolution.Y /= MaximumScanLine; diff --git a/subsystems/ntvdm/vga.h b/subsystems/ntvdm/vga.h index 23b5a3a98d3..4fff78e469d 100644 --- a/subsystems/ntvdm/vga.h +++ b/subsystems/ntvdm/vga.h @@ -80,6 +80,9 @@ /* CRTC underline register bits */ #define VGA_CRTC_UNDERLINE_DWORD (1 << 6) +/* CRTC max scanline register bits */ +#define VGA_CRTC_MAXSCANLINE_DOUBLE (1 << 7) + /* CRTC mode control register bits */ #define VGA_CRTC_MODE_CONTROL_WRAP (1 << 5) #define VGA_CRTC_MODE_CONTROL_BYTE (1 << 6)