Author: aandrejevic
Date: Mon Jul 4 04:08:01 2016
New Revision: 71806
URL:
http://svn.reactos.org/svn/reactos?rev=71806&view=rev
Log:
[NTVDM]
Remove the standard VGA modes from the VBE table as they're irrelevant for the
VBE driver.
Fix several bugs in INT 10h, AX = 4F02h:
- Don't crash if the video mode was not found.
- AH should be set to 1 on failure, and 0 on success.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.c [iso-8859-1] Mon Jul 4 04:08:01
2016
@@ -25,21 +25,6 @@
/* PRIVATE VARIABLES **********************************************************/
static const VBE_MODE Modes[VBE_MODE_COUNT] = {
- { 0x00, 0x00, NULL /* TODO */, NULL /* VGA */ },
- { 0x01, 0x01, NULL /* TODO */, NULL /* VGA */ },
- { 0x02, 0x02, NULL /* TODO */, NULL /* VGA */ },
- { 0x03, 0x03, NULL /* TODO */, NULL /* VGA */ },
- { 0x04, 0x04, NULL /* TODO */, NULL /* VGA */ },
- { 0x05, 0x05, NULL /* TODO */, NULL /* VGA */ },
- { 0x06, 0x06, NULL /* TODO */, NULL /* VGA */ },
- { 0x07, 0x07, NULL /* TODO */, NULL /* VGA */ },
- { 0x0D, 0x0D, NULL /* TODO */, NULL /* VGA */ },
- { 0x0E, 0x0E, NULL /* TODO */, NULL /* VGA */ },
- { 0x0F, 0x0F, NULL /* TODO */, NULL /* VGA */ },
- { 0x10, 0x10, NULL /* TODO */, NULL /* VGA */ },
- { 0x11, 0x11, NULL /* TODO */, NULL /* VGA */ },
- { 0x12, 0x12, NULL /* TODO */, NULL /* VGA */ },
- { 0x13, 0x13, NULL /* TODO */, NULL /* VGA */ },
{ 0x14, 0xFFFF, NULL /* TODO */, NULL },
{ 0x54, 0x10A, NULL /* TODO */, NULL /* TODO */ },
{ 0x55, 0x109, NULL /* TODO */, NULL /* TODO */ },
@@ -368,23 +353,25 @@
/* Set VBE Mode */
case 0x02:
{
- PCVBE_MODE Mode = VbeGetModeByNumber(getBX());
-
- if (Mode->Registers == NULL)
+ WORD VesaNumber = getBX();
+ setAL(0x4F);
+
+ if (getBX() <= BIOS_MAX_VIDEO_MODE)
{
/* Call the VGA BIOS */
setAH(0x00);
- setAL(Mode->Number);
+ setAL(VesaNumber);
Int32Call(&BiosContext, BIOS_VIDEO_INTERRUPT);
- setAL(0x4F);
- setAH(Bda->VideoMode == Mode->Number);
+ setAH(Bda->VideoMode != VesaNumber);
}
else
{
/* This is an extended video mode */
- setAL(0x4F);
- setAH(VbeSetExtendedVideoMode(Mode->Number));
+ PCVBE_MODE Mode = VbeGetModeByNumber(VesaNumber);
+
+ if (Mode) setAH(!VbeSetExtendedVideoMode(Mode->Number));
+ else setAH(1);
}
break;
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vbe.h [iso-8859-1] Mon Jul 4 04:08:01
2016
@@ -97,7 +97,7 @@
BYTE Number;
WORD VesaNumber;
PVBE_MODE_INFO Info;
- PSVGA_REGISTERS Registers; // NULL means "forward to VGABIOS"
+ PSVGA_REGISTERS Registers;
} VBE_MODE, *PVBE_MODE;
typedef const struct _VBE_MODE *PCVBE_MODE;