Skip to content

Commit

Permalink
FastbootMenu: print lovely logo when mainline optimization is enabled
Browse files Browse the repository at this point in the history
Thank you for everything, you are wonderful.

Change-Id: Id980aac9101ba7efd2cf720cc49579feb2dc3755
Signed-off-by: Alexander Martinz <[email protected]>
  • Loading branch information
amartinz committed Aug 31, 2022
1 parent 30d5c7d commit 95b1473
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions QcomModulePkg/Include/Library/DrawUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ typedef enum {
BGR_YELLOW,
BGR_RED,
BGR_GREEN,
BGR_GREEN_DARK,
BGR_BLUE,
BGR_CYAN,
BGR_SILVER,
Expand Down
1 change: 1 addition & 0 deletions QcomModulePkg/Library/BootLib/DrawUI.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL mColors[] = {
[BGR_YELLOW] = {0x00, 0xff, 0xff, 0x00},
[BGR_RED] = {0x00, 0x00, 0x98, 0x00},
[BGR_GREEN] = {0x00, 0xff, 0x00, 0x00},
[BGR_GREEN_DARK] = {0x00, 0x99, 0x00, 0x00},
[BGR_BLUE] = {0xff, 0x00, 0x00, 0x00},
[BGR_CYAN] = {0xff, 0xff, 0x00, 0x00},
[BGR_SILVER] = {0xc0, 0xc0, 0xc0, 0x00},
Expand Down
33 changes: 33 additions & 0 deletions QcomModulePkg/Library/BootLib/FastbootMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ STATIC MENU_MSG_INFO mFastbootOptionTitle[] = {
#define FASTBOOT_MSG_INDEX_SECURE_BOOT 10
#define FASTBOOT_MSG_INDEX_DEVICE_STATE_UNLOCKED 11
#define FASTBOOT_MSG_INDEX_DEVICE_STATE_LOCKED 12
#define FASTBOOT_MSG_INDEX_MAINLINE 13

STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = {
{{"\nPress volume key to select, "
Expand Down Expand Up @@ -196,6 +197,26 @@ STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = {
COMMON,
0,
NOACTION},
{{"\n"},
COMMON_FACTOR,
BGR_GREEN_DARK,
BGR_BLACK,
COMMON,
0,
NOACTION},
};

STATIC CONST CHAR8 MAINLINE_LOGO_PMOS[][MAX_RSP_SIZE] = {
" /\\\n",
" / \\\n",
" / \\\n",
" \\__ \\\n",
" /\\__ \\ \\\n",
" / / \\ _\\\n",
" / / \\/ __\n",
" / / ______/ \\\n",
" / \\ \\ \\\n",
"/_____/ /__________\\\n",
};

/**
Expand Down Expand Up @@ -264,6 +285,7 @@ FastbootMenuShowScreen (OPTION_MENU_INFO *OptionMenuInfo)
UINT32 OptionItem = 0;
UINT32 Height = 0;
UINT32 i = 0;
UINT32 j = 0;
CHAR8 StrTemp[MAX_RSP_SIZE] = "";
CHAR8 StrTemp1[MAX_RSP_SIZE] = "";
CHAR8 VersionTemp[MAX_VERSION_LEN] = "";
Expand Down Expand Up @@ -374,6 +396,17 @@ FastbootMenuShowScreen (OPTION_MENU_INFO *OptionMenuInfo)
if (IsUnlocked ())
continue;
break;
case FASTBOOT_MSG_INDEX_MAINLINE:
/* Print random mainline logo (right now only pmOS though) */
if (!IsMainlineOptimizationEnabled ())
continue;

for (j = 0; j < ARRAY_SIZE (MAINLINE_LOGO_PMOS); j++) {
AsciiStrnCatS (
mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg),
MAINLINE_LOGO_PMOS[j], sizeof (MAINLINE_LOGO_PMOS[j]));
}
break;
}

mFastbootCommonMsgInfo[i].Location = Location;
Expand Down

0 comments on commit 95b1473

Please sign in to comment.