diff --git a/Changelog.md b/Changelog.md index 83168850451..9e9fd9c9e36 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ OpenCore Changelog - Fixed incomplete console mode initialisation when started in graphics mode - Provided additional UEFI forge mode, for use in firmware drivers - Implemented firmware driver enabling pre-OpenCore graphics on non-natively supported GPUs on EFI-era Macs +- Prevented unwanted clear screen to console background colour when in graphics mode #### v0.8.8 - Updated underlying EDK II package to edk2-stable202211 diff --git a/Library/OcConsoleLib/TextOutputBuiltin.c b/Library/OcConsoleLib/TextOutputBuiltin.c index fbe466ad32a..408e5018153 100644 --- a/Library/OcConsoleLib/TextOutputBuiltin.c +++ b/Library/OcConsoleLib/TextOutputBuiltin.c @@ -390,18 +390,21 @@ RenderResync ( mPrivateColumn = mPrivateRow = 0; This->Mode->CursorColumn = This->Mode->CursorRow = 0; - mGraphicsOutput->Blt ( - mGraphicsOutput, - &mBackgroundColor.Pixel, - EfiBltVideoFill, - 0, - 0, - 0, - 0, - Info->HorizontalResolution, - Info->VerticalResolution, - 0 - ); + if (mConsoleMode == EfiConsoleControlScreenText) { + mGraphicsOutput->Blt ( + mGraphicsOutput, + &mBackgroundColor.Pixel, + EfiBltVideoFill, + 0, + 0, + 0, + 0, + Info->HorizontalResolution, + Info->VerticalResolution, + 0 + ); + } + return EFI_SUCCESS; } @@ -968,9 +971,10 @@ OcUseBuiltinTextOutput ( mFontScale = 1; } - DEBUG ((DEBUG_INFO, "OCC: Using builtin text renderer with %d scale\n", mFontScale)); + DEBUG ((DEBUG_INFO, "OCC: Using builtin text renderer scale %u mode %u\n", mFontScale, Mode)); - Status = AsciiTextResetEx (&mAsciiTextOutputProtocol, TRUE, TRUE); + mConsoleMode = Mode; + Status = AsciiTextResetEx (&mAsciiTextOutputProtocol, TRUE, TRUE); if (!EFI_ERROR (Status)) { OcConsoleControlInstallProtocol (&mConsoleControlProtocol, NULL, NULL);