mirror of https://github.com/acidanthera/audk.git
MdeModulePkg Terminal: Add text mode for PcdConOutColumn/Row
Add a new text mode with a resolution of PcdConOutColumn x PcdConOutRow. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11416 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b1aab293ea
commit
9875a3e33e
|
@ -724,7 +724,7 @@ TerminalDriverBindingStart (
|
|||
);
|
||||
SimpleTextOutput->Mode = &TerminalDevice->SimpleTextOutputMode;
|
||||
|
||||
TerminalDevice->SimpleTextOutputMode.MaxMode = 3;
|
||||
TerminalDevice->SimpleTextOutputMode.MaxMode = TERMINAL_MAX_MODE;
|
||||
//
|
||||
// For terminal devices, cursor is always visible
|
||||
//
|
||||
|
|
|
@ -143,6 +143,12 @@ typedef union {
|
|||
#define MODE2_COLUMN_COUNT 100
|
||||
#define MODE2_ROW_COUNT 31
|
||||
|
||||
//
|
||||
// MODE3 is defined by PcdConOutColumn & PcdConOutRow
|
||||
//
|
||||
|
||||
#define TERMINAL_MAX_MODE 4
|
||||
|
||||
#define BACKSPACE 8
|
||||
#define ESC 27
|
||||
#define CSI 0x9B
|
||||
|
|
|
@ -205,7 +205,7 @@ TerminalConOutOutputString (
|
|||
//
|
||||
Mode = This->Mode;
|
||||
|
||||
if (Mode->Mode > 2) {
|
||||
if (Mode->Mode >= TERMINAL_MAX_MODE) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ TerminalConOutQueryMode (
|
|||
OUT UINTN *Rows
|
||||
)
|
||||
{
|
||||
if (This->Mode->MaxMode > 3) {
|
||||
if (This->Mode->MaxMode > TERMINAL_MAX_MODE) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -430,6 +430,16 @@ TerminalConOutQueryMode (
|
|||
*Columns = MODE2_COLUMN_COUNT;
|
||||
*Rows = MODE2_ROW_COUNT;
|
||||
return EFI_SUCCESS;
|
||||
} else if (ModeNumber == 3) {
|
||||
*Columns = (UINTN) PcdGet32 (PcdConOutColumn);
|
||||
if (*Columns == 0) {
|
||||
*Columns = MODE0_COLUMN_COUNT;
|
||||
}
|
||||
*Rows = (UINTN) PcdGet32 (PcdConOutRow);
|
||||
if (*Rows == 0) {
|
||||
*Rows = MODE0_ROW_COUNT;
|
||||
}
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
|
@ -466,7 +476,7 @@ TerminalConOutSetMode (
|
|||
//
|
||||
TerminalDevice = TERMINAL_CON_OUT_DEV_FROM_THIS (This);
|
||||
|
||||
if (ModeNumber > 2) {
|
||||
if (ModeNumber >= TERMINAL_MAX_MODE) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
DevicePathLib
|
||||
|
@ -74,6 +75,8 @@
|
|||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
|
||||
|
||||
# [Event]
|
||||
# ##
|
||||
|
@ -82,3 +85,4 @@
|
|||
# EVENT_TYPE_RELATIVE_TIMER ## PRODUCES
|
||||
#
|
||||
#
|
||||
|
||||
|
|
Loading…
Reference in New Issue