summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/spc1000_cas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats/spc1000_cas.cpp')
-rw-r--r--src/lib/formats/spc1000_cas.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/lib/formats/spc1000_cas.cpp b/src/lib/formats/spc1000_cas.cpp
index d13021b0047..a3830c4a679 100644
--- a/src/lib/formats/spc1000_cas.cpp
+++ b/src/lib/formats/spc1000_cas.cpp
@@ -21,17 +21,16 @@ IPL: This seems a quickload format containing RAM dump, not a real tape
********************************************************************/
-#include <assert.h>
-
#include "spc1000_cas.h"
+
#define WAVEENTRY_LOW -32768
#define WAVEENTRY_HIGH 32767
#define SPC1000_WAV_FREQUENCY 17000
// image size
-static int spc1000_image_size;
+static int spc1000_image_size; // FIXME: global variable prevents multiple instances
static int spc1000_put_samples(int16_t *buffer, int sample_pos, int count, int level)
{
@@ -90,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, 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, 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);
}
@@ -125,7 +124,7 @@ static int spc1000_cas_calculate_size_in_samples(const uint8_t *bytes, int lengt
// TAP
-static const struct CassetteLegacyWaveFiller spc1000_tap_legacy_fill_wave =
+static const cassette_image::LegacyWaveFiller spc1000_tap_legacy_fill_wave =
{
spc1000_tap_fill_wave, /* fill_wave */
-1, /* chunk_size */
@@ -136,17 +135,17 @@ static const struct CassetteLegacyWaveFiller spc1000_tap_legacy_fill_wave =
0 /* trailer_samples */
};
-static cassette_image::error spc1000_tap_cassette_identify(cassette_image *cassette, struct CassetteOptions *opts)
+static cassette_image::error spc1000_tap_cassette_identify(cassette_image *cassette, cassette_image::Options *opts)
{
- return cassette_legacy_identify(cassette, opts, &spc1000_tap_legacy_fill_wave);
+ return cassette->legacy_identify(opts, &spc1000_tap_legacy_fill_wave);
}
static cassette_image::error spc1000_tap_cassette_load(cassette_image *cassette)
{
- return cassette_legacy_construct(cassette, &spc1000_tap_legacy_fill_wave);
+ return cassette->legacy_construct(&spc1000_tap_legacy_fill_wave);
}
-static const struct CassetteFormat spc1000_tap_cassette_image_format =
+static const cassette_image::Format spc1000_tap_cassette_image_format =
{
"tap",
spc1000_tap_cassette_identify,
@@ -156,7 +155,7 @@ static const struct CassetteFormat spc1000_tap_cassette_image_format =
// CAS
-static const struct CassetteLegacyWaveFiller spc1000_cas_legacy_fill_wave =
+static const cassette_image::LegacyWaveFiller spc1000_cas_legacy_fill_wave =
{
spc1000_cas_fill_wave, /* fill_wave */
-1, /* chunk_size */
@@ -167,17 +166,17 @@ static const struct CassetteLegacyWaveFiller spc1000_cas_legacy_fill_wave =
0 /* trailer_samples */
};
-static cassette_image::error spc1000_cas_cassette_identify(cassette_image *cassette, struct CassetteOptions *opts)
+static cassette_image::error spc1000_cas_cassette_identify(cassette_image *cassette, cassette_image::Options *opts)
{
- return cassette_legacy_identify(cassette, opts, &spc1000_cas_legacy_fill_wave);
+ return cassette->legacy_identify(opts, &spc1000_cas_legacy_fill_wave);
}
static cassette_image::error spc1000_cas_cassette_load(cassette_image *cassette)
{
- return cassette_legacy_construct(cassette, &spc1000_cas_legacy_fill_wave);
+ return cassette->legacy_construct(&spc1000_cas_legacy_fill_wave);
}
-static const struct CassetteFormat spc1000_cas_cassette_image_format =
+static const cassette_image::Format spc1000_cas_cassette_image_format =
{
"cas",
spc1000_cas_cassette_identify,