Search
lxdream.org :: lxdream :: r464:8e099fad42a6
lxdream 0.9.1
released Jun 29
Download Now
changeset464:8e099fad42a6
parent463:0655796f9bb5
child465:3bd7be575792
authornkeynes
dateSat Oct 27 05:44:54 2007 +0000 (12 years ago)
Initial gdrom attachment menu
src/Makefile.am
src/Makefile.in
src/config.c
src/config.h
src/gdrom/cdi.c
src/gdrom/gdimage.c
src/gdrom/gdrom.c
src/gdrom/gdrom.h
src/gdrom/linux.c
src/gdrom/nrg.c
src/gui/gdrom_menu.c
src/gui/gtkui.c
src/gui/gtkui.h
src/main.c
1.1 --- a/src/Makefile.am Wed Oct 24 21:24:09 2007 +0000
1.2 +++ b/src/Makefile.am Sat Oct 27 05:44:54 2007 +0000
1.3 @@ -37,7 +37,7 @@
1.4 maple/controller.c maple/controller.h \
1.5 gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
1.6 gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
1.7 - gui/ctrl_dlg.c gui/path_dlg.c \
1.8 + gui/ctrl_dlg.c gui/path_dlg.c gui/gdrom_menu.c \
1.9 loader.c bootstrap.c util.c \
1.10 display.c display.h \
1.11 drivers/audio_null.c drivers/audio_esd.c \
2.1 --- a/src/Makefile.in Wed Oct 24 21:24:09 2007 +0000
2.2 +++ b/src/Makefile.in Sat Oct 27 05:44:54 2007 +0000
2.3 @@ -171,7 +171,7 @@
2.4 maple/controller.c maple/controller.h \
2.5 gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
2.6 gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
2.7 - gui/ctrl_dlg.c gui/path_dlg.c \
2.8 + gui/ctrl_dlg.c gui/path_dlg.c gui/gdrom_menu.c \
2.9 loader.c bootstrap.c util.c \
2.10 display.c display.h \
2.11 drivers/audio_null.c drivers/audio_esd.c \
2.12 @@ -237,11 +237,11 @@
2.13 controller.$(OBJEXT) gtkui.$(OBJEXT) main_win.$(OBJEXT) \
2.14 gtkcb.$(OBJEXT) mmio_win.$(OBJEXT) debug_win.$(OBJEXT) \
2.15 dump_win.$(OBJEXT) ctrl_dlg.$(OBJEXT) path_dlg.$(OBJEXT) \
2.16 - loader.$(OBJEXT) bootstrap.$(OBJEXT) util.$(OBJEXT) \
2.17 - display.$(OBJEXT) audio_null.$(OBJEXT) audio_esd.$(OBJEXT) \
2.18 - video_null.$(OBJEXT) video_gtk.$(OBJEXT) video_x11.$(OBJEXT) \
2.19 - gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) gl_sl.$(OBJEXT) \
2.20 - gl_slsrc.$(OBJEXT)
2.21 + gdrom_menu.$(OBJEXT) loader.$(OBJEXT) bootstrap.$(OBJEXT) \
2.22 + util.$(OBJEXT) display.$(OBJEXT) audio_null.$(OBJEXT) \
2.23 + audio_esd.$(OBJEXT) video_null.$(OBJEXT) video_gtk.$(OBJEXT) \
2.24 + video_x11.$(OBJEXT) gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) \
2.25 + gl_sl.$(OBJEXT) gl_slsrc.$(OBJEXT)
2.26 lxdream_OBJECTS = $(am_lxdream_OBJECTS)
2.27 lxdream_DEPENDENCIES =
2.28 lxdream_LDFLAGS =
2.29 @@ -275,32 +275,32 @@
2.30 @AMDEP_TRUE@ ./$(DEPDIR)/dmac.Po ./$(DEPDIR)/dreamcast.Po \
2.31 @AMDEP_TRUE@ ./$(DEPDIR)/dump_win.Po ./$(DEPDIR)/eventq.Po \
2.32 @AMDEP_TRUE@ ./$(DEPDIR)/gdimage.Po ./$(DEPDIR)/gdrom.Po \
2.33 -@AMDEP_TRUE@ ./$(DEPDIR)/gendec.Po ./$(DEPDIR)/genglsl.Po \
2.34 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_common.Po ./$(DEPDIR)/gl_fbo.Po \
2.35 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_sl.Po ./$(DEPDIR)/gl_slsrc.Po \
2.36 -@AMDEP_TRUE@ ./$(DEPDIR)/gtkcb.Po ./$(DEPDIR)/gtkui.Po \
2.37 -@AMDEP_TRUE@ ./$(DEPDIR)/i386-dis.Po ./$(DEPDIR)/ide.Po \
2.38 -@AMDEP_TRUE@ ./$(DEPDIR)/insparse.Po ./$(DEPDIR)/intc.Po \
2.39 -@AMDEP_TRUE@ ./$(DEPDIR)/linux.Po ./$(DEPDIR)/loader.Po \
2.40 -@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/main_win.Po \
2.41 -@AMDEP_TRUE@ ./$(DEPDIR)/maple.Po ./$(DEPDIR)/mem.Po \
2.42 -@AMDEP_TRUE@ ./$(DEPDIR)/mmio_win.Po ./$(DEPDIR)/nrg.Po \
2.43 -@AMDEP_TRUE@ ./$(DEPDIR)/path_dlg.Po ./$(DEPDIR)/pvr2.Po \
2.44 -@AMDEP_TRUE@ ./$(DEPDIR)/pvr2mem.Po ./$(DEPDIR)/rendbkg.Po \
2.45 -@AMDEP_TRUE@ ./$(DEPDIR)/rendcore.Po ./$(DEPDIR)/render.Po \
2.46 -@AMDEP_TRUE@ ./$(DEPDIR)/rendsave.Po ./$(DEPDIR)/rendsort.Po \
2.47 -@AMDEP_TRUE@ ./$(DEPDIR)/scif.Po ./$(DEPDIR)/sh4.Po \
2.48 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4core.Po ./$(DEPDIR)/sh4dasm.Po \
2.49 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4mem.Po ./$(DEPDIR)/sh4mmio.Po \
2.50 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4stat.Po ./$(DEPDIR)/sh4trans.Po \
2.51 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4x86.Po ./$(DEPDIR)/syscall.Po \
2.52 -@AMDEP_TRUE@ ./$(DEPDIR)/tacore.Po ./$(DEPDIR)/testsh4x86.Po \
2.53 -@AMDEP_TRUE@ ./$(DEPDIR)/testxlt.Po ./$(DEPDIR)/texcache.Po \
2.54 -@AMDEP_TRUE@ ./$(DEPDIR)/timer.Po ./$(DEPDIR)/util.Po \
2.55 -@AMDEP_TRUE@ ./$(DEPDIR)/video_gtk.Po ./$(DEPDIR)/video_null.Po \
2.56 -@AMDEP_TRUE@ ./$(DEPDIR)/video_x11.Po ./$(DEPDIR)/watch.Po \
2.57 -@AMDEP_TRUE@ ./$(DEPDIR)/x86dasm.Po ./$(DEPDIR)/xltcache.Po \
2.58 -@AMDEP_TRUE@ ./$(DEPDIR)/yuv.Po
2.59 +@AMDEP_TRUE@ ./$(DEPDIR)/gdrom_menu.Po ./$(DEPDIR)/gendec.Po \
2.60 +@AMDEP_TRUE@ ./$(DEPDIR)/genglsl.Po ./$(DEPDIR)/gl_common.Po \
2.61 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_fbo.Po ./$(DEPDIR)/gl_sl.Po \
2.62 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_slsrc.Po ./$(DEPDIR)/gtkcb.Po \
2.63 +@AMDEP_TRUE@ ./$(DEPDIR)/gtkui.Po ./$(DEPDIR)/i386-dis.Po \
2.64 +@AMDEP_TRUE@ ./$(DEPDIR)/ide.Po ./$(DEPDIR)/insparse.Po \
2.65 +@AMDEP_TRUE@ ./$(DEPDIR)/intc.Po ./$(DEPDIR)/linux.Po \
2.66 +@AMDEP_TRUE@ ./$(DEPDIR)/loader.Po ./$(DEPDIR)/main.Po \
2.67 +@AMDEP_TRUE@ ./$(DEPDIR)/main_win.Po ./$(DEPDIR)/maple.Po \
2.68 +@AMDEP_TRUE@ ./$(DEPDIR)/mem.Po ./$(DEPDIR)/mmio_win.Po \
2.69 +@AMDEP_TRUE@ ./$(DEPDIR)/nrg.Po ./$(DEPDIR)/path_dlg.Po \
2.70 +@AMDEP_TRUE@ ./$(DEPDIR)/pvr2.Po ./$(DEPDIR)/pvr2mem.Po \
2.71 +@AMDEP_TRUE@ ./$(DEPDIR)/rendbkg.Po ./$(DEPDIR)/rendcore.Po \
2.72 +@AMDEP_TRUE@ ./$(DEPDIR)/render.Po ./$(DEPDIR)/rendsave.Po \
2.73 +@AMDEP_TRUE@ ./$(DEPDIR)/rendsort.Po ./$(DEPDIR)/scif.Po \
2.74 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4.Po ./$(DEPDIR)/sh4core.Po \
2.75 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4dasm.Po ./$(DEPDIR)/sh4mem.Po \
2.76 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4mmio.Po ./$(DEPDIR)/sh4stat.Po \
2.77 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4trans.Po ./$(DEPDIR)/sh4x86.Po \
2.78 +@AMDEP_TRUE@ ./$(DEPDIR)/syscall.Po ./$(DEPDIR)/tacore.Po \
2.79 +@AMDEP_TRUE@ ./$(DEPDIR)/testsh4x86.Po ./$(DEPDIR)/testxlt.Po \
2.80 +@AMDEP_TRUE@ ./$(DEPDIR)/texcache.Po ./$(DEPDIR)/timer.Po \
2.81 +@AMDEP_TRUE@ ./$(DEPDIR)/util.Po ./$(DEPDIR)/video_gtk.Po \
2.82 +@AMDEP_TRUE@ ./$(DEPDIR)/video_null.Po ./$(DEPDIR)/video_x11.Po \
2.83 +@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po ./$(DEPDIR)/x86dasm.Po \
2.84 +@AMDEP_TRUE@ ./$(DEPDIR)/xltcache.Po ./$(DEPDIR)/yuv.Po
2.85 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
2.86 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
2.87 CCLD = $(CC)
2.88 @@ -398,6 +398,7 @@
2.89 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventq.Po@am__quote@
2.90 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdimage.Po@am__quote@
2.91 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrom.Po@am__quote@
2.92 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrom_menu.Po@am__quote@
2.93 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gendec.Po@am__quote@
2.94 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genglsl.Po@am__quote@
2.95 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_common.Po@am__quote@
2.96 @@ -1616,6 +1617,28 @@
2.97 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.98 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o path_dlg.obj `if test -f 'gui/path_dlg.c'; then $(CYGPATH_W) 'gui/path_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gui/path_dlg.c'; fi`
2.99
2.100 +gdrom_menu.o: gui/gdrom_menu.c
2.101 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdrom_menu.o -MD -MP -MF "$(DEPDIR)/gdrom_menu.Tpo" \
2.102 +@am__fastdepCC_TRUE@ -c -o gdrom_menu.o `test -f 'gui/gdrom_menu.c' || echo '$(srcdir)/'`gui/gdrom_menu.c; \
2.103 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdrom_menu.Tpo" "$(DEPDIR)/gdrom_menu.Po"; \
2.104 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdrom_menu.Tpo"; exit 1; \
2.105 +@am__fastdepCC_TRUE@ fi
2.106 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gdrom_menu.c' object='gdrom_menu.o' libtool=no @AMDEPBACKSLASH@
2.107 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdrom_menu.Po' tmpdepfile='$(DEPDIR)/gdrom_menu.TPo' @AMDEPBACKSLASH@
2.108 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.109 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdrom_menu.o `test -f 'gui/gdrom_menu.c' || echo '$(srcdir)/'`gui/gdrom_menu.c
2.110 +
2.111 +gdrom_menu.obj: gui/gdrom_menu.c
2.112 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdrom_menu.obj -MD -MP -MF "$(DEPDIR)/gdrom_menu.Tpo" \
2.113 +@am__fastdepCC_TRUE@ -c -o gdrom_menu.obj `if test -f 'gui/gdrom_menu.c'; then $(CYGPATH_W) 'gui/gdrom_menu.c'; else $(CYGPATH_W) '$(srcdir)/gui/gdrom_menu.c'; fi`; \
2.114 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdrom_menu.Tpo" "$(DEPDIR)/gdrom_menu.Po"; \
2.115 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdrom_menu.Tpo"; exit 1; \
2.116 +@am__fastdepCC_TRUE@ fi
2.117 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gdrom_menu.c' object='gdrom_menu.obj' libtool=no @AMDEPBACKSLASH@
2.118 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdrom_menu.Po' tmpdepfile='$(DEPDIR)/gdrom_menu.TPo' @AMDEPBACKSLASH@
2.119 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.120 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdrom_menu.obj `if test -f 'gui/gdrom_menu.c'; then $(CYGPATH_W) 'gui/gdrom_menu.c'; else $(CYGPATH_W) '$(srcdir)/gui/gdrom_menu.c'; fi`
2.121 +
2.122 audio_null.o: drivers/audio_null.c
2.123 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio_null.o -MD -MP -MF "$(DEPDIR)/audio_null.Tpo" \
2.124 @am__fastdepCC_TRUE@ -c -o audio_null.o `test -f 'drivers/audio_null.c' || echo '$(srcdir)/'`drivers/audio_null.c; \
3.1 --- a/src/config.c Wed Oct 24 21:24:09 2007 +0000
3.2 +++ b/src/config.c Sat Oct 27 05:44:54 2007 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: config.c,v 1.3 2007-10-23 10:47:17 nkeynes Exp $
3.6 + * $Id: config.c,v 1.4 2007-10-27 05:44:53 nkeynes Exp $
3.7 *
3.8 * User configuration support
3.9 *
3.10 @@ -37,6 +37,7 @@
3.11 { "default path", CONFIG_TYPE_PATH, "." },
3.12 { "save path", CONFIG_TYPE_PATH, "save" },
3.13 { "bootstrap", CONFIG_TYPE_FILE, "IP.BIN" },
3.14 + { "gdrom", CONFIG_TYPE_FILE, NULL },
3.15 { NULL, CONFIG_TYPE_NONE }};
3.16
3.17 static struct lxdream_config_entry serial_config[] =
4.1 --- a/src/config.h Wed Oct 24 21:24:09 2007 +0000
4.2 +++ b/src/config.h Sat Oct 27 05:44:54 2007 +0000
4.3 @@ -1,5 +1,5 @@
4.4 /**
4.5 - * $Id: config.h,v 1.3 2007-10-23 10:47:17 nkeynes Exp $
4.6 + * $Id: config.h,v 1.4 2007-10-27 05:44:53 nkeynes Exp $
4.7 *
4.8 * User configuration support
4.9 *
4.10 @@ -45,6 +45,7 @@
4.11 #define CONFIG_DEFAULT_PATH 2
4.12 #define CONFIG_SAVE_PATH 3
4.13 #define CONFIG_BOOTSTRAP 4
4.14 +#define CONFIG_GDROM 5
4.15
4.16 extern struct lxdream_config_group lxdream_config_root[];
4.17
5.1 --- a/src/gdrom/cdi.c Wed Oct 24 21:24:09 2007 +0000
5.2 +++ b/src/gdrom/cdi.c Sat Oct 27 05:44:54 2007 +0000
5.3 @@ -1,5 +1,5 @@
5.4 /**
5.5 - * $Id: cdi.c,v 1.8 2007-10-21 05:20:15 nkeynes Exp $
5.6 + * $Id: cdi.c,v 1.9 2007-10-27 05:44:54 nkeynes Exp $
5.7 *
5.8 * CDI CD-image file support
5.9 *
5.10 @@ -105,7 +105,7 @@
5.11 }
5.12 fread( &session_count, sizeof(session_count), 1, f );
5.13
5.14 - disc = gdrom_image_new(f);
5.15 + disc = gdrom_image_new(filename, f);
5.16 if( disc == NULL ) {
5.17 fclose(f);
5.18 ERROR("Unable to allocate memory!");
5.19 @@ -198,6 +198,5 @@
5.20 }
5.21 }
5.22 image->track_count = total_tracks;
5.23 - image->filename = filename;
5.24 return disc;
5.25 }
6.1 --- a/src/gdrom/gdimage.c Wed Oct 24 21:24:09 2007 +0000
6.2 +++ b/src/gdrom/gdimage.c Sat Oct 27 05:44:54 2007 +0000
6.3 @@ -1,5 +1,5 @@
6.4 /**
6.5 - * $Id: gdimage.c,v 1.2 2007-10-06 08:58:00 nkeynes Exp $
6.6 + * $Id: gdimage.c,v 1.3 2007-10-27 05:44:54 nkeynes Exp $
6.7 *
6.8 * GD-Rom image-file common functions.
6.9 *
6.10 @@ -47,7 +47,7 @@
6.11 disc->close = gdrom_image_destroy;
6.12 }
6.13
6.14 -gdrom_disc_t gdrom_image_new( FILE *f )
6.15 +gdrom_disc_t gdrom_image_new( const gchar *filename, FILE *f )
6.16 {
6.17 gdrom_image_t image = (gdrom_image_t)calloc(sizeof(struct gdrom_image), 1);
6.18 if( image == NULL ) {
6.19 @@ -55,9 +55,14 @@
6.20 }
6.21 image->disc_type = IDE_DISC_CDROM;
6.22 image->file = f;
6.23 -
6.24 gdrom_disc_t disc = (gdrom_disc_t)image;
6.25 gdrom_image_init(disc);
6.26 + if( filename == NULL ) {
6.27 + disc->name = NULL;
6.28 + } else {
6.29 + disc->name = g_strdup(filename);
6.30 + }
6.31 +
6.32 return disc;
6.33 }
6.34
6.35 @@ -68,6 +73,10 @@
6.36 fclose(img->file);
6.37 img->file = NULL;
6.38 }
6.39 + if( disc->name != NULL ) {
6.40 + g_free( disc->name );
6.41 + disc->name = NULL;
6.42 + }
6.43 free( disc );
6.44 }
6.45
7.1 --- a/src/gdrom/gdrom.c Wed Oct 24 21:24:09 2007 +0000
7.2 +++ b/src/gdrom/gdrom.c Sat Oct 27 05:44:54 2007 +0000
7.3 @@ -1,6 +1,6 @@
7.4
7.5 /**
7.6 - * $Id: gdrom.c,v 1.16 2007-10-21 05:20:00 nkeynes Exp $
7.7 + * $Id: gdrom.c,v 1.17 2007-10-27 05:44:54 nkeynes Exp $
7.8 *
7.9 * GD-Rom access functions.
7.10 *
7.11 @@ -108,3 +108,7 @@
7.12
7.13 }
7.14
7.15 +gdrom_disc_t gdrom_get_current_disc()
7.16 +{
7.17 + return gdrom_disc;
7.18 +}
8.1 --- a/src/gdrom/gdrom.h Wed Oct 24 21:24:09 2007 +0000
8.2 +++ b/src/gdrom/gdrom.h Sat Oct 27 05:44:54 2007 +0000
8.3 @@ -1,5 +1,5 @@
8.4 /**
8.5 - * $Id: gdrom.h,v 1.12 2007-10-09 08:45:00 nkeynes Exp $
8.6 + * $Id: gdrom.h,v 1.13 2007-10-27 05:44:54 nkeynes Exp $
8.7 *
8.8 * This file defines the structures and functions used by the GD-Rom
8.9 * disc driver. (ie, the modules that supply a CD image to be used by the
8.10 @@ -22,6 +22,7 @@
8.11 #define dream_gdrom_H 1
8.12
8.13 #include "dream.h"
8.14 +#include <glib.h>
8.15
8.16 #define MAX_SECTOR_SIZE 2352
8.17
8.18 @@ -137,6 +138,7 @@
8.19 * the disc structure itself.
8.20 */
8.21 void (*close)( struct gdrom_disc *disc );
8.22 + const gchar *name; /* Device name / Image filename */
8.23 } *gdrom_disc_t;
8.24
8.25
8.26 @@ -146,7 +148,6 @@
8.27 int track_count;
8.28 struct gdrom_track track[99];
8.29 gchar mcn[14]; /* Media catalogue number */
8.30 - const gchar *filename; /* Image filename */
8.31 FILE *file; /* Open file stream */
8.32 } *gdrom_image_t;
8.33
8.34 @@ -167,7 +168,7 @@
8.35 /**
8.36 * Construct a new image file using the default methods.
8.37 */
8.38 -gdrom_disc_t gdrom_image_new( FILE *file );
8.39 +gdrom_disc_t gdrom_image_new( const gchar *filename, FILE *f );
8.40
8.41 /**
8.42 * Open an image file
8.43 @@ -208,6 +209,10 @@
8.44
8.45 gboolean gdrom_is_mounted( void );
8.46
8.47 +gdrom_disc_t gdrom_get_current_disc();
8.48 +
8.49 +GList *gdrom_get_native_devices();
8.50 +
8.51 uint32_t gdrom_read_sectors( uint32_t sector, uint32_t sector_count,
8.52 int mode, unsigned char *buf, uint32_t *length );
8.53
9.1 --- a/src/gdrom/linux.c Wed Oct 24 21:24:09 2007 +0000
9.2 +++ b/src/gdrom/linux.c Sat Oct 27 05:44:54 2007 +0000
9.3 @@ -1,5 +1,5 @@
9.4 /**
9.5 - * $Id: linux.c,v 1.5 2007-10-06 08:58:00 nkeynes Exp $
9.6 + * $Id: linux.c,v 1.6 2007-10-27 05:44:54 nkeynes Exp $
9.7 *
9.8 * Linux cd-rom device driver.
9.9 *
9.10 @@ -22,6 +22,8 @@
9.11 #include <linux/cdrom.h>
9.12 #include <sys/stat.h>
9.13 #include <sys/ioctl.h>
9.14 +#include <fstab.h>
9.15 +#include <fcntl.h>
9.16
9.17 #include "gdrom/gdrom.h"
9.18 #include "gdrom/packet.h"
9.19 @@ -57,6 +59,29 @@
9.20
9.21 struct gdrom_image_class linux_device_class = { "Linux", NULL,
9.22 linux_image_is_valid, linux_open_device };
9.23 +GList *gdrom_get_native_devices(void)
9.24 +{
9.25 + GList *list = NULL;
9.26 + struct fstab *ent;
9.27 + struct stat st;
9.28 + setfsent();
9.29 + while( (ent = getfsent()) != NULL ) {
9.30 + if( (stat(ent->fs_spec, &st) != -1) &&
9.31 + S_ISBLK(st.st_mode) ) {
9.32 + /* Got a valid block device - is it a CDROM? */
9.33 + int fd = open(ent->fs_spec, O_RDONLY|O_NONBLOCK);
9.34 + if( fd == -1 )
9.35 + continue;
9.36 + int caps = ioctl(fd, CDROM_GET_CAPABILITY);
9.37 + if( caps != -1 ) {
9.38 + /* Appears to support CDROM functions */
9.39 + list = g_list_append( list, g_strdup(ent->fs_spec) );
9.40 + }
9.41 + close(fd);
9.42 + }
9.43 + }
9.44 + return list;
9.45 +}
9.46
9.47 static gboolean linux_image_is_valid( FILE *f )
9.48 {
9.49 @@ -82,7 +107,7 @@
9.50 {
9.51 gdrom_disc_t disc;
9.52
9.53 - disc = gdrom_image_new(f);
9.54 + disc = gdrom_image_new(filename, f);
9.55 if( disc == NULL ) {
9.56 ERROR("Unable to allocate memory!");
9.57 return NULL;
9.58 @@ -186,6 +211,33 @@
9.59 return 0;
9.60 }
9.61
9.62 +static gdrom_error_t linux_play_audio( gdrom_disc_t disc, uint32_t lba, uint32_t endlba )
9.63 +{
9.64 + int fd = fileno( ((gdrom_image_t)disc)->file );
9.65 + uint32_t real_sector = lba - CD_MSF_OFFSET;
9.66 + uint32_t length = endlba - lba;
9.67 + uint32_t buflen = 0;
9.68 + char cmd[12] = { 0xA5, 0,0,0, 0,0,0,0, 0,0,0,0 };
9.69 + cmd[2] = (real_sector >> 24) & 0xFF;
9.70 + cmd[3] = (real_sector >> 16) & 0xFF;
9.71 + cmd[4] = (real_sector >> 8) & 0xFF;
9.72 + cmd[5] = real_sector & 0xFF;
9.73 + cmd[6] = (length >> 24) & 0xFF;
9.74 + cmd[7] = (length >> 16) & 0xFF;
9.75 + cmd[8] = (length >> 8) & 0xFF;
9.76 + cmd[9] = length & 0xFF;
9.77 +
9.78 + return linux_send_command( fd, cmd, NULL, &buflen, CGC_DATA_NONE );
9.79 +}
9.80 +
9.81 +static gdrom_error_t linux_stop_audio( gdrom_disc_t disc )
9.82 +{
9.83 + int fd = fileno( ((gdrom_image_t)disc)->file );
9.84 + uint32_t buflen = 0;
9.85 + char cmd[12] = {0x4E,0,0,0, 0,0,0,0, 0,0,0,0};
9.86 + return linux_send_command( fd, cmd, NULL, &buflen, CGC_DATA_NONE );
9.87 +}
9.88 +
9.89 static gdrom_error_t linux_read_sector( gdrom_disc_t disc, uint32_t sector,
9.90 int mode, unsigned char *buf, uint32_t *length )
9.91 {
10.1 --- a/src/gdrom/nrg.c Wed Oct 24 21:24:09 2007 +0000
10.2 +++ b/src/gdrom/nrg.c Sat Oct 27 05:44:54 2007 +0000
10.3 @@ -1,5 +1,5 @@
10.4 /**
10.5 - * $Id: nrg.c,v 1.5 2007-10-06 08:58:00 nkeynes Exp $
10.6 + * $Id: nrg.c,v 1.6 2007-10-27 05:44:54 nkeynes Exp $
10.7 *
10.8 * Nero (NRG) CD file format. File information stolen shamelessly from
10.9 * libcdio.
10.10 @@ -178,7 +178,7 @@
10.11 return NULL;
10.12 }
10.13
10.14 - disc = gdrom_image_new(f);
10.15 + disc = gdrom_image_new(filename, f);
10.16 if( disc == NULL ) {
10.17 fclose(f);
10.18 ERROR("Unable to allocate memory!");
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/src/gui/gdrom_menu.c Sat Oct 27 05:44:54 2007 +0000
11.3 @@ -0,0 +1,203 @@
11.4 +/**
11.5 + * $Id: gdrom_menu.c,v 1.1 2007-10-27 05:44:54 nkeynes Exp $
11.6 + *
11.7 + * Creates and manages the GD-Rom attachment menu.
11.8 + *
11.9 + * Copyright (c) 2005 Nathan Keynes.
11.10 + *
11.11 + * This program is free software; you can redistribute it and/or modify
11.12 + * it under the terms of the GNU General Public License as published by
11.13 + * the Free Software Foundation; either version 2 of the License, or
11.14 + * (at your option) any later version.
11.15 + *
11.16 + * This program is distributed in the hope that it will be useful,
11.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11.19 + * GNU General Public License for more details.
11.20 + */
11.21 +
11.22 +#include <assert.h>
11.23 +#include <libgen.h>
11.24 +
11.25 +#include "dream.h"
11.26 +#include "dreamcast.h"
11.27 +#include "config.h"
11.28 +#include "gdrom/gdrom.h"
11.29 +#include "gui/gtkui.h"
11.30 +
11.31 +#define MAX_RECENT_ITEMS 5
11.32 +
11.33 +static GList *gdrom_menu_list = NULL;
11.34 +static gboolean gdrom_menu_adjusting = FALSE;
11.35 +static GList *gdrom_device_list = NULL;
11.36 +static GList *gdrom_recent_list = NULL;
11.37 +
11.38 +void gdrom_menu_rebuild_all();
11.39 +
11.40 +
11.41 +gint gdrom_menu_find_item( const gchar *name )
11.42 +{
11.43 + gint posn = 0;
11.44 + GList *ptr;
11.45 +
11.46 + for( ptr = gdrom_device_list; ptr != NULL; ptr = g_list_next(ptr) ) {
11.47 + gchar *device = (gchar *)ptr->data;
11.48 + posn++;
11.49 + if( strcmp(device, name) == 0 ) {
11.50 + return posn;
11.51 + }
11.52 + }
11.53 + posn++;
11.54 + for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
11.55 + gchar *file = (gchar *)ptr->data;
11.56 + posn++;
11.57 + if( strcmp(file, name) == 0 ) {
11.58 + return posn;
11.59 + }
11.60 + }
11.61 + return -1;
11.62 +}
11.63 +
11.64 +gint gdrom_menu_add_recent_item( const gchar *name )
11.65 +{
11.66 + gdrom_recent_list = g_list_prepend( gdrom_recent_list, g_strdup(name) );
11.67 + if( g_list_length(gdrom_recent_list) > MAX_RECENT_ITEMS ) {
11.68 + GList *ptr = g_list_nth( gdrom_recent_list, MAX_RECENT_ITEMS );
11.69 + g_free( ptr->data );
11.70 + gdrom_recent_list = g_list_remove( gdrom_recent_list, ptr->data );
11.71 + }
11.72 + return g_list_length( gdrom_device_list ) + 2; // menu posn of new item
11.73 +}
11.74 +
11.75 +void gdrom_menu_update_all()
11.76 +{
11.77 + gdrom_disc_t disc = gdrom_get_current_disc();
11.78 + gint posn = 0;
11.79 + GList *ptr;
11.80 +
11.81 + gdrom_menu_adjusting = TRUE;
11.82 +
11.83 + if( disc != NULL ) {
11.84 + posn = gdrom_menu_find_item( disc->name );
11.85 + if( posn == -1 ) {
11.86 + posn = gdrom_menu_add_recent_item( disc->name );
11.87 + gdrom_menu_rebuild_all();
11.88 + }
11.89 + }
11.90 +
11.91 + for( ptr = gdrom_menu_list; ptr != NULL; ptr = g_list_next(ptr) ) {
11.92 + GtkWidget *menu = GTK_WIDGET(ptr->data);
11.93 + GList *children = gtk_container_get_children( GTK_CONTAINER(menu) );
11.94 + GList *item = g_list_nth( children, posn );
11.95 + assert( item != NULL );
11.96 + gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(item->data), TRUE );
11.97 + g_list_free(children);
11.98 + }
11.99 +
11.100 + gdrom_menu_adjusting = FALSE;
11.101 +}
11.102 +
11.103 +void gdrom_menu_empty_callback( GtkWidget *widget, gpointer user_data )
11.104 +{
11.105 + if( !gdrom_menu_adjusting ) {
11.106 + gdrom_unmount_disc();
11.107 + gdrom_menu_update_all();
11.108 + }
11.109 +}
11.110 +
11.111 +void gdrom_menu_open_file( const char *filename )
11.112 +{
11.113 + if( filename != NULL ) {
11.114 + gdrom_mount_image(filename);
11.115 + }
11.116 + gdrom_menu_update_all();
11.117 +}
11.118 +
11.119 +void gdrom_menu_open_image_callback( GtkWidget *widget, gpointer user_data )
11.120 +{
11.121 + if( !gdrom_menu_adjusting ) {
11.122 + const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);
11.123 + open_file_dialog( "Open...", gdrom_menu_open_file, NULL, NULL, dir );
11.124 + }
11.125 +}
11.126 +
11.127 +
11.128 +void gdrom_menu_open_specified_callback( GtkWidget *widget, gpointer user_data )
11.129 +{
11.130 + if( !gdrom_menu_adjusting ) {
11.131 + gdrom_menu_open_file( (gchar *)user_data );
11.132 + }
11.133 +}
11.134 +
11.135 +void gdrom_menu_build( GtkWidget *menu )
11.136 +{
11.137 + GSList *group = NULL;
11.138 + GtkWidget *empty = gtk_radio_menu_item_new_with_label( group, "Empty" );
11.139 + group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(empty) );
11.140 + g_signal_connect_after( empty, "activate", G_CALLBACK(gdrom_menu_empty_callback), NULL );
11.141 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), empty );
11.142 +
11.143 + if( gdrom_device_list == NULL ) {
11.144 + gdrom_device_list = gdrom_get_native_devices();
11.145 + }
11.146 + GList *ptr;
11.147 + for( ptr = gdrom_device_list; ptr != NULL; ptr = g_list_next(ptr) ) {
11.148 + gchar *name = (gchar *)ptr->data;
11.149 + GtkWidget *item = gtk_radio_menu_item_new_with_label( group, name);
11.150 + gtk_widget_set_name( item, name );
11.151 + group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(item) );
11.152 + g_signal_connect_after( item, "activate", G_CALLBACK(gdrom_menu_open_specified_callback),
11.153 + name );
11.154 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
11.155 + }
11.156 +
11.157 + if( gdrom_recent_list != NULL ) {
11.158 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), gtk_separator_menu_item_new() );
11.159 + for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
11.160 + gchar *path = (gchar *)ptr->data;
11.161 + gchar *name = basename(path);
11.162 + GtkWidget *item = gtk_radio_menu_item_new_with_label( group, name );
11.163 + gtk_widget_set_name( item, path );
11.164 + group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(item) );
11.165 + g_signal_connect_after( item, "activate", G_CALLBACK(gdrom_menu_open_specified_callback),
11.166 + path );
11.167 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
11.168 +
11.169 + }
11.170 + }
11.171 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), gtk_separator_menu_item_new() );
11.172 + GtkWidget *open = gtk_image_menu_item_new_with_label( "Open image file..." );
11.173 + g_signal_connect_after( open, "activate", G_CALLBACK(gdrom_menu_open_image_callback), NULL );
11.174 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), open );
11.175 + gtk_widget_show_all(menu);
11.176 +}
11.177 +
11.178 +GtkWidget *gdrom_menu_new()
11.179 +{
11.180 + GtkWidget *menu = gtk_menu_new();
11.181 + gtk_menu_set_title( GTK_MENU(menu), "GD-Rom Settings" );
11.182 +
11.183 + gdrom_menu_build(menu);
11.184 +
11.185 + gdrom_menu_list = g_list_append(gdrom_menu_list, menu);
11.186 + gtk_widget_show_all(menu);
11.187 + gdrom_menu_update_all();
11.188 + return menu;
11.189 +}
11.190 +
11.191 +void gdrom_menu_rebuild_all()
11.192 +{
11.193 + GList *ptr;
11.194 +
11.195 + for( ptr = gdrom_menu_list; ptr != NULL; ptr = g_list_next(ptr) ) {
11.196 + GtkWidget *menu = GTK_WIDGET(ptr->data);
11.197 + GList *children = gtk_container_get_children( GTK_CONTAINER(menu) );
11.198 + GList *listptr;
11.199 + for( listptr = children; listptr != NULL; listptr = g_list_next(listptr) ) {
11.200 + gtk_widget_destroy( GTK_WIDGET(listptr->data) );
11.201 + }
11.202 + g_list_free(children);
11.203 + gdrom_menu_build(menu);
11.204 + }
11.205 + gdrom_menu_update_all();
11.206 +}
12.1 --- a/src/gui/gtkui.c Wed Oct 24 21:24:09 2007 +0000
12.2 +++ b/src/gui/gtkui.c Sat Oct 27 05:44:54 2007 +0000
12.3 @@ -1,5 +1,5 @@
12.4 /**
12.5 - * $Id: gtkui.c,v 1.6 2007-10-21 11:38:02 nkeynes Exp $
12.6 + * $Id: gtkui.c,v 1.7 2007-10-27 05:44:54 nkeynes Exp $
12.7 *
12.8 * Core GTK-based user interface
12.9 *
12.10 @@ -20,6 +20,7 @@
12.11 #include <time.h>
12.12 #include "dream.h"
12.13 #include "dreamcast.h"
12.14 +#include "gdrom/gdrom.h"
12.15 #include "gui/gtkui.h"
12.16
12.17
12.18 @@ -56,7 +57,6 @@
12.19 static uint32_t gtk_gui_nanos = 0;
12.20 static struct timeval gtk_gui_lasttv;
12.21
12.22 -
12.23 #define ENABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,TRUE)
12.24 #define DISABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,FALSE)
12.25
12.26 @@ -65,13 +65,15 @@
12.27 { "FileMenu", NULL, "_File" },
12.28 { "SettingsMenu", NULL, "_Settings" },
12.29 { "HelpMenu", NULL, "_Help" },
12.30 - { "Mount", GTK_STOCK_CDROM, "_Mount...", "<control>O", "Mount a cdrom disc", G_CALLBACK(mount_action_callback) },
12.31 { "Reset", GTK_STOCK_REFRESH, "_Reset", "<control>R", "Reset dreamcast", G_CALLBACK(reset_action_callback) },
12.32 { "Pause", GTK_STOCK_MEDIA_PAUSE, "_Pause", NULL, "Pause dreamcast", G_CALLBACK(pause_action_callback) },
12.33 { "Run", GTK_STOCK_MEDIA_PLAY, "Resume", NULL, "Resume", G_CALLBACK(resume_action_callback) },
12.34 { "LoadState", GTK_STOCK_REVERT_TO_SAVED, "_Load state...", "F4", "Load an lxdream save state", G_CALLBACK(load_state_action_callback) },
12.35 { "SaveState", GTK_STOCK_SAVE_AS, "_Save state...", "F3", "Create an lxdream save state", G_CALLBACK(save_state_action_callback) },
12.36 { "Exit", GTK_STOCK_QUIT, "E_xit", NULL, "Exit lxdream", G_CALLBACK(exit_action_callback) },
12.37 + { "GdromSettings", NULL, "_GD-Rom..." },
12.38 + { "GdromUnmount", NULL, "_Empty" },
12.39 + { "GdromMount", GTK_STOCK_CDROM, "_Open Image...", "<control>O", "Mount a cdrom disc", G_CALLBACK(mount_action_callback) },
12.40 { "PathSettings", NULL, "_Paths...", NULL, "Configure files and paths", G_CALLBACK(path_settings_callback) },
12.41 { "AudioSettings", NULL, "_Audio...", NULL, "Configure audio output", G_CALLBACK(audio_settings_callback) },
12.42 { "ControllerSettings", NULL, "_Controllers...", NULL, "Configure controllers", G_CALLBACK(maple_settings_callback) },
12.43 @@ -96,7 +98,7 @@
12.44 "<ui>"
12.45 " <menubar name='MainMenu'>"
12.46 " <menu action='FileMenu'>"
12.47 - " <menuitem action='Mount'/>"
12.48 + " <menuitem action='GdromSettings'/>"
12.49 " <separator/>"
12.50 " <menuitem action='Reset'/>"
12.51 " <menuitem action='Pause'/>"
12.52 @@ -122,7 +124,7 @@
12.53 " </menu>"
12.54 " </menubar>"
12.55 " <toolbar name='MainToolbar'>"
12.56 - " <toolitem action='Mount'/>"
12.57 + " <toolitem action='GdromMount'/>"
12.58 " <toolitem action='Reset'/>"
12.59 " <toolitem action='Pause'/>"
12.60 " <toolitem action='Run'/>"
12.61 @@ -132,7 +134,7 @@
12.62 " </toolbar>"
12.63 " <menubar name='DebugMenu'>"
12.64 " <menu action='FileMenu'>"
12.65 - " <menuitem action='Mount'/>"
12.66 + " <menuitem action='GdromMount'/>"
12.67 " <separator/>"
12.68 " <menuitem action='Reset'/>"
12.69 " <separator/>"
12.70 @@ -166,7 +168,7 @@
12.71 " </menu>"
12.72 " </menubar>"
12.73 " <toolbar name='DebugToolbar'>"
12.74 - " <toolitem action='Mount'/>"
12.75 + " <toolitem action='GdromMount'/>"
12.76 " <toolitem action='Reset'/>"
12.77 " <toolitem action='Pause'/>"
12.78 " <separator/>"
12.79 @@ -180,8 +182,6 @@
12.80 " </toolbar>"
12.81 "</ui>";
12.82
12.83 -
12.84 -
12.85 gboolean gui_parse_cmdline( int *argc, char **argv[] )
12.86 {
12.87 return gtk_init_check( argc, argv );
12.88 @@ -199,6 +199,8 @@
12.89 gtk_gui_enable_action("AudioSettings", FALSE);
12.90 gtk_gui_enable_action("NetworkSettings", FALSE);
12.91 gtk_gui_enable_action("VideoSettings", FALSE);
12.92 + gtk_gui_enable_action("FullScreen", FALSE);
12.93 +
12.94 global_ui_manager = gtk_ui_manager_new();
12.95 gtk_ui_manager_set_add_tearoffs(global_ui_manager, TRUE);
12.96 gtk_ui_manager_insert_action_group( global_ui_manager, global_action_group, 0 );
12.97 @@ -211,8 +213,11 @@
12.98 GtkAccelGroup *accel_group = gtk_ui_manager_get_accel_group (global_ui_manager);
12.99 GtkWidget *menubar = gtk_ui_manager_get_widget(global_ui_manager, "/MainMenu");
12.100 GtkWidget *toolbar = gtk_ui_manager_get_widget(global_ui_manager, "/MainToolbar");
12.101 +
12.102 + GtkWidget *gdrommenuitem = gtk_ui_manager_get_widget(global_ui_manager, "/MainMenu/FileMenu/GdromSettings");
12.103 + GtkWidget *gdrommenu = gdrom_menu_new();
12.104 + gtk_menu_item_set_submenu( GTK_MENU_ITEM(gdrommenuitem), gdrommenu );
12.105 main_win = main_window_new( APP_NAME " " APP_VERSION, menubar, toolbar, accel_group );
12.106 -
12.107 if( withDebug ) {
12.108 gtk_gui_show_debugger();
12.109 }
13.1 --- a/src/gui/gtkui.h Wed Oct 24 21:24:09 2007 +0000
13.2 +++ b/src/gui/gtkui.h Sat Oct 27 05:44:54 2007 +0000
13.3 @@ -1,5 +1,5 @@
13.4 /**
13.5 - * $Id: gtkui.h,v 1.6 2007-10-21 11:38:02 nkeynes Exp $
13.6 + * $Id: gtkui.h,v 1.7 2007-10-27 05:44:54 nkeynes Exp $
13.7 *
13.8 * Core GTK-based user interface
13.9 *
13.10 @@ -63,6 +63,7 @@
13.11 main_window_t gtk_gui_get_main();
13.12 debug_window_t gtk_gui_get_debugger();
13.13 mmio_window_t gtk_gui_get_mmio();
13.14 +void gtk_gui_show_debugger();
13.15
13.16 /********************* Helper functions **********************/
13.17
13.18 @@ -100,6 +101,8 @@
13.19 void debug_runto_action_callback( GtkAction *action, gpointer user_data);
13.20 void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data);
13.21
13.22 +void gdrom_open_direct_callback( GtkWidget *widget, gpointer user_data );
13.23 +
13.24 /*************** Constant colour/font values *****************/
13.25 extern PangoFontDescription *gui_fixed_font;
13.26 extern GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
14.1 --- a/src/main.c Wed Oct 24 21:24:09 2007 +0000
14.2 +++ b/src/main.c Sat Oct 27 05:44:54 2007 +0000
14.3 @@ -1,5 +1,5 @@
14.4 /**
14.5 - * $Id: main.c,v 1.30 2007-10-17 11:26:44 nkeynes Exp $
14.6 + * $Id: main.c,v 1.31 2007-10-27 05:44:54 nkeynes Exp $
14.7 *
14.8 * Main program, initializes dreamcast and gui, then passes control off to
14.9 * the gtk main loop (currently).
14.10 @@ -69,7 +69,7 @@
14.11 textdomain (PACKAGE);
14.12 #endif
14.13 gboolean ui_initialized = gui_parse_cmdline(&argc, &argv);
14.14 -
14.15 +
14.16 while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
14.17 switch( opt ) {
14.18 case 'a': /* AICA only mode - argument is an AICA program */
14.19 @@ -192,6 +192,15 @@
14.20 gdrom_mount_image( disc_file );
14.21 }
14.22
14.23 + if( gdrom_get_current_disc() == NULL ) {
14.24 + disc_file = lxdream_get_config_value( CONFIG_GDROM );
14.25 + if( disc_file != NULL ) {
14.26 + gdrom_mount_image( disc_file );
14.27 + }
14.28 + } else {
14.29 + lxdream_set_global_config_value( CONFIG_GDROM, gdrom_get_current_disc()->name );
14.30 + }
14.31 +
14.32 sh4_set_use_xlat( use_xlat );
14.33
14.34 if( start_immediately ) {
.