summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2016-05-27 10:57:15 +1000
committer Robbbert <Robbbert@users.noreply.github.com>2016-05-27 10:57:15 +1000
commit96674c9a8107d389f22bb5034b75596144930db4 (patch)
tree11f1a4b9dfff18ed467222331fa68400f7c559b3
parentcfdec4e84f47acb76cdc6a7c2001e07cd5e3a394 (diff)
Super-80: added sounds for the cassette relay
-rw-r--r--src/mame/drivers/super80.cpp17
-rw-r--r--src/mame/includes/super80.h5
-rw-r--r--src/mame/machine/super80.cpp8
3 files changed, 27 insertions, 3 deletions
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<cpu_device> m_maincpu;
required_device<z80pio_device> m_pio;
required_device<cassette_image_device> m_cassette;
required_device<wave_device> m_wave;
+ required_device<samples_device> m_samples;
required_device<speaker_sound_device> m_speaker;
required_device<centronics_device> m_centronics;
required_device<output_latch_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);