[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 (;;)
{
/* Redraw the backdrop */
UiDrawBackdrop();
/* Redraw the backdrop, but don't overwrite boot options */
UiDrawBackdrop(UiGetScreenHeight() - 2);
/* Show the operating system list menu */
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
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 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
@ -254,7 +254,7 @@ typedef struct tagUIVTBL
BOOLEAN (*Initialize)(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 (*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);

View file

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

View file

@ -13,7 +13,7 @@
BOOLEAN NoUiInitialize(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 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);

View file

@ -37,7 +37,7 @@ TuiTruncateStringEllipsis(
BOOLEAN TuiInitialize(VOID); // 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 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
strcpy(LinuxBootDescription, "Loading Linux...");
UiDrawBackdrop();
UiDrawBackdrop(UiGetScreenHeight());
UiDrawStatusText(LinuxBootDescription);
UiDrawProgressBarCenter(LinuxBootDescription);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -223,16 +223,16 @@ BOOLEAN UiInitialize(BOOLEAN ShowUi)
VOID UiUnInitialize(PCSTR BootText)
{
UiDrawBackdrop();
UiDrawBackdrop(UiGetScreenHeight());
UiDrawStatusText(BootText);
UiInfoBox(BootText);
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 */)