Search
lxdream.org :: lxdream :: r492:84e33e4dda1c
lxdream 0.9.1
released Jun 29
Download Now
changeset492:84e33e4dda1c
parent491:515c81624943
child493:c8183f888b14
authornkeynes
dateTue Nov 06 08:35:16 2007 +0000 (13 years ago)
Issue #37: Add nulldc GDI format
src/Makefile.am
src/Makefile.in
src/gdrom/gdi.c
src/gdrom/gdimage.c
src/gdrom/gdrom.c
src/gdrom/gdrom.h
1.1 --- a/src/Makefile.am Sun Nov 04 21:08:44 2007 +0000
1.2 +++ b/src/Makefile.am Tue Nov 06 08:35:16 2007 +0000
1.3 @@ -20,7 +20,7 @@
1.4 asic.c asic.h \
1.5 syscall.c syscall.h bios.c dcload.c \
1.6 gdrom/ide.c gdrom/ide.h gdrom/packet.h gdrom/gdimage.c \
1.7 - gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c gdrom/cdi.c \
1.8 + gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c gdrom/cdi.c gdrom/gdi.c \
1.9 dreamcast.c dreamcast.h eventq.c eventq.h \
1.10 sh4/sh4.c sh4/intc.c sh4/intc.h sh4/sh4mem.c sh4/timer.c sh4/dmac.c \
1.11 sh4/sh4core.c sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h \
2.1 --- a/src/Makefile.in Sun Nov 04 21:08:44 2007 +0000
2.2 +++ b/src/Makefile.in Tue Nov 06 08:35:16 2007 +0000
2.3 @@ -158,7 +158,7 @@
2.4 asic.c asic.h \
2.5 syscall.c syscall.h bios.c dcload.c \
2.6 gdrom/ide.c gdrom/ide.h gdrom/packet.h gdrom/gdimage.c \
2.7 - gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c gdrom/cdi.c \
2.8 + gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c gdrom/cdi.c gdrom/gdi.c \
2.9 dreamcast.c dreamcast.h eventq.c eventq.h \
2.10 sh4/sh4.c sh4/intc.c sh4/intc.h sh4/sh4mem.c sh4/timer.c sh4/dmac.c \
2.11 sh4/sh4core.c sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h \
2.12 @@ -226,41 +226,42 @@
2.13 am__lxdream_SOURCES_DIST = main.c config.c config.h mem.c mem.h mmio.h \
2.14 watch.c asic.c asic.h syscall.c syscall.h bios.c dcload.c \
2.15 gdrom/ide.c gdrom/ide.h gdrom/packet.h gdrom/gdimage.c \
2.16 - gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c gdrom/cdi.c dreamcast.c \
2.17 - dreamcast.h eventq.c eventq.h sh4/sh4.c sh4/intc.c sh4/intc.h \
2.18 - sh4/sh4mem.c sh4/timer.c sh4/dmac.c sh4/sh4core.c sh4/sh4core.h \
2.19 - sh4/sh4dasm.c sh4/sh4dasm.h sh4/sh4mmio.c sh4/sh4mmio.h \
2.20 - sh4/scif.c sh4/xltcache.c sh4/xltcache.h sh4/sh4trans.c \
2.21 - sh4/sh4trans.h sh4/sh4x86.c sh4/sh4stat.c sh4/sh4stat.h \
2.22 - x86dasm/x86dasm.c x86dasm/x86dasm.h x86dasm/i386-dis.c \
2.23 - x86dasm/dis-init.c x86dasm/dis-buf.c aica/armcore.c \
2.24 - aica/armcore.h aica/armdasm.c aica/armmem.c aica/aica.c \
2.25 - aica/aica.h aica/audio.c aica/audio.h pvr2/pvr2.c pvr2/pvr2.h \
2.26 - pvr2/pvr2mem.c pvr2/tacore.c pvr2/render.c pvr2/rendcore.c \
2.27 - pvr2/rendbkg.c pvr2/rendsort.c pvr2/texcache.c pvr2/yuv.c \
2.28 - pvr2/rendsave.c maple/maple.c maple/maple.h maple/controller.c \
2.29 - maple/controller.h gui/gtkui.c gui/gtkui.h gui/main_win.c \
2.30 - gui/gtkcb.c gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
2.31 - gui/ctrl_dlg.c gui/path_dlg.c gui/gdrom_menu.c loader.c \
2.32 - bootstrap.c util.c display.c display.h drivers/audio_null.c \
2.33 - drivers/audio_esd.c drivers/video_null.c drivers/video_gtk.c \
2.34 - drivers/video_gtk.h drivers/video_x11.c drivers/video_x11.h \
2.35 - drivers/gl_common.c drivers/gl_common.h drivers/gl_fbo.c \
2.36 - drivers/gl_sl.c drivers/gl_slsrc.c gdrom/linux.c gdrom/cdnone.c
2.37 + gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c gdrom/cdi.c gdrom/gdi.c \
2.38 + dreamcast.c dreamcast.h eventq.c eventq.h sh4/sh4.c sh4/intc.c \
2.39 + sh4/intc.h sh4/sh4mem.c sh4/timer.c sh4/dmac.c sh4/sh4core.c \
2.40 + sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h sh4/sh4mmio.c \
2.41 + sh4/sh4mmio.h sh4/scif.c sh4/xltcache.c sh4/xltcache.h \
2.42 + sh4/sh4trans.c sh4/sh4trans.h sh4/sh4x86.c sh4/sh4stat.c \
2.43 + sh4/sh4stat.h x86dasm/x86dasm.c x86dasm/x86dasm.h \
2.44 + x86dasm/i386-dis.c x86dasm/dis-init.c x86dasm/dis-buf.c \
2.45 + aica/armcore.c aica/armcore.h aica/armdasm.c aica/armmem.c \
2.46 + aica/aica.c aica/aica.h aica/audio.c aica/audio.h pvr2/pvr2.c \
2.47 + pvr2/pvr2.h pvr2/pvr2mem.c pvr2/tacore.c pvr2/render.c \
2.48 + pvr2/rendcore.c pvr2/rendbkg.c pvr2/rendsort.c pvr2/texcache.c \
2.49 + pvr2/yuv.c pvr2/rendsave.c maple/maple.c maple/maple.h \
2.50 + maple/controller.c maple/controller.h gui/gtkui.c gui/gtkui.h \
2.51 + gui/main_win.c gui/gtkcb.c gui/mmio_win.c gui/debug_win.c \
2.52 + gui/dump_win.c gui/ctrl_dlg.c gui/path_dlg.c gui/gdrom_menu.c \
2.53 + loader.c bootstrap.c util.c display.c display.h \
2.54 + drivers/audio_null.c drivers/audio_esd.c drivers/video_null.c \
2.55 + drivers/video_gtk.c drivers/video_gtk.h drivers/video_x11.c \
2.56 + drivers/video_x11.h drivers/gl_common.c drivers/gl_common.h \
2.57 + drivers/gl_fbo.c drivers/gl_sl.c drivers/gl_slsrc.c \
2.58 + gdrom/linux.c gdrom/cdnone.c
2.59 @CDROM_LINUX_TRUE@am__objects_1 = linux.$(OBJEXT)
2.60 @CDROM_LINUX_FALSE@am__objects_2 = cdnone.$(OBJEXT)
2.61 am_lxdream_OBJECTS = main.$(OBJEXT) config.$(OBJEXT) mem.$(OBJEXT) \
2.62 watch.$(OBJEXT) asic.$(OBJEXT) syscall.$(OBJEXT) bios.$(OBJEXT) \
2.63 dcload.$(OBJEXT) ide.$(OBJEXT) gdimage.$(OBJEXT) \
2.64 - gdrom.$(OBJEXT) nrg.$(OBJEXT) cdi.$(OBJEXT) dreamcast.$(OBJEXT) \
2.65 - eventq.$(OBJEXT) sh4.$(OBJEXT) intc.$(OBJEXT) sh4mem.$(OBJEXT) \
2.66 - timer.$(OBJEXT) dmac.$(OBJEXT) sh4core.$(OBJEXT) \
2.67 - sh4dasm.$(OBJEXT) sh4mmio.$(OBJEXT) scif.$(OBJEXT) \
2.68 - xltcache.$(OBJEXT) sh4trans.$(OBJEXT) sh4x86.$(OBJEXT) \
2.69 - sh4stat.$(OBJEXT) x86dasm.$(OBJEXT) i386-dis.$(OBJEXT) \
2.70 - dis-init.$(OBJEXT) dis-buf.$(OBJEXT) armcore.$(OBJEXT) \
2.71 - armdasm.$(OBJEXT) armmem.$(OBJEXT) aica.$(OBJEXT) \
2.72 - audio.$(OBJEXT) pvr2.$(OBJEXT) pvr2mem.$(OBJEXT) \
2.73 + gdrom.$(OBJEXT) nrg.$(OBJEXT) cdi.$(OBJEXT) gdi.$(OBJEXT) \
2.74 + dreamcast.$(OBJEXT) eventq.$(OBJEXT) sh4.$(OBJEXT) \
2.75 + intc.$(OBJEXT) sh4mem.$(OBJEXT) timer.$(OBJEXT) dmac.$(OBJEXT) \
2.76 + sh4core.$(OBJEXT) sh4dasm.$(OBJEXT) sh4mmio.$(OBJEXT) \
2.77 + scif.$(OBJEXT) xltcache.$(OBJEXT) sh4trans.$(OBJEXT) \
2.78 + sh4x86.$(OBJEXT) sh4stat.$(OBJEXT) x86dasm.$(OBJEXT) \
2.79 + i386-dis.$(OBJEXT) dis-init.$(OBJEXT) dis-buf.$(OBJEXT) \
2.80 + armcore.$(OBJEXT) armdasm.$(OBJEXT) armmem.$(OBJEXT) \
2.81 + aica.$(OBJEXT) audio.$(OBJEXT) pvr2.$(OBJEXT) pvr2mem.$(OBJEXT) \
2.82 tacore.$(OBJEXT) render.$(OBJEXT) rendcore.$(OBJEXT) \
2.83 rendbkg.$(OBJEXT) rendsort.$(OBJEXT) texcache.$(OBJEXT) \
2.84 yuv.$(OBJEXT) rendsave.$(OBJEXT) maple.$(OBJEXT) \
2.85 @@ -305,34 +306,34 @@
2.86 @AMDEP_TRUE@ ./$(DEPDIR)/dis-buf.Po ./$(DEPDIR)/dis-init.Po \
2.87 @AMDEP_TRUE@ ./$(DEPDIR)/display.Po ./$(DEPDIR)/dmac.Po \
2.88 @AMDEP_TRUE@ ./$(DEPDIR)/dreamcast.Po ./$(DEPDIR)/dump_win.Po \
2.89 -@AMDEP_TRUE@ ./$(DEPDIR)/eventq.Po ./$(DEPDIR)/gdimage.Po \
2.90 -@AMDEP_TRUE@ ./$(DEPDIR)/gdrom.Po ./$(DEPDIR)/gdrom_menu.Po \
2.91 -@AMDEP_TRUE@ ./$(DEPDIR)/gendec.Po ./$(DEPDIR)/genglsl.Po \
2.92 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_common.Po ./$(DEPDIR)/gl_fbo.Po \
2.93 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_sl.Po ./$(DEPDIR)/gl_slsrc.Po \
2.94 -@AMDEP_TRUE@ ./$(DEPDIR)/gtkcb.Po ./$(DEPDIR)/gtkui.Po \
2.95 -@AMDEP_TRUE@ ./$(DEPDIR)/i386-dis.Po ./$(DEPDIR)/ide.Po \
2.96 -@AMDEP_TRUE@ ./$(DEPDIR)/insparse.Po ./$(DEPDIR)/intc.Po \
2.97 -@AMDEP_TRUE@ ./$(DEPDIR)/linux.Po ./$(DEPDIR)/loader.Po \
2.98 -@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/main_win.Po \
2.99 -@AMDEP_TRUE@ ./$(DEPDIR)/maple.Po ./$(DEPDIR)/mem.Po \
2.100 -@AMDEP_TRUE@ ./$(DEPDIR)/mmio_win.Po ./$(DEPDIR)/nrg.Po \
2.101 -@AMDEP_TRUE@ ./$(DEPDIR)/path_dlg.Po ./$(DEPDIR)/pvr2.Po \
2.102 -@AMDEP_TRUE@ ./$(DEPDIR)/pvr2mem.Po ./$(DEPDIR)/rendbkg.Po \
2.103 -@AMDEP_TRUE@ ./$(DEPDIR)/rendcore.Po ./$(DEPDIR)/render.Po \
2.104 -@AMDEP_TRUE@ ./$(DEPDIR)/rendsave.Po ./$(DEPDIR)/rendsort.Po \
2.105 -@AMDEP_TRUE@ ./$(DEPDIR)/scif.Po ./$(DEPDIR)/sh4.Po \
2.106 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4core.Po ./$(DEPDIR)/sh4dasm.Po \
2.107 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4mem.Po ./$(DEPDIR)/sh4mmio.Po \
2.108 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4stat.Po ./$(DEPDIR)/sh4trans.Po \
2.109 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4x86.Po ./$(DEPDIR)/syscall.Po \
2.110 -@AMDEP_TRUE@ ./$(DEPDIR)/tacore.Po ./$(DEPDIR)/testsh4x86.Po \
2.111 -@AMDEP_TRUE@ ./$(DEPDIR)/testxlt.Po ./$(DEPDIR)/texcache.Po \
2.112 -@AMDEP_TRUE@ ./$(DEPDIR)/timer.Po ./$(DEPDIR)/util.Po \
2.113 -@AMDEP_TRUE@ ./$(DEPDIR)/video_gtk.Po ./$(DEPDIR)/video_null.Po \
2.114 -@AMDEP_TRUE@ ./$(DEPDIR)/video_x11.Po ./$(DEPDIR)/watch.Po \
2.115 -@AMDEP_TRUE@ ./$(DEPDIR)/x86dasm.Po ./$(DEPDIR)/xltcache.Po \
2.116 -@AMDEP_TRUE@ ./$(DEPDIR)/yuv.Po
2.117 +@AMDEP_TRUE@ ./$(DEPDIR)/eventq.Po ./$(DEPDIR)/gdi.Po \
2.118 +@AMDEP_TRUE@ ./$(DEPDIR)/gdimage.Po ./$(DEPDIR)/gdrom.Po \
2.119 +@AMDEP_TRUE@ ./$(DEPDIR)/gdrom_menu.Po ./$(DEPDIR)/gendec.Po \
2.120 +@AMDEP_TRUE@ ./$(DEPDIR)/genglsl.Po ./$(DEPDIR)/gl_common.Po \
2.121 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_fbo.Po ./$(DEPDIR)/gl_sl.Po \
2.122 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_slsrc.Po ./$(DEPDIR)/gtkcb.Po \
2.123 +@AMDEP_TRUE@ ./$(DEPDIR)/gtkui.Po ./$(DEPDIR)/i386-dis.Po \
2.124 +@AMDEP_TRUE@ ./$(DEPDIR)/ide.Po ./$(DEPDIR)/insparse.Po \
2.125 +@AMDEP_TRUE@ ./$(DEPDIR)/intc.Po ./$(DEPDIR)/linux.Po \
2.126 +@AMDEP_TRUE@ ./$(DEPDIR)/loader.Po ./$(DEPDIR)/main.Po \
2.127 +@AMDEP_TRUE@ ./$(DEPDIR)/main_win.Po ./$(DEPDIR)/maple.Po \
2.128 +@AMDEP_TRUE@ ./$(DEPDIR)/mem.Po ./$(DEPDIR)/mmio_win.Po \
2.129 +@AMDEP_TRUE@ ./$(DEPDIR)/nrg.Po ./$(DEPDIR)/path_dlg.Po \
2.130 +@AMDEP_TRUE@ ./$(DEPDIR)/pvr2.Po ./$(DEPDIR)/pvr2mem.Po \
2.131 +@AMDEP_TRUE@ ./$(DEPDIR)/rendbkg.Po ./$(DEPDIR)/rendcore.Po \
2.132 +@AMDEP_TRUE@ ./$(DEPDIR)/render.Po ./$(DEPDIR)/rendsave.Po \
2.133 +@AMDEP_TRUE@ ./$(DEPDIR)/rendsort.Po ./$(DEPDIR)/scif.Po \
2.134 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4.Po ./$(DEPDIR)/sh4core.Po \
2.135 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4dasm.Po ./$(DEPDIR)/sh4mem.Po \
2.136 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4mmio.Po ./$(DEPDIR)/sh4stat.Po \
2.137 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4trans.Po ./$(DEPDIR)/sh4x86.Po \
2.138 +@AMDEP_TRUE@ ./$(DEPDIR)/syscall.Po ./$(DEPDIR)/tacore.Po \
2.139 +@AMDEP_TRUE@ ./$(DEPDIR)/testsh4x86.Po ./$(DEPDIR)/testxlt.Po \
2.140 +@AMDEP_TRUE@ ./$(DEPDIR)/texcache.Po ./$(DEPDIR)/timer.Po \
2.141 +@AMDEP_TRUE@ ./$(DEPDIR)/util.Po ./$(DEPDIR)/video_gtk.Po \
2.142 +@AMDEP_TRUE@ ./$(DEPDIR)/video_null.Po ./$(DEPDIR)/video_x11.Po \
2.143 +@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po ./$(DEPDIR)/x86dasm.Po \
2.144 +@AMDEP_TRUE@ ./$(DEPDIR)/xltcache.Po ./$(DEPDIR)/yuv.Po
2.145 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
2.146 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
2.147 CCLD = $(CC)
2.148 @@ -430,6 +431,7 @@
2.149 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dreamcast.Po@am__quote@
2.150 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump_win.Po@am__quote@
2.151 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventq.Po@am__quote@
2.152 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdi.Po@am__quote@
2.153 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdimage.Po@am__quote@
2.154 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrom.Po@am__quote@
2.155 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrom_menu.Po@am__quote@
2.156 @@ -705,6 +707,28 @@
2.157 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.158 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdi.obj `if test -f 'gdrom/cdi.c'; then $(CYGPATH_W) 'gdrom/cdi.c'; else $(CYGPATH_W) '$(srcdir)/gdrom/cdi.c'; fi`
2.159
2.160 +gdi.o: gdrom/gdi.c
2.161 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdi.o -MD -MP -MF "$(DEPDIR)/gdi.Tpo" \
2.162 +@am__fastdepCC_TRUE@ -c -o gdi.o `test -f 'gdrom/gdi.c' || echo '$(srcdir)/'`gdrom/gdi.c; \
2.163 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdi.Tpo" "$(DEPDIR)/gdi.Po"; \
2.164 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdi.Tpo"; exit 1; \
2.165 +@am__fastdepCC_TRUE@ fi
2.166 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gdrom/gdi.c' object='gdi.o' libtool=no @AMDEPBACKSLASH@
2.167 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdi.Po' tmpdepfile='$(DEPDIR)/gdi.TPo' @AMDEPBACKSLASH@
2.168 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.169 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdi.o `test -f 'gdrom/gdi.c' || echo '$(srcdir)/'`gdrom/gdi.c
2.170 +
2.171 +gdi.obj: gdrom/gdi.c
2.172 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdi.obj -MD -MP -MF "$(DEPDIR)/gdi.Tpo" \
2.173 +@am__fastdepCC_TRUE@ -c -o gdi.obj `if test -f 'gdrom/gdi.c'; then $(CYGPATH_W) 'gdrom/gdi.c'; else $(CYGPATH_W) '$(srcdir)/gdrom/gdi.c'; fi`; \
2.174 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdi.Tpo" "$(DEPDIR)/gdi.Po"; \
2.175 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdi.Tpo"; exit 1; \
2.176 +@am__fastdepCC_TRUE@ fi
2.177 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gdrom/gdi.c' object='gdi.obj' libtool=no @AMDEPBACKSLASH@
2.178 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdi.Po' tmpdepfile='$(DEPDIR)/gdi.TPo' @AMDEPBACKSLASH@
2.179 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.180 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdi.obj `if test -f 'gdrom/gdi.c'; then $(CYGPATH_W) 'gdrom/gdi.c'; else $(CYGPATH_W) '$(srcdir)/gdrom/gdi.c'; fi`
2.181 +
2.182 sh4.o: sh4/sh4.c
2.183 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sh4.o -MD -MP -MF "$(DEPDIR)/sh4.Tpo" \
2.184 @am__fastdepCC_TRUE@ -c -o sh4.o `test -f 'sh4/sh4.c' || echo '$(srcdir)/'`sh4/sh4.c; \
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/src/gdrom/gdi.c Tue Nov 06 08:35:16 2007 +0000
3.3 @@ -0,0 +1,127 @@
3.4 +/**
3.5 + * $Id: gdi.c,v 1.1 2007-11-06 08:35:16 nkeynes Exp $
3.6 + *
3.7 + * NullDC GDI image format
3.8 + *
3.9 + * Copyright (c) 2005 Nathan Keynes.
3.10 + *
3.11 + * This program is free software; you can redistribute it and/or modify
3.12 + * it under the terms of the GNU General Public License as published by
3.13 + * the Free Software Foundation; either version 2 of the License, or
3.14 + * (at your option) any later version.
3.15 + *
3.16 + * This program is distributed in the hope that it will be useful,
3.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.19 + * GNU General Public License for more details.
3.20 + */
3.21 +
3.22 +#include <stdlib.h>
3.23 +#include <stdio.h>
3.24 +#include <stdint.h>
3.25 +#include <fcntl.h>
3.26 +#include <errno.h>
3.27 +#include <sys/stat.h>
3.28 +#include <glib/gutils.h>
3.29 +#include "gdrom/gdrom.h"
3.30 +
3.31 +
3.32 +static gboolean gdi_image_is_valid( FILE *f );
3.33 +static gdrom_disc_t gdi_image_open( const gchar *filename, FILE *f );
3.34 +
3.35 +struct gdrom_image_class gdi_image_class = { "NullDC GD-Rom Image", "gdi",
3.36 + gdi_image_is_valid, gdi_image_open };
3.37 +
3.38 +static gboolean gdi_image_is_valid( FILE *f )
3.39 +{
3.40 + char line[512];
3.41 + uint32_t track_count;
3.42 +
3.43 + fseek(f, 0, SEEK_SET);
3.44 + if( fgets( line, sizeof(line), f ) == NULL ) {
3.45 + return FALSE;
3.46 + }
3.47 + track_count = strtoul(line, NULL, 0);
3.48 + if( track_count == 0 || track_count > 99 ) {
3.49 + return FALSE;
3.50 + }
3.51 + return TRUE;
3.52 +}
3.53 +
3.54 +static gdrom_disc_t gdi_image_open( const gchar *filename, FILE *f )
3.55 +{
3.56 + int i;
3.57 + uint32_t track_count;
3.58 + gdrom_disc_t disc;
3.59 + gdrom_image_t image;
3.60 + struct stat st;
3.61 + char line[512];
3.62 + gchar *dirname;
3.63 +
3.64 + fseek(f, 0, SEEK_SET);
3.65 +
3.66 + if( fgets( line, sizeof(line), f ) == NULL ) {
3.67 + return FALSE;
3.68 + }
3.69 + track_count = strtoul(line, NULL, 0);
3.70 + if( track_count == 0 || track_count > 99 ) {
3.71 + return NULL;
3.72 + }
3.73 +
3.74 + disc = gdrom_image_new(filename, f);
3.75 + if( disc == NULL ) {
3.76 + ERROR("Unable to allocate memory!");
3.77 + return NULL;
3.78 + }
3.79 + dirname = g_path_get_dirname(filename);
3.80 + image = (gdrom_image_t)disc;
3.81 + image->disc_type = IDE_DISC_GDROM;
3.82 + image->track_count = track_count;
3.83 + for( i=0; i<track_count; i++ ) {
3.84 + int track_no, start_lba, flags, size, offset;
3.85 + char filename[256];
3.86 +
3.87 + if( fgets( line, sizeof(line), f ) == NULL ) {
3.88 + gdrom_image_destroy_no_close(disc);
3.89 + return NULL;
3.90 + }
3.91 + sscanf( line, "%d %d %d %d %s %d", &track_no, &start_lba, &flags, &size,
3.92 + &filename, &offset );
3.93 + if( start_lba >= 45000 ) {
3.94 + image->track[i].session = 1;
3.95 + } else {
3.96 + image->track[i].session = 0;
3.97 + }
3.98 + image->track[i].lba = start_lba + 150; // 2-second offset
3.99 + image->track[i].flags = (flags & 0x0F)<<4;
3.100 + image->track[i].sector_size = size;
3.101 + if( strcasecmp( filename, "none" ) == 0 ) {
3.102 + image->track[i].file = NULL;
3.103 + image->track[i].sector_count = 0;
3.104 + image->track[i].mode = GDROM_MODE1;
3.105 + } else {
3.106 + gchar *pathname = g_strdup_printf( "%s%c%s", dirname, G_DIR_SEPARATOR, filename );
3.107 + image->track[i].file = fopen( pathname, "ro" );
3.108 + g_free(pathname);
3.109 + if( image->track[i].file == NULL ) {
3.110 + gdrom_image_destroy_no_close(disc);
3.111 + g_free(dirname);
3.112 + return NULL;
3.113 + }
3.114 + fstat( fileno(image->track[i].file), &st );
3.115 + image->track[i].sector_count = st.st_size / size;
3.116 + switch(size) {
3.117 + case 2048: image->track[i].mode = GDROM_MODE1; break;
3.118 + case 2336: image->track[i].mode = GDROM_GD; break;
3.119 + case 2352: image->track[i].mode = GDROM_CDDA; break;
3.120 + default:
3.121 + gdrom_image_destroy_no_close(disc);
3.122 + g_free(dirname);
3.123 + return NULL;
3.124 + }
3.125 + }
3.126 + image->track[i].offset = offset;
3.127 + }
3.128 + g_free(dirname);
3.129 + return disc;
3.130 +}
4.1 --- a/src/gdrom/gdimage.c Sun Nov 04 21:08:44 2007 +0000
4.2 +++ b/src/gdrom/gdimage.c Tue Nov 06 08:35:16 2007 +0000
4.3 @@ -1,5 +1,5 @@
4.4 /**
4.5 - * $Id: gdimage.c,v 1.5 2007-10-31 11:53:35 nkeynes Exp $
4.6 + * $Id: gdimage.c,v 1.6 2007-11-06 08:35:16 nkeynes Exp $
4.7 *
4.8 * GD-Rom image-file common functions.
4.9 *
4.10 @@ -68,11 +68,20 @@
4.11
4.12 static void gdrom_image_destroy( gdrom_disc_t disc )
4.13 {
4.14 + int i;
4.15 + FILE *lastfile = NULL;
4.16 gdrom_image_t img = (gdrom_image_t)disc;
4.17 if( img->file != NULL ) {
4.18 fclose(img->file);
4.19 img->file = NULL;
4.20 }
4.21 + for( i=0; i<img->track_count; i++ ) {
4.22 + if( img->track[i].file != NULL && img->track[i].file != lastfile ) {
4.23 + lastfile = img->track[i].file;
4.24 + fclose(lastfile);
4.25 + img->track[i].file = NULL;
4.26 + }
4.27 + }
4.28 if( disc->name != NULL ) {
4.29 g_free( (gpointer)disc->name );
4.30 disc->name = NULL;
4.31 @@ -82,10 +91,19 @@
4.32
4.33 void gdrom_image_destroy_no_close( gdrom_disc_t disc )
4.34 {
4.35 + int i;
4.36 + FILE *lastfile = NULL;
4.37 gdrom_image_t img = (gdrom_image_t)disc;
4.38 if( img->file != NULL ) {
4.39 img->file = NULL;
4.40 }
4.41 + for( i=0; i<img->track_count; i++ ) {
4.42 + if( img->track[i].file != NULL && img->track[i].file != lastfile ) {
4.43 + lastfile = img->track[i].file;
4.44 + fclose(lastfile);
4.45 + img->track[i].file = NULL;
4.46 + }
4.47 + }
4.48 if( disc->name != NULL ) {
4.49 g_free( (gpointer)disc->name );
4.50 disc->name = NULL;
4.51 @@ -105,11 +123,33 @@
4.52 return -1;
4.53 }
4.54
4.55 +/**
4.56 + * Read a block from an image file, handling negative file offsets
4.57 + * with 0-fill.
4.58 + */
4.59 +static void gdrom_read_block( char *buf, int file_offset, int length, FILE *f )
4.60 +{
4.61 + if( file_offset < 0 ) {
4.62 + int size = -file_offset;
4.63 + if( size >= length ) {
4.64 + memset( buf, 0, length );
4.65 + return;
4.66 + } else {
4.67 + memset( buf, 0, size );
4.68 + file_offset = 0;
4.69 + length -= size;
4.70 + }
4.71 + }
4.72 + fseek( f, file_offset, SEEK_SET );
4.73 + fread( buf, length, 1, f );
4.74 +}
4.75 +
4.76 static gdrom_error_t gdrom_image_read_sector( gdrom_disc_t disc, uint32_t lba,
4.77 int mode, unsigned char *buf, uint32_t *length )
4.78 {
4.79 gdrom_image_t image = (gdrom_image_t)disc;
4.80 int file_offset, read_len, track_no;
4.81 + FILE *f;
4.82
4.83 track_no = gdrom_image_get_track_by_lba( image, lba );
4.84 if( track_no == -1 ) {
4.85 @@ -118,6 +158,13 @@
4.86 struct gdrom_track *track = &image->track[track_no-1];
4.87 file_offset = track->offset + track->sector_size * (lba - track->lba);
4.88 read_len = track->sector_size;
4.89 + if( track->file != NULL ) {
4.90 + f = track->file;
4.91 + } else {
4.92 + f = image->file;
4.93 + }
4.94 +
4.95 +
4.96
4.97 switch( mode ) {
4.98 case 0x24:
4.99 @@ -125,14 +172,12 @@
4.100 switch( track->mode ) {
4.101 case GDROM_MODE1:
4.102 case GDROM_MODE2_XA1:
4.103 - fseek( image->file, file_offset, SEEK_SET );
4.104 - fread( buf, track->sector_size, 1, image->file );
4.105 + gdrom_read_block( buf, file_offset, track->sector_size, f );
4.106 break;
4.107 case GDROM_MODE2:
4.108 read_len = 2048;
4.109 file_offset += 8; /* skip the subheader */
4.110 - fseek( image->file, file_offset, SEEK_SET );
4.111 - fread( buf, 2048, 1, image->file );
4.112 + gdrom_read_block( buf, file_offset, 2048, f );
4.113 break;
4.114 default:
4.115 return PKT_ERR_BADREADMODE;
5.1 --- a/src/gdrom/gdrom.c Sun Nov 04 21:08:44 2007 +0000
5.2 +++ b/src/gdrom/gdrom.c Tue Nov 06 08:35:16 2007 +0000
5.3 @@ -1,6 +1,6 @@
5.4
5.5 /**
5.6 - * $Id: gdrom.c,v 1.18 2007-11-04 05:07:49 nkeynes Exp $
5.7 + * $Id: gdrom.c,v 1.19 2007-11-06 08:35:16 nkeynes Exp $
5.8 *
5.9 * GD-Rom access functions.
5.10 *
5.11 @@ -27,7 +27,11 @@
5.12
5.13 extern gdrom_disc_t gdrom_disc;
5.14
5.15 -gdrom_image_class_t gdrom_image_classes[] = { &cdrom_device_class, &nrg_image_class, &cdi_image_class, NULL };
5.16 +gdrom_image_class_t gdrom_image_classes[] = { &cdrom_device_class,
5.17 + &nrg_image_class,
5.18 + &cdi_image_class,
5.19 + &gdi_image_class,
5.20 + NULL };
5.21
5.22 char *gdrom_mode_names[] = { "Mode1", "Mode2", "XA 1", "XA2", "Audio", "GD-Rom" };
5.23 uint32_t gdrom_sector_size[] = { 2048, 2336, 2048, 2324, 2352, 2336 };
6.1 --- a/src/gdrom/gdrom.h Sun Nov 04 21:08:44 2007 +0000
6.2 +++ b/src/gdrom/gdrom.h Tue Nov 06 08:35:16 2007 +0000
6.3 @@ -1,5 +1,5 @@
6.4 /**
6.5 - * $Id: gdrom.h,v 1.15 2007-11-04 05:07:49 nkeynes Exp $
6.6 + * $Id: gdrom.h,v 1.16 2007-11-06 08:35:16 nkeynes Exp $
6.7 *
6.8 * This file defines the structures and functions used by the GD-Rom
6.9 * disc driver. (ie, the modules that supply a CD image to be used by the
6.10 @@ -70,6 +70,7 @@
6.11 uint32_t sector_size; /* For convenience, determined by mode */
6.12 uint32_t sector_count;
6.13 uint32_t offset; /* File offset of start of track - image files only */
6.14 + FILE *file;
6.15 } *gdrom_track_t;
6.16
6.17 typedef struct gdrom_disc {
6.18 @@ -163,6 +164,7 @@
6.19
6.20 extern struct gdrom_image_class nrg_image_class;
6.21 extern struct gdrom_image_class cdi_image_class;
6.22 +extern struct gdrom_image_class gdi_image_class;
6.23 extern struct gdrom_image_class cdrom_device_class;
6.24
6.25 /**
.