[FREELDR] Fix menu display on VMware

When drawing the menu, the boot options should not be overwritten, but when clearing the screen, everything needs to be drawn, otherwise there will be uninitialized characters at the bottom. See CORE-20014.
This commit is contained in:
Timo Kreuzer 2025-03-03 13:06:23 +02:00
parent bcedb5314c
commit 9a093ecbe9
15 changed files with 31 additions and 25 deletions

View file

@ -427,8 +427,8 @@ VOID RunLoader(VOID)
for (;;) for (;;)
{ {
/* Redraw the backdrop */ /* Redraw the backdrop, but don't overwrite boot options */
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight() - 2);
/* Show the operating system list menu */ /* Show the operating system list menu */
if (!UiDisplayMenu("Please select the operating system to start:", if (!UiDisplayMenu("Please select the operating system to start:",

View file

@ -53,7 +53,7 @@ extern const PCSTR UiMonthNames[12];
BOOLEAN UiInitialize(BOOLEAN ShowUi); // Initialize User-Interface BOOLEAN UiInitialize(BOOLEAN ShowUi); // Initialize User-Interface
VOID UiUnInitialize(PCSTR BootText); // Un-initialize User-Interface VOID UiUnInitialize(PCSTR BootText); // Un-initialize User-Interface
VOID UiDrawBackdrop(VOID); // Fills the entire screen with a backdrop VOID UiDrawBackdrop(ULONG DrawHeight); // Fills the entire screen with a backdrop
VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); // Draws a box around the area specified VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); // Draws a box around the area specified
@ -254,7 +254,7 @@ typedef struct tagUIVTBL
BOOLEAN (*Initialize)(VOID); BOOLEAN (*Initialize)(VOID);
VOID (*UnInitialize)(VOID); VOID (*UnInitialize)(VOID);
VOID (*DrawBackdrop)(VOID); VOID (*DrawBackdrop)(ULONG DrawHeight);
VOID (*FillArea)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr); VOID (*FillArea)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr);
VOID (*DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); VOID (*DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom);
VOID (*DrawBox)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); VOID (*DrawBox)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr);

View file

@ -10,7 +10,7 @@
/* Textual User Interface Functions ******************************************/ /* Textual User Interface Functions ******************************************/
VOID MiniTuiDrawBackdrop(VOID); VOID MiniTuiDrawBackdrop(ULONG DrawHeight);
VOID MiniTuiDrawStatusText(PCSTR StatusText); VOID MiniTuiDrawStatusText(PCSTR StatusText);
VOID VOID

View file

@ -13,7 +13,7 @@
BOOLEAN NoUiInitialize(VOID); BOOLEAN NoUiInitialize(VOID);
VOID NoUiUnInitialize(VOID); VOID NoUiUnInitialize(VOID);
VOID NoUiDrawBackdrop(VOID); VOID NoUiDrawBackdrop(ULONG DrawHeight);
VOID NoUiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr); VOID NoUiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr);
VOID NoUiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); VOID NoUiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom);
VOID NoUiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); VOID NoUiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr);

View file

@ -37,7 +37,7 @@ TuiTruncateStringEllipsis(
BOOLEAN TuiInitialize(VOID); // Initialize User-Interface BOOLEAN TuiInitialize(VOID); // Initialize User-Interface
VOID TuiUnInitialize(VOID); // Un-initialize User-Interface VOID TuiUnInitialize(VOID); // Un-initialize User-Interface
VOID TuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop VOID TuiDrawBackdrop(ULONG DrawHeight); // Fills the entire screen with a backdrop
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified

View file

@ -114,7 +114,7 @@ LoadAndBootLinux(
else else
strcpy(LinuxBootDescription, "Loading Linux..."); strcpy(LinuxBootDescription, "Loading Linux...");
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
UiDrawStatusText(LinuxBootDescription); UiDrawStatusText(LinuxBootDescription);
UiDrawProgressBarCenter(LinuxBootDescription); UiDrawProgressBarCenter(LinuxBootDescription);

View file

@ -531,7 +531,7 @@ LoadReactOSSetup(
} }
/* Let the user know we started loading */ /* Let the user know we started loading */
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
UiDrawStatusText("Setup is loading..."); UiDrawStatusText("Setup is loading...");
UiDrawProgressBarCenter("Loading ReactOS Setup..."); UiDrawProgressBarCenter("Loading ReactOS Setup...");

View file

@ -1030,7 +1030,7 @@ LoadAndBootWindows(
} }
/* Let the user know we started loading */ /* Let the user know we started loading */
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
UiDrawStatusText("Loading..."); UiDrawStatusText("Loading...");
UiDrawProgressBarCenter("Loading NT..."); UiDrawProgressBarCenter("Loading NT...");

View file

@ -108,7 +108,7 @@ VOID DoOptionsMenu(IN OperatingSystemItem* OperatingSystem)
} }
/* Clear the backdrop */ /* Clear the backdrop */
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
switch (SelectedMenuItem) switch (SelectedMenuItem)
{ {

View file

@ -35,7 +35,7 @@ UiInitialize(IN BOOLEAN ShowUi)
MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth); MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
/* Clear the screen */ /* Clear the screen */
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
return TRUE; return TRUE;
} }
@ -47,7 +47,7 @@ UiUnInitialize(IN PCSTR BootText)
} }
VOID VOID
UiDrawBackdrop(VOID) UiDrawBackdrop(ULONG DrawHeight)
{ {
/* Clear the screen */ /* Clear the screen */
MachVideoClearScreen(ATTR(COLOR_WHITE, COLOR_BLACK)); MachVideoClearScreen(ATTR(COLOR_WHITE, COLOR_BLACK));

View file

@ -53,10 +53,10 @@ BOOLEAN MiniTuiInitialize(VOID)
return TRUE; return TRUE;
} }
VOID MiniTuiDrawBackdrop(VOID) VOID MiniTuiDrawBackdrop(ULONG DrawHeight)
{ {
/* Fill in a black background */ /* Fill in a black background */
TuiFillArea(0, 0, UiScreenWidth - 1, UiScreenHeight - 3, TuiFillArea(0, 0, UiScreenWidth - 1, DrawHeight - 1,
UiBackdropFillStyle, UiBackdropFillStyle,
ATTR(UiBackdropFgColor, UiBackdropBgColor)); ATTR(UiBackdropFgColor, UiBackdropBgColor));
@ -64,6 +64,12 @@ VOID MiniTuiDrawBackdrop(VOID)
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
} }
VOID MiniTuiFadeInBackdrop(VOID)
{
/* No fade-in effect in MiniTui */
MiniTuiDrawBackdrop(UiScreenHeight);
}
VOID MiniTuiDrawStatusText(PCSTR StatusText) VOID MiniTuiDrawStatusText(PCSTR StatusText)
{ {
/* Minimal UI doesn't have a status bar */ /* Minimal UI doesn't have a status bar */
@ -186,7 +192,7 @@ MiniTuiDrawMenu(
ULONG i; ULONG i;
/* Draw the backdrop */ /* Draw the backdrop */
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
/* No GUI status bar text, just minimal text. Show the menu header. */ /* No GUI status bar text, just minimal text. Show the menu header. */
if (MenuInfo->MenuHeader) if (MenuInfo->MenuHeader)
@ -250,7 +256,7 @@ const UIVTBL MiniTuiVtbl =
TuiEditBox, TuiEditBox,
TuiTextToColor, TuiTextToColor,
TuiTextToFillStyle, TuiTextToFillStyle,
MiniTuiDrawBackdrop, /* no FadeIn */ MiniTuiFadeInBackdrop,
TuiFadeOut, TuiFadeOut,
TuiDisplayMenu, TuiDisplayMenu,
MiniTuiDrawMenu, MiniTuiDrawMenu,

View file

@ -17,7 +17,7 @@ VOID NoUiUnInitialize(VOID)
{ {
} }
VOID NoUiDrawBackdrop(VOID) VOID NoUiDrawBackdrop(ULONG DrawHeight)
{ {
} }

View file

@ -269,13 +269,13 @@ VOID TuiUnInitialize(VOID)
MachVideoHideShowTextCursor(TRUE); MachVideoHideShowTextCursor(TRUE);
} }
VOID TuiDrawBackdrop(VOID) VOID TuiDrawBackdrop(ULONG DrawHeight)
{ {
/* Fill in the background (excluding title box & status bar) */ /* Fill in the background (excluding title box & status bar) */
TuiFillArea(0, TuiFillArea(0,
TUI_TITLE_BOX_CHAR_HEIGHT, TUI_TITLE_BOX_CHAR_HEIGHT,
UiScreenWidth - 1, UiScreenWidth - 1,
UiScreenHeight - 3, DrawHeight - 2,
UiBackdropFillStyle, UiBackdropFillStyle,
ATTR(UiBackdropFgColor, UiBackdropBgColor)); ATTR(UiBackdropFgColor, UiBackdropBgColor));
@ -996,7 +996,7 @@ VOID TuiFadeInBackdrop(VOID)
} }
// Draw the backdrop and title box // Draw the backdrop and title box
TuiDrawBackdrop(); TuiDrawBackdrop(UiGetScreenHeight());
if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed() && TuiFadePalette != NULL) if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed() && TuiFadePalette != NULL)
{ {

View file

@ -202,7 +202,7 @@ TuiDrawMenu(
// FIXME: Theme-specific // FIXME: Theme-specific
/* Draw the backdrop */ /* Draw the backdrop */
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
/* Draw the menu box */ /* Draw the menu box */
TuiDrawMenuBox(MenuInfo); TuiDrawMenuBox(MenuInfo);

View file

@ -223,16 +223,16 @@ BOOLEAN UiInitialize(BOOLEAN ShowUi)
VOID UiUnInitialize(PCSTR BootText) VOID UiUnInitialize(PCSTR BootText)
{ {
UiDrawBackdrop(); UiDrawBackdrop(UiGetScreenHeight());
UiDrawStatusText(BootText); UiDrawStatusText(BootText);
UiInfoBox(BootText); UiInfoBox(BootText);
UiVtbl.UnInitialize(); UiVtbl.UnInitialize();
} }
VOID UiDrawBackdrop(VOID) VOID UiDrawBackdrop(ULONG DrawHeight)
{ {
UiVtbl.DrawBackdrop(); UiVtbl.DrawBackdrop(DrawHeight);
} }
VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */) VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */)