{
BYTE Page;
COORD Resolution;
- BOOLEAN DoNotClear = !!(ModeNumber & 0x80);
PVGA_REGISTERS VgaMode;
+ /*
+ * IBM standard modes do not clear the screen if the
+ * high bit of AL is set (EGA or higher only).
+ * See Ralf Brown: http://www.ctyme.com/intr/rb-0069.htm
+ * for more information.
+ */
+ BOOLEAN DoNotClear = !!(ModeNumber & 0x80);
+
/* Retrieve the real mode number and check its validity */
ModeNumber &= 0x7F;
// if (ModeNumber >= sizeof(VideoModes)/sizeof(VideoModes[0]))
return FALSE;
}
+ /* Check if this is the current mode */
+ if (ModeNumber == Bda->VideoMode)
+ {
+ /* Just clear the VGA memory if needed */
+ if (!DoNotClear) VgaClearMemory();
+ return TRUE;
+ }
+
VgaMode = VideoModes[ModeNumber];
DPRINT1("Switching to mode %02Xh %s clearing the screen; VgaMode = 0x%p\n",
VgaChangePalette(ModeNumber);
- /*
- * IBM standard modes do not clear the screen if the
- * high bit of AL is set (EGA or higher only).
- * See Ralf Brown: http://www.ctyme.com/intr/rb-0069.htm
- * for more information.
- */
+ /* Clear the VGA memory if needed */
if (!DoNotClear) VgaClearMemory();
// Bda->CrtModeControl;