Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 1108:305ef2082079
prev1107:7b279d10f46f
next1109:700c5ab26a63
author nkeynes
date Fri Jun 04 09:13:40 2010 +1000 (11 years ago)
permissions -rw-r--r--
last change Add ability to wrap a binary program up in a virtual cd image (so that we
can boot it normally)
file annotate diff log raw
1.1 --- a/src/main.c Mon May 17 22:01:23 2010 +1000
1.2 +++ b/src/main.c Fri Jun 04 09:13:40 2010 +1000
1.3 @@ -42,13 +42,13 @@
1.4 #include "hotkeys.h"
1.5 #include "plugin.h"
1.6
1.7 -char *option_list = "a:A:bc:dfg:G:hHl:m:npt:T:uvV:x?";
1.8 +char *option_list = "a:A:bc:dfg:G:hHl:m:npt:T:uvV:w:x?";
1.9 struct option longopts[] = {
1.10 { "aica", required_argument, NULL, 'a' },
1.11 { "audio", required_argument, NULL, 'A' },
1.12 { "biosless", no_argument, NULL, 'b' },
1.13 { "config", required_argument, NULL, 'c' },
1.14 - { "debugger", no_argument, NULL, 'D' },
1.15 + { "debugger", no_argument, NULL, 'd' },
1.16 { "fullscreen", no_argument, NULL, 'f' },
1.17 { "gdb-sh4", required_argument, NULL, 'g' },
1.18 { "gdb-arm", required_argument, NULL, 'G' },
1.19 @@ -61,6 +61,7 @@
1.20 { "unsafe", no_argument, NULL, 'u' },
1.21 { "video", no_argument, NULL, 'V' },
1.22 { "version", no_argument, NULL, 'v' },
1.23 + { "wrap", required_argument, NULL, 'w' },
1.24 { NULL, 0, 0, 0 } };
1.25 char *aica_program = NULL;
1.26 char *display_driver_name = NULL;
1.27 @@ -107,6 +108,7 @@
1.28 printf( " -u, --unsafe %s\n", _("Allow unsafe dcload syscalls") );
1.29 printf( " -v, --version %s\n", _("Print the lxdream version string") );
1.30 printf( " -V, --video=DRIVER %s\n", _("Use the specified video driver (? to list)") );
1.31 + printf( " -w, --wrap=FILENAME %s\n", _("Wrap the specified binary file in a disc image") );
1.32 printf( " -x %s\n", _("Disable the SH4 translator") );
1.33 }
1.34
1.35 @@ -124,6 +126,7 @@
1.36 double t;
1.37 gboolean display_ok;
1.38 uint32_t time_secs, time_nanos;
1.39 + const char *wrap_name = NULL;
1.40
1.41 install_crash_handler();
1.42 bind_gettext_domain();
1.43 @@ -200,6 +203,9 @@
1.44 case 'V': /* Video driver */
1.45 display_driver_name = optarg;
1.46 break;
1.47 + case 'w': /* Wrap image file */
1.48 + wrap_name = optarg;
1.49 + break;
1.50 case 'x': /* Disable translator */
1.51 use_xlat = FALSE;
1.52 break;
1.53 @@ -262,6 +268,19 @@
1.54 maple_reattach_all();
1.55 INFO( "%s! ready...", APP_NAME );
1.56
1.57 + if( wrap_name != NULL ) {
1.58 + ERROR err;
1.59 + cdrom_disc_t disc = cdrom_wrap_magic( CDROM_DISC_XA, wrap_name, &err );
1.60 + if( disc == NULL )
1.61 + ERROR(err.msg);
1.62 + else {
1.63 + gdrom_mount_disc(disc);
1.64 + if( !no_start ) {
1.65 + start_immediately = TRUE;
1.66 + }
1.67 + }
1.68 + }
1.69 +
1.70 for( ; optind < argc; optind++ ) {
1.71 gboolean ok = gdrom_mount_image(argv[optind]);
1.72 if( !ok ) {
.