summaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2009-11-06 03:46:12 +0300
committermalc <av1474@comtv.ru>2009-11-06 03:46:12 +0300
commitd1984194f3b9f794ca2e353b81680be235be89bf (patch)
tree4c242db6c3a9656a2989a9f2f0bc69a6c798a10d /hw/vga.c
parent3e6ba503400c34cbe0f9ad6e289921688bf303a3 (diff)
downloadqemu-d1984194f3b9f794ca2e353b81680be235be89bf.tar.gz
vga: Respect Line Compare Register in text modes
Unbreaks setup screen of Act1/PL Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/hw/vga.c b/hw/vga.c
index 95a7650f3c..5d09037811 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1267,9 +1267,9 @@ 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;
+ int cx_min, cx_max, linesize, x_incr, line;
uint32_t offset, fgcol, bgcol, v, cursor_offset;
- uint8_t *d1, *d, *src, *s1, *dest, *cursor_ptr;
+ uint8_t *d1, *d, *src, *dest, *cursor_ptr;
const uint8_t *font_ptr, *font_base[2];
int dup9, line_offset, depth_index;
uint32_t *palette;
@@ -1301,7 +1301,6 @@ static void vga_draw_text(VGACommonState *s, int full_update)
full_update |= update_basic_params(s);
line_offset = s->line_offset;
- s1 = s->vram_ptr + (s->start_addr * 4);
vga_get_text_resolution(s, &width, &height, &cw, &cheight);
x_incr = cw * ((ds_get_bits_per_pixel(s->ds) + 7) >> 3);
@@ -1354,9 +1353,11 @@ static void vga_draw_text(VGACommonState *s, int full_update)
dest = ds_get_data(s->ds);
linesize = ds_get_linesize(s->ds);
ch_attr_ptr = s->last_ch_attr;
+ line = 0;
+ offset = s->start_addr * 4;
for(cy = 0; cy < height; cy++) {
d1 = dest;
- src = s1;
+ src = s->vram_ptr + offset;
cx_min = width;
cx_max = -1;
for(cx = 0; cx < width; cx++) {
@@ -1419,7 +1420,14 @@ static void vga_draw_text(VGACommonState *s, int full_update)
(cx_max - cx_min + 1) * cw, cheight);
}
dest += linesize * cheight;
- s1 += line_offset;
+ if (line >= s->line_compare) {
+ line -= s->line_compare;
+ offset = 0;
+ }
+ else {
+ offset += line_offset;
+ line += cheight;
+ }
}
}