// license:BSD-3-Clause // copyright-holders:Sandro Ronco /******************************************************************** Support for Canon X-07 cassette images ********************************************************************/ #include "x07_cas.h" #define WAVEENTRY_LOW -32768 #define WAVEENTRY_HIGH 32767 #define X07_WAV_FREQUENCY 4800 #define X07_TIMER_FREQUENCY 1200 #define X07_BIT_LENGTH (X07_WAV_FREQUENCY/X07_TIMER_FREQUENCY) #define X07_HEADER_BYTES 16 // image size static int x07_image_size; static int x07_put_samples(INT16 *buffer, int sample_pos, int count, int level) { if (buffer) { for (int i=0; i>i) & 0x01); /* stop */ samples += x07_output_bit (buffer, sample_pos + samples, 1); samples += x07_output_bit (buffer, sample_pos + samples, 1); samples += x07_output_bit (buffer, sample_pos + samples, 1); return samples; } static int x07_handle_cassette(INT16 *buffer, const UINT8 *bytes) { int sample_count = 0; int img_start = 0; /* start */ for (int i=0; i