summary refs log tree commit diff stats
path: root/include/ui/console.h
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2015-10-19 21:23:46 +0900
committerGerd Hoffmann <kraxel@redhat.com>2015-11-03 10:12:46 +0100
commite2368dc9684ae5cec2f0558be4803901a0b58b7b (patch)
treeca7ab33ac08acac97aa25e1ae5b89e8a4fa67b74 /include/ui/console.h
parent615220ddaf23db4c5686053257c568b46967e4b5 (diff)
downloadfocaccia-qemu-e2368dc9684ae5cec2f0558be4803901a0b58b7b.tar.gz
focaccia-qemu-e2368dc9684ae5cec2f0558be4803901a0b58b7b.zip
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 <hirofumi@mail.parknet.co.jp>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'include/ui/console.h')
-rw-r--r--include/ui/console.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/ui/console.h b/include/ui/console.h
index d887f911f3..c249db4f7c 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 <curses.h>
 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;
 }