summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-06-21 16:46:10 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-06-21 16:46:10 +0000
commite9b137c2dd3fca222634e82cbec8a7b69abf392b (patch)
tree07acd03c1b58711cacb8ca7c835fc930fdeb9a06 /vl.c
parent95ea3fa19ccb934aff809abf45ef947079934429 (diff)
downloadqemu-e9b137c2dd3fca222634e82cbec8a7b69abf392b.tar.gz
added -g option for OF initial resolution
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@948 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index b2ef506de8..3dee9d32c8 100644
--- a/vl.c
+++ b/vl.c
@@ -131,6 +131,9 @@ int pci_enabled = 1;
int prep_enabled = 0;
int rtc_utc = 1;
int cirrus_vga_enabled = 0;
+int graphic_width = 640;
+int graphic_height = 480;
+int graphic_depth = 15;
/***********************************************************/
/* x86 ISA bus support */
@@ -2042,6 +2045,7 @@ void help(void)
"-localtime set the real time clock to local time [default=utc]\n"
#ifdef TARGET_PPC
"-prep Simulate a PREP system (default is PowerMAC)\n"
+ "-g WxH[xDEPTH] Set the initial VGA graphic mode\n"
#endif
"\n"
"Network options:\n"
@@ -2134,6 +2138,7 @@ enum {
QEMU_OPTION_prep,
QEMU_OPTION_localtime,
QEMU_OPTION_cirrusvga,
+ QEMU_OPTION_g,
};
typedef struct QEMUOption {
@@ -2180,6 +2185,7 @@ const QEMUOption qemu_options[] = {
{ "no-code-copy", 0, QEMU_OPTION_no_code_copy },
#ifdef TARGET_PPC
{ "prep", 0, QEMU_OPTION_prep },
+ { "g", 1, QEMU_OPTION_g },
#endif
{ "localtime", 0, QEMU_OPTION_localtime },
{ "isa", 0, QEMU_OPTION_isa },
@@ -2472,6 +2478,40 @@ int main(int argc, char **argv)
case QEMU_OPTION_cirrusvga:
cirrus_vga_enabled = 1;
break;
+ case QEMU_OPTION_g:
+ {
+ const char *p;
+ int w, h, depth;
+ p = optarg;
+ w = strtol(p, (char **)&p, 10);
+ if (w <= 0) {
+ graphic_error:
+ fprintf(stderr, "qemu: invalid resolution or depth\n");
+ exit(1);
+ }
+ if (*p != 'x')
+ goto graphic_error;
+ p++;
+ h = strtol(p, (char **)&p, 10);
+ if (h <= 0)
+ goto graphic_error;
+ if (*p == 'x') {
+ p++;
+ depth = strtol(p, (char **)&p, 10);
+ if (depth != 8 && depth != 15 && depth != 16 &&
+ depth != 24 && depth != 32)
+ goto graphic_error;
+ } else if (*p == '\0') {
+ depth = graphic_depth;
+ } else {
+ goto graphic_error;
+ }
+
+ graphic_width = w;
+ graphic_height = h;
+ graphic_depth = depth;
+ }
+ break;
}
}
}