From 973b1bf7ee3cf6cc136f3271581edfa1a1f31c77 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Tue, 4 Dec 2012 00:48:44 -0500 Subject: [PATCH] Modified "resolution" refind.conf token so it affects text mode as well as graphics mode. --- NEWS.txt | 5 +++++ refind/main.c | 2 +- refind/screen.c | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 71e0a39..60a94c1 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,11 @@ 0.5.0 (??/??/2012): ------------------- +- Modified the "resolution" token so that it affects text mode as well + as graphics mode. On my systems, though, the actual text area is still + restricted to an 80x25 area. (This seems to be a firmware limitation; my + EFI shells are also so limited.) + - Fixed a bug that caused the options line editor to blank out lines that were not actually edited. diff --git a/refind/main.c b/refind/main.c index 5439188..ebb9fdd 100644 --- a/refind/main.c +++ b/refind/main.c @@ -118,7 +118,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.7.8"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.7.9"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); diff --git a/refind/screen.c b/refind/screen.c index ae90f20..9f0d483 100644 --- a/refind/screen.c +++ b/refind/screen.c @@ -107,6 +107,12 @@ VOID InitScreen(VOID) VOID SetupScreen(VOID) { + if ((GlobalConfig.RequestedScreenWidth > 0) && (GlobalConfig.RequestedScreenHeight > 0) && + egSetScreenSize(GlobalConfig.RequestedScreenWidth, GlobalConfig.RequestedScreenHeight)) { + UGAWidth = GlobalConfig.RequestedScreenWidth; + UGAHeight = GlobalConfig.RequestedScreenHeight; + } // if user requested a particular screen resolution + if (GlobalConfig.TextOnly) { // switch to text mode if requested AllowGraphicsMode = FALSE; @@ -115,11 +121,6 @@ VOID SetupScreen(VOID) } else if (AllowGraphicsMode) { // clear screen and show banner // (now we know we'll stay in graphics mode) - if ((GlobalConfig.RequestedScreenWidth > 0) && (GlobalConfig.RequestedScreenHeight > 0) && - egSetScreenSize(GlobalConfig.RequestedScreenWidth, GlobalConfig.RequestedScreenHeight)) { - UGAWidth = GlobalConfig.RequestedScreenWidth; - UGAHeight = GlobalConfig.RequestedScreenHeight; - } // if user requested a particular screen resolution SwitchToGraphics(); BltClearScreen(TRUE); } @@ -129,6 +130,12 @@ VOID SwitchToText(IN BOOLEAN CursorEnabled) { egSetGraphicsModeEnabled(FALSE); refit_call2_wrapper(ST->ConOut->EnableCursor, ST->ConOut, CursorEnabled); + // get size of text console + if (refit_call4_wrapper(ST->ConOut->QueryMode, ST->ConOut, ST->ConOut->Mode->Mode, &ConWidth, &ConHeight) != EFI_SUCCESS) { + // use default values on error + ConWidth = 80; + ConHeight = 25; + } } VOID SwitchToGraphics(VOID) -- 2.39.2