diff --git a/sdk/xtdk/bltypes.h b/sdk/xtdk/bltypes.h index bb8267f..e60d398 100644 --- a/sdk/xtdk/bltypes.h +++ b/sdk/xtdk/bltypes.h @@ -37,6 +37,7 @@ typedef VOID (*PBL_CONSOLE_DISABLE_CURSOR)(); typedef VOID (*PBL_CONSOLE_ENABLE_CURSOR)(); typedef VOID (*PBL_CONSOLE_PRINT)(IN PUINT16 Format, IN ...); typedef VOID (*PBL_CONSOLE_QUERY_MODE)(OUT PUINT_PTR ResX, OUT PUINT_PTR ResY); +typedef VOID (*PBL_CONSOLE_SET_ATTRIBUTES)(IN ULONGLONG Attributes); typedef VOID (*PBL_CONSOLE_SET_CURSOR_POSITION)(IN ULONGLONG PosX, IN ULONGLONG PosY); typedef VOID (*PBL_CONSOLE_WRITE)(IN PUSHORT String); typedef VOID (*PBL_DEBUG_PRINT)(IN PUINT16 Format, IN ...); @@ -82,6 +83,7 @@ typedef struct _XTBL_LOADER_PROTOCOL PBL_CONSOLE_ENABLE_CURSOR EnableCursor; PBL_CONSOLE_PRINT Print; PBL_CONSOLE_QUERY_MODE QueryMode; + PBL_CONSOLE_SET_ATTRIBUTES SetAttributes; PBL_CONSOLE_SET_CURSOR_POSITION SetCursorPosition; PBL_CONSOLE_WRITE Write; } Console; diff --git a/xtldr2/console.c b/xtldr2/console.c index 66b5ded..5273f5f 100644 --- a/xtldr2/console.c +++ b/xtldr2/console.c @@ -114,6 +114,40 @@ BlConsoleQueryMode(OUT PUINT_PTR ResX, EfiSystemTable->ConOut->QueryMode(EfiSystemTable->ConOut, EfiSystemTable->ConOut->Mode->Mode, ResX, ResY); } +/** + * Displays the string on the device at the current cursor location. + * + * @param String + * The string to be displayed. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTCDECL +VOID +BlConsoleWrite(IN PUSHORT String) +{ + EfiSystemTable->ConOut->OutputString(EfiSystemTable->ConOut, String); +} + +/** + * Sets the foreground and background colors. + * + * @param Attribute + * Specifies the foreground and background colors (bits 0..3 are fg, and bits 4..6 are bg color). + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTCDECL +VOID +BlSetConsoleAttributes(IN ULONGLONG Attributes) +{ + EfiSystemTable->ConOut->SetAttribute(EfiSystemTable->ConOut, Attributes); +} + /** * Sets new coordinates of the console cursor position. * @@ -135,23 +169,6 @@ BlSetCursorPosition(IN ULONGLONG PosX, EfiSystemTable->ConOut->SetCursorPosition(EfiSystemTable->ConOut, PosX, PosY); } -/** - * Displays the string on the device at the current cursor location. - * - * @param String - * The string to be displayed. - * - * @return This routine does not return any value. - * - * @since XT 1.0 - */ -XTCDECL -VOID -BlConsoleWrite(IN PUSHORT String) -{ - EfiSystemTable->ConOut->OutputString(EfiSystemTable->ConOut, String); -} - /** * Writes a character to the default EFI console. * diff --git a/xtldr2/includes/bootman.h b/xtldr2/includes/bootman.h index ffdf282..9a16e58 100644 --- a/xtldr2/includes/bootman.h +++ b/xtldr2/includes/bootman.h @@ -118,6 +118,10 @@ EFI_STATUS BlSetConfigValue(IN CONST PWCHAR ConfigName, IN CONST PWCHAR ConfigValue); +XTCDECL +VOID +BlSetConsoleAttributes(IN ULONGLONG Attributes); + XTCDECL VOID BlSetCursorPosition(IN ULONGLONG PosX, diff --git a/xtldr2/protocol.c b/xtldr2/protocol.c index 7dfb459..941e6dc 100644 --- a/xtldr2/protocol.c +++ b/xtldr2/protocol.c @@ -95,6 +95,7 @@ BlpRegisterXtLoaderProtocol() LdrProtocol.Console.EnableCursor = BlConsoleEnableCursor; LdrProtocol.Console.Print = BlConsolePrint; LdrProtocol.Console.QueryMode = BlConsoleQueryMode; + LdrProtocol.Console.SetAttributes = BlSetConsoleAttributes; LdrProtocol.Console.SetCursorPosition = BlSetCursorPosition; LdrProtocol.Console.Write = BlConsoleWrite; LdrProtocol.Debug.Print = BlDebugPrint;