ReactOS 0.4.15-dev-8146-gdc0ed6d
ueficon.c File Reference
#include <uefildr.h>
Include dependency graph for ueficon.c:

Go to the source code of this file.

Macros

#define CHAR_WIDTH   8
 
#define CHAR_HEIGHT   16
 

Functions

VOID UefiConsPutChar (int c)
 
static UCHAR ConvertToBiosExtValue (UCHAR KeyIn)
 
BOOLEAN UefiConsKbHit (VOID)
 
int UefiConsGetCh (VOID)
 

Variables

EFI_SYSTEM_TABLEGlobalSystemTable
 
static unsigned CurrentCursorX = 0
 
static unsigned CurrentCursorY = 0
 
static unsigned CurrentAttr = 0x0f
 
static EFI_INPUT_KEY Key
 
static BOOLEAN ExtendedKey = FALSE
 
static char ExtendedScanCode = 0
 

Macro Definition Documentation

◆ CHAR_HEIGHT

#define CHAR_HEIGHT   16

Definition at line 11 of file ueficon.c.

◆ CHAR_WIDTH

#define CHAR_WIDTH   8

Definition at line 10 of file ueficon.c.

Function Documentation

◆ ConvertToBiosExtValue()

static UCHAR ConvertToBiosExtValue ( UCHAR  KeyIn)
static

Definition at line 68 of file ueficon.c.

69{
70 switch (KeyIn)
71 {
72 case SCAN_UP:
73 return KEY_UP;
74 case SCAN_DOWN:
75 return KEY_DOWN;
76 case SCAN_RIGHT:
77 return KEY_RIGHT;
78 case SCAN_LEFT:
79 return KEY_LEFT;
80 case SCAN_HOME:
81 return KEY_HOME;
82 case SCAN_END:
83 return KEY_END;
84
85 // case SCAN_INSERT:
86 // break;
87
88 case SCAN_DELETE:
89 return KEY_DELETE;
90
91 // case SCAN_PAGE_UP:
92 // case SCAN_PAGE_DOWN:
93 // break;
94
95 case SCAN_F1:
96 return KEY_F1;
97 case SCAN_F2:
98 return KEY_F2;
99 case SCAN_F3:
100 return KEY_F3;
101 case SCAN_F4:
102 return KEY_F4;
103 case SCAN_F5:
104 return KEY_F5;
105 case SCAN_F6:
106 return KEY_F6;
107 case SCAN_F7:
108 return KEY_F7;
109 case SCAN_F8:
110 return KEY_F8;
111 case SCAN_F9:
112 return KEY_F9;
113 case SCAN_F10:
114 return KEY_F10;
115 case SCAN_ESC:
116 return KEY_ESC;
117 }
118 return 0;
119}
#define SCAN_F3
Definition: SimpleTextIn.h:71
#define SCAN_LEFT
Definition: SimpleTextIn.h:62
#define SCAN_HOME
Definition: SimpleTextIn.h:63
#define SCAN_F4
Definition: SimpleTextIn.h:72
#define SCAN_F6
Definition: SimpleTextIn.h:74
#define SCAN_RIGHT
Definition: SimpleTextIn.h:61
#define SCAN_F9
Definition: SimpleTextIn.h:77
#define SCAN_UP
Definition: SimpleTextIn.h:59
#define SCAN_F8
Definition: SimpleTextIn.h:76
#define SCAN_F5
Definition: SimpleTextIn.h:73
#define SCAN_F10
Definition: SimpleTextIn.h:78
#define SCAN_ESC
Definition: SimpleTextIn.h:79
#define SCAN_DELETE
Definition: SimpleTextIn.h:66
#define SCAN_DOWN
Definition: SimpleTextIn.h:60
#define SCAN_F1
Definition: SimpleTextIn.h:69
#define SCAN_END
Definition: SimpleTextIn.h:64
#define SCAN_F2
Definition: SimpleTextIn.h:70
#define SCAN_F7
Definition: SimpleTextIn.h:75
#define KEY_RIGHT
Definition: keycodes.h:48
#define KEY_DELETE
Definition: keycodes.h:41
#define KEY_DOWN
Definition: keycodes.h:46
#define KEY_F1
Definition: keycodes.h:51
#define KEY_F5
Definition: keycodes.h:55
#define KEY_F3
Definition: keycodes.h:53
#define KEY_F9
Definition: keycodes.h:59
#define KEY_F8
Definition: keycodes.h:58
#define KEY_F7
Definition: keycodes.h:57
#define KEY_ESC
Definition: keycodes.h:49
#define KEY_END
Definition: keycodes.h:64
#define KEY_F4
Definition: keycodes.h:54
#define KEY_F6
Definition: keycodes.h:56
#define KEY_F10
Definition: keycodes.h:60
#define KEY_F2
Definition: keycodes.h:52
#define KEY_LEFT
Definition: keycodes.h:47
#define KEY_HOME
Definition: keycodes.h:44
#define KEY_UP
Definition: keycodes.h:45

Referenced by UefiConsGetCh().

◆ UefiConsGetCh()

int UefiConsGetCh ( VOID  )

Definition at line 128 of file ueficon.c.

129{
130 UCHAR KeyOutput = 0;
131
132 /* If an extended key press was detected the last time we were called
133 * then return the scan code of that key. */
134 if (ExtendedKey)
135 {
137 return ExtendedScanCode;
138 }
139
140 if (Key.UnicodeChar != 0)
141 {
142 KeyOutput = Key.UnicodeChar;
143 }
144 else
145 {
148 KeyOutput = KEY_EXTENDED;
149 }
150
151 /* UEFI will stack input requests, we have to clear it */
152 Key.UnicodeChar = 0;
153 Key.ScanCode = 0;
154 return KeyOutput;
155}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define KEY_EXTENDED
Definition: keycodes.h:38
static UCHAR ConvertToBiosExtValue(UCHAR KeyIn)
Definition: ueficon.c:68
static BOOLEAN ExtendedKey
Definition: ueficon.c:20
static char ExtendedScanCode
Definition: ueficon.c:21
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by MachInit().

◆ UefiConsKbHit()

BOOLEAN UefiConsKbHit ( VOID  )

Definition at line 122 of file ueficon.c.

123{
125}
#define EFI_NOT_READY
Definition: UefiBaseType.h:126
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
Definition: UefiSpec.h:1932
EFI_INPUT_READ_KEY ReadKeyStroke
Definition: SimpleTextIn.h:125
EFI_SYSTEM_TABLE * GlobalSystemTable
Definition: uefildr.c:16

Referenced by MachInit().

◆ UefiConsPutChar()

VOID UefiConsPutChar ( int  c)

Definition at line 26 of file ueficon.c.

27{
29 BOOLEAN NeedScroll;
30
32
33 NeedScroll = (CurrentCursorY >= Height);
34 if (NeedScroll)
35 {
38 }
39 if (c == '\r')
40 {
42 }
43 else if (c == '\n')
44 {
46
47 if (!NeedScroll)
49 }
50 else if (c == '\t')
51 {
52 CurrentCursorX = (CurrentCursorX + 8) & ~7;
53 }
54 else
55 {
58 }
59 if (CurrentCursorX >= Width)
60 {
63 }
64}
unsigned char BOOLEAN
const GLubyte * c
Definition: glext.h:8905
#define Unused(x)
Definition: atlwin.h:28
uint32_t ULONG
Definition: typedefs.h:59
static unsigned CurrentAttr
Definition: ueficon.c:18
static unsigned CurrentCursorX
Definition: ueficon.c:16
static unsigned CurrentCursorY
Definition: ueficon.c:17
VOID UefiVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: uefivid.c:154
VOID UefiVideoScrollUp(VOID)
Definition: uefivid.c:191
VOID UefiVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: uefivid.c:142
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

Referenced by MachInit().

Variable Documentation

◆ CurrentAttr

unsigned CurrentAttr = 0x0f
static

Definition at line 18 of file ueficon.c.

Referenced by UefiConsPutChar().

◆ CurrentCursorX

unsigned CurrentCursorX = 0
static

Definition at line 16 of file ueficon.c.

Referenced by UefiConsPutChar().

◆ CurrentCursorY

unsigned CurrentCursorY = 0
static

Definition at line 17 of file ueficon.c.

Referenced by UefiConsPutChar().

◆ ExtendedKey

BOOLEAN ExtendedKey = FALSE
static

Definition at line 20 of file ueficon.c.

Referenced by Pc98ConsGetCh(), PcConsGetCh(), and UefiConsGetCh().

◆ ExtendedScanCode

char ExtendedScanCode = 0
static

Definition at line 21 of file ueficon.c.

Referenced by Pc98ConsGetCh(), PcConsGetCh(), and UefiConsGetCh().

◆ GlobalSystemTable

EFI_SYSTEM_TABLE* GlobalSystemTable
extern

Definition at line 16 of file uefildr.c.

Referenced by UefiConsKbHit().

◆ Key

Definition at line 19 of file ueficon.c.