Commit 1534272158814dbd860d0ab98e76a6fdaa0d5857

Authored by aurel32
1 parent 8dd3dca3

Fix spurious VGA updates

(Samuel Thibault)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4328 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 10 additions and 2 deletions
hw/vga.c
@@ -1418,7 +1418,7 @@ void vga_invalidate_scanlines(VGAState *s, int y1, int y2) @@ -1418,7 +1418,7 @@ void vga_invalidate_scanlines(VGAState *s, int y1, int y2)
1418 static void vga_draw_graphic(VGAState *s, int full_update) 1418 static void vga_draw_graphic(VGAState *s, int full_update)
1419 { 1419 {
1420 int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask; 1420 int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask;
1421 - int width, height, shift_control, line_offset, page0, page1, bwidth; 1421 + int width, height, shift_control, line_offset, page0, page1, bwidth, bits;
1422 int disp_width, multi_scan, multi_run; 1422 int disp_width, multi_scan, multi_run;
1423 uint8_t *d; 1423 uint8_t *d;
1424 uint32_t v, addr1, addr; 1424 uint32_t v, addr1, addr;
@@ -1454,6 +1454,7 @@ static void vga_draw_graphic(VGAState *s, int full_update) @@ -1454,6 +1454,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
1454 } else { 1454 } else {
1455 v = VGA_DRAW_LINE4; 1455 v = VGA_DRAW_LINE4;
1456 } 1456 }
  1457 + bits = 4;
1457 } else if (shift_control == 1) { 1458 } else if (shift_control == 1) {
1458 full_update |= update_palette16(s); 1459 full_update |= update_palette16(s);
1459 if (s->sr[0x01] & 8) { 1460 if (s->sr[0x01] & 8) {
@@ -1462,28 +1463,35 @@ static void vga_draw_graphic(VGAState *s, int full_update) @@ -1462,28 +1463,35 @@ static void vga_draw_graphic(VGAState *s, int full_update)
1462 } else { 1463 } else {
1463 v = VGA_DRAW_LINE2; 1464 v = VGA_DRAW_LINE2;
1464 } 1465 }
  1466 + bits = 4;
1465 } else { 1467 } else {
1466 switch(s->get_bpp(s)) { 1468 switch(s->get_bpp(s)) {
1467 default: 1469 default:
1468 case 0: 1470 case 0:
1469 full_update |= update_palette256(s); 1471 full_update |= update_palette256(s);
1470 v = VGA_DRAW_LINE8D2; 1472 v = VGA_DRAW_LINE8D2;
  1473 + bits = 4;
1471 break; 1474 break;
1472 case 8: 1475 case 8:
1473 full_update |= update_palette256(s); 1476 full_update |= update_palette256(s);
1474 v = VGA_DRAW_LINE8; 1477 v = VGA_DRAW_LINE8;
  1478 + bits = 8;
1475 break; 1479 break;
1476 case 15: 1480 case 15:
1477 v = VGA_DRAW_LINE15; 1481 v = VGA_DRAW_LINE15;
  1482 + bits = 16;
1478 break; 1483 break;
1479 case 16: 1484 case 16:
1480 v = VGA_DRAW_LINE16; 1485 v = VGA_DRAW_LINE16;
  1486 + bits = 16;
1481 break; 1487 break;
1482 case 24: 1488 case 24:
1483 v = VGA_DRAW_LINE24; 1489 v = VGA_DRAW_LINE24;
  1490 + bits = 24;
1484 break; 1491 break;
1485 case 32: 1492 case 32:
1486 v = VGA_DRAW_LINE32; 1493 v = VGA_DRAW_LINE32;
  1494 + bits = 32;
1487 break; 1495 break;
1488 } 1496 }
1489 } 1497 }
@@ -1507,7 +1515,7 @@ static void vga_draw_graphic(VGAState *s, int full_update) @@ -1507,7 +1515,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
1507 width, height, v, line_offset, s->cr[9], s->cr[0x17], s->line_compare, s->sr[0x01]); 1515 width, height, v, line_offset, s->cr[9], s->cr[0x17], s->line_compare, s->sr[0x01]);
1508 #endif 1516 #endif
1509 addr1 = (s->start_addr * 4); 1517 addr1 = (s->start_addr * 4);
1510 - bwidth = width * 4; 1518 + bwidth = (width * bits + 7) / 8;
1511 y_start = -1; 1519 y_start = -1;
1512 page_min = 0x7fffffff; 1520 page_min = 0x7fffffff;
1513 page_max = -1; 1521 page_max = -1;