From 94b6893a0145a3a8a7c54c4a6b77311aab1478d2 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Wed, 7 Aug 2013 21:15:02 +0000 Subject: [PATCH] [NTVDM] Clear the VGA memory during initialization. Clear the graphics framebuffer when switching to graphics mode. svn path=/branches/ntvdm/; revision=59671 --- subsystems/ntvdm/vga.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subsystems/ntvdm/vga.c b/subsystems/ntvdm/vga.c index 8b6f850a5f9..e939645401c 100644 --- a/subsystems/ntvdm/vga.c +++ b/subsystems/ntvdm/vga.c @@ -254,6 +254,9 @@ static BOOL VgaEnterGraphicsMode(PCOORD Resolution) ConsoleFramebuffer = GraphicsBufferInfo.lpBitMap; ConsoleMutex = GraphicsBufferInfo.hMutex; + /* Clear the framebuffer */ + ZeroMemory(ConsoleFramebuffer, BitmapInfo->bmiHeader.biSizeImage); + /* Set the active buffer */ SetConsoleActiveScreenBuffer(GraphicsConsoleBuffer); @@ -946,6 +949,9 @@ VOID VgaInitialize(HANDLE TextHandle) /* Set the global handle */ TextConsoleBuffer = TextHandle; + /* Clear the VGA memory */ + ZeroMemory(VgaMemory, VGA_NUM_BANKS * VGA_BANK_SIZE); + /* Set the default video mode */ BiosSetVideoMode(BIOS_DEFAULT_VIDEO_MODE); VgaUpdateMode(); -- 2.17.1