Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 435:7a5d71e8560b
prev422:61a0598e07ff
next446:def93c34c84c
author nkeynes
date Thu Oct 11 08:20:38 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Remove intermediate window and adjust size accordingly
file annotate diff log raw
1.1 --- a/src/main.c Sat Oct 06 09:03:24 2007 +0000
1.2 +++ b/src/main.c Thu Oct 11 08:20:38 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: main.c,v 1.27 2007-10-06 09:00:10 nkeynes Exp $
1.6 + * $Id: main.c,v 1.28 2007-10-10 11:02:04 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 @@ -24,8 +24,7 @@
1.11 #endif
1.12 #include <unistd.h>
1.13 #include <getopt.h>
1.14 -#include <gnome.h>
1.15 -#include "gui/gui.h"
1.16 +#include "gui.h"
1.17 #include "dream.h"
1.18 #include "syscall.h"
1.19 #include "mem.h"
1.20 @@ -72,6 +71,7 @@
1.21 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
1.22 textdomain (PACKAGE);
1.23 #endif
1.24 + gboolean ui_initialized = gui_parse_cmdline(&argc, &argv);
1.25
1.26 while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
1.27 switch( opt ) {
1.28 @@ -127,28 +127,13 @@
1.29 dreamcast_load_config( config_file );
1.30
1.31 if( aica_program == NULL ) {
1.32 - if( !headless ) {
1.33 - gnome_init ("lxdream", VERSION, argc, argv);
1.34 - dreamcast_init();
1.35 - dreamcast_register_module( &gtk_gui_module );
1.36 - if( show_debugger ) {
1.37 - gtk_gui_show_debugger();
1.38 - }
1.39 - } else {
1.40 - dreamcast_init();
1.41 - }
1.42 -
1.43 + dreamcast_init();
1.44 } else {
1.45 dreamcast_configure_aica_only();
1.46 mem_load_block( aica_program, 0x00800000, 2048*1024 );
1.47 if( s3m_file != NULL ) {
1.48 mem_load_block( s3m_file, 0x00810000, 2048*1024 - 0x10000 );
1.49 }
1.50 - if( !headless ) {
1.51 - gnome_init ("lxdream", VERSION, argc, argv);
1.52 - dreamcast_register_module( &gtk_gui_module );
1.53 - set_disassembly_cpu( main_debug, "ARM7" );
1.54 - }
1.55 }
1.56
1.57 if( without_bios ) {
1.58 @@ -173,6 +158,8 @@
1.59 if( headless ) {
1.60 display_set_driver( &display_null_driver );
1.61 } else {
1.62 + gui_init(show_debugger);
1.63 +
1.64 gboolean initialized = FALSE;
1.65 for( i=0; display_driver_list[i] != NULL; i++ ) {
1.66 if( strcasecmp( display_driver_list[i]->name, display_driver_name ) == 0 ) {
1.67 @@ -211,7 +198,7 @@
1.68 }
1.69 }
1.70 if( !headless ) {
1.71 - gtk_main ();
1.72 + gui_main_loop();
1.73 }
1.74 return 0;
1.75 }
.