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
qemu-doc.texi
... | ... | @@ -199,6 +199,9 @@ Set the real time clock to local time (the default is to UTC |
199 | 199 | time). This option is needed to have correct date in MS-DOS or |
200 | 200 | Windows. |
201 | 201 | |
202 | +@item -full-screen | |
203 | +Start in full screen. | |
204 | + | |
202 | 205 | @end table |
203 | 206 | |
204 | 207 | Network options: |
... | ... | @@ -345,7 +348,8 @@ Simulate an ISA-only system (default is PCI system). |
345 | 348 | @item -std-vga |
346 | 349 | Simulate a standard VGA card with Bochs VBE extensions (default is |
347 | 350 | Cirrus Logic GD5446 PCI VGA) |
348 | - | |
351 | +@item -loadvm file | |
352 | +Start right away with a saved state (@code{loadvm} in monitor) | |
349 | 353 | @end table |
350 | 354 | |
351 | 355 | @c man end | ... | ... |
sdl.c
... | ... | @@ -40,6 +40,7 @@ static int gui_saved_grab; |
40 | 40 | static int gui_fullscreen; |
41 | 41 | static int gui_key_modifier_pressed; |
42 | 42 | static int gui_keysym; |
43 | +static int gui_fullscreen_initial_grab; | |
43 | 44 | |
44 | 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 | 526 | } |
526 | 527 | break; |
527 | 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 | 531 | sdl_grab_end(); |
530 | 532 | } |
531 | 533 | break; |
... | ... | @@ -540,7 +542,7 @@ static void sdl_cleanup(void) |
540 | 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 | 547 | int flags; |
546 | 548 | |
... | ... | @@ -566,4 +568,9 @@ void sdl_display_init(DisplayState *ds) |
566 | 568 | gui_grab = 0; |
567 | 569 | |
568 | 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 | 129 | int graphic_width = 800; |
130 | 130 | int graphic_height = 600; |
131 | 131 | int graphic_depth = 15; |
132 | +int full_screen = 0; | |
132 | 133 | TextConsole *vga_console; |
133 | 134 | CharDriverState *serial_hds[MAX_SERIAL_PORTS]; |
134 | 135 | |
... | ... | @@ -2505,6 +2506,7 @@ void help(void) |
2505 | 2506 | "-nographic disable graphical output and redirect serial I/Os to console\n" |
2506 | 2507 | "-enable-audio enable audio support\n" |
2507 | 2508 | "-localtime set the real time clock to local time [default=utc]\n" |
2509 | + "-full-screen start in full screen\n" | |
2508 | 2510 | #ifdef TARGET_PPC |
2509 | 2511 | "-prep Simulate a PREP system (default is PowerMAC)\n" |
2510 | 2512 | "-g WxH[xDEPTH] Set the initial VGA graphic mode\n" |
... | ... | @@ -2548,6 +2550,7 @@ void help(void) |
2548 | 2550 | "-std-vga simulate a standard VGA card with VESA Bochs Extensions\n" |
2549 | 2551 | " (default is CL-GD5446 PCI VGA)\n" |
2550 | 2552 | #endif |
2553 | + "-loadvm file start right away with a saved state (loadvm in monitor)\n" | |
2551 | 2554 | "\n" |
2552 | 2555 | "During emulation, the following keys are useful:\n" |
2553 | 2556 | "ctrl-shift-f toggle full screen\n" |
... | ... | @@ -2622,6 +2625,8 @@ enum { |
2622 | 2625 | QEMU_OPTION_std_vga, |
2623 | 2626 | QEMU_OPTION_monitor, |
2624 | 2627 | QEMU_OPTION_serial, |
2628 | + QEMU_OPTION_loadvm, | |
2629 | + QEMU_OPTION_full_screen, | |
2625 | 2630 | }; |
2626 | 2631 | |
2627 | 2632 | typedef struct QEMUOption { |
... | ... | @@ -2680,6 +2685,8 @@ const QEMUOption qemu_options[] = { |
2680 | 2685 | { "std-vga", 0, QEMU_OPTION_std_vga }, |
2681 | 2686 | { "monitor", 1, QEMU_OPTION_monitor }, |
2682 | 2687 | { "serial", 1, QEMU_OPTION_serial }, |
2688 | + { "loadvm", HAS_ARG, QEMU_OPTION_loadvm }, | |
2689 | + { "full-screen", 0, QEMU_OPTION_full_screen }, | |
2683 | 2690 | |
2684 | 2691 | /* temporary options */ |
2685 | 2692 | { "pci", 0, QEMU_OPTION_pci }, |
... | ... | @@ -2759,6 +2766,7 @@ int main(int argc, char **argv) |
2759 | 2766 | char monitor_device[128]; |
2760 | 2767 | char serial_devices[MAX_SERIAL_PORTS][128]; |
2761 | 2768 | int serial_device_index; |
2769 | + const char *loadvm = NULL; | |
2762 | 2770 | |
2763 | 2771 | #if !defined(CONFIG_SOFTMMU) |
2764 | 2772 | /* we never want that malloc() uses mmap() */ |
... | ... | @@ -3080,6 +3088,12 @@ int main(int argc, char **argv) |
3080 | 3088 | sizeof(serial_devices[0]), optarg); |
3081 | 3089 | serial_device_index++; |
3082 | 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 | 3278 | dumb_display_init(ds); |
3265 | 3279 | } else { |
3266 | 3280 | #ifdef CONFIG_SDL |
3267 | - sdl_display_init(ds); | |
3281 | + sdl_display_init(ds, full_screen); | |
3268 | 3282 | #else |
3269 | 3283 | dumb_display_init(ds); |
3270 | 3284 | #endif |
... | ... | @@ -3365,6 +3379,9 @@ int main(int argc, char **argv) |
3365 | 3379 | } |
3366 | 3380 | } else |
3367 | 3381 | #endif |
3382 | + if (loadvm) | |
3383 | + qemu_loadvm(loadvm); | |
3384 | + | |
3368 | 3385 | { |
3369 | 3386 | /* XXX: simplify init */ |
3370 | 3387 | read_passwords(); | ... | ... |
vl.h
... | ... | @@ -537,7 +537,7 @@ void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base, |
537 | 537 | unsigned long vga_ram_offset, int vga_ram_size); |
538 | 538 | |
539 | 539 | /* sdl.c */ |
540 | -void sdl_display_init(DisplayState *ds); | |
540 | +void sdl_display_init(DisplayState *ds, int full_screen); | |
541 | 541 | |
542 | 542 | /* ide.c */ |
543 | 543 | #define MAX_DISKS 4 | ... | ... |