Author: aandrejevic
Date: Sat Aug 10 19:24:00 2013
New Revision: 59688
URL:
http://svn.reactos.org/svn/reactos?rev=59688&view=rev
Log:
[NTVDM]
Clear the screen when switching video modes.
Modified:
branches/ntvdm/subsystems/ntvdm/bios.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] Sat Aug 10 19:24:00 2013
@@ -255,6 +255,31 @@
}
}
+static VOID BiosClearScreen(VOID)
+{
+ INT i;
+ BYTE PlaneMask;
+
+ /* Save the plane write register */
+ VgaWritePort(VGA_SEQ_INDEX, VGA_SEQ_MASK_REG);
+ PlaneMask = VgaReadPort(VGA_SEQ_DATA);
+
+ /* Write to all planes */
+ VgaWritePort(VGA_SEQ_DATA, 0x0F);
+
+ /* Clear the screen */
+ for (i = VgaGetVideoBaseAddress();
+ i < VgaGetVideoLimitAddress();
+ i += sizeof(DWORD))
+ {
+ DWORD Zero = 0;
+ VgaWriteMemory(i, (LPVOID)&Zero, sizeof(DWORD));
+ }
+
+ /* Restore the plane write register */
+ VgaWritePort(VGA_SEQ_DATA, PlaneMask);
+}
+
/* PUBLIC FUNCTIONS ***********************************************************/
BYTE BiosGetVideoMode(VOID)
@@ -304,7 +329,7 @@
/* Update the values in the BDA */
Bda->VideoMode = ModeNumber;
Bda->VideoPage = 0;
- Bda->VideoPageSize = BIOS_PAGE_SIZE;
+ Bda->VideoPageSize = BIOS_PAGE_SIZE;
Bda->VideoPageOffset = 0;
/* Get the character height */
@@ -629,6 +654,8 @@
case 0x00:
{
BiosSetVideoMode(LOBYTE(Eax));
+ BiosClearScreen();
+
break;
}