From a8c17dc44ff5596c6efe16fc3bfe43c379c6cecd Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 23 Jun 2021 03:11:56 +1000 Subject: [PATCH] trs80, trs80m3, vtech1: sound-related improvements --- hash/trs80_quik.xml | 16 ++++++++-------- src/mame/drivers/h01x.cpp | 4 +--- src/mame/drivers/vtech1.cpp | 2 +- src/mame/machine/trs80.cpp | 6 +++--- src/mame/machine/trs80m3.cpp | 18 +++++++++++++++--- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/hash/trs80_quik.xml b/hash/trs80_quik.xml index ad6772f7fbd..5b9a5b14e39 100644 --- a/hash/trs80_quik.xml +++ b/hash/trs80_quik.xml @@ -447,7 +447,7 @@ between them. 1981 Misosys - + @@ -460,7 +460,7 @@ between them. 1981 Misosys - + @@ -473,7 +473,7 @@ between them. 1981 Misosys - + @@ -486,7 +486,7 @@ between them. 1981 Misosys - + @@ -499,7 +499,7 @@ between them. 1981 Misosys - + @@ -512,7 +512,7 @@ between them. 1981 Misosys - + @@ -525,7 +525,7 @@ between them. 1981 Misosys - + @@ -538,7 +538,7 @@ between them. 1981 Misosys - + diff --git a/src/mame/drivers/h01x.cpp b/src/mame/drivers/h01x.cpp index 63069912350..58719f739b3 100644 --- a/src/mame/drivers/h01x.cpp +++ b/src/mame/drivers/h01x.cpp @@ -95,8 +95,6 @@ private: }; -static const double speaker_levels[] = {-1.0, 0.0, 1.0, 0.0}; - void h01x_state::h01x(machine_config &config) { // basic machine hardware @@ -123,7 +121,7 @@ void h01x_state::h01x(machine_config &config) // sound hardware SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker).set_levels(4, speaker_levels); + SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.50); /* devices */ diff --git a/src/mame/drivers/vtech1.cpp b/src/mame/drivers/vtech1.cpp index 2352f586c2e..101f3b4a214 100644 --- a/src/mame/drivers/vtech1.cpp +++ b/src/mame/drivers/vtech1.cpp @@ -450,7 +450,7 @@ INPUT_PORTS_END MACHINE DRIVERS ***************************************************************************/ -static const double speaker_levels[] = {-1.0, 0.0, 1.0, 0.0}; +static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 }; void vtech1_base_state::vtech1(machine_config &config) { diff --git a/src/mame/machine/trs80.cpp b/src/mame/machine/trs80.cpp index a89bd1889ed..1f6e17979f4 100644 --- a/src/mame/machine/trs80.cpp +++ b/src/mame/machine/trs80.cpp @@ -175,12 +175,12 @@ void trs80_state::port_ff_w(u8 data) m_cpl = BIT(data, 3); - static const double speaker_levels[4] = { 0.0, -1.0, 0.0, 1.0 }; - m_speaker->set_levels(4, speaker_levels); - /* Speaker for System-80 MK II - only sounds if relay is off */ if (!(BIT(data, 2))) + { + m_speaker->set_levels(4, levels); m_speaker->level_w(data & 3); + } } /************************************* diff --git a/src/mame/machine/trs80m3.cpp b/src/mame/machine/trs80m3.cpp index ee1f70da20e..842f210bb17 100644 --- a/src/mame/machine/trs80m3.cpp +++ b/src/mame/machine/trs80m3.cpp @@ -411,13 +411,25 @@ void trs80m3_state::port_ff_w(uint8_t data) /* Cassette port d1, d0 Cassette output */ - if (!BIT(m_model4, 2)) // Model 4P has no cassette hardware + static const double levels[4] = { 0.0, 1.0, -1.0, 0.0 }; + + // Model 4P has no cassette hardware, and only one bit for sound + if (BIT(m_model4, 2)) + { + if (!(BIT(m_port_ec, 1))) + m_speaker->level_w(BIT(data, 0)); + } + else + // Others have the same old unofficial sound via the cassette port { - static const double levels[4] = { 0.0, 1.0, -1.0, 0.0 }; m_cassette->output(levels[data & 3]); m_cassette_data &= ~0x80; + if (!(BIT(m_port_ec, 1))) + { + m_speaker->set_levels(4, levels); + m_speaker->level_w(data & 3); + } } - m_speaker->level_w(!(BIT(data, 0))); }