Author: hbelusca
Date: Tue Aug 13 16:49:54 2013
New Revision: 59724
URL:
http://svn.reactos.org/svn/reactos?rev=59724&view=rev
Log:
[NTVDM]
- Add new BIOS video modes (obtained from DosBox with the help of Aleksander)
- Remove an unneeded comment.
Modified:
branches/ntvdm/subsystems/ntvdm/bios.c
branches/ntvdm/subsystems/ntvdm/vga.c
Modified: branches/ntvdm/subsystems/ntvdm/bios.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Tue Aug 13 16:49:54 2013
@@ -25,25 +25,29 @@
static HANDLE BiosConsoleOutput = INVALID_HANDLE_VALUE;
static CONSOLE_SCREEN_BUFFER_INFO BiosSavedBufferInfo;
+/*
+ * VGA Register Configurations for BIOS Video Modes
+ * The configurations come from DosBox.
+ */
static BYTE VideoMode_40x25_text[] =
{
/* Miscellaneous Register */
0x67,
/* Sequencer Registers */
- 0x03, 0x08, 0x03, 0x00, 0x02,
+ 0x00, 0x08, 0x03, 0x00, 0x07,
/* GC Registers */
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x0F, 0xFF,
/* CRTC Registers */
- 0x2D, 0x27, 0x28, 0x90, 0x2B, 0xA0, 0xBF, 0x1F, 0x00, 0x4F, 0x0D, 0x0F,
+ 0x2D, 0x27, 0x28, 0x90, 0x2B, 0xA0, 0xBF, 0x1F, 0x00, 0x4F, 0x0D, 0x0E,
0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x14, 0x1F, 0x96, 0xB9, 0xA3,
0xFF,
/* AC Registers */
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x38, 0x39, 0x3A, 0x3B,
- 0x3C, 0x3D, 0x3E, 0x3F, 0x0C, 0x01, 0x0F, 0x13, 0x00
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x39, 0x0A, 0x3B,
+ 0x0C, 0x3D, 0x0E, 0x3F, 0x10, 0x00, 0x12, 0x08, 0x04
};
static BYTE VideoMode_80x25_text[] =
@@ -52,19 +56,19 @@
0x67,
/* Sequencer Registers */
- 0x03, 0x00, 0x03, 0x00, 0x02,
+ 0x00, 0x00, 0x03, 0x00, 0x07,
/* GC Registers */
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x0F, 0xFF,
/* CRTC Registers */
- 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F, 0x00, 0x4F, 0x0D, 0x0F,
+ 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F, 0x00, 0x4F, 0x0D, 0x0E,
0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x28, 0x1F, 0x96, 0xB9, 0xA3,
0xFF,
/* AC Registers */
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x38, 0x39, 0x3A, 0x3B,
- 0x3C, 0x3D, 0x3E, 0x3F, 0x0C, 0x01, 0x0F, 0x13, 0x00
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x39, 0x0A, 0x3B,
+ 0x0C, 0x3D, 0x0E, 0x3F, 0x10, 0x00, 0x12, 0x08, 0x04
};
static BYTE VideoMode_320x200_4color[] =
@@ -73,10 +77,10 @@
0x63,
/* Sequencer Registers */
- 0x03, 0x09, 0x03, 0x00, 0x02,
+ 0x00, 0x09, 0x00, 0x00, 0x02,
/* GC Registers */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0F, 0x0F, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0F, 0x0F, 0xFF,
/* CRTC Registers */
0x2D, 0x27, 0x28, 0x90, 0x2B, 0x80, 0xBF, 0x1F, 0x00, 0xC1, 0x00, 0x00,
@@ -84,29 +88,134 @@
0xFF,
/* AC Registers */
- 0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
- 0x14, 0x15, 0x16, 0x17, 0x01, 0x00, 0x03, 0x00, 0x00
+ 0x00, 0x13, 0x02, 0x17, 0x04, 0x04, 0x06, 0x07, 0x08, 0x11, 0x0A, 0x13,
+ 0x0C, 0x15, 0x0E, 0x17, 0x10, 0x00, 0x12, 0x00, 0x04
};
-static BYTE VideoMode_640x480_16color[] =
+static BYTE VideoMode_640x200_2color[] =
+{
+ /* Miscellaneous Register */
+ 0x63,
+
+ /* Sequencer Registers */
+ 0x00, 0x09, 0x0F, 0x00, 0x02,
+
+ /* GC Registers */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0xFF,
+
+ /* CRTC Registers */
+ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, 0xC1, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x28, 0x00, 0x96, 0xB9, 0xC2,
+ 0xFF,
+
+ /* AC Registers */
+ 0x00, 0x17, 0x02, 0x17, 0x04, 0x17, 0x06, 0x17, 0x08, 0x17, 0x0A, 0x17,
+ 0x0C, 0x17, 0x0E, 0x17, 0x10, 0x00, 0x12, 0x00, 0x04
+};
+
+static BYTE VideoMode_320x200_16color[] =
+{
+ /* Miscellaneous Register */
+ 0x63,
+
+ /* Sequencer Registers */
+ 0x00, 0x09, 0x0F, 0x00, 0x02,
+
+ /* GC Registers */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF,
+
+ /* CRTC Registers */
+ 0x2D, 0x27, 0x28, 0x90, 0x2B, 0x80, 0xBF, 0x1F, 0x00, 0xC0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x14, 0x00, 0x96, 0xB9, 0xE3,
+ 0xFF,
+
+ /* AC Registers */
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x11, 0x0A, 0x13,
+ 0x0C, 0x15, 0x0E, 0x17, 0x10, 0x00, 0x12, 0x00, 0x04
+};
+
+static BYTE VideoMode_640x200_16color[] =
+{
+ /* Miscellaneous Register */
+ 0x63,
+
+ /* Sequencer Registers */
+ 0x00, 0x01, 0x0F, 0x00, 0x02,
+
+ /* GC Registers */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF,
+
+ /* CRTC Registers */
+ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, 0xC0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x28, 0x00, 0x96, 0xB9, 0xE3,
+ 0xFF,
+
+ /* AC Registers */
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x11, 0x0A, 0x13,
+ 0x0C, 0x15, 0x0E, 0x17, 0x10, 0x00, 0x12, 0x00, 0x04
+};
+
+static BYTE VideoMode_640x350_16color[] =
+{
+ /* Miscellaneous Register */
+ 0xA3,
+
+ /* Sequencer Registers */
+ 0x00, 0x01, 0x0F, 0x00, 0x02,
+
+ /* GC Registers */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF,
+
+ /* CRTC Registers */
+ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, 0x40, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x83, 0x85, 0x5D, 0x28, 0x0F, 0x63, 0xBA, 0xE3,
+ 0xFF,
+
+ /* AC Registers */
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x39, 0x0A, 0x3B,
+ 0x0C, 0x3D, 0x0E, 0x3F, 0x10, 0x00, 0x12, 0x00, 0x04
+};
+
+static BYTE VideoMode_640x480_2color[] =
{
/* Miscellaneous Register */
0xE3,
/* Sequencer Registers */
- 0x03, 0x01, 0x08, 0x00, 0x06,
+ 0x00, 0x01, 0x0F, 0x00, 0x02,
/* GC Registers */
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x05, 0x0F, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF,
/* CRTC Registers */
0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xEA, 0x0C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3,
+ 0x00, 0x00, 0x00, 0x00, 0xEA, 0x8C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xC3,
0xFF,
/* AC Registers */
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x38, 0x39, 0x3A, 0x3B,
- 0x3C, 0x3D, 0x3E, 0x3F, 0x01, 0x00, 0x0F, 0x00, 0x00
+ 0x00, 0x3F, 0x02, 0x3F, 0x04, 0x3F, 0x06, 0x3F, 0x08, 0x3F, 0x0A, 0x3F,
+ 0x0C, 0x3F, 0x0E, 0x3F, 0x10, 0x00, 0x12, 0x00, 0x04
+};
+
+static BYTE VideoMode_640x480_16color[] =
+{
+ /* Miscellaneous Register */
+ 0xE3,
+
+ /* Sequencer Registers */
+ 0x00, 0x01, 0x0F, 0x00, 0x02,
+
+ /* GC Registers */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF,
+
+ /* CRTC Registers */
+ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xEA, 0x8C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3,
+ 0xFF,
+
+ /* AC Registers */
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x39, 0x0A, 0x3B,
+ 0x0C, 0x3D, 0x0E, 0x3F, 0x10, 0x00, 0x12, 0x00, 0x04
};
static BYTE VideoMode_320x200_256color[] =
@@ -115,19 +224,19 @@
0x63,
/* Sequencer Registers */
- 0x03, 0x01, 0x0F, 0x00, 0x0E,
+ 0x00, 0x01, 0x0F, 0x00, 0x0E,
/* GC Registers */
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF,
/* CRTC Registers */
0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, 0x41, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x9C, 0x0E, 0x8F, 0x28, 0x40, 0x96, 0xB9, 0xA3,
+ 0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x28, 0x40, 0x96, 0xB9, 0xA3,
0xFF,
/* AC Registers */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
- 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00
+ 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x00, 0x12, 0x00, 0x04
};
static LPBYTE VideoModes[] =
@@ -138,18 +247,18 @@
VideoMode_80x25_text, /* Mode 03h */
VideoMode_320x200_4color, /* Mode 04h */
VideoMode_320x200_4color, /* Mode 05h */
- NULL, /* Mode 06h */
+ VideoMode_640x200_2color, /* Mode 06h */
NULL, /* Mode 07h */
NULL, /* Mode 08h */
NULL, /* Mode 09h */
NULL, /* Mode 0Ah */
NULL, /* Mode 0Bh */
NULL, /* Mode 0Ch */
- NULL, /* Mode 0Dh */
- NULL, /* Mode 0Eh */
+ VideoMode_320x200_16color, /* Mode 0Dh */
+ VideoMode_640x200_16color, /* Mode 0Eh */
NULL, /* Mode 0Fh */
- NULL, /* Mode 10h */
- NULL, /* Mode 11h */
+ VideoMode_640x350_16color, /* Mode 10h */
+ VideoMode_640x480_2color, /* Mode 11h */
VideoMode_640x480_16color, /* Mode 12h */
VideoMode_320x200_256color, /* Mode 13h */
};
Modified: branches/ntvdm/subsystems/ntvdm/vga.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Tue Aug 13 16:49:54 2013
@@ -668,7 +668,7 @@
/* Yes, write the new value */
CharBuffer[i * Resolution.X + j] = CharInfo;
- /* Mark the specified pixel as changed */
+ /* Mark the specified cell as changed */
VgaMarkForUpdate(i, j);
}
}
@@ -786,11 +786,6 @@
{
if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA)
{
- /* Set the graphics mode palette */
- //SetConsolePalette(GraphicsConsoleBuffer,
- // PaletteHandle,
- // SYSPAL_NOSTATIC256);
-
/* Trigger a full update of the screen */
NeedsUpdate = TRUE;
UpdateRectangle.Left = 0;
@@ -1154,7 +1149,7 @@
TextConsoleBuffer = TextHandle;
/* Clear the VGA memory */
- ZeroMemory(VgaMemory, VGA_NUM_BANKS * VGA_BANK_SIZE);
+ VgaClearMemory();
/* Set the default video mode */
BiosSetVideoMode(BIOS_DEFAULT_VIDEO_MODE);