There was a bug introduced when this code was copied from the old 4.x
assembly implementation, we don't need to update UsingVGA everytime we
read a character, we only need its value when comparing it against the
DisplayMask.
This bug caused every other character to be displayed when only
writing to the text console, as well as other nasties such as making
syslinux_force_text_mode() think it's in VGA mode even when it's in
text mode.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
if (ch == 0x1A)
break;
- /*
- * 01h = text mode
- * 02h = graphics mode
- */
- UsingVGA &= 0x1;
- UsingVGA += 1;
-
NextCharJump(ch); /* Do what shall be done */
}
static void msg_normal(uint8_t data)
{
uint8_t bg, fg;
+ uint8_t mask = UsingVGA & 0x1;
/* Write to serial port */
if (DisplayMask & 0x4)
write_serial(data);
- if (!(DisplayMask & UsingVGA))
+ /* 0x1 = text mode, 0x2 = graphics mode */
+ if (!(DisplayMask & ++mask))
return; /* Not screen */
if (!(DisplayCon & 0x01))