Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 586:2a3ba82cf243
prev543:361ec0a70cf2
next669:ab344e42bca9
author nkeynes
date Tue Jan 15 20:50:23 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Merged lxdream-mmu r570:596 to trunk
file annotate diff log raw
1.1 --- a/src/main.c Thu Nov 22 11:10:15 2007 +0000
1.2 +++ b/src/main.c Tue Jan 15 20:50:23 2008 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: main.c,v 1.35 2007-11-07 11:45:53 nkeynes Exp $
1.6 + * $Id$
1.7 *
1.8 * Main program, initializes dreamcast and gui, then passes control off to
1.9 * the main loop.
1.10 @@ -30,18 +30,20 @@
1.11 #include "aica/audio.h"
1.12 #include "gdrom/gdrom.h"
1.13 #include "maple/maple.h"
1.14 -#include "sh4/sh4core.h"
1.15 +#include "sh4/sh4.h"
1.16
1.17 #define S3M_PLAYER "s3mplay.bin"
1.18
1.19 -char *option_list = "a:m:s:A:V:puhbd:c:t:xD";
1.20 +char *option_list = "a:m:s:A:V:v:puhbd:c:t:T:xDn";
1.21 struct option longopts[1] = { { NULL, 0, 0, 0 } };
1.22 char *aica_program = NULL;
1.23 char *s3m_file = NULL;
1.24 const char *disc_file = NULL;
1.25 char *display_driver_name = NULL;
1.26 char *audio_driver_name = NULL;
1.27 +char *trace_regions = NULL;
1.28 gboolean start_immediately = FALSE;
1.29 +gboolean no_start = FALSE;
1.30 gboolean headless = FALSE;
1.31 gboolean without_bios = FALSE;
1.32 gboolean use_xlat = TRUE;
1.33 @@ -82,6 +84,10 @@
1.34 t = strtod(optarg, NULL);
1.35 sh4_cpu_multiplier = (int)(1000.0/t);
1.36 break;
1.37 + case 'n': /* Don't start immediately */
1.38 + no_start = TRUE;
1.39 + start_immediately = FALSE;
1.40 + break;
1.41 case 's': /* AICA-only w/ S3M player */
1.42 aica_program = S3M_PLAYER;
1.43 s3m_file = optarg;
1.44 @@ -94,6 +100,7 @@
1.45 break;
1.46 case 'p': /* Start immediately */
1.47 start_immediately = TRUE;
1.48 + no_start = FALSE;
1.49 break;
1.50 case 'u': /* Allow unsafe dcload syscalls */
1.51 dcload_set_allow_unsafe(TRUE);
1.52 @@ -109,6 +116,14 @@
1.53 time_secs = (uint32_t)t;
1.54 time_nanos = (int)((t - time_secs) * 1000000000);
1.55 break;
1.56 + case 'T': /* trace regions */
1.57 + trace_regions = optarg;
1.58 + break;
1.59 + case 'v': /* Log verbosity */
1.60 + if( !set_global_log_level(optarg) ) {
1.61 + ERROR( "Unrecognized log level '%s'", optarg );
1.62 + }
1.63 + break;
1.64 case 'x': /* Disable translator */
1.65 use_xlat = FALSE;
1.66 break;
1.67 @@ -126,6 +141,7 @@
1.68 mem_load_block( s3m_file, 0x00810000, 2048*1024 - 0x10000 );
1.69 }
1.70 }
1.71 + mem_set_trace( trace_regions, TRUE );
1.72
1.73 if( without_bios ) {
1.74 bios_install();
1.75 @@ -169,7 +185,9 @@
1.76 if( !ok ) {
1.77 ERROR( "Unrecognized file '%s'", argv[optind] );
1.78 }
1.79 - start_immediately = ok;
1.80 + if( !no_start ) {
1.81 + start_immediately = ok;
1.82 + }
1.83 }
1.84
1.85 if( disc_file != NULL ) {
.