Revision 95219897 hw/vga.c

b/hw/vga.c
146 146
VGAState *vga_state;
147 147
int vga_io_memory;
148 148

  
149
static void vga_screen_dump(void *opaque, const char *filename);
150

  
149 151
static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
150 152
{
151 153
    VGAState *s = opaque;
......
1482 1484
#define GMODE_GRAPH    1
1483 1485
#define GMODE_BLANK 2 
1484 1486

  
1485
void vga_update_display(void)
1487
static void vga_update_display(void *opaque)
1486 1488
{
1487
    VGAState *s = vga_state;
1489
    VGAState *s = (VGAState *)opaque;
1488 1490
    int full_update, graphic_mode;
1489 1491

  
1490 1492
    if (s->ds->depth == 0) {
......
1532 1534
}
1533 1535

  
1534 1536
/* force a full display refresh */
1535
void vga_invalidate_display(void)
1537
static void vga_invalidate_display(void *opaque)
1536 1538
{
1537
    VGAState *s = vga_state;
1539
    VGAState *s = (VGAState *)opaque;
1538 1540
    
1539 1541
    s->last_width = -1;
1540 1542
    s->last_height = -1;
......
1698 1700
    s->get_bpp = vga_get_bpp;
1699 1701
    s->get_offsets = vga_get_offsets;
1700 1702
    s->get_resolution = vga_get_resolution;
1703
    graphic_console_init(s->ds, vga_update_display, vga_invalidate_display,
1704
                         vga_screen_dump, s);
1701 1705
    /* XXX: currently needed for display */
1702 1706
    vga_state = s;
1703 1707
}
......
1854 1858

  
1855 1859
/* save the vga display in a PPM image even if no display is
1856 1860
   available */
1857
void vga_screen_dump(const char *filename)
1861
static void vga_screen_dump(void *opaque, const char *filename)
1858 1862
{
1859
    VGAState *s = vga_state;
1863
    VGAState *s = (VGAState *)opaque;
1860 1864
    DisplayState *saved_ds, ds1, *ds = &ds1;
1861 1865
    
1862 1866
    /* XXX: this is a little hackish */
1863
    vga_invalidate_display();
1867
    vga_invalidate_display(s);
1864 1868
    saved_ds = s->ds;
1865 1869

  
1866 1870
    memset(ds, 0, sizeof(DisplayState));
......
1871 1875

  
1872 1876
    s->ds = ds;
1873 1877
    s->graphic_mode = -1;
1874
    vga_update_display();
1878
    vga_update_display(s);
1875 1879
    
1876 1880
    if (ds->data) {
1877 1881
        ppm_save(filename, ds->data, vga_save_w, vga_save_h, 

Also available in: Unified diff