From: <sp...@us...> - 2008-07-18 03:25:04
|
Revision: 3716 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3716&view=rev Author: specu Date: 2008-07-18 03:25:13 +0000 (Fri, 18 Jul 2008) Log Message: ----------- fix functions export for dll (Marek) Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.h.in trunk/libspectrum/make-perl.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-07-15 12:24:44 UTC (rev 3715) +++ trunk/libspectrum/hacking/ChangeLog 2008-07-18 03:25:13 UTC (rev 3716) @@ -670,3 +670,5 @@ code anyway, which we faithfully checked through many levels of code. Stop doing this as it just makes the code less readable. 20080701 memory.c: allow calloc function to be changed. +20080717 make-perl.c,libspectrum.h.in: Win32: fix functions export for dll + (Marek). Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2008-07-15 12:24:44 UTC (rev 3715) +++ trunk/libspectrum/libspectrum.h.in 2008-07-18 03:25:13 UTC (rev 3716) @@ -132,12 +132,12 @@ libspectrum_free_fn_t free; } libspectrum_mem_vtable_t; -void* libspectrum_malloc( size_t size ); -void* libspectrum_calloc( size_t nmemb, size_t size ); -void* libspectrum_realloc( void *ptr, size_t size ); -void libspectrum_free( void *ptr ); +void* WIN32_DLL libspectrum_malloc( size_t size ); +void* WIN32_DLL libspectrum_calloc( size_t nmemb, size_t size ); +void* WIN32_DLL libspectrum_realloc( void *ptr, size_t size ); +void WIN32_DLL libspectrum_free( void *ptr ); -void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); +void WIN32_DLL libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); /* Attempt to identify a given file */ Modified: trunk/libspectrum/make-perl.c =================================================================== --- trunk/libspectrum/make-perl.c 2008-07-15 12:24:44 UTC (rev 3715) +++ trunk/libspectrum/make-perl.c 2008-07-18 03:25:13 UTC (rev 3716) @@ -228,12 +228,12 @@ " size_t allocated;\n" "};\n" "\n" -"GArray* g_array_new( gboolean zero_terminated, gboolean clear,\n" +"GArray* WIN32_DLL g_array_new( gboolean zero_terminated, gboolean clear,\n" " guint element_size );\n" "#define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 );\n" -"GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len );\n" +"GArray* WIN32_DLL g_array_append_vals( GArray *array, gconstpointer data, guint len );\n" "#define g_array_index(a,t,i) (*(((t*)a->data)+i))\n" -"GArray* g_array_set_size( GArray *array, guint length );\n" +"GArray* WIN32_DLL g_array_set_size( GArray *array, guint length );\n" "\n" ); if( sizeof( void* ) == sizeof( int ) ) { printf( "#define GINT_TO_POINTER(i) ((gpointer) (i))\n" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-08-21 09:28:08
|
Revision: 3755 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3755&view=rev Author: pak21 Date: 2008-08-21 09:28:16 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Make 128Kb SNA files actually loadable again. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/sna.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-08-20 03:34:23 UTC (rev 3754) +++ trunk/libspectrum/hacking/ChangeLog 2008-08-21 09:28:16 UTC (rev 3755) @@ -672,3 +672,4 @@ 20080701 memory.c: allow calloc function to be changed. 20080717 make-perl.c,libspectrum.h.in: Win32: fix functions export for dll (Marek). +20080821 sna.c: make 128Kb SNA files actually loadable again. Modified: trunk/libspectrum/sna.c =================================================================== --- trunk/libspectrum/sna.c 2008-08-20 03:34:23 UTC (rev 3754) +++ trunk/libspectrum/sna.c 2008-08-21 09:28:16 UTC (rev 3755) @@ -187,7 +187,7 @@ break; - case LIBSPECTRUM_MACHINE_128: + case LIBSPECTRUM_MACHINE_PENT: for( i=0; i<8; i++ ) { libspectrum_byte *ram = libspectrum_malloc( 0x4000 * sizeof( *ram ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-09-11 11:23:13
|
Revision: 3771 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3771&view=rev Author: pak21 Date: 2008-09-11 11:23:17 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Add function to get block length. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/internals.h trunk/libspectrum/libspectrum.c trunk/libspectrum/libspectrum.h.in trunk/libspectrum/tape_block.c trunk/libspectrum/test/test.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-09-11 03:47:01 UTC (rev 3770) +++ trunk/libspectrum/hacking/ChangeLog 2008-09-11 11:23:17 UTC (rev 3771) @@ -673,3 +673,5 @@ 20080717 make-perl.c,libspectrum.h.in: Win32: fix functions export for dll (Marek). 20080821 sna.c: make 128Kb SNA files actually loadable again. +20080911 internals.h,libspectrum.{c,h.in},tape_block.c,test/test.c: add + function to get block length. Modified: trunk/libspectrum/internals.h =================================================================== --- trunk/libspectrum/internals.h 2008-09-11 03:47:01 UTC (rev 3770) +++ trunk/libspectrum/internals.h 2008-09-11 11:23:17 UTC (rev 3771) @@ -163,6 +163,8 @@ libspectrum_tape_generalised_data_symbol_table *table, const libspectrum_byte **ptr, size_t length ); +void libspectrum_init_bits_set( void ); + /* Format specific tape routines */ libspectrum_error Modified: trunk/libspectrum/libspectrum.c =================================================================== --- trunk/libspectrum/libspectrum.c 2008-09-11 03:47:01 UTC (rev 3770) +++ trunk/libspectrum/libspectrum.c 2008-09-11 11:23:17 UTC (rev 3771) @@ -116,6 +116,8 @@ #endif /* #ifdef HAVE_GCRYPT_H */ + libspectrum_init_bits_set(); + return LIBSPECTRUM_ERROR_NONE; } Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2008-09-11 03:47:01 UTC (rev 3770) +++ trunk/libspectrum/libspectrum.h.in 2008-09-11 11:23:17 UTC (rev 3771) @@ -564,6 +564,9 @@ int WIN32_DLL libspectrum_tape_block_metadata( libspectrum_tape_block *block ); +libspectrum_dword +libspectrum_tape_block_length( libspectrum_tape_block *block ); + /* Accessor functions */ LIBSPECTRUM_TAPE_ACCESSORS Modified: trunk/libspectrum/tape_block.c =================================================================== --- trunk/libspectrum/tape_block.c 2008-09-11 03:47:01 UTC (rev 3770) +++ trunk/libspectrum/tape_block.c 2008-09-11 11:23:17 UTC (rev 3771) @@ -438,3 +438,117 @@ } } +/* Give the length of a tape block */ + +static int bits_set[ 256 ]; + +void +libspectrum_init_bits_set( void ) +{ + int i, j; + + /* Not big or clever, but easy to understand */ + + for( i = 0; i < 256; i++ ) { + int data = i; + bits_set[ i ] = 0; + for( j = 0; j < 8; j++ ) { + if( data & 0x01 ) bits_set[ i ]++; + data >>= 1; + } + } +} + +static libspectrum_dword +rom_block_length( libspectrum_tape_rom_block *rom ) +{ + libspectrum_dword length = ( rom->pause * 69888 ) / 20; + size_t i; + + for( i = 0; i < rom->length; i++ ) { + libspectrum_byte data = rom->data[ i ]; + length += ( 2 * 1710 ) * bits_set[ data ] + ( 2 * 855 ) * ( 8 - bits_set[ data ] ); + } + + return length; +} + +static libspectrum_dword +turbo_block_length( libspectrum_tape_turbo_block *turbo ) +{ + libspectrum_dword length = + turbo->pilot_pulses * turbo->pilot_length + + turbo->sync1_length + turbo->sync2_length + + ( turbo->pause * 69888 ) / 20; + size_t i; + + /* FIXME: needs to handle bits in last byte correctly */ + for( i = 0; i < turbo->length; i++ ) { + libspectrum_byte data = turbo->data[ i ]; + length += ( 2 * turbo->bit1_length ) * bits_set[ data ] + ( 2 * turbo->bit0_length ) * ( 8 - bits_set[ data ] ); + } + + return length; +} + +static libspectrum_dword +pulses_block_length( libspectrum_tape_pulses_block *pulses ) +{ + libspectrum_dword length = 0; + size_t i; + + for( i = 0; i < pulses->count; i++ ) length += pulses->lengths[ i ]; + + return length; +} + +static libspectrum_dword +pure_data_block_length( libspectrum_tape_pure_data_block *pure_data ) +{ + libspectrum_dword length = ( pure_data->pause * 69888 ) / 20; + size_t i; + + /* FIXME: needs to handle bits in last byte correctly */ + for( i = 0; i < pure_data->length; i++ ) { + libspectrum_byte data = pure_data->data[ i ]; + length += ( 2 * pure_data->bit1_length ) * bits_set[ data ] + ( 2 * pure_data->bit0_length ) * ( 8 - bits_set[ data ] ); + } + + return length; +} + +libspectrum_dword +libspectrum_tape_block_length( libspectrum_tape_block *block ) +{ + libspectrum_tape_pure_tone_block *pure_tone; + + switch( block->type ) { + case LIBSPECTRUM_TAPE_BLOCK_ROM: + return rom_block_length( &block->types.rom ); + case LIBSPECTRUM_TAPE_BLOCK_TURBO: + return turbo_block_length( &block->types.turbo ); + case LIBSPECTRUM_TAPE_BLOCK_PURE_TONE: + pure_tone = &block->types.pure_tone; + return pure_tone->pulses * pure_tone->length; + case LIBSPECTRUM_TAPE_BLOCK_PULSES: + return pulses_block_length( &block->types.pulses ); + case LIBSPECTRUM_TAPE_BLOCK_PURE_DATA: + return pure_data_block_length( &block->types.pure_data ); + case LIBSPECTRUM_TAPE_BLOCK_PAUSE: + return ( block->types.pause.length * 69888 ) / 20; + case LIBSPECTRUM_TAPE_BLOCK_GROUP_START: + case LIBSPECTRUM_TAPE_BLOCK_GROUP_END: + case LIBSPECTRUM_TAPE_BLOCK_JUMP: + case LIBSPECTRUM_TAPE_BLOCK_LOOP_START: + case LIBSPECTRUM_TAPE_BLOCK_LOOP_END: + case LIBSPECTRUM_TAPE_BLOCK_STOP48: + case LIBSPECTRUM_TAPE_BLOCK_COMMENT: + case LIBSPECTRUM_TAPE_BLOCK_MESSAGE: + case LIBSPECTRUM_TAPE_BLOCK_ARCHIVE_INFO: + case LIBSPECTRUM_TAPE_BLOCK_HARDWARE: + case LIBSPECTRUM_TAPE_BLOCK_CUSTOM: + return 0; + default: + return -1; + } +} Modified: trunk/libspectrum/test/test.c =================================================================== --- trunk/libspectrum/test/test.c 2008-09-11 03:47:01 UTC (rev 3770) +++ trunk/libspectrum/test/test.c 2008-09-11 11:23:17 UTC (rev 3771) @@ -493,6 +493,75 @@ return r; } +static test_return_t +test_24( void ) +{ + const char *filename = DYNAMIC_TEST_PATH( "complete-tzx.tzx" ); + libspectrum_byte *buffer; + size_t filesize; + libspectrum_tape *tape; + libspectrum_tape_iterator it; + libspectrum_tape_block *block; + libspectrum_dword expected_sizes[20] = { + 8214888, /* ROM */ + 3494155, /* Turbo */ + 356310, /* Pure tone */ + 1761, /* Pulses */ + 1992829, /* Pure data */ + 2159539, /* Pause */ + 0, /* Group start */ + 0, /* Group end */ + 0, /* Jump */ + 205434, /* Pure tone */ + 0, /* Loop start */ + 154845, /* Pure tone */ + 0, /* Loop end */ + 0, /* Stop tape if in 48K mode */ + 0, /* Comment */ + 0, /* Message */ + 0, /* Archive info */ + 0, /* Hardware */ + 0, /* Custom info */ + 771620, /* Pure tone */ + }; + libspectrum_dword *next_size = &expected_sizes[ 0 ]; + test_return_t r = TEST_PASS; + + if( read_file( &buffer, &filesize, filename ) ) return TEST_INCOMPLETE; + + tape = libspectrum_tape_alloc(); + + if( libspectrum_tape_read( tape, buffer, filesize, LIBSPECTRUM_ID_UNKNOWN, + filename ) ) { + libspectrum_tape_free( tape ); + libspectrum_free( buffer ); + return TEST_INCOMPLETE; + } + + libspectrum_free( buffer ); + + block = libspectrum_tape_iterator_init( &it, tape ); + + while( block ) + { + libspectrum_dword actual_size = libspectrum_tape_block_length( block ); + + if( actual_size != *next_size ) + { + fprintf( stderr, "%s: block had length %lu, but expected %lu\n", progname, (unsigned long)actual_size, (unsigned long)*next_size ); + r = TEST_FAIL; + break; + } + + block = libspectrum_tape_iterator_next( &it ); + next_size++; + } + + if( libspectrum_tape_free( tape ) ) return TEST_INCOMPLETE; + + return r; +} + struct test_description { test_fn test; @@ -525,6 +594,7 @@ { test_21, "SNA file with SP = 0xffff", 0 }, { test_22, "MDR write protection 1", 0 }, { test_23, "MDR write protection 2", 0 }, + { test_24, "Complete TZX timings", 0 }, }; static size_t test_count = sizeof( tests ) / sizeof( tests[0] ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-10-21 09:32:12
|
Revision: 3780 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3780&view=rev Author: pak21 Date: 2008-10-21 09:01:33 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Remove warning. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/tape_block.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-14 14:48:43 UTC (rev 3779) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-21 09:01:33 UTC (rev 3780) @@ -677,3 +677,4 @@ function to get block length. 20080928 internals.h,tape.c,tape_block.[ch],test/test.c: extend timing support to raw data blocks, RLE pulse blocks and the block o' doom (Fred). +20081020 tape_block.c: remove warning. Modified: trunk/libspectrum/tape_block.c =================================================================== --- trunk/libspectrum/tape_block.c 2008-10-14 14:48:43 UTC (rev 3779) +++ trunk/libspectrum/tape_block.c 2008-10-21 09:01:33 UTC (rev 3780) @@ -37,6 +37,8 @@ static const size_t LIBSPECTRUM_TAPE_PILOTS_HEADER = 0x1f7f; static const size_t LIBSPECTRUM_TAPE_PILOTS_DATA = 0x0c97; +#define TZX_HZ 3500000 + /* Functions to initialise block types */ static libspectrum_error @@ -486,8 +488,7 @@ static libspectrum_dword convert_ms_to_tstates( libspectrum_dword ms ) { - static const libspectrum_dword tzx_hz = 3500000; - static const libspectrum_dword tstates_per_ms = tzx_hz / 1000; + static const libspectrum_dword tstates_per_ms = TZX_HZ / 1000; return ms * tstates_per_ms; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-10-21 10:23:06
|
Revision: 3781 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3781&view=rev Author: pak21 Date: 2008-10-21 09:45:25 +0000 (Tue, 21 Oct 2008) Log Message: ----------- SP wasn't being decremented and could have been written to freed memory. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/sna.c trunk/libspectrum/test/test.c Added Paths: ----------- trunk/libspectrum/test/empty.z80 Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-21 09:01:33 UTC (rev 3780) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-21 09:45:25 UTC (rev 3781) @@ -678,3 +678,5 @@ 20080928 internals.h,tape.c,tape_block.[ch],test/test.c: extend timing support to raw data blocks, RLE pulse blocks and the block o' doom (Fred). 20081020 tape_block.c: remove warning. +20081021 sna.c,test/{empty.z80,test.c}: SP wasn't being decremented and + could have been written to freed memory. Modified: trunk/libspectrum/sna.c =================================================================== --- trunk/libspectrum/sna.c 2008-10-21 09:01:33 UTC (rev 3780) +++ trunk/libspectrum/sna.c 2008-10-21 09:45:25 UTC (rev 3781) @@ -32,6 +32,8 @@ #define LIBSPECTRUM_SNA_HEADER_LENGTH 27 #define LIBSPECTRUM_SNA_128_HEADER_LENGTH 4 +#define SNA_OFFSET_SP 23 + static int identify_machine( size_t buffer_length, libspectrum_snap *snap ); static int libspectrum_sna_read_header( const libspectrum_byte *buffer, size_t buffer_length, @@ -48,10 +50,10 @@ static void write_header( libspectrum_byte **buffer, libspectrum_byte **ptr, - size_t *length, libspectrum_byte **sp, libspectrum_snap *snap ); + size_t *length, libspectrum_snap *snap ); static libspectrum_error write_48k_sna( libspectrum_byte **buffer, libspectrum_byte **ptr, - size_t *length, libspectrum_byte *sp, libspectrum_snap *snap ); + size_t *length, libspectrum_snap *snap ); static libspectrum_error write_128k_sna( libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length, libspectrum_snap *snap ); @@ -287,7 +289,7 @@ int in_flags GCC_UNUSED ) { libspectrum_error error = LIBSPECTRUM_ERROR_NONE; - libspectrum_byte *ptr, *sp; + libspectrum_byte *ptr; /* Minor info loss already due to things like tstate count, halted state, etc which are not stored in .sna format */ @@ -325,7 +327,7 @@ ptr = *buffer; - write_header( buffer, &ptr, length, &sp, snap ); + write_header( buffer, &ptr, length, snap ); switch( libspectrum_snap_machine( snap ) ) { @@ -336,7 +338,7 @@ /* Fall through */ case LIBSPECTRUM_MACHINE_16: case LIBSPECTRUM_MACHINE_48: - error = write_48k_sna( buffer, &ptr, length, sp, snap ); + error = write_48k_sna( buffer, &ptr, length, snap ); break; case LIBSPECTRUM_MACHINE_128: @@ -370,7 +372,7 @@ static void write_header( libspectrum_byte **buffer, libspectrum_byte **ptr, - size_t *length, libspectrum_byte **sp, libspectrum_snap *snap ) + size_t *length, libspectrum_snap *snap ) { libspectrum_make_room( buffer, LIBSPECTRUM_SNA_HEADER_LENGTH, ptr, length ); @@ -392,8 +394,6 @@ *(*ptr)++ = libspectrum_snap_f ( snap ); *(*ptr)++ = libspectrum_snap_a ( snap ); - /* Store this for later */ - *sp = *ptr; libspectrum_write_word( ptr, libspectrum_snap_sp ( snap ) ); *(*ptr)++ = libspectrum_snap_im( snap ); @@ -402,15 +402,15 @@ static libspectrum_error write_48k_sna( libspectrum_byte **buffer, libspectrum_byte **ptr, - size_t *length, libspectrum_byte *sp, libspectrum_snap *snap ) + size_t *length, libspectrum_snap *snap ) { libspectrum_error error; - libspectrum_byte *stack; + libspectrum_byte *stack, *sp; - /* Must have somewhere in RAM to store some registers */ + /* Must have somewhere in RAM to store PC */ if( libspectrum_snap_sp( snap ) < 0x4002 ) { libspectrum_print_error( LIBSPECTRUM_ERROR_INVALID, - "SP is too low (0x%04x) to stack registers", + "SP is too low (0x%04x) to stack PC", libspectrum_snap_sp( snap ) ); return LIBSPECTRUM_ERROR_INVALID; } @@ -431,7 +431,8 @@ *ptr += 0xc000; /* Store the new value of SP */ - libspectrum_write_word( &sp, libspectrum_snap_sp( snap ) ); + sp = *buffer + SNA_OFFSET_SP; + libspectrum_write_word( &sp, libspectrum_snap_sp( snap ) - 2 ); return LIBSPECTRUM_ERROR_NONE; } Added: trunk/libspectrum/test/empty.z80 =================================================================== (Binary files differ) Property changes on: trunk/libspectrum/test/empty.z80 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/libspectrum/test/test.c =================================================================== --- trunk/libspectrum/test/test.c 2008-10-21 09:01:33 UTC (rev 3780) +++ trunk/libspectrum/test/test.c 2008-10-21 09:45:25 UTC (rev 3781) @@ -562,6 +562,69 @@ return r; } +static test_return_t +test_25( void ) +{ + const char *filename = STATIC_TEST_PATH( "empty.z80" ); + libspectrum_byte *buffer = NULL; + size_t filesize = 0, length = 0; + libspectrum_snap *snap; + int flags; + test_return_t r = TEST_INCOMPLETE; + + if( read_file( &buffer, &filesize, filename ) ) return TEST_INCOMPLETE; + + snap = libspectrum_snap_alloc(); + + if( libspectrum_snap_read( snap, buffer, filesize, LIBSPECTRUM_ID_UNKNOWN, + filename ) != LIBSPECTRUM_ERROR_NONE ) { + fprintf( stderr, "%s: reading `%s' failed\n", progname, filename ); + libspectrum_snap_free( snap ); + libspectrum_free( buffer ); + return TEST_INCOMPLETE; + } + + libspectrum_free( buffer ); + buffer = NULL; + + if( libspectrum_snap_write( &buffer, &length, &flags, snap, + LIBSPECTRUM_ID_SNAPSHOT_SNA, NULL, 0 ) != + LIBSPECTRUM_ERROR_NONE ) { + fprintf( stderr, "%s: serialising to SNA failed\n", progname ); + libspectrum_snap_free( snap ); + return TEST_INCOMPLETE; + } + + libspectrum_snap_free( snap ); + snap = libspectrum_snap_alloc(); + + if( libspectrum_snap_read( snap, buffer, length, LIBSPECTRUM_ID_SNAPSHOT_SNA, + NULL ) != LIBSPECTRUM_ERROR_NONE ) { + fprintf( stderr, "%s: restoring from SNA failed\n", progname ); + libspectrum_snap_free( snap ); + libspectrum_free( buffer ); + return TEST_INCOMPLETE; + } + + libspectrum_free( buffer ); + + if( libspectrum_snap_pc( snap ) != 0x1234 ) { + fprintf( stderr, "%s: PC is 0x%04x, not the expected 0x1234\n", progname, + libspectrum_snap_pc( snap ) ); + r = TEST_FAIL; + } else if( libspectrum_snap_sp( snap ) != 0x8000 ) { + fprintf( stderr, "%s: SP is 0x%04x, not the expected 0x8000\n", progname, + libspectrum_snap_sp( snap ) ); + r = TEST_FAIL; + } else { + r = TEST_PASS; + } + + libspectrum_snap_free( snap ); + + return r; +} + struct test_description { test_fn test; @@ -595,6 +658,7 @@ { test_22, "MDR write protection 1", 0 }, { test_23, "MDR write protection 2", 0 }, { test_24, "Complete TZX timings", 0 }, + { test_25, "Writing SNA file", 0 }, }; static size_t test_count = sizeof( tests ) / sizeof( tests[0] ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2008-10-22 12:36:21
|
Revision: 3784 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3784&view=rev Author: fredm Date: 2008-10-22 12:36:07 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Remove deprecated functions libspectrum_sna_read(), libspectrum_z80_read(), libspectrum_z80_write(), libspectrum_tap_read(), libspectrum_tap_write(), libspectrum_tzx_read(), libspectrum_tzx_write() and libspectrum_warajevo_read(). Modified Paths: -------------- trunk/libspectrum/doc/libspectrum.txt trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.h.in trunk/libspectrum/sna.c trunk/libspectrum/tap.c trunk/libspectrum/tzx_read.c trunk/libspectrum/tzx_write.c trunk/libspectrum/warajevo_read.c trunk/libspectrum/z80.c Modified: trunk/libspectrum/doc/libspectrum.txt =================================================================== --- trunk/libspectrum/doc/libspectrum.txt 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/doc/libspectrum.txt 2008-10-22 12:36:07 UTC (rev 3784) @@ -695,34 +695,6 @@ The only formats for which serialisation is supported are .sna, .szx and .z80. -Deprecated snapshot routines ----------------------------- - -There are also three format-specific functions. However, *these -functions are deprecated and should not be used in new code*: - -libspectrum_error libspectrum_sna_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, - size_t buffer_length ) - -Take the .sna snapshot of length `buffer_length' bytes at `buffer' and -convert it to a `libspectrum_snap' structure. - -libspectrum_error libspectrum_z80_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, - size_t buffer_length ) - -Similarly for a .z80 snapshot. - -libspectrum_error libspectrum_z80_write( libspectrum_byte **buffer, - size_t *length, - libspectrum_snap *snap ) - -Take the snapshot in `snap' and serialise it into a .z80 file at -'*buffer'. On entry, '*buffer' is assumed to be allocated '*length' -bytes, and will grow if necessary; if '*length' is zero, '*buffer' can -be uninitialised on entry. - Tape functions ============== @@ -832,50 +804,6 @@ Move the tape along so it points to the next block, initialise that block and return it. -Deprecated tape routines ------------------------- - -*These functions are deprecated and should not be used in new code*: - -libspectrum_error -libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ) - -Form a tape object in `tape' from the .tap file of `length' bytes -starting at `buffer'. This routine deals with the `normal' (Z80-style) -.tap files, not with Warajevo .tap files. - -libspectrum_error -libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ) - -Attempt to convert the tape in `tape' to a .tap file in `*buffer', which -has previously been allocated `*length' bytes by user code. The .tap -format can handle only standard speed loading blocks; a best guess -attempt will be made to convert other blocks, but the resultant .tap -file probably won't work. - -libspectrum_error -libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ) - -Just as `libspectrum_tap_read', but for .tzx format files. - -libspectrum_error -libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ) - -Just as `libspectrum_tap_write', but for .tzx files. The conversion to -.tzx format is not lossy as it is with converting to .tap. - -libspectrum_error -libspectrum_warajevo_read( libspectrum_tape *tape, - const libspectrum_byte *buffer, - const size_t length ) - -Just as `libspectrum_tap_read', but for Warajevo-style .tap files. -There is no currently no function to write a Warajevo-style .tap file. - Tape iterators -------------- Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-22 12:36:07 UTC (rev 3784) @@ -680,3 +680,8 @@ 20081020 tape_block.c: remove warning. 20081021 sna.c,test/{empty.z80,test.c}: SP wasn't being decremented and could have been written to freed memory. +20081022 libspectrum.h.in,sna.c,tap.c,tzx_read.c,tzx_write.c,warajevo_read.c, + z80.c: remove deprecated functions libspectrum_sna_read(), + libspectrum_z80_read(),libspectrum_z80_write(),libspectrum_tap_read(), + libspectrum_tap_write(),libspectrum_tzx_read(), + libspectrum_tzx_write() and libspectrum_warajevo_read() (Fred). Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/libspectrum.h.in 2008-10-22 12:36:07 UTC (rev 3784) @@ -449,24 +449,6 @@ /* Accessor functions */ LIBSPECTRUM_SNAP_ACCESSORS -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_sna_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_write( libspectrum_byte **buffer, size_t *length, - libspectrum_snap *snap ); - /* * Tape handling routines */ @@ -639,42 +621,6 @@ libspectrum_tape_block *block, size_t position ); -/*** Routines for .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for .tzx format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for Warajevo .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_warajevo_read( libspectrum_tape *tape, - const libspectrum_byte *buffer, size_t length ); - /*** Routines for iterating through a tape ***/ libspectrum_tape_block WIN32_DLL * Modified: trunk/libspectrum/sna.c =================================================================== --- trunk/libspectrum/sna.c 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/sna.c 2008-10-22 12:36:07 UTC (rev 3784) @@ -61,13 +61,6 @@ write_page( libspectrum_byte *buffer, libspectrum_snap *snap, int page ); libspectrum_error -libspectrum_sna_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ) -{ - return internal_sna_read( snap, buffer, buffer_length ); -} - -libspectrum_error internal_sna_read( libspectrum_snap *snap, const libspectrum_byte *buffer, size_t buffer_length ) { Modified: trunk/libspectrum/tap.c =================================================================== --- trunk/libspectrum/tap.c 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/tap.c 2008-10-22 12:36:07 UTC (rev 3784) @@ -135,13 +135,6 @@ } libspectrum_error -libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ) -{ - return internal_tap_read( tape, buffer, length, LIBSPECTRUM_ID_TAPE_TAP ); -} - -libspectrum_error internal_tap_write( libspectrum_byte **buffer, size_t *length, libspectrum_tape *tape, libspectrum_id_t type ) { @@ -230,13 +223,6 @@ return LIBSPECTRUM_ERROR_NONE; } -libspectrum_error -libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ) -{ - return internal_tap_write( buffer, length, tape, LIBSPECTRUM_ID_TAPE_TAP ); -} - static libspectrum_error write_rom( libspectrum_tape_block *block, libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length, libspectrum_id_t type ) Modified: trunk/libspectrum/tzx_read.c =================================================================== --- trunk/libspectrum/tzx_read.c 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/tzx_read.c 2008-10-22 12:36:07 UTC (rev 3784) @@ -251,13 +251,6 @@ return LIBSPECTRUM_ERROR_NONE; } -libspectrum_error -libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ) -{ - return internal_tzx_read( tape, buffer, length ); -} - static libspectrum_error tzx_read_rom_block( libspectrum_tape *tape, const libspectrum_byte **ptr, const libspectrum_byte *end ) Modified: trunk/libspectrum/tzx_write.c =================================================================== --- trunk/libspectrum/tzx_write.c 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/tzx_write.c 2008-10-22 12:36:07 UTC (rev 3784) @@ -233,13 +233,6 @@ return LIBSPECTRUM_ERROR_NONE; } -libspectrum_error -libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ) -{ - return internal_tzx_write( buffer, length, tape ); -} - static void tzx_write_rom( libspectrum_tape_block *block, libspectrum_byte **buffer, libspectrum_byte **ptr, size_t *length ) Modified: trunk/libspectrum/warajevo_read.c =================================================================== --- trunk/libspectrum/warajevo_read.c 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/warajevo_read.c 2008-10-22 12:36:07 UTC (rev 3784) @@ -205,13 +205,6 @@ return LIBSPECTRUM_ERROR_NONE; } -libspectrum_error -libspectrum_warajevo_read( libspectrum_tape *tape, - const libspectrum_byte *buffer, size_t length ) -{ - return internal_warajevo_read( tape, buffer, length ); -} - static libspectrum_error get_next_block( size_t *offset, const libspectrum_byte *buffer, const libspectrum_byte *end, libspectrum_tape *tape ) Modified: trunk/libspectrum/z80.c =================================================================== --- trunk/libspectrum/z80.c 2008-10-21 13:33:25 UTC (rev 3783) +++ trunk/libspectrum/z80.c 2008-10-22 12:36:07 UTC (rev 3784) @@ -197,13 +197,6 @@ }; libspectrum_error -libspectrum_z80_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ) -{ - return internal_z80_read( snap, buffer, buffer_length ); -} - -libspectrum_error internal_z80_read( libspectrum_snap *snap, const libspectrum_byte *buffer, size_t buffer_length ) { @@ -1109,17 +1102,7 @@ } -/* DEPRECATED: use libspectrum_snap_write() instead */ libspectrum_error -libspectrum_z80_write( libspectrum_byte **buffer, size_t *length, - libspectrum_snap *snap ) -{ - int out_flags; - - return libspectrum_z80_write2( buffer, length, &out_flags, snap, 0 ); -} - -libspectrum_error libspectrum_z80_write2( libspectrum_byte **buffer, size_t *length, int *out_flags, libspectrum_snap *snap, int in_flags ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-10-22 18:26:26
|
Revision: 3785 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3785&view=rev Author: pak21 Date: 2008-10-22 18:26:20 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Add "automatic" flag to snapshots in RZX files. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.h.in trunk/libspectrum/rzx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-22 12:36:07 UTC (rev 3784) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-22 18:26:20 UTC (rev 3785) @@ -680,8 +680,5 @@ 20081020 tape_block.c: remove warning. 20081021 sna.c,test/{empty.z80,test.c}: SP wasn't being decremented and could have been written to freed memory. -20081022 libspectrum.h.in,sna.c,tap.c,tzx_read.c,tzx_write.c,warajevo_read.c, - z80.c: remove deprecated functions libspectrum_sna_read(), - libspectrum_z80_read(),libspectrum_z80_write(),libspectrum_tap_read(), - libspectrum_tap_write(),libspectrum_tzx_read(), - libspectrum_tzx_write() and libspectrum_warajevo_read() (Fred). +20081021 libspectrum.h.in,rzx.c: add "automatic" flag to snapshots in RZX + files. Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2008-10-22 12:36:07 UTC (rev 3784) +++ trunk/libspectrum/libspectrum.h.in 2008-10-22 18:26:20 UTC (rev 3785) @@ -449,6 +449,24 @@ /* Accessor functions */ LIBSPECTRUM_SNAP_ACCESSORS +/* DEPRECATED: use libspectrum_snap_read() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_sna_read( libspectrum_snap *snap, + const libspectrum_byte *buffer, size_t buffer_length ); + +/* DEPRECATED: use libspectrum_snap_read() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_z80_read( libspectrum_snap *snap, + const libspectrum_byte *buffer, size_t buffer_length ); + +/* DEPRECATED: use libspectrum_snap_write() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_z80_write( libspectrum_byte **buffer, size_t *length, + libspectrum_snap *snap ); + /* * Tape handling routines */ @@ -621,6 +639,42 @@ libspectrum_tape_block *block, size_t position ); +/*** Routines for .tap format files ***/ + +/* DEPRECATED: use libspectrum_tape_read() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, + const size_t length ); + +/* DEPRECATED: use libspectrum_tape_write() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, + libspectrum_tape *tape ); + +/*** Routines for .tzx format files ***/ + +/* DEPRECATED: use libspectrum_tape_read() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, + const size_t length ); + +/* DEPRECATED: use libspectrum_tape_write() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, + libspectrum_tape *tape ); + +/*** Routines for Warajevo .tap format files ***/ + +/* DEPRECATED: use libspectrum_tape_read() instead */ +DEPRECATED +libspectrum_error WIN32_DLL +libspectrum_warajevo_read( libspectrum_tape *tape, + const libspectrum_byte *buffer, size_t length ); + /*** Routines for iterating through a tape ***/ libspectrum_tape_block WIN32_DLL * @@ -670,7 +724,7 @@ libspectrum_error WIN32_DLL libspectrum_rzx_stop_input( libspectrum_rzx *rzx ); libspectrum_error WIN32_DLL -libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap ); +libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int automatic ); libspectrum_error WIN32_DLL libspectrum_rzx_rollback( libspectrum_rzx *rzx, libspectrum_snap **snap ); libspectrum_error WIN32_DLL @@ -764,6 +818,8 @@ libspectrum_rzx_iterator it ); libspectrum_snap* WIN32_DLL libspectrum_rzx_iterator_get_snap( libspectrum_rzx_iterator it ); +int WIN32_DLL +libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ); /* * Microdrive image handling routines Modified: trunk/libspectrum/rzx.c =================================================================== --- trunk/libspectrum/rzx.c 2008-10-22 12:36:07 UTC (rev 3784) +++ trunk/libspectrum/rzx.c 2008-10-22 18:26:20 UTC (rev 3785) @@ -1,5 +1,5 @@ /* rzx.c: routines for dealing with .rzx files - Copyright (c) 2002-2005 Philip Kendall + Copyright (c) 2002-2008 Philip Kendall $Id$ @@ -79,6 +79,13 @@ } input_block_t; +typedef struct snapshot_block_t { + + libspectrum_snap *snap; + int automatic; + +} snapshot_block_t; + typedef struct signature_block_t { size_t length; /* Length of the signed data from rzx->signed_start */ @@ -96,7 +103,7 @@ union { input_block_t input; - libspectrum_snap *snap; + snapshot_block_t snap; libspectrum_dword keyid; signature_block_t signature; @@ -200,7 +207,7 @@ return LIBSPECTRUM_ERROR_NONE; case LIBSPECTRUM_RZX_SNAPSHOT_BLOCK: - libspectrum_snap_free( block->types.snap ); + libspectrum_snap_free( block->types.snap.snap ); libspectrum_free( block ); return LIBSPECTRUM_ERROR_NONE; @@ -286,7 +293,7 @@ } libspectrum_error -libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap ) +libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int automatic ) { rzx_block_t *block; libspectrum_error error; @@ -296,7 +303,8 @@ block_alloc( &block, LIBSPECTRUM_RZX_SNAPSHOT_BLOCK ); - block->types.snap = snap; + block->types.snap.snap = snap; + block->types.snap.automatic = automatic; rzx->blocks = g_slist_append( rzx->blocks, block ); @@ -340,7 +348,7 @@ previous->next = NULL; block = previous->data; - *snap = block->types.snap; + *snap = block->types.snap.snap; return LIBSPECTRUM_ERROR_NONE; } @@ -379,7 +387,7 @@ previous->next = NULL; block = previous->data; - *snap = block->types.snap; + *snap = block->types.snap.snap; return LIBSPECTRUM_ERROR_NONE; } @@ -492,7 +500,7 @@ block = previous->data; if( block->type == LIBSPECTRUM_RZX_SNAPSHOT_BLOCK ) - *snap = block->types.snap; + *snap = block->types.snap.snap; } return LIBSPECTRUM_ERROR_NONE; @@ -539,7 +547,7 @@ rzx->current_block = it; break; } else if( block->type == LIBSPECTRUM_RZX_SNAPSHOT_BLOCK ) { - *snap = block->types.snap; + *snap = block->types.snap.snap; } } @@ -912,9 +920,10 @@ } block_alloc( &block, LIBSPECTRUM_RZX_SNAPSHOT_BLOCK ); - block->types.snap = libspectrum_snap_alloc(); + block->types.snap.snap = libspectrum_snap_alloc(); + block->types.snap.automatic = 0; - snap = block->types.snap; + snap = block->types.snap.snap; for( done = 0, type = snapshot_strings; type->format; type++ ) { if( !strncasecmp( (char*)*ptr, type->string, 4 ) ) { @@ -1248,7 +1257,7 @@ switch( block->type ) { case LIBSPECTRUM_RZX_SNAPSHOT_BLOCK: - error = rzx_write_snapshot( buffer, &ptr, length, block->types.snap, + error = rzx_write_snapshot( buffer, &ptr, length, block->types.snap.snap, snap_format, creator, compress ); if( error != LIBSPECTRUM_ERROR_NONE ) return error; break; @@ -1664,5 +1673,15 @@ if( block->type != LIBSPECTRUM_RZX_SNAPSHOT_BLOCK ) return NULL; - return block->types.snap; + return block->types.snap.snap; } + +int +libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ) +{ + rzx_block_t *block = it->data; + + if( block->type != LIBSPECTRUM_RZX_SNAPSHOT_BLOCK ) return 0; + + return block->types.snap.automatic; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-10-22 18:34:03
|
Revision: 3786 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3786&view=rev Author: pak21 Date: 2008-10-22 18:33:54 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Accidently backed out bits of Fred's commit. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.h.in Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-22 18:26:20 UTC (rev 3785) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-22 18:33:54 UTC (rev 3786) @@ -680,5 +680,10 @@ 20081020 tape_block.c: remove warning. 20081021 sna.c,test/{empty.z80,test.c}: SP wasn't being decremented and could have been written to freed memory. +20081021 libspectrum.h.in,sna.c,tap.c,tzx_read.c,tzx_write.c,warajevo_read.c, + z80.c: remove deprecated functions libspectrum_sna_read(), + libspectrum_z80_read(),libspectrum_z80_write(),libspectrum_tap_read(), + libspectrum_tap_write(),libspectrum_tzx_read(), + libspectrum_tzx_write() and libspectrum_warajevo_read() (Fred). 20081021 libspectrum.h.in,rzx.c: add "automatic" flag to snapshots in RZX files. Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2008-10-22 18:26:20 UTC (rev 3785) +++ trunk/libspectrum/libspectrum.h.in 2008-10-22 18:33:54 UTC (rev 3786) @@ -449,24 +449,6 @@ /* Accessor functions */ LIBSPECTRUM_SNAP_ACCESSORS -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_sna_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_write( libspectrum_byte **buffer, size_t *length, - libspectrum_snap *snap ); - /* * Tape handling routines */ @@ -639,42 +621,6 @@ libspectrum_tape_block *block, size_t position ); -/*** Routines for .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for .tzx format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for Warajevo .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_warajevo_read( libspectrum_tape *tape, - const libspectrum_byte *buffer, size_t length ); - /*** Routines for iterating through a tape ***/ libspectrum_tape_block WIN32_DLL * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-10-27 20:20:46
|
Revision: 3791 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3791&view=rev Author: pak21 Date: 2008-10-27 20:20:40 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Bring up to date. Modified Paths: -------------- trunk/libspectrum/ChangeLog trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/ChangeLog =================================================================== --- trunk/libspectrum/ChangeLog 2008-10-25 22:46:20 UTC (rev 3790) +++ trunk/libspectrum/ChangeLog 2008-10-27 20:20:40 UTC (rev 3791) @@ -1,3 +1,47 @@ +2008-11-?? Philip Kendall <phi...@sh...> + + * libspectrum 0.5.0 released. + + * Memory management change: memory allocation functions now abort + on failure. Leads to simpler code both internally and for + users of the library (Philip Kendall). + + * Support for tape acceleration (Philip Kendall) + + * IDE improvements to allow DivIDE to support FATware (Philip + Kendall; thanks, http://www.dusky.sk/zxs/) + + * New API to deal with flagging automatic snapshots in RZX files + (Philip Kendall). + + * New function to get length (time) of a tape block (Philip Kendall, + Fredrick Meunier). + + * 128K SNA files are now treated as being for the Pentagon 128 + rather than the Spectrum 128 (Fredrick Meunier) + + * SNA files now written out correctly (Philip Kendall). + + * Handle MDR write protection flag correctly (Philip Kendall) + + * Allow MDR images with bad checksums to load (the error will + be handled by the If1 ROM) (Gergely Szasz) + + * Support saving custom ROMs in SZX snapshots (Fredrick Meunier, + Stuart Brady) + + * Support for DivIDE, Kempston mouse and the simple IDE interface + in SZX snapshots (Fredrick Meunier) + + * Allow building without libgcrypt (Stuart Brady) + + * Amiga and MorphOS compilation fixes (Chris Young, Q-Master) + + * Don't produce empty libraries to fix build process on + OpenSolaris (Fredrick Meunier) + + * Remove deprecated functions (Fredrick Meunier). + 2008-01-05 Philip Kendall <phi...@sh...> * libspectrum 0.4.0 released. Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-25 22:46:20 UTC (rev 3790) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-27 20:20:40 UTC (rev 3791) @@ -687,3 +687,4 @@ libspectrum_tzx_write() and libspectrum_warajevo_read() (Fred). 20081021 libspectrum.h.in,rzx.c: add "automatic" flag to snapshots in RZX files. +20081027 ChangeLog: bring up to date. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2008-10-27 20:49:41
|
Revision: 3792 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3792&view=rev Author: specu Date: 2008-10-27 20:49:34 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Win32: fixed dll export for libspectrum_tape_block_length (Marek) Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.h.in Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-27 20:20:40 UTC (rev 3791) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-27 20:49:34 UTC (rev 3792) @@ -688,3 +688,5 @@ 20081021 libspectrum.h.in,rzx.c: add "automatic" flag to snapshots in RZX files. 20081027 ChangeLog: bring up to date. +20081027 libspectrum.h.in: Win32: fixed dll export for + libspectrum_tape_block_length (Marek). Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2008-10-27 20:20:40 UTC (rev 3791) +++ trunk/libspectrum/libspectrum.h.in 2008-10-27 20:49:34 UTC (rev 3792) @@ -546,7 +546,7 @@ int WIN32_DLL libspectrum_tape_block_metadata( libspectrum_tape_block *block ); -libspectrum_dword +libspectrum_dword WIN32_DLL libspectrum_tape_block_length( libspectrum_tape_block *block ); /* Accessor functions */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-10-27 20:55:53
|
Revision: 3793 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3793&view=rev Author: pak21 Date: 2008-10-27 20:55:47 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Bring up to date. Modified Paths: -------------- trunk/libspectrum/doc/libspectrum.txt trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/doc/libspectrum.txt =================================================================== --- trunk/libspectrum/doc/libspectrum.txt 2008-10-27 20:49:34 UTC (rev 3792) +++ trunk/libspectrum/doc/libspectrum.txt 2008-10-27 20:55:47 UTC (rev 3793) @@ -61,9 +61,9 @@ libspectrum_error libspectrum_init( void ) This routine must be called before any other libspectrum routines, -other than `libspectrum_version' and `libspectrum_check_version' to -initialise the library. If it isn't called, undefined behaviour may -result. +other than `libspectrum_version', `libspectrum_check_version' and +`libspectrum_mem_set_vtable' to initialise the library. If it isn't +called, undefined behaviour may result. const char *libspectrum_version( void ) @@ -83,6 +83,34 @@ returns non-zero if the libspectrum version in use is at least `version' or zero if it is not. +Memory handling +=============== + +By default, libspectrum will use the standard library's malloc(), +calloc(), realloc() and free() for memory handling, but wrapped so that +they are "strong" (they will either succeed or abort the program). It is +possible to replace these with custom allocation routines if you wish. + +typedef void* (*libspectrum_malloc_fn_t)( size_t size ); +typedef void* (*libspectrum_calloc_fn_t)( size_t nmemb, size_t size ); +typedef void* (*libspectrum_realloc_fn_t)( void *ptr, size_t size ); +typedef void (*libspectrum_free_fn_t)( void *ptr ); + +typedef struct libspectrum_mem_vtable_t { + libspectrum_malloc_fn_t malloc; + libspectrum_calloc_fn_t calloc; + libspectrum_realloc_fn_t realloc; + libspectrum_free_fn_t free; +} libspectrum_mem_vtable_t; + +void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ) + +Set the memory handling routines to be those specified by `table'. This +function may *not* be called after libspectrum_init() has been called. +Note that libspectrum will ensure that the memory allocators are still +strong, and will abort the program if any of the allocators returns +NULL. + Error handling ============== @@ -391,7 +419,7 @@ libspectrum provides a `libspectrum_creator' structure to store this information. -libspectrum_error libspectrum_creator_alloc( libspectrum_creator **creator ) +libspectrum_creator* libspectrum_creator_alloc( void ) Allocate a new `libspectrum_creator' structure. @@ -451,7 +479,7 @@ `libspectrum_snap' structure, which can be accessed via the following routines: -libspectrum_error libspectrum_snap_alloc( libspectrum_snap **snap ) +libspectrum_snap* libspectrum_snap_alloc( void ) Allocate a new libspectrum_snap structure. @@ -704,7 +732,7 @@ The routines for dealing with tapes are: -libspectrum_error libspectrum_tape_alloc( libspectrum_tape **tape ) +libspectrum_tape* libspectrum_tape_alloc( void ) Allocate a new libspectrum_tape object. @@ -765,6 +793,10 @@ forced high at this edge LIBSPECTRUM_TAPE_FLAGS_NO_EDGE This "edge" isn't really an edge and doesn't change the input signal from the tape. +LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT This edge is a "short" edge; used + for loader acceleration +LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG This edge is a "long" edge; again + used for loader acceleration int libspectrum_tape_present( libspectrum_tape *tape ) @@ -781,12 +813,27 @@ Set the current block on the tape to be the `n'th block and initialise it. Again, the first block on the tape is block 0. -libspectrum_error +void libspectrum_tape_append_block( libspectrum_tape *tape, libspectrum_tape_block *block ) Append `block' to `tape'. +void +libspectrum_tape_remove_block( libspectrum_tape *tape, + libspectrum_tape_iterator it ) + +Remove the block pointed to by `it' (see the "Tape iterators" section) +from the tape. + +libspectrum_error +libspectrum_tape_insert_block( libspectrum_tape *tape, + libspectrum_tape_block *block, + size_t position ) + +Insert `block' into `tape` in position `position', where position 0 +would make the new block the first block on the tape. + libspectrum_tape_block* libspectrum_tape_current_block( libspectrum_tape *tape ) @@ -874,9 +921,8 @@ The basic routines for dealing with tape blocks are: -libspectrum_error -libspectrum_tape_block_alloc( libspectrum_tape_block **block, - libspectrum_tape_type type ) +libspectrum_tape_block* +libspectrum_tape_block_alloc( libspectrum_tape_type type ) Allocate a new tape block of `type'. @@ -922,6 +968,11 @@ Returns 1 if the block consists solely of metadata (comments, etc.) or 0 if it contains real data. +libspectrum_dword +libspectrum_tape_block_length( libspectrum_tape_block *block ) + +Returns the length (in tstates) of this block + The `get' and `set' functions follow the same pattern as for the snapshot routines: the `get' functions are like @@ -1088,7 +1139,7 @@ All input recording routines are accessed through the opaque `libspectrum_rzx' structure. -libspectrum_error libspectrum_rzx_alloc( libspectrum_rzx **rzx ) +libspectrum_rzx* libspectrum_rzx_alloc( void ) Allocate a new input recording object. @@ -1097,7 +1148,7 @@ Free the memory used by an input recording object as allocated by `libspectrum_rzx_alloc'. -libspectrum_error +void libspectrum_rzx_start_input( libspectrum_rzx *rzx, libspectrum_dword tstates ) Start an input recording block int the object. @@ -1107,9 +1158,13 @@ Stop the current input recording block. libspectrum_error -libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap ) +libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, + int automatic ) -Add `snap' to the input recording at this point. +Add `snap' to the input recording at this point. `automatic' can be used +to indicate whether this block was automatically added by the calling +program (non-zero) or explicitly requested by the user (zero) and then +fetched with libspectrum_rzx_iterator_snap_is_automatic() (see below). libspectrum_error libspectrum_rzx_rollback( libspectrum_rzx *rzx, libspectrum_snap **snap ) @@ -1226,6 +1281,13 @@ Get the snapshot pointed to by `it'. If `it' does not point to a snapshot, NULL is returned. +int +libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ) + +Returns non-zero if `it' points to a snap which has its "automatic" flag +(see libspectrum_rzx_add_snap()) set to true, or false if it doesn't (or +if `it' doesn't point to a snapshot). + Input recording iterators ------------------------- @@ -1394,8 +1456,8 @@ Routines for handling images of microdrive cartridges. As usual, these are accessed through an opaque structure, libspectrum_microdrive. -libspectrum_error -libspectrum_microdrive_alloc( libspectrum_microdrive **microdrive ) +libspectrum_microdrive* +libspectrum_microdrive_alloc( void ) Allocate a microdrive structure. @@ -1444,7 +1506,7 @@ libspectrum_error libspectrum_microdrive_mdr_read( libspectrum_microdrive *microdrive, libspectrum_byte *buffer, size_t length ) -libspectrum_error +void libspectrum_microdrive_mdr_write( const libspectrum_microdrive *microdrive, libspectrum_byte **buffer, size_t *length ) @@ -1494,7 +1556,7 @@ The actual routines for handling dock files: -libspectrum_error libspectrum_dck_alloc( libspectrum_dck **dck ) +libspectrum_dck* libspectrum_dck_alloc( void ) Allocate a dock structure. @@ -1520,9 +1582,8 @@ images are not handled entirely in memory as are the other file types, but require a real file. -libspectrum_error -libspectrum_ide_alloc( libspectrum_ide_channel **chn, - libspectrum_ide_database databus ) +libspectrum_ide_channel* +libspectrum_ide_alloc( libspectrum_ide_databus databus ) Allocate a new IDE channel in `*chn' of type `databus'. `databus' can take the following values: Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-27 20:49:34 UTC (rev 3792) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-27 20:55:47 UTC (rev 3793) @@ -690,3 +690,4 @@ 20081027 ChangeLog: bring up to date. 20081027 libspectrum.h.in: Win32: fixed dll export for libspectrum_tape_block_length (Marek). +20081027 doc/libspectrum.txt: bring up to date. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-10-27 21:02:52
|
Revision: 3795 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3795&view=rev Author: pak21 Date: 2008-10-27 21:02:43 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Haven't been using CVS for a while now. Modified Paths: -------------- trunk/libspectrum/README trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/README =================================================================== --- trunk/libspectrum/README 2008-10-27 21:00:32 UTC (rev 3794) +++ trunk/libspectrum/README 2008-10-27 21:02:43 UTC (rev 3795) @@ -42,12 +42,12 @@ http://fuse-emulator.sourceforge.net/libspectrum.php -Compiling from CVS ------------------- +Compiling from Subversion +------------------------- -If you're using version of libspectrum from CVS rather than one of the -released tarballs, you'll need to run `autogen.sh' before running -'configure' for the first time. +If you're using version of libspectrum from Subversion rather than one +of the released tarballs, you'll need to run `autogen.sh' before +running 'configure' for the first time. Philip Kendall <phi...@sh...> 5 January 2008 Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-10-27 21:00:32 UTC (rev 3794) +++ trunk/libspectrum/hacking/ChangeLog 2008-10-27 21:02:43 UTC (rev 3795) @@ -691,3 +691,4 @@ 20081027 libspectrum.h.in: Win32: fixed dll export for libspectrum_tape_block_length (Marek). 20081027 doc/libspectrum.txt: bring up to date. +20081027 README: haven't been using CVS for a while now. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2008-11-18 03:38:54
|
Revision: 3832 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3832&view=rev Author: fredm Date: 2008-11-18 03:38:51 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Distribute empty.z80 and writeprotected.mdr test data files. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/test/Makefile.am Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-11-17 23:11:12 UTC (rev 3831) +++ trunk/libspectrum/hacking/ChangeLog 2008-11-18 03:38:51 UTC (rev 3832) @@ -696,3 +696,5 @@ identification of more disk images (part of patch #2233744) (Gergely Szasz). 20081109 doc/cvs-tags: document 0.5.0 branch tag. +20081118 test/Makefile.am: distribute empty.z80 and writeprotected.mdr test + data files (Fred). Modified: trunk/libspectrum/test/Makefile.am =================================================================== --- trunk/libspectrum/test/Makefile.am 2008-11-17 23:11:12 UTC (rev 3831) +++ trunk/libspectrum/test/Makefile.am 2008-11-18 03:38:51 UTC (rev 3832) @@ -42,23 +42,25 @@ EXTRA_DIST += \ test/Makefile.am \ test/complete-tzx.pl \ + test/empty-drb.tzx \ test/empty.csw \ - test/empty-drb.tzx \ - test/invalid.gz \ - test/invalid.szx \ - test/invalid.tzx \ + test/empty.z80 \ test/invalid-archiveinfo.tzx \ test/invalid-custominfo.tzx \ test/invalid-gdb.tzx \ test/invalid-hardwareinfo.tzx \ test/invalid-warajevo-blockoffset.tap \ + test/invalid.gz \ + test/invalid.szx \ + test/invalid.tzx \ test/jump.tzx \ test/loop.tzx \ test/loop2.tzx \ test/loopend.tzx \ test/sp-2000.sna.gz \ test/sp-ffff.sna.gz \ - test/turbo-zeropilot.tzx + test/turbo-zeropilot.tzx \ + test/writeprotected.mdr CLEANFILES += \ test/.libs/test \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2008-11-18 03:41:18
|
Revision: 3833 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3833&view=rev Author: fredm Date: 2008-11-18 03:41:14 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Update version number for 0.5.0 release. Modified Paths: -------------- trunk/libspectrum/configure.in trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/configure.in =================================================================== --- trunk/libspectrum/configure.in 2008-11-18 03:38:51 UTC (rev 3832) +++ trunk/libspectrum/configure.in 2008-11-18 03:41:14 UTC (rev 3833) @@ -25,7 +25,7 @@ AM_CONFIG_HEADER(config.h) dnl Use automake to produce `Makefile.in' -AM_INIT_AUTOMAKE(libspectrum, 0.4.0) +AM_INIT_AUTOMAKE(libspectrum, 0.5.0) dnl Checks for programs. AC_PROG_CC Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-11-18 03:38:51 UTC (rev 3832) +++ trunk/libspectrum/hacking/ChangeLog 2008-11-18 03:41:14 UTC (rev 3833) @@ -698,3 +698,4 @@ 20081109 doc/cvs-tags: document 0.5.0 branch tag. 20081118 test/Makefile.am: distribute empty.z80 and writeprotected.mdr test data files (Fred). +20070411 configure.in: update version number for 0.5.0 release (Fred). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2008-11-18 04:24:08
|
Revision: 3835 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3835&view=rev Author: fredm Date: 2008-11-18 04:24:03 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Back out version number change, this will be merged from the release branch down the track. Modified Paths: -------------- trunk/libspectrum/configure.in trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/configure.in =================================================================== --- trunk/libspectrum/configure.in 2008-11-18 04:17:15 UTC (rev 3834) +++ trunk/libspectrum/configure.in 2008-11-18 04:24:03 UTC (rev 3835) @@ -25,7 +25,7 @@ AM_CONFIG_HEADER(config.h) dnl Use automake to produce `Makefile.in' -AM_INIT_AUTOMAKE(libspectrum, 0.5.0) +AM_INIT_AUTOMAKE(libspectrum, 0.4.0) dnl Checks for programs. AC_PROG_CC Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-11-18 04:17:15 UTC (rev 3834) +++ trunk/libspectrum/hacking/ChangeLog 2008-11-18 04:24:03 UTC (rev 3835) @@ -698,4 +698,3 @@ 20081109 doc/cvs-tags: document 0.5.0 branch tag. 20081118 test/Makefile.am: distribute empty.z80 and writeprotected.mdr test data files (Fred). -20070411 configure.in: update version number for 0.5.0 release (Fred). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2008-11-18 04:54:32
|
Revision: 3837 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3837&view=rev Author: fredm Date: 2008-11-18 04:54:27 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Set glib status off if we can't find it (thanks, Chris Young). Modified Paths: -------------- trunk/libspectrum/configure.in trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/configure.in =================================================================== --- trunk/libspectrum/configure.in 2008-11-18 04:24:34 UTC (rev 3836) +++ trunk/libspectrum/configure.in 2008-11-18 04:54:27 UTC (rev 3837) @@ -108,6 +108,7 @@ 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 Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-11-18 04:24:34 UTC (rev 3836) +++ trunk/libspectrum/hacking/ChangeLog 2008-11-18 04:54:27 UTC (rev 3837) @@ -698,3 +698,5 @@ 20081109 doc/cvs-tags: document 0.5.0 branch tag. 20081118 test/Makefile.am: distribute empty.z80 and writeprotected.mdr test data files (Fred). +20081118 configure.in: set glib status off if we can't find it (thanks, Chris + Young) (Fred). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2008-11-29 02:08:40
|
Revision: 3854 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3854&view=rev Author: fredm Date: 2008-11-29 02:08:34 +0000 (Sat, 29 Nov 2008) Log Message: ----------- Correct first contended tstate for TS2068 based on updated fusetest from Phil. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/timings.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-11-28 09:52:36 UTC (rev 3853) +++ trunk/libspectrum/hacking/ChangeLog 2008-11-29 02:08:34 UTC (rev 3854) @@ -700,3 +700,5 @@ data files (Fred). 20081118 configure.in: set glib status off if we can't find it (thanks, Chris Young) (Fred). +20081129 timings.c: correct first contended tstate for TS2068 based on updated + fusetest from Phil (Fred). Modified: trunk/libspectrum/timings.c =================================================================== --- trunk/libspectrum/timings.c 2008-11-28 09:52:36 UTC (rev 3853) +++ trunk/libspectrum/timings.c 2008-11-29 02:08:34 UTC (rev 3854) @@ -86,7 +86,7 @@ /* SE */ { 3500000, 1750000, 24, 128, 24, 48, 47, 192, 48, 25, 32, 14336 }, /* TS2068 */ - { 3528000, 1764000, 24, 128, 24, 48, 24, 192, 25, 21, 32, 9184 }, + { 3528000, 1764000, 24, 128, 24, 48, 24, 192, 25, 21, 32, 9169 }, /* Pentagon 512K */ { 3584000, 1792000, 36, 128, 28, 32, 64, 192, 48, 16, 36, 17988 }, /* Pentagon 1024K */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-12-03 22:33:45
|
Revision: 3871 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3871&view=rev Author: pak21 Date: 2008-12-03 22:33:41 +0000 (Wed, 03 Dec 2008) Log Message: ----------- Merge libspectrum_0_5_0-branch changes onto trunk. Modified Paths: -------------- trunk/libspectrum/ChangeLog trunk/libspectrum/Makefile.am trunk/libspectrum/README trunk/libspectrum/configure.in trunk/libspectrum/doc/libspectrum.3 trunk/libspectrum/doc/libspectrum.txt trunk/libspectrum/hacking/ChangeLog Property Changed: ---------------- trunk/libspectrum/ Property changes on: trunk/libspectrum ___________________________________________________________________ Added: svn:mergeinfo + /branches/libspectrum_0_5_0-branch:3809-3870 Modified: trunk/libspectrum/ChangeLog =================================================================== --- trunk/libspectrum/ChangeLog 2008-12-03 19:39:25 UTC (rev 3870) +++ trunk/libspectrum/ChangeLog 2008-12-03 22:33:41 UTC (rev 3871) @@ -42,6 +42,8 @@ * Remove deprecated functions (Fredrick Meunier). + * Tweak timings for TS2068 (Fredrick Meunier; thanks Philip Kendall). + 2008-01-05 Philip Kendall <phi...@sh...> * libspectrum 0.4.0 released. Modified: trunk/libspectrum/Makefile.am =================================================================== --- trunk/libspectrum/Makefile.am 2008-12-03 19:39:25 UTC (rev 3870) +++ trunk/libspectrum/Makefile.am 2008-12-03 22:33:41 UTC (rev 3871) @@ -58,7 +58,7 @@ zlib.c \ zxs.c -libspectrum_la_LDFLAGS = -version-info 6:0:1 -no-undefined +libspectrum_la_LDFLAGS = -version-info 7:0:0 -no-undefined libspectrum_la_LIBADD = @AUDIOFILE_LIBS@ -lm Modified: trunk/libspectrum/README =================================================================== --- trunk/libspectrum/README 2008-12-03 19:39:25 UTC (rev 3870) +++ trunk/libspectrum/README 2008-12-03 22:33:41 UTC (rev 3871) @@ -1,4 +1,4 @@ -libspectrum 0.4.0 +libspectrum 0.5.0 ================= libspectrum is a library which is designed to make the input and @@ -13,6 +13,8 @@ * Tape images: .tzx, .tap, .spc, .sta and .ltp (read/write) and 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). * Timex cartridges: .dck (read only). * IDE hard disk images: .hdf (read/write). * Microdrive cartridge images: .mdr (read/write). @@ -50,6 +52,6 @@ running 'configure' for the first time. Philip Kendall <phi...@sh...> -5 January 2008 +3 December 2008 $Id$ Modified: trunk/libspectrum/configure.in =================================================================== --- trunk/libspectrum/configure.in 2008-12-03 19:39:25 UTC (rev 3870) +++ trunk/libspectrum/configure.in 2008-12-03 22:33:41 UTC (rev 3871) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl Copyright (c) 1999-2004 Philip Kendall +dnl Copyright (c) 1999-2008 Philip Kendall dnl $Id$ @@ -25,7 +25,7 @@ AM_CONFIG_HEADER(config.h) dnl Use automake to produce `Makefile.in' -AM_INIT_AUTOMAKE(libspectrum, 0.4.0) +AM_INIT_AUTOMAKE(libspectrum, 0.5.0) dnl Checks for programs. AC_PROG_CC Modified: trunk/libspectrum/doc/libspectrum.3 =================================================================== --- trunk/libspectrum/doc/libspectrum.3 2008-12-03 19:39:25 UTC (rev 3870) +++ trunk/libspectrum/doc/libspectrum.3 2008-12-03 22:33:41 UTC (rev 3871) @@ -1,7 +1,7 @@ .\" -*- nroff -*- .\" .\" libspectrum.3: libspectrum summary -.\" Copyright (c) 2004-2007 Philip Kendall +.\" Copyright (c) 2004-2008 Philip Kendall .\" .\" 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 @@ -22,7 +22,7 @@ .\" E-mail: phi...@sh... .\" .\" -.TH libspectrum 3 "5th January, 2008" "Version 0.4.0" "Emulators" +.TH libspectrum 3 "3rd December, 2008" "Version 0.5.0" "Emulators" .\" .\"------------------------------------------------------------------ .\" @@ -50,6 +50,9 @@ .IP \(bu 2 Input recordings: .rzx (read/write). .IP \(bu 2 +Disk images: .dsk (both plain and extended), .fdi, .sad, .scl, .td0, .trd +and .udi (identification only). +.IP \(bu 2 Timex cartridges: .dck (read only). .IP \(bu 2 IDE hard disk images: .hdf (read/write). Modified: trunk/libspectrum/doc/libspectrum.txt =================================================================== --- trunk/libspectrum/doc/libspectrum.txt 2008-12-03 19:39:25 UTC (rev 3870) +++ trunk/libspectrum/doc/libspectrum.txt 2008-12-03 22:33:41 UTC (rev 3871) @@ -1,4 +1,4 @@ -libspectrum 0.4.0 +libspectrum 0.5.0 ================= libspectrum is a fairly simple library designed to make the handling @@ -213,6 +213,12 @@ LIBSPECTRUM_MACHINE_CAPABILITY_NTSC This machine has an NTSC video output. +LIBSPECTRUM_MACHINE_CAPABILITY_PENT1024_MEMORY + This machine has 1024K of memory accessible as on the Pentagon 1024. + +LIBSPECTRUM_MACHINE_CAPABILITY_PENT512_MEMORY + This machine has 512K of memory accessible as on the Pentagon 512. + LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_MEMORY This machine can change into all-RAM configurations as the +2A/+3. @@ -1254,11 +1260,11 @@ automatically and transparently decompressed. libspectrum_error -libspectrum_rzx_write2( libspectrum_byte **buffer, size_t *length, - libspectrum_rzx *rzx, - libspectrum_byte *snap, libspectrum_id_t snap_format, - libspectrum_creator *creator, - int compress, libspectrum_rzx_dsa_key *key ) +libspectrum_rzx_write( libspectrum_byte **buffer, size_t *length, + libspectrum_rzx *rzx, + libspectrum_byte *snap, libspectrum_id_t snap_format, + libspectrum_creator *creator, + int compress, libspectrum_rzx_dsa_key *key ) Given input recording data in `rzx' and a snapshot in `snap', create a .rzx file in `*buffer'. If no embedded snapshot is required, set Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-12-03 19:39:25 UTC (rev 3870) +++ trunk/libspectrum/hacking/ChangeLog 2008-12-03 22:33:41 UTC (rev 3871) @@ -696,9 +696,19 @@ identification of more disk images (part of patch #2233744) (Gergely Szasz). 20081109 doc/cvs-tags: document 0.5.0 branch tag. +20081110 doc/libspectrum.txt: minor documentation updates + (libspectrum_0_5_0-branch). +20081117 configure.in: bump version number for 0.5.0-pre1 release + (libspectrum_0_5_0-branch). 20081118 test/Makefile.am: distribute empty.z80 and writeprotected.mdr test data files (Fred). 20081118 configure.in: set glib status off if we can't find it (thanks, Chris Young) (Fred). 20081129 timings.c: correct first contended tstate for TS2068 based on updated fusetest from Phil (Fred). +20081129 configure.in,doc/libspectrum.{3,txt},hacking/ChangeLog,Makefile.am, + README: final tweaks for 0.5.0 release (libspectrum_0_5_0-branch). +20081130 ChangeLog: add reference to TS2068 timing update + (libspectrum_0_5_0-branch) (Fred). +20081203 ChangeLog,Makefile.am,README,doc/libspectrum.{3,txt},hacking/ChangeLog, + configure.in: merge libspectrum_0_5_0-branch changes onto trunk. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-12-04 10:36:46
|
Revision: 3880 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3880&view=rev Author: pak21 Date: 2008-12-04 10:36:45 +0000 (Thu, 04 Dec 2008) Log Message: ----------- Merge tag documentation from branch. Modified Paths: -------------- trunk/libspectrum/doc/cvs-tags Property Changed: ---------------- trunk/libspectrum/ Property changes on: trunk/libspectrum ___________________________________________________________________ Modified: svn:mergeinfo - /branches/libspectrum_0_5_0-branch:3809-3870 + /branches/libspectrum_0_5_0-branch:3809-3879 Modified: trunk/libspectrum/doc/cvs-tags =================================================================== --- trunk/libspectrum/doc/cvs-tags 2008-12-04 10:35:35 UTC (rev 3879) +++ trunk/libspectrum/doc/cvs-tags 2008-12-04 10:36:45 UTC (rev 3880) @@ -68,6 +68,9 @@ | | libspectrum_0_4_0-branch | +-\ +| | libspectrum_0_5_0-pre1 +| | libspectrum_0_5_0 +| | | | libspectrum_0_5_0-branch | HEAD This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2008-12-14 19:46:26
|
Revision: 3905 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3905&view=rev Author: pak21 Date: 2008-12-14 19:46:23 +0000 (Sun, 14 Dec 2008) Log Message: ----------- Loosen signature checks for .dsk files (Gergely Szasz; thanks, zx81 and Simon Owen). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2008-12-10 22:28:01 UTC (rev 3904) +++ trunk/libspectrum/hacking/ChangeLog 2008-12-14 19:46:23 UTC (rev 3905) @@ -712,3 +712,5 @@ (libspectrum_0_5_0-branch) (Fred). 20081203 ChangeLog,Makefile.am,README,doc/libspectrum.{3,txt},hacking/ChangeLog, configure.in: merge libspectrum_0_5_0-branch changes onto trunk. +20081214 libspectrum.c: loosen signature checks for .dsk files (Gergely; + thanks, zx81 and Simon Owen). Modified: trunk/libspectrum/libspectrum.c =================================================================== --- trunk/libspectrum/libspectrum.c 2008-12-10 22:28:01 UTC (rev 3904) +++ trunk/libspectrum/libspectrum.c 2008-12-14 19:46:23 UTC (rev 3905) @@ -540,8 +540,8 @@ { LIBSPECTRUM_ID_DISK_IMG, "img", 3, NULL, 0, 0, 0 }, { LIBSPECTRUM_ID_DISK_UDI, "udi", 3, "UDI!", 0, 4, 4 }, - { LIBSPECTRUM_ID_DISK_ECPC, "dsk", 3, "EXTENDED CPC DSK File\r\nDisk-Info\r\n", 0, 34, 4 }, - { LIBSPECTRUM_ID_DISK_CPC, "dsk", 3, "MV - CPCEMU Disk-File\r\nDisk-Info\r\n", 0, 34, 4 }, + { LIBSPECTRUM_ID_DISK_ECPC, "dsk", 3, "EXTENDED", 0, 8, 4 }, + { LIBSPECTRUM_ID_DISK_CPC, "dsk", 3, "MV - CPC", 0, 8, 4 }, { LIBSPECTRUM_ID_DISK_FDI, "fdi", 3, "FDI", 0, 3, 4 }, { LIBSPECTRUM_ID_DISK_SAD, "sad", 3, "Aley's disk backup", 0, 18, 4 }, { LIBSPECTRUM_ID_DISK_TD0, "td0", 3, "TD", 0, 2, 4 }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2009-01-11 14:35:49
|
Revision: 3947 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3947&view=rev Author: pak21 Date: 2009-01-11 14:35:45 +0000 (Sun, 11 Jan 2009) Log Message: ----------- Merge Wii port information across. Modified Paths: -------------- trunk/libspectrum/AUTHORS trunk/libspectrum/README Property Changed: ---------------- trunk/libspectrum/ Property changes on: trunk/libspectrum ___________________________________________________________________ Modified: svn:mergeinfo - /branches/libspectrum_0_5_0-branch:3809-3879 + /branches/libspectrum_0_5_0-branch:3809-3879 /branches/wii-20080828/libspectrum:3757-3946 Modified: trunk/libspectrum/AUTHORS =================================================================== --- trunk/libspectrum/AUTHORS 2009-01-10 21:09:25 UTC (rev 3946) +++ trunk/libspectrum/AUTHORS 2009-01-11 14:35:45 UTC (rev 3947) @@ -2,6 +2,8 @@ * Stuart Brady: Scorpion ZS 256 support. +* Bjoern Giesler: Wii port + * Garry Lancaster: IDE hard disk image support. * Fredrick Meunier: Spectrum SE support and more. Modified: trunk/libspectrum/README =================================================================== --- trunk/libspectrum/README 2009-01-10 21:09:25 UTC (rev 3946) +++ trunk/libspectrum/README 2009-01-11 14:35:45 UTC (rev 3947) @@ -51,6 +51,21 @@ of the released tarballs, you'll need to run `autogen.sh' before running 'configure' for the first time. +Compiling for the Wii +--------------------- + +To compile for the Wii, first make sure the dev tools are in your path +(export PATH=$PATH:$DEVKITPPC/bin). Then, use this configure line: + +./configure --target=powerpc-gekko --host=powerpc-gekko \ + --prefix=$DEVKITPPC \ + --without-gcrypt --without-glib --without-libaudiofile + +That is assuming you don't have gcrypt, glib and libaudiofile for the +Wii. At the time of writing, those haven't been ported yet. + +Then, type "make" and if everything went well, "make install". + Philip Kendall <phi...@sh...> 3 December 2008 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2009-01-28 12:52:36
|
Revision: 3977 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3977&view=rev Author: fredm Date: 2009-01-28 12:52:31 +0000 (Wed, 28 Jan 2009) Log Message: ----------- Add --without-(bzip2 /zlib) for gentoo and similar distros (patch #2533274) (Jos?\195?\169 Manuel Ferrer Ortiz). Modified Paths: -------------- trunk/libspectrum/configure.in trunk/libspectrum/hacking/ChangeLog Modified: trunk/libspectrum/configure.in =================================================================== --- trunk/libspectrum/configure.in 2009-01-26 18:06:13 UTC (rev 3976) +++ trunk/libspectrum/configure.in 2009-01-28 12:52:31 UTC (rev 3977) @@ -65,11 +65,19 @@ CPPFLAGS="$CPPFLAGS -I$prefix/include"; LDFLAGS="$LDFLAGS -L$prefix/lib" fi) -dnl Check for zlib (the UNIX version is called z, Win32 zdll) -AC_CHECK_HEADERS( - zlib.h, - AC_SEARCH_LIBS(compress2, z zdll) -) +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) @@ -82,11 +90,19 @@ AC_CHECK_HEADERS(gcrypt.h,LIBS="$LIBS -lgcrypt") fi -dnl Check for libbz2 1.0 or greater -AC_CHECK_HEADER( - bzlib.h, - AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) -) +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) Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2009-01-26 18:06:13 UTC (rev 3976) +++ trunk/libspectrum/hacking/ChangeLog 2009-01-28 12:52:31 UTC (rev 3977) @@ -714,3 +714,5 @@ configure.in: merge libspectrum_0_5_0-branch changes onto trunk. 20081214 libspectrum.c: loosen signature checks for .dsk files (Gergely; thanks, zx81 and Simon Owen). +20090128 configure.in: add --without-(bzip2 /zlib) for gentoo and similar + distros (patch #2533274) (José Manuel Ferrer Ortiz). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2009-04-11 20:30:36
|
Revision: 3998 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=3998&view=rev Author: pak21 Date: 2009-04-11 20:30:33 +0000 (Sat, 11 Apr 2009) Log Message: ----------- Export new end of tape flag. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum.h.in Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2009-04-11 08:32:14 UTC (rev 3997) +++ trunk/libspectrum/hacking/ChangeLog 2009-04-11 20:30:33 UTC (rev 3998) @@ -718,3 +718,4 @@ distros (patch #2533274) (José Manuel Ferrer Ortiz). 20090411 doc/libspectrum.txt,tape.c: add a new tape flag for end of tape (part of fixes for bug #2743838) (Fred). +20090411 libspectrum.h.in: export new end of tape flag. Modified: trunk/libspectrum/libspectrum.h.in =================================================================== --- trunk/libspectrum/libspectrum.h.in 2009-04-11 08:32:14 UTC (rev 3997) +++ trunk/libspectrum/libspectrum.h.in 2009-04-11 20:30:33 UTC (rev 3998) @@ -526,6 +526,7 @@ extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */ extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT; extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG; +extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_TAPE; /* Tape has finished */ /* The states which a block can be in */ typedef enum libspectrum_tape_state_type { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2009-05-09 14:07:07
|
Revision: 4018 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4018&view=rev Author: fredm Date: 2009-05-09 14:06:50 +0000 (Sat, 09 May 2009) Log Message: ----------- Handle querying the block length for turbo and pure data blocks with 0 length. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/tape_block.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2009-05-09 12:09:33 UTC (rev 4017) +++ trunk/libspectrum/hacking/ChangeLog 2009-05-09 14:06:50 UTC (rev 4018) @@ -719,3 +719,5 @@ 20090411 doc/libspectrum.txt,tape.c: add a new tape flag for end of tape (part of fixes for bug #2743838) (Fred). 20090411 libspectrum.h.in: export new end of tape flag. +20090509 tape_block.c: handle querying the block length for turbo and pure data + blocks with 0 length (Fred). Modified: trunk/libspectrum/tape_block.c =================================================================== --- trunk/libspectrum/tape_block.c 2009-05-09 12:09:33 UTC (rev 4017) +++ trunk/libspectrum/tape_block.c 2009-05-09 14:06:50 UTC (rev 4018) @@ -517,24 +517,26 @@ turbo->sync1_length + turbo->sync2_length + convert_ms_to_tstates( turbo->pause ); size_t i; - int bits_set_in_last_byte = - libspectrum_bits_set_n_bits( turbo->data[ turbo->length-1 ], - turbo->bits_in_last_byte ); + if( turbo->length ) { + int bits_set_in_last_byte = + libspectrum_bits_set_n_bits( turbo->data[ turbo->length-1 ], + turbo->bits_in_last_byte ); - for( i = 0; i < turbo->length-1; i++ ) { - libspectrum_byte data = turbo->data[ i ]; + for( i = 0; i < turbo->length-1; i++ ) { + libspectrum_byte data = turbo->data[ i ]; + length += convert_pulses_to_tstates( turbo->bit1_length, + turbo->bit0_length, + bits_set[ data ], + LIBSPECTRUM_BITS_IN_BYTE ); + } + + /* handle bits in last byte correctly */ length += convert_pulses_to_tstates( turbo->bit1_length, turbo->bit0_length, - bits_set[ data ], - LIBSPECTRUM_BITS_IN_BYTE ); + bits_set_in_last_byte, + turbo->bits_in_last_byte ); } - /* handle bits in last byte correctly */ - length += convert_pulses_to_tstates( turbo->bit1_length, - turbo->bit0_length, - bits_set_in_last_byte, - turbo->bits_in_last_byte ); - return length; } @@ -554,23 +556,25 @@ { libspectrum_dword length = convert_ms_to_tstates( pure_data->pause ); size_t i; - int bits_set_in_last_byte = - libspectrum_bits_set_n_bits( pure_data->data[ pure_data->length-1 ], - pure_data->bits_in_last_byte ); + if( pure_data->length ) { + int bits_set_in_last_byte = + libspectrum_bits_set_n_bits( pure_data->data[ pure_data->length-1 ], + pure_data->bits_in_last_byte ); - for( i = 0; i < pure_data->length-1; i++ ) { - libspectrum_byte data = pure_data->data[ i ]; + for( i = 0; i < pure_data->length-1; i++ ) { + libspectrum_byte data = pure_data->data[ i ]; + length += convert_pulses_to_tstates( pure_data->bit1_length, + pure_data->bit0_length, + bits_set[ data ], + LIBSPECTRUM_BITS_IN_BYTE ); + } + + /* handle bits in last byte correctly */ length += convert_pulses_to_tstates( pure_data->bit1_length, pure_data->bit0_length, - bits_set[ data ], - LIBSPECTRUM_BITS_IN_BYTE ); + bits_set_in_last_byte, + pure_data->bits_in_last_byte ); } - - /* handle bits in last byte correctly */ - length += convert_pulses_to_tstates( pure_data->bit1_length, - pure_data->bit0_length, - bits_set_in_last_byte, - pure_data->bits_in_last_byte ); return length; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2009-06-11 12:58:31
|
Revision: 4034 http://fuse-emulator.svn.sourceforge.net/fuse-emulator/?rev=4034&view=rev Author: fredm Date: 2009-06-11 12:58:26 +0000 (Thu, 11 Jun 2009) Log Message: ----------- Note info loss of Fuller or Melodik info when writing sna format snapshots. Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/sna.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2009-06-11 09:54:35 UTC (rev 4033) +++ trunk/libspectrum/hacking/ChangeLog 2009-06-11 12:58:26 UTC (rev 4034) @@ -727,3 +727,5 @@ 20090610 accessor.pl,doc/libspectrum.txt,libspectrum.c,snap_accessors.txt, snapshot.c,szx.c,z80.c: add support for the Melodik and similar AY interfaces (feature request #1841501) (Fred). +20090611 sna.c: note info loss of Fuller or Melodik info when writing sna + format snapshots (Fred). Modified: trunk/libspectrum/sna.c =================================================================== --- trunk/libspectrum/sna.c 2009-06-11 09:54:35 UTC (rev 4033) +++ trunk/libspectrum/sna.c 2009-06-11 12:58:26 UTC (rev 4034) @@ -318,6 +318,11 @@ if( libspectrum_snap_custom_rom( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + /* We don't save AY interfaces at all */ + if( libspectrum_snap_fuller_box_active( snap ) || + libspectrum_snap_melodik_active( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + ptr = *buffer; write_header( buffer, &ptr, length, snap ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |