From: <fr...@us...> - 2011-09-05 12:17:40
|
Revision: 4539 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4539&view=rev Author: fredm Date: 2011-09-05 12:17:34 +0000 (Mon, 05 Sep 2011) Log Message: ----------- Remove operations with uninitialised pointers in libspectrum_make_room, at stopping RZX recordings or saving snapshots (part of patch #3404090) (Sergio Baldov?\195?\173). Modified Paths: -------------- trunk/libspectrum/libspectrum.c trunk/libspectrum/make-perl.c trunk/libspectrum/myglib/garray.c Modified: trunk/libspectrum/libspectrum.c =================================================================== --- trunk/libspectrum/libspectrum.c 2011-09-05 12:02:04 UTC (rev 4538) +++ trunk/libspectrum/libspectrum.c 2011-09-05 12:17:34 UTC (rev 4539) @@ -914,16 +914,15 @@ libspectrum_make_room( libspectrum_byte **dest, size_t requested, libspectrum_byte **ptr, size_t *allocated ) { - size_t current_length; + size_t current_length = 0; - current_length = *ptr - *dest; - if( *allocated == 0 ) { (*allocated) = requested; *dest = libspectrum_malloc( requested * sizeof( **dest ) ); } else { + current_length = *ptr - *dest; /* If there's already enough room here, just return */ if( current_length + requested <= (*allocated) ) return; Modified: trunk/libspectrum/make-perl.c =================================================================== --- trunk/libspectrum/make-perl.c 2011-09-05 12:02:04 UTC (rev 4538) +++ trunk/libspectrum/make-perl.c 2011-09-05 12:17:34 UTC (rev 4539) @@ -253,6 +253,7 @@ "WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len );\n" "#define g_array_index(a,t,i) (*(((t*)a->data)+i))\n" "WIN32_DLL GArray* g_array_set_size( GArray *array, guint length );\n" +"WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment );\n" "\n" ); if( sizeof( void* ) == sizeof( int ) ) { printf( "#define GINT_TO_POINTER(i) ((gpointer) (i))\n" ); Modified: trunk/libspectrum/myglib/garray.c =================================================================== --- trunk/libspectrum/myglib/garray.c 2011-09-05 12:02:04 UTC (rev 4538) +++ trunk/libspectrum/myglib/garray.c 2011-09-05 12:17:34 UTC (rev 4539) @@ -96,4 +96,21 @@ return array; } +gchar* +g_array_free( GArray *array, gboolean free_segment ) +{ + gchar* segment; + + if( free_segment ) { + libspectrum_free( array->data ); + segment = NULL; + } + else + segment = array->data; + + libspectrum_free( array ); + + return segment; +} + #endif /* #ifndef HAVE_LIB_GLIB */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-11-06 21:44:54
|
Revision: 4548 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4548&view=rev Author: pak21 Date: 2011-11-06 21:44:48 +0000 (Sun, 06 Nov 2011) Log Message: ----------- The "look, Phil's not dead" commit. Remove unused variables (thanks, gcc 4.6). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/rzx.c trunk/libspectrum/szx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2011-09-27 11:50:15 UTC (rev 4547) +++ trunk/libspectrum/hacking/ChangeLog 2011-11-06 21:44:48 UTC (rev 4548) @@ -856,3 +856,4 @@ uninitialised pointers in libspectrum_make_room, at stopping RZX recordings or saving snapshots (part of patch #3404090) (Sergio Baldoví). +20111106 rzx.c,szx.c: remove unused variables (thanks, gcc 4.6). Modified: trunk/libspectrum/rzx.c =================================================================== --- trunk/libspectrum/rzx.c 2011-09-27 11:50:15 UTC (rev 4547) +++ trunk/libspectrum/rzx.c 2011-11-06 21:44:48 UTC (rev 4548) @@ -766,8 +766,6 @@ static libspectrum_error rzx_read_header( const libspectrum_byte **ptr, const libspectrum_byte *end ) { - libspectrum_dword flags; - /* Check the header exists */ if( end - (*ptr) < (ptrdiff_t)strlen( rzx_signature ) + 6 ) { libspectrum_print_error( LIBSPECTRUM_ERROR_CORRUPT, @@ -785,7 +783,9 @@ /* Skip over the signature and the version numbers */ (*ptr) += strlen( rzx_signature ) + 2; - flags = libspectrum_read_dword( ptr ); + /* And skip the flags as well - separate call as we'll need the return + value if we ever fix the stuff below */ + libspectrum_read_dword( ptr ); /* FIXME: how to handle signatures */ Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2011-09-27 11:50:15 UTC (rev 4547) +++ trunk/libspectrum/szx.c 2011-11-06 21:44:48 UTC (rev 4548) @@ -1700,7 +1700,6 @@ libspectrum_byte *buffer2; - size_t compressed_length; size_t uncompressed_length; libspectrum_error error; @@ -1713,7 +1712,8 @@ return LIBSPECTRUM_ERROR_UNKNOWN; } - compressed_length = libspectrum_read_dword( buffer ); + /* Skip the compressed length as we never actually use it - bug? */ + libspectrum_read_dword( buffer ); uncompressed_length = 0x4000; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-02-03 11:48:39
|
Revision: 4653 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4653&view=rev Author: fredm Date: 2012-02-03 11:48:30 +0000 (Fri, 03 Feb 2012) Log Message: ----------- Fix less than 0 check on unsigned expression (thanks, clang 2.1). Modified Paths: -------------- trunk/libspectrum/csw.c trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/csw.c =================================================================== --- trunk/libspectrum/csw.c 2012-01-26 22:06:57 UTC (rev 4652) +++ trunk/libspectrum/csw.c 2012-02-03 11:48:30 UTC (rev 4653) @@ -86,8 +86,8 @@ if( compressed != 0 && compressed != 1 ) goto csw_bad_compress; + if( length < 29 - buffer[12] ) goto csw_short; length -= 29 - buffer[12]; - if( length < 0 ) goto csw_short; buffer += 29 + buffer[12]; break; Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-01-26 22:06:57 UTC (rev 4652) +++ trunk/libspectrum/hacking/ChangeLog 2012-02-03 11:48:30 UTC (rev 4653) @@ -869,3 +869,5 @@ recordings or saving snapshots (part of patch #3404090) (Sergio Baldoví). 20111106 rzx.c,szx.c: remove unused variables (thanks, gcc 4.6). +20120203 csw.c: fix less than 0 check on unsigned expression (thanks, clang + 2.1) (Fred). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-02-03 11:52:26
|
Revision: 4654 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4654&view=rev Author: fredm Date: 2012-02-03 11:52:16 +0000 (Fri, 03 Feb 2012) Log Message: ----------- Correct error argument in libspectrum_print_error() calls (thanks, clang 2.1). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/szx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-02-03 11:48:30 UTC (rev 4653) +++ trunk/libspectrum/hacking/ChangeLog 2012-02-03 11:52:16 UTC (rev 4654) @@ -871,3 +871,5 @@ 20111106 rzx.c,szx.c: remove unused variables (thanks, gcc 4.6). 20120203 csw.c: fix less than 0 check on unsigned expression (thanks, clang 2.1) (Fred). +20120203 szx.c: correct error argument in libspectrum_print_error() calls + (thanks, clang 2.1) (Fred). Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-02-03 11:48:30 UTC (rev 4653) +++ trunk/libspectrum/szx.c 2012-02-03 11:52:16 UTC (rev 4654) @@ -2267,10 +2267,10 @@ default: libspectrum_print_error( - LIBSPECTRUM_MACHINE_UNKNOWN, + LIBSPECTRUM_ERROR_UNKNOWN, "libspectrum_szx_read: unknown machine type %d", (int)*buffer ); - return LIBSPECTRUM_MACHINE_UNKNOWN; + return LIBSPECTRUM_ERROR_UNKNOWN; } /* Skip to the end of the header */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-02-20 10:50:22
|
Revision: 4673 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4673&view=rev Author: fredm Date: 2012-02-20 10:50:13 +0000 (Mon, 20 Feb 2012) Log Message: ----------- Advertise that we support bzip2 compressed and wav files (part of patch #3413549) (Sergio Baldov?\195?\173). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/make-perl.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-02-20 10:38:29 UTC (rev 4672) +++ trunk/libspectrum/hacking/ChangeLog 2012-02-20 10:50:13 UTC (rev 4673) @@ -873,3 +873,5 @@ 2.1) (Fred). 20120203 szx.c: correct error argument in libspectrum_print_error() calls (thanks, clang 2.1) (Fred). +20120220 make-perl.c: advertise that we support bzip2 compressed and wav files + (part of patch #3413549) (Sergio Baldoví). Modified: trunk/libspectrum/make-perl.c =================================================================== --- trunk/libspectrum/make-perl.c 2012-02-20 10:38:29 UTC (rev 4672) +++ trunk/libspectrum/make-perl.c 2012-02-20 10:50:13 UTC (rev 4673) @@ -321,6 +321,16 @@ #endif /* #ifdef HAVE_ZLIB_H */ +#ifdef HAVE_LIBBZ2 + printf( "\n/* we support files compressed with bz2 */\n" ); + printf( "#define LIBSPECTRUM_SUPPORTS_BZ2_COMPRESSION (1)\n\n" ); +#endif /* #ifdef HAVE_LIBBZ2 */ + +#ifdef HAVE_LIB_AUDIOFILE + printf( "\n/* we support files wav files */\n" ); + printf( "#define LIBSPECTRUM_SUPPORTS_AUDIOFILE (1)\n\n" ); +#endif /* #ifdef HAVE_LIB_AUDIOFILE */ + printf( "CODE\n}\n\n" ); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-03-27 11:47:05
|
Revision: 4686 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4686&view=rev Author: fredm Date: 2012-03-27 11:46:54 +0000 (Tue, 27 Mar 2012) Log Message: ----------- Simplify detection of GLib and drop support for version 1.x (patch #3508792) (Alberto Garcia) Modified Paths: -------------- trunk/libspectrum/Makefile.am trunk/libspectrum/acinclude.m4 trunk/libspectrum/configure.in trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/Makefile.am =================================================================== --- trunk/libspectrum/Makefile.am 2012-03-27 11:38:35 UTC (rev 4685) +++ trunk/libspectrum/Makefile.am 2012-03-27 11:46:54 UTC (rev 4686) @@ -63,7 +63,7 @@ libspectrum_la_LDFLAGS = -version-info 8:0:0 -no-undefined @WINDRES_LDFLAGS@ -libspectrum_la_LIBADD = @AUDIOFILE_LIBS@ -lm +libspectrum_la_LIBADD = @AUDIOFILE_LIBS@ @GLIB_LIBS@ -lm libspectrum_la_DEPENDENCIES = @WINDRES_OBJ@ Modified: trunk/libspectrum/acinclude.m4 =================================================================== --- trunk/libspectrum/acinclude.m4 2012-03-27 11:38:35 UTC (rev 4685) +++ trunk/libspectrum/acinclude.m4 2012-03-27 11:46:54 UTC (rev 4686) @@ -1,417 +1,3 @@ -# Configure paths for GLIB -# Owen Taylor 97-11-3 - -# Taken from Glib 1.2.10 by PAK 2004/07/06 - -dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or -dnl gthread is specified in MODULES, pass to glib-config -dnl -AC_DEFUN([AM_PATH_GLIB], -[dnl -dnl Get the cflags and libraries from the glib-config script -dnl -AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], - glib_config_prefix="$withval", glib_config_prefix="") -AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], - glib_config_exec_prefix="$withval", glib_config_exec_prefix="") -AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], - , enable_glibtest=yes) - - if test x$glib_config_exec_prefix != x ; then - glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config - fi - fi - if test x$glib_config_prefix != x ; then - glib_config_args="$glib_config_args --prefix=$glib_config_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_prefix/bin/glib-config - fi - fi - - for module in . $4 - do - case "$module" in - gmodule) - glib_config_args="$glib_config_args gmodule" - ;; - gthread) - glib_config_args="$glib_config_args gthread" - ;; - esac - done - - AC_PATH_PROG(GLIB_CONFIG, glib-config, no) - min_glib_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) - no_glib="" - if test "$GLIB_CONFIG" = "no" ; then - no_glib=yes - else - GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` - GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` - glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" -dnl -dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of glib-config to some extent -dnl - rm -f conf.glibtest - AC_TRY_RUN([ -#include <glib.h> -#include <stdio.h> -#include <stdlib.h> - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.glibtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } - - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If glib-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); - printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the glib-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); - printf("*** correct copy of glib-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$GLIB_CONFIG" = "no" ; then - echo "*** The glib-config script installed by GLIB could not be found" - echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GLIB_CONFIG environment variable to the" - echo "*** full path to glib-config." - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK([ -#include <glib.h> -#include <stdio.h> -], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB was incorrectly installed" - echo "*** or that you have moved GLIB since it was installed. In the latter case, you" - echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - rm -f conf.glibtest -]) - -# Configure paths for GLIB -# Owen Taylor 1997-2001 - -# Taken from Glib 2.4.2 by PAK 2004/07/06 - -dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or -dnl gthread is specified in MODULES, pass to pkg-config -dnl -AC_DEFUN([AM_PATH_GLIB_2_0], -[dnl -dnl Get the cflags and libraries from pkg-config -dnl -AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], - , enable_glibtest=yes) - - pkg_config_args=glib-2.0 - for module in . $4 - do - case "$module" in - gmodule) - pkg_config_args="$pkg_config_args gmodule-2.0" - ;; - gobject) - pkg_config_args="$pkg_config_args gobject-2.0" - ;; - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - esac - done - - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - - no_glib="" - - if test x$PKG_CONFIG != xno ; then - if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then - : - else - echo *** pkg-config too old; version 0.7 or better required. - no_glib=yes - PKG_CONFIG=no - fi - else - no_glib=yes - fi - - min_glib_version=ifelse([$1], ,2.0.0,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) - - if test x$PKG_CONFIG != xno ; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" - enable_glibtest=no - fi - - if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then - : - else - no_glib=yes - fi - fi - - if test x"$no_glib" = x ; then - GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` - GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` - GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` - - GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` - GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` - glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" -dnl -dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of pkg-config to some extent) -dnl - rm -f conf.glibtest - AC_TRY_RUN([ -#include <glib.h> -#include <stdio.h> -#include <stdlib.h> - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.glibtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } - - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$PKG_CONFIG" = "no" ; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://www.freedesktop.org/software/pkgconfig/" - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK([ -#include <glib.h> -#include <stdio.h> -], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - GLIB_GENMARSHAL="" - GOBJECT_QUERY="" - GLIB_MKENUMS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - AC_SUBST(GLIB_GENMARSHAL) - AC_SUBST(GOBJECT_QUERY) - AC_SUBST(GLIB_MKENUMS) - rm -f conf.glibtest -]) - # Configure paths for the Audio File Library # Bertrand Guiheneuf 98-10-21 # stolen from esd.m4 in esound : Modified: trunk/libspectrum/configure.in =================================================================== --- trunk/libspectrum/configure.in 2012-03-27 11:38:35 UTC (rev 4685) +++ trunk/libspectrum/configure.in 2012-03-27 11:46:54 UTC (rev 4686) @@ -137,22 +137,12 @@ glib=yes) AC_MSG_RESULT($glib) if test "$glib" = yes; then - glib2=no - AM_PATH_GLIB_2_0( - 2.0.0, - glib2=yes - AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]) - LIBS="$LIBS `pkg-config --libs glib-2.0`", + PKG_CHECK_MODULES( + GLIB, + glib-2.0, + AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]), + glib="no" ) - if test "$glib2" = no; then - AM_PATH_GLIB( - 1.2.0, - AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]) - LIBS="$LIBS `glib-config --libs`", - glib=no - AC_MSG_WARN(glib not found - using internal replacement) - ) - fi fi AM_CONDITIONAL(USE_MYGLIB, test "$glib" = no) Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-03-27 11:38:35 UTC (rev 4685) +++ trunk/libspectrum/hacking/ChangeLog 2012-03-27 11:46:54 UTC (rev 4686) @@ -875,3 +875,5 @@ (thanks, clang 2.1) (Fred). 20120220 make-perl.c: advertise that we support bzip2 compressed and wav files (part of patch #3413549) (Sergio Baldoví). +20120327 configure.in,Makefile.am,acinclude.m4: simplify detection of GLib + and drop support for version 1.x (patch #3508792) (Alberto Garcia) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-05-06 06:24:21
|
Revision: 4690 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4690&view=rev Author: fredm Date: 2012-05-06 06:24:15 +0000 (Sun, 06 May 2012) Log Message: ----------- Fix some const qualifiers for the data argument to g_slist_remove and g_slist_find_custom (part of bug #3514721) (Sergio Baldov?\195?\173). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/make-perl.c trunk/libspectrum/myglib/gslist.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-05-06 06:18:11 UTC (rev 4689) +++ trunk/libspectrum/hacking/ChangeLog 2012-05-06 06:24:15 UTC (rev 4690) @@ -879,3 +879,6 @@ and drop support for version 1.x (patch #3508792) (Alberto Garcia) 20120327 configure.in: add support for audiofile 0.3.x (patch #3508658) (Alberto Garcia). +20120506 make-perl.c,myglib/gslist.c: fix some const qualifiers for the data + argument to g_slist_remove and g_slist_find_custom (part of bug + #3514721) (Sergio Baldoví). Modified: trunk/libspectrum/make-perl.c =================================================================== --- trunk/libspectrum/make-perl.c 2012-05-06 06:18:11 UTC (rev 4689) +++ trunk/libspectrum/make-perl.c 2012-05-06 06:24:15 UTC (rev 4690) @@ -166,7 +166,7 @@ " gpointer data);\n" "\n" "WIN32_DLL GSList *g_slist_remove (GSList *list,\n" -" gpointer data);\n" +" gconstpointer data);\n" "\n" "WIN32_DLL GSList *g_slist_last (GSList *list);\n" "\n" @@ -187,7 +187,7 @@ " guint n);\n" "\n" "WIN32_DLL GSList *g_slist_find_custom (GSList *list,\n" -" gpointer data,\n" +" gconstpointer data,\n" " GCompareFunc func );\n" "\n" "WIN32_DLL gint g_slist_position (GSList *list,\n" Modified: trunk/libspectrum/myglib/gslist.c =================================================================== --- trunk/libspectrum/myglib/gslist.c 2012-05-06 06:18:11 UTC (rev 4689) +++ trunk/libspectrum/myglib/gslist.c 2012-05-06 06:24:15 UTC (rev 4690) @@ -186,7 +186,7 @@ } GSList* g_slist_remove (GSList *list, - gpointer data) { + gconstpointer data) { GSList *tmp; GSList *prev; @@ -326,7 +326,7 @@ } GSList* g_slist_find_custom (GSList *list, - gpointer data, + gconstpointer data, GCompareFunc func ) { while (list) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-05-07 02:03:16
|
Revision: 4695 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4695&view=rev Author: fredm Date: 2012-05-07 02:03:10 +0000 (Mon, 07 May 2012) Log Message: ----------- Add g_hash_table_new_full() and libspectrum_end() for memory releasing (part of bug #3515269) (Sergio Baldov?\195?\173). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/internals.h trunk/libspectrum/libspectrum.c trunk/libspectrum/libspectrum.h.in trunk/libspectrum/make-perl.c trunk/libspectrum/myglib/ghash.c trunk/libspectrum/myglib/gslist.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-05-06 06:42:44 UTC (rev 4694) +++ trunk/libspectrum/hacking/ChangeLog 2012-05-07 02:03:10 UTC (rev 4695) @@ -882,3 +882,6 @@ 20120506 make-perl.c,myglib/gslist.c: fix some const qualifiers for the data argument to g_slist_remove and g_slist_find_custom (part of bug #3514721) (Sergio Baldoví). +20120507 internals.h,libspectrum.c,libspectrum.h.in,make-perl.c,myglib/{ghash.c, + gslist.c}: add g_hash_table_new_full() and libspectrum_end() for memory + releasing (part of bug #3515269) (Sergio Baldoví). Modified: trunk/libspectrum/internals.h =================================================================== --- trunk/libspectrum/internals.h 2012-05-06 06:42:44 UTC (rev 4694) +++ trunk/libspectrum/internals.h 2012-05-07 02:03:10 UTC (rev 4695) @@ -258,4 +258,14 @@ extern const int LIBSPECTRUM_BITS_IN_BYTE; +/* glib replacement functions */ + +#ifndef HAVE_LIB_GLIB /* Only if we are using glib replacement */ +void +libspectrum_slist_cleanup( void ); + +void +libspectrum_hashtable_cleanup( void ); +#endif /* #ifndef HAVE_LIB_GLIB */ + #endif /* #ifndef LIBSPECTRUM_INTERNALS_H */ Modified: trunk/libspectrum/libspectrum.c =================================================================== --- trunk/libspectrum/libspectrum.c 2012-05-06 06:42:44 UTC (rev 4694) +++ trunk/libspectrum/libspectrum.c 2012-05-07 02:03:10 UTC (rev 4695) @@ -121,6 +121,15 @@ return LIBSPECTRUM_ERROR_NONE; } +void +libspectrum_end( void ) +{ +#ifndef HAVE_LIB_GLIB + libspectrum_slist_cleanup(); + libspectrum_hashtable_cleanup(); +#endif /* #ifndef HAVE_LIB_GLIB */ +} + #ifdef HAVE_GCRYPT_H static void gcrypt_log_handler( void *opaque, int level, const char *format, va_list ap ) Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2012-05-06 06:42:44 UTC (rev 4694) +++ trunk/libspectrum/libspectrum.h.in 2012-05-07 02:03:10 UTC (rev 4695) @@ -100,6 +100,7 @@ /* Initialisation */ WIN32_DLL libspectrum_error libspectrum_init( void ); +WIN32_DLL void libspectrum_end( void ); /* Version checking */ Modified: trunk/libspectrum/make-perl.c =================================================================== --- trunk/libspectrum/make-perl.c 2012-05-06 06:42:44 UTC (rev 4694) +++ trunk/libspectrum/make-perl.c 2012-05-07 02:03:10 UTC (rev 4695) @@ -150,7 +150,11 @@ "typedef gint (*GCompareFunc) (gconstpointer a,\n" " gconstpointer b);\n" "\n" +"typedef void (*GDestroyNotify) (gpointer data);\n" "\n" +"typedef void (*GFreeFunc) (gpointer data);\n" +"\n" +"\n" "WIN32_DLL GSList *g_slist_insert_sorted (GSList *list,\n" " gpointer data,\n" " GCompareFunc func);\n" @@ -216,6 +220,11 @@ "WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func,\n" " GCompareFunc key_compare_func);\n" "\n" +"WIN32_DLL GHashTable *g_hash_table_new_full (GHashFunc hash_func,\n" +" GCompareFunc key_equal_func,\n" +" GDestroyNotify key_destroy_func,\n" +" GDestroyNotify value_destroy_func);\n" +"\n" "WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table);\n" "\n" "WIN32_DLL void g_hash_table_insert (GHashTable *hash_table,\n" Modified: trunk/libspectrum/myglib/ghash.c =================================================================== --- trunk/libspectrum/myglib/ghash.c 2012-05-06 06:42:44 UTC (rev 4694) +++ trunk/libspectrum/myglib/ghash.c 2012-05-07 02:03:10 UTC (rev 4695) @@ -57,9 +57,12 @@ GHashNode **nodes; GHashFunc hash_func; GCompareFunc key_equal_func; + GDestroyNotify key_destroy_func; + GDestroyNotify value_destroy_func; }; static GHashNode *node_free_list = NULL; +static GHashNode *node_allocated_list = NULL; guint g_direct_hash (gconstpointer v) @@ -71,6 +74,15 @@ g_hash_table_new (GHashFunc hash_func, GCompareFunc key_equal_func) { + return g_hash_table_new_full( hash_func, key_equal_func, NULL, NULL ); +} + +GHashTable* +g_hash_table_new_full (GHashFunc hash_func, + GCompareFunc key_equal_func, + GDestroyNotify key_destroy_func, + GDestroyNotify value_destroy_func) +{ GHashTable *hash_table; guint i; @@ -79,6 +91,8 @@ hash_table->nnodes = 0; hash_table->hash_func = hash_func? hash_func : g_direct_hash; hash_table->key_equal_func = key_equal_func; + hash_table->key_destroy_func = key_destroy_func; + hash_table->value_destroy_func = value_destroy_func; hash_table->nodes = libspectrum_malloc (HASH_TABLE_SIZE * sizeof (GHashNode*)); for (i = 0; i < HASH_TABLE_SIZE; i++) @@ -88,15 +102,28 @@ } static void -g_hash_nodes_destroy (GHashNode *hash_node) +g_hash_nodes_destroy (GHashNode *hash_node, + GFreeFunc key_destroy_func, + GFreeFunc value_destroy_func) { if (hash_node) { GHashNode *node = hash_node; - while (node->next) - node = node->next; + while (node->next) { + if (key_destroy_func) + key_destroy_func (node->key); + if (value_destroy_func) + value_destroy_func (node->value); + node = node->next; + } + + if (key_destroy_func) + key_destroy_func (node->key); + if (value_destroy_func) + value_destroy_func (node->value); + node->next = node_free_list; node_free_list = hash_node; } @@ -108,8 +135,10 @@ guint i; for (i = 0; i < HASH_TABLE_SIZE; i++) - g_hash_nodes_destroy (hash_table->nodes[i]); - + g_hash_nodes_destroy (hash_table->nodes[i], + hash_table->key_destroy_func, + hash_table->value_destroy_func); + libspectrum_free (hash_table->nodes); libspectrum_free (hash_table); } @@ -157,6 +186,7 @@ if (!node_free_list) { node_free_list = libspectrum_malloc (1024 * sizeof (GHashNode)); + node_allocated_list = node_free_list; for(i = 0; i < 1023; i++ ) node_free_list[i].next = &node_free_list[i+1]; @@ -185,6 +215,13 @@ if (*node) { + /* free the passed key */ + if (hash_table->key_destroy_func) + hash_table->key_destroy_func (key); + + if (hash_table->value_destroy_func) + hash_table->value_destroy_func ((*node)->value); + (*node)->value = value; } else @@ -195,8 +232,15 @@ } static void -g_hash_node_destroy (GHashNode *hash_node) +g_hash_node_destroy (GHashNode *hash_node, + GDestroyNotify key_destroy_func, + GDestroyNotify value_destroy_func) { + if (key_destroy_func) + key_destroy_func (hash_node->key); + if (value_destroy_func) + value_destroy_func (hash_node->value); + hash_node->next = node_free_list; node_free_list = hash_node; } @@ -227,13 +271,17 @@ if (prev) { prev->next = node->next; - g_hash_node_destroy (node); + g_hash_node_destroy (node, + hash_table->key_destroy_func, + hash_table->value_destroy_func); node = prev; } else { hash_table->nodes[i] = node->next; - g_hash_node_destroy (node); + g_hash_node_destroy (node, + hash_table->key_destroy_func, + hash_table->value_destroy_func); goto restart; } } @@ -299,4 +347,11 @@ return strcmp (string1, string2) == 0; } +void +libspectrum_hashtable_cleanup( void ) +{ + libspectrum_free( node_allocated_list ); + node_allocated_list = NULL; + node_free_list = NULL; +} #endif /* #ifndef HAVE_LIB_GLIB */ Modified: trunk/libspectrum/myglib/gslist.c =================================================================== --- trunk/libspectrum/myglib/gslist.c 2012-05-06 06:42:44 UTC (rev 4694) +++ trunk/libspectrum/myglib/gslist.c 2012-05-07 02:03:10 UTC (rev 4695) @@ -43,12 +43,14 @@ static int FREE_LIST_ALLOCATE_CHUNK = 1024; GSList * free_list = NULL; +GSList * allocated_list = NULL; static void allocate_free ( void ) { if(!free_list) { int i; free_list=libspectrum_malloc(FREE_LIST_ALLOCATE_CHUNK*sizeof(GSList)); + allocated_list = free_list; for(i=0;i<FREE_LIST_ALLOCATE_CHUNK-1;i++) free_list[i].next=&free_list[i+1]; free_list[FREE_LIST_ALLOCATE_CHUNK-1].next=NULL; @@ -352,4 +354,12 @@ return -1; } +void +libspectrum_slist_cleanup( void ) +{ + libspectrum_free( allocated_list ); + allocated_list = NULL; + free_list = NULL; +} + #endif /* #ifndef HAVE_LIB_GLIB */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-09-16 13:28:56
|
Revision: 4732 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4732&view=rev Author: fredm Date: 2012-09-16 13:28:50 +0000 (Sun, 16 Sep 2012) Log Message: ----------- Allow custom build flags for make-perl to address warning from the debian build system (bug #3567469) (Sergio Baldov?\195?\173). Modified Paths: -------------- trunk/libspectrum/Makefile.am trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/Makefile.am =================================================================== --- trunk/libspectrum/Makefile.am 2012-09-03 13:03:35 UTC (rev 4731) +++ trunk/libspectrum/Makefile.am 2012-09-16 13:28:50 UTC (rev 4732) @@ -78,7 +78,7 @@ AM_CFLAGS = -DLIBSPECTRUM_EXPORTS make-perl$(EXEEXT): $(srcdir)/make-perl.c config.h - $(CC_FOR_BUILD) -I. -o $@ $< + $(CC_FOR_BUILD) -I. $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< libspectrum.h: libspectrum.h.in generate.pl snap_accessors.txt tape_accessors.txt config.h @PERL@ -p generate.pl $(srcdir) $(srcdir)/libspectrum.h.in > $@.tmp && mv $@.tmp $@ Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-09-03 13:03:35 UTC (rev 4731) +++ trunk/libspectrum/hacking/ChangeLog 2012-09-16 13:28:50 UTC (rev 4732) @@ -885,3 +885,5 @@ 20120507 internals.h,libspectrum.c,libspectrum.h.in,make-perl.c,myglib/{ghash.c, gslist.c}: add g_hash_table_new_full() and libspectrum_end() for memory releasing (part of bug #3515269) (Sergio Baldoví). +20120916 Makefile.am: allow custom build flags for make-perl to address warning + from the debian build system (bug #3567469) (Sergio Baldoví). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-09-28 12:33:51
|
Revision: 4735 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4735&view=rev Author: fredm Date: 2012-09-28 12:33:40 +0000 (Fri, 28 Sep 2012) Log Message: ----------- Read all possible RAM pages from the SZX (thanks, ketmar). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/szx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-09-23 05:45:23 UTC (rev 4734) +++ trunk/libspectrum/hacking/ChangeLog 2012-09-28 12:33:40 UTC (rev 4735) @@ -887,3 +887,5 @@ releasing (part of bug #3515269) (Sergio Baldoví). 20120916 Makefile.am: allow custom build flags for make-perl to address warning from the debian build system (bug #3567469) (Sergio Baldoví). +201200928 szx.c: read all possible RAM pages from the snap (thanks, ketmar) + (Fred). Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-09-23 05:45:23 UTC (rev 4734) +++ trunk/libspectrum/szx.c 2012-09-28 12:33:40 UTC (rev 4735) @@ -1,5 +1,5 @@ /* szx.c: Routines for .szx snapshots - Copyright (c) 1998-2010 Philip Kendall, Fredrick Meunier, Stuart Brady + Copyright (c) 1998-2012 Philip Kendall, Fredrick Meunier, Stuart Brady $Id$ @@ -1237,7 +1237,7 @@ error = read_ram_page( &data, &page, buffer, data_length, 0x4000, &flags ); if( error ) return error; - if( page > 15 ) { + if( page > 63 ) { libspectrum_print_error( LIBSPECTRUM_ERROR_CORRUPT, "%s:read_ramp_chunk: unknown page number %lu", __FILE__, (unsigned long)page ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-10-21 05:03:45
|
Revision: 4751 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4751&view=rev Author: fredm Date: 2012-10-21 05:03:37 +0000 (Sun, 21 Oct 2012) Log Message: ----------- Modernise autoconf support (more from patch #3575831) (Sergio). Modified Paths: -------------- trunk/libspectrum/Makefile.am trunk/libspectrum/autogen.sh trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/windres.rc Added Paths: ----------- trunk/libspectrum/configure.ac trunk/libspectrum/m4/ trunk/libspectrum/m4/audiofile.m4 Removed Paths: ------------- trunk/libspectrum/acinclude.m4 trunk/libspectrum/configure.in Property Changed: ---------------- trunk/libspectrum/ Property changes on: trunk/libspectrum ___________________________________________________________________ Modified: svn:ignore - *.lo .deps .libs Makefile Makefile.in aclocal.m4 autom4te.cache compile config.cache config.guess config.h config.h.in config.log config.status config.sub configure depcomp generate.pl install-sh libspectrum.h libspectrum.la libspectrum.qpg libtool ltmain.sh make-perl make-perl.exe missing mkinstalldirs snap_accessors.c stamp-h stamp-h.in stamp-h1 tape_accessors.c tape_set.c + *.lo *.dSYM .deps .libs Makefile Makefile.in aclocal.m4 autom4te.cache compile config.cache config.guess config.h config.h.in config.log config.status config.sub configure depcomp generate.pl install-sh libspectrum.h libspectrum.la libspectrum.qpg libtool ltmain.sh make-perl make-perl.exe missing mkinstalldirs snap_accessors.c stamp-h stamp-h.in stamp-h1 tape_accessors.c tape_set.c Modified: trunk/libspectrum/Makefile.am =================================================================== --- trunk/libspectrum/Makefile.am 2012-10-16 11:57:05 UTC (rev 4750) +++ trunk/libspectrum/Makefile.am 2012-10-21 05:03:37 UTC (rev 4751) @@ -23,6 +23,8 @@ AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + lib_LTLIBRARIES = libspectrum.la libspectrum_la_SOURCES = bzip2.c \ @@ -99,10 +101,11 @@ windres.o: windres.rc @WINDRES@ $(srcdir)/windres.rc windres.o -INCLUDES = @GLIB_CFLAGS@ @AUDIOFILE_CFLAGS@ +AM_CPPFLAGS = @GLIB_CFLAGS@ @AUDIOFILE_CFLAGS@ EXTRA_DIST = accessor.pl \ generate.pl.in \ + m4/audiofile.m4 \ make-perl.c \ tape_accessors.pl \ tape_accessors.txt \ Deleted: trunk/libspectrum/acinclude.m4 =================================================================== --- trunk/libspectrum/acinclude.m4 2012-10-16 11:57:05 UTC (rev 4750) +++ trunk/libspectrum/acinclude.m4 2012-10-21 05:03:37 UTC (rev 4751) @@ -1,179 +0,0 @@ -# Configure paths for the Audio File Library -# Bertrand Guiheneuf 98-10-21 -# stolen from esd.m4 in esound : -# Manish Singh 98-9-30 -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for Audio File Library, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS. -dnl -AC_DEFUN([AM_PATH_AUDIOFILE], -[dnl -dnl Get compiler flags and libraries from the audiofile-config script. -dnl -AC_ARG_WITH(audiofile-prefix,[ --with-audiofile-prefix=PFX Prefix where Audio File Library is installed (optional)], - audiofile_prefix="$withval", audiofile_prefix="") -AC_ARG_WITH(audiofile-exec-prefix,[ --with-audiofile-exec-prefix=PFX Exec prefix where Audio File Library is installed (optional)], - audiofile_exec_prefix="$withval", audiofile_exec_prefix="") -AC_ARG_ENABLE(audiofiletest, [ --disable-audiofiletest Do not try to compile and run a test Audio File Library program], , enable_audiofiletest=yes) - - if test x$audiofile_exec_prefix != x ; then - audiofile_args="$audiofile_args --exec-prefix=$audiofile_exec_prefix" - if test x${AUDIOFILE_CONFIG+set} != xset ; then - AUDIOFILE_CONFIG=$audiofile_exec_prefix/bin/audiofile-config - fi - fi - if test x$audiofile_prefix != x ; then - audiofile_args="$audiofile_args --prefix=$audiofile_prefix" - if test x${AUDIOFILE_CONFIG+set} != xset ; then - AUDIOFILE_CONFIG=$audiofile_prefix/bin/audiofile-config - fi - fi - - AC_PATH_PROG(AUDIOFILE_CONFIG, audiofile-config, no) - min_audiofile_version=ifelse([$1], ,0.2.5,$1) - AC_MSG_CHECKING(for Audio File Library - version >= $min_audiofile_version) - no_audiofile="" - if test "$AUDIOFILE_CONFIG" = "no" ; then - no_audiofile=yes - else - AUDIOFILE_LIBS=`$AUDIOFILE_CONFIG $audiofileconf_args --libs` - AUDIOFILE_CFLAGS=`$AUDIOFILE_CONFIG $audiofileconf_args --cflags` - audiofile_major_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - audiofile_minor_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - audiofile_micro_version=`$AUDIOFILE_CONFIG $audiofile_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_audiofiletest" = "xyes" ; then - AC_LANG_SAVE - AC_LANG_C - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" - LIBS="$LIBS $AUDIOFILE_LIBS" -dnl -dnl Now check if the installed Audio File Library is sufficiently new. -dnl (Also checks the sanity of the results of audiofile-config to some extent.) -dnl - rm -f conf.audiofiletest - AC_TRY_RUN([ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <audiofile.h> - -char* -my_strdup (char *str) -{ - char *new_str; - - if (str) - { - new_str = malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } - else - new_str = NULL; - - return new_str; -} - -int main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.audiofiletest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_audiofile_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_audiofile_version"); - exit(1); - } - - if (($audiofile_major_version > major) || - (($audiofile_major_version == major) && ($audiofile_minor_version > minor)) || - (($audiofile_major_version == major) && ($audiofile_minor_version == minor) && ($audiofile_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'audiofile-config --version' returned %d.%d.%d, but the minimum version\n", $audiofile_major_version, $audiofile_minor_version, $audiofile_micro_version); - printf("*** of the Audio File Library required is %d.%d.%d. If audiofile-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If audiofile-config was wrong, set the environment variable AUDIOFILE_CONFIG\n"); - printf("*** to point to the correct copy of audiofile-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -],, no_audiofile=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE - fi - fi - if test "x$no_audiofile" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$AUDIOFILE_CONFIG" = "no" ; then - cat <<END -*** The audiofile-config script installed by the Audio File Library could -*** not be found. If the Audio File Library was installed in PREFIX, make -*** sure PREFIX/bin is in your path, or set the AUDIOFILE_CONFIG -*** environment variable to the full path to audiofile-config. -END - else - if test -f conf.audiofiletest ; then - : - else - echo "*** Could not run Audio File Library test program; checking why..." - AC_LANG_SAVE - AC_LANG_C - CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" - LIBS="$LIBS $AUDIOFILE_LIBS" - AC_TRY_LINK([ -#include <stdio.h> -#include <audiofile.h> -], [ return 0; ], - [ cat <<END -*** The test program compiled, but did not run. This usually means that -*** the run-time linker is not finding Audio File Library or finding the -*** wrong version of Audio File Library. -*** -*** If it is not finding Audio File Library, you'll need to set your -*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point -*** to the installed location. Also, make sure you have run ldconfig if -*** that is required on your system. -*** -*** If you have an old version installed, it is best to remove it, although -*** you may also be able to get things to work by modifying -*** LD_LIBRARY_PATH. -END - ], - [ echo "*** The test program failed to compile or link. See the file config.log" - echo "*** for the exact error that occured. This usually means the Audio File" - echo "*** Library was incorrectly installed or that you have moved the Audio" - echo "*** File Library since it was installed. In the latter case, you may want" - echo "*** to edit the audiofile-config script: $AUDIOFILE_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE - fi - fi - AUDIOFILE_CFLAGS="" - AUDIOFILE_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(AUDIOFILE_CFLAGS) - AC_SUBST(AUDIOFILE_LIBS) - rm -f conf.audiofiletest -]) Modified: trunk/libspectrum/autogen.sh =================================================================== --- trunk/libspectrum/autogen.sh 2012-10-16 11:57:05 UTC (rev 4750) +++ trunk/libspectrum/autogen.sh 2012-10-21 05:03:37 UTC (rev 4751) @@ -26,7 +26,7 @@ # Exit on errors set -e -aclocal +aclocal -I m4 autoheader libtoolize --automake automake --add-missing Copied: trunk/libspectrum/configure.ac (from rev 4734, trunk/libspectrum/configure.in) =================================================================== --- trunk/libspectrum/configure.ac (rev 0) +++ trunk/libspectrum/configure.ac 2012-10-21 05:03:37 UTC (rev 4751) @@ -0,0 +1,225 @@ +dnl Process this file with autoconf to produce a configure script. +dnl Copyright (c) 1999-2008 Philip Kendall + +dnl $Id$ + +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program; if not, write to the Free Software Foundation, Inc., +dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +dnl +dnl Author contact information: +dnl +dnl E-mail: phi...@sh... + +dnl Package version +m4_define([libspectrum_version], [1.0.0]) + +dnl Product full version +m4_define([libspectrum_major_version], [1]) +m4_define([libspectrum_minor_version], [0]) +m4_define([libspectrum_micro_version], [0]) +m4_define([libspectrum_nano_version], [0]) +m4_define([libspectrum_full_version], + [libspectrum_major_version.libspectrum_minor_version.libspectrum_micro_version.libspectrum_nano_version]) +m4_define([libspectrum_rc_version], + [libspectrum_major_version,libspectrum_minor_version,libspectrum_micro_version,libspectrum_nano_version]) + +dnl Package info +m4_define([libspectrum_copyright], ["(c) 1999-2012 Philip Kendall and others"]) +m4_define([libspectrum_url], + [http://fuse-emulator.sourceforge.net/libspectrum.php]) +m4_define([libspectrum_bugreport], + [http://sourceforge.net/tracker/?group_id=91293&atid=596648]) + +AC_INIT([libspectrum],[libspectrum_version],[libspectrum_bugreport], + [libspectrum],[libspectrum_url]) +AC_CONFIG_SRCDIR([libspectrum.c]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([config.h]) + +dnl Use automake to produce `Makefile.in' +AM_INIT_AUTOMAKE + +dnl Substitutions for .in files +LIBSPECTRUM_FULL_VERSION=libspectrum_full_version +LIBSPECTRUM_COPYRIGHT=libspectrum_copyright +LIBSPECTRUM_URL=libspectrum_url +AC_SUBST(LIBSPECTRUM_FULL_VERSION) +AC_SUBST(LIBSPECTRUM_COPYRIGHT) +AC_SUBST(LIBSPECTRUM_URL) + +dnl Definitions for config.h +AC_DEFINE([LIBSPECTRUM_RC_VERSION], [libspectrum_rc_version], + [Define version information for win32 dll library]) +AC_DEFINE([LIBSPECTRUM_COPYRIGHT], [libspectrum_copyright], + [Define copyright of libspectrum]) + +dnl Checks for programs. +AC_PROG_CC + +dnl Setup for compiling build tools (make-perl) +AC_MSG_CHECKING([for a C compiler for build tools]) +if test $cross_compiling = yes; then + AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) +else + CC_FOR_BUILD=$CC +fi +AC_MSG_RESULT([$CC_FOR_BUILD]) +AC_SUBST(CC_FOR_BUILD) + +LT_INIT +AC_PATH_PROG(PERL, perl) +AC_SUBST(PERL) + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(stdint.h strings.h unistd.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST + +dnl Check whether to use Windows resource file utility +AC_MSG_CHECKING(whether to use windres) +AC_ARG_WITH(windres, +[ --without-windres don't use windres], +if test "$withval" = no; then windres=no; else windres=yes; fi, +windres=yes) +AC_MSG_RESULT($windres) +if test "$windres" = yes; then + AC_CHECK_TOOL(WINDRES, windres, no) + AC_SUBST(WINDRES) + if test "$WINDRES" != no; then + WINDRES_OBJ="windres.o" + WINDRES_LDFLAGS="-Xlinker windres.o" + fi +fi +AC_SUBST(WINDRES_OBJ) +AC_SUBST(WINDRES_LDFLAGS) + +dnl Check for big endianness +AC_C_BIGENDIAN + +dnl Check for functions +AC_CHECK_FUNCS(_snprintf _stricmp _strnicmp snprintf strcasecmp strncasecmp) + +dnl Allow the user to say that various libraries are in one place +AC_ARG_WITH(local-prefix, +[ --with-local-prefix=PFX local libraries installed in PFX (optional)], +CPPFLAGS="$CPPFLAGS -I$withval/include"; LDFLAGS="$LDFLAGS -L$withval/lib", +if test "$prefix" != "NONE"; then + CPPFLAGS="$CPPFLAGS -I$prefix/include"; LDFLAGS="$LDFLAGS -L$prefix/lib" +fi) + +dnl Check whether to use zlib (the UNIX version is called z, Win32 zdll) +AC_MSG_CHECKING(whether to use zlib) +AC_ARG_WITH(zlib, +[ --without-zlib don't use zlib], +if test "$withval" = no; then zlib=no; else zlib=yes; fi, +zlib=yes) +AC_MSG_RESULT($zlib) +if test "$zlib" = yes; then + AC_CHECK_HEADERS( + zlib.h, + AC_SEARCH_LIBS(compress2, z zdll) + ) +fi + +dnl Check whether to use libgcrypt +AC_MSG_CHECKING(whether to use libgcrypt) +AC_ARG_WITH(libgcrypt, +[ --without-libgcrypt don't use libgcrypt], +if test "$withval" = no; then libgcrypt=no; else libgcrypt=yes; fi, +libgcrypt=yes) +AC_MSG_RESULT($libgcrypt) +if test "$libgcrypt" = yes; then + AC_CHECK_HEADERS(gcrypt.h,LIBS="$LIBS -lgcrypt") +fi + +dnl Check whether to use libbz2 (1.0 or greater) +AC_MSG_CHECKING(whether to use libbz2) +AC_ARG_WITH(bzip2, +[ --without-bzip2 don't use libbz2], +if test "$withval" = no; then bzip2=no; else bzip2=yes; fi, +bzip2=yes) +AC_MSG_RESULT($bzip2) +if test "$bzip2" = yes; then + AC_CHECK_HEADER( + bzlib.h, + AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) + ) +fi + +dnl Either find glib or use the replacement +AC_MSG_CHECKING(whether to use glib) +AC_ARG_WITH(glib, +[ --without-glib don't use glib], +if test "$withval" = no; then glib=no; else glib=yes; fi, +glib=yes) +AC_MSG_RESULT($glib) +if test "$glib" = yes; then + PKG_CHECK_MODULES( + GLIB, + glib-2.0, + AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]), + glib="no" + ) +fi + +AM_CONDITIONAL(USE_MYGLIB, test "$glib" = no) + +dnl If it appears we're using gcc as our compiler, turn on warnings +if test "$ac_cv_prog_gcc" = yes; then + CFLAGS="$CFLAGS -Wall" + dnl And possibly lots of warnings + AC_MSG_CHECKING(whether lots of warnings requested) + AC_ARG_ENABLE(warnings, + [ --enable-warnings give lots of warnings if using gcc], + if test "$enableval" = yes; then + warnings=yes; + else + warnings=no; + fi, + warnings=no) + AC_MSG_RESULT($warnings) + if test "$warnings" = yes; then + CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -W -Wsign-compare" + fi +fi + +dnl Check whether to use libaudiofile +AC_MSG_CHECKING(whether to use libaudiofile) +AC_ARG_WITH(libaudiofile, +[ --without-libaudiofile don't use libaudiofile], +if test "$withval" = no; then libaudiofile=no; else libaudiofile=yes; fi, +libaudiofile=yes) +AC_MSG_RESULT($libaudiofile) +if test "$libaudiofile" = yes; then + PKG_CHECK_MODULES( + AUDIOFILE, + audiofile, + AC_DEFINE([HAVE_LIB_AUDIOFILE], 1, [Defined if we've got audiofile]), [] + ) + if test -z "$AUDIOFILE_LIBS"; then + AM_PATH_AUDIOFILE( + 0.2.3, + AC_DEFINE([HAVE_LIB_AUDIOFILE], 1, [Defined if we've got audiofile]) + ) + fi +fi + +AC_CONFIG_FILES([ + Makefile + libspectrum.qpg +]) + +AC_OUTPUT Deleted: trunk/libspectrum/configure.in =================================================================== --- trunk/libspectrum/configure.in 2012-10-16 11:57:05 UTC (rev 4750) +++ trunk/libspectrum/configure.in 2012-10-21 05:03:37 UTC (rev 4751) @@ -1,193 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl Copyright (c) 1999-2008 Philip Kendall - -dnl $Id$ - -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License along -dnl with this program; if not, write to the Free Software Foundation, Inc., -dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -dnl -dnl Author contact information: -dnl -dnl E-mail: phi...@sh... - -AC_INIT(libspectrum.c) -AM_CONFIG_HEADER(config.h) - -define(LIBSPECTRUM_VERSION, [1.0.0]) - -dnl Use automake to produce `Makefile.in' -AM_INIT_AUTOMAKE(libspectrum, LIBSPECTRUM_VERSION) - -dnl Checks for programs. -AC_PROG_CC - -dnl Setup for compiling build tools (make-perl) -AC_MSG_CHECKING([for a C compiler for build tools]) -if test $cross_compiling = yes; then - AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) -else - CC_FOR_BUILD=$CC -fi -AC_MSG_RESULT([$CC_FOR_BUILD]) -AC_SUBST(CC_FOR_BUILD) - -AM_PROG_LIBTOOL -AC_PATH_PROG(PERL, perl) -AC_SUBST(PERL) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(stdint.h strings.h unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST - -dnl Check whether to use Windows resource file utility -AC_MSG_CHECKING(whether to use windres) -AC_ARG_WITH(windres, -[ --without-windres don't use windres], -if test "$withval" = no; then windres=no; else windres=yes; fi, -windres=yes) -AC_MSG_RESULT($windres) -if test "$windres" = yes; then - AC_CHECK_TOOL(WINDRES, windres, no) - AC_SUBST(WINDRES) - if test "$WINDRES" != no; then - WINDRES_OBJ="windres.o" - WINDRES_LDFLAGS="-Xlinker windres.o" - define(LIBSPECTRUM_FULL_VERSION, - [ifelse(translit(LIBSPECTRUM_VERSION, [0-9]), [.], [LIBSPECTRUM_VERSION[.0.0]], - translit(LIBSPECTRUM_VERSION, [0-9]), [..], [LIBSPECTRUM_VERSION[.0]], - [LIBSPECTRUM_VERSION])])dnl - AC_DEFINE([VERSION_WIN32], [translit(LIBSPECTRUM_FULL_VERSION, [.], [,])], [Define version information for win32 dll library]) - fi -fi -AC_SUBST(WINDRES_OBJ) -AC_SUBST(WINDRES_LDFLAGS) - -dnl Check for big endianness -AC_C_BIGENDIAN - -dnl Check for functions -AC_CHECK_FUNCS(_snprintf _stricmp _strnicmp snprintf strcasecmp strncasecmp) - -dnl Allow the user to say that various libraries are in one place -AC_ARG_WITH(local-prefix, -[ --with-local-prefix=PFX local libraries installed in PFX (optional)], -CPPFLAGS="$CPPFLAGS -I$withval/include"; LDFLAGS="$LDFLAGS -L$withval/lib", -if test "$prefix" != "NONE"; then - CPPFLAGS="$CPPFLAGS -I$prefix/include"; LDFLAGS="$LDFLAGS -L$prefix/lib" -fi) - -dnl Check whether to use zlib (the UNIX version is called z, Win32 zdll) -AC_MSG_CHECKING(whether to use zlib) -AC_ARG_WITH(zlib, -[ --without-zlib don't use zlib], -if test "$withval" = no; then zlib=no; else zlib=yes; fi, -zlib=yes) -AC_MSG_RESULT($zlib) -if test "$zlib" = yes; then - AC_CHECK_HEADERS( - zlib.h, - AC_SEARCH_LIBS(compress2, z zdll) - ) -fi - -dnl Check whether to use libgcrypt -AC_MSG_CHECKING(whether to use libgcrypt) -AC_ARG_WITH(libgcrypt, -[ --without-libgcrypt don't use libgcrypt], -if test "$withval" = no; then libgcrypt=no; else libgcrypt=yes; fi, -libgcrypt=yes) -AC_MSG_RESULT($libgcrypt) -if test "$libgcrypt" = yes; then - AC_CHECK_HEADERS(gcrypt.h,LIBS="$LIBS -lgcrypt") -fi - -dnl Check whether to use libbz2 (1.0 or greater) -AC_MSG_CHECKING(whether to use libbz2) -AC_ARG_WITH(bzip2, -[ --without-bzip2 don't use libbz2], -if test "$withval" = no; then bzip2=no; else bzip2=yes; fi, -bzip2=yes) -AC_MSG_RESULT($bzip2) -if test "$bzip2" = yes; then - AC_CHECK_HEADER( - bzlib.h, - AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) - ) -fi - -dnl Either find glib or use the replacement -AC_MSG_CHECKING(whether to use glib) -AC_ARG_WITH(glib, -[ --without-glib don't use glib], -if test "$withval" = no; then glib=no; else glib=yes; fi, -glib=yes) -AC_MSG_RESULT($glib) -if test "$glib" = yes; then - PKG_CHECK_MODULES( - GLIB, - glib-2.0, - AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]), - glib="no" - ) -fi - -AM_CONDITIONAL(USE_MYGLIB, test "$glib" = no) - -dnl If it appears we're using gcc as our compiler, turn on warnings -if test "$ac_cv_prog_gcc" = yes; then - CFLAGS="$CFLAGS -Wall" - dnl And possibly lots of warnings - AC_MSG_CHECKING(whether lots of warnings requested) - AC_ARG_ENABLE(warnings, - [ --enable-warnings give lots of warnings if using gcc], - if test "$enableval" = yes; then - warnings=yes; - else - warnings=no; - fi, - warnings=no) - AC_MSG_RESULT($warnings) - if test "$warnings" = yes; then - CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -W -Wsign-compare" - fi -fi - -dnl Check whether to use libaudiofile -AC_MSG_CHECKING(whether to use libaudiofile) -AC_ARG_WITH(libaudiofile, -[ --without-libaudiofile don't use libaudiofile], -if test "$withval" = no; then libaudiofile=no; else libaudiofile=yes; fi, -libaudiofile=yes) -AC_MSG_RESULT($libaudiofile) -if test "$libaudiofile" = yes; then - PKG_CHECK_MODULES( - AUDIOFILE, - audiofile, - AC_DEFINE([HAVE_LIB_AUDIOFILE], 1, [Defined if we've got audiofile]), [] - ) - if test -z "$AUDIOFILE_LIBS"; then - AM_PATH_AUDIOFILE( - 0.2.3, - AC_DEFINE([HAVE_LIB_AUDIOFILE], 1, [Defined if we've got audiofile]) - ) - fi -fi - -AC_OUTPUT( - Makefile - libspectrum.qpg -) Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-10-16 11:57:05 UTC (rev 4750) +++ trunk/libspectrum/hacking/ChangeLog 2012-10-21 05:03:37 UTC (rev 4751) @@ -887,5 +887,8 @@ releasing (part of bug #3515269) (Sergio Baldoví). 20120916 Makefile.am: allow custom build flags for make-perl to address warning from the debian build system (bug #3567469) (Sergio Baldoví). -201200928 szx.c: read all possible RAM pages from the snap (thanks, ketmar) +20120928 szx.c: read all possible RAM pages from the snap (thanks, ketmar) (Fred). +20121021 Makefile.am,acinclude.m4,autogen.sh,configure.ac,configure.in, + m4/audiofile.m4,windres.rc: modernise autoconf support (more from patch + #3575831) (Sergio). Property changes on: trunk/libspectrum/m4 ___________________________________________________________________ Added: svn:ignore + libtool.m4 ltversion.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 Copied: trunk/libspectrum/m4/audiofile.m4 (from rev 4734, trunk/libspectrum/acinclude.m4) =================================================================== --- trunk/libspectrum/m4/audiofile.m4 (rev 0) +++ trunk/libspectrum/m4/audiofile.m4 2012-10-21 05:03:37 UTC (rev 4751) @@ -0,0 +1,179 @@ +# Configure paths for the Audio File Library +# Bertrand Guiheneuf 98-10-21 +# stolen from esd.m4 in esound : +# Manish Singh 98-9-30 +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for Audio File Library, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS. +dnl +AC_DEFUN([AM_PATH_AUDIOFILE], +[dnl +dnl Get compiler flags and libraries from the audiofile-config script. +dnl +AC_ARG_WITH(audiofile-prefix,[ --with-audiofile-prefix=PFX Prefix where Audio File Library is installed (optional)], + audiofile_prefix="$withval", audiofile_prefix="") +AC_ARG_WITH(audiofile-exec-prefix,[ --with-audiofile-exec-prefix=PFX Exec prefix where Audio File Library is installed (optional)], + audiofile_exec_prefix="$withval", audiofile_exec_prefix="") +AC_ARG_ENABLE(audiofiletest, [ --disable-audiofiletest Do not try to compile and run a test Audio File Library program], , enable_audiofiletest=yes) + + if test x$audiofile_exec_prefix != x ; then + audiofile_args="$audiofile_args --exec-prefix=$audiofile_exec_prefix" + if test x${AUDIOFILE_CONFIG+set} != xset ; then + AUDIOFILE_CONFIG=$audiofile_exec_prefix/bin/audiofile-config + fi + fi + if test x$audiofile_prefix != x ; then + audiofile_args="$audiofile_args --prefix=$audiofile_prefix" + if test x${AUDIOFILE_CONFIG+set} != xset ; then + AUDIOFILE_CONFIG=$audiofile_prefix/bin/audiofile-config + fi + fi + + AC_PATH_PROG(AUDIOFILE_CONFIG, audiofile-config, no) + min_audiofile_version=ifelse([$1], ,0.2.5,$1) + AC_MSG_CHECKING(for Audio File Library - version >= $min_audiofile_version) + no_audiofile="" + if test "$AUDIOFILE_CONFIG" = "no" ; then + no_audiofile=yes + else + AUDIOFILE_LIBS=`$AUDIOFILE_CONFIG $audiofileconf_args --libs` + AUDIOFILE_CFLAGS=`$AUDIOFILE_CONFIG $audiofileconf_args --cflags` + audiofile_major_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + audiofile_minor_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + audiofile_micro_version=`$AUDIOFILE_CONFIG $audiofile_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_audiofiletest" = "xyes" ; then + AC_LANG_SAVE + AC_LANG_C + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" + LIBS="$LIBS $AUDIOFILE_LIBS" +dnl +dnl Now check if the installed Audio File Library is sufficiently new. +dnl (Also checks the sanity of the results of audiofile-config to some extent.) +dnl + rm -f conf.audiofiletest + AC_TRY_RUN([ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <audiofile.h> + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.audiofiletest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_audiofile_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_audiofile_version"); + exit(1); + } + + if (($audiofile_major_version > major) || + (($audiofile_major_version == major) && ($audiofile_minor_version > minor)) || + (($audiofile_major_version == major) && ($audiofile_minor_version == minor) && ($audiofile_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'audiofile-config --version' returned %d.%d.%d, but the minimum version\n", $audiofile_major_version, $audiofile_minor_version, $audiofile_micro_version); + printf("*** of the Audio File Library required is %d.%d.%d. If audiofile-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If audiofile-config was wrong, set the environment variable AUDIOFILE_CONFIG\n"); + printf("*** to point to the correct copy of audiofile-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_audiofile=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + AC_LANG_RESTORE + fi + fi + if test "x$no_audiofile" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$AUDIOFILE_CONFIG" = "no" ; then + cat <<END +*** The audiofile-config script installed by the Audio File Library could +*** not be found. If the Audio File Library was installed in PREFIX, make +*** sure PREFIX/bin is in your path, or set the AUDIOFILE_CONFIG +*** environment variable to the full path to audiofile-config. +END + else + if test -f conf.audiofiletest ; then + : + else + echo "*** Could not run Audio File Library test program; checking why..." + AC_LANG_SAVE + AC_LANG_C + CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" + LIBS="$LIBS $AUDIOFILE_LIBS" + AC_TRY_LINK([ +#include <stdio.h> +#include <audiofile.h> +], [ return 0; ], + [ cat <<END +*** The test program compiled, but did not run. This usually means that +*** the run-time linker is not finding Audio File Library or finding the +*** wrong version of Audio File Library. +*** +*** If it is not finding Audio File Library, you'll need to set your +*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point +*** to the installed location. Also, make sure you have run ldconfig if +*** that is required on your system. +*** +*** If you have an old version installed, it is best to remove it, although +*** you may also be able to get things to work by modifying +*** LD_LIBRARY_PATH. +END + ], + [ echo "*** The test program failed to compile or link. See the file config.log" + echo "*** for the exact error that occured. This usually means the Audio File" + echo "*** Library was incorrectly installed or that you have moved the Audio" + echo "*** File Library since it was installed. In the latter case, you may want" + echo "*** to edit the audiofile-config script: $AUDIOFILE_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + AC_LANG_RESTORE + fi + fi + AUDIOFILE_CFLAGS="" + AUDIOFILE_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(AUDIOFILE_CFLAGS) + AC_SUBST(AUDIOFILE_LIBS) + rm -f conf.audiofiletest +]) Modified: trunk/libspectrum/windres.rc =================================================================== --- trunk/libspectrum/windres.rc 2012-10-16 11:57:05 UTC (rev 4750) +++ trunk/libspectrum/windres.rc 2012-10-21 05:03:37 UTC (rev 4751) @@ -30,8 +30,8 @@ /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO -FILEVERSION VERSION_WIN32 -PRODUCTVERSION VERSION_WIN32 +FILEVERSION LIBSPECTRUM_RC_VERSION +PRODUCTVERSION LIBSPECTRUM_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 @@ -46,7 +46,7 @@ VALUE "FileDescription", "libspectrum\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "libspectrum\0" - VALUE "LegalCopyright", "Copyright (c) 1999-2009 Philip Kendall and others; see the file 'AUTHORS' for more details.\0" + VALUE "LegalCopyright", LIBSPECTRUM_COPYRIGHT##"; see the file 'AUTHORS' for more details.\0" VALUE "License", "libspectrum is licensed under the GNU General Public License\0" VALUE "OriginalFilename", "libspectrum.dll\0" VALUE "ProductName", "libspectrum - emulator support library\0" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-10-26 12:59:47
|
Revision: 4753 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4753&view=rev Author: fredm Date: 2012-10-26 12:59:37 +0000 (Fri, 26 Oct 2012) Log Message: ----------- Fix the build when libaudiofile is not found and we are using an old pkg-config/autoconf (bug #3579244) (Sergio). Modified Paths: -------------- trunk/libspectrum/configure.ac trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/configure.ac =================================================================== --- trunk/libspectrum/configure.ac 2012-10-21 05:18:11 UTC (rev 4752) +++ trunk/libspectrum/configure.ac 2012-10-26 12:59:37 UTC (rev 4753) @@ -207,7 +207,8 @@ PKG_CHECK_MODULES( AUDIOFILE, audiofile, - AC_DEFINE([HAVE_LIB_AUDIOFILE], 1, [Defined if we've got audiofile]), [] + AC_DEFINE([HAVE_LIB_AUDIOFILE], 1, [Defined if we've got audiofile]), + [true] ) if test -z "$AUDIOFILE_LIBS"; then AM_PATH_AUDIOFILE( Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-10-21 05:18:11 UTC (rev 4752) +++ trunk/libspectrum/hacking/ChangeLog 2012-10-26 12:59:37 UTC (rev 4753) @@ -892,3 +892,5 @@ 20121021 Makefile.am,acinclude.m4,autogen.sh,configure.ac,configure.in, m4/audiofile.m4,windres.rc: modernise autoconf support (more from patch #3575831) (Sergio). +20121026 configure.ac: fix the build when libaudiofile is not found and we are + using an old pkg-config/autoconf (bug #3579244) (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-11-07 11:14:59
|
Revision: 4757 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4757&view=rev Author: fredm Date: 2012-11-07 11:14:48 +0000 (Wed, 07 Nov 2012) Log Message: ----------- Fix the build when source and build trees are different (VPATH) (bug #3584527) (Sergio). Modified Paths: -------------- trunk/libspectrum/Makefile.am trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/Makefile.am =================================================================== --- trunk/libspectrum/Makefile.am 2012-11-07 11:11:44 UTC (rev 4756) +++ trunk/libspectrum/Makefile.am 2012-11-07 11:14:48 UTC (rev 4757) @@ -99,7 +99,7 @@ @PERL@ $(srcdir)/tape_set.pl $(srcdir)/tape_accessors.txt > $@.tmp && mv $@.tmp $@ windres.o: windres.rc - @WINDRES@ $(srcdir)/windres.rc windres.o + @WINDRES@ -I. $(srcdir)/windres.rc windres.o AM_CPPFLAGS = @GLIB_CFLAGS@ @AUDIOFILE_CFLAGS@ Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-11-07 11:11:44 UTC (rev 4756) +++ trunk/libspectrum/hacking/ChangeLog 2012-11-07 11:14:48 UTC (rev 4757) @@ -894,3 +894,5 @@ #3575831) (Sergio). 20121026 configure.ac: fix the build when libaudiofile is not found and we are using an old pkg-config/autoconf (bug #3579244) (Sergio). +20121107 Makefile.am: fix the build when source and build trees are different + (VPATH) (bug #3584527) (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-11-07 11:58:33
|
Revision: 4758 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4758&view=rev Author: fredm Date: 2012-11-07 11:58:26 +0000 (Wed, 07 Nov 2012) Log Message: ----------- Fix potential calls to memcpy with a null pointer argument (thanks, clang 4.1) (Fred). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/szx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-11-07 11:14:48 UTC (rev 4757) +++ trunk/libspectrum/hacking/ChangeLog 2012-11-07 11:58:26 UTC (rev 4758) @@ -896,3 +896,5 @@ using an old pkg-config/autoconf (bug #3579244) (Sergio). 20121107 Makefile.am: fix the build when source and build trees are different (VPATH) (bug #3584527) (Sergio). +20120203 szx.c: fix potential calls to memcpy with a null pointer argument + (thanks, clang 4.1) (Fred). Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-11-07 11:14:48 UTC (rev 4757) +++ trunk/libspectrum/szx.c 2012-11-07 11:58:26 UTC (rev 4758) @@ -3096,7 +3096,7 @@ *(*ptr)++ = libspectrum_snap_beta_data ( snap ); *(*ptr)++ = libspectrum_snap_beta_status( snap ); - if( libspectrum_snap_beta_custom_rom( snap ) ) { + if( libspectrum_snap_beta_custom_rom( snap ) && rom_data ) { memcpy( *ptr, rom_data, beta_rom_length ); *ptr += beta_rom_length; } @@ -3179,7 +3179,7 @@ *ptr += sizeof(libspectrum_dword) * 8; /* Skip 'reserved' data */ libspectrum_write_word( ptr, uncompressed_rom_length ); - if( libspectrum_snap_interface1_custom_rom( snap ) ) { + if( libspectrum_snap_interface1_custom_rom( snap ) && disk_rom_length ) { memcpy( *ptr, rom_data, disk_rom_length ); *ptr += disk_rom_length; } @@ -3545,6 +3545,11 @@ int use_compression = 0; eprom_data = libspectrum_snap_divide_eprom( snap, 0 ); + if( !eprom_data ) { + libspectrum_print_error( LIBSPECTRUM_ERROR_LOGIC, + "DivIDE EPROM data is missing" ); + return LIBSPECTRUM_ERROR_LOGIC; + } uncompressed_eprom_length = divide_eprom_length = 0x2000; #ifdef HAVE_ZLIB_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-11-07 12:01:57
|
Revision: 4759 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4759&view=rev Author: fredm Date: 2012-11-07 12:01:50 +0000 (Wed, 07 Nov 2012) Log Message: ----------- Fix potential leak of memory pointed to by 'new_filename' (thanks, clang 4.1). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-11-07 11:58:26 UTC (rev 4758) +++ trunk/libspectrum/hacking/ChangeLog 2012-11-07 12:01:50 UTC (rev 4759) @@ -896,5 +896,7 @@ using an old pkg-config/autoconf (bug #3579244) (Sergio). 20121107 Makefile.am: fix the build when source and build trees are different (VPATH) (bug #3584527) (Sergio). -20120203 szx.c: fix potential calls to memcpy with a null pointer argument +20121107 szx.c: fix potential calls to memcpy with a null pointer argument (thanks, clang 4.1) (Fred). +20121107 libspectrum.c: fix potential leak of memory pointed to by + 'new_filename' (thanks, clang 4.1) (Fred). Modified: trunk/libspectrum/libspectrum.c =================================================================== --- trunk/libspectrum/libspectrum.c 2012-11-07 11:58:26 UTC (rev 4758) +++ trunk/libspectrum/libspectrum.c 2012-11-07 12:01:50 UTC (rev 4759) @@ -472,10 +472,12 @@ error = libspectrum_identify_file_with_class( type, libspectrum_class, new_filename, new_buffer, new_length ); - if( error ) return error; + /* new_filename or buffer will be allocated in libspectrum_uncompress_file */ libspectrum_free( new_filename ); libspectrum_free( new_buffer ); + if( error ) return error; + return LIBSPECTRUM_ERROR_NONE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2012-11-26 22:57:36
|
Revision: 4774 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4774&view=rev Author: sbaldovi Date: 2012-11-26 22:57:29 +0000 (Mon, 26 Nov 2012) Log Message: ----------- Fix harcoded Id tags and add missing properties (Sergio). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/windres.rc Property Changed: ---------------- trunk/libspectrum/memory.c trunk/libspectrum/myglib/garray.c trunk/libspectrum/windres.rc Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-11-25 22:49:17 UTC (rev 4773) +++ trunk/libspectrum/hacking/ChangeLog 2012-11-26 22:57:29 UTC (rev 4774) @@ -900,3 +900,5 @@ (thanks, clang 4.1) (Fred). 20121107 libspectrum.c: fix potential leak of memory pointed to by 'new_filename' (thanks, clang 4.1) (Fred). +20121126 memory.c,myglib/garray.c,windres.rc: fix harcoded Id tags and add + missing properties (Sergio). Property changes on: trunk/libspectrum/memory.c ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: trunk/libspectrum/myglib/garray.c ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/libspectrum/windres.rc =================================================================== --- trunk/libspectrum/windres.rc 2012-11-25 22:49:17 UTC (rev 4773) +++ trunk/libspectrum/windres.rc 2012-11-26 22:57:29 UTC (rev 4774) @@ -1,7 +1,7 @@ /* windres.rc: resources for Windows Copyright (c) 2007-2009 Stuart Brady, Marek Januszewski - $Id: windres.rc 4075 2009-08-31 19:41:41Z specu $ + $Id$ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Property changes on: trunk/libspectrum/windres.rc ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2012-11-28 23:21:40
|
Revision: 4778 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4778&view=rev Author: sbaldovi Date: 2012-11-28 23:21:34 +0000 (Wed, 28 Nov 2012) Log Message: ----------- Don't check for windres when not building for Windows hosts. Remove --without-windres option, previously used as a workaround (Sergio). Modified Paths: -------------- trunk/libspectrum/configure.ac trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/configure.ac =================================================================== --- trunk/libspectrum/configure.ac 2012-11-26 23:35:48 UTC (rev 4777) +++ trunk/libspectrum/configure.ac 2012-11-28 23:21:34 UTC (rev 4778) @@ -46,6 +46,7 @@ AC_CONFIG_SRCDIR([libspectrum.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) +AC_CANONICAL_HOST dnl Use automake to produce `Makefile.in' AM_INIT_AUTOMAKE @@ -68,12 +69,12 @@ AC_PROG_CC dnl Setup for compiling build tools (make-perl) -AC_MSG_CHECKING([for a C compiler for build tools]) if test $cross_compiling = yes; then AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) else CC_FOR_BUILD=$CC fi +AC_MSG_CHECKING([for a C compiler for build tools]) AC_MSG_RESULT([$CC_FOR_BUILD]) AC_SUBST(CC_FOR_BUILD) @@ -88,21 +89,18 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST -dnl Check whether to use Windows resource file utility -AC_MSG_CHECKING(whether to use windres) -AC_ARG_WITH(windres, -[ --without-windres don't use windres], -if test "$withval" = no; then windres=no; else windres=yes; fi, -windres=yes) -AC_MSG_RESULT($windres) -if test "$windres" = yes; then - AC_CHECK_TOOL(WINDRES, windres, no) - AC_SUBST(WINDRES) - if test "$WINDRES" != no; then - WINDRES_OBJ="windres.o" - WINDRES_LDFLAGS="-Xlinker windres.o" - fi -fi +dnl Check for host specific programs +WINDRES_OBJ= +WINDRES_LDFLAGS= +case "$host_os" in + mingw32*) + AC_CHECK_TOOL([WINDRES], [windres], [no]) + if test "$WINDRES" != no; then + WINDRES_OBJ="windres.o" + WINDRES_LDFLAGS="-Xlinker windres.o" + fi + ;; +esac AC_SUBST(WINDRES_OBJ) AC_SUBST(WINDRES_LDFLAGS) Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-11-26 23:35:48 UTC (rev 4777) +++ trunk/libspectrum/hacking/ChangeLog 2012-11-28 23:21:34 UTC (rev 4778) @@ -900,5 +900,8 @@ (thanks, clang 4.1) (Fred). 20121107 libspectrum.c: fix potential leak of memory pointed to by 'new_filename' (thanks, clang 4.1) (Fred). -20121126 memory.c,myglib/garray.c,windres.rc: fix harcoded Id tags and add +20121126 memory.c,myglib/garray.c,windres.rc: fix hard-coded Id tags and add missing properties (Sergio). +20121129 configure.ac: don't check for windres when not building for Windows + hosts. Remove --without-windres option, previously used as a workaround + (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2012-11-29 19:10:01
|
Revision: 4780 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4780&view=rev Author: sbaldovi Date: 2012-11-29 19:09:52 +0000 (Thu, 29 Nov 2012) Log Message: ----------- Remove unused variables when not linking against external libraries (Sergio). Modified Paths: -------------- trunk/libspectrum/csw.c trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/rzx.c trunk/libspectrum/szx.c Modified: trunk/libspectrum/csw.c =================================================================== --- trunk/libspectrum/csw.c 2012-11-29 18:55:54 UTC (rev 4779) +++ trunk/libspectrum/csw.c 2012-11-29 19:09:52 UTC (rev 4780) @@ -39,7 +39,6 @@ { libspectrum_tape_block *block = NULL; libspectrum_tape_rle_pulse_block *csw_block; - libspectrum_error error; int compressed; @@ -112,6 +111,8 @@ if( compressed ) { /* Compressed data... */ #ifdef HAVE_ZLIB_H + libspectrum_error error; + csw_block->data = NULL; csw_block->length = 0; error = libspectrum_zlib_inflate( buffer, length, &csw_block->data, Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-11-29 18:55:54 UTC (rev 4779) +++ trunk/libspectrum/hacking/ChangeLog 2012-11-29 19:09:52 UTC (rev 4780) @@ -905,3 +905,5 @@ 20121129 configure.ac: don't check for windres when not building for Windows hosts. Remove --without-windres option, previously used as a workaround (Sergio). +20121129 csw.c,rzx.c,szx.c: remove unused variables when not linking against + external libraries (Sergio). Modified: trunk/libspectrum/rzx.c =================================================================== --- trunk/libspectrum/rzx.c 2012-11-29 18:55:54 UTC (rev 4779) +++ trunk/libspectrum/rzx.c 2012-11-29 19:09:52 UTC (rev 4780) @@ -194,7 +194,9 @@ { size_t i; input_block_t *input; +#ifdef HAVE_GCRYPT_H signature_block_t *signature; +#endif /* #ifdef HAVE_GCRYPT_H */ switch( block->type ) { @@ -216,9 +218,8 @@ return LIBSPECTRUM_ERROR_NONE; case LIBSPECTRUM_RZX_SIGN_END_BLOCK: +#ifdef HAVE_GCRYPT_H signature = &( block->types.signature ); - -#ifdef HAVE_GCRYPT_H gcry_mpi_release( signature->r ); gcry_mpi_release( signature->s ); #endif /* #ifdef HAVE_GCRYPT_H */ @@ -1448,7 +1449,6 @@ rzx_write_input( input_block_t *block, libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length, int compress ) { - libspectrum_error error; size_t i, size; size_t length_offset, data_offset, flags_offset; libspectrum_byte *length_ptr; @@ -1512,6 +1512,7 @@ /* Compress the data the simple way. Really, we should stream the data */ libspectrum_byte *gzsnap = NULL; size_t gzlength; libspectrum_byte *data_ptr = *buffer + data_offset; + libspectrum_error error; error = libspectrum_zlib_compress( data_ptr, *ptr - data_ptr, &gzsnap, &gzlength ); Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-11-29 18:55:54 UTC (rev 4779) +++ trunk/libspectrum/szx.c 2012-11-29 19:09:52 UTC (rev 4780) @@ -1914,9 +1914,8 @@ int compressed, size_t *data_remaining, void (*setter)(libspectrum_snap*, int, libspectrum_byte*) ) { - size_t data_length, uncompressed_length = 0; - libspectrum_error error; - libspectrum_byte *data_out, *uncompressed_data; + size_t data_length; + libspectrum_byte *data_out; const libspectrum_byte *data; if( *data_remaining < 4 ) { @@ -1938,6 +1937,9 @@ if( compressed ) { #ifdef HAVE_ZLIB_H + libspectrum_error error; + size_t uncompressed_length = 0; + libspectrum_byte *uncompressed_data; error = libspectrum_zlib_inflate( *buffer, data_length, &uncompressed_data, &uncompressed_length ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2012-12-02 22:54:30
|
Revision: 4783 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4783&view=rev Author: sbaldovi Date: 2012-12-02 22:54:24 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Fix the macro expansion of PKG_CHECK_MODULES when using both --without-glib and --with-libaudiofile options (Sergio). Modified Paths: -------------- trunk/libspectrum/configure.ac trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/configure.ac =================================================================== --- trunk/libspectrum/configure.ac 2012-12-02 22:49:57 UTC (rev 4782) +++ trunk/libspectrum/configure.ac 2012-12-02 22:54:24 UTC (rev 4783) @@ -164,14 +164,14 @@ if test "$withval" = no; then glib=no; else glib=yes; fi, glib=yes) AC_MSG_RESULT($glib) -if test "$glib" = yes; then +AS_IF([test "$glib" = yes], [ PKG_CHECK_MODULES( GLIB, glib-2.0, AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]), glib="no" ) -fi +]) AM_CONDITIONAL(USE_MYGLIB, test "$glib" = no) @@ -201,7 +201,7 @@ if test "$withval" = no; then libaudiofile=no; else libaudiofile=yes; fi, libaudiofile=yes) AC_MSG_RESULT($libaudiofile) -if test "$libaudiofile" = yes; then +AS_IF([test "$libaudiofile" = yes], [ PKG_CHECK_MODULES( AUDIOFILE, audiofile, @@ -214,7 +214,7 @@ AC_DEFINE([HAVE_LIB_AUDIOFILE], 1, [Defined if we've got audiofile]) ) fi -fi +]) AC_CONFIG_FILES([ Makefile Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-12-02 22:49:57 UTC (rev 4782) +++ trunk/libspectrum/hacking/ChangeLog 2012-12-02 22:54:24 UTC (rev 4783) @@ -907,3 +907,5 @@ (Sergio). 20121129 csw.c,rzx.c,szx.c: remove unused variables when not linking against external libraries (Sergio). +20121202 configure.ac: fix the macro expansion of PKG_CHECK_MODULES when using + both --without-glib and --with-libaudiofile options (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-12-22 12:09:45
|
Revision: 4792 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4792&view=rev Author: fredm Date: 2012-12-22 12:09:33 +0000 (Sat, 22 Dec 2012) Log Message: ----------- Split SNET block into SNET, SNEF and SNER so that flash could theoretically be saved separately (patch #3596469) (Fred). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/szx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-12-22 11:24:59 UTC (rev 4791) +++ trunk/libspectrum/hacking/ChangeLog 2012-12-22 12:09:33 UTC (rev 4792) @@ -912,3 +912,5 @@ 20121208 configure.ac,libspectrum.h.in: preliminary support for 64-bits binaries for Windows (patch #3591613) (Sergio). 20121208 README: document support for reading PZX files (Sergio). +20121222 szx.c: split SNET block into SNET, SNEF and SNER so that flash could + theoretically be saved separately (patch #3596469) (Fred). Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-12-22 11:24:59 UTC (rev 4791) +++ trunk/libspectrum/szx.c 2012-12-22 12:09:33 UTC (rev 4792) @@ -199,9 +199,13 @@ static const libspectrum_word ZXSTSNET_ALL_DISABLED = 16; static const libspectrum_word ZXSTSNET_RST8_DISABLED = 32; static const libspectrum_word ZXSTSNET_DENY_DOWNSTREAM_A15 = 64; -static const libspectrum_word ZXSTSNET_FLASH_COMPRESSED = 128; -static const libspectrum_word ZXSTSNET_RAM_COMPRESSED = 256; +#define ZXSTBID_SPECTRANETFLASHPAGE "SNEF" +static const libspectrum_byte ZXSTSNEF_FLASH_COMPRESSED = 1; + +#define ZXSTBID_SPECTRANETRAMPAGE "SNER" +static const libspectrum_byte ZXSTSNER_RAM_COMPRESSED = 1; + static libspectrum_error read_chunk( libspectrum_snap *snap, libspectrum_word version, const libspectrum_byte **buffer, const libspectrum_byte *end, @@ -292,6 +296,12 @@ static libspectrum_error write_snet_chunk( libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length, libspectrum_snap *snap, int compress ); +static libspectrum_error +write_snef_chunk( libspectrum_byte **buffer, libspectrum_byte **ptr, + size_t *length, libspectrum_snap *snap, int compress ); +static libspectrum_error +write_sner_chunk( libspectrum_byte **buffer, libspectrum_byte **ptr, + size_t *length, libspectrum_snap *snap, int compress ); #ifdef HAVE_ZLIB_H @@ -1991,12 +2001,9 @@ szx_context *ctx GCC_UNUSED ) { libspectrum_word flags; - int flash_compressed, ram_compressed; - libspectrum_error error; libspectrum_byte *w5100; - size_t data_remaining; - if( data_length < 62 ) { + if( data_length < 54 ) { libspectrum_print_error( LIBSPECTRUM_ERROR_UNKNOWN, "read_snet_chunk: length %lu too short", (unsigned long)data_length @@ -2016,8 +2023,6 @@ libspectrum_snap_set_spectranet_all_traps_disabled( snap, flags & ZXSTSNET_ALL_DISABLED ); libspectrum_snap_set_spectranet_rst8_trap_disabled( snap, flags & ZXSTSNET_RST8_DISABLED ); libspectrum_snap_set_spectranet_deny_downstream_a15( snap, flags & ZXSTSNET_DENY_DOWNSTREAM_A15 ); - flash_compressed = flags & ZXSTSNET_FLASH_COMPRESSED; - ram_compressed = flags & ZXSTSNET_RAM_COMPRESSED; libspectrum_snap_set_spectranet_page_a( snap, **buffer ); (*buffer)++; libspectrum_snap_set_spectranet_page_b( snap, **buffer ); (*buffer)++; @@ -2030,13 +2035,65 @@ memcpy( w5100, *buffer, 0x30 ); (*buffer) += 0x30; - data_remaining = data_length - 54; + return LIBSPECTRUM_ERROR_NONE; +} +static libspectrum_error +read_snef_chunk( libspectrum_snap *snap, libspectrum_word version GCC_UNUSED, + const libspectrum_byte **buffer, + const libspectrum_byte *end GCC_UNUSED, size_t data_length, + szx_context *ctx GCC_UNUSED ) +{ + libspectrum_byte flags; + int flash_compressed; + libspectrum_error error; + size_t data_remaining; + + if( data_length < 5 ) { + libspectrum_print_error( + LIBSPECTRUM_ERROR_UNKNOWN, + "read_snef_chunk: length %lu too short", (unsigned long)data_length + ); + return LIBSPECTRUM_ERROR_UNKNOWN; + } + + flags = **buffer; (*buffer)++; + flash_compressed = flags & ZXSTSNEF_FLASH_COMPRESSED; + + data_remaining = data_length - 1; + error = read_snet_memory( snap, buffer, flash_compressed, &data_remaining, libspectrum_snap_set_spectranet_flash ); if( error ) return error; + return LIBSPECTRUM_ERROR_NONE; +} + +static libspectrum_error +read_sner_chunk( libspectrum_snap *snap, libspectrum_word version GCC_UNUSED, + const libspectrum_byte **buffer, + const libspectrum_byte *end GCC_UNUSED, size_t data_length, + szx_context *ctx GCC_UNUSED ) +{ + libspectrum_byte flags; + int ram_compressed; + libspectrum_error error; + size_t data_remaining; + + if( data_length < 5 ) { + libspectrum_print_error( + LIBSPECTRUM_ERROR_UNKNOWN, + "read_sner_chunk: length %lu too short", (unsigned long)data_length + ); + return LIBSPECTRUM_ERROR_UNKNOWN; + } + + flags = **buffer; (*buffer)++; + ram_compressed = flags & ZXSTSNER_RAM_COMPRESSED; + + data_remaining = data_length - 1; + error = read_snet_memory( snap, buffer, ram_compressed, &data_remaining, libspectrum_snap_set_spectranet_ram ); if( error ) @@ -2066,44 +2123,46 @@ static struct read_chunk_t read_chunks[] = { - { ZXSTBID_AY, read_ay_chunk }, - { ZXSTBID_BETA128, read_b128_chunk }, - { ZXSTBID_BETADISK, skip_chunk }, - { ZXSTBID_COVOX, skip_chunk }, - { ZXSTBID_CREATOR, read_crtr_chunk }, - { ZXSTBID_DIVIDE, read_dide_chunk }, - { ZXSTBID_DIVIDERAMPAGE, read_dirp_chunk }, - { ZXSTBID_DOCK, read_dock_chunk }, - { ZXSTBID_DSKFILE, skip_chunk }, - { ZXSTBID_GS, skip_chunk }, - { ZXSTBID_GSRAMPAGE, skip_chunk }, - { ZXSTBID_IF1, read_if1_chunk }, - { ZXSTBID_IF2ROM, read_if2r_chunk }, - { ZXSTBID_JOYSTICK, read_joy_chunk }, - { ZXSTBID_KEYBOARD, read_keyb_chunk }, - { ZXSTBID_MICRODRIVE, skip_chunk }, - { ZXSTBID_MOUSE, read_amxm_chunk }, - { ZXSTBID_MULTIFACE, skip_chunk }, - { ZXSTBID_OPUS, read_opus_chunk }, - { ZXSTBID_OPUSDISK, skip_chunk }, - { ZXSTBID_PLUS3DISK, skip_chunk }, - { ZXSTBID_PLUSD, read_plsd_chunk }, - { ZXSTBID_PLUSDDISK, skip_chunk }, - { ZXSTBID_RAMPAGE, read_ramp_chunk }, - { ZXSTBID_ROM, read_rom_chunk }, - { ZXSTBID_SIMPLEIDE, read_side_chunk }, - { ZXSTBID_SPECDRUM, read_drum_chunk }, - { ZXSTBID_SPECREGS, read_spcr_chunk }, - { ZXSTBID_SPECTRANET, read_snet_chunk }, - { ZXSTBID_TIMEXREGS, read_scld_chunk }, - { ZXSTBID_USPEECH, skip_chunk }, - { ZXSTBID_Z80REGS, read_z80r_chunk }, - { ZXSTBID_ZXATASPRAMPAGE, read_atrp_chunk }, - { ZXSTBID_ZXATASP, read_zxat_chunk }, - { ZXSTBID_ZXCF, read_zxcf_chunk }, - { ZXSTBID_ZXCFRAMPAGE, read_cfrp_chunk }, - { ZXSTBID_ZXPRINTER, skip_chunk }, - { ZXSTBID_ZXTAPE, skip_chunk }, + { ZXSTBID_AY, read_ay_chunk }, + { ZXSTBID_BETA128, read_b128_chunk }, + { ZXSTBID_BETADISK, skip_chunk }, + { ZXSTBID_COVOX, skip_chunk }, + { ZXSTBID_CREATOR, read_crtr_chunk }, + { ZXSTBID_DIVIDE, read_dide_chunk }, + { ZXSTBID_DIVIDERAMPAGE, read_dirp_chunk }, + { ZXSTBID_DOCK, read_dock_chunk }, + { ZXSTBID_DSKFILE, skip_chunk }, + { ZXSTBID_GS, skip_chunk }, + { ZXSTBID_GSRAMPAGE, skip_chunk }, + { ZXSTBID_IF1, read_if1_chunk }, + { ZXSTBID_IF2ROM, read_if2r_chunk }, + { ZXSTBID_JOYSTICK, read_joy_chunk }, + { ZXSTBID_KEYBOARD, read_keyb_chunk }, + { ZXSTBID_MICRODRIVE, skip_chunk }, + { ZXSTBID_MOUSE, read_amxm_chunk }, + { ZXSTBID_MULTIFACE, skip_chunk }, + { ZXSTBID_OPUS, read_opus_chunk }, + { ZXSTBID_OPUSDISK, skip_chunk }, + { ZXSTBID_PLUS3DISK, skip_chunk }, + { ZXSTBID_PLUSD, read_plsd_chunk }, + { ZXSTBID_PLUSDDISK, skip_chunk }, + { ZXSTBID_RAMPAGE, read_ramp_chunk }, + { ZXSTBID_ROM, read_rom_chunk }, + { ZXSTBID_SIMPLEIDE, read_side_chunk }, + { ZXSTBID_SPECDRUM, read_drum_chunk }, + { ZXSTBID_SPECREGS, read_spcr_chunk }, + { ZXSTBID_SPECTRANET, read_snet_chunk }, + { ZXSTBID_SPECTRANETFLASHPAGE, read_snef_chunk }, + { ZXSTBID_SPECTRANETRAMPAGE, read_sner_chunk }, + { ZXSTBID_TIMEXREGS, read_scld_chunk }, + { ZXSTBID_USPEECH, skip_chunk }, + { ZXSTBID_Z80REGS, read_z80r_chunk }, + { ZXSTBID_ZXATASPRAMPAGE, read_atrp_chunk }, + { ZXSTBID_ZXATASP, read_zxat_chunk }, + { ZXSTBID_ZXCF, read_zxcf_chunk }, + { ZXSTBID_ZXCFRAMPAGE, read_cfrp_chunk }, + { ZXSTBID_ZXPRINTER, skip_chunk }, + { ZXSTBID_ZXTAPE, skip_chunk }, }; @@ -2449,6 +2508,10 @@ if( libspectrum_snap_spectranet_active( snap ) ) { error = write_snet_chunk( buffer, &ptr, length, snap, compress ); if( error ) return error; + error = write_snef_chunk( buffer, &ptr, length, snap, compress ); + if( error ) return error; + error = write_sner_chunk( buffer, &ptr, length, snap, compress ); + if( error ) return error; } /* Set length to be actual length, not allocated length */ @@ -3617,6 +3680,43 @@ write_snet_chunk( libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length, libspectrum_snap *snap, int compress ) { + size_t block_size = 54; + libspectrum_word flags = 0; + + write_chunk_header( buffer, ptr, length, ZXSTBID_SPECTRANET, block_size ); + + if( libspectrum_snap_spectranet_paged( snap ) ) + flags |= ZXSTSNET_PAGED; + if( libspectrum_snap_spectranet_paged_via_io( snap ) ) + flags |= ZXSTSNET_PAGED_VIA_IO; + if( libspectrum_snap_spectranet_programmable_trap_active( snap ) ) + flags |= ZXSTSNET_PROGRAMMABLE_TRAP_ACTIVE; + if( libspectrum_snap_spectranet_programmable_trap_msb( snap ) ) + flags |= ZXSTSNET_PROGRAMMABLE_TRAP_MSB; + if( libspectrum_snap_spectranet_all_traps_disabled( snap ) ) + flags |= ZXSTSNET_ALL_DISABLED; + if( libspectrum_snap_spectranet_rst8_trap_disabled( snap ) ) + flags |= ZXSTSNET_RST8_DISABLED; + if( libspectrum_snap_spectranet_deny_downstream_a15( snap ) ) + flags |= ZXSTSNET_DENY_DOWNSTREAM_A15; + libspectrum_write_word( ptr, flags ); + + *(*ptr)++ = libspectrum_snap_spectranet_page_a( snap ); + *(*ptr)++ = libspectrum_snap_spectranet_page_b( snap ); + + libspectrum_write_word( ptr, + libspectrum_snap_spectranet_programmable_trap( snap ) ); + + memcpy( *ptr, libspectrum_snap_spectranet_w5100( snap, 0 ), 0x30 ); + (*ptr) += 0x30; + + return LIBSPECTRUM_ERROR_NONE; +} + +static libspectrum_error +write_snef_chunk( libspectrum_byte **buffer, libspectrum_byte **ptr, + size_t *length, libspectrum_snap *snap, int compress ) +{ #ifdef HAVE_ZLIB_H libspectrum_error error; #endif @@ -3626,20 +3726,12 @@ libspectrum_byte *compressed_flash_data = NULL; int flash_compressed = 0; - size_t ram_length; - libspectrum_byte *ram_data; - libspectrum_byte *compressed_ram_data = NULL; - int ram_compressed = 0; - size_t block_size; - libspectrum_word flags = 0; + libspectrum_byte flags = 0; flash_data = libspectrum_snap_spectranet_flash( snap, 0 ); flash_length = 0x20000; - ram_data = libspectrum_snap_spectranet_ram( snap, 0 ); - ram_length = 0x20000; - #ifdef HAVE_ZLIB_H if( compress ) { @@ -3655,13 +3747,58 @@ flash_data = compressed_flash_data; flash_length = compressed_length; } + } +#endif + + block_size = 5 + flash_length; + + write_chunk_header( buffer, ptr, length, ZXSTBID_SPECTRANETFLASHPAGE, + block_size ); + + if( flash_compressed ) + flags |= ZXSTSNEF_FLASH_COMPRESSED; + *(*ptr)++ = flags; + + libspectrum_write_dword( ptr, flash_length ); + memcpy( *ptr, flash_data, flash_length ); *ptr += flash_length; + + if( flash_compressed ) + libspectrum_free( compressed_flash_data ); + + return LIBSPECTRUM_ERROR_NONE; +} + +static libspectrum_error +write_sner_chunk( libspectrum_byte **buffer, libspectrum_byte **ptr, + size_t *length, libspectrum_snap *snap, int compress ) +{ +#ifdef HAVE_ZLIB_H + libspectrum_error error; +#endif + + size_t ram_length; + libspectrum_byte *ram_data; + libspectrum_byte *compressed_ram_data = NULL; + int ram_compressed = 0; + + size_t block_size; + libspectrum_byte flags = 0; + + ram_data = libspectrum_snap_spectranet_ram( snap, 0 ); + ram_length = 0x20000; + +#ifdef HAVE_ZLIB_H + + if( compress ) { + size_t compressed_length; + error = libspectrum_zlib_compress( ram_data, ram_length, &compressed_ram_data, &compressed_length ); if( error ) return error; if( compress & LIBSPECTRUM_FLAG_SNAPSHOT_ALWAYS_COMPRESS || - compressed_length < flash_length ) { + compressed_length < ram_length ) { ram_compressed = 1; ram_data = compressed_ram_data; ram_length = compressed_length; @@ -3670,48 +3807,18 @@ #endif - block_size = 62 + flash_length + ram_length; + block_size = 5 + ram_length; - write_chunk_header( buffer, ptr, length, ZXSTBID_SPECTRANET, block_size ); + write_chunk_header( buffer, ptr, length, ZXSTBID_SPECTRANETRAMPAGE, + block_size ); - if( libspectrum_snap_spectranet_paged( snap ) ) - flags |= ZXSTSNET_PAGED; - if( libspectrum_snap_spectranet_paged_via_io( snap ) ) - flags |= ZXSTSNET_PAGED_VIA_IO; - if( libspectrum_snap_spectranet_programmable_trap_active( snap ) ) - flags |= ZXSTSNET_PROGRAMMABLE_TRAP_ACTIVE; - if( libspectrum_snap_spectranet_programmable_trap_msb( snap ) ) - flags |= ZXSTSNET_PROGRAMMABLE_TRAP_MSB; - if( libspectrum_snap_spectranet_all_traps_disabled( snap ) ) - flags |= ZXSTSNET_ALL_DISABLED; - if( libspectrum_snap_spectranet_rst8_trap_disabled( snap ) ) - flags |= ZXSTSNET_RST8_DISABLED; - if( libspectrum_snap_spectranet_deny_downstream_a15( snap ) ) - flags |= ZXSTSNET_DENY_DOWNSTREAM_A15; - if( flash_compressed ) - flags |= ZXSTSNET_FLASH_COMPRESSED; if( ram_compressed ) - flags |= ZXSTSNET_RAM_COMPRESSED; - libspectrum_write_word( ptr, flags ); + flags |= ZXSTSNER_RAM_COMPRESSED; + *(*ptr)++ = flags; - *(*ptr)++ = libspectrum_snap_spectranet_page_a( snap ); - *(*ptr)++ = libspectrum_snap_spectranet_page_b( snap ); - - libspectrum_write_word( ptr, - libspectrum_snap_spectranet_programmable_trap( snap ) ); - - memcpy( *ptr, libspectrum_snap_spectranet_w5100( snap, 0 ), 0x30 ); - (*ptr) += 0x30; - - libspectrum_write_dword( ptr, flash_length ); - memcpy( *ptr, flash_data, flash_length ); *ptr += flash_length; - libspectrum_write_dword( ptr, ram_length ); memcpy( *ptr, ram_data, ram_length ); *ptr += ram_length; - if( flash_compressed ) - libspectrum_free( compressed_flash_data ); - if( ram_compressed ) libspectrum_free( compressed_ram_data ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-12-25 12:34:43
|
Revision: 4793 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4793&view=rev Author: fredm Date: 2012-12-25 12:34:34 +0000 (Tue, 25 Dec 2012) Log Message: ----------- Extend SZX support to version 1.5 draft specs. Modified Paths: -------------- trunk/libspectrum/accessor.pl trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.h.in trunk/libspectrum/sna.c trunk/libspectrum/snap_accessors.txt trunk/libspectrum/snapshot.c trunk/libspectrum/szx.c trunk/libspectrum/z80.c Modified: trunk/libspectrum/accessor.pl =================================================================== --- trunk/libspectrum/accessor.pl 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/accessor.pl 2012-12-25 12:34:34 UTC (rev 4793) @@ -73,6 +73,7 @@ int halted; /* Is the Z80 currently HALTed? */ int last_instruction_ei; /* Was the last instruction an EI? */ + int last_instruction_set_f; /* Did the last instruction set Flags? */ /* Custom ROM */ int custom_rom; @@ -232,6 +233,9 @@ libspectrum_byte *spectranet_w5100[1]; libspectrum_byte *spectranet_flash[1]; libspectrum_byte *spectranet_ram[1]; + + /* Timings emulation */ + int late_timings; }; /* Initialise a libspectrum_snap structure */ Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/hacking/ChangeLog 2012-12-25 12:34:34 UTC (rev 4793) @@ -914,3 +914,5 @@ 20121208 README: document support for reading PZX files (Sergio). 20121222 szx.c: split SNET block into SNET, SNEF and SNER so that flash could theoretically be saved separately (patch #3596469) (Fred). +20121225 accessor.pl,libspectrum.h.in,sna.c,snap_accessors.txt,snapshot.c,szx.c, + z80.c: extend SZX support to version 1.5 draft specs (Fred). Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/libspectrum.h.in 2012-12-25 12:34:34 UTC (rev 4793) @@ -312,6 +312,8 @@ LIBSPECTRUM_MACHINE_48_NTSC, + LIBSPECTRUM_MACHINE_128E, + } libspectrum_machine; WIN32_DLL const char* libspectrum_machine_name( libspectrum_machine type ); Modified: trunk/libspectrum/sna.c =================================================================== --- trunk/libspectrum/sna.c 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/sna.c 2012-12-25 12:34:34 UTC (rev 4793) @@ -331,6 +331,10 @@ if( libspectrum_snap_specdrum_active( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + /* We don't save the Spectranet state at all */ + if( libspectrum_snap_spectranet_active( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + ptr = *buffer; write_header( buffer, &ptr, length, snap ); @@ -349,6 +353,7 @@ break; case LIBSPECTRUM_MACHINE_128: + case LIBSPECTRUM_MACHINE_128E: case LIBSPECTRUM_MACHINE_PENT512: case LIBSPECTRUM_MACHINE_PENT1024: case LIBSPECTRUM_MACHINE_PLUS2: Modified: trunk/libspectrum/snap_accessors.txt =================================================================== --- trunk/libspectrum/snap_accessors.txt 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/snap_accessors.txt 2012-12-25 12:34:34 UTC (rev 4793) @@ -47,6 +47,7 @@ int halted int last_instruction_ei +int last_instruction_set_f libspectrum_byte out_ula @@ -187,3 +188,5 @@ libspectrum_byte* spectranet_w5100 1 libspectrum_byte* spectranet_flash 1 libspectrum_byte* spectranet_ram 1 + +int late_timings Modified: trunk/libspectrum/snapshot.c =================================================================== --- trunk/libspectrum/snapshot.c 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/snapshot.c 2012-12-25 12:34:34 UTC (rev 4793) @@ -71,6 +71,7 @@ libspectrum_snap_set_halted( snap, 0 ); libspectrum_snap_set_last_instruction_ei( snap, 0 ); + libspectrum_snap_set_last_instruction_set_f( snap, 0 ); libspectrum_snap_set_custom_rom( snap, 0 ); libspectrum_snap_set_custom_rom_pages( snap, 0 ); @@ -217,6 +218,8 @@ libspectrum_snap_set_spectranet_flash( snap, 0, NULL ); libspectrum_snap_set_spectranet_ram( snap, 0, NULL ); + libspectrum_snap_set_late_timings( snap, 0 ); + return snap; } Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/szx.c 2012-12-25 12:34:34 UTC (rev 4793) @@ -57,12 +57,15 @@ SZX_MACHINE_PENTAGON512, SZX_MACHINE_PENTAGON1024, SZX_MACHINE_48_NTSC, + SZX_MACHINE_128KE, } szx_machine_type; static const char *signature = "ZXST"; static const size_t signature_length = 4; +static const libspectrum_byte ZXSTMF_ALTERNATETIMINGS = 1; + static const char *libspectrum_string = "libspectrum: "; static const libspectrum_byte SZX_VERSION_MAJOR = 1; @@ -75,6 +78,7 @@ #define ZXSTBID_Z80REGS "Z80R" static const libspectrum_byte ZXSTZF_EILAST = 1; static const libspectrum_byte ZXSTZF_HALTED = 2; +static const libspectrum_byte ZXSTZF_FSET = 4; #define ZXSTBID_SPECREGS "SPCR" @@ -133,6 +137,12 @@ #define ZXSTBID_MICRODRIVE "MDRV" #define ZXSTBID_PLUS3DISK "+3\0\0" #define ZXSTBID_DSKFILE "DSK\0" +#define ZXSTBID_LEC "LEC\0" +static const libspectrum_word ZXSTLECF_PAGED = 1; + +#define ZXSTBID_LECRAMPAGE "LCRP" +static const libspectrum_word ZXSTLCRPF_COMPRESSED = 1; + #define ZXSTBID_TIMEXREGS "SCLD" #define ZXSTBID_BETA128 "B128" @@ -1372,8 +1382,10 @@ if( version >= 0x0101 ) { (*buffer)++; /* Skip dwHoldIntReqCycles */ - /* Flags; ignore the 'last instruction EI' flag for now */ + /* Flags */ + libspectrum_snap_set_last_instruction_ei( snap, **buffer & ZXSTZF_EILAST ); libspectrum_snap_set_halted( snap, **buffer & ZXSTZF_HALTED ); + libspectrum_snap_set_last_instruction_set_f( snap, **buffer & ZXSTZF_FSET ); (*buffer)++; (*buffer)++; /* Skip the hidden register */ @@ -2132,6 +2144,8 @@ { ZXSTBID_DIVIDERAMPAGE, read_dirp_chunk }, { ZXSTBID_DOCK, read_dock_chunk }, { ZXSTBID_DSKFILE, skip_chunk }, + { ZXSTBID_LEC, skip_chunk }, + { ZXSTBID_LECRAMPAGE, skip_chunk }, { ZXSTBID_GS, skip_chunk }, { ZXSTBID_GSRAMPAGE, skip_chunk }, { ZXSTBID_IF1, read_if1_chunk }, @@ -2236,6 +2250,8 @@ size_t length ) { libspectrum_word version; + libspectrum_byte machine; + libspectrum_byte flags; libspectrum_error error; const libspectrum_byte *end = buffer + length; @@ -2260,8 +2276,10 @@ version = (*buffer++) << 8; version |= *buffer++; - switch( *buffer ) { + machine = *buffer++; + switch( machine ) { + case SZX_MACHINE_16: libspectrum_snap_set_machine( snap, LIBSPECTRUM_MACHINE_16 ); break; @@ -2326,6 +2344,10 @@ libspectrum_snap_set_machine( snap, LIBSPECTRUM_MACHINE_PENT1024 ); break; + case SZX_MACHINE_128KE: + libspectrum_snap_set_machine( snap, LIBSPECTRUM_MACHINE_128E ); + break; + default: libspectrum_print_error( LIBSPECTRUM_ERROR_UNKNOWN, @@ -2334,9 +2356,21 @@ return LIBSPECTRUM_ERROR_UNKNOWN; } - /* Skip to the end of the header */ - buffer += 2; + flags = *buffer++; + switch( machine ) { + + case SZX_MACHINE_16: + case SZX_MACHINE_48: + case SZX_MACHINE_48_NTSC: + case SZX_MACHINE_128: + libspectrum_snap_set_late_timings( snap, flags & ZXSTMF_ALTERNATETIMINGS ); + break; + + default: + break; + } + ctx = libspectrum_malloc( sizeof( *ctx ) ); ctx->swap_af = 0; @@ -2524,6 +2558,8 @@ write_file_header( libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length, int *out_flags, libspectrum_snap *snap ) { + libspectrum_byte flags; + libspectrum_make_room( buffer, 8, ptr, length ); memcpy( *ptr, signature, 4 ); *ptr += 4; @@ -2536,6 +2572,7 @@ case LIBSPECTRUM_MACHINE_48: **ptr = SZX_MACHINE_48; break; case LIBSPECTRUM_MACHINE_48_NTSC: **ptr = SZX_MACHINE_48_NTSC; break; case LIBSPECTRUM_MACHINE_128: **ptr = SZX_MACHINE_128; break; + case LIBSPECTRUM_MACHINE_128E: **ptr = SZX_MACHINE_128KE; break; case LIBSPECTRUM_MACHINE_PLUS2: **ptr = SZX_MACHINE_PLUS2; break; case LIBSPECTRUM_MACHINE_PLUS2A: **ptr = SZX_MACHINE_PLUS2A; break; case LIBSPECTRUM_MACHINE_PLUS3: **ptr = SZX_MACHINE_PLUS3; break; @@ -2556,8 +2593,10 @@ } (*ptr)++; - /* Reserved byte */ - *(*ptr)++ = '\0'; + /* Flags byte */ + flags = 0; + if( libspectrum_snap_late_timings( snap ) ) flags |= ZXSTMF_ALTERNATETIMINGS; + *(*ptr)++ = flags; return LIBSPECTRUM_ERROR_NONE; } @@ -2630,6 +2669,7 @@ flags = '\0'; if( libspectrum_snap_last_instruction_ei( snap ) ) flags |= ZXSTZF_EILAST; if( libspectrum_snap_halted( snap ) ) flags |= ZXSTZF_HALTED; + if( libspectrum_snap_last_instruction_set_f( snap ) ) flags |= ZXSTZF_FSET; *(*ptr)++ = flags; /* Hidden register not supported */ @@ -2820,6 +2860,7 @@ } break; case LIBSPECTRUM_MACHINE_128: + case LIBSPECTRUM_MACHINE_128E: case LIBSPECTRUM_MACHINE_PENT: case LIBSPECTRUM_MACHINE_PLUS2: case LIBSPECTRUM_MACHINE_SE: Modified: trunk/libspectrum/z80.c =================================================================== --- trunk/libspectrum/z80.c 2012-12-22 12:09:33 UTC (rev 4792) +++ trunk/libspectrum/z80.c 2012-12-25 12:34:34 UTC (rev 4793) @@ -1125,12 +1125,19 @@ *out_flags = 0; - /* .z80 format doesn't store the 'last instruction EI' or 'halted' state */ + /* .z80 format doesn't store the 'last instruction EI', 'halted' state or + the 'last instruction set Flags' */ if( libspectrum_snap_last_instruction_ei( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; if( libspectrum_snap_halted( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; + if( libspectrum_snap_last_instruction_set_f( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; + /* .z80 format doesn't store the 'late timings' state */ + if( libspectrum_snap_late_timings( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; + /* .z80 format doesn't store +D info well */ if( libspectrum_snap_plusd_active( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; @@ -1171,6 +1178,10 @@ if( libspectrum_snap_specdrum_active( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + /* .z80 format doesn't save the Spectranet state at all */ + if( libspectrum_snap_spectranet_active( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + error = write_header( buffer, &ptr, length, out_flags, snap ); if( error != LIBSPECTRUM_ERROR_NONE ) return error; @@ -1297,6 +1308,7 @@ } break; case LIBSPECTRUM_MACHINE_SE: + case LIBSPECTRUM_MACHINE_128E: *flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; /* fall through */ case LIBSPECTRUM_MACHINE_128: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-12-25 22:42:17
|
Revision: 4795 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4795&view=rev Author: fredm Date: 2012-12-25 22:42:11 +0000 (Tue, 25 Dec 2012) Log Message: ----------- MEMPTR is also in v1.4 SZX files. Modified Paths: -------------- trunk/libspectrum/accessor.pl trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/snap_accessors.txt trunk/libspectrum/snapshot.c trunk/libspectrum/szx.c Modified: trunk/libspectrum/accessor.pl =================================================================== --- trunk/libspectrum/accessor.pl 2012-12-25 12:50:49 UTC (rev 4794) +++ trunk/libspectrum/accessor.pl 2012-12-25 22:42:11 UTC (rev 4795) @@ -67,7 +67,7 @@ libspectrum_byte a_, f_; libspectrum_word bc_, de_, hl_; libspectrum_word ix, iy; libspectrum_byte i, r; - libspectrum_word sp, pc; + libspectrum_word sp, pc, memptr; libspectrum_byte iff1, iff2, im; Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-12-25 12:50:49 UTC (rev 4794) +++ trunk/libspectrum/hacking/ChangeLog 2012-12-25 22:42:11 UTC (rev 4795) @@ -916,3 +916,5 @@ theoretically be saved separately (patch #3596469) (Fred). 20121225 accessor.pl,libspectrum.h.in,sna.c,snap_accessors.txt,snapshot.c,szx.c, z80.c: extend SZX support to version 1.5 draft specs (Fred). +20121226 accessor.pl,snap_accessors.txt,snapshot.c,szx.c: MEMPTR is also in v1.4 + SZX files (Fred). Modified: trunk/libspectrum/snap_accessors.txt =================================================================== --- trunk/libspectrum/snap_accessors.txt 2012-12-25 12:50:49 UTC (rev 4794) +++ trunk/libspectrum/snap_accessors.txt 2012-12-25 22:42:11 UTC (rev 4795) @@ -39,6 +39,7 @@ libspectrum_byte r libspectrum_word sp libspectrum_word pc +libspectrum_word memptr libspectrum_byte iff1 libspectrum_byte iff2 libspectrum_byte im Modified: trunk/libspectrum/snapshot.c =================================================================== --- trunk/libspectrum/snapshot.c 2012-12-25 12:50:49 UTC (rev 4794) +++ trunk/libspectrum/snapshot.c 2012-12-25 22:42:11 UTC (rev 4795) @@ -64,6 +64,7 @@ libspectrum_snap_set_r ( snap, 0x00 ); libspectrum_snap_set_sp ( snap, 0x0000 ); libspectrum_snap_set_pc ( snap, 0x0000 ); + libspectrum_snap_set_memptr( snap, 0x0000 ); libspectrum_snap_set_iff1( snap, 1 ); libspectrum_snap_set_iff2( snap, 1 ); Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-12-25 12:50:49 UTC (rev 4794) +++ trunk/libspectrum/szx.c 2012-12-25 22:42:11 UTC (rev 4795) @@ -1380,7 +1380,7 @@ libspectrum_snap_set_tstates( snap, libspectrum_read_dword( buffer ) ); if( version >= 0x0101 ) { - (*buffer)++; /* Skip dwHoldIntReqCycles */ + (*buffer)++; /* Skip chHoldIntReqCycles */ /* Flags */ libspectrum_snap_set_last_instruction_ei( snap, **buffer & ZXSTZF_EILAST ); @@ -1388,8 +1388,12 @@ libspectrum_snap_set_last_instruction_set_f( snap, **buffer & ZXSTZF_FSET ); (*buffer)++; - (*buffer)++; /* Skip the hidden register */ - (*buffer)++; /* Skip the reserved byte */ + if( version >= 0x0104 ) { + libspectrum_snap_set_memptr( snap, libspectrum_read_word( buffer ) ); + } else { + (*buffer)++; /* Skip the hidden register */ + (*buffer)++; /* Skip the reserved byte */ + } } else { *buffer += 4; /* Skip the reserved dword */ @@ -2672,12 +2676,8 @@ if( libspectrum_snap_last_instruction_set_f( snap ) ) flags |= ZXSTZF_FSET; *(*ptr)++ = flags; - /* Hidden register not supported */ - *(*ptr)++ = '\0'; + libspectrum_write_word( ptr, libspectrum_snap_memptr( snap ) ); - /* Reserved byte */ - *(*ptr)++ = '\0'; - return LIBSPECTRUM_ERROR_NONE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-12-26 10:37:04
|
Revision: 4796 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4796&view=rev Author: fredm Date: 2012-12-26 10:36:57 +0000 (Wed, 26 Dec 2012) Log Message: ----------- Fix typo in comment. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/make-perl.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-12-25 22:42:11 UTC (rev 4795) +++ trunk/libspectrum/hacking/ChangeLog 2012-12-26 10:36:57 UTC (rev 4796) @@ -918,3 +918,4 @@ z80.c: extend SZX support to version 1.5 draft specs (Fred). 20121226 accessor.pl,snap_accessors.txt,snapshot.c,szx.c: MEMPTR is also in v1.4 SZX files (Fred). +20121226 make-perl.c: fix typo in comment (Fred). Modified: trunk/libspectrum/make-perl.c =================================================================== --- trunk/libspectrum/make-perl.c 2012-12-25 22:42:11 UTC (rev 4795) +++ trunk/libspectrum/make-perl.c 2012-12-26 10:36:57 UTC (rev 4796) @@ -336,7 +336,7 @@ #endif /* #ifdef HAVE_LIBBZ2 */ #ifdef HAVE_LIB_AUDIOFILE - printf( "\n/* we support files wav files */\n" ); + printf( "\n/* we support wav files */\n" ); printf( "#define LIBSPECTRUM_SUPPORTS_AUDIOFILE (1)\n\n" ); #endif /* #ifdef HAVE_LIB_AUDIOFILE */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-12-26 10:38:53
|
Revision: 4797 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4797&view=rev Author: fredm Date: 2012-12-26 10:38:47 +0000 (Wed, 26 Dec 2012) Log Message: ----------- Inline constant in write_snet_chunk(). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/szx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-12-26 10:36:57 UTC (rev 4796) +++ trunk/libspectrum/hacking/ChangeLog 2012-12-26 10:38:47 UTC (rev 4797) @@ -919,3 +919,4 @@ 20121226 accessor.pl,snap_accessors.txt,snapshot.c,szx.c: MEMPTR is also in v1.4 SZX files (Fred). 20121226 make-perl.c: fix typo in comment (Fred). +20121226 szx.c: inline constant in write_snet_chunk() (Fred). Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2012-12-26 10:36:57 UTC (rev 4796) +++ trunk/libspectrum/szx.c 2012-12-26 10:38:47 UTC (rev 4797) @@ -3721,10 +3721,9 @@ write_snet_chunk( libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length, libspectrum_snap *snap, int compress ) { - size_t block_size = 54; libspectrum_word flags = 0; - write_chunk_header( buffer, ptr, length, ZXSTBID_SPECTRANET, block_size ); + write_chunk_header( buffer, ptr, length, ZXSTBID_SPECTRANET, 54 ); if( libspectrum_snap_spectranet_paged( snap ) ) flags |= ZXSTSNET_PAGED; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-12-26 10:43:02
|
Revision: 4798 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4798&view=rev Author: fredm Date: 2012-12-26 10:42:55 +0000 (Wed, 26 Dec 2012) Log Message: ----------- Add some text about changes to the interface. Modified Paths: -------------- trunk/libspectrum/doc/libspectrum.txt trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/doc/libspectrum.txt =================================================================== --- trunk/libspectrum/doc/libspectrum.txt 2012-12-26 10:38:47 UTC (rev 4797) +++ trunk/libspectrum/doc/libspectrum.txt 2012-12-26 10:42:55 UTC (rev 4798) @@ -8,7 +8,7 @@ * Snapshots: .z80, .szx, .sna (all read/write), .zxs, .sp., .snp and +D snapshots (read only). * Tape images: .tzx, .tap, .spc, .sta and .ltp (read/write) and - Warajevo .tap, Z80Em and CSW version 1 (read only). + PZX, Warajevo .tap, Z80Em and CSW version 1 (read only). * Input recordings: .rzx (read/write). * Disk images: .dsk (both plain and extended), .fdi, .sad, .scl, .td0, .trd and .udi (identification only). @@ -43,6 +43,9 @@ the library does not support zlib compression, then the constant will not be defined. +Bzip2 compression is similarly covered by LIBSPECTRUM_SUPPORTS_BZ2_COMPRESSION +and WAV file support is covered by LIBSPECTRUM_SUPPORTS_AUDIOFILE. + Defined types ============= @@ -168,6 +171,7 @@ LIBSPECTRUM_MACHINE_48 48K Spectrum LIBSPECTRUM_MACHINE_48_NTSC NTSC version of 48K Spectrum LIBSPECTRUM_MACHINE_128 (Original) 128K Spectrum +LIBSPECTRUM_MACHINE_128E Spectrum 128Ke LIBSPECTRUM_MACHINE_PLUS2 Spectrum +2 (the grey one) LIBSPECTRUM_MACHINE_PLUS2A Spectrum +2A (the black one) LIBSPECTRUM_MACHINE_PLUS3 Spectrum +3 @@ -552,6 +556,7 @@ * libspectrum_byte r * libspectrum_word sp * libspectrum_word pc +* libspectrum_word memptr * libspectrum_byte iff1 * libspectrum_byte iff2 * libspectrum_byte im @@ -560,6 +565,7 @@ * int halted * int last_instruction_ei +* int last_instruction_set_f * libspectrum_byte out_ula @@ -682,6 +688,23 @@ * int specdrum_active * libspectrum_signed_byte specdrum_dac +* int spectranet_active +* int spectranet_paged +* int spectranet_paged_via_io +* int spectranet_programmable_trap_active +* int spectranet_programmable_trap_msb +* int spectranet_all_traps_disabled +* int spectranet_rst8_trap_disabled +* int spectranet_deny_downstream_a15 +* int spectranet_page_a +* int spectranet_page_b +* libspectrum_word spectranet_programmable_trap +* libspectrum_byte* spectranet_w5100[1] +* libspectrum_byte* spectranet_flash[1] +* libspectrum_byte* spectranet_ram[1] + +* int late_timings + Most of those should be fairly self-explanatory; those which may not be are: @@ -696,9 +719,16 @@ previously executed was an EI and thus interrupts should not be accepted at this point, but will be after the next opcode. +* `last_instruction_set_f' being non-zero signals that the opcode + previously executed affected the F register. + * `out_plus3_memoryport' should also be used to save the state of the Scorpion's secondary memory control port (0x1ffd). +* `late_timings' being non-zero signals that the emulated Spectrum + should use timings 1 t-state later than usual as in some machines + that have warmed up. + * The `beta_*' functions represent the Betadisk interface. `beta_paged' is non-zero if the Betadisk ROM is currently paged in between 0x0000 and 0x3fff and `beta_direction' is non-zero @@ -715,6 +745,8 @@ * `exrom_ram' and `dock_ram' are non-zero if the corresponding 8K page of the Timex EXROM or DOCK are writable. +* The `spectranet_*' functions represent the Spectranet interface. + * `joystick_active_count' is the number of joysticks connected to the emulated Spectrum. `joystick_list' gives the type of the joysticks and `joystick_inputs' gives the corresponding connections to the real machines Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2012-12-26 10:38:47 UTC (rev 4797) +++ trunk/libspectrum/hacking/ChangeLog 2012-12-26 10:42:55 UTC (rev 4798) @@ -920,3 +920,5 @@ SZX files (Fred). 20121226 make-perl.c: fix typo in comment (Fred). 20121226 szx.c: inline constant in write_snet_chunk() (Fred). +20121226 doc/libspectrum.txt: add some text about changes to the interface + (Fred). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |