mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 23:48:12 +00:00
[NTVDM]
The highest bit of the mode number is used to determine whether or not we need to clear the screen. Fix the existing code that was disabled in revision 61907 because it was completely wrong. Now we correctly support this feature. Also check the mode number limit and fail if it is unsupported. svn path=/trunk/; revision=64431
This commit is contained in:
parent
26fc5d3c9c
commit
39faa961a5
1 changed files with 16 additions and 5 deletions
|
@ -1003,11 +1003,23 @@ BYTE VidBiosGetVideoMode(VOID)
|
|||
static BOOLEAN VidBiosSetVideoMode(BYTE ModeNumber)
|
||||
{
|
||||
BYTE Page;
|
||||
|
||||
COORD Resolution;
|
||||
PVGA_REGISTERS VgaMode = VideoModes[ModeNumber];
|
||||
BOOLEAN DoNotClear = !!(ModeNumber & 0x80);
|
||||
PVGA_REGISTERS VgaMode;
|
||||
|
||||
DPRINT1("Switching to mode %Xh; VgaMode = 0x%p\n", ModeNumber, VgaMode);
|
||||
/* Retrieve the real mode number and check its validity */
|
||||
ModeNumber &= 0x7F;
|
||||
// if (ModeNumber >= sizeof(VideoModes)/sizeof(VideoModes[0]))
|
||||
if (ModeNumber > BIOS_MAX_VIDEO_MODE)
|
||||
{
|
||||
DPRINT1("VidBiosSetVideoMode -- Mode %02Xh invalid\n", ModeNumber);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VgaMode = VideoModes[ModeNumber];
|
||||
|
||||
DPRINT1("Switching to mode %02Xh %s clearing the screen; VgaMode = 0x%p\n",
|
||||
ModeNumber, (DoNotClear ? "without" : "and"), VgaMode);
|
||||
|
||||
if (!VgaSetRegisters(VgaMode)) return FALSE;
|
||||
|
||||
|
@ -1019,8 +1031,7 @@ static BOOLEAN VidBiosSetVideoMode(BYTE ModeNumber)
|
|||
* See Ralf Brown: http://www.ctyme.com/intr/rb-0069.htm
|
||||
* for more information.
|
||||
*/
|
||||
// if ((ModeNumber & 0x08) == 0) VgaClearMemory();
|
||||
VgaClearMemory();
|
||||
if (!DoNotClear) VgaClearMemory();
|
||||
|
||||
// Bda->CrtModeControl;
|
||||
// Bda->CrtColorPaletteMask;
|
||||
|
|
Loading…
Reference in a new issue