summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/m10.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-02-19 01:53:16 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-02-19 01:53:16 +0000
commit24400ec22314e091de045cf8203188bf08eda4d1 (patch)
treed65604749cf8a434a2f3c70d3fb6fd9c86fc8def /src/mame/drivers/m10.c
parentb76358a33595a97a49b49a962e9d92c2277f83f4 (diff)
Rewrote SAMPLES as a modern device. Updated all callers. FLAC
reading is now done using the FLAC wrapper. There is now a samples_iterator class to centralize the logic for handling the sample list walking. Also redid the cheesy half-baked votrax device since it relied on some old samples-based handling. Until we have a real implementation, it would be good to route the various clients through the current one to at least wire it up properly, even if it just plays samples in the end. Will look into that shortly.
Diffstat (limited to 'src/mame/drivers/m10.c')
-rw-r--r--src/mame/drivers/m10.c50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index 859c9590f25..d729e5af813 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -199,7 +199,7 @@ static MACHINE_START( m10 )
state->m_maincpu = machine.device("maincpu");
state->m_ic8j1 = machine.device("ic8j1");
state->m_ic8j2 = machine.device("ic8j2");
- state->m_samples = machine.device("samples");
+ state->m_samples = machine.device<samples_device>("samples");
state->save_item(NAME(state->m_bottomline));
state->save_item(NAME(state->m_flip));
@@ -266,27 +266,27 @@ static WRITE8_HANDLER( m10_ctrl_w )
break;
case 0x01:
/* MISSILE sound */
- sample_start(state->m_samples, 0, 0, 0);
+ state->m_samples->start(0, 0);
break;
case 0x02:
/* EXPLOSION sound */
- sample_start(state->m_samples, 1, 1, 0);
+ state->m_samples->start(1, 1);
break;
case 0x03:
/* INVADER HIT sound */
- sample_start(state->m_samples, 2, 2, 0);
+ state->m_samples->start(2, 2);
break;
case 0x04:
/* BONUS BASE sound */
- sample_start(state->m_samples, 3, 8, 0);
+ state->m_samples->start(3, 8);
break;
case 0x05:
/* FLEET MOVE sound */
- sample_start(state->m_samples, 3, 3, 0);
+ state->m_samples->start(3, 3);
break;
case 0x06:
/* SAUCER HIT SOUND */
- sample_start(state->m_samples, 2, 7, 0);
+ state->m_samples->start(2, 7);
break;
default:
popmessage("Unknown sound M10: %02x\n", data & 0x07);
@@ -294,9 +294,9 @@ static WRITE8_HANDLER( m10_ctrl_w )
}
/* UFO SOUND */
if (data & 0x08)
- sample_stop(state->m_samples, 4);
+ state->m_samples->stop(4);
else
- sample_start(state->m_samples, 4, 9, 1);
+ state->m_samples->start(4, 9, true);
}
@@ -403,21 +403,21 @@ static WRITE8_HANDLER( m11_a100_w )
// audio control!
/* MISSILE sound */
if (raising_bits & 0x01)
- sample_start(state->m_samples, 0, 0, 0);
+ state->m_samples->start(0, 0);
/* EXPLOSION sound */
if (raising_bits & 0x02)
- sample_start(state->m_samples, 1, 1, 0);
+ state->m_samples->start(1, 1);
/* Rapidly falling parachute */
if (raising_bits & 0x04)
- sample_start(state->m_samples, 3, 8, 0);
+ state->m_samples->start(3, 8);
/* Background sound ? */
if (data & 0x10)
- sample_start(state->m_samples, 4, 9, 1);
+ state->m_samples->start(4, 9, true);
else
- sample_stop(state->m_samples, 4);
+ state->m_samples->stop(4);
}
@@ -446,34 +446,34 @@ static WRITE8_HANDLER( m15_a100_w )
#endif
/* DOT sound */
if (falling_bits & 0x40)
- sample_start(state->m_samples, 0, 0, 0);
+ state->m_samples->start(0, 0);
#if 0
if (raising_bits & 0x40)
- sample_stop(state->m_samples, 0);
+ state->m_samples->stop(0);
#endif
/* EXPLOSION sound */
if (falling_bits & 0x08)
- sample_start(state->m_samples, 1, 1, 0);
+ state->m_samples->start(1, 1);
#if 0
if (raising_bits & 0x08)
- sample_stop(state->m_samples, 1);
+ state->m_samples->stop(1);
#endif
/* player changes lane */
if (falling_bits & 0x10)
- sample_start(state->m_samples, 3, 3, 0);
+ state->m_samples->start(3, 3);
#if 0
if (raising_bits & 0x10)
- sample_stop(state->m_samples, 3);
+ state->m_samples->stop(3);
#endif
/* computer car changes lane */
if (falling_bits & 0x20)
- sample_start(state->m_samples, 4, 4, 0);
+ state->m_samples->start(4, 4);
#if 0
if (raising_bits & 0x20)
- sample_stop(state->m_samples, 4);
+ state->m_samples->stop(4);
#endif
state->m_last = data;
@@ -863,8 +863,7 @@ static MACHINE_CONFIG_START( m10, m10_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("samples", SAMPLES, 0)
- MCFG_SOUND_CONFIG(m10_samples_interface)
+ MCFG_SAMPLES_ADD("samples", m10_samples_interface)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -903,8 +902,7 @@ static MACHINE_CONFIG_START( m15, m10_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("samples", SAMPLES, 0)
- MCFG_SOUND_CONFIG(m10_samples_interface)
+ MCFG_SAMPLES_ADD("samples", m10_samples_interface)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END