Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 68:0cf3ead96627
prev35:21a4be098304
next77:935dd09c5ace
author nkeynes
date Tue Jan 10 13:57:54 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add command line parser, and aica-only mode
file annotate diff log raw
1.1 --- a/src/main.c Mon Dec 26 03:54:55 2005 +0000
1.2 +++ b/src/main.c Tue Jan 10 13:57:54 2006 +0000
1.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 to
1.9 * the gtk main loop (currently).
1.10 @@ -23,26 +23,55 @@
1.11 # include <config.h>
1.12 #endif
1.13
1.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.19
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_NLS
1.28 - bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
1.29 - textdomain (PACKAGE);
1.30 + bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
1.31 + textdomain (PACKAGE);
1.32 #endif
1.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.48
1.49 - gnome_init ("dreamon", VERSION, argc, argv);
1.50 - video_open();
1.51 - dreamcast_register_module( &gtk_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( &gtk_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( &gtk_gui_module );
1.64 + set_disassembly_cpu( main_debug, "ARM7" );
1.65 + }
1.66
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 }
1.75
.