//\r
// Store current mode settings since PrepareToScanRom may change mode.\r
//\r
- VideoMode = *(UINT8 *) ((UINTN) 0x449);\r
+ VideoMode = *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE));\r
}\r
//\r
// Notify the platform that we are about to scan the ROM\r
//\r
// Set mode settings since PrepareToScanRom may change mode\r
//\r
- Regs.H.AH = 0x00;\r
- Regs.H.AL = VideoMode;\r
- Private->LegacyBios.Int86 (&Private->LegacyBios, 0x10, &Regs);\r
+ if (VideoMode != *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE))) {\r
+ //\r
+ // The active video mode is changed, restore it to original mode.\r
+ //\r
+ Regs.H.AH = 0x00;\r
+ Regs.H.AL = VideoMode;\r
+ Private->LegacyBios.Int86 (&Private->LegacyBios, 0x10, &Regs);\r
+ }\r
}\r
//\r
// Regs.X.AX from the adapter initializion is ignored since some adapters\r