filename | src/main.c |
changeset | 68:0cf3ead96627 |
prev | 35:21a4be098304 |
next | 77:935dd09c5ace |
author | nkeynes |
date | Tue Jan 10 13:58:35 2006 +0000 (18 years ago) |
permissions | -rw-r--r-- |
last change | Force redisasm when switching cpus Handle emits when gui hasn't been created yet (dump to stderr) |
file | annotate | diff | log | raw |
1.1 --- a/src/main.c Mon Dec 26 03:54:55 2005 +00001.2 +++ b/src/main.c Tue Jan 10 13:58:35 2006 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: main.c,v 1.9 2005-12-26 03:54:52 nkeynes Exp $1.6 + * $Id: main.c,v 1.10 2006-01-10 13:57:54 nkeynes Exp $1.7 *1.8 * Main program, initializes dreamcast and gui, then passes control off to1.9 * the gtk main loop (currently).1.10 @@ -23,26 +23,55 @@1.11 # include <config.h>1.12 #endif1.14 +#include <unistd.h>1.15 #include <gnome.h>1.16 #include "gui/gui.h"1.17 #include "dream.h"1.18 #include "dreamcast.h"1.20 +char *option_list = "a:A:V:p";1.21 +char *aica_program = NULL;1.22 +gboolean start_immediately = FALSE;1.23 +1.24 int main (int argc, char *argv[])1.25 {1.26 + int opt;1.27 #ifdef ENABLE_NLS1.28 - bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);1.29 - textdomain (PACKAGE);1.30 + bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);1.31 + textdomain (PACKAGE);1.32 #endif1.33 - dreamcast_init();1.34 +1.35 + while( (opt = getopt( argc, argv, option_list )) != -1 ) {1.36 + switch( opt ) {1.37 + case 'a': /* AICA only mode - argument is an AICA program */1.38 + aica_program = optarg;1.39 + break;1.40 + case 'A': /* Audio driver */1.41 + break;1.42 + case 'V': /* Video driver */1.43 + break;1.44 + case 'p': /* Start immediately */1.45 + start_immediately = TRUE;1.46 + }1.47 + }1.49 - gnome_init ("dreamon", VERSION, argc, argv);1.50 - video_open();1.51 - dreamcast_register_module( >k_gui_module );1.52 -1.53 - INFO( "DreamOn! ready..." );1.54 + if( aica_program == NULL ) {1.55 + dreamcast_init();1.56 + gnome_init ("dreamon", VERSION, argc, argv);1.57 + video_open();1.58 + dreamcast_register_module( >k_gui_module );1.59 + } else {1.60 + dreamcast_configure_aica_only();1.61 + mem_load_block( aica_program, 0x00800000, 2048*1024 );1.62 + gnome_init ("dreamon", VERSION, argc, argv);1.63 + dreamcast_register_module( >k_gui_module );1.64 + set_disassembly_cpu( main_debug, "ARM7" );1.65 + }1.67 - gtk_main ();1.68 - return 0;1.69 + INFO( "DreamOn! ready..." );1.70 + if( start_immediately )1.71 + dreamcast_run();1.72 + gtk_main ();1.73 + return 0;1.74 }
.