2010-02-02 17:21:19 +00:00
|
|
|
/*
|
|
|
|
* 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"
|
|
|
|
|
2010-02-09 03:10:07 +00:00
|
|
|
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},
|
|
|
|
};
|
|
|
|
|
2010-02-02 17:21:19 +00:00
|
|
|
VOID
|
|
|
|
LlbFwPutChar(INT Ch)
|
|
|
|
{
|
|
|
|
/* Just call directly the video function */
|
|
|
|
LlbVideoPutChar(Ch);
|
|
|
|
|
|
|
|
/* DEBUG ONLY */
|
|
|
|
LlbSerialPutChar(Ch);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
LlbFwKbHit(VOID)
|
|
|
|
{
|
2010-02-04 08:02:30 +00:00
|
|
|
/* Check RX buffer */
|
|
|
|
return LlbHwKbdReady();
|
2010-02-02 17:21:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
INT
|
|
|
|
LlbFwGetCh(VOID)
|
|
|
|
{
|
2010-02-03 01:19:26 +00:00
|
|
|
/* Return the key pressed */
|
[ARMLLB]: We made certain assumptions in the "generic" files that are actually board-specific. For example, Versatile does indeed return a strange ULONG as the RTC time (seconds since 1970, I think), but TWL4030 on the ZOOM2 is normal and returns BCD RTC values just like the PC CMOS. Therefore, most of the "Generic" time.c code should move to versatile later. For now, use an IFDEF.
[ARMLLB]: Likewise, not all platforms have a PS/2 controller like the Versatile. ZOOM2 for example has a keypad, so the generic "input" file shouldn't assume keyboard-only. As such, most of the code there should also be made specific, but for now, use an ifdef.
svn path=/trunk/; revision=49741
2010-11-23 16:49:28 +00:00
|
|
|
#ifdef _ZOOM2_
|
|
|
|
return LlbKeypadGetChar();
|
|
|
|
#else
|
2010-02-03 01:19:26 +00:00
|
|
|
return LlbKeyboardGetChar();
|
[ARMLLB]: We made certain assumptions in the "generic" files that are actually board-specific. For example, Versatile does indeed return a strange ULONG as the RTC time (seconds since 1970, I think), but TWL4030 on the ZOOM2 is normal and returns BCD RTC values just like the PC CMOS. Therefore, most of the "Generic" time.c code should move to versatile later. For now, use an IFDEF.
[ARMLLB]: Likewise, not all platforms have a PS/2 controller like the Versatile. ZOOM2 for example has a keypad, so the generic "input" file shouldn't assume keyboard-only. As such, most of the code there should also be made specific, but for now, use an ifdef.
svn path=/trunk/; revision=49741
2010-11-23 16:49:28 +00:00
|
|
|
#endif
|
2010-02-02 17:21:19 +00:00
|
|
|
}
|
|
|
|
|
2010-02-04 05:43:02 +00:00
|
|
|
ULONG
|
|
|
|
LlbFwVideoSetDisplayMode(IN PCHAR DisplayModeName,
|
|
|
|
IN BOOLEAN Init)
|
|
|
|
{
|
2010-02-04 06:09:03 +00:00
|
|
|
/* Return text mode */
|
2010-02-04 05:43:02 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
LlbFwVideoGetDisplaySize(OUT PULONG Width,
|
|
|
|
OUT PULONG Height,
|
|
|
|
OUT PULONG Depth)
|
|
|
|
{
|
2010-02-04 06:09:03 +00:00
|
|
|
/* Query static settings */
|
2010-02-04 07:55:26 +00:00
|
|
|
*Width = LlbHwGetScreenWidth() / 8;
|
2010-02-06 00:49:30 +00:00
|
|
|
*Height = LlbHwGetScreenHeight() / 16;
|
2010-02-04 06:09:03 +00:00
|
|
|
|
|
|
|
/* Depth is always 16 bpp */
|
|
|
|
*Depth = 16;
|
2010-02-04 05:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
LlbFwVideoClearScreen(IN UCHAR Attr)
|
|
|
|
{
|
2010-02-04 06:09:03 +00:00
|
|
|
/* Clear the screen */
|
|
|
|
LlbVideoClearScreen(TRUE);
|
2010-02-04 05:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
LlbFwVideoPutChar(IN INT c,
|
|
|
|
IN UCHAR Attr,
|
|
|
|
IN ULONG X,
|
|
|
|
IN ULONG Y)
|
|
|
|
{
|
2010-02-04 06:44:06 +00:00
|
|
|
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 */
|
2010-02-06 00:49:30 +00:00
|
|
|
Buffer = (PUSHORT)LlbHwGetFrameBuffer() + (LlbHwGetScreenWidth() * (Y * 16)) + (X * 8);
|
2010-02-04 06:44:06 +00:00
|
|
|
|
|
|
|
/* Draw it */
|
|
|
|
LlbVideoDrawChar(c, Buffer, Color, BackColor);
|
2010-02-04 05:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-04 07:22:03 +00:00
|
|
|
TIMEINFO*
|
2010-02-04 06:44:06 +00:00
|
|
|
LlbFwGetTime(VOID)
|
|
|
|
{
|
2010-02-04 07:22:03 +00:00
|
|
|
/* Call existing function */
|
|
|
|
return LlbGetTime();
|
2010-02-04 06:44:06 +00:00
|
|
|
}
|
|
|
|
|
2010-02-02 17:21:19 +00:00
|
|
|
/* EOF */
|