Commit a07cf92aed58a1fbf03d9010e6a81258300be642

Authored by bellard
1 parent 01e3b763

multiscan/doublescan fix (malc)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@396 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 21 additions and 12 deletions
hw/vga.c
... ... @@ -1109,7 +1109,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
1109 1109 {
1110 1110 int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask;
1111 1111 int width, height, shift_control, line_offset, page0, page1, bwidth;
1112   - int disp_width;
  1112 + int disp_width, multi_scan, multi_run;
1113 1113 uint8_t *d;
1114 1114 uint32_t v, addr1, addr;
1115 1115 vga_draw_line_func *vga_draw_line;
... ... @@ -1124,10 +1124,13 @@ static void vga_draw_graphic(VGAState *s, int full_update)
1124 1124 disp_width = width;
1125 1125  
1126 1126 shift_control = (s->gr[0x05] >> 5) & 3;
1127   - if (shift_control > 1)
1128   - double_scan = ((s->cr[0x09] & 0x1f) != 0);
1129   - else
1130   - double_scan = (s->cr[0x09] & 0x80);
  1127 + double_scan = (s->cr[0x09] & 0x80);
  1128 + if (shift_control > 1) {
  1129 + multi_scan = (s->cr[0x09] & 0x1f);
  1130 + } else {
  1131 + multi_scan = 0;
  1132 + }
  1133 + multi_run = multi_scan;
1131 1134 if (shift_control != s->shift_control ||
1132 1135 double_scan != s->double_scan) {
1133 1136 full_update = 1;
... ... @@ -1212,14 +1215,20 @@ static void vga_draw_graphic(VGAState *s, int full_update)
1212 1215 y_start = -1;
1213 1216 }
1214 1217 }
1215   - if (!double_scan || (y & 1) != 0) {
1216   - if (y1 == s->line_compare) {
1217   - addr1 = 0;
1218   - } else {
1219   - mask = (s->cr[0x17] & 3) ^ 3;
1220   - if ((y1 & mask) == mask)
1221   - addr1 += line_offset;
  1218 + if (!multi_run) {
  1219 + if (!double_scan || (y & 1) != 0) {
  1220 + if (y1 == s->line_compare) {
  1221 + addr1 = 0;
  1222 + } else {
  1223 + mask = (s->cr[0x17] & 3) ^ 3;
  1224 + if ((y1 & mask) == mask)
  1225 + addr1 += line_offset;
  1226 + }
  1227 + y1++;
1222 1228 }
  1229 + multi_run = multi_scan;
  1230 + } else {
  1231 + multi_run--;
1223 1232 y1++;
1224 1233 }
1225 1234 d += linesize;
... ...