From 0e122af46553c394b1ac4c38dd83ab01c7c34a9c Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Sat, 29 Mar 2008 16:13:22 +0000 Subject: [PATCH] [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 Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3195 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/curses/tinycurses.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/payloads/libpayload/curses/tinycurses.c b/payloads/libpayload/curses/tinycurses.c index 776ff16042..5e707c47db 100644 --- a/payloads/libpayload/curses/tinycurses.c +++ b/payloads/libpayload/curses/tinycurses.c @@ -580,7 +580,13 @@ int wnoutrefresh(WINDOW *win) 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); } }