Wipe the vendor logo as soon as possible

Loading the image might take some minimal time. Optimize experience.
Hide cursor as well but restore it in ReadKey.
This commit is contained in:
Lauri Kenttä
2023-12-09 00:13:24 +02:00
parent 294da9c069
commit a82646a822
2 changed files with 5 additions and 0 deletions

View File

@@ -415,6 +415,10 @@ EFI_STATUS EFIAPI efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *ST_) {
BS = ST_->BootServices;
RT = ST_->RuntimeServices;
// Clear the screen to wipe the vendor logo.
ST->ConOut->EnableCursor(ST->ConOut, 0);
ST->ConOut->ClearScreen(ST->ConOut);
Log(0, L"HackBGRT version: %s\n", version);
EFI_LOADED_IMAGE* image;

View File

@@ -177,6 +177,7 @@ EFI_STATUS WaitKey(UINT64 timeout_ms) {
EFI_INPUT_KEY ReadKey(UINT64 timeout_ms) {
EFI_INPUT_KEY key = {0};
ST->ConOut->EnableCursor(ST->ConOut, 1);
WaitKey(timeout_ms);
ST->ConIn->ReadKeyStroke(ST->ConIn, &key);
return key;