Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 94:8d80d9c7cc7d
prev87:11208d725b61
next105:1faa0745f200
author nkeynes
date Sun Feb 05 04:05:27 2006 +0000 (18 years ago)
permissions -rw-r--r--
last change Video code reshuffle to start getting real video happening.
Implement colourspace conversions
Various tweaks
file annotate diff log raw
1.1 --- a/src/main.c Sun Jan 22 22:40:53 2006 +0000
1.2 +++ b/src/main.c Sun Feb 05 04:05:27 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: main.c,v 1.12 2006-01-22 22:40:53 nkeynes Exp $
1.6 + * $Id: main.c,v 1.13 2006-02-05 04:05:27 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 @@ -22,8 +22,8 @@
1.11 #ifdef HAVE_CONFIG_H
1.12 # include <config.h>
1.13 #endif
1.14 -
1.15 #include <unistd.h>
1.16 +#include <getopt.h>
1.17 #include <gnome.h>
1.18 #include "gui/gui.h"
1.19 #include "dream.h"
1.20 @@ -33,6 +33,7 @@
1.21 #define S3M_PLAYER "s3mplay.bin"
1.22
1.23 char *option_list = "a:s:A:V:phb";
1.24 +struct option longopts[1] = { { NULL, 0, 0, 0 } };
1.25 char *aica_program = NULL;
1.26 char *s3m_file = NULL;
1.27 gboolean start_immediately = FALSE;
1.28 @@ -47,7 +48,7 @@
1.29 textdomain (PACKAGE);
1.30 #endif
1.31
1.32 - while( (opt = getopt( argc, argv, option_list )) != -1 ) {
1.33 + while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
1.34 switch( opt ) {
1.35 case 'a': /* AICA only mode - argument is an AICA program */
1.36 aica_program = optarg;
1.37 @@ -73,11 +74,12 @@
1.38 }
1.39
1.40 if( aica_program == NULL ) {
1.41 - dreamcast_init();
1.42 if( !headless ) {
1.43 gnome_init ("dreamon", VERSION, argc, argv);
1.44 - video_open();
1.45 + dreamcast_init();
1.46 dreamcast_register_module( &gtk_gui_module );
1.47 + } else {
1.48 + dreamcast_init();
1.49 }
1.50 } else {
1.51 dreamcast_configure_aica_only();
1.52 @@ -96,6 +98,10 @@
1.53 bios_install();
1.54 }
1.55 INFO( "DreamOn! ready..." );
1.56 + if( optind < argc ) {
1.57 + file_load_magic( argv[optind] );
1.58 + }
1.59 +
1.60 if( start_immediately )
1.61 dreamcast_run();
1.62 if( !headless ) {
.