2 * $Id: main.c,v 1.13 2006-02-05 04:05:27 nkeynes Exp $
4 * Main program, initializes dreamcast and gui, then passes control off to
5 * the gtk main loop (currently).
7 * FIXME: Remove explicit GTK/Gnome references from this file
9 * Copyright (c) 2005 Nathan Keynes.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
31 #include "dreamcast.h"
33 #define S3M_PLAYER "s3mplay.bin"
35 char *option_list = "a:s:A:V:phb";
36 struct option longopts[1] = { { NULL, 0, 0, 0 } };
37 char *aica_program = NULL;
38 char *s3m_file = NULL;
39 gboolean start_immediately = FALSE;
40 gboolean headless = FALSE;
41 gboolean without_bios = FALSE;
43 int main (int argc, char *argv[])
47 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
51 while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
53 case 'a': /* AICA only mode - argument is an AICA program */
54 aica_program = optarg;
56 case 's': /* AICA-only w/ S3M player */
57 aica_program = S3M_PLAYER;
60 case 'A': /* Audio driver */
62 case 'V': /* Video driver */
64 case 'p': /* Start immediately */
65 start_immediately = TRUE;
67 case 'b': /* No BIOS */
70 case 'h': /* Headless */
76 if( aica_program == NULL ) {
78 gnome_init ("dreamon", VERSION, argc, argv);
80 dreamcast_register_module( >k_gui_module );
85 dreamcast_configure_aica_only();
86 mem_load_block( aica_program, 0x00800000, 2048*1024 );
87 if( s3m_file != NULL ) {
88 mem_load_block( s3m_file, 0x00810000, 2048*1024 - 0x10000 );
91 gnome_init ("dreamon", VERSION, argc, argv);
92 dreamcast_register_module( >k_gui_module );
93 set_disassembly_cpu( main_debug, "ARM7" );
100 INFO( "DreamOn! ready..." );
101 if( optind < argc ) {
102 file_load_magic( argv[optind] );
105 if( start_immediately )
.