Commit d63d307f6e00856dae25e9cd3d96bc0ba31ff107
1 parent
487be8a1
-loadvm and -full-screen options
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1090 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
5 changed files
with
34 additions
and
5 deletions
Changelog
@@ -19,6 +19,7 @@ version 0.6.1: | @@ -19,6 +19,7 @@ version 0.6.1: | ||
19 | - DHCP fix for Windows (accept DHCPREQUEST alone) | 19 | - DHCP fix for Windows (accept DHCPREQUEST alone) |
20 | - SPARC system emulation (Blue Swirl) | 20 | - SPARC system emulation (Blue Swirl) |
21 | - Automatic Samba configuration for host file access from Windows. | 21 | - Automatic Samba configuration for host file access from Windows. |
22 | + - '-loadvm' and '-full-screen' options | ||
22 | 23 | ||
23 | version 0.6.0: | 24 | version 0.6.0: |
24 | 25 |
qemu-doc.texi
@@ -199,6 +199,9 @@ Set the real time clock to local time (the default is to UTC | @@ -199,6 +199,9 @@ Set the real time clock to local time (the default is to UTC | ||
199 | time). This option is needed to have correct date in MS-DOS or | 199 | time). This option is needed to have correct date in MS-DOS or |
200 | Windows. | 200 | Windows. |
201 | 201 | ||
202 | +@item -full-screen | ||
203 | +Start in full screen. | ||
204 | + | ||
202 | @end table | 205 | @end table |
203 | 206 | ||
204 | Network options: | 207 | Network options: |
@@ -345,7 +348,8 @@ Simulate an ISA-only system (default is PCI system). | @@ -345,7 +348,8 @@ Simulate an ISA-only system (default is PCI system). | ||
345 | @item -std-vga | 348 | @item -std-vga |
346 | Simulate a standard VGA card with Bochs VBE extensions (default is | 349 | Simulate a standard VGA card with Bochs VBE extensions (default is |
347 | Cirrus Logic GD5446 PCI VGA) | 350 | Cirrus Logic GD5446 PCI VGA) |
348 | - | 351 | +@item -loadvm file |
352 | +Start right away with a saved state (@code{loadvm} in monitor) | ||
349 | @end table | 353 | @end table |
350 | 354 | ||
351 | @c man end | 355 | @c man end |
sdl.c
@@ -40,6 +40,7 @@ static int gui_saved_grab; | @@ -40,6 +40,7 @@ static int gui_saved_grab; | ||
40 | static int gui_fullscreen; | 40 | static int gui_fullscreen; |
41 | static int gui_key_modifier_pressed; | 41 | static int gui_key_modifier_pressed; |
42 | static int gui_keysym; | 42 | static int gui_keysym; |
43 | +static int gui_fullscreen_initial_grab; | ||
43 | 44 | ||
44 | static void sdl_update(DisplayState *ds, int x, int y, int w, int h) | 45 | static void sdl_update(DisplayState *ds, int x, int y, int w, int h) |
45 | { | 46 | { |
@@ -525,7 +526,8 @@ static void sdl_refresh(DisplayState *ds) | @@ -525,7 +526,8 @@ static void sdl_refresh(DisplayState *ds) | ||
525 | } | 526 | } |
526 | break; | 527 | break; |
527 | case SDL_ACTIVEEVENT: | 528 | case SDL_ACTIVEEVENT: |
528 | - if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0) { | 529 | + if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 && |
530 | + !gui_fullscreen_initial_grab) { | ||
529 | sdl_grab_end(); | 531 | sdl_grab_end(); |
530 | } | 532 | } |
531 | break; | 533 | break; |
@@ -540,7 +542,7 @@ static void sdl_cleanup(void) | @@ -540,7 +542,7 @@ static void sdl_cleanup(void) | ||
540 | SDL_Quit(); | 542 | SDL_Quit(); |
541 | } | 543 | } |
542 | 544 | ||
543 | -void sdl_display_init(DisplayState *ds) | 545 | +void sdl_display_init(DisplayState *ds, int full_screen) |
544 | { | 546 | { |
545 | int flags; | 547 | int flags; |
546 | 548 | ||
@@ -566,4 +568,9 @@ void sdl_display_init(DisplayState *ds) | @@ -566,4 +568,9 @@ void sdl_display_init(DisplayState *ds) | ||
566 | gui_grab = 0; | 568 | gui_grab = 0; |
567 | 569 | ||
568 | atexit(sdl_cleanup); | 570 | atexit(sdl_cleanup); |
571 | + if (full_screen) { | ||
572 | + gui_fullscreen = 1; | ||
573 | + gui_fullscreen_initial_grab = 1; | ||
574 | + sdl_grab_start(); | ||
575 | + } | ||
569 | } | 576 | } |
vl.c
@@ -129,6 +129,7 @@ int cirrus_vga_enabled = 1; | @@ -129,6 +129,7 @@ int cirrus_vga_enabled = 1; | ||
129 | int graphic_width = 800; | 129 | int graphic_width = 800; |
130 | int graphic_height = 600; | 130 | int graphic_height = 600; |
131 | int graphic_depth = 15; | 131 | int graphic_depth = 15; |
132 | +int full_screen = 0; | ||
132 | TextConsole *vga_console; | 133 | TextConsole *vga_console; |
133 | CharDriverState *serial_hds[MAX_SERIAL_PORTS]; | 134 | CharDriverState *serial_hds[MAX_SERIAL_PORTS]; |
134 | 135 | ||
@@ -2505,6 +2506,7 @@ void help(void) | @@ -2505,6 +2506,7 @@ void help(void) | ||
2505 | "-nographic disable graphical output and redirect serial I/Os to console\n" | 2506 | "-nographic disable graphical output and redirect serial I/Os to console\n" |
2506 | "-enable-audio enable audio support\n" | 2507 | "-enable-audio enable audio support\n" |
2507 | "-localtime set the real time clock to local time [default=utc]\n" | 2508 | "-localtime set the real time clock to local time [default=utc]\n" |
2509 | + "-full-screen start in full screen\n" | ||
2508 | #ifdef TARGET_PPC | 2510 | #ifdef TARGET_PPC |
2509 | "-prep Simulate a PREP system (default is PowerMAC)\n" | 2511 | "-prep Simulate a PREP system (default is PowerMAC)\n" |
2510 | "-g WxH[xDEPTH] Set the initial VGA graphic mode\n" | 2512 | "-g WxH[xDEPTH] Set the initial VGA graphic mode\n" |
@@ -2548,6 +2550,7 @@ void help(void) | @@ -2548,6 +2550,7 @@ void help(void) | ||
2548 | "-std-vga simulate a standard VGA card with VESA Bochs Extensions\n" | 2550 | "-std-vga simulate a standard VGA card with VESA Bochs Extensions\n" |
2549 | " (default is CL-GD5446 PCI VGA)\n" | 2551 | " (default is CL-GD5446 PCI VGA)\n" |
2550 | #endif | 2552 | #endif |
2553 | + "-loadvm file start right away with a saved state (loadvm in monitor)\n" | ||
2551 | "\n" | 2554 | "\n" |
2552 | "During emulation, the following keys are useful:\n" | 2555 | "During emulation, the following keys are useful:\n" |
2553 | "ctrl-shift-f toggle full screen\n" | 2556 | "ctrl-shift-f toggle full screen\n" |
@@ -2622,6 +2625,8 @@ enum { | @@ -2622,6 +2625,8 @@ enum { | ||
2622 | QEMU_OPTION_std_vga, | 2625 | QEMU_OPTION_std_vga, |
2623 | QEMU_OPTION_monitor, | 2626 | QEMU_OPTION_monitor, |
2624 | QEMU_OPTION_serial, | 2627 | QEMU_OPTION_serial, |
2628 | + QEMU_OPTION_loadvm, | ||
2629 | + QEMU_OPTION_full_screen, | ||
2625 | }; | 2630 | }; |
2626 | 2631 | ||
2627 | typedef struct QEMUOption { | 2632 | typedef struct QEMUOption { |
@@ -2680,6 +2685,8 @@ const QEMUOption qemu_options[] = { | @@ -2680,6 +2685,8 @@ const QEMUOption qemu_options[] = { | ||
2680 | { "std-vga", 0, QEMU_OPTION_std_vga }, | 2685 | { "std-vga", 0, QEMU_OPTION_std_vga }, |
2681 | { "monitor", 1, QEMU_OPTION_monitor }, | 2686 | { "monitor", 1, QEMU_OPTION_monitor }, |
2682 | { "serial", 1, QEMU_OPTION_serial }, | 2687 | { "serial", 1, QEMU_OPTION_serial }, |
2688 | + { "loadvm", HAS_ARG, QEMU_OPTION_loadvm }, | ||
2689 | + { "full-screen", 0, QEMU_OPTION_full_screen }, | ||
2683 | 2690 | ||
2684 | /* temporary options */ | 2691 | /* temporary options */ |
2685 | { "pci", 0, QEMU_OPTION_pci }, | 2692 | { "pci", 0, QEMU_OPTION_pci }, |
@@ -2759,6 +2766,7 @@ int main(int argc, char **argv) | @@ -2759,6 +2766,7 @@ int main(int argc, char **argv) | ||
2759 | char monitor_device[128]; | 2766 | char monitor_device[128]; |
2760 | char serial_devices[MAX_SERIAL_PORTS][128]; | 2767 | char serial_devices[MAX_SERIAL_PORTS][128]; |
2761 | int serial_device_index; | 2768 | int serial_device_index; |
2769 | + const char *loadvm = NULL; | ||
2762 | 2770 | ||
2763 | #if !defined(CONFIG_SOFTMMU) | 2771 | #if !defined(CONFIG_SOFTMMU) |
2764 | /* we never want that malloc() uses mmap() */ | 2772 | /* we never want that malloc() uses mmap() */ |
@@ -3080,6 +3088,12 @@ int main(int argc, char **argv) | @@ -3080,6 +3088,12 @@ int main(int argc, char **argv) | ||
3080 | sizeof(serial_devices[0]), optarg); | 3088 | sizeof(serial_devices[0]), optarg); |
3081 | serial_device_index++; | 3089 | serial_device_index++; |
3082 | break; | 3090 | break; |
3091 | + case QEMU_OPTION_loadvm: | ||
3092 | + loadvm = optarg; | ||
3093 | + break; | ||
3094 | + case QEMU_OPTION_full_screen: | ||
3095 | + full_screen = 1; | ||
3096 | + break; | ||
3083 | } | 3097 | } |
3084 | } | 3098 | } |
3085 | } | 3099 | } |
@@ -3264,7 +3278,7 @@ int main(int argc, char **argv) | @@ -3264,7 +3278,7 @@ int main(int argc, char **argv) | ||
3264 | dumb_display_init(ds); | 3278 | dumb_display_init(ds); |
3265 | } else { | 3279 | } else { |
3266 | #ifdef CONFIG_SDL | 3280 | #ifdef CONFIG_SDL |
3267 | - sdl_display_init(ds); | 3281 | + sdl_display_init(ds, full_screen); |
3268 | #else | 3282 | #else |
3269 | dumb_display_init(ds); | 3283 | dumb_display_init(ds); |
3270 | #endif | 3284 | #endif |
@@ -3365,6 +3379,9 @@ int main(int argc, char **argv) | @@ -3365,6 +3379,9 @@ int main(int argc, char **argv) | ||
3365 | } | 3379 | } |
3366 | } else | 3380 | } else |
3367 | #endif | 3381 | #endif |
3382 | + if (loadvm) | ||
3383 | + qemu_loadvm(loadvm); | ||
3384 | + | ||
3368 | { | 3385 | { |
3369 | /* XXX: simplify init */ | 3386 | /* XXX: simplify init */ |
3370 | read_passwords(); | 3387 | read_passwords(); |
vl.h
@@ -537,7 +537,7 @@ void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base, | @@ -537,7 +537,7 @@ void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base, | ||
537 | unsigned long vga_ram_offset, int vga_ram_size); | 537 | unsigned long vga_ram_offset, int vga_ram_size); |
538 | 538 | ||
539 | /* sdl.c */ | 539 | /* sdl.c */ |
540 | -void sdl_display_init(DisplayState *ds); | 540 | +void sdl_display_init(DisplayState *ds, int full_screen); |
541 | 541 | ||
542 | /* ide.c */ | 542 | /* ide.c */ |
543 | #define MAX_DISKS 4 | 543 | #define MAX_DISKS 4 |