[coreboot] r3195 - trunk/payloads/libpayload/curses

svn at coreboot.org svn at coreboot.org
Sat Mar 29 17:13:22 CET 2008


Author: uwe
Date: 2008-03-29 17:13:22 +0100 (Sat, 29 Mar 2008)
New Revision: 3195

Modified:
   trunk/payloads/libpayload/curses/tinycurses.c
Log:
[libpayload] Work around sign-extending issue

Somewhere characters are getting sign-extended, meaning that the
attributes of the drawing chars (>= 128) are wrong. Cast the value
before sending it to VGA.

Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>



Modified: trunk/payloads/libpayload/curses/tinycurses.c
===================================================================
--- trunk/payloads/libpayload/curses/tinycurses.c	2008-03-29 01:35:21 UTC (rev 3194)
+++ trunk/payloads/libpayload/curses/tinycurses.c	2008-03-29 16:13:22 UTC (rev 3195)
@@ -580,7 +580,13 @@
 					c |= tmp << 12;
 				}
 
-				c |= win->_line[y].text[x].chars[0];
+				/*
+				 * FIXME: Somewhere along the line, the
+				 * character value is getting sign-extented.
+				 * For now grab just the 8 bit character,
+				 * but this will break wide characters!
+				 */
+				c |= (chtype) (win->_line[y].text[x].chars[0] & 0xff);
 				vga_putc(y, x, c);
 			}
 		}





More information about the coreboot mailing list