-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
476 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
*/ | ||
/* | ||
* Modified for RefindPlus | ||
* Copyright (c) 2020-2024 Dayo Akanji (sf.net/u/dakanji/profile) | ||
* Copyright (c) 2020-2025 Dayo Akanji (sf.net/u/dakanji/profile) | ||
* Portions Copyright (c) 2021 Joe van Tunen ([email protected]) | ||
* | ||
* Modifications distributed under the preceding terms. | ||
|
@@ -2362,6 +2362,9 @@ VOID ReadConfig ( | |
BOOLEAN GotSyncTrustAll; | ||
BOOLEAN GotNoneSyncTrust; | ||
BOOLEAN OutLoopSyncTrust; | ||
BOOLEAN GotNoBootLogoAll; | ||
BOOLEAN GotNoneNoBootLogo; | ||
BOOLEAN OutLoopNoBootLogo; | ||
BOOLEAN GotGraphicsForAll; | ||
BOOLEAN GotNoneGraphicsFor; | ||
BOOLEAN OutLoopGraphicsFor; | ||
|
@@ -2508,6 +2511,7 @@ VOID ReadConfig ( | |
CheckManual = DoneManual = FALSE; | ||
GotNoneHideui = OutLoopHideui = FALSE; | ||
GotNoneSyncTrust = OutLoopSyncTrust = FALSE; | ||
GotNoneNoBootLogo = OutLoopNoBootLogo = FALSE; | ||
GotNoneGraphicsFor = OutLoopGraphicsFor = FALSE; | ||
#if REFIT_DEBUG > 0 | ||
if (!OuterLoop) { | ||
|
@@ -3745,6 +3749,62 @@ VOID ReadConfig ( | |
TokenList, TokenCount | ||
); | ||
} | ||
else if (MyStriCmp (TokenList[0], L"disable_bootlogo")) { | ||
#if REFIT_DEBUG > 0 | ||
if (!OuterLoop && !OutLoopNoBootLogo) { | ||
UpdatedToken = LogUpdate ( | ||
TokenList[0], NotRunBefore, TRUE | ||
); | ||
} | ||
#endif | ||
|
||
GotNoBootLogoAll = FALSE; | ||
if (!OuterLoop && !OutLoopNoBootLogo) { | ||
// DA-TAG: Allows reset/override in 'included' config files | ||
OutLoopNoBootLogo = TRUE; | ||
GlobalConfig.DisableBootLogo = DISABLE_BOOTLOGO_OFF; | ||
} | ||
|
||
for (i = 1; i < TokenCount; i++) { | ||
Flag = TokenList[i]; | ||
if (MyStrBegins (Flag, L"Off")) { | ||
// DA-TAG: Required despite earlier reset | ||
// This will always be used if in token list | ||
GotNoneNoBootLogo = TRUE; | ||
GlobalConfig.DisableBootLogo = DISABLE_BOOTLOGO_OFF; | ||
break; | ||
} | ||
|
||
if (!GotNoBootLogoAll) { | ||
// DA-TAG: Arranged as so to prioritise 'Off' above | ||
if (MyStrBegins (Flag, L"All")) { | ||
GotNoBootLogoAll = TRUE; | ||
GlobalConfig.DisableBootLogo = DISABLE_BOOTLOGO_ALL; | ||
} | ||
else { | ||
if (0); | ||
else if (MyStrBegins (Flag, L"Lin")) GlobalConfig.DisableBootLogo |= DISABLE_BOOTLOGO_LIN; | ||
else if (MyStrBegins (Flag, L"Win")) GlobalConfig.DisableBootLogo |= DISABLE_BOOTLOGO_WIN; | ||
else { | ||
MsgStr = PoolPrint ( | ||
L"WARN: Invalid 'disable_bootlogo' Token:- '%s'", Flag | ||
); | ||
|
||
#if REFIT_DEBUG > 0 | ||
if (NotRunBefore) MuteLogger = FALSE; | ||
LOG_MSG("%s - %s", OffsetNext, MsgStr); | ||
if (NotRunBefore) MuteLogger = TRUE; | ||
#endif | ||
|
||
SwitchToText (FALSE); | ||
PrintUglyText (MsgStr, NEXTLINE); | ||
PauseForKey(); | ||
MY_FREE_POOL(MsgStr); | ||
} | ||
} | ||
} | ||
} // for | ||
} | ||
else if (MyStriCmp (TokenList[0], L"supply_nvme")) { | ||
#if REFIT_DEBUG > 0 | ||
if (!OuterLoop) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
*/ | ||
/* | ||
* Modified for RefindPlus | ||
* Copyright (c) 2020-2024 Dayo Akanji (sf.net/u/dakanji/profile) | ||
* Copyright (c) 2020-2025 Dayo Akanji (sf.net/u/dakanji/profile) | ||
* Portions Copyright (c) 2021 Joe van Tunen ([email protected]) | ||
* | ||
* Modifications distributed under the preceding terms. | ||
|
@@ -261,6 +261,8 @@ EG_IMAGE * LoadOSIcon ( | |
IN BOOLEAN BootLogo | ||
) { | ||
EG_IMAGE *Image; | ||
BOOLEAN WinAltIcon; | ||
BOOLEAN LoadCustom; | ||
CHAR16 *CutoutName; | ||
CHAR16 *BaseName; | ||
UINTN Index2; | ||
|
@@ -272,7 +274,14 @@ EG_IMAGE * LoadOSIcon ( | |
return NULL; | ||
} | ||
|
||
// Try to find an icon from the OSIconName list | ||
if (BootLogo && GlobalConfig.DisableBootLogo == DISABLE_BOOTLOGO_ALL) { | ||
return NULL; | ||
} | ||
|
||
LoadCustom = MyStriCmp (FallbackIconName, EXIT_SPLASH); | ||
WinAltIcon = MyStriCmp (FallbackIconName, L"windows"); | ||
|
||
// Try to find an icon from the OSIconName list. | ||
Index = 0; | ||
OurId = -1; | ||
Image = NULL; | ||
|
@@ -286,8 +295,8 @@ EG_IMAGE * LoadOSIcon ( | |
CutoutName | ||
); | ||
|
||
// Skip cache check if BootLogo is set | ||
// BootLogo is not cached | ||
// Skip cache check if BootLogo is set. | ||
// BootLogo is not cached. | ||
if (GlobalConfig.HelpIcon && !BootLogo) { | ||
for (Index2 = 0; Index2 < BASE_OS_ICON_COUNT; Index2++) { | ||
Image = LoadIndexedIcon (BaseName, Index2); | ||
|
@@ -306,10 +315,11 @@ EG_IMAGE * LoadOSIcon ( | |
MY_FREE_POOL(CutoutName); | ||
} // while | ||
|
||
// Try again with "os_" if that fails and BootLogo was set | ||
if (BootLogo && Image == NULL) { | ||
Index = 0; | ||
OurId = -1; | ||
// Try again with 'os_' if that fails, | ||
// BootLogo was set, but not 'LoadCustom'. | ||
if (!LoadCustom && BootLogo && Image == NULL) { | ||
Index = 0; | ||
OurId = -1; | ||
while ( | ||
Image == NULL && | ||
(CutoutName = FindCommaDelimited (OSIconName, Index++)) != NULL | ||
|
@@ -319,37 +329,25 @@ EG_IMAGE * LoadOSIcon ( | |
CutoutName | ||
); | ||
|
||
// Skip cache check if BootLogo is set | ||
// BootLogo is not cached | ||
if (GlobalConfig.HelpIcon && !BootLogo) { | ||
for (Index2 = 0; Index2 < BASE_OS_ICON_COUNT; Index2++) { | ||
Image = LoadIndexedIcon (BaseName, Index2); | ||
if (Image != NULL) { | ||
OurId = (Index2 < BASE_OS_ICON_COUNT) | ||
? Index2 : (BASE_OS_ICON_COUNT - 1); | ||
|
||
break; | ||
} | ||
} // for | ||
} | ||
|
||
// No cache check as BootLogo is set. | ||
// BootLogo is not cached. | ||
UpdateBaseIcon (BaseName, &Image); | ||
|
||
MY_FREE_POOL(BaseName); | ||
MY_FREE_POOL(CutoutName); | ||
} // while | ||
} | ||
|
||
// Try again using "FallbackIconName" if that fails | ||
// Try again using 'FallbackIconName' if that fails. | ||
if (Image == NULL) { | ||
BaseName = PoolPrint ( | ||
L"%s_%s", | ||
(BootLogo) ? L"boot" : L"os", | ||
FallbackIconName | ||
); | ||
|
||
// Skip cache check if BootLogo is set | ||
// BootLogo is not cached | ||
// Skip cache check if BootLogo is set. | ||
// BootLogo is not cached. | ||
if (GlobalConfig.HelpIcon && !BootLogo) { | ||
for (Index2 = 0; Index2 < BASE_OS_ICON_COUNT; Index2++) { | ||
Image = LoadIndexedIcon (BaseName, Index2); | ||
|
@@ -364,10 +362,38 @@ EG_IMAGE * LoadOSIcon ( | |
|
||
UpdateBaseIcon (BaseName, &Image); | ||
MY_FREE_POOL(BaseName); | ||
|
||
// If that fails and 'WinAltIcon' is set, | ||
// try with 'win' as 'FallbackIconName'. | ||
if (Image == NULL && WinAltIcon) { | ||
BaseName = PoolPrint ( | ||
L"%s_%s", | ||
(BootLogo) ? L"boot" : L"os", | ||
L"win" | ||
); | ||
|
||
// Skip cache check if BootLogo is set. | ||
// BootLogo is not cached. | ||
if (GlobalConfig.HelpIcon && !BootLogo) { | ||
for (Index2 = 0; Index2 < BASE_OS_ICON_COUNT; Index2++) { | ||
Image = LoadIndexedIcon (BaseName, Index2); | ||
if (Image != NULL) { | ||
OurId = (Index2 < BASE_OS_ICON_COUNT) | ||
? Index2 : (BASE_OS_ICON_COUNT - 1); | ||
|
||
break; | ||
} | ||
} // for | ||
} | ||
|
||
UpdateBaseIcon (BaseName, &Image); | ||
MY_FREE_POOL(BaseName); | ||
} | ||
} | ||
|
||
// Try again with "os_" if that fails and BootLogo was set | ||
if (BootLogo && Image == NULL) { | ||
// Try again with 'os_' if that fails, | ||
// BootLogo was set, but not 'LoadCustom'. | ||
if (!LoadCustom && BootLogo && Image == NULL) { | ||
BaseName = PoolPrint (L"os_%s", FallbackIconName); | ||
|
||
if (GlobalConfig.HelpIcon) { | ||
|
@@ -384,10 +410,27 @@ EG_IMAGE * LoadOSIcon ( | |
|
||
UpdateBaseIcon (BaseName, &Image); | ||
MY_FREE_POOL(BaseName); | ||
|
||
// Try 'os_win' if that fails and 'WinAltIcon' is set. | ||
if (Image == NULL && WinAltIcon) { | ||
if (GlobalConfig.HelpIcon) { | ||
for (Index2 = 0; Index2 < BASE_OS_ICON_COUNT; Index2++) { | ||
Image = LoadIndexedIcon (L"os_win", Index2); | ||
if (Image != NULL) { | ||
OurId = (Index2 < BASE_OS_ICON_COUNT) | ||
? Index2 : (BASE_OS_ICON_COUNT - 1); | ||
|
||
break; | ||
} | ||
} // for | ||
} | ||
|
||
UpdateBaseIcon (L"os_win", &Image); | ||
} | ||
} | ||
|
||
// Try again with the "unknown" icon specifically if that fails. | ||
// Only if BootLogo is *NOT* set ... No "unknown" BootLogo icon | ||
// Only if BootLogo is *NOT* set ... No "unknown" BootLogo icon. | ||
if (!BootLogo && | ||
Image == NULL && | ||
!MyStriCmp (FallbackIconName, L"unknown") | ||
|
@@ -406,8 +449,8 @@ EG_IMAGE * LoadOSIcon ( | |
} | ||
} | ||
|
||
// Use the "dummy" image if still fails | ||
if (Image == NULL) { | ||
// Use the "dummy" image if still fails and BootLogo is *NOT* set. | ||
if (!BootLogo && Image == NULL) { | ||
#if REFIT_DEBUG > 0 | ||
ALT_LOG(1, LOG_LINE_NORMAL, L"Set Dummy Image"); | ||
#endif | ||
|
@@ -425,12 +468,12 @@ EG_IMAGE * LoadOSIcon ( | |
} | ||
} | ||
|
||
// Return NULL if all failed | ||
// Return NULL if all failed. | ||
if (Image == NULL) { | ||
return NULL; | ||
} | ||
|
||
// Cache the image if appropriate and not BootLogo | ||
// Cache the image if appropriate and not BootLogo. | ||
if (GlobalConfig.HelpIcon && !BootLogo) { | ||
if (OurId >= 0 && TableBuiltinIconOS[OurId].Image == NULL) { | ||
TableBuiltinIconOS[OurId].Image = Image; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters