aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-01-24 13:24:41 +0000
committerMatt Fleming <matt.fleming@intel.com>2013-01-24 17:22:45 +0000
commit40a6839c9ed17518e5984f4ea3e5530cbcfeb4c3 (patch)
tree78120f9c58004b6d18feff7755a15de79979b0eb
parentb1d6dbbb4cf1784ebb8dff0d772b6bc2cb5c89e3 (diff)
downloadsyslinux-40a6839c9ed17518e5984f4ea3e5530cbcfeb4c3.tar.gz
syslinux-40a6839c9ed17518e5984f4ea3e5530cbcfeb4c3.tar.xz
syslinux-40a6839c9ed17518e5984f4ea3e5530cbcfeb4c3.zip
ldlinux: Don't update UsingVGA when we just want the value
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>
-rw-r--r--com32/elflink/ldlinux/msg.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/com32/elflink/ldlinux/msg.c b/com32/elflink/ldlinux/msg.c
index 46927168..6ce63685 100644
--- a/com32/elflink/ldlinux/msg.c
+++ b/com32/elflink/ldlinux/msg.c
@@ -42,13 +42,6 @@ int get_msg_file(char *filename)
if (ch == 0x1A)
break;
- /*
- * 01h = text mode
- * 02h = graphics mode
- */
- UsingVGA &= 0x1;
- UsingVGA += 1;
-
NextCharJump(ch); /* Do what shall be done */
}
@@ -149,12 +142,14 @@ static int convert_to_pcdisplay[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
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))