+ COORD Resolution;
+ 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];
+ Resolution.Y = VgaCrtcRegisters[VGA_CRTC_VERT_DISP_END_REG];
+
+ /* Set the top bits from the overflow register */
+ if (VgaCrtcRegisters[VGA_CRTC_OVERFLOW_REG] & VGA_CRTC_OVERFLOW_VDE8)
+ {
+ Resolution.Y |= 1 << 8;
+ }
+ if (VgaCrtcRegisters[VGA_CRTC_OVERFLOW_REG] & VGA_CRTC_OVERFLOW_VDE9)
+ {
+ Resolution.Y |= 1 << 9;
+ }
+
+ /* Increase the values by 1 */
+ Resolution.X++;
+ Resolution.Y++;
+
+ if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA)
+ {
+ /* Multiply the horizontal resolution by the 9/8 dot mode */
+ Resolution.X *= (VgaSeqRegisters[VGA_SEQ_CLOCK_REG] & VGA_SEQ_CLOCK_98DM)
+ ? 8 : 9;
+
+ /* The horizontal resolution is halved in 8-bit mode */
+ 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;
+ }
+ else
+ {
+ /* Divide the vertical resolution by the maximum scan line (== font size in text mode) */
+ Resolution.Y /= MaximumScanLine;
+ }
+
+ /* Return the resolution */
+ return Resolution;
+}
+
+BOOLEAN VgaGetDoubleVisionState(PBOOLEAN Horizontal, PBOOLEAN Vertical)
+{
+ if (GraphicsConsoleBuffer == NULL) return FALSE;
+ if (Horizontal) *Horizontal = DoubleWidth;
+ if (Vertical) *Vertical = DoubleHeight;
+ return TRUE;
+}
+
+VOID VgaRefreshDisplay(VOID)
+{
+ VgaVerticalRetrace(0);
+}
+
+VOID NTAPI VgaReadMemory(ULONG Address, PVOID Buffer, ULONG Size)
+{
+ DWORD i, j;