Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120/* * PROJECT: ReactOS Boot Loader * LICENSE: BSD - See COPYING.ARM in the top level directory * FILE: boot/armllb/fw.c * PURPOSE: LLB Firmware Routines (accessible by OS Loader) * PROGRAMMERS: ReactOS Portable Systems Group */
#include "precomp.h"
USHORT ColorPalette[16][3] ={ {0x00, 0x00, 0x00}, {0x00, 0x00, 0xAA}, {0x00, 0xAA, 0x00}, {0x00, 0xAA, 0xAA}, {0xAA, 0x00, 0x00}, {0xAA, 0x00, 0xAA}, {0xAA, 0x55, 0x00}, {0xAA, 0xAA, 0xAA}, {0x55, 0x55, 0x55}, {0x55, 0x55, 0xFF}, {0x55, 0xFF, 0x55}, {0x55, 0xFF, 0xFF}, {0xFF, 0x55, 0x55}, {0xFF, 0x55, 0xFF}, {0xFF, 0xFF, 0x55}, {0xFF, 0xFF, 0xFF},};
VOIDLlbFwPutChar(INT Ch){ /* Just call directly the video function */ LlbVideoPutChar(Ch);
/* DEBUG ONLY */ LlbSerialPutChar(Ch);}
BOOLEANLlbFwKbHit(VOID){ /* Check RX buffer */ return LlbHwKbdReady();}
INTLlbFwGetCh(VOID){ /* Return the key pressed */#ifdef _ZOOM2_ return LlbKeypadGetChar();#else return LlbKeyboardGetChar();#endif}
ULONGLlbFwVideoSetDisplayMode(IN PCSTR DisplayModeName, IN BOOLEAN Init){ /* Return text mode */ return 0;}
VOIDLlbFwVideoGetDisplaySize(OUT PULONG Width, OUT PULONG Height, OUT PULONG Depth){ /* Query static settings */ *Width = LlbHwGetScreenWidth() / 8; *Height = LlbHwGetScreenHeight() / 16;
/* Depth is always 16 bpp */ *Depth = 16;}
VOIDLlbFwVideoClearScreen(IN UCHAR Attr){ /* Clear the screen */ LlbVideoClearScreen(TRUE);}
VOIDLlbFwVideoPutChar(IN INT c, IN UCHAR Attr, IN ULONG X, IN ULONG Y){ ULONG Color, BackColor; PUSHORT Buffer;
/* Convert EGA index to color used by hardware */ Color = LlbHwVideoCreateColor(ColorPalette[Attr & 0xF][0], ColorPalette[Attr & 0xF][1], ColorPalette[Attr & 0xF][2]); BackColor = LlbHwVideoCreateColor(ColorPalette[Attr >> 4][0], ColorPalette[Attr >> 4][1], ColorPalette[Attr >> 4][2]);
/* Compute buffer address */ Buffer = (PUSHORT)LlbHwGetFrameBuffer() + (LlbHwGetScreenWidth() * (Y * 16)) + (X * 8);
/* Draw it */ LlbVideoDrawChar(c, Buffer, Color, BackColor);}
TIMEINFO*LlbFwGetTime(VOID){ /* Call existing function */ return LlbGetTime();}
/* EOF */