// license:BSD-3-Clause // copyright-holders:Robbbert /******************************************************************** Support for Heathkit H8 H8T cassette images Standard Kansas City format (300 baud) We output a leader, followed by the contents of the H8T file. ********************************************************************/ #include #include "h8_cas.h" #define WAVEENTRY_LOW -32768 #define WAVEENTRY_HIGH 32767 #define H8_WAV_FREQUENCY 9600 // image size static int h8_image_size; static int h8_put_samples(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { for (int i=0; i> i) & 1); // stop bits for (i = 0; i<2; i++) samples += h8_output_bit (buffer, sample_pos + samples, 1); return samples; } static int h8_handle_cassette(int16_t *buffer, const uint8_t *bytes) { uint32_t sample_count = 0; uint32_t byte_count = 0; uint32_t i; // leader for (i=0; i<2000; i++) sample_count += h8_output_bit(buffer, sample_count, 1); // data for (i=byte_count; i