void vga_hw_screen_dump(const char *filename)
{
TextConsole *previous_active_console;
+ bool cswitch;
previous_active_console = active_console;
+ cswitch = previous_active_console && previous_active_console->index != 0;
/* There is currently no way of specifying which screen we want to dump,
so always dump the first one. */
- console_select(0);
+ if (cswitch) {
+ console_select(0);
+ }
if (consoles[0] && consoles[0]->hw_screen_dump) {
- consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
+ consoles[0]->hw_screen_dump(consoles[0]->hw, filename, cswitch);
} else {
error_report("screen dump not implemented");
}
- if (previous_active_console) {
+ if (cswitch) {
console_select(previous_active_console->index);
}
}
typedef void (*vga_hw_update_ptr)(void *);
typedef void (*vga_hw_invalidate_ptr)(void *);
-typedef void (*vga_hw_screen_dump_ptr)(void *, const char *);
+typedef void (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch);
typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *);
DisplayState *graphic_console_init(vga_hw_update_ptr update,
s->my[1] = 0;
}
-static void blizzard_screen_dump(void *opaque, const char *filename) {
+static void blizzard_screen_dump(void *opaque, const char *filename,
+ bool cswitch)
+{
BlizzardState *s = (BlizzardState *) opaque;
- blizzard_update_display(opaque);
+ if (cswitch) {
+ blizzard_update_display(opaque);
+ }
if (s && ds_get_data(s->state))
ppm_save(filename, s->state->surface);
}
g364fb_invalidate_display(s);
}
-static void g364fb_screen_dump(void *opaque, const char *filename)
+static void g364fb_screen_dump(void *opaque, const char *filename, bool cswitch)
{
G364State *s = opaque;
int y, x;
return 0;
}
-static void omap_screen_dump(void *opaque, const char *filename) {
+static void omap_screen_dump(void *opaque, const char *filename, bool cswitch)
+{
struct omap_lcd_panel_s *omap_lcd = opaque;
- omap_update_display(opaque);
+ if (cswitch) {
+ omap_update_display(opaque);
+ }
if (omap_lcd && ds_get_data(omap_lcd->state))
ppm_save(filename, ds_get_data(omap_lcd->state),
omap_lcd->width, omap_lcd->height,
vga->invalidate(vga);
}
-static void qxl_hw_screen_dump(void *opaque, const char *filename)
+static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch)
{
PCIQXLDevice *qxl = opaque;
VGACommonState *vga = &qxl->vga;
ppm_save(filename, qxl->ssd.ds->surface);
break;
case QXL_MODE_VGA:
- vga->screen_dump(vga, filename);
+ vga->screen_dump(vga, filename, cswitch);
break;
default:
break;
uint8_t dac_index, dac_state;
} TCXState;
-static void tcx_screen_dump(void *opaque, const char *filename);
-static void tcx24_screen_dump(void *opaque, const char *filename);
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch);
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch);
static void tcx_set_dirty(TCXState *s)
{
return 0;
}
-static void tcx_screen_dump(void *opaque, const char *filename)
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch)
{
TCXState *s = opaque;
FILE *f;
return;
}
-static void tcx24_screen_dump(void *opaque, const char *filename)
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch)
{
TCXState *s = opaque;
FILE *f;
static uint16_t expand2[256];
static uint8_t expand4to8[16];
-static void vga_screen_dump(void *opaque, const char *filename);
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch);
static void vga_update_memory_access(VGACommonState *s)
{
/* save the vga display in a PPM image even if no display is
available */
-static void vga_screen_dump(void *opaque, const char *filename)
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch)
{
VGACommonState *s = opaque;
- vga_invalidate_display(s);
- vga_hw_update();
+ if (cswitch) {
+ vga_invalidate_display(s);
+ vga_hw_update();
+ }
ppm_save(filename, s->ds->surface);
}
/* save the vga display in a PPM image even if no display is
available */
-static void vmsvga_screen_dump(void *opaque, const char *filename)
+static void vmsvga_screen_dump(void *opaque, const char *filename, bool cswitch)
{
struct vmsvga_state_s *s = opaque;
if (!s->enable) {
- s->vga.screen_dump(&s->vga, filename);
+ s->vga.screen_dump(&s->vga, filename, cswitch);
return;
}