+// Display a message in the center of the screen, surrounded by a box of the
+// specified color. For the moment, uses graphics calls only. (It still works
+// in text mode on GOP/UEFI systems, but not on UGA/EFI 1.x systems.)
+VOID egDisplayMessage(IN CHAR16 *Text, EG_PIXEL *BGColor) {
+ UINTN BoxWidth, BoxHeight;
+ EG_IMAGE *Box;
+
+ if ((Text != NULL) && (BGColor != NULL)) {
+ BoxWidth = (StrLen(Text) + 2) * FONT_CELL_WIDTH;
+ if (BoxWidth > egScreenWidth)
+ BoxWidth = egScreenWidth;
+ BoxHeight = 2 * FONT_CELL_HEIGHT;
+ Box = egCreateFilledImage(BoxWidth, BoxHeight, FALSE, BGColor);
+ egRenderText(Text, Box, FONT_CELL_WIDTH, FONT_CELL_HEIGHT / 2);
+ egDrawImage(Box, (egScreenWidth - BoxWidth) / 2, (egScreenHeight - BoxHeight) / 2);
+ } // if non-NULL inputs
+} // VOID egDisplayMessage()
+