Commit e9b137c2dd3fca222634e82cbec8a7b69abf392b
1 parent
95ea3fa1
added -g option for OF initial resolution
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@948 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
40 additions
and
0 deletions
vl.c
... | ... | @@ -131,6 +131,9 @@ int pci_enabled = 1; |
131 | 131 | int prep_enabled = 0; |
132 | 132 | int rtc_utc = 1; |
133 | 133 | int cirrus_vga_enabled = 0; |
134 | +int graphic_width = 640; | |
135 | +int graphic_height = 480; | |
136 | +int graphic_depth = 15; | |
134 | 137 | |
135 | 138 | /***********************************************************/ |
136 | 139 | /* x86 ISA bus support */ |
... | ... | @@ -2042,6 +2045,7 @@ void help(void) |
2042 | 2045 | "-localtime set the real time clock to local time [default=utc]\n" |
2043 | 2046 | #ifdef TARGET_PPC |
2044 | 2047 | "-prep Simulate a PREP system (default is PowerMAC)\n" |
2048 | + "-g WxH[xDEPTH] Set the initial VGA graphic mode\n" | |
2045 | 2049 | #endif |
2046 | 2050 | "\n" |
2047 | 2051 | "Network options:\n" |
... | ... | @@ -2134,6 +2138,7 @@ enum { |
2134 | 2138 | QEMU_OPTION_prep, |
2135 | 2139 | QEMU_OPTION_localtime, |
2136 | 2140 | QEMU_OPTION_cirrusvga, |
2141 | + QEMU_OPTION_g, | |
2137 | 2142 | }; |
2138 | 2143 | |
2139 | 2144 | typedef struct QEMUOption { |
... | ... | @@ -2180,6 +2185,7 @@ const QEMUOption qemu_options[] = { |
2180 | 2185 | { "no-code-copy", 0, QEMU_OPTION_no_code_copy }, |
2181 | 2186 | #ifdef TARGET_PPC |
2182 | 2187 | { "prep", 0, QEMU_OPTION_prep }, |
2188 | + { "g", 1, QEMU_OPTION_g }, | |
2183 | 2189 | #endif |
2184 | 2190 | { "localtime", 0, QEMU_OPTION_localtime }, |
2185 | 2191 | { "isa", 0, QEMU_OPTION_isa }, |
... | ... | @@ -2472,6 +2478,40 @@ int main(int argc, char **argv) |
2472 | 2478 | case QEMU_OPTION_cirrusvga: |
2473 | 2479 | cirrus_vga_enabled = 1; |
2474 | 2480 | break; |
2481 | + case QEMU_OPTION_g: | |
2482 | + { | |
2483 | + const char *p; | |
2484 | + int w, h, depth; | |
2485 | + p = optarg; | |
2486 | + w = strtol(p, (char **)&p, 10); | |
2487 | + if (w <= 0) { | |
2488 | + graphic_error: | |
2489 | + fprintf(stderr, "qemu: invalid resolution or depth\n"); | |
2490 | + exit(1); | |
2491 | + } | |
2492 | + if (*p != 'x') | |
2493 | + goto graphic_error; | |
2494 | + p++; | |
2495 | + h = strtol(p, (char **)&p, 10); | |
2496 | + if (h <= 0) | |
2497 | + goto graphic_error; | |
2498 | + if (*p == 'x') { | |
2499 | + p++; | |
2500 | + depth = strtol(p, (char **)&p, 10); | |
2501 | + if (depth != 8 && depth != 15 && depth != 16 && | |
2502 | + depth != 24 && depth != 32) | |
2503 | + goto graphic_error; | |
2504 | + } else if (*p == '\0') { | |
2505 | + depth = graphic_depth; | |
2506 | + } else { | |
2507 | + goto graphic_error; | |
2508 | + } | |
2509 | + | |
2510 | + graphic_width = w; | |
2511 | + graphic_height = h; | |
2512 | + graphic_depth = depth; | |
2513 | + } | |
2514 | + break; | |
2475 | 2515 | } |
2476 | 2516 | } |
2477 | 2517 | } | ... | ... |