From 7c19aac60e12d6f5ea301bdb34d7826a01e0b06f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 8 Nov 2015 12:56:12 +0100 Subject: Rename *.c -> *.cpp in our source (nw) --- src/lib/formats/fc100_cas.cpp | 156 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 src/lib/formats/fc100_cas.cpp (limited to 'src/lib/formats/fc100_cas.cpp') diff --git a/src/lib/formats/fc100_cas.cpp b/src/lib/formats/fc100_cas.cpp new file mode 100644 index 00000000000..415d3fb01db --- /dev/null +++ b/src/lib/formats/fc100_cas.cpp @@ -0,0 +1,156 @@ +// license:BSD-3-Clause +// copyright-holders:Robbbert +/******************************************************************** + +Support for Goldstar FC-100 cassette images + + +We don't actually have any info on the cassette frequencies, so +it's all a guess. + +********************************************************************/ + +#include + +#include "fc100_cas.h" + +#define WAVEENTRY_LOW -32768 +#define WAVEENTRY_HIGH 32767 + +#define FC100_WAV_FREQUENCY 9600 +#define FC100_HEADER_BYTES 16 + +// image size +static int fc100_image_size; + +static int fc100_put_samples(INT16 *buffer, int sample_pos, int count, int level) +{ + if (buffer) + { + for (int i=0; i> i) & 1); + + /* stop */ + for (i = 0; i<4; i++) + samples += fc100_output_bit (buffer, sample_pos + samples, 1); + + return samples; +} + +static int fc100_handle_cassette(INT16 *buffer, const UINT8 *bytes) +{ + UINT32 sample_count = 0; + UINT32 byte_count = 0; + UINT32 i; + + + /* start */ + for (i=0; i<2155; i++) + sample_count += fc100_output_bit(buffer, sample_count, 1); + + /* header */ + for (int i=0; i