--- a/src/main.c Mon Dec 26 03:54:55 2005 +0000 +++ b/src/main.c Tue Jan 10 13:58:35 2006 +0000 @@ -1,5 +1,5 @@ /** - * $Id: main.c,v 1.9 2005-12-26 03:54:52 nkeynes Exp $ + * $Id: main.c,v 1.10 2006-01-10 13:57:54 nkeynes Exp $ * * Main program, initializes dreamcast and gui, then passes control off to * the gtk main loop (currently). @@ -23,26 +23,55 @@ # include #endif +#include #include #include "gui/gui.h" #include "dream.h" #include "dreamcast.h" +char *option_list = "a:A:V:p"; +char *aica_program = NULL; +gboolean start_immediately = FALSE; + int main (int argc, char *argv[]) { + int opt; #ifdef ENABLE_NLS - bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); - textdomain (PACKAGE); + bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); + textdomain (PACKAGE); #endif - dreamcast_init(); + + while( (opt = getopt( argc, argv, option_list )) != -1 ) { + switch( opt ) { + case 'a': /* AICA only mode - argument is an AICA program */ + aica_program = optarg; + break; + case 'A': /* Audio driver */ + break; + case 'V': /* Video driver */ + break; + case 'p': /* Start immediately */ + start_immediately = TRUE; + } + } - gnome_init ("dreamon", VERSION, argc, argv); - video_open(); - dreamcast_register_module( >k_gui_module ); - - INFO( "DreamOn! ready..." ); + if( aica_program == NULL ) { + dreamcast_init(); + gnome_init ("dreamon", VERSION, argc, argv); + video_open(); + dreamcast_register_module( >k_gui_module ); + } else { + dreamcast_configure_aica_only(); + mem_load_block( aica_program, 0x00800000, 2048*1024 ); + gnome_init ("dreamon", VERSION, argc, argv); + dreamcast_register_module( >k_gui_module ); + set_disassembly_cpu( main_debug, "ARM7" ); + } - gtk_main (); - return 0; + INFO( "DreamOn! ready..." ); + if( start_immediately ) + dreamcast_run(); + gtk_main (); + return 0; }