From 66856363ddfab0d7dab60382866d1fd6194ad154 Mon Sep 17 00:00:00 2001 From: Mark Garlanger Date: Sat, 17 Feb 2024 11:08:32 -0600 Subject: [PATCH] heathkit/h89.cpp: Add a software list for H88 cassettes. (#12019) New working software list items (h88_cass.xml) ------------------------ BUG-8 02.05.00 [Society of Eight-Bit Heathkit Computerists] BUG-8 02.06.00 [Society of Eight-Bit Heathkit Computerists] Extended Benton Harbor Basic 10.05.00 [Society of Eight-Bit Heathkit Computerists] Extended Benton Harbor Basic 10.05.01 [Society of Eight-Bit Heathkit Computerists] Extended Benton Harbor Basic 10.06.00 [Society of Eight-Bit Heathkit Computerists] Heath H8 Assembler 04.05.00 [Society of Eight-Bit Heathkit Computerists] Heath H8 Assembler 04.06.00 [Society of Eight-Bit Heathkit Computerists] Heath/Wintek H8 Editor 03.05.00 [Society of Eight-Bit Heathkit Computerists] Heath/Wintek H8 Editor 03.06.00 [Society of Eight-Bit Heathkit Computerists] --- hash/h88_cass.xml | 161 ++++++++++++++++++++++++++++++++ src/lib/formats/h8_cas.cpp | 71 +++++++------- src/mame/heathkit/h89.cpp | 3 + src/mame/heathkit/h_88_cass.cpp | 4 +- 4 files changed, 204 insertions(+), 35 deletions(-) create mode 100644 hash/h88_cass.xml diff --git a/hash/h88_cass.xml b/hash/h88_cass.xml new file mode 100644 index 00000000000..25dd090a262 --- /dev/null +++ b/hash/h88_cass.xml @@ -0,0 +1,161 @@ + + + + + + + BUG-8 02.05.00 + 1978 + Heath Corp. + + + + + + + + + + + + + + + BUG-8 02.06.00 + 1978 + Heath Corp. + + + + + + + + + + + + + + + Extended Benton Harbor Basic 10.05.00 + 1978 + Heath Corp. + + + + + + + + + + + + + + + Extended Benton Harbor Basic 10.05.01 + 1978 + Heath Corp. + + + + + + + + + + + + + + + Extended Benton Harbor Basic 10.06.00 + 1979 + Heath Corp. + + + + + + + + + + + + + + + Heath H8 Assembler 04.05.00 + 1978 + Heath Corp. + + + + + + + + + + + + + + + Heath H8 Assembler 04.06.00 + 1979 + Heath Corp. + + + + + + + + + + + + + + + Heath/Wintek H8 Editor 03.05.00 + 1979 + Heath Corp. + + + + + + + + + + + + + + + Heath/Wintek H8 Editor 03.06.00 + 1979 + Heath Corp. + + + + + + + + + + + + + + diff --git a/src/lib/formats/h8_cas.cpp b/src/lib/formats/h8_cas.cpp index c0d5d6dd925..e1eabf7baf2 100644 --- a/src/lib/formats/h8_cas.cpp +++ b/src/lib/formats/h8_cas.cpp @@ -7,16 +7,31 @@ Support for Heathkit H8 H8T cassette images Standard Kansas City format (300 baud) +TODO - investigate 1200 buad support, H8 should support it, but H88 does not. + We output a leader, followed by the contents of the H8T file. ********************************************************************/ #include "h8_cas.h" -#define WAVEENTRY_LOW -32768 -#define WAVEENTRY_HIGH 32767 +#include -#define H8_WAV_FREQUENCY 9600 + +static constexpr uint16_t WAVEENTRY_LOW = -32768; +static constexpr uint16_t WAVEENTRY_HIGH = 32767; +static constexpr uint16_t SILENCE = 0; + +// using a multiple of 4800 will ensure an integer multiple of samples for each wave. +static constexpr uint16_t H8_WAV_FREQUENCY = 9600; +static constexpr uint16_t TAPE_BAUD_RATE = 300; +static constexpr uint16_t SAMPLES_PER_BIT = H8_WAV_FREQUENCY / TAPE_BAUD_RATE; +static constexpr uint16_t SAMPLES_PER_HALF_WAVE = SAMPLES_PER_BIT / 2; + +static constexpr uint16_t ONE_FREQ = 1200; +static constexpr uint16_t ZERO_FREQ = 2400; +static constexpr uint16_t ONE_CYCLES = H8_WAV_FREQUENCY / ONE_FREQ; +static constexpr uint16_t ZERO_CYCLES = H8_WAV_FREQUENCY / ZERO_FREQ; // image size static int h8_image_size; // FIXME: global variable prevents multiple instances @@ -25,8 +40,7 @@ static int h8_put_samples(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { - for (int i=0; i> i) & 1); + for (int i = 0; i < 8; i++) + { + samples += h8_output_bit(buffer, sample_pos + samples, data & 1); + data >>= 1; + } - // stop bits - for (i = 0; i<2; i++) - samples += h8_output_bit (buffer, sample_pos + samples, 1); + // stop bit + 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; + int sample_count = 0; - - // leader - for (i=0; i<2000; i++) + // leader - 1 second + for (int i = 0; i < TAPE_BAUD_RATE; i++) sample_count += h8_output_bit(buffer, sample_count, 1); // data - for (i=byte_count; iset_default_option("original"); m_intr_socket->set_fixed(true); + SOFTWARE_LIST(config, "cass_list").set_original("h88_cass"); + // H-88-5 Cassette interface board HEATH_H88_CASS(config, m_cassette, H89_CLOCK); } diff --git a/src/mame/heathkit/h_88_cass.cpp b/src/mame/heathkit/h_88_cass.cpp index 5f09426f964..7c4e49dee04 100644 --- a/src/mame/heathkit/h_88_cass.cpp +++ b/src/mame/heathkit/h_88_cass.cpp @@ -153,13 +153,13 @@ void heath_h_88_cass_device::device_add_mconfig(machine_config &config) m_cass_player->set_formats(h8_cassette_formats); m_cass_player->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); m_cass_player->add_route(ALL_OUTPUTS, "mono", 0.15); - m_cass_player->set_interface("h89_cass_player"); + m_cass_player->set_interface("h88_cass_player"); CASSETTE(config, m_cass_recorder); m_cass_recorder->set_formats(h8_cassette_formats); m_cass_recorder->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); m_cass_recorder->add_route(ALL_OUTPUTS, "mono", 0.15); - m_cass_recorder->set_interface("h89_cass_recorder"); + m_cass_recorder->set_interface("h88_cass_recorder"); TIMER(config, "kansas_w").configure_periodic(FUNC(heath_h_88_cass_device::kansas_w), attotime::from_hz(4800)); TIMER(config, "kansas_r").configure_periodic(FUNC(heath_h_88_cass_device::kansas_r), attotime::from_hz(40000));