提交 ac4dd020 编写于 作者: V vit9696

OpenCanopy: Fix switching to graphics mode when entering canopy

closes acidanthera/bugtracker#1512
上级 12f15107
......@@ -10,6 +10,7 @@ OpenCore Changelog
- Added workaround for firmware not specifying DeviceHandle at bootstrap
- Added support for R/O page tables in `SetupVirtualMap` quirk
- Added OEM preservation for certain Apple SMBIOS tables
- Fixed switching to graphics mode when entering OpenCanopy
#### v0.6.6
- Added keyboard and pointer entry scroll support in OpenCanopy
......
......@@ -33,9 +33,48 @@
extern BOOT_PICKER_GUI_CONTEXT mGuiContext;
extern CONST GUI_IMAGE mBackgroundImage;
STATIC GUI_DRAWING_CONTEXT mDrawContext;
STATIC EFI_CONSOLE_CONTROL_SCREEN_MODE mPreviousMode;
STATIC
EFI_STATUS
OcShowMenyByOcEnter (
IN OC_BOOT_CONTEXT *BootContext
)
{
EFI_STATUS Status;
Status = GuiLibConstruct (
BootContext->PickerContext,
mGuiContext.CursorDefaultX,
mGuiContext.CursorDefaultY
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Extension for OpenCore builtin renderer to mark that we control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_CONTROLLED);
mPreviousMode = OcConsoleControlSetMode (EfiConsoleControlScreenGraphics);
return EFI_SUCCESS;
}
STATIC
GUI_DRAWING_CONTEXT
mDrawContext;
VOID
OcShowMenyByOcLeave (
VOID
)
{
GuiLibDestruct ();
//
// Extension for OpenCore builtin renderer to mark that we no longer control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_UNCONTROLLED);
OcConsoleControlSetMode (mPreviousMode);
}
EFI_STATUS
EFIAPI
......@@ -56,20 +95,11 @@ OcShowMenuByOc (
mGuiContext.PickerContext = BootContext->PickerContext;
mGuiContext.AudioPlaybackTimeout = -1;
Status = GuiLibConstruct (
BootContext->PickerContext,
mGuiContext.CursorDefaultX,
mGuiContext.CursorDefaultY
);
Status = OcShowMenyByOcEnter (BootContext);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Extension for OpenCore builtin renderer to mark that we control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_CONTROLLED);
//
// Do not play intro animation for blind.
//
......@@ -83,7 +113,7 @@ OcShowMenuByOc (
InternalGetCursorImage
);
if (EFI_ERROR (Status)) {
GuiLibDestruct ();
OcShowMenyByOcLeave ();
return Status;
}
......@@ -95,7 +125,7 @@ OcShowMenuByOc (
Index == BootContext->DefaultEntry->EntryIndex - 1
);
if (EFI_ERROR (Status)) {
GuiLibDestruct ();
OcShowMenyByOcLeave ();
return Status;
}
}
......@@ -138,12 +168,7 @@ OcShowMenuByOc (
//
GuiClearScreen (&mDrawContext, mBackgroundImage.Buffer);
BootPickerViewDeinitialize (&mDrawContext, &mGuiContext);
GuiLibDestruct ();
//
// Extension for OpenCore builtin renderer to mark that we no longer control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_UNCONTROLLED);
OcShowMenyByOcLeave ();
*ChosenBootEntry = mGuiContext.BootEntry;
BootContext->PickerContext->HideAuxiliary = mGuiContext.HideAuxiliary;
......
......@@ -71,6 +71,7 @@
MtrrLib
OcAppleKeyMapLib
OcCompressionLib
OcConsoleLib
OcGuardLib
OcMiscLib
OcPngLib
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册