1.1 --- a/src/main.c Sat Sep 08 04:05:35 2007 +0000
1.2 +++ b/src/main.c Sat Sep 08 04:38:38 2007 +0000
1.5 - * $Id: main.c,v 1.21 2007-09-08 04:05:35 nkeynes Exp $
1.6 + * $Id: main.c,v 1.22 2007-09-08 04:38:38 nkeynes Exp $
1.8 * Main program, initializes dreamcast and gui, then passes control off to
1.9 * the gtk main loop (currently).
1.12 #define S3M_PLAYER "s3mplay.bin"
1.14 -char *option_list = "a:s:A:V:puhbd:c:";
1.15 +char *option_list = "a:s:A:V:puhbd:c:t:";
1.16 struct option longopts[1] = { { NULL, 0, 0, 0 } };
1.17 char *aica_program = NULL;
1.18 char *s3m_file = NULL;
1.20 gboolean start_immediately = FALSE;
1.21 gboolean headless = FALSE;
1.22 gboolean without_bios = FALSE;
1.23 +uint32_t time_secs = 0;
1.24 +uint32_t time_nanos = 0;
1.26 audio_driver_t audio_driver_list[] = { &audio_null_driver,
1.29 int main (int argc, char *argv[])
1.34 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
1.35 textdomain (PACKAGE);
1.37 case 'h': /* Headless */
1.40 + case 't': /* Time limit */
1.41 + t = strtod(optarg, NULL);
1.42 + time_secs = (uint32_t)t;
1.43 + time_nanos = (int)((t - time_secs) * 1000000000);
1.47 @@ -172,8 +179,14 @@
1.48 gdrom_mount_image( disc_file );
1.51 - if( start_immediately )
1.53 + if( start_immediately ) {
1.54 + if( time_nanos != 0 || time_secs != 0 ) {
1.55 + dreamcast_run_for(time_secs, time_nanos);