Search
lxdream.org :: lxdream :: r1107:7b279d10f46f
lxdream 0.9.1
released Jun 29
Download Now
changeset1107:7b279d10f46f
parent1106:1879fd49ccf6
child1108:305ef2082079
authornkeynes
dateMon May 17 22:01:23 2010 +1000 (9 years ago)
Rip out my hacked-up isofs code and replace with libisofs. Much better.
configure
configure.in
src/Makefile.am
src/Makefile.in
src/bios.c
src/drivers/cdrom/iso_impl.h
src/drivers/cdrom/isofs.c
src/drivers/cdrom/isofs.h
src/drivers/cdrom/isoread.c
src/drivers/cdrom/isoread.h
src/drivers/cdrom/sector.c
src/drivers/cdrom/sector.h
src/main.c
src/test/testisoread.c
1.1 --- a/configure Tue Mar 23 19:48:03 2010 +1000
1.2 +++ b/configure Mon May 17 22:01:23 2010 +1000
1.3 @@ -9224,6 +9224,226 @@
1.4 fi
1.5
1.6
1.7 +if test "${ac_cv_header_libisofs_libisofs_h+set}" = set; then
1.8 + { $as_echo "$as_me:$LINENO: checking for libisofs/libisofs.h" >&5
1.9 +$as_echo_n "checking for libisofs/libisofs.h... " >&6; }
1.10 +if test "${ac_cv_header_libisofs_libisofs_h+set}" = set; then
1.11 + $as_echo_n "(cached) " >&6
1.12 +fi
1.13 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libisofs_libisofs_h" >&5
1.14 +$as_echo "$ac_cv_header_libisofs_libisofs_h" >&6; }
1.15 +else
1.16 + # Is the header compilable?
1.17 +{ $as_echo "$as_me:$LINENO: checking libisofs/libisofs.h usability" >&5
1.18 +$as_echo_n "checking libisofs/libisofs.h usability... " >&6; }
1.19 +cat >conftest.$ac_ext <<_ACEOF
1.20 +/* confdefs.h. */
1.21 +_ACEOF
1.22 +cat confdefs.h >>conftest.$ac_ext
1.23 +cat >>conftest.$ac_ext <<_ACEOF
1.24 +/* end confdefs.h. */
1.25 +$ac_includes_default
1.26 +#include <libisofs/libisofs.h>
1.27 +_ACEOF
1.28 +rm -f conftest.$ac_objext
1.29 +if { (ac_try="$ac_compile"
1.30 +case "(($ac_try" in
1.31 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1.32 + *) ac_try_echo=$ac_try;;
1.33 +esac
1.34 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
1.35 +$as_echo "$ac_try_echo") >&5
1.36 + (eval "$ac_compile") 2>conftest.er1
1.37 + ac_status=$?
1.38 + grep -v '^ *+' conftest.er1 >conftest.err
1.39 + rm -f conftest.er1
1.40 + cat conftest.err >&5
1.41 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
1.42 + (exit $ac_status); } && {
1.43 + test -z "$ac_c_werror_flag" ||
1.44 + test ! -s conftest.err
1.45 + } && test -s conftest.$ac_objext; then
1.46 + ac_header_compiler=yes
1.47 +else
1.48 + $as_echo "$as_me: failed program was:" >&5
1.49 +sed 's/^/| /' conftest.$ac_ext >&5
1.50 +
1.51 + ac_header_compiler=no
1.52 +fi
1.53 +
1.54 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1.55 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
1.56 +$as_echo "$ac_header_compiler" >&6; }
1.57 +
1.58 +# Is the header present?
1.59 +{ $as_echo "$as_me:$LINENO: checking libisofs/libisofs.h presence" >&5
1.60 +$as_echo_n "checking libisofs/libisofs.h presence... " >&6; }
1.61 +cat >conftest.$ac_ext <<_ACEOF
1.62 +/* confdefs.h. */
1.63 +_ACEOF
1.64 +cat confdefs.h >>conftest.$ac_ext
1.65 +cat >>conftest.$ac_ext <<_ACEOF
1.66 +/* end confdefs.h. */
1.67 +#include <libisofs/libisofs.h>
1.68 +_ACEOF
1.69 +if { (ac_try="$ac_cpp conftest.$ac_ext"
1.70 +case "(($ac_try" in
1.71 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1.72 + *) ac_try_echo=$ac_try;;
1.73 +esac
1.74 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
1.75 +$as_echo "$ac_try_echo") >&5
1.76 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
1.77 + ac_status=$?
1.78 + grep -v '^ *+' conftest.er1 >conftest.err
1.79 + rm -f conftest.er1
1.80 + cat conftest.err >&5
1.81 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
1.82 + (exit $ac_status); } >/dev/null && {
1.83 + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1.84 + test ! -s conftest.err
1.85 + }; then
1.86 + ac_header_preproc=yes
1.87 +else
1.88 + $as_echo "$as_me: failed program was:" >&5
1.89 +sed 's/^/| /' conftest.$ac_ext >&5
1.90 +
1.91 + ac_header_preproc=no
1.92 +fi
1.93 +
1.94 +rm -f conftest.err conftest.$ac_ext
1.95 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
1.96 +$as_echo "$ac_header_preproc" >&6; }
1.97 +
1.98 +# So? What about this header?
1.99 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
1.100 + yes:no: )
1.101 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: accepted by the compiler, rejected by the preprocessor!" >&5
1.102 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
1.103 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: proceeding with the compiler's result" >&5
1.104 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: proceeding with the compiler's result" >&2;}
1.105 + ac_header_preproc=yes
1.106 + ;;
1.107 + no:yes:* )
1.108 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: present but cannot be compiled" >&5
1.109 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: present but cannot be compiled" >&2;}
1.110 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: check for missing prerequisite headers?" >&5
1.111 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: check for missing prerequisite headers?" >&2;}
1.112 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: see the Autoconf documentation" >&5
1.113 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: see the Autoconf documentation" >&2;}
1.114 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: section \"Present But Cannot Be Compiled\"" >&5
1.115 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: section \"Present But Cannot Be Compiled\"" >&2;}
1.116 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: proceeding with the preprocessor's result" >&5
1.117 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: proceeding with the preprocessor's result" >&2;}
1.118 + { $as_echo "$as_me:$LINENO: WARNING: libisofs/libisofs.h: in the future, the compiler will take precedence" >&5
1.119 +$as_echo "$as_me: WARNING: libisofs/libisofs.h: in the future, the compiler will take precedence" >&2;}
1.120 +
1.121 + ;;
1.122 +esac
1.123 +{ $as_echo "$as_me:$LINENO: checking for libisofs/libisofs.h" >&5
1.124 +$as_echo_n "checking for libisofs/libisofs.h... " >&6; }
1.125 +if test "${ac_cv_header_libisofs_libisofs_h+set}" = set; then
1.126 + $as_echo_n "(cached) " >&6
1.127 +else
1.128 + ac_cv_header_libisofs_libisofs_h=$ac_header_preproc
1.129 +fi
1.130 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libisofs_libisofs_h" >&5
1.131 +$as_echo "$ac_cv_header_libisofs_libisofs_h" >&6; }
1.132 +
1.133 +fi
1.134 +if test "x$ac_cv_header_libisofs_libisofs_h" = x""yes; then
1.135 +
1.136 + { $as_echo "$as_me:$LINENO: checking for iso_data_source_new_from_file in -lisofs" >&5
1.137 +$as_echo_n "checking for iso_data_source_new_from_file in -lisofs... " >&6; }
1.138 +if test "${ac_cv_lib_isofs_iso_data_source_new_from_file+set}" = set; then
1.139 + $as_echo_n "(cached) " >&6
1.140 +else
1.141 + ac_check_lib_save_LIBS=$LIBS
1.142 +LIBS="-lisofs $LIBS"
1.143 +cat >conftest.$ac_ext <<_ACEOF
1.144 +/* confdefs.h. */
1.145 +_ACEOF
1.146 +cat confdefs.h >>conftest.$ac_ext
1.147 +cat >>conftest.$ac_ext <<_ACEOF
1.148 +/* end confdefs.h. */
1.149 +
1.150 +/* Override any GCC internal prototype to avoid an error.
1.151 + Use char because int might match the return type of a GCC
1.152 + builtin and then its argument prototype would still apply. */
1.153 +#ifdef __cplusplus
1.154 +extern "C"
1.155 +#endif
1.156 +char iso_data_source_new_from_file ();
1.157 +int
1.158 +main ()
1.159 +{
1.160 +return iso_data_source_new_from_file ();
1.161 + ;
1.162 + return 0;
1.163 +}
1.164 +_ACEOF
1.165 +rm -f conftest.$ac_objext conftest$ac_exeext
1.166 +if { (ac_try="$ac_link"
1.167 +case "(($ac_try" in
1.168 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1.169 + *) ac_try_echo=$ac_try;;
1.170 +esac
1.171 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
1.172 +$as_echo "$ac_try_echo") >&5
1.173 + (eval "$ac_link") 2>conftest.er1
1.174 + ac_status=$?
1.175 + grep -v '^ *+' conftest.er1 >conftest.err
1.176 + rm -f conftest.er1
1.177 + cat conftest.err >&5
1.178 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
1.179 + (exit $ac_status); } && {
1.180 + test -z "$ac_c_werror_flag" ||
1.181 + test ! -s conftest.err
1.182 + } && test -s conftest$ac_exeext && {
1.183 + test "$cross_compiling" = yes ||
1.184 + $as_test_x conftest$ac_exeext
1.185 + }; then
1.186 + ac_cv_lib_isofs_iso_data_source_new_from_file=yes
1.187 +else
1.188 + $as_echo "$as_me: failed program was:" >&5
1.189 +sed 's/^/| /' conftest.$ac_ext >&5
1.190 +
1.191 + ac_cv_lib_isofs_iso_data_source_new_from_file=no
1.192 +fi
1.193 +
1.194 +rm -rf conftest.dSYM
1.195 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
1.196 + conftest$ac_exeext conftest.$ac_ext
1.197 +LIBS=$ac_check_lib_save_LIBS
1.198 +fi
1.199 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_isofs_iso_data_source_new_from_file" >&5
1.200 +$as_echo "$ac_cv_lib_isofs_iso_data_source_new_from_file" >&6; }
1.201 +if test "x$ac_cv_lib_isofs_iso_data_source_new_from_file" = x""yes; then
1.202 +
1.203 + LIBS="$LIBS -lisofs"
1.204 +
1.205 +else
1.206 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
1.207 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1.208 +{ { $as_echo "$as_me:$LINENO: error: \"Libisofs library not found, but is required\"
1.209 +See \`config.log' for more details." >&5
1.210 +$as_echo "$as_me: error: \"Libisofs library not found, but is required\"
1.211 +See \`config.log' for more details." >&2;}
1.212 + { (exit 1); exit 1; }; }; }
1.213 +fi
1.214 +
1.215 +else
1.216 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
1.217 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1.218 +{ { $as_echo "$as_me:$LINENO: error: \"Libisofs headers not found, but is required\"
1.219 +See \`config.log' for more details." >&5
1.220 +$as_echo "$as_me: error: \"Libisofs headers not found, but is required\"
1.221 +See \`config.log' for more details." >&2;}
1.222 + { (exit 1); exit 1; }; }; }
1.223 +fi
1.224 +
1.225 +
1.226 +
1.227 if test "x$with_osmesa" != xno; then
1.228
1.229
2.1 --- a/configure.in Tue Mar 23 19:48:03 2010 +1000
2.2 +++ b/configure.in Mon May 17 22:01:23 2010 +1000
2.3 @@ -217,6 +217,12 @@
2.4
2.5 AM_CONDITIONAL(GUI_GTK, [test "$HAVE_GTK" = 'yes'])
2.6
2.7 +AC_CHECK_HEADER([libisofs/libisofs.h], [
2.8 + AC_CHECK_LIB(isofs, [iso_data_source_new_from_file], [
2.9 + LIBS="$LIBS -lisofs"
2.10 + ], [ AC_MSG_FAILURE( ["Libisofs library not found, but is required"]) ])],
2.11 + [ AC_MSG_FAILURE( ["Libisofs headers not found, but is required"]) ])
2.12 +
2.13 dnl ------------------ Video driver support -------------------
2.14 AS_IF([test "x$with_osmesa" != xno], [
2.15
3.1 --- a/src/Makefile.am Tue Mar 23 19:48:03 2010 +1000
3.2 +++ b/src/Makefile.am Mon May 17 22:01:23 2010 +1000
3.3 @@ -13,7 +13,7 @@
3.4 PLUGINLDFLAGS = @PLUGINLDFLAGS@
3.5 bin_PROGRAMS = lxdream
3.6 noinst_PROGRAMS = gendec genglsl genmach
3.7 -check_PROGRAMS = test/testxlt test/testisoread
3.8 +check_PROGRAMS = test/testxlt
3.9
3.10 pkglib_PROGRAMS=
3.11 EXTRA_DIST=drivers/genkeymap.pl checkver.pl drivers/dummy.c
3.12 @@ -74,7 +74,7 @@
3.13 drivers/cdrom/edc_ecc.c drivers/cdrom/ecc.h drivers/cdrom/drive.c \
3.14 drivers/cdrom/edc_crctable.h drivers/cdrom/edc_encoder.h \
3.15 drivers/cdrom/edc_l2sq.h drivers/cdrom/edc_scramble.h drivers/cdrom/cd_mmc.c \
3.16 - drivers/cdrom/isoread.h drivers/cdrom/isoread.c drivers/cdrom/iso_impl.h \
3.17 + drivers/cdrom/isofs.h drivers/cdrom/isofs.c \
3.18 sh4/sh4.def sh4/sh4core.in sh4/sh4x86.in sh4/sh4dasm.in sh4/sh4stat.in \
3.19 hotkeys.c hotkeys.h
3.20 lxdream_CPPFLAGS = @LXDREAMCPPFLAGS@
3.21 @@ -241,15 +241,6 @@
3.22
3.23
3.24 test_testxlt_SOURCES = test/testxlt.c xlat/xltcache.c xlat/xltcache.h
3.25 -test_testisoread_SOURCES = test/testisoread.c drivers/cdrom/isoread.c \
3.26 - drivers/cdrom/isoread.h drivers/cdrom/isofs_impl.h drivers/cdrom/ecc.h \
3.27 - drivers/cdrom/cdrom.c drivers/cdrom/cdrom.h drivers/cdrom/sector.h \
3.28 - drivers/cdrom/sector.c drivers/cdrom/cdimpl.h drivers/cdrom/edc_ecc.c \
3.29 - drivers/cdrom/edc_crctable.h drivers/cdrom/edc_encoder.h \
3.30 - drivers/cdrom/edc_l2sq.h drivers/cdrom/edc_scramble.h \
3.31 - drivers/cdrom/defs.h drivers/cdrom/drive.h drivers/cdrom/drive.c \
3.32 - drivers/cdrom/cd_nrg.c drivers/cdrom/cd_cdi.c drivers/cdrom/cd_gdi.c
3.33 -test_testisoread_LDADD = @GLIB_LIBS@ $(INTLLIBS)
3.34
3.35 sh4/sh4core.c: gendec sh4/sh4.def sh4/sh4core.in
3.36 $(mkdir_p) `dirname $@`
4.1 --- a/src/Makefile.in Tue Mar 23 19:48:03 2010 +1000
4.2 +++ b/src/Makefile.in Mon May 17 22:01:23 2010 +1000
4.3 @@ -38,8 +38,7 @@
4.4 host_triplet = @host@
4.5 bin_PROGRAMS = lxdream$(EXEEXT)
4.6 noinst_PROGRAMS = gendec$(EXEEXT) genglsl$(EXEEXT) genmach$(EXEEXT)
4.7 -check_PROGRAMS = test/testxlt$(EXEEXT) test/testisoread$(EXEEXT) \
4.8 - $(am__EXEEXT_1)
4.9 +check_PROGRAMS = test/testxlt$(EXEEXT) $(am__EXEEXT_1)
4.10 pkglib_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) \
4.11 $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7)
4.12 @BUILD_SHARED_TRUE@am__append_1 = plugin.c plugin.h
4.13 @@ -175,29 +174,28 @@
4.14 drivers/cdrom/ecc.h drivers/cdrom/drive.c \
4.15 drivers/cdrom/edc_crctable.h drivers/cdrom/edc_encoder.h \
4.16 drivers/cdrom/edc_l2sq.h drivers/cdrom/edc_scramble.h \
4.17 - drivers/cdrom/cd_mmc.c drivers/cdrom/isoread.h \
4.18 - drivers/cdrom/isoread.c drivers/cdrom/iso_impl.h sh4/sh4.def \
4.19 - sh4/sh4core.in sh4/sh4x86.in sh4/sh4dasm.in sh4/sh4stat.in \
4.20 - hotkeys.c hotkeys.h plugin.c plugin.h sh4/sh4x86.c \
4.21 - xlat/x86/x86op.h xlat/x86/ia32abi.h xlat/x86/amd64abi.h \
4.22 - sh4/sh4trans.c sh4/sh4trans.h sh4/mmux86.c x86dasm/x86dasm.c \
4.23 - x86dasm/x86dasm.h x86dasm/i386-dis.c x86dasm/dis-init.c \
4.24 - x86dasm/dis-buf.c x86dasm/ansidecl.h x86dasm/bfd.h \
4.25 - x86dasm/dis-asm.h x86dasm/symcat.h x86dasm/sysdep.h \
4.26 - gtkui/gtkui.c gtkui/gtkui.h gtkui/gtk_win.c gtkui/gtkcb.c \
4.27 - gtkui/gtk_cfg.c gtkui/gtk_mmio.c gtkui/gtk_debug.c \
4.28 - gtkui/gtk_dump.c gtkui/gtk_ctrl.c gtkui/gtk_gd.c \
4.29 - drivers/io_glib.c drivers/video_gtk.c cocoaui/cocoaui.m \
4.30 - cocoaui/cocoaui.h cocoaui/cocoa_cfg.m cocoaui/cocoa_win.m \
4.31 - cocoaui/cocoa_gd.m cocoaui/cocoa_prefs.m cocoaui/cocoa_ctrl.m \
4.32 - cocoaui/paths_osx.m drivers/io_osx.m drivers/video_osx.m \
4.33 - drivers/mac_keymap.h drivers/mac_keymap.txt paths_unix.c \
4.34 - drivers/video_gdk.c drivers/video_glx.c drivers/video_glx.h \
4.35 - drivers/video_nsgl.m drivers/video_nsgl.h drivers/audio_osx.m \
4.36 - drivers/audio_sdl.c drivers/audio_pulse.c drivers/audio_esd.c \
4.37 - drivers/audio_alsa.c drivers/input_lirc.c \
4.38 - drivers/cdrom/cd_linux.c drivers/cdrom/cd_osx.c \
4.39 - drivers/osx_iokit.m drivers/osx_iokit.h \
4.40 + drivers/cdrom/cd_mmc.c drivers/cdrom/isofs.h \
4.41 + drivers/cdrom/isofs.c sh4/sh4.def sh4/sh4core.in sh4/sh4x86.in \
4.42 + sh4/sh4dasm.in sh4/sh4stat.in hotkeys.c hotkeys.h plugin.c \
4.43 + plugin.h sh4/sh4x86.c xlat/x86/x86op.h xlat/x86/ia32abi.h \
4.44 + xlat/x86/amd64abi.h sh4/sh4trans.c sh4/sh4trans.h sh4/mmux86.c \
4.45 + x86dasm/x86dasm.c x86dasm/x86dasm.h x86dasm/i386-dis.c \
4.46 + x86dasm/dis-init.c x86dasm/dis-buf.c x86dasm/ansidecl.h \
4.47 + x86dasm/bfd.h x86dasm/dis-asm.h x86dasm/symcat.h \
4.48 + x86dasm/sysdep.h gtkui/gtkui.c gtkui/gtkui.h gtkui/gtk_win.c \
4.49 + gtkui/gtkcb.c gtkui/gtk_cfg.c gtkui/gtk_mmio.c \
4.50 + gtkui/gtk_debug.c gtkui/gtk_dump.c gtkui/gtk_ctrl.c \
4.51 + gtkui/gtk_gd.c drivers/io_glib.c drivers/video_gtk.c \
4.52 + cocoaui/cocoaui.m cocoaui/cocoaui.h cocoaui/cocoa_cfg.m \
4.53 + cocoaui/cocoa_win.m cocoaui/cocoa_gd.m cocoaui/cocoa_prefs.m \
4.54 + cocoaui/cocoa_ctrl.m cocoaui/paths_osx.m drivers/io_osx.m \
4.55 + drivers/video_osx.m drivers/mac_keymap.h \
4.56 + drivers/mac_keymap.txt paths_unix.c drivers/video_gdk.c \
4.57 + drivers/video_glx.c drivers/video_glx.h drivers/video_nsgl.m \
4.58 + drivers/video_nsgl.h drivers/audio_osx.m drivers/audio_sdl.c \
4.59 + drivers/audio_pulse.c drivers/audio_esd.c drivers/audio_alsa.c \
4.60 + drivers/input_lirc.c drivers/cdrom/cd_linux.c \
4.61 + drivers/cdrom/cd_osx.c drivers/osx_iokit.m drivers/osx_iokit.h \
4.62 drivers/cdrom/cd_none.c drivers/joy_linux.c \
4.63 drivers/joy_linux.h
4.64 @BUILD_SHARED_TRUE@am__objects_1 = lxdream-plugin.$(OBJEXT)
4.65 @@ -280,7 +278,7 @@
4.66 lxdream-sector.$(OBJEXT) lxdream-cd_nrg.$(OBJEXT) \
4.67 lxdream-cd_cdi.$(OBJEXT) lxdream-cd_gdi.$(OBJEXT) \
4.68 lxdream-edc_ecc.$(OBJEXT) lxdream-drive.$(OBJEXT) \
4.69 - lxdream-cd_mmc.$(OBJEXT) lxdream-isoread.$(OBJEXT) \
4.70 + lxdream-cd_mmc.$(OBJEXT) lxdream-isofs.$(OBJEXT) \
4.71 lxdream-hotkeys.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
4.72 $(am__objects_3) $(am__objects_4) $(am__objects_5) \
4.73 $(am__objects_6) $(am__objects_7) $(am__objects_8) \
4.74 @@ -296,13 +294,6 @@
4.75 lxdream_dummy_@SOEXT@_OBJECTS = $(am_lxdream_dummy_@SOEXT@_OBJECTS)
4.76 @BUILD_SHARED_TRUE@lxdream_dummy_@SOEXT@_DEPENDENCIES = \
4.77 @BUILD_SHARED_TRUE@ lxdream_dummy.lo
4.78 -am_test_testisoread_OBJECTS = testisoread.$(OBJEXT) isoread.$(OBJEXT) \
4.79 - cdrom.$(OBJEXT) sector.$(OBJEXT) edc_ecc.$(OBJEXT) \
4.80 - drive.$(OBJEXT) cd_nrg.$(OBJEXT) cd_cdi.$(OBJEXT) \
4.81 - cd_gdi.$(OBJEXT)
4.82 -test_testisoread_OBJECTS = $(am_test_testisoread_OBJECTS)
4.83 -test_testisoread_DEPENDENCIES = $(am__DEPENDENCIES_1)
4.84 -am__dirstamp = $(am__leading_dot)dirstamp
4.85 am__test_testsh4x86_SOURCES_DIST = test/testsh4x86.c x86dasm/x86dasm.c \
4.86 x86dasm/x86dasm.h x86dasm/i386-dis.c x86dasm/dis-init.c \
4.87 x86dasm/dis-buf.c sh4/sh4trans.c sh4/sh4x86.c xlat/xltcache.c \
4.88 @@ -322,6 +313,7 @@
4.89 @BUILD_SH4X86_TRUE@ test_testsh4x86-cpu.$(OBJEXT)
4.90 test_testsh4x86_OBJECTS = $(am_test_testsh4x86_OBJECTS)
4.91 test_testsh4x86_DEPENDENCIES =
4.92 +am__dirstamp = $(am__leading_dot)dirstamp
4.93 am_test_testxlt_OBJECTS = testxlt.$(OBJEXT) xltcache.$(OBJEXT)
4.94 test_testxlt_OBJECTS = $(am_test_testxlt_OBJECTS)
4.95 test_testxlt_LDADD = $(LDADD)
4.96 @@ -341,14 +333,14 @@
4.97 $(audio_pulse_@SOEXT@_SOURCES) $(audio_sdl_@SOEXT@_SOURCES) \
4.98 $(gendec_SOURCES) $(genglsl_SOURCES) $(genmach_SOURCES) \
4.99 $(input_lirc_@SOEXT@_SOURCES) $(lxdream_SOURCES) \
4.100 - $(lxdream_dummy_@SOEXT@_SOURCES) $(test_testisoread_SOURCES) \
4.101 - $(test_testsh4x86_SOURCES) $(test_testxlt_SOURCES)
4.102 + $(lxdream_dummy_@SOEXT@_SOURCES) $(test_testsh4x86_SOURCES) \
4.103 + $(test_testxlt_SOURCES)
4.104 DIST_SOURCES = $(audio_alsa_@SOEXT@_SOURCES) \
4.105 $(audio_esd_@SOEXT@_SOURCES) $(audio_pulse_@SOEXT@_SOURCES) \
4.106 $(audio_sdl_@SOEXT@_SOURCES) $(gendec_SOURCES) \
4.107 $(genglsl_SOURCES) $(genmach_SOURCES) \
4.108 $(input_lirc_@SOEXT@_SOURCES) $(am__lxdream_SOURCES_DIST) \
4.109 - $(lxdream_dummy_@SOEXT@_SOURCES) $(test_testisoread_SOURCES) \
4.110 + $(lxdream_dummy_@SOEXT@_SOURCES) \
4.111 $(am__test_testsh4x86_SOURCES_DIST) $(test_testxlt_SOURCES)
4.112 ETAGS = etags
4.113 CTAGS = ctags
4.114 @@ -597,15 +589,15 @@
4.115 drivers/cdrom/drive.c drivers/cdrom/edc_crctable.h \
4.116 drivers/cdrom/edc_encoder.h drivers/cdrom/edc_l2sq.h \
4.117 drivers/cdrom/edc_scramble.h drivers/cdrom/cd_mmc.c \
4.118 - drivers/cdrom/isoread.h drivers/cdrom/isoread.c \
4.119 - drivers/cdrom/iso_impl.h sh4/sh4.def sh4/sh4core.in \
4.120 - sh4/sh4x86.in sh4/sh4dasm.in sh4/sh4stat.in hotkeys.c \
4.121 - hotkeys.h $(am__append_1) $(am__append_2) $(am__append_4) \
4.122 - $(am__append_5) $(am__append_6) $(am__append_7) \
4.123 - $(am__append_8) $(am__append_9) $(am__append_10) \
4.124 - $(am__append_17) $(am__append_19) $(am__append_21) \
4.125 - $(am__append_23) $(am__append_25) $(am__append_27) \
4.126 - $(am__append_28) $(am__append_29) $(am__append_30)
4.127 + drivers/cdrom/isofs.h drivers/cdrom/isofs.c sh4/sh4.def \
4.128 + sh4/sh4core.in sh4/sh4x86.in sh4/sh4dasm.in sh4/sh4stat.in \
4.129 + hotkeys.c hotkeys.h $(am__append_1) $(am__append_2) \
4.130 + $(am__append_4) $(am__append_5) $(am__append_6) \
4.131 + $(am__append_7) $(am__append_8) $(am__append_9) \
4.132 + $(am__append_10) $(am__append_17) $(am__append_19) \
4.133 + $(am__append_21) $(am__append_23) $(am__append_25) \
4.134 + $(am__append_27) $(am__append_28) $(am__append_29) \
4.135 + $(am__append_30)
4.136 lxdream_CPPFLAGS = @LXDREAMCPPFLAGS@
4.137 @BUILD_SH4X86_TRUE@test_testsh4x86_LDADD = @LXDREAM_LIBS@ @GLIB_LIBS@ @GTK_LIBS@ @LIBPNG_LIBS@
4.138 @BUILD_SH4X86_TRUE@test_testsh4x86_CPPFLAGS = @LXDREAMCPPFLAGS@
4.139 @@ -637,16 +629,6 @@
4.140 genglsl_LDADD = @GLIB_LIBS@ @GTK_LIBS@ $(INTLLIBS)
4.141 genmach_LDADD = @GLIB_LIBS@ @GTK_LIBS@ $(INTLLIBS)
4.142 test_testxlt_SOURCES = test/testxlt.c xlat/xltcache.c xlat/xltcache.h
4.143 -test_testisoread_SOURCES = test/testisoread.c drivers/cdrom/isoread.c \
4.144 - drivers/cdrom/isoread.h drivers/cdrom/isofs_impl.h drivers/cdrom/ecc.h \
4.145 - drivers/cdrom/cdrom.c drivers/cdrom/cdrom.h drivers/cdrom/sector.h \
4.146 - drivers/cdrom/sector.c drivers/cdrom/cdimpl.h drivers/cdrom/edc_ecc.c \
4.147 - drivers/cdrom/edc_crctable.h drivers/cdrom/edc_encoder.h \
4.148 - drivers/cdrom/edc_l2sq.h drivers/cdrom/edc_scramble.h \
4.149 - drivers/cdrom/defs.h drivers/cdrom/drive.h drivers/cdrom/drive.c \
4.150 - drivers/cdrom/cd_nrg.c drivers/cdrom/cd_cdi.c drivers/cdrom/cd_gdi.c
4.151 -
4.152 -test_testisoread_LDADD = @GLIB_LIBS@ $(INTLLIBS)
4.153 all: $(BUILT_SOURCES)
4.154 $(MAKE) $(AM_MAKEFLAGS) all-am
4.155
4.156 @@ -766,9 +748,6 @@
4.157 test/$(am__dirstamp):
4.158 @$(mkdir_p) test
4.159 @: > test/$(am__dirstamp)
4.160 -test/testisoread$(EXEEXT): $(test_testisoread_OBJECTS) $(test_testisoread_DEPENDENCIES) test/$(am__dirstamp)
4.161 - @rm -f test/testisoread$(EXEEXT)
4.162 - $(LINK) $(test_testisoread_LDFLAGS) $(test_testisoread_OBJECTS) $(test_testisoread_LDADD) $(LIBS)
4.163 test/testsh4x86$(EXEEXT): $(test_testsh4x86_OBJECTS) $(test_testsh4x86_DEPENDENCIES) test/$(am__dirstamp)
4.164 @rm -f test/testsh4x86$(EXEEXT)
4.165 $(LINK) $(test_testsh4x86_LDFLAGS) $(test_testsh4x86_OBJECTS) $(test_testsh4x86_LDADD) $(LIBS)
4.166 @@ -783,17 +762,10 @@
4.167 -rm -f *.tab.c
4.168
4.169 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/actparse.Po@am__quote@
4.170 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cd_cdi.Po@am__quote@
4.171 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cd_gdi.Po@am__quote@
4.172 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cd_nrg.Po@am__quote@
4.173 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom.Po@am__quote@
4.174 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drive.Po@am__quote@
4.175 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edc_ecc.Po@am__quote@
4.176 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gendec.Po@am__quote@
4.177 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genglsl.Po@am__quote@
4.178 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genmach.Po@am__quote@
4.179 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/insparse.Po@am__quote@
4.180 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isoread.Po@am__quote@
4.181 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-aica.Po@am__quote@
4.182 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-armcore.Po@am__quote@
4.183 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-armdasm.Po@am__quote@
4.184 @@ -860,7 +832,7 @@
4.185 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-io_glib.Po@am__quote@
4.186 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-io_osx.Po@am__quote@
4.187 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-ioutil.Po@am__quote@
4.188 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-isoread.Po@am__quote@
4.189 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-isofs.Po@am__quote@
4.190 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-joy_linux.Po@am__quote@
4.191 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-kbd.Po@am__quote@
4.192 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-lightgun.Po@am__quote@
4.193 @@ -915,7 +887,6 @@
4.194 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-xltcache.Po@am__quote@
4.195 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-yuv.Po@am__quote@
4.196 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mdparse.Po@am__quote@
4.197 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sector.Po@am__quote@
4.198 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-cpu.Po@am__quote@
4.199 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-dis-buf.Po@am__quote@
4.200 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-dis-init.Po@am__quote@
4.201 @@ -928,7 +899,6 @@
4.202 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-util.Po@am__quote@
4.203 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-x86dasm.Po@am__quote@
4.204 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-xltcache.Po@am__quote@
4.205 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testisoread.Po@am__quote@
4.206 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testxlt.Po@am__quote@
4.207 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xltcache.Po@am__quote@
4.208
4.209 @@ -2080,19 +2050,19 @@
4.210 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.211 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lxdream-cd_mmc.obj `if test -f 'drivers/cdrom/cd_mmc.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_mmc.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_mmc.c'; fi`
4.212
4.213 -lxdream-isoread.o: drivers/cdrom/isoread.c
4.214 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lxdream-isoread.o -MD -MP -MF "$(DEPDIR)/lxdream-isoread.Tpo" -c -o lxdream-isoread.o `test -f 'drivers/cdrom/isoread.c' || echo '$(srcdir)/'`drivers/cdrom/isoread.c; \
4.215 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lxdream-isoread.Tpo" "$(DEPDIR)/lxdream-isoread.Po"; else rm -f "$(DEPDIR)/lxdream-isoread.Tpo"; exit 1; fi
4.216 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/isoread.c' object='lxdream-isoread.o' libtool=no @AMDEPBACKSLASH@
4.217 +lxdream-isofs.o: drivers/cdrom/isofs.c
4.218 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lxdream-isofs.o -MD -MP -MF "$(DEPDIR)/lxdream-isofs.Tpo" -c -o lxdream-isofs.o `test -f 'drivers/cdrom/isofs.c' || echo '$(srcdir)/'`drivers/cdrom/isofs.c; \
4.219 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lxdream-isofs.Tpo" "$(DEPDIR)/lxdream-isofs.Po"; else rm -f "$(DEPDIR)/lxdream-isofs.Tpo"; exit 1; fi
4.220 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/isofs.c' object='lxdream-isofs.o' libtool=no @AMDEPBACKSLASH@
4.221 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.222 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lxdream-isoread.o `test -f 'drivers/cdrom/isoread.c' || echo '$(srcdir)/'`drivers/cdrom/isoread.c
4.223 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lxdream-isofs.o `test -f 'drivers/cdrom/isofs.c' || echo '$(srcdir)/'`drivers/cdrom/isofs.c
4.224
4.225 -lxdream-isoread.obj: drivers/cdrom/isoread.c
4.226 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lxdream-isoread.obj -MD -MP -MF "$(DEPDIR)/lxdream-isoread.Tpo" -c -o lxdream-isoread.obj `if test -f 'drivers/cdrom/isoread.c'; then $(CYGPATH_W) 'drivers/cdrom/isoread.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/isoread.c'; fi`; \
4.227 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lxdream-isoread.Tpo" "$(DEPDIR)/lxdream-isoread.Po"; else rm -f "$(DEPDIR)/lxdream-isoread.Tpo"; exit 1; fi
4.228 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/isoread.c' object='lxdream-isoread.obj' libtool=no @AMDEPBACKSLASH@
4.229 +lxdream-isofs.obj: drivers/cdrom/isofs.c
4.230 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lxdream-isofs.obj -MD -MP -MF "$(DEPDIR)/lxdream-isofs.Tpo" -c -o lxdream-isofs.obj `if test -f 'drivers/cdrom/isofs.c'; then $(CYGPATH_W) 'drivers/cdrom/isofs.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/isofs.c'; fi`; \
4.231 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lxdream-isofs.Tpo" "$(DEPDIR)/lxdream-isofs.Po"; else rm -f "$(DEPDIR)/lxdream-isofs.Tpo"; exit 1; fi
4.232 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/isofs.c' object='lxdream-isofs.obj' libtool=no @AMDEPBACKSLASH@
4.233 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.234 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lxdream-isoread.obj `if test -f 'drivers/cdrom/isoread.c'; then $(CYGPATH_W) 'drivers/cdrom/isoread.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/isoread.c'; fi`
4.235 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lxdream-isofs.obj `if test -f 'drivers/cdrom/isofs.c'; then $(CYGPATH_W) 'drivers/cdrom/isofs.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/isofs.c'; fi`
4.236
4.237 lxdream-hotkeys.o: hotkeys.c
4.238 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lxdream-hotkeys.o -MD -MP -MF "$(DEPDIR)/lxdream-hotkeys.Tpo" -c -o lxdream-hotkeys.o `test -f 'hotkeys.c' || echo '$(srcdir)/'`hotkeys.c; \
4.239 @@ -2542,132 +2512,6 @@
4.240 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.241 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lxdream-joy_linux.obj `if test -f 'drivers/joy_linux.c'; then $(CYGPATH_W) 'drivers/joy_linux.c'; else $(CYGPATH_W) '$(srcdir)/drivers/joy_linux.c'; fi`
4.242
4.243 -testisoread.o: test/testisoread.c
4.244 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT testisoread.o -MD -MP -MF "$(DEPDIR)/testisoread.Tpo" -c -o testisoread.o `test -f 'test/testisoread.c' || echo '$(srcdir)/'`test/testisoread.c; \
4.245 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testisoread.Tpo" "$(DEPDIR)/testisoread.Po"; else rm -f "$(DEPDIR)/testisoread.Tpo"; exit 1; fi
4.246 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/testisoread.c' object='testisoread.o' libtool=no @AMDEPBACKSLASH@
4.247 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.248 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o testisoread.o `test -f 'test/testisoread.c' || echo '$(srcdir)/'`test/testisoread.c
4.249 -
4.250 -testisoread.obj: test/testisoread.c
4.251 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT testisoread.obj -MD -MP -MF "$(DEPDIR)/testisoread.Tpo" -c -o testisoread.obj `if test -f 'test/testisoread.c'; then $(CYGPATH_W) 'test/testisoread.c'; else $(CYGPATH_W) '$(srcdir)/test/testisoread.c'; fi`; \
4.252 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testisoread.Tpo" "$(DEPDIR)/testisoread.Po"; else rm -f "$(DEPDIR)/testisoread.Tpo"; exit 1; fi
4.253 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/testisoread.c' object='testisoread.obj' libtool=no @AMDEPBACKSLASH@
4.254 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.255 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o testisoread.obj `if test -f 'test/testisoread.c'; then $(CYGPATH_W) 'test/testisoread.c'; else $(CYGPATH_W) '$(srcdir)/test/testisoread.c'; fi`
4.256 -
4.257 -isoread.o: drivers/cdrom/isoread.c
4.258 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isoread.o -MD -MP -MF "$(DEPDIR)/isoread.Tpo" -c -o isoread.o `test -f 'drivers/cdrom/isoread.c' || echo '$(srcdir)/'`drivers/cdrom/isoread.c; \
4.259 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/isoread.Tpo" "$(DEPDIR)/isoread.Po"; else rm -f "$(DEPDIR)/isoread.Tpo"; exit 1; fi
4.260 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/isoread.c' object='isoread.o' libtool=no @AMDEPBACKSLASH@
4.261 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.262 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isoread.o `test -f 'drivers/cdrom/isoread.c' || echo '$(srcdir)/'`drivers/cdrom/isoread.c
4.263 -
4.264 -isoread.obj: drivers/cdrom/isoread.c
4.265 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isoread.obj -MD -MP -MF "$(DEPDIR)/isoread.Tpo" -c -o isoread.obj `if test -f 'drivers/cdrom/isoread.c'; then $(CYGPATH_W) 'drivers/cdrom/isoread.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/isoread.c'; fi`; \
4.266 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/isoread.Tpo" "$(DEPDIR)/isoread.Po"; else rm -f "$(DEPDIR)/isoread.Tpo"; exit 1; fi
4.267 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/isoread.c' object='isoread.obj' libtool=no @AMDEPBACKSLASH@
4.268 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.269 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isoread.obj `if test -f 'drivers/cdrom/isoread.c'; then $(CYGPATH_W) 'drivers/cdrom/isoread.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/isoread.c'; fi`
4.270 -
4.271 -cdrom.o: drivers/cdrom/cdrom.c
4.272 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdrom.o -MD -MP -MF "$(DEPDIR)/cdrom.Tpo" -c -o cdrom.o `test -f 'drivers/cdrom/cdrom.c' || echo '$(srcdir)/'`drivers/cdrom/cdrom.c; \
4.273 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cdrom.Tpo" "$(DEPDIR)/cdrom.Po"; else rm -f "$(DEPDIR)/cdrom.Tpo"; exit 1; fi
4.274 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cdrom.c' object='cdrom.o' libtool=no @AMDEPBACKSLASH@
4.275 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.276 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdrom.o `test -f 'drivers/cdrom/cdrom.c' || echo '$(srcdir)/'`drivers/cdrom/cdrom.c
4.277 -
4.278 -cdrom.obj: drivers/cdrom/cdrom.c
4.279 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdrom.obj -MD -MP -MF "$(DEPDIR)/cdrom.Tpo" -c -o cdrom.obj `if test -f 'drivers/cdrom/cdrom.c'; then $(CYGPATH_W) 'drivers/cdrom/cdrom.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cdrom.c'; fi`; \
4.280 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cdrom.Tpo" "$(DEPDIR)/cdrom.Po"; else rm -f "$(DEPDIR)/cdrom.Tpo"; exit 1; fi
4.281 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cdrom.c' object='cdrom.obj' libtool=no @AMDEPBACKSLASH@
4.282 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.283 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdrom.obj `if test -f 'drivers/cdrom/cdrom.c'; then $(CYGPATH_W) 'drivers/cdrom/cdrom.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cdrom.c'; fi`
4.284 -
4.285 -sector.o: drivers/cdrom/sector.c
4.286 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sector.o -MD -MP -MF "$(DEPDIR)/sector.Tpo" -c -o sector.o `test -f 'drivers/cdrom/sector.c' || echo '$(srcdir)/'`drivers/cdrom/sector.c; \
4.287 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sector.Tpo" "$(DEPDIR)/sector.Po"; else rm -f "$(DEPDIR)/sector.Tpo"; exit 1; fi
4.288 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/sector.c' object='sector.o' libtool=no @AMDEPBACKSLASH@
4.289 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.290 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sector.o `test -f 'drivers/cdrom/sector.c' || echo '$(srcdir)/'`drivers/cdrom/sector.c
4.291 -
4.292 -sector.obj: drivers/cdrom/sector.c
4.293 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sector.obj -MD -MP -MF "$(DEPDIR)/sector.Tpo" -c -o sector.obj `if test -f 'drivers/cdrom/sector.c'; then $(CYGPATH_W) 'drivers/cdrom/sector.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/sector.c'; fi`; \
4.294 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sector.Tpo" "$(DEPDIR)/sector.Po"; else rm -f "$(DEPDIR)/sector.Tpo"; exit 1; fi
4.295 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/sector.c' object='sector.obj' libtool=no @AMDEPBACKSLASH@
4.296 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.297 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sector.obj `if test -f 'drivers/cdrom/sector.c'; then $(CYGPATH_W) 'drivers/cdrom/sector.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/sector.c'; fi`
4.298 -
4.299 -edc_ecc.o: drivers/cdrom/edc_ecc.c
4.300 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT edc_ecc.o -MD -MP -MF "$(DEPDIR)/edc_ecc.Tpo" -c -o edc_ecc.o `test -f 'drivers/cdrom/edc_ecc.c' || echo '$(srcdir)/'`drivers/cdrom/edc_ecc.c; \
4.301 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/edc_ecc.Tpo" "$(DEPDIR)/edc_ecc.Po"; else rm -f "$(DEPDIR)/edc_ecc.Tpo"; exit 1; fi
4.302 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/edc_ecc.c' object='edc_ecc.o' libtool=no @AMDEPBACKSLASH@
4.303 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.304 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o edc_ecc.o `test -f 'drivers/cdrom/edc_ecc.c' || echo '$(srcdir)/'`drivers/cdrom/edc_ecc.c
4.305 -
4.306 -edc_ecc.obj: drivers/cdrom/edc_ecc.c
4.307 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT edc_ecc.obj -MD -MP -MF "$(DEPDIR)/edc_ecc.Tpo" -c -o edc_ecc.obj `if test -f 'drivers/cdrom/edc_ecc.c'; then $(CYGPATH_W) 'drivers/cdrom/edc_ecc.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/edc_ecc.c'; fi`; \
4.308 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/edc_ecc.Tpo" "$(DEPDIR)/edc_ecc.Po"; else rm -f "$(DEPDIR)/edc_ecc.Tpo"; exit 1; fi
4.309 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/edc_ecc.c' object='edc_ecc.obj' libtool=no @AMDEPBACKSLASH@
4.310 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.311 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o edc_ecc.obj `if test -f 'drivers/cdrom/edc_ecc.c'; then $(CYGPATH_W) 'drivers/cdrom/edc_ecc.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/edc_ecc.c'; fi`
4.312 -
4.313 -drive.o: drivers/cdrom/drive.c
4.314 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT drive.o -MD -MP -MF "$(DEPDIR)/drive.Tpo" -c -o drive.o `test -f 'drivers/cdrom/drive.c' || echo '$(srcdir)/'`drivers/cdrom/drive.c; \
4.315 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/drive.Tpo" "$(DEPDIR)/drive.Po"; else rm -f "$(DEPDIR)/drive.Tpo"; exit 1; fi
4.316 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/drive.c' object='drive.o' libtool=no @AMDEPBACKSLASH@
4.317 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.318 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drive.o `test -f 'drivers/cdrom/drive.c' || echo '$(srcdir)/'`drivers/cdrom/drive.c
4.319 -
4.320 -drive.obj: drivers/cdrom/drive.c
4.321 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT drive.obj -MD -MP -MF "$(DEPDIR)/drive.Tpo" -c -o drive.obj `if test -f 'drivers/cdrom/drive.c'; then $(CYGPATH_W) 'drivers/cdrom/drive.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/drive.c'; fi`; \
4.322 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/drive.Tpo" "$(DEPDIR)/drive.Po"; else rm -f "$(DEPDIR)/drive.Tpo"; exit 1; fi
4.323 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/drive.c' object='drive.obj' libtool=no @AMDEPBACKSLASH@
4.324 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.325 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drive.obj `if test -f 'drivers/cdrom/drive.c'; then $(CYGPATH_W) 'drivers/cdrom/drive.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/drive.c'; fi`
4.326 -
4.327 -cd_nrg.o: drivers/cdrom/cd_nrg.c
4.328 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cd_nrg.o -MD -MP -MF "$(DEPDIR)/cd_nrg.Tpo" -c -o cd_nrg.o `test -f 'drivers/cdrom/cd_nrg.c' || echo '$(srcdir)/'`drivers/cdrom/cd_nrg.c; \
4.329 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cd_nrg.Tpo" "$(DEPDIR)/cd_nrg.Po"; else rm -f "$(DEPDIR)/cd_nrg.Tpo"; exit 1; fi
4.330 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cd_nrg.c' object='cd_nrg.o' libtool=no @AMDEPBACKSLASH@
4.331 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.332 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cd_nrg.o `test -f 'drivers/cdrom/cd_nrg.c' || echo '$(srcdir)/'`drivers/cdrom/cd_nrg.c
4.333 -
4.334 -cd_nrg.obj: drivers/cdrom/cd_nrg.c
4.335 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cd_nrg.obj -MD -MP -MF "$(DEPDIR)/cd_nrg.Tpo" -c -o cd_nrg.obj `if test -f 'drivers/cdrom/cd_nrg.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_nrg.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_nrg.c'; fi`; \
4.336 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cd_nrg.Tpo" "$(DEPDIR)/cd_nrg.Po"; else rm -f "$(DEPDIR)/cd_nrg.Tpo"; exit 1; fi
4.337 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cd_nrg.c' object='cd_nrg.obj' libtool=no @AMDEPBACKSLASH@
4.338 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.339 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cd_nrg.obj `if test -f 'drivers/cdrom/cd_nrg.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_nrg.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_nrg.c'; fi`
4.340 -
4.341 -cd_cdi.o: drivers/cdrom/cd_cdi.c
4.342 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cd_cdi.o -MD -MP -MF "$(DEPDIR)/cd_cdi.Tpo" -c -o cd_cdi.o `test -f 'drivers/cdrom/cd_cdi.c' || echo '$(srcdir)/'`drivers/cdrom/cd_cdi.c; \
4.343 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cd_cdi.Tpo" "$(DEPDIR)/cd_cdi.Po"; else rm -f "$(DEPDIR)/cd_cdi.Tpo"; exit 1; fi
4.344 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cd_cdi.c' object='cd_cdi.o' libtool=no @AMDEPBACKSLASH@
4.345 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.346 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cd_cdi.o `test -f 'drivers/cdrom/cd_cdi.c' || echo '$(srcdir)/'`drivers/cdrom/cd_cdi.c
4.347 -
4.348 -cd_cdi.obj: drivers/cdrom/cd_cdi.c
4.349 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cd_cdi.obj -MD -MP -MF "$(DEPDIR)/cd_cdi.Tpo" -c -o cd_cdi.obj `if test -f 'drivers/cdrom/cd_cdi.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_cdi.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_cdi.c'; fi`; \
4.350 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cd_cdi.Tpo" "$(DEPDIR)/cd_cdi.Po"; else rm -f "$(DEPDIR)/cd_cdi.Tpo"; exit 1; fi
4.351 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cd_cdi.c' object='cd_cdi.obj' libtool=no @AMDEPBACKSLASH@
4.352 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.353 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cd_cdi.obj `if test -f 'drivers/cdrom/cd_cdi.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_cdi.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_cdi.c'; fi`
4.354 -
4.355 -cd_gdi.o: drivers/cdrom/cd_gdi.c
4.356 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cd_gdi.o -MD -MP -MF "$(DEPDIR)/cd_gdi.Tpo" -c -o cd_gdi.o `test -f 'drivers/cdrom/cd_gdi.c' || echo '$(srcdir)/'`drivers/cdrom/cd_gdi.c; \
4.357 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cd_gdi.Tpo" "$(DEPDIR)/cd_gdi.Po"; else rm -f "$(DEPDIR)/cd_gdi.Tpo"; exit 1; fi
4.358 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cd_gdi.c' object='cd_gdi.o' libtool=no @AMDEPBACKSLASH@
4.359 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.360 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cd_gdi.o `test -f 'drivers/cdrom/cd_gdi.c' || echo '$(srcdir)/'`drivers/cdrom/cd_gdi.c
4.361 -
4.362 -cd_gdi.obj: drivers/cdrom/cd_gdi.c
4.363 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cd_gdi.obj -MD -MP -MF "$(DEPDIR)/cd_gdi.Tpo" -c -o cd_gdi.obj `if test -f 'drivers/cdrom/cd_gdi.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_gdi.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_gdi.c'; fi`; \
4.364 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cd_gdi.Tpo" "$(DEPDIR)/cd_gdi.Po"; else rm -f "$(DEPDIR)/cd_gdi.Tpo"; exit 1; fi
4.365 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/cdrom/cd_gdi.c' object='cd_gdi.obj' libtool=no @AMDEPBACKSLASH@
4.366 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
4.367 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cd_gdi.obj `if test -f 'drivers/cdrom/cd_gdi.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_gdi.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_gdi.c'; fi`
4.368 -
4.369 test_testsh4x86-testsh4x86.o: test/testsh4x86.c
4.370 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-testsh4x86.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-testsh4x86.Tpo" -c -o test_testsh4x86-testsh4x86.o `test -f 'test/testsh4x86.c' || echo '$(srcdir)/'`test/testsh4x86.c; \
4.371 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_testsh4x86-testsh4x86.Tpo" "$(DEPDIR)/test_testsh4x86-testsh4x86.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-testsh4x86.Tpo"; exit 1; fi
5.1 --- a/src/bios.c Tue Mar 23 19:48:03 2010 +1000
5.2 +++ b/src/bios.c Mon May 17 22:01:23 2010 +1000
5.3 @@ -24,7 +24,7 @@
5.4 #include "bootstrap.h"
5.5 #include "sh4/sh4.h"
5.6 #include "drivers/cdrom/cdrom.h"
5.7 -#include "drivers/cdrom/isoread.h"
5.8 +#include "drivers/cdrom/isofs.h"
5.9 #include "gdrom/gdrom.h"
5.10
5.11 gboolean bios_boot_gdrom_disc( void );
5.12 @@ -387,6 +387,56 @@
5.13
5.14 #define MIN_ISO_SECTORS 32
5.15
5.16 +static gboolean bios_load_ipl( cdrom_disc_t disc, cdrom_track_t track, const char *program_name,
5.17 + unsigned char *buffer, gboolean unscramble )
5.18 +{
5.19 + gboolean rv = TRUE;
5.20 +
5.21 + IsoImageFilesystem *iso = iso_filesystem_new_from_track( disc, track, NULL );
5.22 + if( iso == NULL ) {
5.23 + ERROR( "Disc is not bootable (invalid ISO9660 filesystem)" );
5.24 + return FALSE;
5.25 + }
5.26 + IsoFileSource *file = NULL;
5.27 + int status = iso->get_by_path(iso, program_name, &file );
5.28 + if( status != 1 ) {
5.29 + ERROR( "Disc is not bootable (initial program '%s' not found)", program_name );
5.30 + iso_filesystem_unref(iso);
5.31 + return FALSE;
5.32 + }
5.33 +
5.34 + struct stat st;
5.35 + if( iso_file_source_stat(file, &st) == 1 ) {
5.36 + if( st.st_size > (0x8D000000 - BINARY_LOAD_ADDR) ) {
5.37 + ERROR( "Disc is not bootable (Initial program is too large to fit into memory)" );
5.38 + rv = FALSE;
5.39 + } else if( iso_file_source_open(file) == 1 ) {
5.40 + size_t len;
5.41 + if( unscramble ) {
5.42 + char *tmp = g_malloc(st.st_size);
5.43 + len = iso_file_source_read(file, tmp, st.st_size);
5.44 + bootprogram_unscramble(buffer, tmp, st.st_size);
5.45 + g_free(tmp);
5.46 + } else {
5.47 + len = iso_file_source_read(file, buffer, st.st_size);
5.48 + }
5.49 +
5.50 + if( len != st.st_size ) {
5.51 + ERROR( "Disc is not bootable (Unable to read initial program '%s')", program_name );
5.52 + rv = FALSE;
5.53 + }
5.54 + iso_file_source_close(file);
5.55 + }
5.56 + } else {
5.57 + ERROR( "Disc is not bootable (Unable to get size of initial program '%s')", program_name );
5.58 + rv = FALSE;
5.59 + }
5.60 +
5.61 + iso_file_source_unref(file);
5.62 + iso_filesystem_unref(iso);
5.63 + return rv;
5.64 +}
5.65 +
5.66 gboolean bios_boot_gdrom_disc( void )
5.67 {
5.68 cdrom_disc_t disc = gdrom_get_current_disc();
5.69 @@ -427,56 +477,19 @@
5.70 }
5.71
5.72 /* Get the initial program from the bootstrap (usually 1ST_READ.BIN) */
5.73 - char program_name[17];
5.74 - memcpy(program_name, metadata->boot_file, 16);
5.75 - program_name[16] = '\0';
5.76 - for( int i=15; i >= 0 && program_name[i] == ' '; i-- ) {
5.77 + char program_name[18] = "/";
5.78 + memcpy(program_name+1, metadata->boot_file, 16);
5.79 + program_name[17] = '\0';
5.80 + for( int i=16; i >= 0 && program_name[i] == ' '; i-- ) {
5.81 program_name[i] = '\0';
5.82 }
5.83
5.84 /* Bootstrap is good. Now find the program in the actual filesystem... */
5.85 - isofs_reader_t iso = isofs_reader_new_from_track( disc, track, NULL );
5.86 - if( iso == NULL ) {
5.87 - ERROR( "Disc is not bootable" );
5.88 + unsigned char *program = mem_get_region(BINARY_LOAD_ADDR);
5.89 + gboolean isGDROM = (disc->disc_type == CDROM_DISC_GDROM );
5.90 + if( !bios_load_ipl( disc, track, program_name, program, !isGDROM ) )
5.91 return FALSE;
5.92 - }
5.93 - isofs_reader_dirent_t ent = isofs_reader_get_file( iso, program_name );
5.94 - if( ent == NULL ) {
5.95 - ERROR( "Disc is not bootable (initial program '%s' not found)", program_name );
5.96 - isofs_reader_destroy(iso);
5.97 - return FALSE;
5.98 - }
5.99 -
5.100 - if( ent->size > (0x8D000000 - BINARY_LOAD_ADDR) ) {
5.101 - /* Bootstrap isn't going to fit in memory. Complain and abort */
5.102 - ERROR( "Disc is not bootable (initial program too large)" );
5.103 - isofs_reader_destroy(iso);
5.104 - return FALSE;
5.105 - }
5.106 - unsigned char *program = mem_get_region(BINARY_LOAD_ADDR);
5.107 - int program_sectors = (ent->size+2047)/2048;
5.108 - if( disc->disc_type == CDROM_DISC_GDROM ) {
5.109 - /* Load the binary directly into RAM */
5.110 - if( isofs_reader_read_file( iso, ent, 0, ent->size, program ) !=
5.111 - CDROM_ERROR_OK ) {
5.112 - ERROR( "Disc is not bootable (failed to read initial program)\n" );
5.113 - isofs_reader_destroy(iso);
5.114 - return FALSE;
5.115 - }
5.116 - asic_enable_ide_interface(TRUE);
5.117 - } else {
5.118 - /* Load the binary into a temp buffer */
5.119 - unsigned char tmp[program_sectors*2048];
5.120 - if( isofs_reader_read_file( iso, ent, 0, ent->size, tmp ) !=
5.121 - CDROM_ERROR_OK ) {
5.122 - ERROR( "Disc is not bootable (failed to read initial program)\n" );
5.123 - isofs_reader_destroy(iso);
5.124 - return FALSE;
5.125 - }
5.126 - bootprogram_unscramble(program, tmp, ent->size);
5.127 - asic_enable_ide_interface(FALSE);
5.128 - }
5.129 - isofs_reader_destroy(iso);
5.130 + asic_enable_ide_interface(isGDROM);
5.131 dreamcast_program_loaded( "", BOOTSTRAP_ENTRY_ADDR );
5.132 return TRUE;
5.133 }
6.1 --- a/src/drivers/cdrom/iso_impl.h Tue Mar 23 19:48:03 2010 +1000
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,128 +0,0 @@
6.4 -/**
6.5 - * $Id$
6.6 - *
6.7 - * ISO9660 filesystem support
6.8 - *
6.9 - * Copyright (c) 2009 Nathan Keynes.
6.10 - *
6.11 - * This program is free software; you can redistribute it and/or modify
6.12 - * it under the terms of the GNU General Public License as published by
6.13 - * the Free Software Foundation; either version 2 of the License, or
6.14 - * (at your option) any later version.
6.15 - *
6.16 - * This program is distributed in the hope that it will be useful,
6.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
6.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6.19 - * GNU General Public License for more details.
6.20 - */
6.21 -
6.22 -#define ISO_SUPERBLOCK_OFFSET 16
6.23 -#define ISO_BOOT_DESCRIPTOR 0
6.24 -#define ISO_PRIMARY_DESCRIPTOR 1
6.25 -#define ISO_SECONDARY_DESCRIPTOR 2
6.26 -#define ISO_PARTITION_DESCRIPTOR 3
6.27 -#define ISO_TERMINAL_DESCRIPTOR 0xFF
6.28 -
6.29 -typedef struct iso_timestamp_full { /* 17 bytes */
6.30 - char year[4];
6.31 - char month[2];
6.32 - char day[2];
6.33 - char hour[2];
6.34 - char minute[2];
6.35 - char second[2];
6.36 - char hundredths[2];
6.37 - int8_t utc_offset; /* 15 min intervals from -48 to +52 7.1.2 */
6.38 -} *iso_timestamp_full_t;
6.39 -
6.40 -typedef struct iso_timestamp { /* 7 bytes */
6.41 - uint8_t year; /* Since 1900 */
6.42 - uint8_t month; /* 1 .. 12 */
6.43 - uint8_t day; /* 1 .. 31 */
6.44 - uint8_t hour; /* 0 .. 23 */
6.45 - uint8_t minute; /* 0 .. 59 */
6.46 - uint8_t second; /* 0 .. 59 */
6.47 - uint8_t utc_offset; /* 15 min intervals from -48 to +52 7.1.2 */
6.48 -} *iso_timestamp_t;
6.49 -
6.50 -#define ISO_FILE_EXISTS 0x01
6.51 -#define ISO_FILE_DIR 0x02
6.52 -#define ISO_FILE_ASSOC 0x04 /* Associated file */
6.53 -#define ISO_FILE_RECORD 0x08 /* Structure specified by XA record */
6.54 -#define ISO_FILE_PROTECT 0x10 /* Permissions specified */
6.55 -#define ISO_FILE_MULTIEXT 0x80 /* Multiple extents */
6.56 -
6.57 -typedef struct iso_dirent { /* 34+ bytes 9.1 */
6.58 - uint8_t record_len;
6.59 - uint8_t xa_record_len;
6.60 - uint32_t file_lba_le, file_lba_be;
6.61 - uint32_t file_size_le, file_size_be;
6.62 - struct iso_timestamp timestamp;
6.63 - uint8_t flags;
6.64 - uint8_t unit_size;
6.65 - uint8_t gap_size;
6.66 - uint16_t volume_seq_le, volume_seq_be;
6.67 - uint8_t file_id_len;
6.68 - char file_id[1];
6.69 -} __attribute__((packed)) *iso_dirent_t;
6.70 -
6.71 -typedef struct iso_pathtabrec { /* 8+ bytes 9.4 */
6.72 - uint8_t record_len;
6.73 - uint8_t xa_record_len;
6.74 - uint32_t file_lba;
6.75 - uint16_t parent_dir_no;
6.76 - char file_id[];
6.77 -} *iso_pathtabrec_t;
6.78 -
6.79 -typedef struct iso_xattrrec {
6.80 - uint16_t uid_le, uid_be;
6.81 - uint16_t gid_le, gid_be;
6.82 - uint16_t permissions;
6.83 - struct iso_timestamp_full create_time;
6.84 - struct iso_timestamp_full modify_time;
6.85 - struct iso_timestamp_full expiry_time;
6.86 - struct iso_timestamp_full effective_time;
6.87 - uint8_t record_format;
6.88 - uint8_t record_attrs;
6.89 - uint16_t record_len_le, record_len_be;
6.90 - char system_id[32];
6.91 - char system_use[64];
6.92 - uint8_t record_version; /* Should be 1 */
6.93 - uint8_t escape_len;
6.94 - char reserved[64];
6.95 - uint16_t app_use_len_le, app_use_len_be;
6.96 - char app_use[];
6.97 -} *iso_xattrrec_t;
6.98 -
6.99 -/** Primary Volume Descriptor */
6.100 -typedef struct iso_pvd {
6.101 - uint8_t desc_type;
6.102 - char tag[5];
6.103 - uint8_t desc_version;
6.104 - char pad0;
6.105 - char system_id[32];
6.106 - char volume_id[32];
6.107 - char pad1[8];
6.108 - uint32_t volume_size_le, volume_size_be;
6.109 - char pad2[32];
6.110 - uint16_t volume_sets_le, volume_sets_be;
6.111 - uint16_t volume_seq_le, volume_seq_be;
6.112 - uint16_t block_size_le, block_size_be;
6.113 - uint32_t pathtab_size_le, pathtab_size_be;
6.114 - uint32_t pathtab_offset_le, pathtab2_offset_le;
6.115 - uint32_t pathtab_offset_be, pathtab2_offset_be;
6.116 - struct iso_dirent root_dirent;
6.117 - char volume_set_id[128];
6.118 - char publisher_id[128];
6.119 - char preparer_id[128];
6.120 - char app_id[128];
6.121 - char copyright_file_id[37];
6.122 - char abstract_file_id[37];
6.123 - char biblio_file_id[37];
6.124 - struct iso_timestamp_full create_time;
6.125 - struct iso_timestamp_full modify_time;
6.126 - struct iso_timestamp_full expiry_time;
6.127 - struct iso_timestamp_full effective_time;
6.128 - uint8_t fs_version; /* must be 1 */
6.129 - char pad3[1166];
6.130 -} *iso_pvd_t;
6.131 -
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/src/drivers/cdrom/isofs.c Mon May 17 22:01:23 2010 +1000
7.3 @@ -0,0 +1,188 @@
7.4 +/**
7.5 + * $Id$
7.6 + *
7.7 + * libisofs adapter
7.8 + *
7.9 + * Copyright (c) 2010 Nathan Keynes.
7.10 + *
7.11 + * This program is free software; you can redistribute it and/or modify
7.12 + * it under the terms of the GNU General Public License as published by
7.13 + * the Free Software Foundation; either version 2 of the License, or
7.14 + * (at your option) any later version.
7.15 + *
7.16 + * This program is distributed in the hope that it will be useful,
7.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7.19 + * GNU General Public License for more details.
7.20 + */
7.21 +
7.22 +#include <assert.h>
7.23 +#include <glib/gmem.h>
7.24 +
7.25 +#define LIBISOFS_WITHOUT_LIBBURN 1
7.26 +
7.27 +#include "drivers/cdrom/cdrom.h"
7.28 +#include "drivers/cdrom/isofs.h"
7.29 +
7.30 +static int isofs_dummy_fn(IsoDataSource *src)
7.31 +{
7.32 + return 1;
7.33 +}
7.34 +
7.35 +static int isofs_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer)
7.36 +{
7.37 + sector_source_t source = (sector_source_t)src->data;
7.38 + cdrom_error_t err = sector_source_read_sectors(source, lba, 1,
7.39 + CDROM_READ_MODE2_FORM1|CDROM_READ_DATA, buffer, NULL );
7.40 + if( err != CDROM_ERROR_OK ) {
7.41 + return ISO_DATA_SOURCE_FAILURE;
7.42 + }
7.43 + return 1;
7.44 +}
7.45 +
7.46 +static void isofs_release(IsoDataSource *src)
7.47 +{
7.48 + sector_source_unref((sector_source_t)src->data);
7.49 +}
7.50 +
7.51 +static IsoDataSource *iso_data_source_new( sector_source_t source )
7.52 +{
7.53 + IsoDataSource *src = g_malloc0(sizeof(IsoDataSource));
7.54 + src->refcount = 1;
7.55 + src->open = isofs_dummy_fn;
7.56 + src->close = isofs_dummy_fn;
7.57 + src->read_block = isofs_read_block;
7.58 + src->free_data = isofs_release;
7.59 + src->data = source;
7.60 + sector_source_ref(source);
7.61 + return src;
7.62 +}
7.63 +
7.64 +/**
7.65 + * Construct an isofs image from an existing sector source.
7.66 + */
7.67 +IsoImage *iso_image_new_from_source( sector_source_t source, cdrom_lba_t start, ERROR *err )
7.68 +{
7.69 + IsoImage *iso = NULL;
7.70 + IsoReadOpts *opts;
7.71 + IsoDataSource *src;
7.72 +
7.73 + int status = iso_image_new(NULL, &iso);
7.74 + if( status != 1 )
7.75 + return NULL;
7.76 +
7.77 + status = iso_read_opts_new(&opts,0);
7.78 + if( status != 1 ) {
7.79 + iso_image_unref( iso );
7.80 + return NULL;
7.81 + }
7.82 +
7.83 + iso_read_opts_set_start_block(opts, start);
7.84 + src = iso_data_source_new(source);
7.85 + status = iso_image_import(iso, src, opts, NULL);
7.86 + iso_data_source_unref(src);
7.87 + iso_read_opts_free(opts);
7.88 + if( status != 1 ) {
7.89 + iso_image_unref(iso);
7.90 + return NULL;
7.91 + }
7.92 + return iso;
7.93 +}
7.94 +
7.95 +IsoImage *iso_image_new_from_disc( cdrom_disc_t disc, cdrom_lba_t start_sector, ERROR *err )
7.96 +{
7.97 + return iso_image_new_from_source( &disc->source, start_sector, err );
7.98 +}
7.99 +
7.100 +IsoImage *iso_image_new_from_track( cdrom_disc_t disc, cdrom_track_t track, ERROR *err )
7.101 +{
7.102 + return iso_image_new_from_source( &disc->source, track->lba, err );
7.103 +}
7.104 +
7.105 +
7.106 +IsoImageFilesystem *iso_filesystem_new_from_source( sector_source_t source, cdrom_lba_t start, ERROR *err )
7.107 +{
7.108 + IsoImageFilesystem *iso = NULL;
7.109 + IsoReadOpts *opts;
7.110 + IsoDataSource *src;
7.111 +
7.112 + int status = iso_read_opts_new(&opts,0);
7.113 + if( status != 1 ) {
7.114 + return NULL;
7.115 + }
7.116 +
7.117 + iso_read_opts_set_start_block(opts, start);
7.118 + src = iso_data_source_new(source);
7.119 + status = iso_image_filesystem_new(src, opts, 0x1FFFFF, &iso);
7.120 + iso_data_source_unref(src);
7.121 + iso_read_opts_free(opts);
7.122 + if( status != 1 ) {
7.123 + return NULL;
7.124 + }
7.125 + return iso;
7.126 +
7.127 +}
7.128 +
7.129 +IsoImageFilesystem *iso_filesystem_new_from_disc( cdrom_disc_t disc, cdrom_lba_t start_sector, ERROR *err )
7.130 +{
7.131 + return iso_filesystem_new_from_source( &disc->source, start_sector, err );
7.132 +}
7.133 +
7.134 +IsoImageFilesystem *iso_filesystem_new_from_track( cdrom_disc_t disc, cdrom_track_t track, ERROR *err )
7.135 +{
7.136 + return iso_filesystem_new_from_source( &disc->source, track->lba, err );
7.137 +}
7.138 +
7.139 +
7.140 +/**
7.141 + * Construct a sector source from a given IsoImage.
7.142 + */
7.143 +sector_source_t iso_sector_source_new( IsoImage *image, sector_mode_t mode, cdrom_lba_t start_sector,
7.144 + const char *bootstrap, ERROR *err )
7.145 +{
7.146 + assert( mode == SECTOR_MODE1 || mode == SECTOR_MODE2_FORM1 );
7.147 +
7.148 + IsoWriteOpts *opts;
7.149 + struct burn_source *burn;
7.150 +
7.151 + int status = iso_write_opts_new(&opts, 0);
7.152 + if( status != 1 )
7.153 + return NULL;
7.154 + iso_write_opts_set_appendable(opts,0);
7.155 + iso_write_opts_set_ms_block(opts, start_sector);
7.156 + iso_write_opts_set_system_area(opts, (char *)bootstrap, 0, 0);
7.157 +
7.158 + status = iso_image_create_burn_source(image, opts, &burn);
7.159 + iso_write_opts_free(opts);
7.160 + if( status != 1 ) {
7.161 + return NULL;
7.162 + }
7.163 +
7.164 + off_t size = burn->get_size(burn);
7.165 + sector_source_t source = tmpfile_sector_source_new(mode);
7.166 + if( source == NULL ) {
7.167 + burn->free_data(burn);
7.168 + free(burn);
7.169 + return NULL;
7.170 + }
7.171 +
7.172 + char buf[2048];
7.173 + cdrom_count_t expect = size/2048;
7.174 + cdrom_count_t count = 0;
7.175 + for( cdrom_count_t count = 0; count < expect; count++ ) {
7.176 + status = burn->read(burn, buf, 2048);
7.177 + if( status == 0 ) {
7.178 + /* EOF */
7.179 + break;
7.180 + } else if( status != 2048 ) {
7.181 + /* Error */
7.182 + sector_source_unref(source);
7.183 + source = NULL;
7.184 + break;
7.185 + }
7.186 + }
7.187 + burn->free_data(burn);
7.188 + free(burn);
7.189 + return source;
7.190 +}
7.191 +
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/src/drivers/cdrom/isofs.h Mon May 17 22:01:23 2010 +1000
8.3 @@ -0,0 +1,58 @@
8.4 +/**
8.5 + * $Id$
8.6 + *
8.7 + * libisofs adapter
8.8 + *
8.9 + * Copyright (c) 2010 Nathan Keynes.
8.10 + *
8.11 + * This program is free software; you can redistribute it and/or modify
8.12 + * it under the terms of the GNU General Public License as published by
8.13 + * the Free Software Foundation; either version 2 of the License, or
8.14 + * (at your option) any later version.
8.15 + *
8.16 + * This program is distributed in the hope that it will be useful,
8.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8.19 + * GNU General Public License for more details.
8.20 + */
8.21 +
8.22 +#ifndef cdrom_isofs_H
8.23 +#define cdrom_isofs_H 1
8.24 +
8.25 +#include <libisofs/libisofs.h>
8.26 +#include "drivers/cdrom/sector.h"
8.27 +
8.28 +/**
8.29 + * Construct an IsoFilesystem from an existing sector source
8.30 + */
8.31 +IsoImageFilesystem *iso_filesystem_new_from_source( sector_source_t track, cdrom_lba_t start, ERROR *err );
8.32 +IsoImageFilesystem *iso_filesystem_new_from_disc( cdrom_disc_t disc, cdrom_lba_t start, ERROR *err );
8.33 +IsoImageFilesystem *iso_filesystem_new_from_track( cdrom_disc_t disc, cdrom_track_t track, ERROR *err );
8.34 +
8.35 +
8.36 +/**
8.37 + * Convenience function to read an entire IsoFileSource
8.38 + */
8.39 +int iso_source_file_read_all( IsoFileSource *file, unsigned char *buf, size_t max_size );
8.40 +
8.41 +/**
8.42 + * Construct an IsoImage image from an existing sector source, for use in
8.43 + * creating a modified image
8.44 + */
8.45 +IsoImage *iso_image_new_from_source( sector_source_t track, cdrom_lba_t start, ERROR *err );
8.46 +
8.47 +/**
8.48 + * Construct an IsoImage from a cdrom disc and sector position.
8.49 + * @return a new isofs_reader, or NULL on an error.
8.50 + */
8.51 +IsoImage *iso_image_new_from_disc( cdrom_disc_t disc, cdrom_lba_t start_sector, ERROR *err );
8.52 +
8.53 +IsoImage *iso_image_new_from_track( cdrom_disc_t disc, cdrom_track_t track, ERROR *err );
8.54 +
8.55 +/**
8.56 + * Construct a sector source from a given IsoImage.
8.57 + */
8.58 +sector_source_t iso_sector_source_new( IsoImage *image, sector_mode_t mode, cdrom_lba_t start_sector,
8.59 + const char *bootstrap, ERROR *err );
8.60 +
8.61 +#endif /* !cdrom_isofs_H */
9.1 --- a/src/drivers/cdrom/isoread.c Tue Mar 23 19:48:03 2010 +1000
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,392 +0,0 @@
9.4 -/**
9.5 - * $Id$
9.6 - *
9.7 - * ISO9660 filesystem reading support
9.8 - *
9.9 - * Copyright (c) 2010 Nathan Keynes.
9.10 - *
9.11 - * This program is free software; you can redistribute it and/or modify
9.12 - * it under the terms of the GNU General Public License as published by
9.13 - * the Free Software Foundation; either version 2 of the License, or
9.14 - * (at your option) any later version.
9.15 - *
9.16 - * This program is distributed in the hope that it will be useful,
9.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
9.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9.19 - * GNU General Public License for more details.
9.20 - */
9.21 -
9.22 -#include "drivers/cdrom/cdrom.h"
9.23 -#include "drivers/cdrom/isoread.h"
9.24 -#include "drivers/cdrom/iso_impl.h"
9.25 -
9.26 -#include <string.h>
9.27 -#include <errno.h>
9.28 -
9.29 -static char isofs_magic[5] = { 'C', 'D', '0', '0', '1' };
9.30 -
9.31 -#define ISO_DIR_TAG 0x52494449
9.32 -
9.33 -struct isofs_reader_dir {
9.34 - uint32_t tag;
9.35 - isofs_reader_dir_t parent;
9.36 - size_t num_entries;
9.37 - struct isofs_reader_dirent entries[];
9.38 -};
9.39 -
9.40 -struct isofs_reader {
9.41 - /**
9.42 - * Base sector source to read the filesystem from (must support Mode 1 reads)
9.43 - */
9.44 - sector_source_t source;
9.45 -
9.46 - /**
9.47 - * Offset of the source relative to the start of the (notional) disc -
9.48 - * this is subtracted from all source lba addresses.
9.49 - */
9.50 - cdrom_lba_t source_offset;
9.51 -
9.52 - /**
9.53 - * Start of the ISO9660 filesystem relative to the start of the disc.
9.54 - * (The actual superblock is at fs_start+16)
9.55 - */
9.56 - cdrom_lba_t fs_start;
9.57 -
9.58 - /**
9.59 - * If TRUE, read the little-endian side of the FS, otherwise the big-endian
9.60 - * side. (They should normally give the same result, but in case it matters...)
9.61 - */
9.62 - gboolean little_endian;
9.63 -
9.64 - /**
9.65 - * The volume sequence number, for multi-volume sets.
9.66 - */
9.67 - uint16_t volume_seq_no;
9.68 -
9.69 - char volume_label[33];
9.70 -
9.71 - /**
9.72 - * Filesystem root directory
9.73 - */
9.74 - isofs_reader_dir_t root_dir;
9.75 -};
9.76 -
9.77 -/**
9.78 - * Read a 16-bit dual-endian field using the defined endianness of the reader
9.79 - */
9.80 -#define ISO_GET_DE16( iso, field ) \
9.81 - ( ((iso)->little_endian) ? GINT16_FROM_LE(field) : GINT16_FROM_BE(*((&field)+1)) )
9.82 -
9.83 -/**
9.84 - * Read a 32-bit dual-endian field using the defined endianness of the reader
9.85 - */
9.86 -#define ISO_GET_DE32( iso, field ) \
9.87 - ( ((iso)->little_endian) ? GINT32_FROM_LE(field) : GINT32_FROM_BE(*((&field)+1)) )
9.88 -
9.89 -
9.90 -static void isofs_reader_convert_dirent( isofs_reader_t iso, isofs_reader_dirent_t dest, iso_dirent_t src,
9.91 - char **strp )
9.92 -{
9.93 - dest->start_lba = ISO_GET_DE32(iso, src->file_lba_le);
9.94 - dest->size = ISO_GET_DE32(iso, src->file_size_le);
9.95 - dest->is_dir = (src->flags & ISO_FILE_DIR) ? TRUE : FALSE;
9.96 - dest->interleave_gap = src->gap_size;
9.97 - dest->interleave_size = src->unit_size;
9.98 - dest->name = *strp;
9.99 - memcpy( *strp, src->file_id, src->file_id_len );
9.100 - (*strp)[src->file_id_len] = '\0';
9.101 - *strp += src->file_id_len + 1;
9.102 -}
9.103 -
9.104 -/**
9.105 - * Read a directory from the disc into memory.
9.106 - */
9.107 -isofs_reader_dir_t isofs_reader_read_dir( isofs_reader_t iso, cdrom_lba_t lba, size_t size )
9.108 -{
9.109 - cdrom_count_t count = (size+2047)/2048;
9.110 -
9.111 - char buf[count*2048];
9.112 -
9.113 - if( isofs_reader_read_sectors( iso, lba, count, buf ) != CDROM_ERROR_OK )
9.114 - return NULL;
9.115 -
9.116 - size_t len = 0;
9.117 - unsigned num_entries = 0, i=0, offset=0;
9.118 - /* Compute number of entries and total string length */
9.119 - while( offset < size ) {
9.120 - struct iso_dirent *p = (struct iso_dirent *)&buf[offset];
9.121 - offset += p->record_len;
9.122 - if( offset > size || p->record_len < sizeof(struct iso_dirent) )
9.123 - break; // Bad record length
9.124 - if( p->file_id_len + sizeof(struct iso_dirent)-1 > p->record_len )
9.125 - break; // Bad fileid length
9.126 - if( p->file_id_len == 1 && (p->file_id[0] == 0 || p->file_id[0] == 1 ) )
9.127 - continue; /* self and parent-dir references */
9.128 - num_entries++;
9.129 - len += p->file_id_len + 1;
9.130 - }
9.131 -
9.132 - size_t table_len = num_entries * sizeof(struct isofs_reader_dirent);
9.133 - isofs_reader_dir_t dir = g_malloc0( sizeof(struct isofs_reader_dir) + table_len + len );
9.134 - dir->tag = ISO_DIR_TAG;
9.135 - dir->num_entries = num_entries;
9.136 -
9.137 - char *strp = (char *)&dir->entries[num_entries];
9.138 - offset = 0;
9.139 - for( i=0; i < num_entries; i++ ) {
9.140 - struct iso_dirent *p;
9.141 - do {
9.142 - p = (struct iso_dirent *)&buf[offset];
9.143 - offset += p->record_len;
9.144 - /* Skip over self and parent-dir references */
9.145 - } while( p->file_id_len == 1 && (p->file_id[0] == 0 || p->file_id[0] == 1 ) );
9.146 -
9.147 - isofs_reader_convert_dirent( iso, &dir->entries[i], p, &strp );
9.148 -
9.149 - }
9.150 - return dir;
9.151 -}
9.152 -
9.153 -static gboolean isofs_reader_dirent_match_exact( const char *file, const char *find )
9.154 -{
9.155 - return strcasecmp( file, find ) == 0;
9.156 -}
9.157 -
9.158 -static gboolean isofs_reader_dirent_match_unversioned( const char *file, const char *find )
9.159 -{
9.160 - char *semi = strchr(file, ';');
9.161 - if( semi == NULL ) {
9.162 - /* Unversioned ISO file */
9.163 - return strcasecmp( file, find ) == 0;
9.164 - } else {
9.165 - int len = semi - file;
9.166 - return strncasecmp( file, find, len ) == 0 && strlen(find) == len;
9.167 - }
9.168 -}
9.169 -
9.170 -/**
9.171 - * Search a directory for a given filename. If found, return the corresponding
9.172 - * dirent structure, otherwise NULL. Comparison is case-insensitive, and returns
9.173 - * the most recent (highest numbered) version of a file in case of multiple
9.174 - * versions unless the requested component is also explicitly versioned.
9.175 - *
9.176 - * For now just do a linear search, although we could do a binary search given
9.177 - * that the directory should be sorted.
9.178 - */
9.179 -static isofs_reader_dirent_t isofs_reader_get_file_component( isofs_reader_dir_t dir, const char *component )
9.180 -{
9.181 -
9.182 - if( strchr( component, ';' ) != NULL ) {
9.183 - for( unsigned i=0; i<dir->num_entries; i++ ) {
9.184 - if( isofs_reader_dirent_match_exact(dir->entries[i].name,component) ) {
9.185 - return &dir->entries[i];
9.186 - }
9.187 - }
9.188 - } else {
9.189 - for( unsigned i=0; i<dir->num_entries; i++ ) {
9.190 - if( isofs_reader_dirent_match_unversioned(dir->entries[i].name,component) ) {
9.191 - return &dir->entries[i];
9.192 - }
9.193 - }
9.194 - }
9.195 - return NULL;
9.196 -}
9.197 -
9.198 -isofs_reader_dirent_t isofs_reader_get_file( isofs_reader_t iso, const char *pathname )
9.199 -{
9.200 - int pathlen = strlen(pathname);
9.201 - char tmp[pathlen+1];
9.202 - char *p = tmp;
9.203 - isofs_reader_dir_t dir = iso->root_dir;
9.204 -
9.205 - memcpy( tmp, pathname, pathlen+1 );
9.206 - char *q = strchr(p, '/');
9.207 - while( q != NULL ) {
9.208 - *q = '\0';
9.209 - isofs_reader_dirent_t ent = isofs_reader_get_file_component( dir, p );
9.210 - if( ent == NULL || !ent->is_dir ) {
9.211 - return NULL;
9.212 - }
9.213 - if( ent->subdir == NULL ) {
9.214 - ent->subdir = dir = isofs_reader_read_dir( iso, ent->start_lba, ent->size );
9.215 - if( dir == NULL ) {
9.216 - return NULL;
9.217 - }
9.218 - }
9.219 -
9.220 - p = q+1;
9.221 - q = strchr(p, '/');
9.222 -
9.223 - }
9.224 - return isofs_reader_get_file_component( dir, p );
9.225 -}
9.226 -
9.227 -cdrom_error_t isofs_reader_read_file( isofs_reader_t iso, isofs_reader_dirent_t file,
9.228 - size_t offset, size_t byte_count, unsigned char *buf )
9.229 -{
9.230 - char tmp[2048];
9.231 -
9.232 - if( offset + byte_count > file->size )
9.233 - return CDROM_ERROR_BADREAD;
9.234 -
9.235 - if( file->interleave_gap == 0 ) {
9.236 - cdrom_lba_t lba = file->start_lba + (offset>>11);
9.237 - lba += ((file->xa_size+2047)>>11); /* Skip XA record if present */
9.238 -
9.239 - if( (offset & 2047) != 0 ) {
9.240 - /* Read an unaligned start block */
9.241 - cdrom_error_t status = isofs_reader_read_sectors( iso, lba, 1, tmp );
9.242 - if( status != CDROM_ERROR_OK )
9.243 - return status;
9.244 - unsigned align = offset & 2047;
9.245 - size_t length = 2048 - align;
9.246 - if( length >= byte_count ) {
9.247 - memcpy( buf, &tmp[align], byte_count );
9.248 - return CDROM_ERROR_OK;
9.249 - } else {
9.250 - memcpy( buf, &tmp[align], length );
9.251 - byte_count -= length;
9.252 - buf += length;
9.253 - lba++;
9.254 - }
9.255 - }
9.256 - /* Read the bulk of the data */
9.257 - cdrom_count_t sector_count = byte_count >> 11;
9.258 - if( sector_count > 0 ) {
9.259 - cdrom_error_t status = isofs_reader_read_sectors( iso, lba, sector_count, buf );
9.260 - if( status != CDROM_ERROR_OK )
9.261 - return status;
9.262 - buf += (sector_count << 11);
9.263 - lba += sector_count;
9.264 - }
9.265 - /* Finally read a partial final block */
9.266 - if( (byte_count & 2047) != 0 ) {
9.267 - cdrom_error_t status = isofs_reader_read_sectors( iso, lba, 1, tmp );
9.268 - if( status != CDROM_ERROR_OK )
9.269 - return status;
9.270 - memcpy( buf, tmp, byte_count & 2047 );
9.271 - }
9.272 - return CDROM_ERROR_OK;
9.273 - } else {
9.274 - // ERROR("Interleaved files not supported");
9.275 - return CDROM_ERROR_BADREAD;
9.276 - }
9.277 -}
9.278 -
9.279 -void isofs_reader_destroy_dir( isofs_reader_dir_t dir )
9.280 -{
9.281 - dir->tag = 0;
9.282 - for( unsigned i=0; i<dir->num_entries; i++ ) {
9.283 - if( dir->entries[i].subdir != NULL ) {
9.284 - isofs_reader_dir_t subdir = dir->entries[i].subdir;
9.285 - dir->entries[i].subdir = NULL;
9.286 - isofs_reader_destroy_dir(dir);
9.287 - }
9.288 - }
9.289 - g_free(dir);
9.290 -}
9.291 -
9.292 -cdrom_error_t isofs_reader_read_sectors( isofs_reader_t iso, cdrom_lba_t lba, cdrom_count_t count,
9.293 - unsigned char *buf )
9.294 -{
9.295 - if( lba < iso->source_offset )
9.296 - return CDROM_ERROR_BADREAD;
9.297 - return sector_source_read_sectors( iso->source, lba - iso->source_offset, count,
9.298 - CDROM_READ_MODE2_FORM1|CDROM_READ_DATA, buf, NULL );
9.299 -}
9.300 -
9.301 -
9.302 -isofs_reader_t isofs_reader_new( sector_source_t source, cdrom_lba_t offset, cdrom_lba_t start, ERROR *err )
9.303 -{
9.304 - char buf[2048];
9.305 - iso_pvd_t pvd = (iso_pvd_t)&buf;
9.306 - unsigned i = 0;
9.307 -
9.308 - isofs_reader_t iso = g_malloc0( sizeof(struct isofs_reader) );
9.309 - if( iso == NULL ) {
9.310 - SET_ERROR( err, ENOMEM, "Unable to allocate memory" );
9.311 - return NULL;
9.312 - }
9.313 - iso->source = source;
9.314 - iso->source_offset = offset;
9.315 - iso->fs_start = start;
9.316 - iso->little_endian = TRUE;
9.317 -
9.318 - do {
9.319 - /* Find the primary volume descriptor */
9.320 - cdrom_error_t status = isofs_reader_read_sectors( iso, iso->fs_start + ISO_SUPERBLOCK_OFFSET + i, 1, buf );
9.321 - if( status != CDROM_ERROR_OK ) {
9.322 - SET_ERROR( err, EBADF, "Unable to read superblock from ISO9660 filesystem" );
9.323 - g_free(iso);
9.324 - return NULL;
9.325 - }
9.326 - if( memcmp(pvd->tag, isofs_magic, 5) != 0 || /* Not an ISO volume descriptor */
9.327 - pvd->desc_type == ISO_TERMINAL_DESCRIPTOR ) { /* Reached the end of the descriptor list */
9.328 - SET_ERROR( err, EINVAL, "ISO9660 filesystem not found" );
9.329 - g_free(iso);
9.330 - return NULL;
9.331 - }
9.332 - i++;
9.333 - } while( pvd->desc_type != ISO_PRIMARY_DESCRIPTOR );
9.334 -
9.335 - if( pvd->desc_version != 1 ) {
9.336 - SET_ERROR( err, EINVAL, "Incompatible ISO9660 filesystem" );
9.337 - g_free(iso);
9.338 - return NULL;
9.339 - }
9.340 -
9.341 - iso->volume_seq_no = ISO_GET_DE16(iso, pvd->volume_seq_le);
9.342 - memcpy( iso->volume_label, pvd->volume_id, 32 );
9.343 - for( i=32; i>0 && iso->volume_label[i-1] == ' '; i-- );
9.344 - iso->volume_label[i] = '\0';
9.345 -
9.346 - iso->root_dir = isofs_reader_read_dir( iso,
9.347 - ISO_GET_DE32(iso, pvd->root_dirent.file_lba_le),
9.348 - ISO_GET_DE32(iso, pvd->root_dirent.file_size_le) );
9.349 - if( iso->root_dir == NULL ) {
9.350 - SET_ERROR( err, EINVAL, "Unable to read root directory from ISO9660 filesystem" );
9.351 - g_free(iso);
9.352 - return NULL;
9.353 - }
9.354 -
9.355 - sector_source_ref( source );
9.356 - return iso;
9.357 -}
9.358 -
9.359 -isofs_reader_t isofs_reader_new_from_disc( cdrom_disc_t disc, cdrom_lba_t lba, ERROR *err )
9.360 -{
9.361 - return isofs_reader_new( &disc->source, 0, lba, err );
9.362 -}
9.363 -
9.364 -isofs_reader_t isofs_reader_new_from_track( cdrom_disc_t disc, cdrom_track_t track, ERROR *err )
9.365 -{
9.366 - return isofs_reader_new( &disc->source, 0, track->lba, err );
9.367 -}
9.368 -
9.369 -isofs_reader_t isofs_reader_new_from_source( sector_source_t source, ERROR *err )
9.370 -{
9.371 - return isofs_reader_new( source, 0, 0, err );
9.372 -}
9.373 -
9.374 -void isofs_reader_destroy( isofs_reader_t iso )
9.375 -{
9.376 - isofs_reader_destroy_dir( iso->root_dir );
9.377 - iso->root_dir = NULL;
9.378 - sector_source_unref( iso->source );
9.379 - iso->source = NULL;
9.380 - g_free( iso );
9.381 -}
9.382 -
9.383 -isofs_reader_dir_t isofs_reader_get_root_dir( isofs_reader_t iso )
9.384 -{
9.385 - return iso->root_dir;
9.386 -}
9.387 -
9.388 -void isofs_reader_print_dir( FILE *f, isofs_reader_dir_t dir )
9.389 -{
9.390 - fprintf( f, "Total %d files\n", dir->num_entries );
9.391 - for( unsigned i=0; i<dir->num_entries; i++ ) {
9.392 - fprintf( f, "%7d %s\n", dir->entries[i].size, dir->entries[i].name );
9.393 - }
9.394 -
9.395 -}
10.1 --- a/src/drivers/cdrom/isoread.h Tue Mar 23 19:48:03 2010 +1000
10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
10.3 @@ -1,95 +0,0 @@
10.4 -/**
10.5 - * $Id$
10.6 - *
10.7 - * ISO9660 filesystem reading support
10.8 - *
10.9 - * Copyright (c) 2010 Nathan Keynes.
10.10 - *
10.11 - * This program is free software; you can redistribute it and/or modify
10.12 - * it under the terms of the GNU General Public License as published by
10.13 - * the Free Software Foundation; either version 2 of the License, or
10.14 - * (at your option) any later version.
10.15 - *
10.16 - * This program is distributed in the hope that it will be useful,
10.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
10.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10.19 - * GNU General Public License for more details.
10.20 - */
10.21 -
10.22 -
10.23 -#ifndef cdrom_isoread_H
10.24 -#define cdrom_isoread_H 1
10.25 -
10.26 -#include "drivers/cdrom/defs.h"
10.27 -
10.28 -#ifdef __cplusplus
10.29 -extern "C" {
10.30 -#endif
10.31 -
10.32 -typedef struct isofs_reader_dir *isofs_reader_dir_t;
10.33 -
10.34 -typedef struct isofs_reader_dirent {
10.35 - const char *name;
10.36 - size_t size;
10.37 - gboolean is_dir;
10.38 -
10.39 - cdrom_lba_t start_lba;
10.40 - size_t xa_size;
10.41 - unsigned interleave_gap;
10.42 - unsigned interleave_size;
10.43 - isofs_reader_dir_t subdir;
10.44 -} *isofs_reader_dirent_t;
10.45 -
10.46 -/**
10.47 - * ISO9600 filesystem reader.
10.48 - */
10.49 -typedef struct isofs_reader *isofs_reader_t;
10.50 -
10.51 -/**
10.52 - * Construct an isofs reader from an existing sector source. On error, returns
10.53 - * NULL.
10.54 - */
10.55 -isofs_reader_t isofs_reader_new_from_source( sector_source_t track, ERROR *err );
10.56 -
10.57 -/**
10.58 - * Construct an isofs from a cdrom disc and sector position.
10.59 - * @return a new isofs_reader, or NULL on an error (and sets err).
10.60 - */
10.61 -isofs_reader_t isofs_reader_new_from_disc( cdrom_disc_t disc, cdrom_lba_t start_sector, ERROR *err );
10.62 -
10.63 -isofs_reader_t isofs_reader_new_from_track( cdrom_disc_t disc, cdrom_track_t track, ERROR *err );
10.64 -
10.65 -/**
10.66 - * Destroy an isofs reader.
10.67 - */
10.68 -void isofs_reader_destroy( isofs_reader_t reader );
10.69 -
10.70 -/**
10.71 - * Read 0 or more 2048-byte sectors from the filesystem.
10.72 - */
10.73 -cdrom_error_t isofs_reader_read_sectors( isofs_reader_t iso, cdrom_lba_t sector, cdrom_count_t count,
10.74 - unsigned char *buf );
10.75 -
10.76 -
10.77 -/**
10.78 - * Search the filesystem for the specific fully-qualified file.
10.79 - * @return FALSE if the file could not be found, otherwise TRUE and the iterator
10.80 - * is updated to point to the requested file.
10.81 - */
10.82 -isofs_reader_dirent_t isofs_reader_get_file( isofs_reader_t iso, const char *filename );
10.83 -
10.84 -cdrom_error_t isofs_reader_read_file( isofs_reader_t iso, isofs_reader_dirent_t file,
10.85 - size_t offset, size_t byte_count, unsigned char *buf );
10.86 -
10.87 -/**
10.88 - * Print an isofs directory to the given stream (mostly for debugging purposes)
10.89 - */
10.90 -void isofs_reader_print_dir( FILE *f, isofs_reader_dir_t dir );
10.91 -
10.92 -isofs_reader_dir_t isofs_reader_get_root_dir( isofs_reader_t iso );
10.93 -
10.94 -#ifdef __cplusplus
10.95 -}
10.96 -#endif
10.97 -
10.98 -#endif /* !cdrom_isoread_H */
11.1 --- a/src/drivers/cdrom/sector.c Tue Mar 23 19:48:03 2010 +1000
11.2 +++ b/src/drivers/cdrom/sector.c Mon May 17 22:01:23 2010 +1000
11.3 @@ -25,6 +25,7 @@
11.4 #include <unistd.h>
11.5 #include <fcntl.h>
11.6
11.7 +#include "lxpaths.h"
11.8 #include "drivers/cdrom/sector.h"
11.9 #include "drivers/cdrom/cdrom.h"
11.10 #include "drivers/cdrom/ecc.h"
11.11 @@ -534,6 +535,139 @@
11.12 fref->closeOnDestroy = closeOnDestroy;
11.13 }
11.14
11.15 +/********************** Temporary file implementation ************************/
11.16 +/**
11.17 + * The tmpfile source behaves exactly like a regular file source, except that
11.18 + * it creates a new temporary file, which is deleted on destruction or program
11.19 + * exit. The file is initially empty, so the user will need to get the fd and
11.20 + * write something to it before use.
11.21 + */
11.22 +
11.23 +typedef struct tmpfile_sector_source {
11.24 + struct file_sector_source file;
11.25 + const char *filename;
11.26 +} *tmpfile_sector_source_t;
11.27 +
11.28 +static GList *tmpfile_open_list = NULL;
11.29 +static gboolean tmpfile_atexit_installed = 0; /* TRUE to indicate atexit hook is registered */
11.30 +
11.31 +/**
11.32 + * atexit hook to destroy any open tmpfiles - make sure they're deleted.
11.33 + */
11.34 +static void tmpfile_atexit_hook(void)
11.35 +{
11.36 + GList *ptr;
11.37 + while( tmpfile_open_list != NULL ) {
11.38 + sector_source_t source = (sector_source_t)tmpfile_open_list->data;
11.39 + source->destroy(source);
11.40 + assert( tmpfile_open_list == NULL || tmpfile_open_list->data != source );
11.41 + }
11.42 +}
11.43 +
11.44 +
11.45 +static void tmpfile_sector_source_destroy( sector_source_t dev )
11.46 +{
11.47 + assert( IS_SECTOR_SOURCE_TYPE(dev,FILE_SECTOR_SOURCE) );
11.48 + tmpfile_sector_source_t fdev = (tmpfile_sector_source_t)dev;
11.49 +
11.50 + fclose( fdev->file.file );
11.51 + fdev->file.file = NULL;
11.52 + unlink(fdev->filename);
11.53 + g_free((char *)fdev->filename);
11.54 + tmpfile_open_list = g_list_remove(tmpfile_open_list, fdev);
11.55 + default_sector_source_destroy(dev);
11.56 +}
11.57 +
11.58 +sector_source_t tmpfile_sector_source_new( sector_mode_t mode )
11.59 +{
11.60 + if( !tmpfile_atexit_installed ) {
11.61 + atexit(tmpfile_atexit_hook);
11.62 + }
11.63 +
11.64 + gchar *tmpdir = getenv("TMPDIR");
11.65 + if( tmpdir == NULL ) {
11.66 + tmpdir = "/tmp";
11.67 + }
11.68 + gchar *tempfile = get_filename_at(tmpdir, "cd.XXXXXXX");
11.69 + int fd = mkstemp( tempfile );
11.70 + if( fd == -1 ) {
11.71 + g_free(tempfile);
11.72 + return FALSE;
11.73 + }
11.74 +
11.75 + FILE *f = fdopen( fd, "w+" );
11.76 + if( f == NULL ) {
11.77 + close(fd);
11.78 + unlink(tempfile);
11.79 + g_free(tempfile);
11.80 + return NULL;
11.81 + }
11.82 +
11.83 + tmpfile_sector_source_t dev = g_malloc0(sizeof(struct tmpfile_sector_source));
11.84 + dev->file.file = f;
11.85 + dev->filename = tempfile;
11.86 + sector_source_t source = sector_source_init( &dev->file.dev, FILE_SECTOR_SOURCE, mode, 0, file_sector_source_read, tmpfile_sector_source_destroy );
11.87 + tmpfile_open_list = g_list_append(tmpfile_open_list, source);
11.88 +}
11.89 +
11.90 +/************************ Memory device implementation *************************/
11.91 +typedef struct mem_sector_source {
11.92 + struct sector_source dev;
11.93 + unsigned char *buffer;
11.94 + gboolean freeOnDestroy;
11.95 +} *mem_sector_source_t;
11.96 +
11.97 +static void mem_sector_source_destroy( sector_source_t dev )
11.98 +{
11.99 + assert( IS_SECTOR_SOURCE_TYPE(dev,MEM_SECTOR_SOURCE) );
11.100 + mem_sector_source_t mdev = (mem_sector_source_t)dev;
11.101 +
11.102 + if( mdev->freeOnDestroy ) {
11.103 + free(mdev->buffer);
11.104 + }
11.105 + mdev->buffer = NULL;
11.106 + default_sector_source_destroy(dev);
11.107 +}
11.108 +
11.109 +static cdrom_error_t mem_sector_source_read( sector_source_t dev, cdrom_lba_t lba, cdrom_count_t block_count, unsigned char *buf )
11.110 +{
11.111 + assert( IS_SECTOR_SOURCE_TYPE(dev,MEM_SECTOR_SOURCE) );
11.112 + mem_sector_source_t mdev = (mem_sector_source_t)dev;
11.113 +
11.114 + if( (lba + block_count) >= dev->size )
11.115 + return CDROM_ERROR_BADREAD;
11.116 + uint32_t off = lba * CDROM_SECTOR_SIZE(dev->mode);
11.117 + uint32_t size = block_count * CDROM_SECTOR_SIZE(dev->mode);
11.118 +
11.119 + memcpy( buf, mdev->buffer + off, size );
11.120 + return CDROM_ERROR_OK;
11.121 +}
11.122 +
11.123 +sector_source_t mem_sector_source_new_buffer( unsigned char *buffer, sector_mode_t mode,
11.124 + cdrom_count_t sector_count, gboolean freeOnDestroy )
11.125 +{
11.126 + assert( mode != SECTOR_UNKNOWN );
11.127 + assert( buffer != NULL );
11.128 + mem_sector_source_t dev = g_malloc(sizeof(struct mem_sector_source));
11.129 + dev->buffer = buffer;
11.130 + dev->freeOnDestroy = freeOnDestroy;
11.131 + return sector_source_init( &dev->dev, MEM_SECTOR_SOURCE, mode, sector_count, mem_sector_source_read, mem_sector_source_destroy );
11.132 +}
11.133 +
11.134 +sector_source_t mem_sector_source_new( sector_mode_t mode, cdrom_count_t sector_count )
11.135 +{
11.136 + return mem_sector_source_new_buffer( g_malloc( sector_count * CDROM_SECTOR_SIZE(mode) ), mode,
11.137 + sector_count, TRUE );
11.138 +}
11.139 +
11.140 +unsigned char *mem_sector_source_get_buffer( sector_source_t dev )
11.141 +{
11.142 + assert( IS_SECTOR_SOURCE_TYPE(dev,MEM_SECTOR_SOURCE) );
11.143 + mem_sector_source_t mdev = (mem_sector_source_t)dev;
11.144 + return mdev->buffer;
11.145 +}
11.146 +
11.147 +
11.148 /************************ Track device implementation *************************/
11.149 typedef struct track_sector_source {
11.150 struct sector_source dev;
12.1 --- a/src/drivers/cdrom/sector.h Tue Mar 23 19:48:03 2010 +1000
12.2 +++ b/src/drivers/cdrom/sector.h Mon May 17 22:01:23 2010 +1000
12.3 @@ -33,6 +33,7 @@
12.4 typedef enum {
12.5 NULL_SECTOR_SOURCE,
12.6 FILE_SECTOR_SOURCE,
12.7 + MEM_SECTOR_SOURCE,
12.8 DISC_SECTOR_SOURCE,
12.9 TRACK_SECTOR_SOURCE
12.10 } sector_source_type_t;
12.11 @@ -56,7 +57,7 @@
12.12 sector_source_type_t type;
12.13
12.14 sector_mode_t mode; /* Implies sector size. */
12.15 - uint32_t size; /* Block count */
12.16 + cdrom_count_t size; /* Block count */
12.17
12.18 /**
12.19 * Read blocks from the device using the native block size.
12.20 @@ -98,6 +99,12 @@
12.21 sector_source_t file_sector_source_new_full( FILE *f, sector_mode_t mode, gboolean closeOnDestroy );
12.22
12.23 /**
12.24 + * Temp-file creator - initially empty. Creates a file in the system temp dir,
12.25 + * unlinked on destruction or program exit.
12.26 + */
12.27 +sector_source_t tmpfile_sector_source_new( sector_mode_t mode );
12.28 +
12.29 +/**
12.30 * Construct a file source that shares its file descriptor with another
12.31 * file source.
12.32 */
12.33 @@ -119,6 +126,25 @@
12.34 */
12.35 int file_sector_source_get_fd( sector_source_t ref );
12.36
12.37 +/** Construct a memory source with the given mode and size */
12.38 +sector_source_t mem_sector_source_new( sector_mode_t mode, cdrom_count_t size );
12.39 +
12.40 +/**
12.41 + * Construct a memory source using the supplied buffer for data.
12.42 + * @param buffer The buffer to read from, which must be at least size * sector_size in length
12.43 + * @param mode The sector mode of the data in the buffer, which cannot be SECTOR_UNKNOWN
12.44 + * @param size Number of sectors in the buffer
12.45 + * @param freeOnDestroy If true, the source owns the buffer and will release it when the
12.46 + * source is destroyed.
12.47 + */
12.48 +sector_source_t mem_sector_source_new_buffer( unsigned char *buffer, sector_mode_t mode, cdrom_count_t size,
12.49 + gboolean freeOnDestroy );
12.50 +
12.51 +/**
12.52 + * Retrieve the underlying buffer for a memory source
12.53 + */
12.54 +unsigned char *mem_sector_source_get_buffer( sector_source_t source );
12.55 +
12.56 /**
12.57 * Increment the reference count for a block device.
12.58 */
13.1 --- a/src/main.c Tue Mar 23 19:48:03 2010 +1000
13.2 +++ b/src/main.c Mon May 17 22:01:23 2010 +1000
13.3 @@ -20,6 +20,7 @@
13.4 #include <stdlib.h>
13.5 #include <unistd.h>
13.6 #include <getopt.h>
13.7 +#include <libisofs/libisofs.h>
13.8 #include "lxdream.h"
13.9 #include "lxpaths.h"
13.10 #include "gettext.h"
13.11 @@ -224,6 +225,7 @@
13.12 exit(0);
13.13 }
13.14
13.15 + iso_init();
13.16 gdrom_list_init();
13.17 vmulist_init();
13.18
14.1 --- a/src/test/testisoread.c Tue Mar 23 19:48:03 2010 +1000
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,63 +0,0 @@
14.4 -/**
14.5 - * $Id$
14.6 - *
14.7 - * Unit tests for the ISO9660 filesystem reader
14.8 - *
14.9 - * Copyright (c) 2010 Nathan Keynes.
14.10 - *
14.11 - * This program is free software; you can redistribute it and/or modify
14.12 - * it under the terms of the GNU General Public License as published by
14.13 - * the Free Software Foundation; either version 2 of the License, or
14.14 - * (at your option) any later version.
14.15 - *
14.16 - * This program is distributed in the hope that it will be useful,
14.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
14.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14.19 - * GNU General Public License for more details.
14.20 - */
14.21 -
14.22 -#include "drivers/cdrom/cdrom.h"
14.23 -#include "drivers/cdrom/isoread.h"
14.24 -#include <stdio.h>
14.25 -
14.26 -int main( int argc, char *argv[] )
14.27 -{
14.28 - if( argc < 2 ) {
14.29 - fprintf( stderr, "Usage: testisoread <disc image>\n" );
14.30 - return 1;
14.31 - }
14.32 -
14.33 - ERROR err;
14.34 - cdrom_disc_t disc = cdrom_disc_open(argv[1], &err);
14.35 -
14.36 - if( disc == NULL ) {
14.37 - fprintf( stderr, "Unable to open disc image '%s': %s\n", argv[1], err.msg );
14.38 - return 2;
14.39 - }
14.40 - cdrom_track_t track = cdrom_disc_get_last_data_track(disc);
14.41 - if( track == NULL ) {
14.42 - fprintf( stderr, "Disc has no data tracks\n" );
14.43 - return 3;
14.44 - }
14.45 -
14.46 - isofs_reader_t iso = isofs_reader_new_from_track( disc, track, &err );
14.47 - if( iso == NULL ) {
14.48 - fprintf( stderr, "Unable to open ISO filesystem: %s\n", err.msg );
14.49 - return 4;
14.50 - }
14.51 - isofs_reader_print_dir( stdout, isofs_reader_get_root_dir(iso) );
14.52 -
14.53 - isofs_reader_dirent_t boot = isofs_reader_get_file( iso, "1st_read.bin" );
14.54 - if( boot == NULL ) {
14.55 - fprintf( stderr, "Unable to find 1st_read.bin" );
14.56 - return 5;
14.57 - }
14.58 -
14.59 - printf( "Bootstrap: %s (%d)\n", boot->name, boot->size );
14.60 - char tmp[boot->size];
14.61 - if( isofs_reader_read_file( iso, boot, 0, boot->size, tmp ) != CDROM_ERROR_OK ) {
14.62 - fprintf( stderr, "Unable to read 1st_read.bin" );
14.63 - return 6;
14.64 - }
14.65 - return 0;
14.66 -}
.