diff --git a/reactos/boot/armllb/fw.c b/reactos/boot/armllb/fw.c index 884d0f81e22..94350fad460 100644 --- a/reactos/boot/armllb/fw.c +++ b/reactos/boot/armllb/fw.c @@ -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 */ diff --git a/reactos/boot/armllb/hw/video.c b/reactos/boot/armllb/hw/video.c index 10f280227df..174c30e7287 100644 --- a/reactos/boot/armllb/hw/video.c +++ b/reactos/boot/armllb/hw/video.c @@ -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++; } } diff --git a/reactos/boot/armllb/inc/fw.h b/reactos/boot/armllb/inc/fw.h index fb1404e47e2..3c44c2dd47f 100755 --- a/reactos/boot/armllb/inc/fw.h +++ b/reactos/boot/armllb/inc/fw.h @@ -94,4 +94,9 @@ LlbFwVideoSync( VOID ); +VOID +LlbFwGetTime( + VOID +); + /* EOF */ diff --git a/reactos/boot/armllb/inc/osloader.h b/reactos/boot/armllb/inc/osloader.h index 133dafb162a..6251bb1fa56 100644 --- a/reactos/boot/armllb/inc/osloader.h +++ b/reactos/boot/armllb/inc/osloader.h @@ -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 diff --git a/reactos/boot/armllb/inc/video.h b/reactos/boot/armllb/inc/video.h index 416f6eee818..0e67123c934 100755 --- a/reactos/boot/armllb/inc/video.h +++ b/reactos/boot/armllb/inc/video.h @@ -18,4 +18,13 @@ LlbVideoPutChar( IN CHAR c ); +VOID +NTAPI +LlbVideoDrawChar( + IN CHAR c, + IN PUSHORT Buffer, + IN USHORT Color, + IN USHORT BackColor +); + /* EOF */ diff --git a/reactos/boot/armllb/os/loader.c b/reactos/boot/armllb/os/loader.c index 7c705caad2c..d7f7e90e147 100755 --- a/reactos/boot/armllb/os/loader.c +++ b/reactos/boot/armllb/os/loader.c @@ -86,6 +86,7 @@ LlbBuildArmBlock(VOID) ArmBlock.VideoSetPaletteColor = LlbFwVideoSetPaletteColor; ArmBlock.VideoGetPaletteColor = LlbFwVideoGetPaletteColor; ArmBlock.VideoSync = LlbFwVideoSync; + ArmBlock.GetTime = LlbFwGetTime; } VOID diff --git a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c index 14505959b73..006a2998040 100644 --- a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c +++ b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c @@ -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; diff --git a/reactos/boot/freeldr/freeldr/ui/tui.c b/reactos/boot/freeldr/freeldr/ui/tui.c index 726eb80489a..d0016f463a8 100644 --- a/reactos/boot/freeldr/freeldr/ui/tui.c +++ b/reactos/boot/freeldr/freeldr/ui/tui.c @@ -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