Skip to content

Commit

Permalink
OcConsoleLib: Do not clear screen on console reset if in graphics mode
Browse files Browse the repository at this point in the history
Prevents clearing to console background colour when screen is in themed graphics mode
  • Loading branch information
mikebeaton committed Jan 29, 2023
1 parent 3bd023b commit a189bd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -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
Expand Down
32 changes: 18 additions & 14 deletions Library/OcConsoleLib/TextOutputBuiltin.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a189bd5

Please sign in to comment.