diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-02-10 22:37:56 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-02-10 22:37:56 +0000 |
commit | ed8276ac7e7e4d18cbb37ee3069f3fc2f08ca1c7 (patch) | |
tree | 7f805f671d04405ee6732dbb8253070f061ec622 /console.c | |
parent | dbcf5e82debb5d1901546705cb10a2fd34b59a99 (diff) |
Serial console improvements, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2412 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'console.c')
-rw-r--r-- | console.c | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -533,21 +533,24 @@ static void console_show_cursor(TextConsole *s, int show) int y, y1; if (s == active_console) { + int x = s->x; + if (x >= s->width) { + x = s->width - 1; + } y1 = (s->y_base + s->y) % s->total_height; y = y1 - s->y_displayed; if (y < 0) y += s->total_height; if (y < s->height) { - c = &s->cells[y1 * s->width + s->x]; + c = &s->cells[y1 * s->width + x]; if (show) { TextAttributes t_attrib = s->t_attrib_default; t_attrib.invers = !(t_attrib.invers); /* invert fg and bg */ - vga_putcharxy(s->ds, s->x, y, c->ch, &t_attrib); + vga_putcharxy(s->ds, x, y, c->ch, &t_attrib); } else { - vga_putcharxy(s->ds, s->x, y, c->ch, - &(c->t_attrib)); + vga_putcharxy(s->ds, x, y, c->ch, &(c->t_attrib)); } - dpy_update(s->ds, s->x * FONT_WIDTH, y * FONT_HEIGHT, + dpy_update(s->ds, x * FONT_WIDTH, y * FONT_HEIGHT, FONT_WIDTH, FONT_HEIGHT); } } @@ -796,8 +799,10 @@ static void console_putchar(TextConsole *s, int ch) s->state = TTY_STATE_ESC; break; default: - if (s->x >= s->width - 1) { - break; + if (s->x >= s->width) { + /* line wrap */ + s->x = 0; + console_put_lf(s); } y1 = (s->y_base + s->y) % s->total_height; c = &s->cells[y1 * s->width + s->x]; @@ -805,12 +810,6 @@ static void console_putchar(TextConsole *s, int ch) c->t_attrib = s->t_attrib; update_xy(s, s->x, s->y); s->x++; -#if 0 /* line wrap disabled */ - if (s->x >= s->width) { - s->x = 0; - console_put_lf(s); - } -#endif break; } break; |