186 ULONG TextWidth, TextHeight;
192 State->XPos =
Mode->CursorColumn * TextWidth;
193 State->YPos =
Mode->CursorRow * TextHeight;
205 ULONG FgColor, BgColor, Attribute, XPos, YPos, TextHeight, TextWidth;
212 FgColor =
State->FgColor;
213 if (TextConsole->State.FgColor != FgColor)
231 TextConsole->State.FgColor = FgColor;
239 BgColor =
State->BgColor;
240 if (TextConsole->State.BgColor != BgColor)
250 TextConsole->State.FgColor);
259 TextConsole->State.BgColor = BgColor;
269 if ((TextConsole->State.XPos != XPos) ||
270 (TextConsole->State.YPos != YPos))
283 TextConsole->State.XPos = XPos;
284 TextConsole->State.YPos = YPos;
292 Visible =
State->CursorVisible;
293 if (TextConsole->State.CursorVisible != Visible)
309 TextConsole->State.CursorVisible = Visible;
326 ULONG MaxMode, MaxQueriedMode,
Mode,
i, MatchingMode;
337 ModeListSize =
sizeof(*ModeEntry) * ModeInfo.
MaxMode;
351 EfiPrintf(
L"Scanning through %d modes\r\n", MaxMode);
352 for (MaxQueriedMode = 0,
Mode = 0;
Mode < MaxMode;
Mode++)
355 ModeEntry = &ModeList[MaxQueriedMode];
362 EfiPrintf(
L"EFI Firmware Supported Mode %d is H: %d V: %d\r\n",
Mode, HRes, VRes);
363 ModeEntry->
HRes = HRes;
364 ModeEntry->
VRes = VRes;
365 ModeEntry->
HRes2 = HRes;
366 MaxQueriedMode =
Mode + 1;
371 for (
i = 0;
i < MaxIndex;
i++)
374 SupportedModeEntry = &SupportedModes[
i];
375 for (MatchingMode = 0; MatchingMode < MaxQueriedMode; MatchingMode++)
378 ModeEntry = &ModeList[MatchingMode];
379 EfiPrintf(
L"H1: %d V1: %d - H2: %d - V2: %d\r\n", ModeEntry->
HRes, ModeEntry->
VRes, SupportedModeEntry->
HRes, SupportedModeEntry->
VRes);
380 if ((ModeEntry->
HRes == SupportedModeEntry->
HRes) &&
381 (ModeEntry->
VRes == SupportedModeEntry->
VRes))
385 *SupportedMode = MatchingMode;
406 Mode = TextConsole->OldMode.Mode;
407 if (
Mode != TextConsole->Mode)
440 NewMode = CurrentMode;
449 EfiPrintf(
L"In incorrect mode, scanning for right one\r\n");
485 TextConsole->Mode = NewMode.
Mode;
488 TextConsole->OldMode = CurrentMode;
505 ValueToFill = *FillValue;
510 ValueToFill = 0x10020;
517 for (
i =
Console->Buffer; i < Console->EndBuffer;
i++)
565 ULONG i, Column, Row, TextWidth, TextHeight;
574 Column =
Console->State.XPos / TextWidth;
575 Row =
Console->State.YPos / TextHeight;
578 for (
i = 0;
i <
Console->DisplayMode.HRes - Column - 1;
i++)
#define EFI_BACKGROUND_LIGHTGRAY
#define EFI_BACKGROUND_BLUE
#define EFI_BACKGROUND_BROWN
#define EFI_BACKGROUND_RED
#define EFI_BACKGROUND_BLACK
#define EFI_BACKGROUND_CYAN
#define EFI_BACKGROUND_MAGENTA
#define EFI_BACKGROUND_GREEN
NTSTATUS EfiGetNtStatusCode(_In_ EFI_STATUS EfiStatus)
NTSTATUS EfiConOutQueryMode(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface, _In_ ULONG Mode, _In_ UINTN *Columns, _In_ UINTN *Rows)
VOID BlDisplayGetTextCellResolution(_Out_ PULONG TextWidth, _Out_ PULONG TextHeight)
VOID EfiPrintf(_In_ PWCHAR Format,...)
PVOID BlMmAllocateHeap(_In_ SIZE_T Size)
NTSTATUS EfiConOutSetMode(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface, _In_ ULONG Mode)
VOID EfiConOutReadCurrentMode(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface, _Out_ EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode)
BL_DISPLAY_MODE ConsoleTextResolutionList[]
VOID BlpArchSwitchContext(_In_ BL_ARCH_MODE NewMode)
BOOLEAN ConsolepFindResolution(_In_ PBL_DISPLAY_MODE Mode, _In_ PBL_DISPLAY_MODE List, _In_ ULONG MaxIndex)
PBL_ARCH_CONTEXT CurrentExecutionContext
NTSTATUS EfiConOutSetCursorPosition(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface, _In_ ULONG Column, _In_ ULONG Row)
NTSTATUS EfiConOutSetAttribute(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface, _In_ ULONG Attribute)
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL * EfiConInEx
NTSTATUS EfiConOutOutputString(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface, _In_ PWCHAR String)
NTSTATUS EfiConOutEnableCursor(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface, _In_ BOOLEAN Visible)
NTSTATUS BlMmFreeHeap(_In_ PVOID Buffer)
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * EfiConOut
NTSTATUS EfiConInExReset(VOID)
NTSTATUS EfiConInReset(VOID)
enum _BL_ARCH_MODE BL_ARCH_MODE
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
BL_COLOR ConsoleEfiTextGetColorBackground(_In_ UINT32 Attributes)
VOID ConsoleEfiTextGetStateFromMode(_In_ EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode, _Out_ PBL_DISPLAY_STATE State)
NTSTATUS ConsoleInputBaseEraseBuffer(_In_ PBL_INPUT_CONSOLE Console, _In_opt_ PULONG FillValue)
NTSTATUS ConsoleEfiTextFindModeFromAllowed(_In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextProtocol, _In_ PBL_DISPLAY_MODE SupportedModes, _In_ ULONG MaxIndex, _Out_ PULONG SupportedMode)
NTSTATUS ConsoleFirmwareTextOpen(_In_ PBL_TEXT_CONSOLE TextConsole)
BL_COLOR ConsoleEfiTextGetColorForeground(_In_ UINT32 Attributes)
VOID ConsoleFirmwareTextClose(_In_ PBL_TEXT_CONSOLE TextConsole)
NTSTATUS ConsoleInputLocalEraseBuffer(_In_ PBL_INPUT_CONSOLE Console, _In_opt_ PULONG FillValue)
NTSTATUS ConsoleFirmwareTextSetState(_In_ PBL_TEXT_CONSOLE TextConsole, _In_ UCHAR Mask, _In_ PBL_DISPLAY_STATE State)
ULONG ConsoleEfiTextGetAttribute(BL_COLOR BgColor, BL_COLOR FgColor)
ULONG ConsoleEfiTextGetEfiColorForeground(_In_ BL_COLOR Color)
ULONG ConsoleEfiTextGetEfiColorBackground(_In_ BL_COLOR Color)
NTSTATUS ConsoleFirmwareTextClear(_In_ PBL_TEXT_CONSOLE Console, _In_ BOOLEAN LineOnly)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define STATUS_INTEGER_OVERFLOW
static VIDEODISPLAYMODE DisplayMode
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes