} else { // User specified width & height; must find mode
// Do a loop through the modes to see if the specified one is available;
// and if so, switch to it....
- while ((Status == EFI_SUCCESS) && (!ModeSet)) {
+ do {
Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info);
if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info)) &&
(Info->HorizontalResolution == *ScreenWidth) && (Info->VerticalResolution == *ScreenHeight)) {
Status = refit_call2_wrapper(GraphicsOutput->SetMode, GraphicsOutput, ModeNum);
ModeSet = (Status == EFI_SUCCESS);
} // if
- ModeNum++;
- } // while()
+ } while (((ModeNum++ < 10) || (Status == EFI_SUCCESS)) && !ModeSet);
+// while ((Status == EFI_SUCCESS) && (!ModeSet)) {
+// Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info);
+// if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info)) &&
+// (Info->HorizontalResolution == *ScreenWidth) && (Info->VerticalResolution == *ScreenHeight)) {
+// Status = refit_call2_wrapper(GraphicsOutput->SetMode, GraphicsOutput, ModeNum);
+// ModeSet = (Status == EFI_SUCCESS);
+// } // if
+// ModeNum++;
+// } // while()
} // if/else
if (ModeSet) {
PauseForKey();
SwitchToGraphics();
} // if()
+
} else if (UgaDraw != NULL) { // UGA mode (EFI 1.x)
// Try to use current color depth & refresh rate for new mode. Maybe not the best choice
// in all cases, but I don't know how to probe for alternatives....
if (!egHasGraphics)
return;
- FillColor.Red = Color->r;
- FillColor.Green = Color->g;
- FillColor.Blue = Color->b;
+ if (Color != NULL) {
+ FillColor.Red = Color->r;
+ FillColor.Green = Color->g;
+ FillColor.Blue = Color->b;
+ } else {
+ FillColor.Red = 0x0;
+ FillColor.Green = 0x0;
+ FillColor.Blue = 0x0;
+ }
FillColor.Reserved = 0;
if (GraphicsOutput != NULL) {
// layout, and the header from TianoCore actually defines them
// to be the same type.
refit_call10_wrapper(GraphicsOutput->Blt, GraphicsOutput, (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)&FillColor, EfiBltVideoFill,
- 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
+ 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
} else if (UgaDraw != NULL) {
- refit_call10_wrapper(UgaDraw->Blt, UgaDraw, &FillColor, EfiUgaVideoFill,
- 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
+ refit_call10_wrapper(UgaDraw->Blt, UgaDraw, &FillColor, EfiUgaVideoFill, 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
}
}