Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 736:a02d1475ccfd
prev723:a13e5529c52a
next738:0cbff49086b8
author nkeynes
date Mon Jul 14 07:44:42 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Re-indent everything consistently
Fix include guards for consistency as well
file annotate diff log raw
1.1 --- a/src/main.c Sun Jul 06 03:16:21 2008 +0000
1.2 +++ b/src/main.c Mon Jul 14 07:44:42 2008 +0000
1.3 @@ -73,7 +73,7 @@
1.4 {
1.5 print_version();
1.6 printf( "Usage: lxdream [options] [disc-file] [program-file]\n\n" );
1.7 -
1.8 +
1.9 printf( "Options:\n" );
1.10 printf( " -a, --aica=PROGFILE %s\n", _("Run the AICA SPU only, with the supplied program") );
1.11 printf( " -A, --audio=DRIVER %s\n", _("Use the specified audio driver (? to list)") );
1.12 @@ -108,7 +108,7 @@
1.13 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
1.14 #endif
1.15 textdomain(PACKAGE);
1.16 -
1.17 +
1.18 #endif
1.19 }
1.20
1.21 @@ -124,84 +124,84 @@
1.22 display_ok = gui_parse_cmdline(&argc, &argv);
1.23
1.24 while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
1.25 - switch( opt ) {
1.26 - case 'a': /* AICA only mode - argument is an AICA program */
1.27 - aica_program = optarg;
1.28 - break;
1.29 - case 'A': /* Audio driver */
1.30 - audio_driver_name = optarg;
1.31 - if( strcmp(audio_driver_name, "?") == 0 ) {
1.32 + switch( opt ) {
1.33 + case 'a': /* AICA only mode - argument is an AICA program */
1.34 + aica_program = optarg;
1.35 + break;
1.36 + case 'A': /* Audio driver */
1.37 + audio_driver_name = optarg;
1.38 + if( strcmp(audio_driver_name, "?") == 0 ) {
1.39 + print_version();
1.40 + print_audio_drivers(stdout);
1.41 + exit(0);
1.42 + }
1.43 + break;
1.44 + case 'c': /* Config file */
1.45 + lxdream_set_config_filename(optarg);
1.46 + break;
1.47 + case 'd': /* Launch w/ debugger */
1.48 + show_debugger = TRUE;
1.49 + break;
1.50 + case 'h': /* help */
1.51 + case '?':
1.52 + print_usage();
1.53 + exit(0);
1.54 + break;
1.55 + case 'H': /* Headless - shorthand for -V null */
1.56 + display_driver_name = "null";
1.57 + break;
1.58 + case 'l': /* Log verbosity */
1.59 + if( !set_global_log_level(optarg) ) {
1.60 + ERROR( "Unrecognized log level '%s'", optarg );
1.61 + }
1.62 + break;
1.63 + case 'm': /* Set SH4 CPU clock multiplier (default 0.5) */
1.64 + t = strtod(optarg, NULL);
1.65 + sh4_cpu_multiplier = (int)(1000.0/t);
1.66 + break;
1.67 + case 'n': /* Don't start immediately */
1.68 + no_start = TRUE;
1.69 + start_immediately = FALSE;
1.70 + break;
1.71 + case 'p': /* Start immediately */
1.72 + start_immediately = TRUE;
1.73 + no_start = FALSE;
1.74 + break;
1.75 + case 't': /* Time limit + auto quit */
1.76 + t = strtod(optarg, NULL);
1.77 + time_secs = (uint32_t)t;
1.78 + time_nanos = (int)((t - time_secs) * 1000000000);
1.79 + dreamcast_set_run_time( time_secs, time_nanos );
1.80 + dreamcast_set_exit_on_stop( TRUE );
1.81 + break;
1.82 + case 'T': /* trace regions */
1.83 + trace_regions = optarg;
1.84 + set_global_log_level("trace");
1.85 + break;
1.86 + case 'u': /* Allow unsafe dcload syscalls */
1.87 + dcload_set_allow_unsafe(TRUE);
1.88 + break;
1.89 + case 'v':
1.90 print_version();
1.91 - print_audio_drivers(stdout);
1.92 exit(0);
1.93 + break;
1.94 + case 'V': /* Video driver */
1.95 + display_driver_name = optarg;
1.96 + if( strcmp(display_driver_name,"?") == 0 ) {
1.97 + print_version();
1.98 + print_display_drivers(stdout);
1.99 + exit(0);
1.100 + }
1.101 + break;
1.102 + case 'x': /* Disable translator */
1.103 + use_xlat = FALSE;
1.104 + break;
1.105 }
1.106 - break;
1.107 - case 'c': /* Config file */
1.108 - lxdream_set_config_filename(optarg);
1.109 - break;
1.110 - case 'd': /* Launch w/ debugger */
1.111 - show_debugger = TRUE;
1.112 - break;
1.113 - case 'h': /* help */
1.114 - case '?':
1.115 - print_usage();
1.116 - exit(0);
1.117 - break;
1.118 - case 'H': /* Headless - shorthand for -V null */
1.119 - display_driver_name = "null";
1.120 - break;
1.121 - case 'l': /* Log verbosity */
1.122 - if( !set_global_log_level(optarg) ) {
1.123 - ERROR( "Unrecognized log level '%s'", optarg );
1.124 - }
1.125 - break;
1.126 - case 'm': /* Set SH4 CPU clock multiplier (default 0.5) */
1.127 - t = strtod(optarg, NULL);
1.128 - sh4_cpu_multiplier = (int)(1000.0/t);
1.129 - break;
1.130 - case 'n': /* Don't start immediately */
1.131 - no_start = TRUE;
1.132 - start_immediately = FALSE;
1.133 - break;
1.134 - case 'p': /* Start immediately */
1.135 - start_immediately = TRUE;
1.136 - no_start = FALSE;
1.137 - break;
1.138 - case 't': /* Time limit + auto quit */
1.139 - t = strtod(optarg, NULL);
1.140 - time_secs = (uint32_t)t;
1.141 - time_nanos = (int)((t - time_secs) * 1000000000);
1.142 - dreamcast_set_run_time( time_secs, time_nanos );
1.143 - dreamcast_set_exit_on_stop( TRUE );
1.144 - break;
1.145 - case 'T': /* trace regions */
1.146 - trace_regions = optarg;
1.147 - set_global_log_level("trace");
1.148 - break;
1.149 - case 'u': /* Allow unsafe dcload syscalls */
1.150 - dcload_set_allow_unsafe(TRUE);
1.151 - break;
1.152 - case 'v':
1.153 - print_version();
1.154 - exit(0);
1.155 - break;
1.156 - case 'V': /* Video driver */
1.157 - display_driver_name = optarg;
1.158 - if( strcmp(display_driver_name,"?") == 0 ) {
1.159 - print_version();
1.160 - print_display_drivers(stdout);
1.161 - exit(0);
1.162 - }
1.163 - break;
1.164 - case 'x': /* Disable translator */
1.165 - use_xlat = FALSE;
1.166 - break;
1.167 - }
1.168 }
1.169
1.170 lxdream_load_config( );
1.171 gdrom_list_init();
1.172 -
1.173 +
1.174 if( aica_program == NULL ) {
1.175 dreamcast_init();
1.176 } else {
1.177 @@ -211,7 +211,7 @@
1.178 mem_set_trace( trace_regions, TRUE );
1.179
1.180 audio_init_driver( audio_driver_name, 44100, AUDIO_FMT_16ST );
1.181 -
1.182 +
1.183 headless = display_driver_name != NULL && strcasecmp( display_driver_name, "null" ) == 0;
1.184 if( headless ) {
1.185 display_set_driver( &display_null_driver );
.