2 * $Id: main.c,v 1.11 2006-01-16 11:18:29 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.
30 #include "dreamcast.h"
32 #define S3M_PLAYER "s3mplay.bin"
34 char *option_list = "a:s:A:V:ph";
35 char *aica_program = NULL;
36 char *s3m_file = NULL;
37 gboolean start_immediately = FALSE;
38 gboolean headless = FALSE;
40 int main (int argc, char *argv[])
44 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
48 while( (opt = getopt( argc, argv, option_list )) != -1 ) {
50 case 'a': /* AICA only mode - argument is an AICA program */
51 aica_program = optarg;
53 case 's': /* AICA-only w/ S3M player */
54 aica_program = S3M_PLAYER;
57 case 'A': /* Audio driver */
59 case 'V': /* Video driver */
61 case 'p': /* Start immediately */
62 start_immediately = TRUE;
64 case 'h': /* Headless */
70 if( aica_program == NULL ) {
73 gnome_init ("dreamon", VERSION, argc, argv);
75 dreamcast_register_module( >k_gui_module );
78 dreamcast_configure_aica_only();
79 mem_load_block( aica_program, 0x00800000, 2048*1024 );
80 if( s3m_file != NULL ) {
81 mem_load_block( s3m_file, 0x00810000, 2048*1024 - 0x10000 );
84 gnome_init ("dreamon", VERSION, argc, argv);
85 dreamcast_register_module( >k_gui_module );
86 set_disassembly_cpu( main_debug, "ARM7" );
90 INFO( "DreamOn! ready..." );
91 if( start_immediately )
.