Clear the screen when switching video modes.


svn path=/branches/ntvdm/; revision=59688
This commit is contained in:
Aleksandar Andrejevic 2013-08-10 19:24:00 +00:00
parent 7b2978c43f
commit acf127fe24

View file

@ -255,6 +255,31 @@ static VOID BiosWriteWindow(LPWORD Buffer, SMALL_RECT Rectangle, BYTE Page)
}
}
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 @@ BOOLEAN BiosSetVideoMode(BYTE ModeNumber)
/* 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 @@ VOID BiosVideoService(LPWORD Stack)
case 0x00:
{
BiosSetVideoMode(LOBYTE(Eax));
BiosClearScreen();
break;
}