diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2011-01-04 21:58:24 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2011-01-04 21:58:24 +0100 |
commit | 9ae19b657ee20f4d03bdca8dbf367b932801ac93 (patch) | |
tree | a589f32a77453e19979a42abceab9dd6356ac528 /hw/vga.c | |
parent | 8a7d0890acd03f45f1d86e12449938891ae18ed9 (diff) | |
download | qemu-9ae19b657ee20f4d03bdca8dbf367b932801ac93.zip qemu-9ae19b657ee20f4d03bdca8dbf367b932801ac93.tar.gz qemu-9ae19b657ee20f4d03bdca8dbf367b932801ac93.tar.bz2 |
Fix curses on big endian hosts
On big endian hosts, the curses interface is unusable: the emulated
graphic card only displays garbage, while the monitor interface displays
nothing (or rather only spaces).
The curses interface is waiting for data in native endianness, so
console_write_ch() should not do any conversion. The conversion should
be done when reading the video buffer in hw/vga.c. I supposed this
buffer is in little endian mode, though it's not impossible that the
data is actually in guest endianness. I currently have no big endian
guest to way (they all switch to graphic mode immediately).
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/vga.c')
-rw-r--r-- | hw/vga.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2073,14 +2073,14 @@ static void vga_update_text(void *opaque, console_ch_t *chardata) if (full_update) { for (i = 0; i < size; src ++, dst ++, i ++) - console_write_ch(dst, VMEM2CHTYPE(*src)); + console_write_ch(dst, VMEM2CHTYPE(le32_to_cpu(*src))); dpy_update(s->ds, 0, 0, width, height); } else { c_max = 0; for (i = 0; i < size; src ++, dst ++, i ++) { - console_write_ch(&val, VMEM2CHTYPE(*src)); + console_write_ch(&val, VMEM2CHTYPE(le32_to_cpu(*src))); if (*dst != val) { *dst = val; c_max = i; @@ -2089,7 +2089,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata) } c_min = i; for (; i < size; src ++, dst ++, i ++) { - console_write_ch(&val, VMEM2CHTYPE(*src)); + console_write_ch(&val, VMEM2CHTYPE(le32_to_cpu(*src))); if (*dst != val) { *dst = val; c_max = i; |