Author: evb
Date: Thu Feb 4 07:44:06 2010
New Revision: 45413
URL:
http://svn.reactos.org/svn/reactos?rev=45413&view=rev
Log:
- 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.
Modified:
trunk/reactos/boot/armllb/fw.c
trunk/reactos/boot/armllb/hw/video.c
trunk/reactos/boot/armllb/inc/fw.h
trunk/reactos/boot/armllb/inc/osloader.h
trunk/reactos/boot/armllb/inc/video.h
trunk/reactos/boot/armllb/os/loader.c
trunk/reactos/boot/freeldr/freeldr/arch/arm/macharm.c
trunk/reactos/boot/freeldr/freeldr/ui/tui.c
Modified: trunk/reactos/boot/armllb/fw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/fw.c?rev=45413…
==============================================================================
--- trunk/reactos/boot/armllb/fw.c [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/fw.c [iso-8859-1] Thu Feb 4 07:44:06 2010
@@ -75,11 +75,31 @@
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 @@
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 @@
return;
}
+VOID
+LlbFwGetTime(VOID)
+{
+ printf("%s is UNIMPLEMENTED", __FUNCTION__);
+ while (TRUE);
+ return;
+}
+
/* EOF */
Modified: trunk/reactos/boot/armllb/hw/video.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/hw/video.c?rev…
==============================================================================
--- trunk/reactos/boot/armllb/hw/video.c [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/hw/video.c [iso-8859-1] Thu Feb 4 07:44:06 2010
@@ -268,51 +268,22 @@
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 */
+
+ /* Get screen width */
ScreenWidth = LlbHwGetScreenWidth();
- VideoBuffer = LlbHwGetFrameBuffer();
-
- /* Compute starting address on-screen and in the character-array */
- Buffer = VideoBuffer + ScreenWidth * cy + cx;
Pixels = LlbHwBootFont + c * 8;
/* Loop y pixels */
@@ -371,13 +342,14 @@
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 @@
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++;
}
}
Modified: trunk/reactos/boot/armllb/inc/fw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/inc/fw.h?rev=4…
==============================================================================
--- trunk/reactos/boot/armllb/inc/fw.h [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/inc/fw.h [iso-8859-1] Thu Feb 4 07:44:06 2010
@@ -94,4 +94,9 @@
VOID
);
+VOID
+LlbFwGetTime(
+ VOID
+);
+
/* EOF */
Modified: trunk/reactos/boot/armllb/inc/osloader.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/inc/osloader.h…
==============================================================================
--- trunk/reactos/boot/armllb/inc/osloader.h [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/inc/osloader.h [iso-8859-1] Thu Feb 4 07:44:06 2010
@@ -42,7 +42,7 @@
// 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 @@
PVOID VideoSetPaletteColor;
PVOID VideoGetPaletteColor;
PVOID VideoSync;
+ PVOID GetTime;
} ARM_BOARD_CONFIGURATION_BLOCK, *PARM_BOARD_CONFIGURATION_BLOCK;
VOID
Modified: trunk/reactos/boot/armllb/inc/video.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/inc/video.h?re…
==============================================================================
--- trunk/reactos/boot/armllb/inc/video.h [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/inc/video.h [iso-8859-1] Thu Feb 4 07:44:06 2010
@@ -18,4 +18,13 @@
IN CHAR c
);
+VOID
+NTAPI
+LlbVideoDrawChar(
+ IN CHAR c,
+ IN PUSHORT Buffer,
+ IN USHORT Color,
+ IN USHORT BackColor
+);
+
/* EOF */
Modified: trunk/reactos/boot/armllb/os/loader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/os/loader.c?re…
==============================================================================
--- trunk/reactos/boot/armllb/os/loader.c [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/os/loader.c [iso-8859-1] Thu Feb 4 07:44:06 2010
@@ -86,6 +86,7 @@
ArmBlock.VideoSetPaletteColor = LlbFwVideoSetPaletteColor;
ArmBlock.VideoGetPaletteColor = LlbFwVideoGetPaletteColor;
ArmBlock.VideoSync = LlbFwVideoSync;
+ ArmBlock.GetTime = LlbFwGetTime;
}
VOID
Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/macharm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/arm/macharm.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/arm/macharm.c [iso-8859-1] Thu Feb 4 07:44:06
2010
@@ -171,6 +171,7 @@
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;
Modified: trunk/reactos/boot/freeldr/freeldr/ui/tui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] Thu Feb 4 07:44:06 2010
@@ -325,8 +325,13 @@
// 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
}
}