Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 689:9868667e3525
prev681:1755a126b109
next691:ad3356543392
author nkeynes
date Mon Jun 16 10:58:41 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Unbreak and finish cleaning up the 'run for limited time' feature
file annotate diff log raw
1.1 --- a/src/main.c Sun Jun 01 00:47:45 2008 +0000
1.2 +++ b/src/main.c Mon Jun 16 10:58:41 2008 +0000
1.3 @@ -49,8 +49,6 @@
1.4 gboolean without_bios = FALSE;
1.5 gboolean use_xlat = TRUE;
1.6 gboolean show_debugger = FALSE;
1.7 -uint32_t time_secs = 0;
1.8 -uint32_t time_nanos = 0;
1.9 extern uint32_t sh4_cpu_multiplier;
1.10
1.11 int main (int argc, char *argv[])
1.12 @@ -58,6 +56,7 @@
1.13 int opt;
1.14 double t;
1.15 gboolean display_ok;
1.16 + uint32_t time_secs, time_nanos;
1.17
1.18 install_crash_handler();
1.19 gdrom_get_native_devices();
1.20 @@ -112,10 +111,12 @@
1.21 case 'h': /* Headless */
1.22 headless = TRUE;
1.23 break;
1.24 - case 't': /* Time limit */
1.25 + case 't': /* Time limit + auto quit */
1.26 t = strtod(optarg, NULL);
1.27 time_secs = (uint32_t)t;
1.28 time_nanos = (int)((t - time_secs) * 1000000000);
1.29 + dreamcast_set_run_time( time_secs, time_nanos );
1.30 + dreamcast_set_exit_on_stop( TRUE );
1.31 break;
1.32 case 'T': /* trace regions */
1.33 trace_regions = optarg;
1.34 @@ -204,22 +205,9 @@
1.35
1.36 sh4_set_use_xlat( use_xlat );
1.37
1.38 - /*
1.39 - if( start_immediately ) {
1.40 - if( dreamcast_can_run() ) {
1.41 - if( time_nanos != 0 || time_secs != 0 ) {
1.42 - dreamcast_run_for(time_secs, time_nanos);
1.43 - dreamcast_shutdown();
1.44 - return 0;
1.45 - } else {
1.46 - dreamcast_run();
1.47 - }
1.48 - } else {
1.49 - ERROR( "Unable to start dreamcast: no program/bios loaded" );
1.50 - }
1.51 - }
1.52 - */
1.53 - if( !headless ) {
1.54 + if( headless ) {
1.55 + dreamcast_run();
1.56 + } else {
1.57 gui_main_loop( start_immediately && dreamcast_can_run() );
1.58 }
1.59 dreamcast_shutdown();
.