ReactOS  0.4.14-dev-1314-gacf135d
fw.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Boot Loader
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: boot/armllb/fw.c
5  * PURPOSE: LLB Firmware Routines (accessible by OS Loader)
6  * PROGRAMMERS: ReactOS Portable Systems Group
7  */
8 
9 #include "precomp.h"
10 
12 {
13  {0x00, 0x00, 0x00},
14  {0x00, 0x00, 0xAA},
15  {0x00, 0xAA, 0x00},
16  {0x00, 0xAA, 0xAA},
17  {0xAA, 0x00, 0x00},
18  {0xAA, 0x00, 0xAA},
19  {0xAA, 0x55, 0x00},
20  {0xAA, 0xAA, 0xAA},
21  {0x55, 0x55, 0x55},
22  {0x55, 0x55, 0xFF},
23  {0x55, 0xFF, 0x55},
24  {0x55, 0xFF, 0xFF},
25  {0xFF, 0x55, 0x55},
26  {0xFF, 0x55, 0xFF},
27  {0xFF, 0xFF, 0x55},
28  {0xFF, 0xFF, 0xFF},
29 };
30 
31 VOID
33 {
34  /* Just call directly the video function */
36 
37  /* DEBUG ONLY */
39 }
40 
41 BOOLEAN
43 {
44  /* Check RX buffer */
45  return LlbHwKbdReady();
46 }
47 
48 INT
50 {
51  /* Return the key pressed */
52 #ifdef _ZOOM2_
53  return LlbKeypadGetChar();
54 #else
55  return LlbKeyboardGetChar();
56 #endif
57 }
58 
59 ULONG
61  IN BOOLEAN Init)
62 {
63  /* Return text mode */
64  return 0;
65 }
66 
67 VOID
69  OUT PULONG Height,
71 {
72  /* Query static settings */
73  *Width = LlbHwGetScreenWidth() / 8;
74  *Height = LlbHwGetScreenHeight() / 16;
75 
76  /* Depth is always 16 bpp */
77  *Depth = 16;
78 }
79 
80 VOID
82 {
83  /* Clear the screen */
85 }
86 
87 VOID
89  IN UCHAR Attr,
90  IN ULONG X,
91  IN ULONG Y)
92 {
93  ULONG Color, BackColor;
95 
96  /* Convert EGA index to color used by hardware */
97  Color = LlbHwVideoCreateColor(ColorPalette[Attr & 0xF][0],
98  ColorPalette[Attr & 0xF][1],
99  ColorPalette[Attr & 0xF][2]);
100  BackColor = LlbHwVideoCreateColor(ColorPalette[Attr >> 4][0],
101  ColorPalette[Attr >> 4][1],
102  ColorPalette[Attr >> 4][2]);
103 
104  /* Compute buffer address */
105  Buffer = (PUSHORT)LlbHwGetFrameBuffer() + (LlbHwGetScreenWidth() * (Y * 16)) + (X * 8);
106 
107  /* Draw it */
108  LlbVideoDrawChar(c, Buffer, Color, BackColor);
109 }
110 
111 
112 TIMEINFO*
114 {
115  /* Call existing function */
116  return LlbGetTime();
117 }
118 
119 /* EOF */
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:39
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:656
#define TRUE
Definition: types.h:120
ULONG NTAPI LlbHwGetScreenWidth(VOID)
Definition: hwinfo.c:62
#define Y(I)
VOID LlbFwVideoPutChar(IN INT c, IN UCHAR Attr, IN ULONG X, IN ULONG Y)
Definition: fw.c:88
CHAR NTAPI LlbKeyboardGetChar(VOID)
Definition: keyboard.c:225
VOID NTAPI LlbVideoDrawChar(IN UCHAR c, IN PUSHORT Buffer, IN USHORT Color, IN USHORT BackColor)
Definition: video.c:277
#define Ch(x, y, z)
Definition: sha2.c:141
int32_t INT
Definition: typedefs.h:57
VOID NTAPI LlbSerialPutChar(IN CHAR c)
Definition: serial.c:13
BOOLEAN NTAPI LlbHwKbdReady(VOID)
Definition: hwinfo.c:48
struct Color Color
Definition: fw.h:9
INT LlbFwGetCh(VOID)
Definition: fw.c:49
CHAR NTAPI LlbKeypadGetChar(VOID)
Definition: matrix.c:29
ULONG LlbFwVideoSetDisplayMode(IN PCHAR DisplayModeName, IN BOOLEAN Init)
Definition: fw.c:60
PVOID NTAPI LlbHwGetFrameBuffer(VOID)
Definition: hwinfo.c:76
unsigned char BOOLEAN
Definition: bufpool.h:45
TIMEINFO *NTAPI LlbGetTime(VOID)
Definition: time.c:84
VOID NTAPI LlbVideoPutChar(IN UCHAR c)
Definition: video.c:349
const GLubyte * c
Definition: glext.h:8905
ULONG NTAPI LlbHwGetScreenHeight(VOID)
Definition: hwinfo.c:69
VOID LlbFwVideoClearScreen(IN UCHAR Attr)
Definition: fw.c:81
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID LlbFwVideoGetDisplaySize(OUT PULONG Width, OUT PULONG Height, OUT PULONG Depth)
Definition: fw.c:68
TIMEINFO * LlbFwGetTime(VOID)
Definition: fw.c:113
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
VOID NTAPI LlbVideoClearScreen(IN BOOLEAN OsLoader)
Definition: video.c:310
#define OUT
Definition: typedefs.h:40
VOID LlbFwPutChar(INT Ch)
Definition: fw.c:32
unsigned int ULONG
Definition: retypes.h:1
ULONG NTAPI LlbHwVideoCreateColor(IN ULONG Red, IN ULONG Green, IN ULONG Blue)
Definition: hwinfo.c:83
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
BOOLEAN LlbFwKbHit(VOID)
Definition: fw.c:42
unsigned short * PUSHORT
Definition: retypes.h:2