diff --git a/boot/freeldr/freeldr/arch/i386/xbox/xboxcons.c b/boot/freeldr/freeldr/arch/i386/xbox/xboxcons.c index ed5d55c5b09..18869cc6078 100644 --- a/boot/freeldr/freeldr/arch/i386/xbox/xboxcons.c +++ b/boot/freeldr/freeldr/arch/i386/xbox/xboxcons.c @@ -17,10 +17,13 @@ */ #include +#include "../../vidfb.h" + +UCHAR MachDefaultTextColor = COLOR_GRAY; static unsigned CurrentCursorX = 0; static unsigned CurrentCursorY = 0; -static unsigned CurrentAttr = 0x0f; +static UCHAR CurrentAttr = ATTR(COLOR_GRAY, COLOR_BLACK); VOID XboxConsPutChar(int c) @@ -33,7 +36,7 @@ XboxConsPutChar(int c) NeedScroll = (CurrentCursorY >= Height); if (NeedScroll) { - XboxVideoScrollUp(); + VidFbScrollUp(CurrentAttr); --CurrentCursorY; } diff --git a/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c b/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c index ca490cacc76..ffdceaf399e 100644 --- a/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c +++ b/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c @@ -31,16 +31,8 @@ ULONG FrameBufferSize; extern multiboot_info_t * MultibootInfoPtr; #define FB_SIZE_MB 4 -UCHAR MachDefaultTextColor = COLOR_GRAY; - #define MAKE_COLOR(Red, Green, Blue) (0xff000000 | (((Red) & 0xff) << 16) | (((Green) & 0xff) << 8) | ((Blue) & 0xff)) -VOID -XboxVideoScrollUp(VOID) -{ - VidFbScrollUp(); -} - VOID XboxVideoClearScreen(UCHAR Attr) { diff --git a/boot/freeldr/freeldr/arch/uefi/ueficon.c b/boot/freeldr/freeldr/arch/uefi/ueficon.c index b112ec53003..dd15c392ee0 100644 --- a/boot/freeldr/freeldr/arch/uefi/ueficon.c +++ b/boot/freeldr/freeldr/arch/uefi/ueficon.c @@ -6,13 +6,17 @@ */ #include +#include "../vidfb.h" /* GLOBALS ********************************************************************/ -extern EFI_SYSTEM_TABLE* GlobalSystemTable; +UCHAR MachDefaultTextColor = COLOR_GRAY; + static unsigned CurrentCursorX = 0; static unsigned CurrentCursorY = 0; -static unsigned CurrentAttr = 0x0f; +static UCHAR CurrentAttr = ATTR(COLOR_GRAY, COLOR_BLACK); + +extern EFI_SYSTEM_TABLE* GlobalSystemTable; static EFI_INPUT_KEY Key; static BOOLEAN ExtendedKey = FALSE; static char ExtendedScanCode = 0; @@ -30,7 +34,7 @@ UefiConsPutChar(int c) NeedScroll = (CurrentCursorY >= Height); if (NeedScroll) { - UefiVideoScrollUp(); + VidFbScrollUp(CurrentAttr); --CurrentCursorY; } if (c == '\r') @@ -40,7 +44,6 @@ UefiConsPutChar(int c) else if (c == '\n') { CurrentCursorX = 0; - if (!NeedScroll) ++CurrentCursorY; } diff --git a/boot/freeldr/freeldr/arch/uefi/uefivid.c b/boot/freeldr/freeldr/arch/uefi/uefivid.c index 8eb951a98ee..2d5ddd16585 100644 --- a/boot/freeldr/freeldr/arch/uefi/uefivid.c +++ b/boot/freeldr/freeldr/arch/uefi/uefivid.c @@ -15,8 +15,6 @@ DBG_DEFAULT_CHANNEL(UI); extern EFI_SYSTEM_TABLE* GlobalSystemTable; extern EFI_HANDLE GlobalImageHandle; - -UCHAR MachDefaultTextColor = COLOR_GRAY; EFI_GUID EfiGraphicsOutputProtocol = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; #define LOWEST_SUPPORTED_RES 1 @@ -109,12 +107,6 @@ UefiVideoCopyOffScreenBufferToVRAM(PVOID Buffer) VidFbCopyOffScreenBufferToVRAM(Buffer); } -VOID -UefiVideoScrollUp(VOID) -{ - VidFbScrollUp(); -} - VOID UefiVideoSetTextCursorPosition(UCHAR X, UCHAR Y) { diff --git a/boot/freeldr/freeldr/arch/vidfb.c b/boot/freeldr/freeldr/arch/vidfb.c index 3a85b103411..034a6e8aa03 100644 --- a/boot/freeldr/freeldr/arch/vidfb.c +++ b/boot/freeldr/freeldr/arch/vidfb.c @@ -247,7 +247,8 @@ VidFbCopyOffScreenBufferToVRAM( } VOID -VidFbScrollUp(VOID) +VidFbScrollUp( + _In_ UCHAR Attr) { UINT32 BgColor, Dummy; ULONG PixelCount = framebufInfo.ScreenWidth * CHAR_HEIGHT * @@ -255,7 +256,7 @@ VidFbScrollUp(VOID) PUINT32 Src = (PUINT32)((PUCHAR)framebufInfo.BaseAddress + (CHAR_HEIGHT + TOP_BOTTOM_LINES) * framebufInfo.Delta); PUINT32 Dst = (PUINT32)((PUCHAR)framebufInfo.BaseAddress + TOP_BOTTOM_LINES * framebufInfo.Delta); - VidFbAttrToColors(ATTR(COLOR_WHITE, COLOR_BLACK), &Dummy, &BgColor); + VidFbAttrToColors(Attr, &Dummy, &BgColor); while (PixelCount--) *Dst++ = *Src++; diff --git a/boot/freeldr/freeldr/arch/vidfb.h b/boot/freeldr/freeldr/arch/vidfb.h index ef0ed4d65d2..1aca5ae78fe 100644 --- a/boot/freeldr/freeldr/arch/vidfb.h +++ b/boot/freeldr/freeldr/arch/vidfb.h @@ -54,7 +54,8 @@ VidFbCopyOffScreenBufferToVRAM( _In_ PVOID Buffer); VOID -VidFbScrollUp(VOID); +VidFbScrollUp( + _In_ UCHAR Attr); #if 0 VOID diff --git a/boot/freeldr/freeldr/include/arch/i386/machxbox.h b/boot/freeldr/freeldr/include/arch/i386/machxbox.h index 2b413255084..2ceaec7286e 100644 --- a/boot/freeldr/freeldr/include/arch/i386/machxbox.h +++ b/boot/freeldr/freeldr/include/arch/i386/machxbox.h @@ -43,7 +43,6 @@ VOID XboxVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue); VOID XboxVideoGetPaletteColor(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue); VOID XboxVideoSync(VOID); VOID XboxVideoPrepareForReactOS(VOID); -VOID XboxVideoScrollUp(VOID); VOID XboxPrepareForReactOS(VOID); VOID XboxMemInit(VOID); diff --git a/boot/freeldr/freeldr/include/arch/uefi/machuefi.h b/boot/freeldr/freeldr/include/arch/uefi/machuefi.h index c6e1a3076b1..86cedb5a34c 100644 --- a/boot/freeldr/freeldr/include/arch/uefi/machuefi.h +++ b/boot/freeldr/freeldr/include/arch/uefi/machuefi.h @@ -107,6 +107,3 @@ UefiHwIdle(VOID); VOID UefiInitializeFileSystemSupport(_In_ EFI_HANDLE ImageHandle, _In_ EFI_SYSTEM_TABLE *SystemTable); - -VOID -UefiVideoScrollUp(VOID);