formats/cassimg.cpp: Pass byte count to wave fill function for legacy cassette formats. (#13294)

formats/tzx_cass.cpp: Check length of data read for TAP format blocks (fixes MT08952).
This commit is contained in:
holub 2025-04-25 12:50:12 -04:00 committed by GitHub
parent bbb45dfa64
commit 0855e13672
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 84 additions and 94 deletions

View File

@ -120,7 +120,7 @@ static int a26_cas_do_work( int16_t **buffer, const uint8_t *bytes ) {
return size;
}
static int a26_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes ) {
static int a26_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int ) {
int16_t *p = buffer;
return a26_cas_do_work( &p, (const uint8_t *)bytes );

View File

@ -135,7 +135,7 @@ static int ace_handle_tap(int16_t *buffer, const uint8_t *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int ace_tap_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int ace_tap_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return ace_handle_tap( buffer, bytes );
}

View File

@ -152,12 +152,12 @@ static int apf_cpf_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int apf_apt_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int apf_apt_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return apf_apt_handle_cassette(buffer, bytes);
}
static int apf_cpf_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int apf_cpf_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return apf_cpf_handle_cassette(buffer, bytes);
}

View File

@ -179,7 +179,7 @@ static int camplynx_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int camplynx_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int camplynx_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return camplynx_handle_cassette(buffer, bytes);
}

View File

@ -859,7 +859,7 @@ cassette_image::error cassette_image::legacy_construct(const LegacyWaveFiller *l
/* if there has to be a header */
if (args.header_samples > 0)
{
length = args.fill_wave(&samples[pos], sample_count - pos, CODE_HEADER);
length = args.fill_wave(&samples[pos], sample_count - pos, CODE_HEADER, -1);
if (length < 0)
{
err = error::INVALID_IMAGE;
@ -877,20 +877,11 @@ cassette_image::error cassette_image::legacy_construct(const LegacyWaveFiller *l
}
while ((pos < sample_count) && (offset < size))
{
image_read(chunk.get(), offset, args.chunk_size);
offset += args.chunk_size;
const int slice = std::min<int>(args.chunk_size, size - offset);
image_read(chunk.get(), offset, slice);
offset += slice;
/*
This approach is problematic because we don't have control on incomming image size when processing the data
(at least in tap implementation).
The method sending the size of output (calculated in 'chunk_sample_calc' above) which uses same data as a input but
without knowing how much data available in the image. Having wrong header with size bigger than image couses illegal
access beyond image data.
Desired state is:
length = args.fill_wave(&samples[pos], args.chunk_size, chunk.get());
aslo the fix for tap is commented out in 'tap_cas_fill_wave'
*/
length = args.fill_wave(&samples[pos], sample_count - pos, chunk.get());
length = args.fill_wave(&samples[pos], sample_count - pos, chunk.get(), slice);
if (length < 0)
{
err = error::INVALID_IMAGE;
@ -905,7 +896,7 @@ cassette_image::error cassette_image::legacy_construct(const LegacyWaveFiller *l
/* if there has to be a trailer */
if (args.trailer_samples > 0)
{
length = args.fill_wave(&samples[pos], sample_count - pos, CODE_TRAILER);
length = args.fill_wave(&samples[pos], sample_count - pos, CODE_TRAILER, -1);
if (length < 0)
{
err = error::INVALID_IMAGE;

View File

@ -120,7 +120,7 @@ public:
/* code to adapt existing legacy fill_wave functions */
struct LegacyWaveFiller
{
int (*fill_wave)(int16_t *, int, const uint8_t *) = nullptr;
int (*fill_wave)(int16_t *, int, const uint8_t *, int) = nullptr;
int chunk_size = 0;
int chunk_samples = 0;
int (*chunk_sample_calc)(const uint8_t *bytes, int length) = nullptr;

View File

@ -330,7 +330,7 @@ static int cbm_tap_to_wav_size( const uint8_t *tapdata, int taplen )
return size;
}
static int cbm_tap_fill_wave( int16_t *buffer, int length, const uint8_t *bytes )
static int cbm_tap_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int )
{
int16_t *p = buffer;

View File

@ -108,7 +108,7 @@ static int cgenie_handle_cas(int16_t *buffer, const uint8_t *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int cgenie_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int cgenie_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return cgenie_handle_cas(buffer, bytes);
}

View File

@ -104,7 +104,7 @@ static int fc100_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int fc100_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int fc100_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return fc100_handle_cassette(buffer, bytes);
}

View File

@ -72,7 +72,7 @@ static int fm7_cas_to_wav_size (const uint8_t *casdata, int caslen)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int fm7_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int fm7_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return fm7_handle_t77(buffer,bytes);
}

View File

@ -49,7 +49,7 @@ static int fmsx_cas_to_wav_size (const uint8_t *casdata, int caslen)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int fmsx_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int fmsx_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
int cas_pos, bit, state = 1, samples_pos, size, n, i, p;

View File

@ -127,7 +127,7 @@ static int gtp_cas_to_wav_size( const uint8_t *casdata, int caslen ) {
return size;
}
static int gtp_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes ) {
static int gtp_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int ) {
int i,size,n;
size = 0;
n = 0;

View File

@ -203,7 +203,7 @@ static int hector_handle_forth_tap(int16_t *buffer, const uint8_t *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int hector_tap_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int hector_tap_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return hector_handle_tap( buffer, bytes );
}
@ -222,7 +222,7 @@ static int hector_tap_forth_to_wav_size(const uint8_t *casdata, int caslen)
/*******************************************************************
Generate samples for the tape image FORTH
********************************************************************/
static int hector_tap_forth_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int hector_tap_forth_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return hector_handle_forth_tap( buffer, bytes ); //forth removed here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}

View File

@ -232,7 +232,7 @@ static int kc_handle_sss(int16_t *buffer, const uint8_t *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int kc_kcc_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int kc_kcc_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return kc_handle_kcc(buffer, bytes);
}
@ -284,7 +284,7 @@ static const cassette_image::Format kc_kcc_format =
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int kc_tap_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int kc_tap_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return kc_handle_tap(buffer, bytes);
}
@ -336,7 +336,7 @@ static const cassette_image::Format kc_tap_format =
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int kc_sss_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int kc_sss_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return kc_handle_sss(buffer, bytes);
}

View File

@ -145,7 +145,7 @@ static int kim1_handle_kim(int16_t *buffer, const uint8_t *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int kim1_kim_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int kim1_kim_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return kim1_handle_kim( buffer, bytes );
}

View File

@ -71,7 +71,7 @@ static int lviv_cassette_calculate_size_in_samples(const uint8_t *bytes, int len
/*************************************************************************************/
static int lviv_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int lviv_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
int16_t * p = buffer;

View File

@ -209,7 +209,7 @@ static int mbee_handle_tap(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int mbee_tap_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int mbee_tap_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return mbee_handle_tap(buffer, bytes);
}

View File

@ -69,7 +69,7 @@ static int fill_wave_b(int16_t *buffer, int offs, int byte)
return count;
}
static int fill_wave(int16_t *buffer, int length, const uint8_t *code)
static int fill_wave(int16_t *buffer, int length, const uint8_t *code, int)
{
static int16_t *beg;
static uint16_t csum = 0;

View File

@ -62,7 +62,7 @@ static int orao_cas_to_wav_size( const uint8_t *casdata, int caslen ) {
return size;
}
static int orao_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes ) {
static int orao_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int ) {
int i,j,size,k;
uint8_t b;
size = 0;

View File

@ -345,7 +345,7 @@ static int oric_cassette_calculate_size_in_samples(const uint8_t *bytes, int len
}
/* length is length of sample buffer to fill! */
static int oric_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int oric_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
unsigned char header[9];
int16_t *p = buffer;

View File

@ -53,7 +53,7 @@ static int pc6001_cas_to_wav_size (const uint8_t *casdata, int caslen)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int pc6001_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int pc6001_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return pc6001_handle_cas(buffer,bytes);
}

View File

@ -129,7 +129,7 @@ static int phc25_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int phc25_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int phc25_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return phc25_handle_cassette(buffer, bytes);
}

View File

@ -168,7 +168,7 @@ static int pmd85_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int pmd85_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int pmd85_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return pmd85_handle_cassette(buffer, bytes);
}

View File

@ -138,7 +138,7 @@ static int primo_cassette_calculate_size_in_samples(const uint8_t *bytes, int le
return size_in_samples;
}
static int primo_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int primo_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
int i = 0, j = 0, k;

View File

@ -77,7 +77,7 @@ static int gam_cas_to_wav_size( const uint8_t *casdata, int caslen ) {
return (RK_HEADER_LEN * 8 * 2 + caslen * 8 * 2) * RK_SIZE_20;
}
static int rk20_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes ) {
static int rk20_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int ) {
int i;
int16_t * p = buffer;
@ -93,7 +93,7 @@ static int rk20_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes
return p - buffer;
}
static int rk22_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes ) {
static int rk22_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int ) {
int i;
int16_t * p = buffer;
@ -109,7 +109,7 @@ static int rk22_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes
return p - buffer;
}
static int rk60_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes ) {
static int rk60_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int ) {
int i;
int16_t * p = buffer;
@ -125,7 +125,7 @@ static int rk60_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes
return p - buffer;
}
static int gam_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes ) {
static int gam_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int ) {
int i;
int16_t * p = buffer;

View File

@ -335,7 +335,7 @@ static int sol20_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int sol20_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int sol20_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return sol20_handle_cassette(buffer, bytes);
}

View File

@ -107,7 +107,7 @@ static int sorcerer_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int sorcerer_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int sorcerer_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return sorcerer_handle_cassette(buffer, bytes);
}

View File

@ -89,12 +89,12 @@ static int spc1000_handle_cas(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int spc1000_tap_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int spc1000_tap_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return spc1000_handle_tap(buffer, bytes);
}
static int spc1000_cas_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int spc1000_cas_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return spc1000_handle_cas(buffer, bytes);
}

View File

@ -24,7 +24,7 @@ static int cas_size; // FIXME: global variable prevents multiple instances
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int svi_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int svi_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
int cas_pos, samples_pos, n, i;

View File

@ -174,7 +174,7 @@ static int trs80m3_handle_cas(int16_t *buffer, const uint8_t *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int trs80_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int trs80_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
if (cas_size && (bytes[0] == 0x55))
return trs80m3_handle_cas( buffer, bytes );

View File

@ -786,7 +786,7 @@ cleanup:
return -1;
}
static int tzx_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes )
static int tzx_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int )
{
int16_t *p = buffer;
int size = 0;
@ -795,7 +795,7 @@ static int tzx_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes
return size;
}
static int cdt_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes )
static int cdt_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int )
{
int16_t *p = buffer;
int size = 0;
@ -853,26 +853,25 @@ static int tap_cas_to_wav_size(const uint8_t *casdata, int caslen)
return size;
}
static int tap_cas_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int tap_cas_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int bytes_length)
{
int16_t *p = buffer;
int size = 0;
//while (length > 0)
while (size < length)
while (bytes_length > 2)
{
int data_size = get_u16le(&bytes[0]);
bytes += 2;
bytes_length -= 2;
LOG_FORMATS("tap_cas_fill_wave: Handling TAP block containing 0x%X bytes\n", data_size);
if (bytes_length < data_size)
{
data_size = bytes_length; // Take as much as we can.
}
bytes_length -= data_size;
int pilot_length = (bytes[0] == 0x00) ? 8063 : 3223;
LOG_FORMATS("tap_cas_fill_wave: Handling TAP block containing 0x%X bytes\n", data_size);
/*
length -= data_size;
if (length < 0)
{
data_size += length; // Take as much as we can.
}
*/
size += tzx_cas_handle_block(&p, bytes, 1000, data_size, 2168, pilot_length, 667, 735, 855, 1710, 8);
bytes += data_size;
}
@ -881,35 +880,35 @@ static int tap_cas_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static const cassette_image::LegacyWaveFiller tzx_legacy_fill_wave =
{
tzx_cas_fill_wave, /* fill_wave */
-1, /* chunk_size */
0, /* chunk_samples */
tzx_cas_to_wav_size, /* chunk_sample_calc */
TZX_WAV_FREQUENCY, /* sample_frequency */
0, /* header_samples */
0 /* trailer_samples */
tzx_cas_fill_wave, // fill_wave
-1, // chunk_size
0, // chunk_samples
tzx_cas_to_wav_size, // chunk_sample_calc
TZX_WAV_FREQUENCY, // sample_frequency
0, // header_samples
0, // trailer_samples
};
static const cassette_image::LegacyWaveFiller tap_legacy_fill_wave =
{
tap_cas_fill_wave, /* fill_wave */
-1, /* chunk_size */
0, /* chunk_samples */
tap_cas_to_wav_size, /* chunk_sample_calc */
TZX_WAV_FREQUENCY, /* sample_frequency */
0, /* header_samples */
0 /* trailer_samples */
tap_cas_fill_wave, // fill_wave
-1, // chunk_size
0, // chunk_samples
tap_cas_to_wav_size, // chunk_sample_calc
TZX_WAV_FREQUENCY, // sample_frequency
0, // header_samples
0 // trailer_samples
};
static const cassette_image::LegacyWaveFiller cdt_legacy_fill_wave =
{
cdt_cas_fill_wave, /* fill_wave */
-1, /* chunk_size */
0, /* chunk_samples */
tzx_cas_to_wav_size, /* chunk_sample_calc */
TZX_WAV_FREQUENCY, /* sample_frequency */
0, /* header_samples */
0 /* trailer_samples */
cdt_cas_fill_wave, // fill_wave
-1, // chunk_size
0, // chunk_samples
tzx_cas_to_wav_size, // chunk_sample_calc
TZX_WAV_FREQUENCY, // sample_frequency
0, // header_samples
0 // trailer_samples
};
static cassette_image::error tzx_cassette_identify( cassette_image *cassette, cassette_image::Options *opts )

View File

@ -247,7 +247,7 @@ static int16_t* uef_cas_fill_bit( uint8_t loops, int16_t *buffer, bool bit )
return buffer;
}
static int uef_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes )
static int uef_cas_fill_wave( int16_t *buffer, int length, const uint8_t *bytes, int )
{
if ( bytes[0] == 0x1f && bytes[1] == 0x8b ) {
if ( gz_ptr == nullptr ) {

View File

@ -184,7 +184,7 @@ static int vg5k_handle_tap(int16_t *buffer, const uint8_t *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int vg5k_k7_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int vg5k_k7_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return vg5k_handle_tap(buffer, bytes);
}

View File

@ -90,7 +90,7 @@ static int16_t *vtech1_fill_wave_byte(int16_t *buffer, int byte)
return buffer;
}
static int vtech1_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *code)
static int vtech1_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *code, int)
{
return generic_fill_wave(buffer, length, code, V1_BITSAMPLES, V1_BYTESAMPLES, V1_LO, vtech1_fill_wave_byte);
}
@ -185,7 +185,7 @@ static int16_t *vtech2_fill_wave_byte(int16_t *buffer, int byte)
return buffer;
}
static int vtech2_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *code)
static int vtech2_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *code, int)
{
return generic_fill_wave(buffer, length, code, VT2_BITSAMPLES, VT2_BYTESAMPLES, VT2_LO, vtech2_fill_wave_byte);
}

View File

@ -122,7 +122,7 @@ static int x07_handle_cassette(int16_t *buffer, const uint8_t *bytes)
Generate samples for the tape image
********************************************************************/
static int x07_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int x07_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
return x07_handle_cassette(buffer, bytes);
}

View File

@ -101,7 +101,7 @@ static int x1_cas_to_wav_size (const uint8_t *casdata, int caslen)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
static int x1_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes)
static int x1_cas_fill_wave(int16_t *buffer, int sample_count, const uint8_t *bytes, int)
{
return x1_handle_tap(buffer,bytes);
}

View File

@ -173,7 +173,7 @@ static int zx81_cassette_calculate_size_in_samples(const uint8_t *bytes, int len
return (number_of_0_data+number_of_0_name)*ZX81_LOW_BIT_LENGTH + (number_of_1_data+number_of_1_name)*ZX81_HIGH_BIT_LENGTH + ZX81_PILOT_LENGTH;
}
static int zx81_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int zx81_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
int16_t * p = buffer;
int i;
@ -250,7 +250,7 @@ static int zx80_cassette_calculate_size_in_samples(const uint8_t *bytes, int len
return number_of_0_data*ZX81_LOW_BIT_LENGTH + number_of_1_data*ZX81_HIGH_BIT_LENGTH + ZX81_PILOT_LENGTH;
}
static int zx80_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes)
static int zx80_cassette_fill_wave(int16_t *buffer, int length, const uint8_t *bytes, int)
{
int16_t * p = buffer;
int i;