Love Nystrom (=lovenystrom=at=hotmail=dot=com=), bug #4727

- Change some 'suspiciously looking' code in bootvid.dll.
- BOOTCHAR_HEIGHT: a new macro to use instead of a plain integer.
- CHAR_GEN_UPSIDE_DOWN: define it for upside down font data.

svn path=/trunk/; revision=42350
This commit is contained in:
Dmitry Gorbachev 2009-08-02 21:26:05 +00:00
parent f78dc5c1e5
commit 5da0923cf0
3 changed files with 20 additions and 7 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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];