From: <fr...@us...> - 2016-04-27 11:46:06
|
Revision: 5411 http://sourceforge.net/p/fuse-emulator/code/5411 Author: fredm Date: 2016-04-27 11:46:03 +0000 (Wed, 27 Apr 2016) Log Message: ----------- Fix bugs handling TZX generalised data blocks with empty symbol tables (e.g. ZX81 tapes encoded as in the TZX 1.20 specification) (Andre Leiradella). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/tape_block.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2016-04-27 11:19:56 UTC (rev 5410) +++ trunk/libspectrum/hacking/ChangeLog 2016-04-27 11:46:03 UTC (rev 5411) @@ -1033,3 +1033,6 @@ 20160424 ChangeLog,README,configure.ac,doc/libspectrum.{3,txt}, hacking/ChangeLog: merge libspectrum_1_1_0-branch changes onto trunk (Fred). +20160427 tape_block.c: fix bugs handling TZX generalised data blocks with empty + symbol tables (e.g. ZX81 tapes encoded as in the TZX 1.20 + specification) (Andre Leiradella). Modified: trunk/libspectrum/tape_block.c =================================================================== --- trunk/libspectrum/tape_block.c 2016-04-27 11:19:56 UTC (rev 5410) +++ trunk/libspectrum/tape_block.c 2016-04-27 11:46:03 UTC (rev 5411) @@ -348,12 +348,20 @@ generalised_data_init( libspectrum_tape_generalised_data_block *block, libspectrum_tape_generalised_data_block_state *state ) { - state->state = LIBSPECTRUM_TAPE_STATE_PILOT; + state->state = block->pilot_table.symbols_in_block ? + LIBSPECTRUM_TAPE_STATE_PILOT : LIBSPECTRUM_TAPE_STATE_DATA1; state->run = 0; state->symbols_through_run = 0; state->edges_through_symbol = 0; + state->current_symbol = 0; + state->symbols_through_stream = 0; + + state->current_byte = 0; + state->bits_through_byte = 0; + state->bytes_through_stream = 0; + return LIBSPECTRUM_ERROR_NONE; } @@ -447,7 +455,8 @@ table->max_pulses = (*ptr)[0]; table->symbols_in_table = (*ptr)[1]; - if( !table->symbols_in_table ) table->symbols_in_table = 256; + if( !table->symbols_in_table && table->symbols_in_block ) + table->symbols_in_table = 256; (*ptr) += 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |