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

View file

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

View file

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

View file

@ -42,7 +42,7 @@ typedef struct
// Information sent from LLB to OS Loader
//
#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
{
ULONG MajorVersion;
@ -69,6 +69,7 @@ typedef struct _ARM_BOARD_CONFIGURATION_BLOCK
PVOID VideoSetPaletteColor;
PVOID VideoGetPaletteColor;
PVOID VideoSync;
PVOID GetTime;
} ARM_BOARD_CONFIGURATION_BLOCK, *PARM_BOARD_CONFIGURATION_BLOCK;
VOID

View file

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

View file

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

View file

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

View file

@ -325,8 +325,13 @@ VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
// Draw the text
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)+1] = Attr;
#else
UNREFERENCED_PARAMETER(ScreenMemory);
MachVideoPutChar(Text[j], Attr, i, Y);
#endif
}
}