Revision a130a41e hw/vga.c
b/hw/vga.c | ||
---|---|---|
1301 | 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 | 1317 |
void vga_invalidate_scanlines(VGAState *s, int y1, int y2) |
1305 | 1318 |
{ |
1306 | 1319 |
int y; |
... | ... | |
1327 | 1340 |
|
1328 | 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 | 1344 |
disp_width = width; |
1336 | 1345 |
|
1337 | 1346 |
shift_control = (s->gr[0x05] >> 5) & 3; |
... | ... | |
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 | 1583 |
static void vga_reset(VGAState *s) |
1566 | 1584 |
{ |
1567 | 1585 |
memset(s, 0, sizeof(VGAState)); |
... | ... | |
1723 | 1741 |
s->ds = ds; |
1724 | 1742 |
s->get_bpp = vga_get_bpp; |
1725 | 1743 |
s->get_offsets = vga_get_offsets; |
1744 |
s->get_resolution = vga_get_resolution; |
|
1726 | 1745 |
/* XXX: currently needed for display */ |
1727 | 1746 |
vga_state = s; |
1728 | 1747 |
} |
... | ... | |
1875 | 1894 |
DisplayState *saved_ds, ds1, *ds = &ds1; |
1876 | 1895 |
|
1877 | 1896 |
/* XXX: this is a little hackish */ |
1878 |
s->last_width = -1; |
|
1879 |
s->last_height = -1; |
|
1897 |
vga_invalidate_display(); |
|
1880 | 1898 |
saved_ds = s->ds; |
1881 | 1899 |
|
1882 | 1900 |
memset(ds, 0, sizeof(DisplayState)); |
Also available in: Unified diff