From e2368dc9684ae5cec2f0558be4803901a0b58b7b Mon Sep 17 00:00:00 2001 From: OGAWA Hirofumi Date: Mon, 19 Oct 2015 21:23:46 +0900 Subject: ui/curses: Support line graphics chars on -curses mode This converts vga code to curses code in console_write_bh(). With this changes, we can see line graphics (for example, dialog uses) correctly. Signed-off-by: OGAWA Hirofumi Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include/ui') diff --git a/include/ui/console.h b/include/ui/console.h index d887f91..c249db4 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -321,13 +321,23 @@ static inline pixman_format_code_t surface_format(DisplaySurface *s) #ifdef CONFIG_CURSES #include typedef chtype console_ch_t; +extern chtype vga_to_curses[]; #else typedef unsigned long console_ch_t; #endif static inline void console_write_ch(console_ch_t *dest, uint32_t ch) { - if (!(ch & 0xff)) + uint8_t c = ch; +#ifdef CONFIG_CURSES + if (vga_to_curses[c]) { + ch &= ~(console_ch_t)0xff; + ch |= vga_to_curses[c]; + } +#else + if (c == '\0') { ch |= ' '; + } +#endif *dest = ch; } -- cgit v1.1