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 */
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);
}
do
{
/* Write value in the new position so that we can do the scroll */
- WRITE_REGISTER_UCHAR((PUCHAR)j,
- READ_REGISTER_UCHAR((PUCHAR)j + i));
+ WRITE_REGISTER_UCHAR(UlongToPtr(j),
+ READ_REGISTER_UCHAR(UlongToPtr(j + i)));
/* Move to the next memory location to write to */
j++;
__outpw(0x3CE, 7);
/* Calculate pixel position for the read */
- Offset = VgaBase + (Top * 80) + (PUCHAR)LeftOffset;
+ Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)LeftOffset;
/* Select the bitmask register and write the mask */
__outpw(0x3CE, (USHORT)lMask);
if (Distance)
{
/* Calculate new pixel position */
- Offset = VgaBase + (Top * 80) + (PUCHAR)RightOffset;
+ Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)RightOffset;
Distance--;
/* Select the bitmask register and write the mask */
if (Distance)
{
/* Calculate new pixel position */
- Offset = VgaBase + (Top * 80) + (PUCHAR)(LeftOffset + 1);
+ Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)(LeftOffset + 1);
/* Set the bitmask to 0xFF for all 4 planes */
__outpw(0x3CE, 0xFF08);