Search
lxdream.org :: lxdream :: r77:935dd09c5ace
lxdream 0.9.1
released Jun 29
Download Now
changeset77:935dd09c5ace
parent76:e9a0bd313036
child78:4ba04e1d8448
authornkeynes
dateMon Jan 16 11:18:29 2006 +0000 (14 years ago)
Add 's3m' mode (for testing) and also headless mode
src/main.c
1.1 --- a/src/main.c Sat Jan 14 12:31:36 2006 +0000
1.2 +++ b/src/main.c Mon Jan 16 11:18:29 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: main.c,v 1.10 2006-01-10 13:57:54 nkeynes Exp $
1.6 + * $Id: main.c,v 1.11 2006-01-16 11:18:29 nkeynes Exp $
1.7 *
1.8 * Main program, initializes dreamcast and gui, then passes control off to
1.9 * the gtk main loop (currently).
1.10 @@ -29,9 +29,13 @@
1.11 #include "dream.h"
1.12 #include "dreamcast.h"
1.13
1.14 -char *option_list = "a:A:V:p";
1.15 +#define S3M_PLAYER "s3mplay.bin"
1.16 +
1.17 +char *option_list = "a:s:A:V:ph";
1.18 char *aica_program = NULL;
1.19 +char *s3m_file = NULL;
1.20 gboolean start_immediately = FALSE;
1.21 +gboolean headless = FALSE;
1.22
1.23 int main (int argc, char *argv[])
1.24 {
1.25 @@ -46,32 +50,49 @@
1.26 case 'a': /* AICA only mode - argument is an AICA program */
1.27 aica_program = optarg;
1.28 break;
1.29 + case 's': /* AICA-only w/ S3M player */
1.30 + aica_program = S3M_PLAYER;
1.31 + s3m_file = optarg;
1.32 + break;
1.33 case 'A': /* Audio driver */
1.34 break;
1.35 case 'V': /* Video driver */
1.36 break;
1.37 case 'p': /* Start immediately */
1.38 start_immediately = TRUE;
1.39 + break;
1.40 + case 'h': /* Headless */
1.41 + headless = TRUE;
1.42 + break;
1.43 }
1.44 }
1.45
1.46 if( aica_program == NULL ) {
1.47 dreamcast_init();
1.48 - gnome_init ("dreamon", VERSION, argc, argv);
1.49 - video_open();
1.50 - dreamcast_register_module( &gtk_gui_module );
1.51 + if( !headless ) {
1.52 + gnome_init ("dreamon", VERSION, argc, argv);
1.53 + video_open();
1.54 + dreamcast_register_module( &gtk_gui_module );
1.55 + }
1.56 } else {
1.57 dreamcast_configure_aica_only();
1.58 mem_load_block( aica_program, 0x00800000, 2048*1024 );
1.59 - gnome_init ("dreamon", VERSION, argc, argv);
1.60 - dreamcast_register_module( &gtk_gui_module );
1.61 - set_disassembly_cpu( main_debug, "ARM7" );
1.62 + if( s3m_file != NULL ) {
1.63 + mem_load_block( s3m_file, 0x00810000, 2048*1024 - 0x10000 );
1.64 + }
1.65 + if( !headless ) {
1.66 + gnome_init ("dreamon", VERSION, argc, argv);
1.67 + dreamcast_register_module( &gtk_gui_module );
1.68 + set_disassembly_cpu( main_debug, "ARM7" );
1.69 + }
1.70 }
1.71
1.72 INFO( "DreamOn! ready..." );
1.73 if( start_immediately )
1.74 dreamcast_run();
1.75 - gtk_main ();
1.76 + if( !headless ) {
1.77 + gtk_main ();
1.78 + }
1.79 return 0;
1.80 }
1.81
.