summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Greg Kennedy <kennedy.greg@gmail.com>2020-11-25 02:46:33 -0600
committer GitHub <noreply@github.com>2020-11-25 19:46:33 +1100
commit4086c1aac0177f9f8cc3b4e4b52355dc4bd0fa18 (patch)
treeaacac2ef5e85bf7f556c611827af6a2239200712
parentec8042864703f9ce6cc9b0cf528e6a8528104b89 (diff)
cosmic.cpp: Fixed bug in sound output handler and cleaned up sample playback code
Removed some redundant calls, and turned the questionable [[fallthrough]] into a break.
-rw-r--r--src/mame/drivers/cosmic.cpp38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/mame/drivers/cosmic.cpp b/src/mame/drivers/cosmic.cpp
index a846e06043d..6b4eaae00d3 100644
--- a/src/mame/drivers/cosmic.cpp
+++ b/src/mame/drivers/cosmic.cpp
@@ -221,66 +221,42 @@ void cosmic_state::cosmica_sound_output_w(offs_t offset, uint8_t data)
{
case 2:
if (m_samples->playing(2))
- {
m_samples->stop(2);
- m_samples->start(2, 3);
- }
- else
- m_samples->start(2, 3);
+ m_samples->start(2, 3);
break;
case 3:
if (m_samples->playing(3))
- {
m_samples->stop(3);
- m_samples->start(3, 4);
- }
- else
- m_samples->start(3, 4);
+ m_samples->start(3, 4);
break;
case 4:
if (m_samples->playing(4))
- {
m_samples->stop(4);
- m_samples->start(4, 5);
- }
- else
- m_samples->start(4, 5);
+ m_samples->start(4, 5);
break;
case 5:
if (m_samples->playing(5))
- {
m_samples->stop(5);
- m_samples->start(5, 6);
- }
- else
- m_samples->start(5, 6);
+ m_samples->start(5, 6);
break;
case 6:
if (m_samples->playing(6))
- {
m_samples->stop(6);
- m_samples->start(6, 7);
- }
- else
- m_samples->start(6, 7);
+ m_samples->start(6, 7);
break;
case 7:
if (m_samples->playing(7))
- {
m_samples->stop(7);
- m_samples->start(7, 8);
- }
- else
- m_samples->start(7, 8);
+ m_samples->start(7, 8);
break;
}
}
- [[fallthrough]]; // FIXME: really?
+ break;
case 3: /*Dive Bombing Type B (G.S.B)*/
if (data)