[FREELDR] Abstract VGA BIOS specific code (#1736)
[reactos.git] / boot / freeldr / freeldr / arch / i386 / xboxcons.c
1 /*
2 * FreeLoader
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #include <freeldr.h>
20
21 static unsigned CurrentCursorX = 0;
22 static unsigned CurrentCursorY = 0;
23 static unsigned CurrentAttr = 0x0f;
24
25 VOID
26 XboxConsPutChar(int c)
27 {
28 ULONG Width;
29 ULONG Height;
30 ULONG Depth;
31
32 if ('\r' == c)
33 {
34 CurrentCursorX = 0;
35 }
36 else if ('\n' == c)
37 {
38 CurrentCursorX = 0;
39 CurrentCursorY++;
40 }
41 else if ('\t' == c)
42 {
43 CurrentCursorX = (CurrentCursorX + 8) & ~ 7;
44 }
45 else
46 {
47 XboxVideoPutChar(c, CurrentAttr, CurrentCursorX, CurrentCursorY);
48 CurrentCursorX++;
49 }
50 XboxVideoGetDisplaySize(&Width, &Height, &Depth);
51 if (Width <= CurrentCursorX)
52 {
53 CurrentCursorX = 0;
54 CurrentCursorY++;
55 }
56 }
57
58 BOOLEAN
59 XboxConsKbHit(VOID)
60 {
61 /* No keyboard support yet */
62 return FALSE;
63 }
64
65 int
66 XboxConsGetCh(void)
67 {
68 /* No keyboard support yet */
69 while (1)
70 {
71 ;
72 }
73
74 return 0;
75 }
76
77 /* EOF */