summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author angelosa <salese_corp_ltd@email.it>2017-09-04 14:06:38 +0200
committer angelosa <salese_corp_ltd@email.it>2017-09-04 14:07:40 +0200
commit4f56d21643a366dbd6840f5315266414e222809d (patch)
treea7dbc6289af28271f36df006fb1db2ecb16de5fa /src/mame
parent9a7f96ba04ba240bc1bf1c1063ec5d72b3aec802 (diff)
vicdual.cpp: Added sound samples to Borderline [Angelo Salese, Corrado Tomaselli]
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/audio/vicdual.cpp53
-rw-r--r--src/mame/audio/vicdual.h1
-rw-r--r--src/mame/drivers/vicdual.cpp12
-rw-r--r--src/mame/includes/vicdual.h2
4 files changed, 66 insertions, 2 deletions
diff --git a/src/mame/audio/vicdual.cpp b/src/mame/audio/vicdual.cpp
index 941d5e368b0..e49c35cfb81 100644
--- a/src/mame/audio/vicdual.cpp
+++ b/src/mame/audio/vicdual.cpp
@@ -577,3 +577,56 @@ DISCRETE_SOUND_START(brdrline)
DISCRETE_SOUND_END
#endif
+
+static const char *const brdrline_sample_names[] =
+{
+ "*brdrline",
+ "boot_and_start",
+ "coin",
+ "crashes",
+ "end_level",
+ "engine_noise",
+ "field",
+ "fire",
+ nullptr
+};
+
+
+MACHINE_CONFIG_START( brdrline_audio )
+ MCFG_SOUND_ADD("samples", SAMPLES, 0)
+ MCFG_SAMPLES_CHANNELS(7)
+ MCFG_SAMPLES_NAMES(brdrline_sample_names)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+MACHINE_CONFIG_END
+
+WRITE8_MEMBER( vicdual_state::brdrline_audio_w )
+{
+ uint8_t res = data ^ 0xff;
+
+// if(res & 2) // low fuel, MISSING
+
+ if(res & 8) // end level
+ m_samples->start(3, 3);
+
+ if(res & 0x10) // moving in the brush
+ m_samples->start(5, 5);
+
+ if(res & 0x20) // fire
+ m_samples->start(6, 6);
+
+ if(res & 0x40) // car engine noise
+ m_samples->start(4, 4);
+
+ if(res & 0x80) // crashes
+ m_samples->start(2, 2);
+
+ //printf("%02x\n",res);
+}
+
+WRITE8_MEMBER( vicdual_state::brdrline_audio_aux_w )
+{
+ if(data & 0xfc) // coin, unknown which is the trigger
+ m_samples->start(1, 1);
+ else // boot sample
+ m_samples->start(0, 0);
+}
diff --git a/src/mame/audio/vicdual.h b/src/mame/audio/vicdual.h
index fe93707481f..aac4bffbe28 100644
--- a/src/mame/audio/vicdual.h
+++ b/src/mame/audio/vicdual.h
@@ -3,3 +3,4 @@
MACHINE_CONFIG_EXTERN( frogs_audio );
MACHINE_CONFIG_EXTERN( headon_audio );
+MACHINE_CONFIG_EXTERN( brdrline_audio );
diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp
index 176b0f04fc5..ab1a24e2b64 100644
--- a/src/mame/drivers/vicdual.cpp
+++ b/src/mame/drivers/vicdual.cpp
@@ -1101,8 +1101,12 @@ WRITE8_MEMBER(vicdual_state::carnival_io_w)
WRITE8_MEMBER(vicdual_state::brdrline_io_w)
{
- if (offset & 0x01) { /* brdrline_audio_w(space, 0, data) */ }
- if (offset & 0x02) palette_bank_w(space, 0, data);
+ if (offset & 0x01) brdrline_audio_w(space, 0, data);
+ if (offset & 0x02)
+ {
+ palette_bank_w(space, 0, data);
+ brdrline_audio_aux_w(space,0, data);
+ }
if (offset & 0x08) assert_coin_status();
}
@@ -2064,6 +2068,10 @@ static MACHINE_CONFIG_DERIVED( brdrline, vicdual_dualgame_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(brdrline_io_map)
+
+ /* audio hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_FRAGMENT_ADD(brdrline_audio)
MACHINE_CONFIG_END
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index b9807288d3f..bca3a20eae6 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -108,6 +108,8 @@ public:
DECLARE_WRITE8_MEMBER( frogs_audio_w );
DECLARE_WRITE8_MEMBER( headon_audio_w );
DECLARE_WRITE8_MEMBER( invho2_audio_w );
+ DECLARE_WRITE8_MEMBER( brdrline_audio_w );
+ DECLARE_WRITE8_MEMBER( brdrline_audio_aux_w );
TIMER_CALLBACK_MEMBER( frogs_croak_callback );
/*----------- defined in audio/carnival.c -----------*/