Implement some video routines for Xen
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
_____
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c
2005-05-16 17:19:10 UTC (rev 15345)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c
2005-05-16 18:02:10 UTC (rev 15346)
@@ -210,44 +210,12 @@
return 0;
}
-VIDEODISPLAYMODE
-XenVideoSetDisplayMode(char *DisplayMode, BOOL Init)
- {
- XEN_UNIMPLEMENTED("XenVideoSetDisplayMode");
- return VideoTextMode;
- }
-
VOID
-XenVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
- {
- XEN_UNIMPLEMENTED("XenVideoGetDisplaySize");
- }
-
-ULONG
-XenVideoGetBufferSize(VOID)
- {
- XEN_UNIMPLEMENTED("XenVideoGetBufferSize");
- return 0;
- }
-
-VOID
XenVideoSetTextCursorPosition(ULONG X, ULONG Y)
{
XEN_UNIMPLEMENTED("XenVideoSetTextCursorPosition");
}
-VOID
-XenVideoHideShowTextCursor(BOOL Show)
- {
- XEN_UNIMPLEMENTED("XenVideoHideShowTextCursor");
- }
-
-VOID
-XenVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
- {
- XEN_UNIMPLEMENTED("XenVideoCopyOffScreenBufferToVRAM");
- }
-
BOOL
XenVideoIsPaletteFixed(VOID)
{
_____
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
2005-05-16 17:19:10 UTC (rev 15345)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
2005-05-16 18:02:10 UTC (rev 15346)
@@ -90,6 +90,29 @@
return;
}
+ /* Translate some line-drawing characters */
+ if (0x80 <= Ch)
+ {
+ switch(Ch)
+ {
+ case 0xc9: /* top-left double corner */
+ case 0xbb: /* top-right double corner */
+ case 0xc8: /* bottom-left double corner */
+ case 0xbc: /* bottom-right double corner */
+ Ch = '+';
+ break;
+ case 0xcd: /* horizontal double */
+ Ch = '-';
+ break;
+ case 0xba: /* vertical double */
+ Ch = '|';
+ break;
+ case 0xb1: /* dotted pattern */
+ Ch = ' ';
+ break;
+ }
+ }
+
if (X != CurrentX || Y != CurrentY)
{
AnsiMoveToPos(X, Y);
@@ -102,4 +125,48 @@
CurrentX++;
}
+VIDEODISPLAYMODE
+XenVideoSetDisplayMode(char *DisplayMode, BOOL Init)
+{
+ /* We only have one mode: text */
+ return VideoTextMode;
+}
+
+VOID
+XenVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
+{
+ *Width = COLS;
+ *Height = ROWS;
+ *Depth = 0;
+}
+
+VOID
+XenVideoHideShowTextCursor(BOOL Show)
+{
+ /* We can't hide the cursor */
+}
+
+ULONG
+XenVideoGetBufferSize(VOID)
+{
+ return COLS * ROWS * 2;
+}
+
+VOID
+XenVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
+{
+ unsigned X, Y;
+ PUCHAR BufPtr = (PUCHAR) Buffer;
+
+ for (Y = 0; Y < ROWS; Y++)
+ {
+ for (X = 0; X < COLS; X++)
+ {
+ XenVideoPutChar(BufPtr[0], BufPtr[1], X, Y);
+ BufPtr += 2;
+ }
+ }
+ XenConsFlush();
+}
+
/* EOF */
Show replies by date