Optimize screen writing
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c
_____
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
2005-05-16 19:46:56 UTC (rev 15353)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c
2005-05-16 20:16:33 UTC (rev 15354)
@@ -32,6 +32,7 @@
static unsigned CurrentY = (unsigned) -1;
static UCHAR CurrentAttr = 0x07;
+static UCHAR ShadowBuffer[ROWS * COLS * 2];
static VOID
AnsiMoveToPos(unsigned X, unsigned Y)
@@ -72,11 +73,21 @@
VOID
XenVideoClearScreen(UCHAR Attr)
{
+ unsigned X, Y;
+
if (Attr != CurrentAttr)
{
AnsiSetAttr(Attr);
}
AnsiClearScreen();
+ for (Y = 0; Y < ROWS; Y++)
+ {
+ for (X = 0; X < COLS; X++)
+ {
+ ShadowBuffer[2 * (Y * COLS + X)] = ' ';
+ ShadowBuffer[2 * (Y * COLS + X) + 1] = Attr;
+ }
+ }
}
VOID
@@ -113,16 +124,23 @@
}
}
- if (X != CurrentX || Y != CurrentY)
+ if (Ch != ShadowBuffer[2 * (Y * COLS + X)]
+ || Attr != ShadowBuffer[2 * (Y * COLS + X) + 1])
{
- AnsiMoveToPos(X, Y);
+ if (X != CurrentX || Y != CurrentY)
+ {
+ AnsiMoveToPos(X, Y);
+ }
+ if (Attr != CurrentAttr)
+ {
+ AnsiSetAttr(Attr);
+ }
+ XenConsPutChar(Ch);
+ CurrentX++;
+
+ ShadowBuffer[2 * (Y * COLS + X)] = Ch;
+ ShadowBuffer[2 * (Y * COLS + X) + 1] = Attr;
}
- if (Attr != CurrentAttr)
- {
- AnsiSetAttr(Attr);
- }
- XenConsPutChar(Ch);
- CurrentX++;
}
VIDEODISPLAYMODE
@@ -166,6 +184,7 @@
BufPtr += 2;
}
}
+ AnsiMoveToPos(COLS, ROWS);
XenConsFlush();
}
_____
Modified: branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c
--- branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c
2005-05-16 19:46:56 UTC (rev 15353)
+++ branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c
2005-05-16 20:16:33 UTC (rev 15354)
@@ -196,7 +196,7 @@
//
// Update the status bar
//
- UiDrawStatusText("Use \x18\x19 to select, then press ENTER.");
+ UiDrawStatusText("Use arrow keys to select, then press ENTER.");
//
// Draw the menu box
Show replies by date