From d07dc3a5c24c3367f474983b4c538018a4ca8ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 26 Oct 2014 16:56:14 +0000 Subject: [PATCH] [NTVDM]: Temporarily fix for r65015 before a proper fix. svn path=/trunk/; revision=65018 --- reactos/subsystems/ntvdm/bios/vidbios.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/reactos/subsystems/ntvdm/bios/vidbios.c b/reactos/subsystems/ntvdm/bios/vidbios.c index 3db458feda6..bb5e5376136 100644 --- a/reactos/subsystems/ntvdm/bios/vidbios.c +++ b/reactos/subsystems/ntvdm/bios/vidbios.c @@ -2296,9 +2296,16 @@ static BOOLEAN VidBiosSetVideoMode(BYTE ModeNumber) { 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])) @@ -2308,8 +2315,13 @@ static BOOLEAN VidBiosSetVideoMode(BYTE ModeNumber) return FALSE; } - /* Check if this is the same mode */ - if (ModeNumber == Bda->VideoMode) return TRUE; + /* 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]; @@ -2320,12 +2332,7 @@ static BOOLEAN VidBiosSetVideoMode(BYTE ModeNumber) 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;