ReactOS 0.4.15-dev-8241-g63935f8
video.c File Reference
#include "precomp.h"
Include dependency graph for video.c:

Go to the source code of this file.

Macros

#define FONT_HEIGHT   16
 

Functions

VOID NTAPI LlbVideoDrawChar (IN UCHAR c, IN PUSHORT Buffer, IN USHORT Color, IN USHORT BackColor)
 
VOID NTAPI LlbVideoClearScreen (IN BOOLEAN OsLoader)
 
VOID NTAPI LlbVideoPutChar (IN UCHAR c)
 

Variables

CHAR LlbHwBootFont []
 
ULONG ScreenCursor
 

Macro Definition Documentation

◆ FONT_HEIGHT

#define FONT_HEIGHT   16

Definition at line 11 of file video.c.

Function Documentation

◆ LlbVideoClearScreen()

VOID NTAPI LlbVideoClearScreen ( IN BOOLEAN  OsLoader)

Definition at line 310 of file video.c.

311{
312 ULONG ScreenSize, p;
313 ULONG BackColor;
314 PUSHORT VideoBuffer;
315
316 /* Get frame buffer and reset cursor position */
317 VideoBuffer = LlbHwGetFrameBuffer();
318 ScreenCursor = 0;
319
320 /* Backcolor on this machine */
321 if (OsLoader)
322 {
323 /* Black */
324 BackColor = 0;
325 }
326 else
327 {
328 /* Deep blue */
329#ifdef BLUE_SCREEN
330 BackColor = LlbHwVideoCreateColor(14, 0, 82);
331#else
332 BackColor = LlbHwVideoCreateColor(0, 0, 0);
333#endif
334 BackColor = (BackColor << 16) | BackColor;
335 }
336
337 /* Screen size on this machine */
338 ScreenSize = LlbHwGetScreenWidth() * LlbHwGetScreenHeight();
339
340 /* Clear the screen with the given color */
341 for (p = 0; p < ScreenSize * 2; p += 4)
342 {
343 *(PULONG)((PCHAR)VideoBuffer + p) = BackColor;
344 }
345}
ULONG ScreenCursor
Definition: video.c:273
GLfloat GLfloat p
Definition: glext.h:8902
ULONG NTAPI LlbHwVideoCreateColor(IN ULONG Red, IN ULONG Green, IN ULONG Blue)
Definition: hwinfo.c:83
PVOID NTAPI LlbHwGetFrameBuffer(VOID)
Definition: hwinfo.c:76
ULONG NTAPI LlbHwGetScreenWidth(VOID)
Definition: hwinfo.c:62
ULONG NTAPI LlbHwGetScreenHeight(VOID)
Definition: hwinfo.c:69
uint32_t * PULONG
Definition: typedefs.h:59
uint16_t * PUSHORT
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51

Referenced by LlbFwVideoClearScreen(), and LlbStartup().

◆ LlbVideoDrawChar()

VOID NTAPI LlbVideoDrawChar ( IN UCHAR  c,
IN PUSHORT  Buffer,
IN USHORT  Color,
IN USHORT  BackColor 
)

Definition at line 277 of file video.c.

281{
282 PCHAR Pixels;
283 CHAR Line;
285 LONG x;
286
287 /* Get screen width */
289 Pixels = LlbHwBootFont + c * FONT_HEIGHT;
290
291 /* Loop y pixels */
292 for (y = 0; y < FONT_HEIGHT; y++)
293 {
294 /* Loop x pixels */
295 Line = *Pixels++;
296 for (x = 7; x >= 0; x--)
297 {
298 /* Draw either a character or background pixel */
299 Buffer[x] = (Line & 1) ? Color : BackColor;
300 Line >>= 1;
301 }
302
303 /* Next line */
305 }
306}
#define FONT_HEIGHT
Definition: video.c:11
CHAR LlbHwBootFont[]
Definition: video.c:13
Definition: bufpool.h:45
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
const GLubyte * c
Definition: glext.h:8905
static ULONG ScreenWidth
Definition: pcvideo.c:114
long LONG
Definition: pedump.c:60
Definition: ncftp.h:79
char CHAR
Definition: xmlstorage.h:175

Referenced by LlbFwVideoPutChar(), and LlbVideoPutChar().

◆ LlbVideoPutChar()

VOID NTAPI LlbVideoPutChar ( IN UCHAR  c)

Definition at line 349 of file video.c.

350{
351 ULONG cx, cy, CharsPerLine, BackColor, ScreenWidth;
352
353 /* Backcolor on this machine */
354#ifdef BLUE_SCREEN
355 BackColor = LlbHwVideoCreateColor(14, 0, 82);
356#else
357 BackColor = LlbHwVideoCreateColor(0, 0, 0);
358#endif
359
360 /* Amount of characters in a line */
362 CharsPerLine = ScreenWidth / 8;
363
364 /* Handle new line and scrolling */
365 if (c == '\n')
366 {
367 /* Move a line down */
368 ScreenCursor += CharsPerLine - (ScreenCursor % CharsPerLine);
369
370 /* FIXME: Scrolling */
371 }
372 else
373 {
374 /* Calculate character position from pixel position */
375 cy = (ScreenCursor / CharsPerLine) * FONT_HEIGHT;
376 cx = (ScreenCursor % CharsPerLine) * 8;
377
378 /* Draw the character and increment the cursor */
381 0xFFFF,
382 BackColor);
383 ScreenCursor++;
384 }
385}
VOID NTAPI LlbVideoDrawChar(IN UCHAR c, IN PUSHORT Buffer, IN USHORT Color, IN USHORT BackColor)
Definition: video.c:277
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585

Referenced by LlbFwPutChar(), and putchar().

Variable Documentation

◆ LlbHwBootFont

CHAR LlbHwBootFont[]

Definition at line 13 of file video.c.

Referenced by LlbVideoDrawChar().

◆ ScreenCursor

ULONG ScreenCursor

Definition at line 273 of file video.c.

Referenced by LlbVideoClearScreen(), and LlbVideoPutChar().