From c5d1646e66976fff2184375187bb96db366afcbc Mon Sep 17 00:00:00 2001 From: srs5694 Date: Thu, 27 Dec 2012 16:15:32 -0500 Subject: [PATCH] Added "1024" as code to not change the mode to the "textmode" token. --- NEWS.txt | 6 ++++++ docs/refind/configfile.html | 2 +- libeg/screen.c | 6 +++--- refind.conf-sample | 12 +++++++----- refind/main.c | 4 ++-- refind/screen.c | 2 +- refind/screen.h | 2 ++ 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 441cb1e..50ee4fb 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,9 @@ +0.6.2 (??/??/201?): +------------------- + +- Altered default for "textmode" option to not adjust the text mode + at all. (Prior versions set it to mode 0 by default.) + 0.6.1 (12/21/2012): ------------------- diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index ff1f183..89fcf3b 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -185,7 +185,7 @@ timeout 20 textmode text mode number - Sets the text-mode video resolution to be used in conjunction with textonly or for the line editor and program-launch screens. This option takes a single-digit code. Mode 0 is guaranteed to be present and should be 80x25. Mode 1 is supposed to be either invalid or 80x50, but some systems use this number for something else. Higher values are system-specific. If you set this option to an invalid value, rEFInd pauses during startup to tell you of that fact. Note that setting textmode can sometimes force your graphics-mode resolution to a higher value than you specify in resolution. + Sets the text-mode video resolution to be used in conjunction with textonly or for the line editor and program-launch screens. This option takes a single-digit code. Mode 0 is guaranteed to be present and should be 80x25. Mode 1 is supposed to be either invalid or 80x50, but some systems use this number for something else. Higher values are system-specific. Mode 1024 is a rEFInd-specific code that means to not set any mode at all; rEFInd instead uses whatever mode was set when it launched. If you set this option to an invalid value, rEFInd pauses during startup to tell you of that fact. Note that setting textmode can sometimes force your graphics-mode resolution to a higher value than you specify in resolution. resolution diff --git a/libeg/screen.c b/libeg/screen.c index 04d1283..24b7652 100644 --- a/libeg/screen.c +++ b/libeg/screen.c @@ -200,7 +200,7 @@ BOOLEAN egSetScreenSize(IN OUT UINTN *ScreenWidth, IN OUT UINTN *ScreenHeight) { } while (++ModeNum < GraphicsOutput->Mode->MaxMode); PauseForKey(); SwitchToGraphics(); - } // if() + } // if GOP mode (UEFI) } else if (UgaDraw != NULL) { // UGA mode (EFI 1.x) // Try to use current color depth & refresh rate for new mode. Maybe not the best choice @@ -217,7 +217,7 @@ BOOLEAN egSetScreenSize(IN OUT UINTN *ScreenWidth, IN OUT UINTN *ScreenHeight) { // This is just a placeholder until something better can be done.... Print(L"Error setting graphics mode %d x %d; unsupported mode!\n"); } // if/else - } // if/else if + } // if/else if UGA mode (EFI 1.x) return (ModeSet); } // BOOLEAN egSetScreenSize() @@ -230,7 +230,7 @@ BOOLEAN egSetTextMode(UINT32 RequestedMode) { EFI_STATUS Status; BOOLEAN ChangedIt = FALSE; - if (RequestedMode != ST->ConOut->Mode->Mode) { + if ((RequestedMode != ST->ConOut->Mode->Mode) && (RequestedMode != DONT_CHANGE_TEXT_MODE)) { // SwitchToGraphics(); Status = refit_call2_wrapper(ST->ConOut->SetMode, ST->ConOut, RequestedMode); if (Status == EFI_SUCCESS) { diff --git a/refind.conf-sample b/refind.conf-sample index 7d77fde..0f580be 100644 --- a/refind.conf-sample +++ b/refind.conf-sample @@ -62,14 +62,16 @@ timeout 20 #textonly # Set the EFI text mode to be used for textual displays. This option -# takes a single digit that refers to a mode number. The default is 0 -# (80x25), 1 is sometimes 80x50, and higher numbers are system-specific -# modes. If you specify an invalid mode, rEFInd pauses during boot to -# inform you of valid modes. +# takes a single digit that refers to a mode number. Mode 0 is normally +# 80x25, 1 is sometimes 80x50, and higher numbers are system-specific +# modes. Mode 1024 is a special code that tells rEFInd to not set the +# text mode; it uses whatever was in use when the program was launched. +# If you specify an invalid mode, rEFInd pauses during boot to inform +# you of valid modes. # CAUTION: On VirtualBox, and perhaps on some real computers, specifying # a text mode and uncommenting the "textonly" option while NOT specifying # a resolution can result in an unusable display in the booted OS. -# Default is 0 +# Default is 1024 (no change) # #textmode 2 diff --git a/refind/main.c b/refind/main.c index f134101..c7564c6 100644 --- a/refind/main.c +++ b/refind/main.c @@ -105,7 +105,7 @@ static REFIT_MENU_SCREEN MainMenu = { L"Main Menu", NULL, 0, NULL, 0, NULL L"Insert or F2 for more options; Esc to refresh" }; static REFIT_MENU_SCREEN AboutMenu = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL, L"Press Enter to return to main menu", L"" }; -REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, 0, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, +REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, {TAG_SHELL, TAG_APPLE_RECOVERY, TAG_MOK_TOOL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, 0, 0, 0, 0, 0 }}; @@ -127,7 +127,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.1"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.1.1"); 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 7f279db..14a43ed 100644 --- a/refind/screen.c +++ b/refind/screen.c @@ -154,7 +154,7 @@ VOID SetupScreen(VOID) } if (GlobalConfig.RequestedScreenWidth > 0) { - egSetScreenSize(&GlobalConfig.RequestedScreenWidth, &GlobalConfig.RequestedScreenHeight); + egSetScreenSize(&(GlobalConfig.RequestedScreenWidth), &(GlobalConfig.RequestedScreenHeight)); egGetScreenSize(&UGAWidth, &UGAHeight); } // if user requested a particular screen resolution diff --git a/refind/screen.h b/refind/screen.h index b03f6e1..3fc089f 100644 --- a/refind/screen.h +++ b/refind/screen.h @@ -50,6 +50,8 @@ // screen module // +#define DONT_CHANGE_TEXT_MODE 1024 /* textmode # that's a code to not change the text mode */ + #define ATTR_BASIC (EFI_LIGHTGRAY | EFI_BACKGROUND_BLACK) #define ATTR_ERROR (EFI_YELLOW | EFI_BACKGROUND_BLACK) #define ATTR_BANNER (EFI_WHITE | EFI_BACKGROUND_BLUE) -- 2.39.2