- Add GetTime stub, bump version to 1.4.

- Implement function for drawing character on the screen when request come from firmware.
- Tui.c assumes all screens are x86 VGA Consoles with 8-bit character and 8-bit attribute. On ARM, call Mach function to draw character instead of drawing into ScreenMemory off-screen buffer.
- FreeLDR menu now appears, need GetTime for counter.


svn path=/trunk/; revision=45413
This commit is contained in:
evb 2010-02-04 06:44:06 +00:00
parent ee2e3391be
commit 1dc4d1bc2e
8 changed files with 79 additions and 40 deletions

View file

@ -75,11 +75,31 @@ LlbFwVideoHideShowTextCursor(IN BOOLEAN Show)
return; return;
} }
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},
};
VOID VOID
LlbFwVideoCopyOffScreenBufferToVRAM(IN PVOID Buffer) LlbFwVideoCopyOffScreenBufferToVRAM(IN PVOID Buffer)
{ {
printf("%s is UNIMPLEMENTED", __FUNCTION__); /* No double-buffer is used on ARM */
while (TRUE); return;
} }
VOID VOID
@ -95,8 +115,22 @@ LlbFwVideoPutChar(IN INT c,
IN ULONG X, IN ULONG X,
IN ULONG Y) IN ULONG Y)
{ {
printf("%s is UNIMPLEMENTED", __FUNCTION__); ULONG Color, BackColor;
while (TRUE); 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 * 8)) + (X * 8);
/* Draw it */
LlbVideoDrawChar(c, Buffer, Color, BackColor);
} }
BOOLEAN BOOLEAN
@ -137,4 +171,12 @@ LlbFwVideoSync(VOID)
return; return;
} }
VOID
LlbFwGetTime(VOID)
{
printf("%s is UNIMPLEMENTED", __FUNCTION__);
while (TRUE);
return;
}
/* EOF */ /* EOF */

View file

@ -268,51 +268,22 @@ CHAR LlbHwBootFont[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
}; };
#if 0
USHORT ColorPalette[16] =
{
RGB565(0x00, 0x00, 0x00),
RGB565(0x00, 0x00, 0xAA),
RGB565(0x00, 0xAA, 0x00),
RGB565(0x00, 0xAA, 0xAA),
RGB565(0xAA, 0x00, 0x00),
RGB565(0xAA, 0x00, 0xAA),
RGB565(0xAA, 0x55, 0x00),
RGB565(0xAA, 0xAA, 0xAA),
RGB565(0x55, 0x55, 0x55),
RGB565(0x55, 0x55, 0xFF),
RGB565(0x55, 0xFF, 0x55),
RGB565(0x55, 0xFF, 0xFF),
RGB565(0xFF, 0x55, 0x55),
RGB565(0xFF, 0x55, 0xFF),
RGB565(0xFF, 0xFF, 0x55),
RGB565(0xFF, 0xFF, 0xFF),
};
#endif
ULONG ScreenCursor; ULONG ScreenCursor;
VOID VOID
NTAPI NTAPI
LlbVideoDrawChar(IN CHAR c, LlbVideoDrawChar(IN CHAR c,
IN ULONG cx, IN PUSHORT Buffer,
IN ULONG cy,
IN USHORT Color, IN USHORT Color,
IN USHORT BackColor) IN USHORT BackColor)
{ {
PUSHORT Buffer;
PCHAR Pixels; PCHAR Pixels;
CHAR Line; CHAR Line;
ULONG y, ScreenWidth; ULONG y, ScreenWidth;
LONG x; LONG x;
PUSHORT VideoBuffer;
/* Get screen width and frame buffer */ /* Get screen width */
ScreenWidth = LlbHwGetScreenWidth(); ScreenWidth = LlbHwGetScreenWidth();
VideoBuffer = LlbHwGetFrameBuffer();
/* Compute starting address on-screen and in the character-array */
Buffer = VideoBuffer + ScreenWidth * cy + cx;
Pixels = LlbHwBootFont + c * 8; Pixels = LlbHwBootFont + c * 8;
/* Loop y pixels */ /* Loop y pixels */
@ -371,13 +342,14 @@ VOID
NTAPI NTAPI
LlbVideoPutChar(IN CHAR c) LlbVideoPutChar(IN CHAR c)
{ {
ULONG cx, cy, CharsPerLine, BackColor; ULONG cx, cy, CharsPerLine, BackColor, ScreenWidth;
/* Forecolor on this machine */ /* Forecolor on this machine */
BackColor = LlbHwVideoCreateColor(14, 0, 82); BackColor = LlbHwVideoCreateColor(14, 0, 82);
/* Amount of characters in a line */ /* Amount of characters in a line */
CharsPerLine = LlbHwGetScreenWidth() / 8; ScreenWidth = LlbHwGetScreenWidth();
CharsPerLine = ScreenWidth / 8;
/* Handle new line and scrolling */ /* Handle new line and scrolling */
if (c == '\n') if (c == '\n')
@ -394,7 +366,10 @@ LlbVideoPutChar(IN CHAR c)
cx = (ScreenCursor % CharsPerLine) * 8; cx = (ScreenCursor % CharsPerLine) * 8;
/* Draw the character and increment the cursor */ /* Draw the character and increment the cursor */
LlbVideoDrawChar(c, cx, cy, 0xFFFF, BackColor); LlbVideoDrawChar(c,
(PUSHORT)LlbHwGetFrameBuffer() + ScreenWidth * cy + cx,
0xFFFF,
BackColor);
ScreenCursor++; ScreenCursor++;
} }
} }

View file

@ -94,4 +94,9 @@ LlbFwVideoSync(
VOID VOID
); );
VOID
LlbFwGetTime(
VOID
);
/* EOF */ /* EOF */

View file

@ -42,7 +42,7 @@ typedef struct
// Information sent from LLB to OS Loader // Information sent from LLB to OS Loader
// //
#define ARM_BOARD_CONFIGURATION_MAJOR_VERSION 1 #define ARM_BOARD_CONFIGURATION_MAJOR_VERSION 1
#define ARM_BOARD_CONFIGURATION_MINOR_VERSION 3 #define ARM_BOARD_CONFIGURATION_MINOR_VERSION 4
typedef struct _ARM_BOARD_CONFIGURATION_BLOCK typedef struct _ARM_BOARD_CONFIGURATION_BLOCK
{ {
ULONG MajorVersion; ULONG MajorVersion;
@ -69,6 +69,7 @@ typedef struct _ARM_BOARD_CONFIGURATION_BLOCK
PVOID VideoSetPaletteColor; PVOID VideoSetPaletteColor;
PVOID VideoGetPaletteColor; PVOID VideoGetPaletteColor;
PVOID VideoSync; PVOID VideoSync;
PVOID GetTime;
} ARM_BOARD_CONFIGURATION_BLOCK, *PARM_BOARD_CONFIGURATION_BLOCK; } ARM_BOARD_CONFIGURATION_BLOCK, *PARM_BOARD_CONFIGURATION_BLOCK;
VOID VOID

View file

@ -18,4 +18,13 @@ LlbVideoPutChar(
IN CHAR c IN CHAR c
); );
VOID
NTAPI
LlbVideoDrawChar(
IN CHAR c,
IN PUSHORT Buffer,
IN USHORT Color,
IN USHORT BackColor
);
/* EOF */ /* EOF */

View file

@ -86,6 +86,7 @@ LlbBuildArmBlock(VOID)
ArmBlock.VideoSetPaletteColor = LlbFwVideoSetPaletteColor; ArmBlock.VideoSetPaletteColor = LlbFwVideoSetPaletteColor;
ArmBlock.VideoGetPaletteColor = LlbFwVideoGetPaletteColor; ArmBlock.VideoGetPaletteColor = LlbFwVideoGetPaletteColor;
ArmBlock.VideoSync = LlbFwVideoSync; ArmBlock.VideoSync = LlbFwVideoSync;
ArmBlock.GetTime = LlbFwGetTime;
} }
VOID VOID

View file

@ -171,6 +171,7 @@ MachInit(IN PCCH CommandLine)
MachVtbl.VideoSetPaletteColor = ArmBoardBlock->VideoSetPaletteColor; MachVtbl.VideoSetPaletteColor = ArmBoardBlock->VideoSetPaletteColor;
MachVtbl.VideoGetPaletteColor = ArmBoardBlock->VideoGetPaletteColor; MachVtbl.VideoGetPaletteColor = ArmBoardBlock->VideoGetPaletteColor;
MachVtbl.VideoSync = ArmBoardBlock->VideoSync; MachVtbl.VideoSync = ArmBoardBlock->VideoSync;
MachVtbl.GetTime = ArmBoardBlock->GetTime;
/* Setup the disk and file system buffers */ /* Setup the disk and file system buffers */
gDiskReadBuffer = 0x00090000; gDiskReadBuffer = 0x00090000;

View file

@ -325,8 +325,13 @@ VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
// Draw the text // Draw the text
for (i=X, j=0; Text[j] && i<UiScreenWidth; i++,j++) for (i=X, j=0; Text[j] && i<UiScreenWidth; i++,j++)
{ {
#ifndef _ARM_
ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)] = (UCHAR)Text[j]; ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)] = (UCHAR)Text[j];
ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr; ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr;
#else
UNREFERENCED_PARAMETER(ScreenMemory);
MachVideoPutChar(Text[j], Attr, i, Y);
#endif
} }
} }