mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
615220ddaf
commit
e2368dc968
2 changed files with 55 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue