diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp index 959785797a7..d233790e0c3 100644 --- a/src/mame/drivers/super80.cpp +++ b/src/mame/drivers/super80.cpp @@ -678,6 +678,15 @@ static SLOT_INTERFACE_START( super80_floppies ) SLOT_INTERFACE_END +static const char *const relay_sample_names[] = +{ + "*relay", + "relayoff", + "relayon", + nullptr +}; + + static MACHINE_CONFIG_START( super80, super80_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* 2 MHz */ @@ -710,6 +719,10 @@ static MACHINE_CONFIG_START( super80, super80_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + MCFG_SOUND_ADD("samples", SAMPLES, 0) + MCFG_SAMPLES_CHANNELS(1) + MCFG_SAMPLES_NAMES(relay_sample_names) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* printer */ MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") @@ -798,6 +811,10 @@ static MACHINE_CONFIG_START( super80v, super80_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + MCFG_SOUND_ADD("samples", SAMPLES, 0) + MCFG_SAMPLES_CHANNELS(1) + MCFG_SAMPLES_NAMES(relay_sample_names) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* printer */ MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") diff --git a/src/mame/includes/super80.h b/src/mame/includes/super80.h index b8d8d6b99af..f200c0524b6 100644 --- a/src/mame/includes/super80.h +++ b/src/mame/includes/super80.h @@ -7,6 +7,7 @@ #include "imagedev/snapquik.h" #include "imagedev/cassette.h" #include "sound/speaker.h" +#include "sound/samples.h" #include "machine/buffer.h" #include "bus/centronics/ctronics.h" #include "video/mc6845.h" @@ -31,6 +32,7 @@ public: , m_pio(*this, "z80pio") , m_cassette(*this, "cassette") , m_wave(*this, WAVE_TAG) + , m_samples(*this, "samples") , m_speaker(*this, "speaker") , m_centronics(*this, "centronics") , m_cent_data_out(*this, "cent_data_out") @@ -104,11 +106,12 @@ private: UINT8 m_mc6845_ind; UINT8 *m_p_ram; void mc6845_cursor_configure(); - void super80_cassette_motor(UINT8 data); + void super80_cassette_motor(bool data); required_device m_maincpu; required_device m_pio; required_device m_cassette; required_device m_wave; + required_device m_samples; required_device m_speaker; required_device m_centronics; required_device m_cent_data_out; diff --git a/src/mame/machine/super80.cpp b/src/mame/machine/super80.cpp index 9d44cc7cec4..c08288c89a8 100644 --- a/src/mame/machine/super80.cpp +++ b/src/mame/machine/super80.cpp @@ -31,9 +31,13 @@ READ8_MEMBER( super80_state::pio_port_b_r ) /**************************** CASSETTE ROUTINES *****************************************************************/ -void super80_state::super80_cassette_motor( UINT8 data ) +void super80_state::super80_cassette_motor( bool motor_state ) { - if (data) + // relay sound + if (BIT(m_last_data, 1) != motor_state) + m_samples->start(0, motor_state ? 0 : 1); + + if (motor_state) m_cassette->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); else m_cassette->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);