static void vga_screen_dump_common(VGAState *s, const char *filename,

                                   int w, int h)

{

    DisplayState *saved_ds, ds1, *ds = &ds1;

    DisplayChangeListener dcl;



    /* XXX: this is a little hackish */

    vga_invalidate_display(s);

    saved_ds = s->ds;



    memset(ds, 0, sizeof(DisplayState));

    memset(&dcl, 0, sizeof(DisplayChangeListener));

    dcl.dpy_update = vga_save_dpy_update;

    dcl.dpy_resize = vga_save_dpy_resize;

    dcl.dpy_refresh = vga_save_dpy_refresh;

    register_displaychangelistener(ds, &dcl);


    ds->surface = qemu_create_displaysurface(ds, w, h);



    s->ds = ds;

    s->graphic_mode = -1;

    vga_update_display(s);



    ppm_save(filename, ds->surface);



    qemu_free_displaysurface(ds);

    s->ds = saved_ds;

}
static void vga_screen_dump_common(VGAState *s, const char *filename,

                                   int w, int h)

{

    DisplayState *saved_ds, ds1, *ds = &ds1;

    DisplayChangeListener dcl;



    

    vga_invalidate_display(s);

    saved_ds = s->ds;



    memset(ds, 0, sizeof(DisplayState));

    memset(&dcl, 0, sizeof(DisplayChangeListener));

    dcl.dpy_update = vga_save_dpy_update;

    dcl.dpy_resize = vga_save_dpy_resize;

    dcl.dpy_refresh = vga_save_dpy_refresh;

    register_displaychangelistener(ds, &dcl);


    ds->surface = qemu_create_displaysurface(ds, w, h);



    s->ds = ds;

    s->graphic_mode = -1;

    vga_update_display(s);



    ppm_save(filename, ds->surface);



    qemu_free_displaysurface(ds);

    s->ds = saved_ds;

}
static void FUNC_0(VGAState *VAR_0, const char *VAR_1,

                                   int VAR_2, int VAR_3)

{

    DisplayState *saved_ds, ds1, *ds = &ds1;

    DisplayChangeListener dcl;



    

    vga_invalidate_display(VAR_0);

    saved_ds = VAR_0->ds;



    memset(ds, 0, sizeof(DisplayState));

    memset(&dcl, 0, sizeof(DisplayChangeListener));

    dcl.dpy_update = vga_save_dpy_update;

    dcl.dpy_resize = vga_save_dpy_resize;

    dcl.dpy_refresh = vga_save_dpy_refresh;

    register_displaychangelistener(ds, &dcl);


    ds->surface = qemu_create_displaysurface(ds, VAR_2, VAR_3);



    VAR_0->ds = ds;

    VAR_0->graphic_mode = -1;

    vga_update_display(VAR_0);



    ppm_save(VAR_1, ds->surface);



    qemu_free_displaysurface(ds);

    VAR_0->ds = saved_ds;

}
static void FUNC_0(VGAState *VAR_0, const char *VAR_1,
int VAR_2, int VAR_3)
{ DisplayState *saved_ds, ds1, *ds = &ds1; DisplayChangeListener dcl; vga_invalidate_display(VAR_0); saved_ds = VAR_0->ds; memset(ds, 0, sizeof(DisplayState)); memset(&dcl, 0, sizeof(DisplayChangeListener)); dcl.dpy_update = vga_save_dpy_update; dcl.dpy_resize = vga_save_dpy_resize; dcl.dpy_refresh = vga_save_dpy_refresh; register_displaychangelistener(ds, &dcl); ds->surface = qemu_create_displaysurface(ds, VAR_2, VAR_3); VAR_0->ds = ds; VAR_0->graphic_mode = -1; vga_update_display(VAR_0); ppm_save(VAR_1, ds->surface); qemu_free_displaysurface(ds); VAR_0->ds = saved_ds; }