diff --git a/reactos/drivers/base/bootvid/i386/bootdata.c b/reactos/drivers/base/bootvid/i386/bootdata.c index 5087a8a1fa2..87085a3401b 100644 --- a/reactos/drivers/base/bootvid/i386/bootdata.c +++ b/reactos/drivers/base/bootvid/i386/bootdata.c @@ -48,7 +48,10 @@ USHORT AT_Initialization[] = 0x0 // End of command stream }; -UCHAR FontData[256 * 13] = +// +// The character generator is in natural order, top of char is first element. +// +UCHAR FontData[256 * BOOTCHAR_HEIGHT] = { 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 0 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 13 diff --git a/reactos/drivers/base/bootvid/i386/vga.c b/reactos/drivers/base/bootvid/i386/vga.c index 83405ee13a9..e11aae77fab 100644 --- a/reactos/drivers/base/bootvid/i386/vga.c +++ b/reactos/drivers/base/bootvid/i386/vga.c @@ -146,10 +146,10 @@ DisplayCharacter(CHAR Character, ULONG i, j, XOffset; /* Get the font line for this character */ - FontChar = &FontData[Character * 13 - Top]; + FontChar = &FontData[Character * BOOTCHAR_HEIGHT]; /* Loop each pixel height */ - i = 13; + i = BOOTCHAR_HEIGHT; do { /* Loop each pixel width */ @@ -158,15 +158,20 @@ DisplayCharacter(CHAR Character, do { /* Check if we should draw this pixel */ - if (FontChar[Top] & (UCHAR)j) +#ifdef CHAR_GEN_UPSIDE_DOWN + if (FontChar[i] & (UCHAR)j) +#else + /* Normal character generator (top of char is first element) */ + if (FontChar[BOOTCHAR_HEIGHT - i] & (UCHAR)j) +#endif { /* We do, use the given Text Color */ SetPixel(XOffset, Top, (UCHAR)TextColor); } else if (BackTextColor < 16) { - /* This is a background pixel. We're drawing it unless it's */ - /* transparent. */ + /* This is a background pixel. */ + /* We're drawing it unless it's transparent. */ SetPixel(XOffset, Top, (UCHAR)BackTextColor); } diff --git a/reactos/drivers/base/bootvid/precomp.h b/reactos/drivers/base/bootvid/precomp.h index 88c95e7f4f2..c53b7206d7d 100644 --- a/reactos/drivers/base/bootvid/precomp.h +++ b/reactos/drivers/base/bootvid/precomp.h @@ -3,6 +3,11 @@ #include "halfuncs.h" #include "drivers/bootvid/bootvid.h" +/* Define if FontData has upside down characters */ +#undef CHAR_GEN_UPSIDE_DOWN + +#define BOOTCHAR_HEIGHT 13 + // // Command Stream Definitions // @@ -43,4 +48,4 @@ extern ULONG curr_x; extern ULONG curr_y; extern ULONG_PTR VgaRegisterBase; extern ULONG_PTR VgaBase; -extern UCHAR FontData[256 * 13]; +extern UCHAR FontData[256 * BOOTCHAR_HEIGHT];