Fix spurious VGA updates

(Samuel Thibault)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4328 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aurel32 2008-05-04 13:11:53 +00:00
parent 8dd3dca351
commit 1534272158

View file

@ -1418,7 +1418,7 @@ void vga_invalidate_scanlines(VGAState *s, int y1, int y2)
static void vga_draw_graphic(VGAState *s, int full_update) static void vga_draw_graphic(VGAState *s, int full_update)
{ {
int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask; int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask;
int width, height, shift_control, line_offset, page0, page1, bwidth; int width, height, shift_control, line_offset, page0, page1, bwidth, bits;
int disp_width, multi_scan, multi_run; int disp_width, multi_scan, multi_run;
uint8_t *d; uint8_t *d;
uint32_t v, addr1, addr; uint32_t v, addr1, addr;
@ -1454,6 +1454,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
} else { } else {
v = VGA_DRAW_LINE4; v = VGA_DRAW_LINE4;
} }
bits = 4;
} else if (shift_control == 1) { } else if (shift_control == 1) {
full_update |= update_palette16(s); full_update |= update_palette16(s);
if (s->sr[0x01] & 8) { if (s->sr[0x01] & 8) {
@ -1462,28 +1463,35 @@ static void vga_draw_graphic(VGAState *s, int full_update)
} else { } else {
v = VGA_DRAW_LINE2; v = VGA_DRAW_LINE2;
} }
bits = 4;
} else { } else {
switch(s->get_bpp(s)) { switch(s->get_bpp(s)) {
default: default:
case 0: case 0:
full_update |= update_palette256(s); full_update |= update_palette256(s);
v = VGA_DRAW_LINE8D2; v = VGA_DRAW_LINE8D2;
bits = 4;
break; break;
case 8: case 8:
full_update |= update_palette256(s); full_update |= update_palette256(s);
v = VGA_DRAW_LINE8; v = VGA_DRAW_LINE8;
bits = 8;
break; break;
case 15: case 15:
v = VGA_DRAW_LINE15; v = VGA_DRAW_LINE15;
bits = 16;
break; break;
case 16: case 16:
v = VGA_DRAW_LINE16; v = VGA_DRAW_LINE16;
bits = 16;
break; break;
case 24: case 24:
v = VGA_DRAW_LINE24; v = VGA_DRAW_LINE24;
bits = 24;
break; break;
case 32: case 32:
v = VGA_DRAW_LINE32; v = VGA_DRAW_LINE32;
bits = 32;
break; break;
} }
} }
@ -1507,7 +1515,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
width, height, v, line_offset, s->cr[9], s->cr[0x17], s->line_compare, s->sr[0x01]); width, height, v, line_offset, s->cr[9], s->cr[0x17], s->line_compare, s->sr[0x01]);
#endif #endif
addr1 = (s->start_addr * 4); addr1 = (s->start_addr * 4);
bwidth = width * 4; bwidth = (width * bits + 7) / 8;
y_start = -1; y_start = -1;
page_min = 0x7fffffff; page_min = 0x7fffffff;
page_max = -1; page_max = -1;