Commit a130a41e69bd0d71574fa7c5b955f3850496fe76

Authored by bellard
1 parent 78e127ef

interlace support


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@915 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 28 additions and 7 deletions
hw/vga.c
@@ -1301,6 +1301,19 @@ static int vga_get_bpp(VGAState *s) @@ -1301,6 +1301,19 @@ static int vga_get_bpp(VGAState *s)
1301 return ret; 1301 return ret;
1302 } 1302 }
1303 1303
  1304 +static void vga_get_resolution(VGAState *s, int *pwidth, int *pheight)
  1305 +{
  1306 + int width, height;
  1307 +
  1308 + width = (s->cr[0x01] + 1) * 8;
  1309 + height = s->cr[0x12] |
  1310 + ((s->cr[0x07] & 0x02) << 7) |
  1311 + ((s->cr[0x07] & 0x40) << 3);
  1312 + height = (height + 1);
  1313 + *pwidth = width;
  1314 + *pheight = height;
  1315 +}
  1316 +
1304 void vga_invalidate_scanlines(VGAState *s, int y1, int y2) 1317 void vga_invalidate_scanlines(VGAState *s, int y1, int y2)
1305 { 1318 {
1306 int y; 1319 int y;
@@ -1327,11 +1340,7 @@ static void vga_draw_graphic(VGAState *s, int full_update) @@ -1327,11 +1340,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
1327 1340
1328 full_update |= update_basic_params(s); 1341 full_update |= update_basic_params(s);
1329 1342
1330 - width = (s->cr[0x01] + 1) * 8;  
1331 - height = s->cr[0x12] |  
1332 - ((s->cr[0x07] & 0x02) << 7) |  
1333 - ((s->cr[0x07] & 0x40) << 3);  
1334 - height = (height + 1); 1343 + s->get_resolution(s, &width, &height);
1335 disp_width = width; 1344 disp_width = width;
1336 1345
1337 shift_control = (s->gr[0x05] >> 5) & 3; 1346 shift_control = (s->gr[0x05] >> 5) & 3;
@@ -1562,6 +1571,15 @@ void vga_update_display(void) @@ -1562,6 +1571,15 @@ void vga_update_display(void)
1562 } 1571 }
1563 } 1572 }
1564 1573
  1574 +/* force a full display refresh */
  1575 +void vga_invalidate_display(void)
  1576 +{
  1577 + VGAState *s = vga_state;
  1578 +
  1579 + s->last_width = -1;
  1580 + s->last_height = -1;
  1581 +}
  1582 +
1565 static void vga_reset(VGAState *s) 1583 static void vga_reset(VGAState *s)
1566 { 1584 {
1567 memset(s, 0, sizeof(VGAState)); 1585 memset(s, 0, sizeof(VGAState));
@@ -1723,6 +1741,7 @@ void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base, @@ -1723,6 +1741,7 @@ void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
1723 s->ds = ds; 1741 s->ds = ds;
1724 s->get_bpp = vga_get_bpp; 1742 s->get_bpp = vga_get_bpp;
1725 s->get_offsets = vga_get_offsets; 1743 s->get_offsets = vga_get_offsets;
  1744 + s->get_resolution = vga_get_resolution;
1726 /* XXX: currently needed for display */ 1745 /* XXX: currently needed for display */
1727 vga_state = s; 1746 vga_state = s;
1728 } 1747 }
@@ -1875,8 +1894,7 @@ void vga_screen_dump(const char *filename) @@ -1875,8 +1894,7 @@ void vga_screen_dump(const char *filename)
1875 DisplayState *saved_ds, ds1, *ds = &ds1; 1894 DisplayState *saved_ds, ds1, *ds = &ds1;
1876 1895
1877 /* XXX: this is a little hackish */ 1896 /* XXX: this is a little hackish */
1878 - s->last_width = -1;  
1879 - s->last_height = -1; 1897 + vga_invalidate_display();
1880 saved_ds = s->ds; 1898 saved_ds = s->ds;
1881 1899
1882 memset(ds, 0, sizeof(DisplayState)); 1900 memset(ds, 0, sizeof(DisplayState));
hw/vga_int.h
@@ -103,6 +103,9 @@ @@ -103,6 +103,9 @@
103 void (*get_offsets)(struct VGAState *s, \ 103 void (*get_offsets)(struct VGAState *s, \
104 uint32_t *pline_offset, \ 104 uint32_t *pline_offset, \
105 uint32_t *pstart_addr); \ 105 uint32_t *pstart_addr); \
  106 + void (*get_resolution)(struct VGAState *s, \
  107 + int *pwidth, \
  108 + int *pheight); \
106 VGA_STATE_COMMON_BOCHS_VBE \ 109 VGA_STATE_COMMON_BOCHS_VBE \
107 /* display refresh support */ \ 110 /* display refresh support */ \
108 DisplayState *ds; \ 111 DisplayState *ds; \