aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2009-11-06 16:08:26 +0300
committermalc <av1474@comtv.ru>2009-11-06 16:08:41 +0300
commitcae334cd6b2aed62a2af82314da1b9eab06824d5 (patch)
tree770ab3c1345db8d2cc201c1bda97c1b932481b01 /hw
parentd1984194f3b9f794ca2e353b81680be235be89bf (diff)
downloadqemu-cae334cd6b2aed62a2af82314da1b9eab06824d5.zip
qemu-cae334cd6b2aed62a2af82314da1b9eab06824d5.tar.gz
qemu-cae334cd6b2aed62a2af82314da1b9eab06824d5.tar.bz2
vga: fix line comparison
Line counter doesn't wrap. Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'hw')
-rw-r--r--hw/vga.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/vga.c b/hw/vga.c
index 5d09037..899e66b 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1267,7 +1267,7 @@ static rgb_to_pixel_dup_func *rgb_to_pixel_dup_table[NB_DEPTHS] = {
static void vga_draw_text(VGACommonState *s, int full_update)
{
int cx, cy, cheight, cw, ch, cattr, height, width, ch_attr;
- int cx_min, cx_max, linesize, x_incr, line;
+ int cx_min, cx_max, linesize, x_incr, line, line1;
uint32_t offset, fgcol, bgcol, v, cursor_offset;
uint8_t *d1, *d, *src, *dest, *cursor_ptr;
const uint8_t *font_ptr, *font_base[2];
@@ -1420,14 +1420,12 @@ static void vga_draw_text(VGACommonState *s, int full_update)
(cx_max - cx_min + 1) * cw, cheight);
}
dest += linesize * cheight;
- if (line >= s->line_compare) {
- line -= s->line_compare;
+ line1 = line + cheight;
+ offset += line_offset;
+ if (line < s->line_compare && line1 >= s->line_compare) {
offset = 0;
}
- else {
- offset += line_offset;
- line += cheight;
- }
+ line = line1;
}
}