- Fix bugs.
[reactos.git] / reactos / boot / armllb / hw / video.c
1 /*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/armllb/hw/video.c
5 * PURPOSE: LLB Video Output Routines
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 #include "precomp.h"
10
11 CHAR LlbHwBootFont[] =
12 {
13 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
14 0x7e,0x81,0xa5,0x81,0xbd,0x99,0x81,0x7e,
15 0x7e,0xff,0xdb,0xff,0xc3,0xe7,0xff,0x7e,
16 0x6c,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,
17 0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,
18 0x38,0x7c,0x38,0xfe,0xfe,0x7c,0x38,0x7c,
19 0x10,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x7c,
20 0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,
21 0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,
22 0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,
23 0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,
24 0x0f,0x07,0x0f,0x7d,0xcc,0xcc,0xcc,0x78,
25 0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,
26 0x3f,0x33,0x3f,0x30,0x30,0x70,0xf0,0xe0,
27 0x7f,0x63,0x7f,0x63,0x63,0x67,0xe6,0xc0,
28 0x99,0x5a,0x3c,0xe7,0xe7,0x3c,0x5a,0x99,
29 0x80,0xe0,0xf8,0xfe,0xf8,0xe0,0x80,0x00,
30 0x02,0x0e,0x3e,0xfe,0x3e,0x0e,0x02,0x00,
31 0x18,0x3c,0x7e,0x18,0x18,0x7e,0x3c,0x18,
32 0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x00,
33 0x7f,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x00,
34 0x3e,0x63,0x38,0x6c,0x6c,0x38,0xcc,0x78,
35 0x00,0x00,0x00,0x00,0x7e,0x7e,0x7e,0x00,
36 0x18,0x3c,0x7e,0x18,0x7e,0x3c,0x18,0xff,
37 0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x00,
38 0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,
39 0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,
40 0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,
41 0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,
42 0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00,
43 0x00,0x18,0x3c,0x7e,0xff,0xff,0x00,0x00,
44 0x00,0xff,0xff,0x7e,0x3c,0x18,0x00,0x00,
45 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
46 0x30,0x78,0x78,0x30,0x30,0x00,0x30,0x00,
47 0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,
48 0x6c,0x6c,0xfe,0x6c,0xfe,0x6c,0x6c,0x00,
49 0x30,0x7c,0xc0,0x78,0x0c,0xf8,0x30,0x00,
50 0x00,0xc6,0xcc,0x18,0x30,0x66,0xc6,0x00,
51 0x38,0x6c,0x38,0x76,0xdc,0xcc,0x76,0x00,
52 0x60,0x60,0xc0,0x00,0x00,0x00,0x00,0x00,
53 0x18,0x30,0x60,0x60,0x60,0x30,0x18,0x00,
54 0x60,0x30,0x18,0x18,0x18,0x30,0x60,0x00,
55 0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,
56 0x00,0x30,0x30,0xfc,0x30,0x30,0x00,0x00,
57 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,
58 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
59 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,
60 0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,
61 0x7c,0xc6,0xce,0xde,0xf6,0xe6,0x7c,0x00,
62 0x30,0x70,0x30,0x30,0x30,0x30,0xfc,0x00,
63 0x78,0xcc,0x0c,0x38,0x60,0xcc,0xfc,0x00,
64 0x78,0xcc,0x0c,0x38,0x0c,0xcc,0x78,0x00,
65 0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x1e,0x00,
66 0xfc,0xc0,0xf8,0x0c,0x0c,0xcc,0x78,0x00,
67 0x38,0x60,0xc0,0xf8,0xcc,0xcc,0x78,0x00,
68 0xfc,0xcc,0x0c,0x18,0x30,0x30,0x30,0x00,
69 0x78,0xcc,0xcc,0x78,0xcc,0xcc,0x78,0x00,
70 0x78,0xcc,0xcc,0x7c,0x0c,0x18,0x70,0x00,
71 0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,
72 0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x60,
73 0x18,0x30,0x60,0xc0,0x60,0x30,0x18,0x00,
74 0x00,0x00,0xfc,0x00,0x00,0xfc,0x00,0x00,
75 0x60,0x30,0x18,0x0c,0x18,0x30,0x60,0x00,
76 0x78,0xcc,0x0c,0x18,0x30,0x00,0x30,0x00,
77 0x7c,0xc6,0xde,0xde,0xde,0xc0,0x78,0x00,
78 0x30,0x78,0xcc,0xcc,0xfc,0xcc,0xcc,0x00,
79 0xfc,0x66,0x66,0x7c,0x66,0x66,0xfc,0x00,
80 0x3c,0x66,0xc0,0xc0,0xc0,0x66,0x3c,0x00,
81 0xf8,0x6c,0x66,0x66,0x66,0x6c,0xf8,0x00,
82 0xfe,0x62,0x68,0x78,0x68,0x62,0xfe,0x00,
83 0xfe,0x62,0x68,0x78,0x68,0x60,0xf0,0x00,
84 0x3c,0x66,0xc0,0xc0,0xce,0x66,0x3e,0x00,
85 0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0x00,
86 0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00,
87 0x1e,0x0c,0x0c,0x0c,0xcc,0xcc,0x78,0x00,
88 0xe6,0x66,0x6c,0x78,0x6c,0x66,0xe6,0x00,
89 0xf0,0x60,0x60,0x60,0x62,0x66,0xfe,0x00,
90 0xc6,0xee,0xfe,0xfe,0xd6,0xc6,0xc6,0x00,
91 0xc6,0xe6,0xf6,0xde,0xce,0xc6,0xc6,0x00,
92 0x38,0x6c,0xc6,0xc6,0xc6,0x6c,0x38,0x00,
93 0xfc,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00,
94 0x78,0xcc,0xcc,0xcc,0xdc,0x78,0x1c,0x00,
95 0xfc,0x66,0x66,0x7c,0x6c,0x66,0xe6,0x00,
96 0x78,0xcc,0xe0,0x70,0x1c,0xcc,0x78,0x00,
97 0xfc,0xb4,0x30,0x30,0x30,0x30,0x78,0x00,
98 0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xfc,0x00,
99 0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x00,
100 0xc6,0xc6,0xc6,0xd6,0xfe,0xee,0xc6,0x00,
101 0xc6,0xc6,0x6c,0x38,0x38,0x6c,0xc6,0x00,
102 0xcc,0xcc,0xcc,0x78,0x30,0x30,0x78,0x00,
103 0xfe,0xc6,0x8c,0x18,0x32,0x66,0xfe,0x00,
104 0x78,0x60,0x60,0x60,0x60,0x60,0x78,0x00,
105 0xc0,0x60,0x30,0x18,0x0c,0x06,0x02,0x00,
106 0x78,0x18,0x18,0x18,0x18,0x18,0x78,0x00,
107 0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,
108 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
109 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,
110 0x00,0x00,0x78,0x0c,0x7c,0xcc,0x76,0x00,
111 0xe0,0x60,0x60,0x7c,0x66,0x66,0xdc,0x00,
112 0x00,0x00,0x78,0xcc,0xc0,0xcc,0x78,0x00,
113 0x1c,0x0c,0x0c,0x7c,0xcc,0xcc,0x76,0x00,
114 0x00,0x00,0x78,0xcc,0xfc,0xc0,0x78,0x00,
115 0x38,0x6c,0x60,0xf0,0x60,0x60,0xf0,0x00,
116 0x00,0x00,0x76,0xcc,0xcc,0x7c,0x0c,0xf8,
117 0xe0,0x60,0x6c,0x76,0x66,0x66,0xe6,0x00,
118 0x30,0x00,0x70,0x30,0x30,0x30,0x78,0x00,
119 0x0c,0x00,0x0c,0x0c,0x0c,0xcc,0xcc,0x78,
120 0xe0,0x60,0x66,0x6c,0x78,0x6c,0xe6,0x00,
121 0x70,0x30,0x30,0x30,0x30,0x30,0x78,0x00,
122 0x00,0x00,0xcc,0xfe,0xfe,0xd6,0xc6,0x00,
123 0x00,0x00,0xf8,0xcc,0xcc,0xcc,0xcc,0x00,
124 0x00,0x00,0x78,0xcc,0xcc,0xcc,0x78,0x00,
125 0x00,0x00,0xdc,0x66,0x66,0x7c,0x60,0xf0,
126 0x00,0x00,0x76,0xcc,0xcc,0x7c,0x0c,0x1e,
127 0x00,0x00,0xdc,0x76,0x66,0x60,0xf0,0x00,
128 0x00,0x00,0x7c,0xc0,0x78,0x0c,0xf8,0x00,
129 0x10,0x30,0x7c,0x30,0x30,0x34,0x18,0x00,
130 0x00,0x00,0xcc,0xcc,0xcc,0xcc,0x76,0x00,
131 0x00,0x00,0xcc,0xcc,0xcc,0x78,0x30,0x00,
132 0x00,0x00,0xc6,0xd6,0xfe,0xfe,0x6c,0x00,
133 0x00,0x00,0xc6,0x6c,0x38,0x6c,0xc6,0x00,
134 0x00,0x00,0xcc,0xcc,0xcc,0x7c,0x0c,0xf8,
135 0x00,0x00,0xfc,0x98,0x30,0x64,0xfc,0x00,
136 0x1c,0x30,0x30,0xe0,0x30,0x30,0x1c,0x00,
137 0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00,
138 0xe0,0x30,0x30,0x1c,0x30,0x30,0xe0,0x00,
139 0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,
140 0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0x00,
141 0x78,0xcc,0xc0,0xcc,0x78,0x18,0x0c,0x78,
142 0x00,0xcc,0x00,0xcc,0xcc,0xcc,0x7e,0x00,
143 0x1c,0x00,0x78,0xcc,0xfc,0xc0,0x78,0x00,
144 0x7e,0xc3,0x3c,0x06,0x3e,0x66,0x3f,0x00,
145 0xcc,0x00,0x78,0x0c,0x7c,0xcc,0x7e,0x00,
146 0xe0,0x00,0x78,0x0c,0x7c,0xcc,0x7e,0x00,
147 0x30,0x30,0x78,0x0c,0x7c,0xcc,0x7e,0x00,
148 0x00,0x00,0x78,0xc0,0xc0,0x78,0x0c,0x38,
149 0x7e,0xc3,0x3c,0x66,0x7e,0x60,0x3c,0x00,
150 0xcc,0x00,0x78,0xcc,0xfc,0xc0,0x78,0x00,
151 0xe0,0x00,0x78,0xcc,0xfc,0xc0,0x78,0x00,
152 0xcc,0x00,0x70,0x30,0x30,0x30,0x78,0x00,
153 0x7c,0xc6,0x38,0x18,0x18,0x18,0x3c,0x00,
154 0xe0,0x00,0x70,0x30,0x30,0x30,0x78,0x00,
155 0xc6,0x38,0x6c,0xc6,0xfe,0xc6,0xc6,0x00,
156 0x30,0x30,0x00,0x78,0xcc,0xfc,0xcc,0x00,
157 0x1c,0x00,0xfc,0x60,0x78,0x60,0xfc,0x00,
158 0x00,0x00,0x7f,0x0c,0x7f,0xcc,0x7f,0x00,
159 0x3e,0x6c,0xcc,0xfe,0xcc,0xcc,0xce,0x00,
160 0x78,0xcc,0x00,0x78,0xcc,0xcc,0x78,0x00,
161 0x00,0xcc,0x00,0x78,0xcc,0xcc,0x78,0x00,
162 0x00,0xe0,0x00,0x78,0xcc,0xcc,0x78,0x00,
163 0x78,0xcc,0x00,0xcc,0xcc,0xcc,0x7e,0x00,
164 0x00,0xe0,0x00,0xcc,0xcc,0xcc,0x7e,0x00,
165 0x00,0xcc,0x00,0xcc,0xcc,0x7c,0x0c,0xf8,
166 0xc3,0x18,0x3c,0x66,0x66,0x3c,0x18,0x00,
167 0xcc,0x00,0xcc,0xcc,0xcc,0xcc,0x78,0x00,
168 0x18,0x18,0x7e,0xc0,0xc0,0x7e,0x18,0x18,
169 0x38,0x6c,0x64,0xf0,0x60,0xe6,0xfc,0x00,
170 0xcc,0xcc,0x78,0xfc,0x30,0xfc,0x30,0x30,
171 0xf8,0xcc,0xcc,0xfa,0xc6,0xcf,0xc6,0xc7,
172 0x0e,0x1b,0x18,0x3c,0x18,0x18,0xd8,0x70,
173 0x1c,0x00,0x78,0x0c,0x7c,0xcc,0x7e,0x00,
174 0x38,0x00,0x70,0x30,0x30,0x30,0x78,0x00,
175 0x00,0x1c,0x00,0x78,0xcc,0xcc,0x78,0x00,
176 0x00,0x1c,0x00,0xcc,0xcc,0xcc,0x7e,0x00,
177 0x00,0xf8,0x00,0xf8,0xcc,0xcc,0xcc,0x00,
178 0xfc,0x00,0xcc,0xec,0xfc,0xdc,0xcc,0x00,
179 0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,
180 0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,
181 0x30,0x00,0x30,0x60,0xc0,0xcc,0x78,0x00,
182 0x00,0x00,0x00,0xfc,0xc0,0xc0,0x00,0x00,
183 0x00,0x00,0x00,0xfc,0x0c,0x0c,0x00,0x00,
184 0xc3,0xc6,0xcc,0xde,0x33,0x66,0xcc,0x0f,
185 0xc3,0xc6,0xcc,0xdb,0x37,0x6f,0xcf,0x03,
186 0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00,
187 0x00,0x33,0x66,0xcc,0x66,0x33,0x00,0x00,
188 0x00,0xcc,0x66,0x33,0x66,0xcc,0x00,0x00,
189 0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,
190 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
191 0xdb,0x77,0xdb,0xee,0xdb,0x77,0xdb,0xee,
192 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
193 0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,
194 0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,
195 0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,
196 0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,
197 0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,
198 0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,
199 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
200 0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,
201 0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,
202 0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,
203 0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,
204 0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,
205 0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,
206 0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,
207 0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,
208 0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,
209 0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
210 0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,
211 0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,
212 0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,
213 0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,
214 0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,
215 0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,
216 0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,
217 0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,
218 0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,
219 0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,
220 0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,
221 0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,
222 0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,
223 0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,
224 0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,
225 0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,
226 0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,
227 0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,
228 0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,
229 0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,
230 0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,
231 0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,
232 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
233 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
234 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
235 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,
236 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
237 0x00,0x00,0x76,0xdc,0xc8,0xdc,0x76,0x00,
238 0x00,0x78,0xcc,0xf8,0xcc,0xf8,0xc0,0xc0,
239 0x00,0xfc,0xcc,0xc0,0xc0,0xc0,0xc0,0x00,
240 0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,
241 0xfc,0xcc,0x60,0x30,0x60,0xcc,0xfc,0x00,
242 0x00,0x00,0x7e,0xd8,0xd8,0xd8,0x70,0x00,
243 0x00,0x66,0x66,0x66,0x66,0x7c,0x60,0xc0,
244 0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x00,
245 0xfc,0x30,0x78,0xcc,0xcc,0x78,0x30,0xfc,
246 0x38,0x6c,0xc6,0xfe,0xc6,0x6c,0x38,0x00,
247 0x38,0x6c,0xc6,0xc6,0x6c,0x6c,0xee,0x00,
248 0x1c,0x30,0x18,0x7c,0xcc,0xcc,0x78,0x00,
249 0x00,0x00,0x7e,0xdb,0xdb,0x7e,0x00,0x00,
250 0x06,0x0c,0x7e,0xdb,0xdb,0x7e,0x60,0xc0,
251 0x38,0x60,0xc0,0xf8,0xc0,0x60,0x38,0x00,
252 0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,
253 0x00,0xfc,0x00,0xfc,0x00,0xfc,0x00,0x00,
254 0x30,0x30,0xfc,0x30,0x30,0x00,0xfc,0x00,
255 0x60,0x30,0x18,0x30,0x60,0x00,0xfc,0x00,
256 0x18,0x30,0x60,0x30,0x18,0x00,0xfc,0x00,
257 0x0e,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,
258 0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0x70,
259 0x30,0x30,0x00,0xfc,0x00,0x30,0x30,0x00,
260 0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,
261 0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,
262 0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,
263 0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
264 0x0f,0x0c,0x0c,0x0c,0xec,0x6c,0x3c,0x1c,
265 0x78,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,
266 0x70,0x18,0x30,0x60,0x78,0x00,0x00,0x00,
267 0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00,
268 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
269 };
270
271 ULONG ScreenCursor;
272
273 VOID
274 NTAPI
275 LlbVideoDrawChar(IN CHAR c,
276 IN ULONG cx,
277 IN ULONG cy,
278 IN USHORT Color,
279 IN USHORT BackColor)
280 {
281 PUSHORT Buffer;
282 PCHAR Pixels;
283 CHAR Line;
284 ULONG y, ScreenWidth;
285 LONG x;
286 PUSHORT VideoBuffer;
287
288 /* Get screen width and frame buffer */
289 ScreenWidth = LlbHwGetScreenWidth();
290 VideoBuffer = LlbHwGetFrameBuffer();
291
292 /* Compute starting address on-screen and in the character-array */
293 Buffer = VideoBuffer + ScreenWidth * cy + cx;
294 Pixels = LlbHwBootFont + c * 8;
295
296 /* Loop y pixels */
297 for (y = 0; y < 8; y++)
298 {
299 /* Loop x pixels */
300 Line = *Pixels++;
301 for (x = 7; x >= 0; x--)
302 {
303 /* Draw either a character or background pixel */
304 Buffer[x] = (Line & 1) ? Color : BackColor;
305 Line >>= 1;
306 }
307
308 /* Next line */
309 Buffer += ScreenWidth;
310 }
311 }
312
313 VOID
314 NTAPI
315 LlbVideoClearScreen(VOID)
316 {
317 ULONG ScreenSize, p;
318 ULONG BackColor;
319 PUSHORT VideoBuffer;
320
321 /* Get frame buffer and reset cursor position */
322 VideoBuffer = LlbHwGetFrameBuffer();
323 ScreenCursor = 0;
324
325 /* Backcolor on this machine */
326 BackColor = LlbHwVideoCreateColor(14, 0, 82);
327 BackColor = (BackColor << 16) | BackColor;
328
329 /* Screen size on this machine */
330 ScreenSize = LlbHwGetScreenWidth() * LlbHwGetScreenHeight();
331
332 /* Clear the screen with the given color */
333 for (p = 0; p < ScreenSize * 2; p += 4)
334 {
335 *(PULONG)((PCHAR)VideoBuffer + p) = BackColor;
336 }
337 }
338
339 VOID
340 NTAPI
341 LlbVideoPutChar(IN CHAR c)
342 {
343 ULONG cx, cy, CharsPerLine, BackColor;
344
345 /* Forecolor on this machine */
346 BackColor = LlbHwVideoCreateColor(14, 0, 82);
347
348 /* Amount of characters in a line */
349 CharsPerLine = LlbHwGetScreenWidth() / 8;
350
351 /* Handle new line and scrolling */
352 if (c == '\n')
353 {
354 /* Move a line down */
355 ScreenCursor += CharsPerLine - (ScreenCursor % CharsPerLine);
356
357 /* FIXME: Scrolling */
358 }
359 else
360 {
361 /* Calculate character position from pixel position */
362 cy = (ScreenCursor / CharsPerLine) * 8;
363 cx = (ScreenCursor % CharsPerLine) * 8;
364
365 /* Draw the character and increment the cursor */
366 LlbVideoDrawChar(c, cx, cy, 0xFFFF, BackColor);
367 ScreenCursor++;
368 }
369 }
370
371 /* EOF */