Author: hbelusca
Date: Sun Jun 14 15:35:38 2015
New Revision: 68134
URL:
http://svn.reactos.org/svn/reactos?rev=68134&view=rev
Log:
[NTVDM]
- Stubplement the font generator functions for text-mode.
- Store in plane 2+ the font ONLY in text mode (guilty r68085). Fixes spurious graphics
corruption in gfx modes.
CORE-9791
CORE-9794 #resolve #comment Should be fixed in r68134.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c [iso-8859-1] Sun Jun 14 15:35:38
2015
@@ -2491,25 +2491,30 @@
switch (Bda->CharacterHeight)
{
/*
- * Write the default font to the VGA font plane
- * and update the BIOS INT 43h vector (far pointer
- * to the character range 00h-...)
+ * Write the default font to the VGA font plane for text-modes only.
+ * Update the BIOS INT 43h vector (far pointer to the character range 00h-...).
*/
case 8:
{
- VgaWriteFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
+ if (ModeNumber <= 3)
+ VgaWriteTextModeFont(0, Font8x8, ARRAYSIZE(Font8x8) /
VGA_FONT_CHARACTERS);
+
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x8_OFFSET,
VIDEO_BIOS_DATA_SEG);
break;
}
case 14:
{
- VgaWriteFont(0, Font8x14, ARRAYSIZE(Font8x14) / VGA_FONT_CHARACTERS);
+ if (ModeNumber <= 3)
+ VgaWriteTextModeFont(0, Font8x14, ARRAYSIZE(Font8x14) /
VGA_FONT_CHARACTERS);
+
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x14_OFFSET,
VIDEO_BIOS_DATA_SEG);
break;
}
case 16:
{
- VgaWriteFont(0, Font8x16, ARRAYSIZE(Font8x16) / VGA_FONT_CHARACTERS);
+ if (ModeNumber <= 3)
+ VgaWriteTextModeFont(0, Font8x16, ARRAYSIZE(Font8x16) /
VGA_FONT_CHARACTERS);
+
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x16_OFFSET,
VIDEO_BIOS_DATA_SEG);
break;
}
@@ -3371,6 +3376,58 @@
{
// FIXME: At the moment we support only graphics-mode functions!
+ /* Load User-specified Patterns (Character Set) for Text Mode */
+ case 0x00:
+ case 0x10: // FIXME: 0x1x performs a full mode reset
+ {
+ // FIXME: BL == ??
+
+ /* Write the default font to the VGA font plane */
+ // VgaWriteTextModeFont(0, Font8x8, ARRAYSIZE(Font8x8) /
VGA_FONT_CHARACTERS);
+
+ UNIMPLEMENTED;
+ break;
+ }
+
+ /* Load ROM Monochrome 8x14 Patterns (Character Set) for Text Mode */
+ case 0x01:
+ case 0x11: // FIXME: 0x1x performs a full mode reset
+ {
+ // FIXME: BL == ??
+
+ /* Write the default font to the VGA font plane */
+ VgaWriteTextModeFont(0, Font8x14, ARRAYSIZE(Font8x14) /
VGA_FONT_CHARACTERS);
+
+ UNIMPLEMENTED;
+ break;
+ }
+
+ /* Load ROM 8x8 Double-dot Patterns (Character Set) for Text Mode */
+ case 0x02:
+ case 0x12: // FIXME: 0x1x performs a full mode reset
+ {
+ // FIXME: BL == ??
+
+ /* Write the default font to the VGA font plane */
+ VgaWriteTextModeFont(0, Font8x8, ARRAYSIZE(Font8x8) /
VGA_FONT_CHARACTERS);
+
+ UNIMPLEMENTED;
+ break;
+ }
+
+ /* Load ROM 8x16 Character Set for Text Mode */
+ case 0x04:
+ case 0x14: // FIXME: 0x1x performs a full mode reset
+ {
+ // FIXME: BL == ??
+
+ /* Write the default font to the VGA font plane */
+ VgaWriteTextModeFont(0, Font8x16, ARRAYSIZE(Font8x16) /
VGA_FONT_CHARACTERS);
+
+ UNIMPLEMENTED;
+ break;
+ }
+
/* Set User 8x8 Graphics Chars (Setup INT 1Fh Vector) */
case 0x20:
{
@@ -3383,10 +3440,10 @@
/* Set User Graphics Characters */
case 0x21:
{
- // /* Write the font to the VGA font plane */
- // VgaWriteFont(0, Font8x8, ARRAYSIZE(Font8x8) /
VGA_FONT_CHARACTERS);
-
- /* Update the BIOS INT 43h vector */
+ /*
+ * Update the BIOS INT 43h vector (far pointer
+ * to the character range 00h-...)
+ */
((PULONG)BaseAddress)[0x43] = MAKELONG(getBP(), getES());
/* Update BDA */
@@ -3407,11 +3464,9 @@
case 0x22:
{
/*
- * Write the default font to the VGA font plane
- * and update the BIOS INT 43h vector (far pointer
+ * Update the BIOS INT 43h vector (far pointer
* to the character range 00h-...)
*/
- VgaWriteFont(0, Font8x14, ARRAYSIZE(Font8x14) /
VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x14_OFFSET,
VIDEO_BIOS_DATA_SEG);
/* Update BDA */
@@ -3432,11 +3487,9 @@
case 0x23:
{
/*
- * Write the default font to the VGA font plane
- * and update the BIOS INT 43h vector (far pointer
+ * Update the BIOS INT 43h vector (far pointer
* to the character range 00h-...)
*/
- VgaWriteFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x8_OFFSET,
VIDEO_BIOS_DATA_SEG);
/* Update BDA */
@@ -3457,11 +3510,9 @@
case 0x24:
{
/*
- * Write the default font to the VGA font plane
- * and update the BIOS INT 43h vector (far pointer
- * to the character range 00h-...)
+ * Update the BIOS INT 43h vector (far pointer
+ * to the character range 00h-...).
*/
- VgaWriteFont(0, Font8x16, ARRAYSIZE(Font8x16) /
VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x16_OFFSET,
VIDEO_BIOS_DATA_SEG);
/* Update BDA */
@@ -3715,7 +3766,6 @@
VOID VidBiosAttachToConsole(VOID)
{
- // VgaRefreshDisplay();
if (!Attached)
{
VgaAttachToConsole();
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] Sun Jun 14
15:35:38 2015
@@ -22,7 +22,7 @@
/* PRIVATE VARIABLES **********************************************************/
static CONST DWORD MemoryBase[] = { 0xA0000, 0xA0000, 0xB0000, 0xB8000 };
-static CONST DWORD MemorySize[] = { 0x20000, 0x10000, 0x8000, 0x8000 };
+static CONST DWORD MemorySize[] = { 0x20000, 0x10000, 0x08000, 0x08000 };
/*
* Activate this line if you want to use the real
@@ -2086,7 +2086,7 @@
RtlZeroMemory(VgaMemory, sizeof(VgaMemory));
}
-VOID VgaWriteFont(UINT FontNumber, CONST UCHAR* FontData, UINT Height)
+VOID VgaWriteTextModeFont(UINT FontNumber, CONST UCHAR* FontData, UINT Height)
{
UINT i, j;
PUCHAR FontMemory = (PUCHAR)&VgaMemory[VGA_BANK_SIZE * VGA_FONT_BANK +
(FontNumber * VGA_FONT_SIZE)];
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h [iso-8859-1] Sun Jun 14
15:35:38 2015
@@ -258,7 +258,7 @@
VOID VgaRefreshDisplay(VOID);
VOID FASTCALL VgaReadMemory(ULONG Address, PVOID Buffer, ULONG Size);
BOOLEAN FASTCALL VgaWriteMemory(ULONG Address, PVOID Buffer, ULONG Size);
-VOID VgaWriteFont(UINT FontNumber, CONST UCHAR *FontData, UINT Height);
+VOID VgaWriteTextModeFont(UINT FontNumber, CONST UCHAR *FontData, UINT Height);
VOID VgaClearMemory(VOID);
BOOLEAN VgaGetDoubleVisionState(PBOOLEAN Horizontal, PBOOLEAN Vertical);