aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-11 00:09:42 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-11 00:09:42 +0000
commit5228c2d3b40d976f451831a8a8b3092c37f44747 (patch)
tree7ccc1c4058514b237845eb6866ba79cf5402cf51 /hw
parent29885477725df546145dd09678556e4551961cb3 (diff)
Force a resize after leaving graphical mode in curses (spotted by Samuel Thibault).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3978 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/vga.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/hw/vga.c b/hw/vga.c
index 99a31735a7..6474211dba 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1674,8 +1674,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
uint32_t *src;
console_ch_t *dst, val;
char msg_buffer[80];
- int full_update;
- full_update = 0;
+ int full_update = 0;
if (!(s->ar_index & 0x20)) {
graphic_mode = GMODE_BLANK;
@@ -1804,19 +1803,21 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
}
/* Display a message */
+ s->last_width = 60;
+ s->last_height = height = 3;
dpy_cursor(s->ds, -1, -1);
- dpy_resize(s->ds, 60, 3);
+ dpy_resize(s->ds, s->last_width, height);
- for (dst = chardata, i = 0; i < 60 * 3; i ++)
+ for (dst = chardata, i = 0; i < s->last_width * height; i ++)
console_write_ch(dst ++, ' ');
size = strlen(msg_buffer);
- width = (60 - size) / 2;
- dst = chardata + 60 + width;
+ width = (s->last_width - size) / 2;
+ dst = chardata + s->last_width + width;
for (i = 0; i < size; i ++)
console_write_ch(dst ++, 0x00200100 | msg_buffer[i]);
- dpy_update(s->ds, 0, 0, 60, 3);
+ dpy_update(s->ds, 0, 0, s->last_width, height);
}
static CPUReadMemoryFunc *vga_mem_read[3] = {