summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/devices/bus/abckb/abc77.cpp5
-rw-r--r--src/devices/sound/discrete.h26
-rw-r--r--src/devices/sound/flt_vol.h14
-rw-r--r--src/devices/sound/okim6295.cpp1
-rw-r--r--src/devices/sound/okim6295.h6
-rw-r--r--src/emu/device.h2
-rw-r--r--src/emu/device.ipp15
-rw-r--r--src/emu/emufwd.h1
-rw-r--r--src/emu/mconfig.cpp175
-rw-r--r--src/emu/mconfig.h49
-rw-r--r--src/mame/audio/8080bw.cpp8
-rw-r--r--src/mame/audio/asteroid.cpp10
-rw-r--r--src/mame/audio/atarifb.cpp4
-rw-r--r--src/mame/audio/avalnche.cpp5
-rw-r--r--src/mame/audio/bsktball.cpp2
-rw-r--r--src/mame/audio/bwidow.cpp9
-rw-r--r--src/mame/audio/bzone.cpp5
-rw-r--r--src/mame/audio/canyon.cpp2
-rw-r--r--src/mame/audio/circus.cpp6
-rw-r--r--src/mame/audio/cliffhgr.cpp3
-rw-r--r--src/mame/audio/cliffhgr.h2
-rw-r--r--src/mame/audio/copsnrob.cpp5
-rw-r--r--src/mame/audio/crbaloon.cpp5
-rw-r--r--src/mame/audio/dkong.cpp12
-rw-r--r--src/mame/audio/dragrace.cpp2
-rw-r--r--src/mame/audio/firetrk.cpp6
-rw-r--r--src/mame/audio/galaga.cpp4
-rw-r--r--src/mame/audio/galaxian.cpp19
-rw-r--r--src/mame/audio/grchamp.cpp2
-rw-r--r--src/mame/audio/hitme.cpp2
-rw-r--r--src/mame/audio/irem.cpp5
-rw-r--r--src/mame/audio/llander.cpp5
-rw-r--r--src/mame/audio/m79amb.cpp2
-rw-r--r--src/mame/audio/madalien.cpp2
-rw-r--r--src/mame/audio/mario.cpp2
-rw-r--r--src/mame/audio/mw8080bw.cpp75
-rw-r--r--src/mame/audio/nitedrvr.cpp2
-rw-r--r--src/mame/audio/norautp.cpp2
-rw-r--r--src/mame/audio/orbit.cpp2
-rw-r--r--src/mame/audio/phoenix.cpp2
-rw-r--r--src/mame/audio/phoenix.h2
-rw-r--r--src/mame/audio/polepos.cpp2
-rw-r--r--src/mame/audio/polepos.h2
-rw-r--r--src/mame/audio/poolshrk.cpp2
-rw-r--r--src/mame/audio/qix.cpp5
-rw-r--r--src/mame/audio/skydiver.cpp2
-rw-r--r--src/mame/audio/skyraid.cpp2
-rw-r--r--src/mame/audio/snk6502.cpp2
-rw-r--r--src/mame/audio/snk6502.h2
-rw-r--r--src/mame/audio/spiders.cpp5
-rw-r--r--src/mame/audio/sprint2.cpp6
-rw-r--r--src/mame/audio/sprint4.cpp4
-rw-r--r--src/mame/audio/sprint4.h4
-rw-r--r--src/mame/audio/sprint8.cpp5
-rw-r--r--src/mame/audio/starshp1.cpp2
-rw-r--r--src/mame/audio/subs.cpp2
-rw-r--r--src/mame/audio/tank8.cpp2
-rw-r--r--src/mame/audio/triplhnt.cpp2
-rw-r--r--src/mame/audio/turbo.cpp2
-rw-r--r--src/mame/audio/vicdual.cpp12
-rw-r--r--src/mame/audio/videopin.cpp2
-rw-r--r--src/mame/drivers/8080bw.cpp15
-rw-r--r--src/mame/drivers/abc80x.cpp11
-rw-r--r--src/mame/drivers/alinvade.cpp4
-rw-r--r--src/mame/drivers/atarifb.cpp6
-rw-r--r--src/mame/drivers/blockade.cpp5
-rw-r--r--src/mame/drivers/bloodbro.cpp2
-rw-r--r--src/mame/drivers/bsktball.cpp3
-rw-r--r--src/mame/drivers/btime.cpp5
-rw-r--r--src/mame/drivers/by35.cpp5
-rw-r--r--src/mame/drivers/canyon.cpp3
-rw-r--r--src/mame/drivers/circus.cpp12
-rw-r--r--src/mame/drivers/circusc.cpp6
-rw-r--r--src/mame/drivers/cliffhgr.cpp3
-rw-r--r--src/mame/drivers/cninja.cpp2
-rw-r--r--src/mame/drivers/darius.cpp58
-rw-r--r--src/mame/drivers/dragrace.cpp3
-rw-r--r--src/mame/drivers/esd16.cpp2
-rw-r--r--src/mame/drivers/expro02.cpp6
-rw-r--r--src/mame/drivers/firetrk.cpp9
-rw-r--r--src/mame/drivers/galaga.cpp9
-rw-r--r--src/mame/drivers/galaxian.cpp8
-rw-r--r--src/mame/drivers/goldnpkr.cpp34
-rw-r--r--src/mame/drivers/grchamp.cpp3
-rw-r--r--src/mame/drivers/gyruss.cpp5
-rw-r--r--src/mame/drivers/hitme.cpp3
-rw-r--r--src/mame/drivers/ironhors.cpp5
-rw-r--r--src/mame/drivers/itgamble.cpp4
-rw-r--r--src/mame/drivers/lockon.cpp18
-rw-r--r--src/mame/drivers/m79amb.cpp4
-rw-r--r--src/mame/drivers/madalien.cpp4
-rw-r--r--src/mame/drivers/megasys1.cpp4
-rw-r--r--src/mame/drivers/ninjaw.cpp24
-rw-r--r--src/mame/drivers/nitedrvr.cpp3
-rw-r--r--src/mame/drivers/norautp.cpp19
-rw-r--r--src/mame/drivers/orbit.cpp3
-rw-r--r--src/mame/drivers/othunder.cpp18
-rw-r--r--src/mame/drivers/phoenix.cpp3
-rw-r--r--src/mame/drivers/polepos.cpp3
-rw-r--r--src/mame/drivers/poolshrk.cpp3
-rw-r--r--src/mame/drivers/powerins.cpp2
-rw-r--r--src/mame/drivers/quantum.cpp6
-rw-r--r--src/mame/drivers/simpl156.cpp2
-rw-r--r--src/mame/drivers/skydiver.cpp3
-rw-r--r--src/mame/drivers/skyraid.cpp3
-rw-r--r--src/mame/drivers/snk6502.cpp7
-rw-r--r--src/mame/drivers/snowbros.cpp2
-rw-r--r--src/mame/drivers/sprint2.cpp9
-rw-r--r--src/mame/drivers/sprint4.cpp3
-rw-r--r--src/mame/drivers/starshp1.cpp3
-rw-r--r--src/mame/drivers/subs.cpp3
-rw-r--r--src/mame/drivers/taito_z.cpp120
-rw-r--r--src/mame/drivers/taitosj.cpp4
-rw-r--r--src/mame/drivers/tank8.cpp3
-rw-r--r--src/mame/drivers/topspeed.cpp18
-rw-r--r--src/mame/drivers/triplhnt.cpp3
-rw-r--r--src/mame/drivers/tumbleb.cpp4
-rw-r--r--src/mame/drivers/uapce.cpp5
-rw-r--r--src/mame/drivers/ultratnk.cpp3
-rw-r--r--src/mame/drivers/videopin.cpp3
-rw-r--r--src/mame/drivers/vip.cpp5
-rw-r--r--src/mame/drivers/vixen.cpp5
-rw-r--r--src/mame/drivers/warriorb.cpp24
-rw-r--r--src/mame/drivers/wiz.cpp5
-rw-r--r--src/mame/drivers/x68k.cpp6
-rw-r--r--src/mame/drivers/xexex.cpp12
-rw-r--r--src/mame/includes/8080bw.h8
-rw-r--r--src/mame/includes/atarifb.h4
-rw-r--r--src/mame/includes/bsktball.h2
-rw-r--r--src/mame/includes/canyon.h2
-rw-r--r--src/mame/includes/circus.h6
-rw-r--r--src/mame/includes/dragrace.h2
-rw-r--r--src/mame/includes/firetrk.h6
-rw-r--r--src/mame/includes/galaga.h4
-rw-r--r--src/mame/includes/grchamp.h2
-rw-r--r--src/mame/includes/hitme.h8
-rw-r--r--src/mame/includes/m79amb.h9
-rw-r--r--src/mame/includes/madalien.h6
-rw-r--r--src/mame/includes/nitedrvr.h2
-rw-r--r--src/mame/includes/norautp.h13
-rw-r--r--src/mame/includes/orbit.h2
-rw-r--r--src/mame/includes/poolshrk.h2
-rw-r--r--src/mame/includes/skydiver.h2
-rw-r--r--src/mame/includes/skyraid.h2
-rw-r--r--src/mame/includes/sprint2.h12
-rw-r--r--src/mame/includes/sprint8.h2
-rw-r--r--src/mame/includes/starshp1.h2
-rw-r--r--src/mame/includes/subs.h6
-rw-r--r--src/mame/includes/tank8.h2
-rw-r--r--src/mame/includes/triplhnt.h2
-rw-r--r--src/mame/includes/videopin.h2
-rw-r--r--src/mame/machine/hec2hrp.cpp5
-rw-r--r--src/mame/machine/k7659kb.cpp2
-rw-r--r--src/mame/machine/v1050kb.cpp7
154 files changed, 589 insertions, 710 deletions
diff --git a/src/devices/bus/abckb/abc77.cpp b/src/devices/bus/abckb/abc77.cpp
index 87959e8f970..97cce80367f 100644
--- a/src/devices/bus/abckb/abc77.cpp
+++ b/src/devices/bus/abckb/abc77.cpp
@@ -118,7 +118,7 @@ static const discrete_555_desc abc77_ne556_a =
};
-static DISCRETE_SOUND_START( abc77 )
+static DISCRETE_SOUND_START( abc77_discrete )
DISCRETE_INPUT_LOGIC(NODE_01)
DISCRETE_555_ASTABLE(NODE_02, NODE_01, (int) RES_K(2.7), (int) RES_K(15), (int) CAP_N(22), &abc77_ne556_a)
DISCRETE_OUTPUT(NODE_02, 5000)
@@ -145,8 +145,7 @@ MACHINE_CONFIG_START(abc77_device::device_add_mconfig)
// discrete sound
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, 0)
- MCFG_DISCRETE_INTF(abc77)
+ MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, abc77_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_CONFIG_END
diff --git a/src/devices/sound/discrete.h b/src/devices/sound/discrete.h
index bcabbf8978f..eca3fcea4af 100644
--- a/src/devices/sound/discrete.h
+++ b/src/devices/sound/discrete.h
@@ -4255,16 +4255,8 @@ public:
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_DISCRETE_ADD(_tag, _clock, _intf) \
- MCFG_DEVICE_ADD(_tag, DISCRETE, _clock) \
- MCFG_DISCRETE_INTF(_intf)
-
-#define MCFG_DISCRETE_REPLACE(_tag, _clock, _intf) \
- MCFG_DEVICE_REPLACE(_tag, DISCRETE, _clock) \
- MCFG_DISCRETE_INTF(_intf)
-
#define MCFG_DISCRETE_INTF(_intf) \
- downcast<discrete_device &>(*device).set_intf((const discrete_block *)&(_intf##_discrete_interface));
+ downcast<discrete_device &>(*device).set_intf(_intf);
//**************************************************************************
// TYPE DEFINITIONS
@@ -4377,6 +4369,16 @@ class discrete_sound_device : public discrete_device,
{
public:
// construction/destruction
+ discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const discrete_block *intf)
+ : discrete_sound_device(mconfig, tag, owner, clock)
+ {
+ set_intf(intf);
+ }
+ discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, const discrete_block *intf)
+ : discrete_sound_device(mconfig, tag, owner, uint32_t(0))
+ {
+ set_intf(intf);
+ }
discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~discrete_sound_device(void) { };
@@ -4531,8 +4533,8 @@ discrete_base_node *discrete_create_node(discrete_device * pdev, const discrete_
return discrete_node_factory< C >().Create(pdev, block);
}
-#define DISCRETE_SOUND_EXTERN(name) extern const discrete_block name##_discrete_interface[]
-#define DISCRETE_SOUND_START(name) const discrete_block name##_discrete_interface[] = {
+#define DISCRETE_SOUND_EXTERN(name) extern const discrete_block name[]
+#define DISCRETE_SOUND_START(name) const discrete_block name[] = {
//#define DSC_SND_ENTRY(_nod, _class, _dss, _num, _iact, _iinit, _custom, _name) { _nod, new discrete_node_factory< DISCRETE_CLASS_NAME(_class) >, _dss, _num, _iact, _iinit, _custom, _name, # _class }
#define DSC_SND_ENTRY(_nod, _class, _dss, _num, _iact, _iinit, _custom, _name) { _nod, &discrete_create_node< DISCRETE_CLASS_NAME(_class) >, _dss, _num, _iact, _iinit, _custom, _name, # _class }
@@ -4716,7 +4718,7 @@ discrete_base_node *discrete_create_node(discrete_device * pdev, const discrete_
#define DISCRETE_WAVLOG2(NODE1,GAIN1,NODE2,GAIN2) DSC_SND_ENTRY( NODE_SPECIAL, dso_wavlog , DSO_WAVLOG , 4, DSE( static_cast<int>(NODE1),NODE_NC,static_cast<int>(NODE2),NODE_NC ), DSE( NODE1,GAIN1,NODE2,GAIN2 ), nullptr, "DISCRETE_WAVLOG2" ),
/* import */
-#define DISCRETE_IMPORT(INFO) DSC_SND_ENTRY( NODE_SPECIAL, special , DSO_IMPORT , 0, DSE( 0 ), DSE( 0 ), &(INFO##_discrete_interface), "DISCRETE_IMPORT" ),
+#define DISCRETE_IMPORT(INFO) DSC_SND_ENTRY( NODE_SPECIAL, special , DSO_IMPORT , 0, DSE( 0 ), DSE( 0 ), &(INFO), "DISCRETE_IMPORT" ),
#define DISCRETE_DELETE(NODE_FROM, NODE_TO) DSC_SND_ENTRY( NODE_SPECIAL, special , DSO_DELETE , 2, DSE( static_cast<int>(NODE_FROM), static_cast<int>(NODE_TO) ), DSE( NODE_FROM, NODE_TO ), nullptr, "DISCRETE_DELETE" ),
#define DISCRETE_REPLACE DSC_SND_ENTRY( NODE_SPECIAL, special , DSO_REPLACE , 0, DSE( 0 ), DSE( 0 ), nullptr, "DISCRETE_REPLACE" ),
diff --git a/src/devices/sound/flt_vol.h b/src/devices/sound/flt_vol.h
index b0f9234d1ae..bcd4a05d399 100644
--- a/src/devices/sound/flt_vol.h
+++ b/src/devices/sound/flt_vol.h
@@ -6,17 +6,6 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_FILTER_VOLUME_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FILTER_VOLUME, _clock)
-#define MCFG_FILTER_VOLUME_REPLACE(_tag, _clock) \
- MCFG_DEVICE_REPLACE(_tag, FILTER_VOLUME, _clock)
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -26,7 +15,7 @@
class filter_volume_device : public device_t, public device_sound_interface
{
public:
- filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
void flt_volume_set_volume(float volume);
@@ -44,5 +33,4 @@ private:
DECLARE_DEVICE_TYPE(FILTER_VOLUME, filter_volume_device)
-
#endif // MAME_SOUND_FLT_VOL_H
diff --git a/src/devices/sound/okim6295.cpp b/src/devices/sound/okim6295.cpp
index af7ba14e34a..faf078e5f7c 100644
--- a/src/devices/sound/okim6295.cpp
+++ b/src/devices/sound/okim6295.cpp
@@ -203,6 +203,7 @@ void okim6295_device::rom_bank_updated()
void okim6295_device::set_pin7(int pin7)
{
+ assert(started());
m_pin7_state = pin7 ? 1 : 0;
device_clock_changed();
}
diff --git a/src/devices/sound/okim6295.h b/src/devices/sound/okim6295.h
index 40690932b86..88a72dbe61c 100644
--- a/src/devices/sound/okim6295.h
+++ b/src/devices/sound/okim6295.h
@@ -21,10 +21,6 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_OKIM6295_REPLACE(tag, clock, pin7) \
- MCFG_DEVICE_REPLACE((tag), OKIM6295, (clock)) \
- MCFG_OKIM6295_PIN7(pin7)
-
#define MCFG_OKIM6295_PIN7(pin7) \
downcast<okim6295_device &>(*device).config_pin7((okim6295_device::pin7));
@@ -56,7 +52,7 @@ public:
okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- void config_pin7(pin7_state pin7) { m_pin7_state = pin7; }
+ void config_pin7(pin7_state pin7) { assert(!started()); m_pin7_state = pin7; }
// runtime configuration
void set_pin7(int pin7);
diff --git a/src/emu/device.h b/src/emu/device.h
index a7b9d8707e3..68ae68b7cd1 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -289,6 +289,8 @@ public:
template <typename... Params> DeviceClass &operator()(machine_config &mconfig, char const *tag, Params &&... args) const;
template <typename Exposed, bool Required, typename... Params> DeviceClass &operator()(machine_config &mconfig, device_finder<Exposed, Required> &finder, Params &&... args) const;
+ template <typename... Params> DeviceClass &operator()(machine_config_replace replace, char const *tag, Params &&... args) const;
+ template <typename Exposed, bool Required, typename... Params> DeviceClass &operator()(machine_config_replace replace, device_finder<Exposed, Required> &finder, Params &&... args) const;
};
diff --git a/src/emu/device.ipp b/src/emu/device.ipp
index 4fa6b2fe1ec..e90f6bd4e6c 100644
--- a/src/emu/device.ipp
+++ b/src/emu/device.ipp
@@ -45,6 +45,21 @@ inline DeviceClass &device_type_impl<DeviceClass>::operator()(machine_config &mc
return finder = result;
}
+template <class DeviceClass> template <typename... Params>
+inline DeviceClass &device_type_impl<DeviceClass>::operator()(machine_config_replace replace, char const *tag, Params &&... args) const
+{
+ return dynamic_cast<DeviceClass &>(*replace.config.device_replace(tag, *this, std::forward<Params>(args)...));
+}
+
+template <class DeviceClass> template <typename Exposed, bool Required, typename... Params>
+inline DeviceClass &device_type_impl<DeviceClass>::operator()(machine_config_replace replace, device_finder<Exposed, Required> &finder, Params &&... args) const
+{
+ std::pair<device_t &, char const *> const target(finder.finder_target());
+ assert(&replace.config.current_device() == &target.first);
+ DeviceClass &result(dynamic_cast<DeviceClass &>(*replace.config.device_replace(target.second, *this, std::forward<Params>(args)...)));
+ return finder = result;
+}
+
} } // namespace emu::detail
diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h
index 41e725e7a58..c548e09d3a7 100644
--- a/src/emu/emufwd.h
+++ b/src/emu/emufwd.h
@@ -179,6 +179,7 @@ struct ioport_port_live;
class running_machine;
// declared in mconfig.h
+namespace emu { namespace detail { struct machine_config_replace; } }
class machine_config;
// declared in natkeyboard.h
diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp
index 7f142ab5958..342651818bc 100644
--- a/src/emu/mconfig.cpp
+++ b/src/emu/mconfig.cpp
@@ -116,6 +116,61 @@ machine_config::~machine_config()
//-------------------------------------------------
+// device_add - configuration helper to add a
+// new device
+//-------------------------------------------------
+
+device_t *machine_config::device_add(const char *tag, device_type type, u32 clock)
+{
+ std::pair<const char *, device_t *> const owner(resolve_owner(tag));
+ return &add_device(type.create(*this, owner.first, owner.second, clock), owner.second);
+}
+
+
+//-------------------------------------------------
+// device_replace - configuration helper to
+// replace one device with a new device
+//-------------------------------------------------
+
+device_t *machine_config::device_replace(const char *tag, device_type type, u32 clock)
+{
+ std::tuple<const char *, device_t *, device_t *> const existing(prepare_replace(tag));
+ std::unique_ptr<device_t> device(type.create(*this, std::get<0>(existing), std::get<1>(existing), clock));
+ return &replace_device(std::move(device), *std::get<1>(existing), std::get<2>(existing));
+}
+
+
+//-------------------------------------------------
+// device_remove - configuration helper to
+// remove a device
+//-------------------------------------------------
+
+device_t *machine_config::device_remove(const char *tag)
+{
+ // find the original device by relative tag (must exist)
+ assert(m_current_device);
+ device_t *const device = m_current_device->subdevice(tag);
+ if (device == nullptr)
+ {
+ osd_printf_warning("Warning: attempting to remove non-existent device '%s'\n", tag);
+ }
+ else
+ {
+ // make sure we have the old device's actual owner
+ device_t *const owner = device->owner();
+ assert(owner);
+
+ // remove references to the old device
+ remove_references(*device);
+
+ // let the device's owner do the work
+ owner->subdevices().m_list.remove(*device);
+ }
+ return nullptr;
+}
+
+
+//-------------------------------------------------
// resolve_owner - get the actual owner and base
// tag given tag relative to current context
//-------------------------------------------------
@@ -134,11 +189,12 @@ std::pair<const char *, device_t *> machine_config::resolve_owner(const char *ta
}
// go down the path until we're done with it
+ std::string part;
while (strchr(tag, ':'))
{
const char *next = strchr(tag, ':');
assert(next != tag);
- std::string part(tag, next-tag);
+ part.assign(tag, next - tag);
owner = owner->subdevices().find(part);
if (!owner)
throw emu_fatalerror("Could not find %s when looking up path for device %s\n", part.c_str(), orig_tag);
@@ -151,18 +207,40 @@ std::pair<const char *, device_t *> machine_config::resolve_owner(const char *ta
//-------------------------------------------------
+// prepare_replace - ensure owner is present and
+// existing device is removed if necessary
+//-------------------------------------------------
+
+std::tuple<const char *, device_t *, device_t *> machine_config::prepare_replace(const char *tag)
+{
+ // make sure we have the old device's actual owner
+ std::pair<const char *, device_t *> const owner(resolve_owner(tag));
+ assert(owner.second);
+
+ // remove references to the old device
+ device_t *const old_device(owner.second->subdevice(owner.first));
+ if (old_device)
+ remove_references(*old_device);
+ else
+ osd_printf_warning("Warning: attempting to replace non-existent device '%s'\n", tag);
+
+ return std::make_tuple(owner.first, owner.second, old_device);
+}
+
+
+//-------------------------------------------------
// add_device - add a new device at the correct
// point in the hierarchy
//-------------------------------------------------
-device_t *machine_config::add_device(std::unique_ptr<device_t> &&device, device_t *owner)
+device_t &machine_config::add_device(std::unique_ptr<device_t> &&device, device_t *owner)
{
- current_device_stack context(*this);
+ current_device_stack const context(*this);
if (owner)
{
// allocate the new device and append it to the owner's list
- device_t *const result = &owner->subdevices().m_list.append(*device.release());
- result->add_machine_configuration(*this);
+ device_t &result(owner->subdevices().m_list.append(*device.release()));
+ result.add_machine_configuration(*this);
return result;
}
else
@@ -174,91 +252,24 @@ device_t *machine_config::add_device(std::unique_ptr<device_t> &&device, device_
if (driver)
driver->set_game_driver(m_gamedrv);
m_root_device->add_machine_configuration(*this);
- return m_root_device.get();
+ return *m_root_device;
}
}
//-------------------------------------------------
-// device_add - configuration helper to add a
-// new device
-//-------------------------------------------------
-
-device_t *machine_config::device_add(const char *tag, device_type type, u32 clock)
-{
- std::pair<const char *, device_t *> const owner(resolve_owner(tag));
- return add_device(type.create(*this, owner.first, owner.second, clock), owner.second);
-}
-
-
-//-------------------------------------------------
-// device_replace - configuration helper to
-// replace one device with a new device
+// replace_device - substitute the new device for
+// the old one in the owner's list
//-------------------------------------------------
-device_t *machine_config::device_replace(const char *tag, device_type type, u32 clock)
+device_t &machine_config::replace_device(std::unique_ptr<device_t> &&device, device_t &owner, device_t *existing)
{
- // find the original device by relative tag (must exist)
- assert(m_current_device);
- device_t *old_device = m_current_device->subdevice(tag);
- if (!old_device)
- {
- osd_printf_warning("Warning: attempting to replace non-existent device '%s'\n", tag);
- return device_add(tag, type, clock);
- }
- else
- {
- // make sure we have the old device's actual owner
- device_t *const owner = old_device->owner();
- assert(owner);
-
- // remove references to the old device
- remove_references(*old_device);
-
- // allocate the new device and substitute it for the old one in the owner's list
- device_t *const new_device = &owner->subdevices().m_list.replace_and_remove(*type.create(*this, tag, owner, clock).release(), *old_device);
- current_device_stack context(*this);
- new_device->add_machine_configuration(*this);
- return new_device;
- }
-}
-
-
-device_t *machine_config::device_replace(const char *tag, device_type type, const XTAL &clock)
-{
- std::string msg = std::string("Replacing device ") + tag;
- clock.validate(msg);
- return device_replace(tag, type, clock.value());
-}
-
-
-//-------------------------------------------------
-// device_remove - configuration helper to
-// remove a device
-//-------------------------------------------------
-
-device_t *machine_config::device_remove(const char *tag)
-{
- // find the original device by relative tag (must exist)
- assert(m_current_device);
- device_t *const device = m_current_device->subdevice(tag);
- if (device == nullptr)
- {
- osd_printf_warning("Warning: attempting to remove non-existent device '%s'\n", tag);
- }
- else
- {
- // make sure we have the old device's actual owner
- device_t *const owner = device->owner();
- assert(owner);
-
- // remove references to the old device
- remove_references(*device);
-
- // let the device's owner do the work
- owner->subdevices().m_list.remove(*device);
- }
- return nullptr;
+ current_device_stack const context(*this);
+ device_t &result(existing
+ ? owner.subdevices().m_list.replace_and_remove(*device.release(), *existing)
+ : owner.subdevices().m_list.append(*device.release()));
+ result.add_machine_configuration(*this);
+ return result;
}
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index ce3317a17b2..c7f071d0a91 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -20,6 +20,7 @@
#include <cassert>
#include <memory>
+#include <tuple>
#include <type_traits>
#include <typeinfo>
#include <utility>
@@ -36,6 +37,13 @@
// TYPE DEFINITIONS
//**************************************************************************
+namespace emu { namespace detail {
+
+struct machine_config_replace { machine_config &config; };
+
+} } // namesapce emu::detail
+
+
struct internal_layout
{
size_t decompressed_size;
@@ -109,6 +117,7 @@ public:
m_current_device = &device;
return token(*this, device);
}
+ emu::detail::machine_config_replace replace() { return emu::detail::machine_config_replace{ *this }; };
device_t *device_add(const char *tag, device_type type, u32 clock);
template <typename Creator>
device_t *device_add(const char *tag, Creator &&type, u32 clock)
@@ -132,7 +141,27 @@ public:
return device_add(tag, std::forward<Creator>(type), clock.value(), std::forward<Params>(args)...);
}
device_t *device_replace(const char *tag, device_type type, u32 clock);
- device_t *device_replace(const char *tag, device_type type, const XTAL &xtal);
+ template <typename Creator>
+ device_t *device_replace(const char *tag, Creator &&type, u32 clock)
+ {
+ return device_add(tag, device_type(type), clock);
+ }
+ template <typename Creator, typename... Params>
+ auto device_replace(const char *tag, Creator &&type, Params &&... args)
+ {
+ std::tuple<const char *, device_t *, device_t *> const existing(prepare_replace(tag));
+ auto device(type.create(*this, std::get<0>(existing), std::get<1>(existing), std::forward<Params>(args)...));
+ auto &result(*device);
+ assert(type.type() == typeid(result));
+ replace_device(std::move(device), *std::get<1>(existing), std::get<2>(existing));
+ return &result;
+ }
+ template <typename Creator, typename... Params>
+ auto device_replace(const char *tag, Creator &&type, XTAL clock, Params &&... args)
+ {
+ clock.validate(std::string("Replacing device ") + tag);
+ return device_replace(tag, std::forward<Creator>(type), clock.value(), std::forward<Params>(args)...);
+ }
device_t *device_remove(const char *tag);
device_t *device_find(device_t *owner, const char *tag);
@@ -141,7 +170,9 @@ private:
// internal helpers
std::pair<const char *, device_t *> resolve_owner(const char *tag) const;
- device_t *add_device(std::unique_ptr<device_t> &&device, device_t *owner);
+ std::tuple<const char *, device_t *, device_t *> prepare_replace(const char *tag);
+ device_t &add_device(std::unique_ptr<device_t> &&device, device_t *owner);
+ device_t &replace_device(std::unique_ptr<device_t> &&device, device_t &owner, device_t *existing);
void remove_references(ATTR_UNUSED device_t &device);
// internal state
@@ -164,6 +195,16 @@ inline std::enable_if_t<emu::detail::is_device_interface<typename std::remove_re
{
return &type(mconfig, std::forward<Tag>(tag), std::forward<Params>(args)...).device();
}
+template <typename Tag, typename Creator, typename... Params>
+inline std::enable_if_t<emu::detail::is_device_implementation<typename std::remove_reference_t<Creator>::exposed_type>::value, typename std::remove_reference_t<Creator>::exposed_type *> device_replace_impl(machine_config &mconfig, Tag &&tag, Creator &&type, Params &&... args)
+{
+ return &type(mconfig.replace(), std::forward<Tag>(tag), std::forward<Params>(args)...);
+}
+template <typename Tag, typename Creator, typename... Params>
+inline std::enable_if_t<emu::detail::is_device_interface<typename std::remove_reference_t<Creator>::exposed_type>::value, device_t *> device_replace_impl(machine_config &mconfig, Tag &&tag, Creator &&type, Params &&... args)
+{
+ return &type(mconfig.replace(), std::forward<Tag>(tag), std::forward<Params>(args)...).device();
+}
} } // namespace emu::detail
@@ -211,8 +252,8 @@ Ends a machine_config.
// add/remove devices
#define MCFG_DEVICE_ADD(_tag, ...) \
device = emu::detail::device_add_impl(config, _tag, __VA_ARGS__);
-#define MCFG_DEVICE_REPLACE(_tag, _type, _clock) \
- device = config.device_replace(_tag, _type, _clock);
+#define MCFG_DEVICE_REPLACE(_tag, ...) \
+ device = emu::detail::device_replace_impl(config, _tag, __VA_ARGS__);
#define MCFG_DEVICE_REMOVE(_tag) \
device = config.device_remove(_tag);
#define MCFG_DEVICE_MODIFY(_tag) \
diff --git a/src/mame/audio/8080bw.cpp b/src/mame/audio/8080bw.cpp
index a62568a5ae8..518d1db7a0b 100644
--- a/src/mame/audio/8080bw.cpp
+++ b/src/mame/audio/8080bw.cpp
@@ -213,7 +213,7 @@ static const discrete_dac_r1_ladder ballbomb_music_dac =
/* Nodes - Sounds */
#define BALLBOMB_MUSIC NODE_11
-DISCRETE_SOUND_START(ballbomb)
+DISCRETE_SOUND_START(ballbomb_discrete)
DISCRETE_INPUT_DATA (BALLBOMB_MUSIC_DATA)
@@ -293,7 +293,7 @@ static const discrete_dac_r1_ladder indianbt_music_dac =
/* Nodes - Sounds */
#define INDIANBT_MUSIC NODE_11
-DISCRETE_SOUND_START(indianbt)
+DISCRETE_SOUND_START(indianbt_discrete)
DISCRETE_INPUT_DATA (INDIANBT_MUSIC_DATA)
@@ -504,7 +504,7 @@ static const discrete_mixer_desc polaris_mixer_vr4_desc =
#define POLARIS_ADJ_VR2 NODE_24
#define POLARIS_ADJ_VR3 NODE_25
-DISCRETE_SOUND_START(polaris)
+DISCRETE_SOUND_START(polaris_discrete)
/************************************************/
/* Polaris sound system: 8 Sound Sources */
@@ -781,7 +781,7 @@ WRITE8_MEMBER(_8080bw_state::polaris_sh_port_3_w)
#define SCHASER_EXP_SND NODE_11
#define SCHASER_MUSIC_SND NODE_12
-DISCRETE_SOUND_START(schaser)
+DISCRETE_SOUND_START(schaser_discrete)
/************************************************/
/* Input register mapping for schaser */
/************************************************/
diff --git a/src/mame/audio/asteroid.cpp b/src/mame/audio/asteroid.cpp
index 7eb5816c913..afcb68898bf 100644
--- a/src/mame/audio/asteroid.cpp
+++ b/src/mame/audio/asteroid.cpp
@@ -71,7 +71,7 @@ static const discrete_555_cc_desc asteroid_thump_555cc =
#define ASTEROID_EXPLODE_SND NODE_26
#define ASTEROID_THRUST_SND NODE_27
-static DISCRETE_SOUND_START(asteroid)
+static DISCRETE_SOUND_START(asteroid_discrete)
/************************************************/
/* Asteroid Effects Relataive Gain Table */
/* */
@@ -217,7 +217,7 @@ static DISCRETE_SOUND_START(asteroid)
DISCRETE_SOUND_END
-static DISCRETE_SOUND_START(astdelux)
+static DISCRETE_SOUND_START(astdelux_discrete)
/************************************************/
/* Asteroid delux sound hardware is mostly done */
/* in the Pokey chip except for the thrust and */
@@ -318,8 +318,7 @@ WRITE8_MEMBER(asteroid_state::asteroid_noise_reset_w)
MACHINE_CONFIG_START(asteroid_state::asteroid_sound)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(asteroid)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, asteroid_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.4)
MCFG_DEVICE_ADD("audiolatch", LS259, 0) // M10
@@ -335,8 +334,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(asteroid_state::astdelux_sound)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(astdelux)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, astdelux_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_ADD("audiolatch", LS259, 0) // M10
diff --git a/src/mame/audio/atarifb.cpp b/src/mame/audio/atarifb.cpp
index e58c9cbbd24..1a241886671 100644
--- a/src/mame/audio/atarifb.cpp
+++ b/src/mame/audio/atarifb.cpp
@@ -79,7 +79,7 @@ static const discrete_mixer_desc atarifb_mixer =
#define ATARIFB_WHISTLE_SND NODE_12
#define ATARIFB_CROWD_SND NODE_13
-DISCRETE_SOUND_START(atarifb)
+DISCRETE_SOUND_START(atarifb_discrete)
/************************************************/
/* Input register mapping for atarifb */
/************************************************/
@@ -169,7 +169,7 @@ static const discrete_mixer_desc abaseb_mixer =
#define ABASEB_WHISTLE_SND NODE_12
#define ABASEB_CROWD_SND NODE_13
-DISCRETE_SOUND_START(abaseb)
+DISCRETE_SOUND_START(abaseb_discrete)
/************************************************/
/* Input register mapping for abaseb */
/************************************************/
diff --git a/src/mame/audio/avalnche.cpp b/src/mame/audio/avalnche.cpp
index 9590658a7c4..2803c2da03a 100644
--- a/src/mame/audio/avalnche.cpp
+++ b/src/mame/audio/avalnche.cpp
@@ -55,7 +55,7 @@ static const discrete_lfsr_desc avalnche_lfsr={
#define AVALNCHE_AUD2_SND NODE_12
#define AVALNCHE_SOUNDLVL_AUD0_SND NODE_13
-static DISCRETE_SOUND_START(avalnche)
+static DISCRETE_SOUND_START(avalnche_discrete)
/************************************************/
/* avalnche Effects Relataive Gain Table */
/* */
@@ -106,8 +106,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(avalnche_state::avalnche_sound)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(avalnche)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, avalnche_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_MODIFY("latch")
diff --git a/src/mame/audio/bsktball.cpp b/src/mame/audio/bsktball.cpp
index 3322c33dc92..287d6523d6e 100644
--- a/src/mame/audio/bsktball.cpp
+++ b/src/mame/audio/bsktball.cpp
@@ -86,7 +86,7 @@ static const discrete_mixer_desc bsktball_mixer =
#define BSKTBALL_NOTE_SND NODE_12
#define BSKTBALL_CROWD_SND NODE_13
-DISCRETE_SOUND_START(bsktball)
+DISCRETE_SOUND_START(bsktball_discrete)
/************************************************/
/* Input register mapping for bsktball */
/************************************************/
diff --git a/src/mame/audio/bwidow.cpp b/src/mame/audio/bwidow.cpp
index 5bb074aefa3..1d0c55bab27 100644
--- a/src/mame/audio/bwidow.cpp
+++ b/src/mame/audio/bwidow.cpp
@@ -71,7 +71,7 @@ static discrete_mixer_desc bwidow_mixer = {
1.0 /* gain */
};
-static DISCRETE_SOUND_START(bwidow)
+static DISCRETE_SOUND_START(bwidow_discrete)
/************************************************/
/* FINAL MIX */
@@ -130,7 +130,7 @@ static discrete_mixer_desc gravitar_mixer = {
};
-static DISCRETE_SOUND_START(gravitar)
+static DISCRETE_SOUND_START(gravitar_discrete)
/************************************************/
/* FINAL MIX */
@@ -162,8 +162,7 @@ MACHINE_CONFIG_START(bwidow_state::bwidow_audio)
MCFG_POKEY_OUTPUT_OPAMP(BW_R47, BW_C32, 5.0)
MCFG_SOUND_ROUTE(0, "discrete", 1.0, 1)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(bwidow)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, bwidow_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -176,5 +175,5 @@ MACHINE_CONFIG_START(bwidow_state::gravitar_audio)
MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(BW_R51, GRAV_C34, 5.0) /* BW_C31 ignored */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(gravitar)
+ MCFG_DISCRETE_INTF(gravitar_discrete)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/bzone.cpp b/src/mame/audio/bzone.cpp
index cf7d7f00b37..b5a912b3b0c 100644
--- a/src/mame/audio/bzone.cpp
+++ b/src/mame/audio/bzone.cpp
@@ -277,7 +277,7 @@ DISCRETE_RESET(bzone_custom_filter)
*
*************************************/
-static DISCRETE_SOUND_START(bzone)
+static DISCRETE_SOUND_START(bzone_discrete)
/************************************************/
/* Input register mapping for Battlezone */
@@ -406,8 +406,7 @@ MACHINE_CONFIG_START(bzone_state::bzone_audio)
MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0)
MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(bzone)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, bzone_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/canyon.cpp b/src/mame/audio/canyon.cpp
index 7e65dc0f6cd..2819659e030 100644
--- a/src/mame/audio/canyon.cpp
+++ b/src/mame/audio/canyon.cpp
@@ -62,7 +62,7 @@ static const discrete_lfsr_desc canyon_lfsr =
#define CANYON_WHISTLESND2 NODE_14
#define CANYON_NOISE NODE_15
-DISCRETE_SOUND_START(canyon)
+DISCRETE_SOUND_START(canyon_discrete)
/************************************************/
/* Canyon sound system: 5 Sound Sources */
/* Relative Volume */
diff --git a/src/mame/audio/circus.cpp b/src/mame/audio/circus.cpp
index c8bc072f69d..b589d1ccc5a 100644
--- a/src/mame/audio/circus.cpp
+++ b/src/mame/audio/circus.cpp
@@ -47,7 +47,7 @@ const char *const robotbwl_sample_names[] =
/* Nodes - Sounds */
#define CIRCUS_MUSIC_SND NODE_10
-DISCRETE_SOUND_START(circus)
+DISCRETE_SOUND_START(circus_discrete)
/************************************************/
/* Input register mapping for circus */
/************************************************/
@@ -94,7 +94,7 @@ static const discrete_555_desc crash_beeper_555a =
#define CRASH_MUSIC_SND NODE_20
#define CRASH_BEEPER_SND NODE_21
-DISCRETE_SOUND_START(crash)
+DISCRETE_SOUND_START(crash_discrete)
/************************************************/
/* Input register mapping for crash */
/************************************************/
@@ -129,7 +129,7 @@ DISCRETE_SOUND_END
/* Nodes - Sounds */
#define ROBOTBWL_MUSIC_SND NODE_10
-DISCRETE_SOUND_START(robotbwl)
+DISCRETE_SOUND_START(robotbwl_discrete)
/************************************************/
/* Input register mapping for robotbwl */
/************************************************/
diff --git a/src/mame/audio/cliffhgr.cpp b/src/mame/audio/cliffhgr.cpp
index 2fdc02ca88e..ac64627f5eb 100644
--- a/src/mame/audio/cliffhgr.cpp
+++ b/src/mame/audio/cliffhgr.cpp
@@ -28,9 +28,8 @@ static const discrete_mixer_desc desc_cliffhgr_mixer =
8
};
-DISCRETE_SOUND_EXTERN(cliffhgr);
-DISCRETE_SOUND_START(cliffhgr)
+DISCRETE_SOUND_START(cliffhgr_discrete)
DISCRETE_INPUT_LOGIC(CLIFF_ENABLE_SND_1)
DISCRETE_INPUT_LOGIC(CLIFF_ENABLE_SND_2)
diff --git a/src/mame/audio/cliffhgr.h b/src/mame/audio/cliffhgr.h
index 340b043debe..8c2bf06b297 100644
--- a/src/mame/audio/cliffhgr.h
+++ b/src/mame/audio/cliffhgr.h
@@ -7,6 +7,6 @@
#include "sound/discrete.h"
-DISCRETE_SOUND_EXTERN( cliffhgr );
+DISCRETE_SOUND_EXTERN( cliffhgr_discrete );
#endif // MAME_AUDIO_CLIFFHGR_H
diff --git a/src/mame/audio/copsnrob.cpp b/src/mame/audio/copsnrob.cpp
index 986537bb7db..0b4e04eb07a 100644
--- a/src/mame/audio/copsnrob.cpp
+++ b/src/mame/audio/copsnrob.cpp
@@ -590,7 +590,7 @@ DISCRETE_RESET(copsnrob_zings_555_astable)
************************************************/
-static DISCRETE_SOUND_START(copsnrob)
+static DISCRETE_SOUND_START(copsnrob_discrete)
/************************************************
* Input register mapping
@@ -699,8 +699,7 @@ MACHINE_CONFIG_START(copsnrob_state::copsnrob_audio)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(copsnrob)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, copsnrob_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
diff --git a/src/mame/audio/crbaloon.cpp b/src/mame/audio/crbaloon.cpp
index 8ed2352e89c..4e1e15d6590 100644
--- a/src/mame/audio/crbaloon.cpp
+++ b/src/mame/audio/crbaloon.cpp
@@ -89,7 +89,7 @@ static const discrete_dac_r1_ladder desc_crbaloon_music_dac =
-static DISCRETE_SOUND_START(crbaloon)
+static DISCRETE_SOUND_START(crbaloon_discrete)
/************************************************
* Input register mapping
@@ -158,7 +158,6 @@ MACHINE_CONFIG_START(crbaloon_state::crbaloon_audio)
MCFG_SN76477_ENABLE(0) // enable
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(crbaloon)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, crbaloon_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/dkong.cpp b/src/mame/audio/dkong.cpp
index 70e06f7b597..490248e6ef6 100644
--- a/src/mame/audio/dkong.cpp
+++ b/src/mame/audio/dkong.cpp
@@ -342,7 +342,7 @@ DISCRETE_RESET( dkong_custom_mixer )
#endif
-static DISCRETE_SOUND_START(dkong2b)
+static DISCRETE_SOUND_START(dkong2b_discrete)
/************************************************/
/* Input register mapping for dkong */
@@ -620,7 +620,7 @@ static const discrete_dss_inverter_osc_node::description radarscp_inverter_osc_d
discrete_dss_inverter_osc_node::IS_TYPE3
};
-static DISCRETE_SOUND_START(radarscp)
+static DISCRETE_SOUND_START(radarscp_discrete)
/************************************************/
/* Input register mapping for radarscp */
@@ -853,7 +853,7 @@ static const discrete_lfsr_desc dkongjr_lfsr =
#define DS_SOUND9_EN DS_SOUND9_INV
-static DISCRETE_SOUND_START(dkongjr)
+static DISCRETE_SOUND_START(dkongjr_discrete)
/************************************************/
/* Input register mapping for dkongjr */
@@ -1353,14 +1353,14 @@ MACHINE_CONFIG_START(dkong_state::dkong2b_audio)
MCFG_MCS48_PORT_T1_IN_CB(READLINE("ls259.6h", latch8_device, bit4_q_r))
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DISCRETE_ADD("discrete", 0, dkong2b)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, dkong2b_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
MACHINE_CONFIG_START(dkong_state::radarscp_audio)
dkong2b_audio(config);
- MCFG_DISCRETE_REPLACE("discrete", 0, radarscp)
+ MCFG_DEVICE_REPLACE("discrete", DISCRETE, radarscp_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.7)
MACHINE_CONFIG_END
@@ -1427,7 +1427,7 @@ MACHINE_CONFIG_START(dkong_state::dkongjr_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DISCRETE_ADD("discrete", 0, dkongjr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, dkongjr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/dragrace.cpp b/src/mame/audio/dragrace.cpp
index c4de9473287..5c84331ce4e 100644
--- a/src/mame/audio/dragrace.cpp
+++ b/src/mame/audio/dragrace.cpp
@@ -40,7 +40,7 @@ static const discrete_lfsr_desc dragrace_lfsr =
#define DRAGRACE_MOTOR1_SND NODE_18
#define DRAGRACE_MOTOR2_SND NODE_19
-DISCRETE_SOUND_START(dragrace)
+DISCRETE_SOUND_START(dragrace_discrete)
/************************************************/
/* dragrace Effects Relataive Gain Table */
/* */
diff --git a/src/mame/audio/firetrk.cpp b/src/mame/audio/firetrk.cpp
index 74269247cf4..562423e5391 100644
--- a/src/mame/audio/firetrk.cpp
+++ b/src/mame/audio/firetrk.cpp
@@ -180,7 +180,7 @@ static const discrete_mixer_desc firetrk_mixer =
#define FIRETRUCK_BELLSND NODE_17
#define FIRETRUCK_XTNDPLYSND NODE_18
-DISCRETE_SOUND_START(firetrk)
+DISCRETE_SOUND_START(firetrk_discrete)
/************************************************/
/* Input register mapping for firetruck */
/************************************************/
@@ -387,7 +387,7 @@ static const discrete_mixer_desc superbug_mixer =
#define SUPERBUG_SCREECHSND NODE_13
#define SUPERBUG_ASRSND NODE_14
-DISCRETE_SOUND_START(superbug)
+DISCRETE_SOUND_START(superbug_discrete)
/************************************************/
/* Input register mapping for superbug */
/************************************************/
@@ -568,7 +568,7 @@ static const discrete_mixer_desc montecar_mixer =
#define MONTECAR_BANGSND NODE_13
#define MONTECAR_SCREECHSND NODE_14
-DISCRETE_SOUND_START(montecar)
+DISCRETE_SOUND_START(montecar_discrete)
/************************************************/
/* Input register mapping for montecar */
/************************************************/
diff --git a/src/mame/audio/galaga.cpp b/src/mame/audio/galaga.cpp
index de76a62ba13..03bd0d4e3ac 100644
--- a/src/mame/audio/galaga.cpp
+++ b/src/mame/audio/galaga.cpp
@@ -127,7 +127,7 @@ static const discrete_mixer_desc bosco_final_mixer =
462000 /* gain */
};
-DISCRETE_SOUND_START(bosco)
+DISCRETE_SOUND_START(bosco_discrete)
/************************************************
* Input register mapping
@@ -307,7 +307,7 @@ static const discrete_mixer_desc galaga_final_mixer =
40800, /* gain */
};
-DISCRETE_SOUND_START(galaga)
+DISCRETE_SOUND_START(galaga_discrete)
/************************************************
* Input register mapping
diff --git a/src/mame/audio/galaxian.cpp b/src/mame/audio/galaxian.cpp
index ec0e9fc6801..bdb4d18816c 100644
--- a/src/mame/audio/galaxian.cpp
+++ b/src/mame/audio/galaxian.cpp
@@ -244,7 +244,7 @@ static const discrete_op_amp_filt_info galaxian_bandpass_desc =
*************************************/
-static DISCRETE_SOUND_START(galaxian)
+static DISCRETE_SOUND_START(galaxian_discrete)
/************************************************/
/* Input register mapping for galaxian */
@@ -376,8 +376,8 @@ static DISCRETE_SOUND_START(galaxian)
DISCRETE_SOUND_END
-static DISCRETE_SOUND_START(mooncrst)
- DISCRETE_IMPORT(galaxian)
+static DISCRETE_SOUND_START(mooncrst_discrete)
+ DISCRETE_IMPORT(galaxian_discrete)
/************************************************/
/* Moon Cresta mixing stage */
@@ -501,8 +501,7 @@ MACHINE_CONFIG_START(galaxold_state::galaxian_audio)
MCFG_DEVICE_ADD("cust", GALAXIAN, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
- MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE)
- MCFG_DISCRETE_INTF(galaxian)
+ MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE, galaxian_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -511,8 +510,7 @@ MACHINE_CONFIG_START(galaxold_state::mooncrst_audio)
MCFG_DEVICE_ADD("cust", GALAXIAN, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
- MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE)
- MCFG_DISCRETE_INTF(mooncrst)
+ MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE, mooncrst_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -522,8 +520,7 @@ MACHINE_CONFIG_START(galaxian_state::galaxian_audio)
MCFG_DEVICE_ADD("cust", GALAXIAN, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
- MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE)
- MCFG_DISCRETE_INTF(galaxian)
+ MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE, galaxian_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -532,8 +529,6 @@ MACHINE_CONFIG_START(galaxian_state::mooncrst_audio)
MCFG_DEVICE_ADD("cust", GALAXIAN, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
- MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE)
- MCFG_DISCRETE_INTF(mooncrst)
-
+ MCFG_DEVICE_ADD(GAL_AUDIO, DISCRETE, mooncrst_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/grchamp.cpp b/src/mame/audio/grchamp.cpp
index c4600a957ac..729fc9fe9d4 100644
--- a/src/mame/audio/grchamp.cpp
+++ b/src/mame/audio/grchamp.cpp
@@ -36,7 +36,7 @@ static const discrete_dac_r1_ladder grchamp_sound_dac2 =
/* Nodes - Sounds */
-DISCRETE_SOUND_START(grchamp)
+DISCRETE_SOUND_START(grchamp_discrete)
/************************************************/
/* Input register mapping for grand champion */
diff --git a/src/mame/audio/hitme.cpp b/src/mame/audio/hitme.cpp
index 1a7ed091c42..10ab8b0c698 100644
--- a/src/mame/audio/hitme.cpp
+++ b/src/mame/audio/hitme.cpp
@@ -35,7 +35,7 @@ static const discrete_comp_adder_table desc_hitme_adder =
#define HITME_FINAL_SND NODE_90
-DISCRETE_SOUND_START(hitme)
+DISCRETE_SOUND_START(hitme_discrete)
/* These are the inputs; PULSE-type inputs are used for oneshot latching signals */
DISCRETE_INPUT_DATA (HITME_DOWNCOUNT_VAL)
diff --git a/src/mame/audio/irem.cpp b/src/mame/audio/irem.cpp
index 3b0dc6844ba..5187c93c814 100644
--- a/src/mame/audio/irem.cpp
+++ b/src/mame/audio/irem.cpp
@@ -321,7 +321,7 @@ static const discrete_mixer_desc m52_sound_c_mix1 =
CAP_U(1), /* cAmp */
0, 1};
-static DISCRETE_SOUND_START( m52_sound_c )
+static DISCRETE_SOUND_START( m52_sound_c_discrete )
/* Chip AY8910/1 */
DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
@@ -502,8 +502,7 @@ MACHINE_CONFIG_START(m52_soundc_audio_device::device_add_mconfig)
MCFG_MSM5205_PRESCALER_SELECTOR(S96_4B) /* default to 4KHz, but can be changed at run time */
MCFG_SOUND_ROUTE(0, "filtermix", 1.0, 2)
- MCFG_DEVICE_ADD("filtermix", DISCRETE)
- MCFG_DISCRETE_INTF(m52_sound_c)
+ MCFG_DEVICE_ADD("filtermix", DISCRETE, m52_sound_c_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/llander.cpp b/src/mame/audio/llander.cpp
index 1a35dc7c443..b29eb4dba67 100644
--- a/src/mame/audio/llander.cpp
+++ b/src/mame/audio/llander.cpp
@@ -41,7 +41,7 @@ static const discrete_lfsr_desc llander_lfsr =
14 /* Output bit */
};
-static DISCRETE_SOUND_START(llander)
+static DISCRETE_SOUND_START(llander_discrete)
/************************************************/
/* llander Effects Relataive Gain Table */
/* */
@@ -101,7 +101,6 @@ WRITE8_MEMBER(asteroid_state::llander_sounds_w)
MACHINE_CONFIG_START(asteroid_state::llander_sound)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(llander)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, llander_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/m79amb.cpp b/src/mame/audio/m79amb.cpp
index f826e091533..0d989b357d0 100644
--- a/src/mame/audio/m79amb.cpp
+++ b/src/mame/audio/m79amb.cpp
@@ -136,7 +136,7 @@ static const discrete_mixer_desc m79amb_final_mix =
1 /* gain */
};
-DISCRETE_SOUND_START( m79amb )
+DISCRETE_SOUND_START( m79amb_discrete )
/************************************************
* Input register mapping
************************************************/
diff --git a/src/mame/audio/madalien.cpp b/src/mame/audio/madalien.cpp
index 59990445d3e..067330ee24a 100644
--- a/src/mame/audio/madalien.cpp
+++ b/src/mame/audio/madalien.cpp
@@ -126,7 +126,7 @@ static const discrete_mixer_desc madalien_final_mix =
32768.0/DEFAULT_TTL_V_LOGIC_1 // final gain
};
-DISCRETE_SOUND_START( madalien )
+DISCRETE_SOUND_START( madalien_discrete )
/************************************************
* Input register mapping
************************************************/
diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp
index 31aa82269a6..07d13d2c313 100644
--- a/src/mame/audio/mario.cpp
+++ b/src/mame/audio/mario.cpp
@@ -148,7 +148,7 @@
#define LS629_FREQ_R_IN RES_K(90)
-static DISCRETE_SOUND_START(mario)
+static DISCRETE_SOUND_START(mario_discrete)
/************************************************
* Input register mapping for mario
diff --git a/src/mame/audio/mw8080bw.cpp b/src/mame/audio/mw8080bw.cpp
index 1a3d4b602e4..a2b64a7da4b 100644
--- a/src/mame/audio/mw8080bw.cpp
+++ b/src/mame/audio/mw8080bw.cpp
@@ -276,7 +276,7 @@ WRITE8_MEMBER(mw8080bw_state::gunfight_audio_w)
#define TORNBASE_TONE_SND_FILT NODE_11
-static DISCRETE_SOUND_START(tornbase)
+static DISCRETE_SOUND_START(tornbase_discrete)
/* the 3 enable lines coming out of the 74175 flip-flop at G5 */
DISCRETE_INPUT_LOGIC(TORNBASE_TONE_240_EN) /* pin 2 */
@@ -309,8 +309,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::tornbase_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(tornbase)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, tornbase_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
MACHINE_CONFIG_END
@@ -462,7 +461,7 @@ static const discrete_op_amp_osc_info maze_op_amp_osc =
};
-static DISCRETE_SOUND_START(maze)
+static DISCRETE_SOUND_START(maze_discrete)
/************************************************
* Input register mapping
@@ -555,8 +554,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::maze_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(maze)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, maze_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -730,7 +728,7 @@ static const discrete_mixer_desc boothill_r_mixer =
};
-static DISCRETE_SOUND_START(boothill)
+static DISCRETE_SOUND_START(boothill_discrete)
/************************************************
* Input register mapping
@@ -802,8 +800,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::boothill_audio)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(boothill)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, boothill_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -934,7 +931,7 @@ static const discrete_mixer_desc checkmat_mixer =
1 /* gain */
};
-static DISCRETE_SOUND_START(checkmat)
+static DISCRETE_SOUND_START(checkmat_discrete)
/************************************************
* Input register mapping
@@ -1032,8 +1029,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::checkmat_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(checkmat)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, checkmat_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4)
MACHINE_CONFIG_END
@@ -1173,7 +1169,7 @@ static const discrete_mixer_desc desertgu_mixer =
};
-static DISCRETE_SOUND_START(desertgu)
+static DISCRETE_SOUND_START(desertgu_discrete)
/************************************************
* Input register mapping
@@ -1243,8 +1239,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::desertgu_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(desertgu)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, desertgu_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
MACHINE_CONFIG_END
@@ -1441,7 +1436,7 @@ static const discrete_mixer_desc dplay_mixer =
};
-static DISCRETE_SOUND_START(dplay)
+static DISCRETE_SOUND_START(dplay_discrete)
/************************************************
* Input register mapping
@@ -1508,8 +1503,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::dplay_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(dplay)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, dplay_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
MACHINE_CONFIG_END
@@ -1831,7 +1825,7 @@ static const discrete_mixer_desc clowns_mixer =
};
-static DISCRETE_SOUND_START(clowns)
+static DISCRETE_SOUND_START(clowns_discrete)
/************************************************
* Input register mapping
@@ -1905,8 +1899,7 @@ MACHINE_CONFIG_START(mw8080bw_state::clowns_audio)
MCFG_SAMPLES_NAMES(clowns_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(clowns)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, clowns_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
@@ -2158,7 +2151,7 @@ DISCRETE_FILTER2(NODE_RELATIVE(NODE_37, _num),
DISCRETE_GAIN(NODE_RELATIVE(SPACWALK_SPRINGBOARD_HIT1_SND, _num - 1), \
NODE_RELATIVE(NODE_37, _num), 0.5)
- static DISCRETE_SOUND_START(spacwalk)
+ static DISCRETE_SOUND_START(spacwalk_discrete)
/************************************************
* Input register mapping
@@ -2271,8 +2264,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::spacwalk_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(spacwalk)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, spacwalk_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -2424,7 +2416,7 @@ static const discrete_mixer_desc shuffle_mixer =
};
-static DISCRETE_SOUND_START(shuffle)
+static DISCRETE_SOUND_START(shuffle_discrete)
DISCRETE_INPUT_LOGIC(SHUFFLE_ROLLING_1_EN)
DISCRETE_INPUT_LOGIC(SHUFFLE_ROLLING_2_EN)
DISCRETE_INPUT_LOGIC(SHUFFLE_ROLLING_3_EN)
@@ -2500,8 +2492,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::shuffle_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(shuffle)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, shuffle_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -2622,7 +2613,7 @@ static const discrete_mixer_desc dogpatch_r_mixer =
};
-static DISCRETE_SOUND_START(dogpatch)
+static DISCRETE_SOUND_START(dogpatch_discrete)
/************************************************
* Input register mapping
************************************************/
@@ -2679,8 +2670,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::dogpatch_audio)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(dogpatch)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, dogpatch_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -2969,7 +2959,7 @@ static const discrete_mixer_desc spcenctr_mixer =
};
-static DISCRETE_SOUND_START(spcenctr)
+static DISCRETE_SOUND_START(spcenctr_discrete)
/************************************************
* Input register mapping
@@ -3201,8 +3191,7 @@ MACHINE_CONFIG_START(mw8080bw_state::spcenctr_audio)
MCFG_SN76477_ENABLE(1) // enable
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(spcenctr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, spcenctr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
MACHINE_CONFIG_END
@@ -3364,7 +3353,7 @@ static const discrete_op_amp_tvca_info bowler_fowl_tvca =
};
-static DISCRETE_SOUND_START(bowler)
+static DISCRETE_SOUND_START(bowler_discrete)
/************************************************
* Input register mapping
@@ -3401,8 +3390,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::bowler_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(bowler)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, bowler_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
MACHINE_CONFIG_END
@@ -4083,7 +4071,7 @@ static const discrete_mixer_desc invaders_mixer =
/* Schematic M051-00739-A005 and M051-00739-B005 */
/* P.C. A084-90700-B000 and A084-90700-C000 */
-static DISCRETE_SOUND_START(invaders)
+static DISCRETE_SOUND_START(invaders_discrete)
INVADERS_NOISE_GENERATOR
INVADERS_SAUCER_HIT(1)
INVADERS_FLEET(1)
@@ -4114,8 +4102,7 @@ MACHINE_CONFIG_START(mw8080bw_state::invaders_audio)
MCFG_SN76477_ENABLE(1) // enable
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(invaders)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, invaders_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
MACHINE_CONFIG_END
@@ -4387,7 +4374,7 @@ static const discrete_mixer_desc blueshrk_mixer =
0, 0, 0, BLUESHRK_C900, 0, 1 /* rI, rF, cF, cAmp, vRef, gain */
};
-static DISCRETE_SOUND_START(blueshrk)
+static DISCRETE_SOUND_START(blueshrk_discrete)
/************************************************
* Input register mapping
@@ -4515,8 +4502,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::blueshrk_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(blueshrk)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, blueshrk_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
@@ -4649,7 +4635,7 @@ static const discrete_mixer_desc invad2ct_mixer =
};
-static DISCRETE_SOUND_START(invad2ct)
+static DISCRETE_SOUND_START(invad2ct_discrete)
/* sound board 1 */
/* P.C. A082-90700-A000 */
/* Schematic M051-00851-A002 */
@@ -4678,8 +4664,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(mw8080bw_state::invad2ct_audio)
MCFG_SPEAKER_STANDARD_STEREO("spk1", "spk2")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(invad2ct)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, invad2ct_discrete)
MCFG_SOUND_ROUTE(0, "spk1", 0.5)
MCFG_SOUND_ROUTE(1, "spk2", 0.5)
diff --git a/src/mame/audio/nitedrvr.cpp b/src/mame/audio/nitedrvr.cpp
index e3a0c5000a7..a005627758a 100644
--- a/src/mame/audio/nitedrvr.cpp
+++ b/src/mame/audio/nitedrvr.cpp
@@ -34,7 +34,7 @@ static const discrete_lfsr_desc nitedrvr_lfsr =
#define NITEDRVR_SCREECH1_SND NODE_13
#define NITEDRVR_SCREECH2_SND NODE_14
-DISCRETE_SOUND_START(nitedrvr)
+DISCRETE_SOUND_START(nitedrvr_discrete)
/************************************************/
/* nitedrvr Effects Relataive Gain Table */
/* */
diff --git a/src/mame/audio/norautp.cpp b/src/mame/audio/norautp.cpp
index 73eaf1fa12b..b0a6af312f2 100644
--- a/src/mame/audio/norautp.cpp
+++ b/src/mame/audio/norautp.cpp
@@ -30,7 +30,7 @@ static const discrete_comp_adder_table desc_##_name##_caps = \
} \
}; \
\
-DISCRETE_SOUND_START( _name ) \
+DISCRETE_SOUND_START( _name##_discrete ) \
/************************************************ \
* Input register mapping \
************************************************/ \
diff --git a/src/mame/audio/orbit.cpp b/src/mame/audio/orbit.cpp
index 2deacd5afb3..47d5eee7051 100644
--- a/src/mame/audio/orbit.cpp
+++ b/src/mame/audio/orbit.cpp
@@ -65,7 +65,7 @@ static const discrete_lfsr_desc orbit_lfsr =
#define ORBIT_ANOTE2_SND NODE_14
#define ORBIT_WARNING_SND NODE_15
-DISCRETE_SOUND_START(orbit)
+DISCRETE_SOUND_START(orbit_discrete)
/************************************************/
/* orbit Effects Relataive Gain Table */
/* */
diff --git a/src/mame/audio/phoenix.cpp b/src/mame/audio/phoenix.cpp
index 6f057b194d3..7b7fd0d4915 100644
--- a/src/mame/audio/phoenix.cpp
+++ b/src/mame/audio/phoenix.cpp
@@ -341,7 +341,7 @@ static const discrete_mixer_desc phoenix_mixer =
#define PHOENIX_EFFECT_4_SND 0
-DISCRETE_SOUND_START(phoenix)
+DISCRETE_SOUND_START(phoenix_discrete)
/************************************************/
/* Input register mapping for phoenix */
/************************************************/
diff --git a/src/mame/audio/phoenix.h b/src/mame/audio/phoenix.h
index 1492f39d227..c59d8fb1640 100644
--- a/src/mame/audio/phoenix.h
+++ b/src/mame/audio/phoenix.h
@@ -57,6 +57,6 @@ private:
DECLARE_DEVICE_TYPE(PHOENIX_SOUND, phoenix_sound_device)
-DISCRETE_SOUND_EXTERN(phoenix);
+DISCRETE_SOUND_EXTERN(phoenix_discrete);
#endif // MAME_AUDIO_PHOENIX_H
diff --git a/src/mame/audio/polepos.cpp b/src/mame/audio/polepos.cpp
index ee706143f4e..f911dd2ae2e 100644
--- a/src/mame/audio/polepos.cpp
+++ b/src/mame/audio/polepos.cpp
@@ -421,7 +421,7 @@ static const discrete_op_amp_filt_info polepos_chanl3_filt =
};
-DISCRETE_SOUND_START(polepos)
+DISCRETE_SOUND_START(polepos_discrete)
/************************************************
* Input register mapping
diff --git a/src/mame/audio/polepos.h b/src/mame/audio/polepos.h
index 6fe6f12e710..97b954921ad 100644
--- a/src/mame/audio/polepos.h
+++ b/src/mame/audio/polepos.h
@@ -52,6 +52,6 @@ private:
DECLARE_DEVICE_TYPE(POLEPOS_SOUND, polepos_sound_device)
-DISCRETE_SOUND_EXTERN( polepos );
+DISCRETE_SOUND_EXTERN( polepos_discrete );
#endif // MAME_AUDIO_POLEPOS_H
diff --git a/src/mame/audio/poolshrk.cpp b/src/mame/audio/poolshrk.cpp
index 2f030135d3a..ab4ca35ff5c 100644
--- a/src/mame/audio/poolshrk.cpp
+++ b/src/mame/audio/poolshrk.cpp
@@ -55,7 +55,7 @@ static const discrete_mixer_desc poolshrk_mixer =
#define POOLSHRK_CLICK_SND NODE_12
#define POOLSHRK_SCORE_SND NODE_13
-DISCRETE_SOUND_START(poolshrk)
+DISCRETE_SOUND_START(poolshrk_discrete)
/************************************************/
/* Input register mapping for poolshrk */
/************************************************/
diff --git a/src/mame/audio/qix.cpp b/src/mame/audio/qix.cpp
index fcd9a2128e1..4d9c8543501 100644
--- a/src/mame/audio/qix.cpp
+++ b/src/mame/audio/qix.cpp
@@ -59,7 +59,7 @@ static const discrete_comp_adder_table qix_attn_table =
{RES_K(22)+250, RES_K(10)+250, RES_K(5.6)+250, RES_K(3.3)+250}
};
-static DISCRETE_SOUND_START(qix)
+static DISCRETE_SOUND_START(qix_discrete)
/* NODE */
DISCRETE_INPUTX_DATA(QIX_DAC_DATA, 128, -128*128, 128)
DISCRETE_INPUT_DATA (QIX_VOL_DATA)
@@ -198,8 +198,7 @@ MACHINE_CONFIG_START(qix_state::qix_audio)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(qix)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, qix_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/skydiver.cpp b/src/mame/audio/skydiver.cpp
index 33377f6fe21..dc1a303d9de 100644
--- a/src/mame/audio/skydiver.cpp
+++ b/src/mame/audio/skydiver.cpp
@@ -43,7 +43,7 @@ static const discrete_lfsr_desc skydiver_lfsr =
#define SKYDIVER_WHISTLE1_SND NODE_13
#define SKYDIVER_WHISTLE2_SND NODE_14
-DISCRETE_SOUND_START(skydiver)
+DISCRETE_SOUND_START(skydiver_discrete)
/************************************************/
/* skydiver Effects Relative Gain Table */
/* */
diff --git a/src/mame/audio/skyraid.cpp b/src/mame/audio/skyraid.cpp
index faf3d1e254e..75e9eac3397 100644
--- a/src/mame/audio/skyraid.cpp
+++ b/src/mame/audio/skyraid.cpp
@@ -184,7 +184,7 @@ DISCRETE_RESET( skyraid_missle_custom_charge )
-DISCRETE_SOUND_START( skyraid )
+DISCRETE_SOUND_START( skyraid_discrete )
/************************************************
* Input register mapping
************************************************/
diff --git a/src/mame/audio/snk6502.cpp b/src/mame/audio/snk6502.cpp
index 62c644f6e6e..c08fd88880d 100644
--- a/src/mame/audio/snk6502.cpp
+++ b/src/mame/audio/snk6502.cpp
@@ -108,7 +108,7 @@ static const discrete_op_amp_filt_info fantasy_filter =
#define FANTASY_NOISE_STREAM_IN NODE_02
#define FANTASY_NOISE_LOGIC NODE_03
-DISCRETE_SOUND_START( fantasy )
+DISCRETE_SOUND_START( fantasy_discrete )
DISCRETE_INPUT_LOGIC (FANTASY_BOMB_EN)
DISCRETE_INPUT_STREAM(FANTASY_NOISE_STREAM_IN, 0)
diff --git a/src/mame/audio/snk6502.h b/src/mame/audio/snk6502.h
index bd03457376e..195135b47b5 100644
--- a/src/mame/audio/snk6502.h
+++ b/src/mame/audio/snk6502.h
@@ -77,7 +77,7 @@ private:
DECLARE_DEVICE_TYPE(SNK6502, snk6502_sound_device)
-DISCRETE_SOUND_EXTERN( fantasy );
+DISCRETE_SOUND_EXTERN( fantasy_discrete );
extern char const *const sasuke_sample_names[];
extern char const *const vanguard_sample_names[];
diff --git a/src/mame/audio/spiders.cpp b/src/mame/audio/spiders.cpp
index ffd8f774133..03b736c8455 100644
--- a/src/mame/audio/spiders.cpp
+++ b/src/mame/audio/spiders.cpp
@@ -110,7 +110,7 @@ static const discrete_555_desc spiders_super_web_555a =
#define SPIDERS_SW NODE_13
#define SPIDERS_X NODE_14
-static DISCRETE_SOUND_START(spiders)
+static DISCRETE_SOUND_START(spiders_discrete)
/************************************************/
/* Input register mapping for spiders */
@@ -208,7 +208,6 @@ WRITE8_MEMBER(spiders_state::spiders_audio_ctrl_w)
MACHINE_CONFIG_START(spiders_state::spiders_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(spiders)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, spiders_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/sprint2.cpp b/src/mame/audio/sprint2.cpp
index f0f7df6925e..b5cff7b1946 100644
--- a/src/mame/audio/sprint2.cpp
+++ b/src/mame/audio/sprint2.cpp
@@ -102,7 +102,7 @@ static const discrete_mixer_desc sprint2_mixer =
#define SPRINT2_1V SPRINT2_HSYNC/2
#define SPRINT2_2V SPRINT2_1V/2
-DISCRETE_SOUND_START(sprint2)
+DISCRETE_SOUND_START(sprint2_discrete)
/************************************************/
/* Input register mapping for sprint2 */
@@ -227,7 +227,7 @@ DISCRETE_SOUND_START(sprint2)
DISCRETE_SOUND_END
-DISCRETE_SOUND_START(sprint1)
+DISCRETE_SOUND_START(sprint1_discrete)
/************************************************/
/* Input register mapping for sprint1 */
@@ -361,7 +361,7 @@ static const discrete_mixer_desc dominos_mixer =
/* Nodes - Adjusters */
#define DOMINOS_R23 NODE_15
-DISCRETE_SOUND_START(dominos)
+DISCRETE_SOUND_START(dominos_discrete)
/************************************************/
/* Input register mapping for dominos */
/************************************************/
diff --git a/src/mame/audio/sprint4.cpp b/src/mame/audio/sprint4.cpp
index 5a8aef449e1..51e86a9b72b 100644
--- a/src/mame/audio/sprint4.cpp
+++ b/src/mame/audio/sprint4.cpp
@@ -276,7 +276,7 @@ static const discrete_mixer_desc sprint4_mixer =
-DISCRETE_SOUND_START(sprint4)
+DISCRETE_SOUND_START(sprint4_discrete)
SPRINT4_ATTRACT
SPRINT4_PLAYER_MOTOR(1)
SPRINT4_PLAYER_MOTOR(2)
@@ -292,7 +292,7 @@ DISCRETE_SOUND_START(sprint4)
DISCRETE_SOUND_END
-DISCRETE_SOUND_START(ultratnk)
+DISCRETE_SOUND_START(ultratnk_discrete)
SPRINT4_ATTRACT
SPRINT4_PLAYER_MOTOR(1)
SPRINT4_PLAYER_MOTOR(2)
diff --git a/src/mame/audio/sprint4.h b/src/mame/audio/sprint4.h
index 855e919c725..bec2100eee8 100644
--- a/src/mame/audio/sprint4.h
+++ b/src/mame/audio/sprint4.h
@@ -29,5 +29,5 @@ Atari Sprint 4 + Ultra Tank Audio
/*----------- defined in audio/sprint4.c -----------*/
-DISCRETE_SOUND_EXTERN( sprint4 );
-DISCRETE_SOUND_EXTERN( ultratnk );
+DISCRETE_SOUND_EXTERN( sprint4_discrete );
+DISCRETE_SOUND_EXTERN( ultratnk_discrete );
diff --git a/src/mame/audio/sprint8.cpp b/src/mame/audio/sprint8.cpp
index ca6d63fa30b..5339365152a 100644
--- a/src/mame/audio/sprint8.cpp
+++ b/src/mame/audio/sprint8.cpp
@@ -169,7 +169,7 @@ DISCRETE_555_MSTABLE(NODE_RELATIVE(NODE_60, _car - 1), 1, NODE_RELATIVE(NODE_50,
DISCRETE_OP_AMP_FILTER(NODE_RELATIVE(SPRINT8_MOTOR1_SND, _car - 1), 1, NODE_RELATIVE(NODE_60, _car - 1), 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &sprint8_motor_filter)
-DISCRETE_SOUND_START( sprint8 )
+DISCRETE_SOUND_START( sprint8_discrete )
/************************************************
* Input register mapping
************************************************/
@@ -305,8 +305,7 @@ MACHINE_CONFIG_START(sprint8_state::sprint8_audio)
MCFG_SPEAKER_ADD("speaker_5_6", 0.0, 0.0, -0.5) /* back */
MCFG_SPEAKER_ADD("speaker_4_8", 0.2, 0.0, 1.0) /* right */
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(sprint8)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, sprint8_discrete)
MCFG_SOUND_ROUTE(0, "speaker_1_2", 1.0)
/* volumes on other channels defaulted to off, */
/* user can turn them up if needed. */
diff --git a/src/mame/audio/starshp1.cpp b/src/mame/audio/starshp1.cpp
index b9f58ada159..f236ae5faab 100644
--- a/src/mame/audio/starshp1.cpp
+++ b/src/mame/audio/starshp1.cpp
@@ -145,7 +145,7 @@ static const discrete_mixer_desc starshp1_final_mix =
};
-DISCRETE_SOUND_START( starshp1 )
+DISCRETE_SOUND_START( starshp1_discrete )
/************************************************
* Input register mapping
************************************************/
diff --git a/src/mame/audio/subs.cpp b/src/mame/audio/subs.cpp
index 40d58bdddfb..cb550ec12a5 100644
--- a/src/mame/audio/subs.cpp
+++ b/src/mame/audio/subs.cpp
@@ -48,7 +48,7 @@ static const discrete_lfsr_desc subs_lfsr =
#define SUBS_CRASH_SND NODE_14
#define SUBS_EXPLODE_SND NODE_15
-DISCRETE_SOUND_START(subs)
+DISCRETE_SOUND_START(subs_discrete)
/************************************************/
/* subs Effects Relataive Gain Table */
/* */
diff --git a/src/mame/audio/tank8.cpp b/src/mame/audio/tank8.cpp
index 506bded19da..4db13355148 100644
--- a/src/mame/audio/tank8.cpp
+++ b/src/mame/audio/tank8.cpp
@@ -113,7 +113,7 @@ static const discrete_dac_r1_ladder tank8_dac =
#define TANK8_A2_LINE NODE_26
-DISCRETE_SOUND_START(tank8)
+DISCRETE_SOUND_START(tank8_discrete)
/************************************************/
/* Tank8 sound system: 10 Sound Sources */
/* Motor 1-8 */
diff --git a/src/mame/audio/triplhnt.cpp b/src/mame/audio/triplhnt.cpp
index ccd478ceb10..d0ddba719d2 100644
--- a/src/mame/audio/triplhnt.cpp
+++ b/src/mame/audio/triplhnt.cpp
@@ -105,7 +105,7 @@ static const discrete_mixer_desc triplhnt_mixer =
#define TRIPLHNT_SCREECH_SND NODE_13
#define POOLSHRK_SCORE_SND NODE_14
-DISCRETE_SOUND_START(triplhnt)
+DISCRETE_SOUND_START(triplhnt_discrete)
/************************************************/
/* Input register mapping for triplhnt */
/************************************************/
diff --git a/src/mame/audio/turbo.cpp b/src/mame/audio/turbo.cpp
index da93ff07c2c..f430001a7ad 100644
--- a/src/mame/audio/turbo.cpp
+++ b/src/mame/audio/turbo.cpp
@@ -616,7 +616,7 @@ static const discrete_555_desc turbo_alarm_555 =
DEFAULT_555_VALUES,
};
-DISCRETE_SOUND_START(turbo)
+DISCRETE_SOUND_START(turbo_discrete)
/************************************************/
/* Input register mapping for turbo */
/************************************************/
diff --git a/src/mame/audio/vicdual.cpp b/src/mame/audio/vicdual.cpp
index cb2f72a1d18..1b2f6af170b 100644
--- a/src/mame/audio/vicdual.cpp
+++ b/src/mame/audio/vicdual.cpp
@@ -58,7 +58,7 @@ static const discrete_mixer_desc frogsMixer =
0, RES_K(56), 0, CAP_U(0.1), 0, 10000
};
-static DISCRETE_SOUND_START(frogs)
+static DISCRETE_SOUND_START(frogs_discrete)
/************************************************
* Input register mapping for frogs
*
@@ -117,8 +117,7 @@ MACHINE_CONFIG_START(vicdual_state::frogs_audio)
MCFG_SAMPLES_NAMES(frogs_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(frogs)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, frogs_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -313,7 +312,7 @@ static const discrete_op_amp_filt_info headon_sallen_key_info =
CAP_N(470), CAP_N(47), 0
};
-static DISCRETE_SOUND_START(headon)
+static DISCRETE_SOUND_START(headon_discrete)
/************************************************
* Input register mapping for headon
*
@@ -447,8 +446,7 @@ DISCRETE_SOUND_END
MACHINE_CONFIG_START(vicdual_state::headon_audio)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(headon)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, headon_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -507,7 +505,7 @@ WRITE8_MEMBER( vicdual_state::invho2_audio_w )
#define BRDRLINE_WALK_TRG_SND NODE_97
#define BRDRLINE_CRY_TRG_SND NODE_98
-DISCRETE_SOUND_START(brdrline)
+DISCRETE_SOUND_START(brdrline_discrete)
/************************************************
* Input register mapping
************************************************/
diff --git a/src/mame/audio/videopin.cpp b/src/mame/audio/videopin.cpp
index 10d3c2c1aae..023cbd06377 100644
--- a/src/mame/audio/videopin.cpp
+++ b/src/mame/audio/videopin.cpp
@@ -20,7 +20,7 @@
#define VIDEOPIN_BELL_SND NODE_11
#define VIDEOPIN_BONG_SND NODE_12
-DISCRETE_SOUND_START(videopin)
+DISCRETE_SOUND_START(videopin_discrete)
/************************************************/
/* videopin Effects Relataive Gain Table */
/* */
diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp
index 06a03a192a2..516ec4a46ca 100644
--- a/src/mame/drivers/8080bw.cpp
+++ b/src/mame/drivers/8080bw.cpp
@@ -1584,8 +1584,7 @@ MACHINE_CONFIG_START(_8080bw_state::schaser)
MCFG_SN76477_ENABLE(1) // enable
MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(schaser)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, schaser_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1924,8 +1923,7 @@ MACHINE_CONFIG_START(_8080bw_state::lupin3)
MCFG_SAMPLES_NAMES(lupin3_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(indianbt)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, indianbt_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -2075,8 +2073,7 @@ MACHINE_CONFIG_START(_8080bw_state::polaris)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(polaris)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, polaris_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -2203,8 +2200,7 @@ MACHINE_CONFIG_START(_8080bw_state::ballbomb)
/* sound hardware */
invaders_samples_audio(config);
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(ballbomb)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, ballbomb_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -2453,8 +2449,7 @@ MACHINE_CONFIG_START(_8080bw_state::indianbt)
/* sound hardware */
invaders_samples_audio(config);
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(indianbt)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, indianbt_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/abc80x.cpp b/src/mame/drivers/abc80x.cpp
index 8f21826e8bf..176355ebbc2 100644
--- a/src/mame/drivers/abc80x.cpp
+++ b/src/mame/drivers/abc80x.cpp
@@ -161,7 +161,7 @@ Notes:
// DISCRETE_SOUND( abc800 )
//-------------------------------------------------
-static DISCRETE_SOUND_START( abc800 )
+static DISCRETE_SOUND_START( abc800_discrete )
DISCRETE_INPUT_LOGIC(NODE_01)
DISCRETE_OUTPUT(NODE_01, 5000)
DISCRETE_SOUND_END
@@ -1162,8 +1162,7 @@ MACHINE_CONFIG_START(abc800c_state::abc800c)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE)
- MCFG_DISCRETE_INTF(abc800)
+ MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, abc800_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
// peripheral hardware
@@ -1238,8 +1237,7 @@ MACHINE_CONFIG_START(abc800m_state::abc800m)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE)
- MCFG_DISCRETE_INTF(abc800)
+ MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, abc800_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
// peripheral hardware
@@ -1316,8 +1314,7 @@ MACHINE_CONFIG_START(abc802_state::abc802)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE)
- MCFG_DISCRETE_INTF(abc800)
+ MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, abc800_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
// peripheral hardware
diff --git a/src/mame/drivers/alinvade.cpp b/src/mame/drivers/alinvade.cpp
index b052de92823..20e15526336 100644
--- a/src/mame/drivers/alinvade.cpp
+++ b/src/mame/drivers/alinvade.cpp
@@ -62,7 +62,7 @@ static const discrete_dac_r1_ladder alinvade_music_dac =
#define ALINVADE_MUSIC_CLK (75000)
-DISCRETE_SOUND_START(alinvade)
+DISCRETE_SOUND_START(alinvade_discrete)
DISCRETE_INPUT_DATA (NODE_01)
DISCRETE_NOTE(NODE_20, 1, ALINVADE_MUSIC_CLK, NODE_01, 255, 5, DISC_CLK_IS_FREQ)
@@ -222,7 +222,7 @@ MACHINE_CONFIG_START(alinvade_state::alinvade)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DISCRETE_ADD("discrete", 0, alinvade)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, alinvade_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/atarifb.cpp b/src/mame/drivers/atarifb.cpp
index 04304a2df77..4e2aeec7743 100644
--- a/src/mame/drivers/atarifb.cpp
+++ b/src/mame/drivers/atarifb.cpp
@@ -579,8 +579,7 @@ MACHINE_CONFIG_START(atarifb_state::atarifb)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(atarifb)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, atarifb_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.18)
MACHINE_CONFIG_END
@@ -606,8 +605,7 @@ MACHINE_CONFIG_START(atarifb_state::abaseb)
MCFG_SCREEN_UPDATE_DRIVER(atarifb_state, screen_update_abaseb)
/* sound hardware */
- MCFG_DEVICE_REPLACE("discrete", DISCRETE, 0)
- MCFG_DISCRETE_INTF(abaseb)
+ MCFG_DEVICE_REPLACE("discrete", DISCRETE, abaseb_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.24)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/blockade.cpp b/src/mame/drivers/blockade.cpp
index e901307dbc7..d6a52906f5b 100644
--- a/src/mame/drivers/blockade.cpp
+++ b/src/mame/drivers/blockade.cpp
@@ -387,7 +387,7 @@ TILE_GET_INFO_MEMBER( blockade_state::tile_info )
#define BLOCKADE_NOTE_DATA NODE_01
#define BLOCKADE_NOTE NODE_02
-DISCRETE_SOUND_START( blockade )
+DISCRETE_SOUND_START( blockade_discrete )
DISCRETE_INPUT_DATA (BLOCKADE_NOTE_DATA)
/************************************************/
@@ -489,8 +489,7 @@ MACHINE_CONFIG_START(blockade_state::blockade)
MCFG_SAMPLES_NAMES(blockade_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(blockade)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, blockade_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/bloodbro.cpp b/src/mame/drivers/bloodbro.cpp
index c9368c696e7..ed46f5b45c9 100644
--- a/src/mame/drivers/bloodbro.cpp
+++ b/src/mame/drivers/bloodbro.cpp
@@ -591,7 +591,7 @@ MACHINE_CONFIG_START(bloodbro_state::weststry)
// Bootleg sound hardware is close copy of Seibu, but uses different interrupts
- MCFG_OKIM6295_REPLACE("oki", XTAL(20'000'000)/16, PIN7_HIGH) /* 1.25MHz - verified on PCB */
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, XTAL(20'000'000)/16, okim6295_device::PIN7_HIGH) /* 1.25MHz - verified on PCB */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_REPLACE("ymsnd", YM3812, XTAL(20'000'000)/4) /* ~4.9MHz - see notes at top */
diff --git a/src/mame/drivers/bsktball.cpp b/src/mame/drivers/bsktball.cpp
index 0597d11b02a..3868ce84d7c 100644
--- a/src/mame/drivers/bsktball.cpp
+++ b/src/mame/drivers/bsktball.cpp
@@ -272,8 +272,7 @@ MACHINE_CONFIG_START(bsktball_state::bsktball)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(bsktball)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, bsktball_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/btime.cpp b/src/mame/drivers/btime.cpp
index e90be5f07b9..7254eecbafe 100644
--- a/src/mame/drivers/btime.cpp
+++ b/src/mame/drivers/btime.cpp
@@ -1188,7 +1188,7 @@ static const discrete_mixer_desc btime_sound_mixer_desc =
static const discrete_op_amp_filt_info btime_opamp_desc =
{BTIME_R51, 0, BTIME_R50, 0, BTIME_R49, CAP_U(0.068), CAP_U(0.068), 0, 0, 5.0, -5.0};
-static DISCRETE_SOUND_START( btime_sound )
+static DISCRETE_SOUND_START( btime_sound_discrete )
DISCRETE_INPUTX_STREAM(NODE_01, 0, 5.0/32767.0, 0)
DISCRETE_INPUTX_STREAM(NODE_02, 1, 5.0/32767.0, 0)
@@ -1326,8 +1326,7 @@ MACHINE_CONFIG_START(btime_state::btime)
MCFG_SOUND_ROUTE(1, "discrete", 1.0, 4)
MCFG_SOUND_ROUTE(2, "discrete", 1.0, 5)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(btime_sound)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, btime_sound_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/by35.cpp b/src/mame/drivers/by35.cpp
index ef66760ba81..31518d1c195 100644
--- a/src/mame/drivers/by35.cpp
+++ b/src/mame/drivers/by35.cpp
@@ -1060,7 +1060,7 @@ static const discrete_op_amp_filt_info as2888_preamp_info = {
};
-static DISCRETE_SOUND_START(as2888)
+static DISCRETE_SOUND_START(as2888_discrete)
DISCRETE_INPUT_DATA(NODE_08) // Start Sustain Attenuation from 555 circuit
DISCRETE_INPUT_LOGIC(NODE_01) // Binary Counter B output (divide by 1) T2
@@ -1138,8 +1138,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(as2888_state::as2888_audio)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(as2888)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, as2888_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MCFG_DEVICE_MODIFY("pia_u11")
diff --git a/src/mame/drivers/canyon.cpp b/src/mame/drivers/canyon.cpp
index 228716baddd..076c4414e6f 100644
--- a/src/mame/drivers/canyon.cpp
+++ b/src/mame/drivers/canyon.cpp
@@ -272,8 +272,7 @@ MACHINE_CONFIG_START(canyon_state::canyon)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(canyon)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, canyon_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/circus.cpp b/src/mame/drivers/circus.cpp
index 3382872938e..20b3fa01686 100644
--- a/src/mame/drivers/circus.cpp
+++ b/src/mame/drivers/circus.cpp
@@ -312,8 +312,7 @@ MACHINE_CONFIG_START(circus_state::circus)
MCFG_SAMPLES_NAMES(circus_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(circus)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, circus_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -347,8 +346,7 @@ MACHINE_CONFIG_START(circus_state::robotbwl)
MCFG_SAMPLES_NAMES(robotbwl_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(robotbwl)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, robotbwl_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -389,8 +387,7 @@ MACHINE_CONFIG_START(circus_state::crash)
MCFG_SAMPLES_NAMES(crash_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(crash)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, crash_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_CONFIG_END
@@ -423,8 +420,7 @@ MACHINE_CONFIG_START(circus_state::ripcord)
MCFG_SAMPLES_NAMES(ripcord_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(circus)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, circus_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/circusc.cpp b/src/mame/drivers/circusc.cpp
index 658176a16ef..9970cb079bf 100644
--- a/src/mame/drivers/circusc.cpp
+++ b/src/mame/drivers/circusc.cpp
@@ -318,7 +318,7 @@ static const discrete_mixer_desc circusc_mixer_desc =
CAP_U(0.47),
0, 1};
-static DISCRETE_SOUND_START( circusc )
+static DISCRETE_SOUND_START( circusc_discrete )
DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
@@ -395,9 +395,7 @@ MACHINE_CONFIG_START(circusc_state::circusc)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT)
- MCFG_DEVICE_ADD("fltdisc", DISCRETE)
-
- MCFG_DISCRETE_INTF(circusc)
+ MCFG_DEVICE_ADD("fltdisc", DISCRETE, circusc_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cliffhgr.cpp b/src/mame/drivers/cliffhgr.cpp
index 564dd70c499..176a8bb5486 100644
--- a/src/mame/drivers/cliffhgr.cpp
+++ b/src/mame/drivers/cliffhgr.cpp
@@ -707,8 +707,7 @@ MACHINE_CONFIG_START(cliffhgr_state::cliffhgr)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(cliffhgr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, cliffhgr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp
index fb93918aa56..380773ba46b 100644
--- a/src/mame/drivers/cninja.cpp
+++ b/src/mame/drivers/cninja.cpp
@@ -1007,7 +1007,7 @@ MACHINE_CONFIG_START(cninja_state::cninjabl2)
MCFG_DEVICE_REMOVE("ymsnd")
- MCFG_OKIM6295_REPLACE("oki1", XTAL(32'220'000) / 32, PIN7_LOW)
+ MCFG_DEVICE_REPLACE("oki1", OKIM6295, XTAL(32'220'000) / 32, okim6295_device::PIN7_LOW)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_ADDRESS_MAP(0, cninjabl2_oki_map)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/darius.cpp b/src/mame/drivers/darius.cpp
index 6b333915b7b..ae9722918eb 100644
--- a/src/mame/drivers/darius.cpp
+++ b/src/mame/drivers/darius.cpp
@@ -797,44 +797,26 @@ MACHINE_CONFIG_START(darius_state::darius)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.l", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.r", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.0l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.0r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.1l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.1r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.2l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.2r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.3l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter0.3r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
-
- MCFG_FILTER_VOLUME_ADD("filter1.0l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1.0r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1.1l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1.1r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1.2l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1.2r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1.3l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1.3r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
-
- MCFG_FILTER_VOLUME_ADD("msm5205.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("msm5205.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "filter0.0l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter0.0r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "filter0.1l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter0.1r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "filter0.2l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter0.2r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "filter0.3l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter0.3r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+
+ FILTER_VOLUME(config, "filter1.0l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1.0r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1.1l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1.1r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1.2l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1.2r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1.3l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1.3r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+
+ FILTER_VOLUME(config, "msm5205.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "msm5205.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MCFG_DEVICE_ADD("ciu", PC060HA, 0)
MCFG_PC060HA_MASTER_CPU("maincpu")
diff --git a/src/mame/drivers/dragrace.cpp b/src/mame/drivers/dragrace.cpp
index 71c501f07de..3956980e000 100644
--- a/src/mame/drivers/dragrace.cpp
+++ b/src/mame/drivers/dragrace.cpp
@@ -298,8 +298,7 @@ MACHINE_CONFIG_START(dragrace_state::dragrace)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(dragrace)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, dragrace_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
diff --git a/src/mame/drivers/esd16.cpp b/src/mame/drivers/esd16.cpp
index ce61152f031..63e48a4498f 100644
--- a/src/mame/drivers/esd16.cpp
+++ b/src/mame/drivers/esd16.cpp
@@ -693,7 +693,7 @@ MACHINE_CONFIG_START(esd16_state::jumppop)
MCFG_DEVICE_REPLACE("ymsnd", YM3812, XTAL(14'000'000)/4) /* 3.5MHz - Verified */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
- MCFG_OKIM6295_REPLACE("oki", XTAL(14'000'000)/16, PIN7_HIGH) /* 875kHz - Verified */
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, XTAL(14'000'000)/16, okim6295_device::PIN7_HIGH) /* 875kHz - Verified */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp
index a4d2cf950dd..9920572e602 100644
--- a/src/mame/drivers/expro02.cpp
+++ b/src/mame/drivers/expro02.cpp
@@ -995,7 +995,7 @@ MACHINE_CONFIG_START(expro02_state::supmodel)
comad_noview2(config);
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(supmodel_map)
- MCFG_OKIM6295_REPLACE("oki", 1584000, PIN7_HIGH) // clock frequency & pin 7 not verified
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, 1584000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1016,7 +1016,7 @@ MACHINE_CONFIG_START(expro02_state::galhustl)
comad_noview2(config);
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(galhustl_map)
- MCFG_OKIM6295_REPLACE("oki", 1056000, PIN7_HIGH) // clock frequency & pin 7 not verified
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1029,7 +1029,7 @@ MACHINE_CONFIG_START(expro02_state::zipzap)
/* basic machine hardware */
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(zipzap_map)
- MCFG_OKIM6295_REPLACE("oki", 1056000, PIN7_HIGH) // clock frequency & pin 7 not verified
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/firetrk.cpp b/src/mame/drivers/firetrk.cpp
index bc3d7dfb5ea..7899763774b 100644
--- a/src/mame/drivers/firetrk.cpp
+++ b/src/mame/drivers/firetrk.cpp
@@ -878,8 +878,7 @@ MACHINE_CONFIG_START(firetrk_state::firetrk)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(firetrk)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, firetrk_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -903,8 +902,7 @@ MACHINE_CONFIG_START(firetrk_state::superbug)
MCFG_PALETTE_INIT_OWNER(firetrk_state, firetrk)
/* sound hardware */
- MCFG_DEVICE_REPLACE("discrete", DISCRETE, 0)
- MCFG_DISCRETE_INTF(superbug)
+ MCFG_DEVICE_REPLACE("discrete", DISCRETE, superbug_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -928,8 +926,7 @@ MACHINE_CONFIG_START(firetrk_state::montecar)
MCFG_PALETTE_INIT_OWNER(firetrk_state,montecar)
/* sound hardware */
- MCFG_DEVICE_REPLACE("discrete", DISCRETE, 0)
- MCFG_DISCRETE_INTF(montecar)
+ MCFG_DEVICE_REPLACE("discrete", DISCRETE, montecar_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp
index d2f52325bf3..10b8db3f640 100644
--- a/src/mame/drivers/galaga.cpp
+++ b/src/mame/drivers/galaga.cpp
@@ -1656,8 +1656,7 @@ MACHINE_CONFIG_START(bosco_state::bosco)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
/* discrete circuit on the 54XX outputs */
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(bosco)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, bosco_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
MACHINE_CONFIG_END
@@ -1732,8 +1731,7 @@ MACHINE_CONFIG_START(galaga_state::galaga)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
/* discrete circuit on the 54XX outputs */
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(galaga)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, galaga_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
MACHINE_CONFIG_END
@@ -1838,8 +1836,7 @@ MACHINE_CONFIG_START(xevious_state::xevious)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
/* discrete circuit on the 54XX outputs */
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(galaga)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, galaga_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index 82aa7fbc5fc..19cf93e30be 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -5731,7 +5731,7 @@ static const discrete_mixer_desc konami_sound_mixer_desc =
0, /* modelled separately */
0, 1};
-static DISCRETE_SOUND_START( konami_sound )
+static DISCRETE_SOUND_START( konami_sound_discrete )
DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
@@ -5840,8 +5840,7 @@ MACHINE_CONFIG_START(galaxian_state::konami_sound_1x_ay8910)
MCFG_SOUND_ROUTE(1, "konami", 1.0, 1)
MCFG_SOUND_ROUTE(2, "konami", 1.0, 2)
- MCFG_DEVICE_ADD("konami", DISCRETE)
- MCFG_DISCRETE_INTF(konami_sound)
+ MCFG_DEVICE_ADD("konami", DISCRETE, konami_sound_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
MACHINE_CONFIG_END
@@ -5872,8 +5871,7 @@ MACHINE_CONFIG_START(galaxian_state::konami_sound_2x_ay8910)
MCFG_SOUND_ROUTE(1, "konami", 1.0, 4)
MCFG_SOUND_ROUTE(2, "konami", 1.0, 5)
- MCFG_DEVICE_ADD("konami", DISCRETE)
- MCFG_DISCRETE_INTF(konami_sound)
+ MCFG_DEVICE_ADD("konami", DISCRETE, konami_sound_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/goldnpkr.cpp b/src/mame/drivers/goldnpkr.cpp
index c0fb21f356c..4e7ee01a96f 100644
--- a/src/mame/drivers/goldnpkr.cpp
+++ b/src/mame/drivers/goldnpkr.cpp
@@ -4187,7 +4187,7 @@ static const discrete_dac_r1_ladder dac_goldnpkr_ladder =
// 0, /* resistor tied to ground */
};
-static DISCRETE_SOUND_START( goldnpkr )
+static DISCRETE_SOUND_START( goldnpkr_discrete )
/*
- bits -
76543210
@@ -4250,7 +4250,7 @@ static const discrete_dac_r1_ladder dac_pottnpkr_ladder =
0 /* no filtering cap tied to ground */
};
-static DISCRETE_SOUND_START( pottnpkr )
+static DISCRETE_SOUND_START( pottnpkr_discrete )
/*
- bits -
76543210
@@ -4334,8 +4334,7 @@ MACHINE_CONFIG_START(goldnpkr_state::goldnpkr)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4353,8 +4352,7 @@ MACHINE_CONFIG_START(goldnpkr_state::pottnpkr)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(pottnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, pottnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4376,8 +4374,7 @@ MACHINE_CONFIG_START(goldnpkr_state::witchcrd)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4425,8 +4422,7 @@ MACHINE_CONFIG_START(goldnpkr_state::wildcard)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4450,8 +4446,7 @@ MACHINE_CONFIG_START(goldnpkr_state::wcrdxtnd)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4503,8 +4498,7 @@ MACHINE_CONFIG_START(goldnpkr_state::genie)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4526,8 +4520,7 @@ MACHINE_CONFIG_START(goldnpkr_state::geniea)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4544,8 +4537,7 @@ MACHINE_CONFIG_START(goldnpkr_state::mondial)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4570,8 +4562,7 @@ MACHINE_CONFIG_START(goldnpkr_state::bchancep)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(pottnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, pottnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -4746,8 +4737,7 @@ MACHINE_CONFIG_START(blitz_state::megadpkr)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(goldnpkr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, goldnpkr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/grchamp.cpp b/src/mame/drivers/grchamp.cpp
index bd81552b700..21fd9637dbd 100644
--- a/src/mame/drivers/grchamp.cpp
+++ b/src/mame/drivers/grchamp.cpp
@@ -789,8 +789,7 @@ MACHINE_CONFIG_START(grchamp_state::grchamp)
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, grchamp_state, portB_2_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(grchamp)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, grchamp_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gyruss.cpp b/src/mame/drivers/gyruss.cpp
index 87100c0b8ea..eed631e1772 100644
--- a/src/mame/drivers/gyruss.cpp
+++ b/src/mame/drivers/gyruss.cpp
@@ -386,7 +386,7 @@ static const discrete_mixer_desc konami_left_mixer_desc =
CAP_U(1), /* DC - Removal, not in schematics */
0, 1};
-static DISCRETE_SOUND_START( gyruss_sound )
+static DISCRETE_SOUND_START( gyruss_sound_discrete )
/* Chip 1 right */
DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
@@ -557,8 +557,7 @@ MACHINE_CONFIG_START(gyruss_state::gyruss)
MCFG_SOUND_ROUTE(1, "discrete", 1.0, 13)
MCFG_SOUND_ROUTE(2, "discrete", 1.0, 14)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(gyruss_sound)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, gyruss_sound_discrete)
MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/hitme.cpp b/src/mame/drivers/hitme.cpp
index b14eeff4d05..377744402e1 100644
--- a/src/mame/drivers/hitme.cpp
+++ b/src/mame/drivers/hitme.cpp
@@ -336,8 +336,7 @@ MACHINE_CONFIG_START(hitme_state::hitme)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(hitme)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, hitme_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ironhors.cpp b/src/mame/drivers/ironhors.cpp
index 2c816e9ebee..b74b9951248 100644
--- a/src/mame/drivers/ironhors.cpp
+++ b/src/mame/drivers/ironhors.cpp
@@ -319,7 +319,7 @@ static const discrete_mixer_desc ironhors_mixer_desc_final =
0,
0, 1};
-static DISCRETE_SOUND_START( ironhors )
+static DISCRETE_SOUND_START( ironhors_discrete )
DISCRETE_INPUTX_STREAM(NODE_01, 0, 5.0, 0)
DISCRETE_INPUTX_STREAM(NODE_02, 1, 5.0, 0)
@@ -418,8 +418,7 @@ MACHINE_CONFIG_START(ironhors_state::ironhors)
MCFG_SOUND_ROUTE(2, "disc_ih", 1.0, 2)
MCFG_SOUND_ROUTE(3, "disc_ih", 1.0, 3)
- MCFG_DEVICE_ADD("disc_ih", DISCRETE)
- MCFG_DISCRETE_INTF(ironhors)
+ MCFG_DEVICE_ADD("disc_ih", DISCRETE, ironhors_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/itgamble.cpp b/src/mame/drivers/itgamble.cpp
index 215dd816eea..85ff3b54d4c 100644
--- a/src/mame/drivers/itgamble.cpp
+++ b/src/mame/drivers/itgamble.cpp
@@ -242,7 +242,7 @@ MACHINE_CONFIG_START(itgamble_state::mnumber)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_CLOCK(MNUMBER_MAIN_CLOCK/2) /* probably the wrong CPU */
- MCFG_OKIM6295_REPLACE("oki", MNUMBER_SND_CLOCK/16, PIN7_HIGH) /* clock frequency & pin 7 not verified */
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, MNUMBER_SND_CLOCK/16, okim6295_device::PIN7_HIGH) /* clock frequency & pin 7 not verified */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -254,7 +254,7 @@ static MACHINE_CONFIG_START( ejollyx5 )
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_CLOCK(EJOLLYX5_MAIN_CLOCK/2) /* up to 10MHz.*/
- MCFG_OKIM6295_REPLACE("oki", MNUMBER_SND_CLOCK/16, PIN7_HIGH) /* clock frequency & pin 7 not verified */
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, MNUMBER_SND_CLOCK/16, okim6295_device::PIN7_HIGH) /* clock frequency & pin 7 not verified */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
#endif
diff --git a/src/mame/drivers/lockon.cpp b/src/mame/drivers/lockon.cpp
index 796248ad3bd..000a14ed653 100644
--- a/src/mame/drivers/lockon.cpp
+++ b/src/mame/drivers/lockon.cpp
@@ -519,18 +519,12 @@ MACHINE_CONFIG_START(lockon_state::lockon)
MCFG_SOUND_ROUTE(3, "f2203.3l", 1.0)
MCFG_SOUND_ROUTE(3, "f2203.3r", 1.0)
- MCFG_FILTER_VOLUME_ADD("f2203.1l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("f2203.1r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("f2203.2l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("f2203.2r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("f2203.3l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("f2203.3r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "f2203.1l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "f2203.1r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "f2203.2l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "f2203.2r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "f2203.3l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "f2203.3r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/m79amb.cpp b/src/mame/drivers/m79amb.cpp
index dc953c96e06..c2145dad509 100644
--- a/src/mame/drivers/m79amb.cpp
+++ b/src/mame/drivers/m79amb.cpp
@@ -212,9 +212,7 @@ MACHINE_CONFIG_START(m79amb_state::m79amb)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(m79amb)
-
+ MCFG_DEVICE_ADD("discrete", DISCRETE, m79amb_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/madalien.cpp b/src/mame/drivers/madalien.cpp
index 9bc9700b42b..fd802f00054 100644
--- a/src/mame/drivers/madalien.cpp
+++ b/src/mame/drivers/madalien.cpp
@@ -177,9 +177,7 @@ MACHINE_CONFIG_START(madalien_state::madalien)
MCFG_SOUND_ROUTE(1, "discrete", 1.0, 1)
MCFG_SOUND_ROUTE(2, "discrete", 1.0, 2)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(madalien)
-
+ MCFG_DEVICE_ADD("discrete", DISCRETE, madalien_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/megasys1.cpp b/src/mame/drivers/megasys1.cpp
index e0d11a8667a..9f280acf1f5 100644
--- a/src/mame/drivers/megasys1.cpp
+++ b/src/mame/drivers/megasys1.cpp
@@ -1833,11 +1833,11 @@ MACHINE_CONFIG_START(megasys1_state::system_B_hayaosi1)
/* basic machine hardware */
- MCFG_OKIM6295_REPLACE("oki1", 2000000, okim6295_device::PIN7_HIGH) /* correct speed, but unknown OSC + divider combo */
+ MCFG_DEVICE_REPLACE("oki1", OKIM6295, 2000000, okim6295_device::PIN7_HIGH) /* correct speed, but unknown OSC + divider combo */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
- MCFG_OKIM6295_REPLACE("oki2", 2000000, okim6295_device::PIN7_HIGH) /* correct speed, but unknown OSC + divider combo */
+ MCFG_DEVICE_REPLACE("oki2", OKIM6295, 2000000, okim6295_device::PIN7_HIGH) /* correct speed, but unknown OSC + divider combo */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ninjaw.cpp b/src/mame/drivers/ninjaw.cpp
index ddbd00c0d3b..97ce74a7549 100644
--- a/src/mame/drivers/ninjaw.cpp
+++ b/src/mame/drivers/ninjaw.cpp
@@ -841,14 +841,10 @@ MACHINE_CONFIG_START(ninjaw_state::ninjaw)
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
// MCFG_DEVICE_ADD("subwoofer", SUBWOOFER, 0)
@@ -963,14 +959,10 @@ MACHINE_CONFIG_START(ninjaw_state::darius2)
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
// MCFG_DEVICE_ADD("subwoofer", SUBWOOFER, 0)
diff --git a/src/mame/drivers/nitedrvr.cpp b/src/mame/drivers/nitedrvr.cpp
index e58aff21939..61143b73e4b 100644
--- a/src/mame/drivers/nitedrvr.cpp
+++ b/src/mame/drivers/nitedrvr.cpp
@@ -168,8 +168,7 @@ MACHINE_CONFIG_START(nitedrvr_state::nitedrvr)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(nitedrvr)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, nitedrvr_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/norautp.cpp b/src/mame/drivers/norautp.cpp
index ca5b4586e9a..da9672cf969 100644
--- a/src/mame/drivers/norautp.cpp
+++ b/src/mame/drivers/norautp.cpp
@@ -1286,8 +1286,7 @@ MACHINE_CONFIG_START(norautp_state::noraut_base)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(norautp)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, norautp_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1310,7 +1309,7 @@ MACHINE_CONFIG_START(norautp_state::norautpl)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(kimble)
+ MCFG_DISCRETE_INTF(kimble_discrete)
MACHINE_CONFIG_END
@@ -1366,7 +1365,7 @@ MACHINE_CONFIG_START(norautp_state::kimble)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(kimble)
+ MCFG_DISCRETE_INTF(kimble_discrete)
MACHINE_CONFIG_END
MACHINE_CONFIG_START(norautp_state::newhilop)
@@ -1392,7 +1391,7 @@ MACHINE_CONFIG_START(norautp_state::dphl)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(dphl)
+ MCFG_DISCRETE_INTF(dphl_discrete)
MACHINE_CONFIG_END
@@ -1406,7 +1405,7 @@ MACHINE_CONFIG_START(norautp_state::dphla)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(dphl)
+ MCFG_DISCRETE_INTF(dphl_discrete)
MACHINE_CONFIG_END
@@ -1420,7 +1419,7 @@ MACHINE_CONFIG_START(norautp_state::kimbldhl)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(kimble)
+ MCFG_DISCRETE_INTF(kimble_discrete)
MACHINE_CONFIG_END
@@ -1434,7 +1433,7 @@ MACHINE_CONFIG_START(norautp_state::dphltest)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(dphl)
+ MCFG_DISCRETE_INTF(dphl_discrete)
MACHINE_CONFIG_END
@@ -1448,7 +1447,7 @@ MACHINE_CONFIG_START(norautp_state::drhl)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(dphl)
+ MCFG_DISCRETE_INTF(dphl_discrete)
MACHINE_CONFIG_END
@@ -1462,7 +1461,7 @@ MACHINE_CONFIG_START(norautp_state::ssjkrpkr)
/* sound hardware */
MCFG_DEVICE_MODIFY("discrete")
- MCFG_DISCRETE_INTF(dphl)
+ MCFG_DISCRETE_INTF(dphl_discrete)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/orbit.cpp b/src/mame/drivers/orbit.cpp
index 51e424e7588..335ae5e6180 100644
--- a/src/mame/drivers/orbit.cpp
+++ b/src/mame/drivers/orbit.cpp
@@ -302,8 +302,7 @@ MACHINE_CONFIG_START(orbit_state::orbit)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(orbit)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, orbit_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/othunder.cpp b/src/mame/drivers/othunder.cpp
index e80b180e7a0..60083bc073e 100644
--- a/src/mame/drivers/othunder.cpp
+++ b/src/mame/drivers/othunder.cpp
@@ -666,18 +666,12 @@ MACHINE_CONFIG_START(othunder_state::othunder)
MCFG_SOUND_ROUTE(2, "2610.2l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2r", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.0l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.0r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
+ FILTER_VOLUME(config, "2610.0l").add_route(ALL_OUTPUTS, "speaker", 1.0);
+ FILTER_VOLUME(config, "2610.0r").add_route(ALL_OUTPUTS, "speaker", 1.0);
+ FILTER_VOLUME(config, "2610.1l").add_route(ALL_OUTPUTS, "speaker", 1.0);
+ FILTER_VOLUME(config, "2610.1r").add_route(ALL_OUTPUTS, "speaker", 1.0);
+ FILTER_VOLUME(config, "2610.2l").add_route(ALL_OUTPUTS, "speaker", 1.0);
+ FILTER_VOLUME(config, "2610.2r").add_route(ALL_OUTPUTS, "speaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("maincpu")
diff --git a/src/mame/drivers/phoenix.cpp b/src/mame/drivers/phoenix.cpp
index 330307d0f9c..d69ac954459 100644
--- a/src/mame/drivers/phoenix.cpp
+++ b/src/mame/drivers/phoenix.cpp
@@ -472,8 +472,7 @@ MACHINE_CONFIG_START(phoenix_state::phoenix)
MCFG_DEVICE_ADD("cust", PHOENIX_SOUND)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4)
- MCFG_DEVICE_ADD("discrete", DISCRETE, 120000)
- MCFG_DISCRETE_INTF(phoenix)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, 120000, phoenix_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp
index ffb5d363263..270be0775f8 100644
--- a/src/mame/drivers/polepos.cpp
+++ b/src/mame/drivers/polepos.cpp
@@ -932,8 +932,7 @@ MACHINE_CONFIG_START(polepos_state::polepos)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
/* discrete circuit on the 54XX outputs */
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(polepos)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, polepos_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.90)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.90)
diff --git a/src/mame/drivers/poolshrk.cpp b/src/mame/drivers/poolshrk.cpp
index b9bf946d7a7..9b8a1c4ab06 100644
--- a/src/mame/drivers/poolshrk.cpp
+++ b/src/mame/drivers/poolshrk.cpp
@@ -240,8 +240,7 @@ MACHINE_CONFIG_START(poolshrk_state::poolshrk)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(poolshrk)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, poolshrk_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/powerins.cpp b/src/mame/drivers/powerins.cpp
index 89ecb8e075e..61c8a5fa6c9 100644
--- a/src/mame/drivers/powerins.cpp
+++ b/src/mame/drivers/powerins.cpp
@@ -362,7 +362,7 @@ MACHINE_CONFIG_START(powerins_state::powerinsa)
MCFG_MACHINE_START_OVERRIDE(powerins_state, powerinsa)
- MCFG_OKIM6295_REPLACE("oki1", 990000, PIN7_LOW) // pin7 not verified
+ MCFG_DEVICE_REPLACE("oki1", OKIM6295, 990000, okim6295_device::PIN7_LOW) // pin7 not verified
MCFG_DEVICE_ADDRESS_MAP(0, powerinsa_oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/quantum.cpp b/src/mame/drivers/quantum.cpp
index 2482c9226fc..812b0aad015 100644
--- a/src/mame/drivers/quantum.cpp
+++ b/src/mame/drivers/quantum.cpp
@@ -248,7 +248,7 @@ static discrete_mixer_desc quantum_mixer = {
1.0 /* gain */
};
-static DISCRETE_SOUND_START(quantum)
+static DISCRETE_SOUND_START(quantum_discrete)
/************************************************/
/* FINAL MIX */
@@ -321,9 +321,7 @@ MACHINE_CONFIG_START(quantum_state::quantum)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0)
MCFG_SOUND_ROUTE(0, "discrete", 1.0, 1)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(quantum)
-
+ MCFG_DEVICE_ADD("discrete", DISCRETE, quantum_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/simpl156.cpp b/src/mame/drivers/simpl156.cpp
index a39abe82a09..39a87160a6a 100644
--- a/src/mame/drivers/simpl156.cpp
+++ b/src/mame/drivers/simpl156.cpp
@@ -488,7 +488,7 @@ MACHINE_CONFIG_START(simpl156_state::mitchell156)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(mitchell156_map)
- MCFG_OKIM6295_REPLACE("okimusic", 32220000/32, PIN7_HIGH)
+ MCFG_DEVICE_REPLACE("okimusic", OKIM6295, 32220000/32, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/skydiver.cpp b/src/mame/drivers/skydiver.cpp
index 08560baef22..cba45936533 100644
--- a/src/mame/drivers/skydiver.cpp
+++ b/src/mame/drivers/skydiver.cpp
@@ -399,8 +399,7 @@ MACHINE_CONFIG_START(skydiver_state::skydiver)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(skydiver)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, skydiver_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/skyraid.cpp b/src/mame/drivers/skyraid.cpp
index 58c86c78903..28e81b05855 100644
--- a/src/mame/drivers/skyraid.cpp
+++ b/src/mame/drivers/skyraid.cpp
@@ -249,8 +249,7 @@ MACHINE_CONFIG_START(skyraid_state::skyraid)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(skyraid)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, skyraid_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/snk6502.cpp b/src/mame/drivers/snk6502.cpp
index 4e5be7d07e4..4dc7e0c3744 100644
--- a/src/mame/drivers/snk6502.cpp
+++ b/src/mame/drivers/snk6502.cpp
@@ -945,7 +945,7 @@ MACHINE_CONFIG_START(snk6502_state::satansat)
MCFG_SAMPLES_NAMES(vanguard_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_DEVICE_REPLACE("sn76477.1", SN76477, 0)
+ MCFG_DEVICE_REPLACE("sn76477.1", SN76477)
// ??? GND: 2,26,27 +5V: 15,25
MCFG_SN76477_NOISE_PARAMS(RES_K(470), RES_M(1.5), CAP_P(220)) // noise + filter
MCFG_SN76477_DECAY_RES(0) // decay_res
@@ -1054,7 +1054,7 @@ MACHINE_CONFIG_START(snk6502_state::fantasy)
MCFG_SAMPLES_NAMES(fantasy_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
- MCFG_DEVICE_REPLACE("sn76477.1", SN76477, 0)
+ MCFG_DEVICE_REPLACE("sn76477.1", SN76477)
// BOMB GND: 2,9,26,27 +5V: 15,25
MCFG_SN76477_NOISE_PARAMS(RES_K(470), RES_M(1.5), CAP_P(220)) // noise + filter
MCFG_SN76477_DECAY_RES(0) // decay_res
@@ -1073,8 +1073,7 @@ MACHINE_CONFIG_START(snk6502_state::fantasy)
MCFG_SN76477_ENABLE(0) // enable
MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(fantasy)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, fantasy_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
MCFG_DEVICE_REMOVE("sn76477.2")
diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp
index a854ec0f3cf..1ef3a79a560 100644
--- a/src/mame/drivers/snowbros.cpp
+++ b/src/mame/drivers/snowbros.cpp
@@ -1948,7 +1948,7 @@ MACHINE_CONFIG_START(snowbros_state::finalttr)
MCFG_SOUND_ROUTE(0, "mono", 0.08)
MCFG_SOUND_ROUTE(1, "mono", 0.08)
- MCFG_OKIM6295_REPLACE("oki", 999900, okim6295_device::PIN7_HIGH)
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, 999900, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/sprint2.cpp b/src/mame/drivers/sprint2.cpp
index 33e5041a40f..6e9554bad70 100644
--- a/src/mame/drivers/sprint2.cpp
+++ b/src/mame/drivers/sprint2.cpp
@@ -525,8 +525,7 @@ MACHINE_CONFIG_START(sprint2_state::sprint2)
MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led1")) // START LAMP2
//MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, sprint2_state, sprint2_spare_w))
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(sprint2)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, sprint2_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -542,8 +541,7 @@ MACHINE_CONFIG_START(sprint2_state::sprint1)
MCFG_DEVICE_REMOVE("discrete")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(sprint1)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, sprint1_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -558,8 +556,7 @@ MACHINE_CONFIG_START(sprint2_state::dominos)
MCFG_DEVICE_REMOVE("discrete")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(dominos)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, dominos_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp
index 46675c2511d..a2a1c53eca0 100644
--- a/src/mame/drivers/sprint4.cpp
+++ b/src/mame/drivers/sprint4.cpp
@@ -413,8 +413,7 @@ MACHINE_CONFIG_START(sprint4_state::sprint4)
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line<SPRINT4_SCREECH_EN_3>))
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("discrete", discrete_device, write_line<SPRINT4_SCREECH_EN_4>))
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(sprint4)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, sprint4_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
diff --git a/src/mame/drivers/starshp1.cpp b/src/mame/drivers/starshp1.cpp
index 6c6c807a444..7c33862c398 100644
--- a/src/mame/drivers/starshp1.cpp
+++ b/src/mame/drivers/starshp1.cpp
@@ -323,8 +323,7 @@ MACHINE_CONFIG_START(starshp1_state::starshp1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(starshp1)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, starshp1_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_ADD("audiolatch", F9334, 0) // D9
diff --git a/src/mame/drivers/subs.cpp b/src/mame/drivers/subs.cpp
index 031b9009dff..832e5224498 100644
--- a/src/mame/drivers/subs.cpp
+++ b/src/mame/drivers/subs.cpp
@@ -209,8 +209,7 @@ MACHINE_CONFIG_START(subs_state::subs)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(subs)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, subs_discrete)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp
index 3a0d17bed97..1557f17b02d 100644
--- a/src/mame/drivers/taito_z.cpp
+++ b/src/mame/drivers/taito_z.cpp
@@ -3239,14 +3239,10 @@ MACHINE_CONFIG_START(taitoz_state::contcirc)
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rear", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "front", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rear", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "front", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
@@ -3318,14 +3314,10 @@ MACHINE_CONFIG_START(taitoz_state::chasehq)
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rear", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "front", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rear", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "front", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
@@ -3398,14 +3390,10 @@ MACHINE_CONFIG_START(taitoz_state::enforce)
MCFG_SOUND_ROUTE(2, "2610.2.l", 20.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 20.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
@@ -3479,14 +3467,10 @@ MACHINE_CONFIG_START(taitoz_state::bshark)
MCFG_SOUND_ROUTE(2, "2610.2.l", 28.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 28.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(taitoz_state::bsharkjjs)
@@ -3563,14 +3547,10 @@ MACHINE_CONFIG_START(taitoz_state::sci)
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
@@ -3651,14 +3631,10 @@ MACHINE_CONFIG_START(taitoz_state::nightstr)
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rear", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "front", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rear", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "front", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
@@ -3731,14 +3707,10 @@ MACHINE_CONFIG_START(taitoz_state::aquajack)
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
@@ -3814,14 +3786,10 @@ MACHINE_CONFIG_START(taitoz_state::spacegun)
MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MACHINE_CONFIG_END
@@ -3888,14 +3856,10 @@ MACHINE_CONFIG_START(taitoz_state::dblaxle)
MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
@@ -3964,14 +3928,10 @@ MACHINE_CONFIG_START(taitoz_state::racingb)
MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("sub")
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp
index 29c068110eb..e48d985df36 100644
--- a/src/mame/drivers/taitosj.cpp
+++ b/src/mame/drivers/taitosj.cpp
@@ -1745,7 +1745,7 @@ static const discrete_dac_r1_ladder taitosj_dacvol_ladder =
0 // no cap
};
-DISCRETE_SOUND_START(taitosj_dacvol)
+DISCRETE_SOUND_START(taitosj_dacvol_discrete)
DISCRETE_INPUT_DATA(NODE_01)
DISCRETE_DAC_R1(NODE_02, NODE_01, DEFAULT_TTL_V_LOGIC_1, &taitosj_dacvol_ladder)
DISCRETE_OUTPUT(NODE_02, 9637)
@@ -1825,7 +1825,7 @@ MACHINE_CONFIG_START(taitosj_state::nomcu)
MCFG_WATCHDOG_VBLANK_INIT("screen", 128); // 74LS393 on CPU board, counts 128 vblanks before firing watchdog
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // 30k r-2r network
- MCFG_DEVICE_ADD("dacvol", DISCRETE) MCFG_DISCRETE_INTF(taitosj_dacvol)
+ MCFG_DEVICE_ADD("dacvol", DISCRETE, taitosj_dacvol_discrete)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tank8.cpp b/src/mame/drivers/tank8.cpp
index 34246dd8dcd..3b8f586ae60 100644
--- a/src/mame/drivers/tank8.cpp
+++ b/src/mame/drivers/tank8.cpp
@@ -353,8 +353,7 @@ MACHINE_CONFIG_START(tank8_state::tank8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(tank8)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, tank8_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/topspeed.cpp b/src/mame/drivers/topspeed.cpp
index 892637887d4..33be5218afa 100644
--- a/src/mame/drivers/topspeed.cpp
+++ b/src/mame/drivers/topspeed.cpp
@@ -646,18 +646,12 @@ MACHINE_CONFIG_START(topspeed_state::topspeed)
MCFG_MSM5205_PRESCALER_SELECTOR(SEX_4B) // Slave mode, 4-bit
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter3", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
-
- MCFG_FILTER_VOLUME_ADD("filter2", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
-
- MCFG_FILTER_VOLUME_ADD("filter3", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "filter1l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+
+ FILTER_VOLUME(config, "filter2").add_route(ALL_OUTPUTS, "lspeaker", 1.0).add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+
+ FILTER_VOLUME(config, "filter3").add_route(ALL_OUTPUTS, "lspeaker", 1.0).add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/triplhnt.cpp b/src/mame/drivers/triplhnt.cpp
index 5d92c79579d..f1153aa1685 100644
--- a/src/mame/drivers/triplhnt.cpp
+++ b/src/mame/drivers/triplhnt.cpp
@@ -333,8 +333,7 @@ MACHINE_CONFIG_START(triplhnt_state::triplhnt)
MCFG_SAMPLES_NAMES(triplhnt_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(triplhnt)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, triplhnt_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp
index ef4210f214b..1c0d507720f 100644
--- a/src/mame/drivers/tumbleb.cpp
+++ b/src/mame/drivers/tumbleb.cpp
@@ -2254,9 +2254,7 @@ MACHINE_CONFIG_START(tumbleb_state::chokchok)
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
// some PCBs have left factory with a 3.57mhz while some have a 4.096 which matches other games, assuming the former are factory errors
- // TODO: MAME sound cores doesn't handle on-the-fly sound frequency changes, I guess best action here is to make the sound chip a slot option,
- // assuming it's worth emulating a factory error in the first place.
- MCFG_OKIM6295_REPLACE("oki", 4096000/4, okim6295_device::PIN7_HIGH)
+ MCFG_DEVICE_REPLACE("oki", OKIM6295, 4096000/4, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/uapce.cpp b/src/mame/drivers/uapce.cpp
index 926aa8c3288..7ddadd9aec9 100644
--- a/src/mame/drivers/uapce.cpp
+++ b/src/mame/drivers/uapce.cpp
@@ -129,7 +129,7 @@ public:
#define UAPCE_SOUND_EN NODE_10
#define UAPCE_TONE_752 NODE_11
-static DISCRETE_SOUND_START(uapce)
+static DISCRETE_SOUND_START(uapce_discrete)
DISCRETE_INPUT_LOGIC(UAPCE_SOUND_EN)
DISCRETE_SQUAREWFIX(UAPCE_TONE_752, UAPCE_SOUND_EN, 752, DEFAULT_TTL_V_LOGIC_1, 50, DEFAULT_TTL_V_LOGIC_1, 0) // 752Hz
DISCRETE_OUTPUT(UAPCE_TONE_752, 100)
@@ -337,8 +337,7 @@ MACHINE_CONFIG_START(uapce_state::uapce)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(uapce)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, uapce_discrete)
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp
index 27c4336d891..be8dc7afb54 100644
--- a/src/mame/drivers/ultratnk.cpp
+++ b/src/mame/drivers/ultratnk.cpp
@@ -320,8 +320,7 @@ MACHINE_CONFIG_START(ultratnk_state::ultratnk)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(ultratnk)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, ultratnk_discrete)
MCFG_SOUND_ROUTE(0, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/videopin.cpp b/src/mame/drivers/videopin.cpp
index a7fb255b8b9..7185345b388 100644
--- a/src/mame/drivers/videopin.cpp
+++ b/src/mame/drivers/videopin.cpp
@@ -382,8 +382,7 @@ MACHINE_CONFIG_START(videopin_state::videopin)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(videopin)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, videopin_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/vip.cpp b/src/mame/drivers/vip.cpp
index 8e1f9b9e062..31e847b9b27 100644
--- a/src/mame/drivers/vip.cpp
+++ b/src/mame/drivers/vip.cpp
@@ -556,7 +556,7 @@ static const discrete_555_desc vip_ca555_a =
DEFAULT_555_VALUES
};
-static DISCRETE_SOUND_START( vip )
+static DISCRETE_SOUND_START( vip_discrete )
DISCRETE_INPUT_LOGIC(NODE_01)
DISCRETE_555_ASTABLE_CV(NODE_02, NODE_01, 470, (int) RES_M(1), (int) CAP_P(470), NODE_01, &vip_ca555_a)
DISCRETE_OUTPUT(NODE_02, 5000)
@@ -739,8 +739,7 @@ MACHINE_CONFIG_START(vip_state::vip)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE)
- MCFG_DISCRETE_INTF(vip)
+ MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, vip_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, vip_byteio_cards, nullptr, WRITELINE(*this, vip_state, byteio_inst_w))
diff --git a/src/mame/drivers/vixen.cpp b/src/mame/drivers/vixen.cpp
index af59f0a00d3..2fd382e804b 100644
--- a/src/mame/drivers/vixen.cpp
+++ b/src/mame/drivers/vixen.cpp
@@ -486,7 +486,7 @@ uint32_t vixen_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
// DISCRETE_SOUND( vixen )
//-------------------------------------------------
-static DISCRETE_SOUND_START( vixen )
+static DISCRETE_SOUND_START( vixen_discrete )
DISCRETE_INPUT_LOGIC(NODE_01)
DISCRETE_SQUAREWAVE(NODE_02, NODE_01, (XTAL(23'961'600)/15360).dvalue(), 100, 50, 0, 90)
DISCRETE_OUTPUT(NODE_02, 2000)
@@ -760,8 +760,7 @@ MACHINE_CONFIG_START(vixen_state::vixen)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE)
- MCFG_DISCRETE_INTF(vixen)
+ MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, vixen_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
// devices
diff --git a/src/mame/drivers/warriorb.cpp b/src/mame/drivers/warriorb.cpp
index d1492ff238b..76d6967104d 100644
--- a/src/mame/drivers/warriorb.cpp
+++ b/src/mame/drivers/warriorb.cpp
@@ -509,14 +509,10 @@ MACHINE_CONFIG_START(warriorb_state::darius2d)
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("maincpu")
@@ -599,14 +595,10 @@ MACHINE_CONFIG_START(warriorb_state::warriorb)
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "2610.1.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.1.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "2610.2.r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
MCFG_TC0140SYT_MASTER_CPU("maincpu")
diff --git a/src/mame/drivers/wiz.cpp b/src/mame/drivers/wiz.cpp
index 9019734f19b..9cf21111e27 100644
--- a/src/mame/drivers/wiz.cpp
+++ b/src/mame/drivers/wiz.cpp
@@ -214,7 +214,7 @@ static const discrete_lfsr_desc stinger_lfsr =
16 /* Output bit is feedback bit */
};
-static DISCRETE_SOUND_START(stinger)
+static DISCRETE_SOUND_START(stinger_discrete)
#define STINGER_SHOT_OUT NODE_90
#define STINGER_BOOM_OUT NODE_91
@@ -864,8 +864,7 @@ MACHINE_CONFIG_START(wiz_state::stinger)
/* sound hardware */
MCFG_DEVICE_REMOVE("8910.3")
- MCFG_DEVICE_ADD("discrete", DISCRETE)
- MCFG_DISCRETE_INTF(stinger)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, stinger_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp
index 044a58a6041..ccd53898d06 100644
--- a/src/mame/drivers/x68k.cpp
+++ b/src/mame/drivers/x68k.cpp
@@ -1708,10 +1708,8 @@ MACHINE_CONFIG_START(x68k_state::x68000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "adpcm_outl", 0.50)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "adpcm_outr", 0.50)
- MCFG_FILTER_VOLUME_ADD("adpcm_outl", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("adpcm_outr", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "adpcm_outl").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "adpcm_outr").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MCFG_UPD72065_ADD("upd72065", true, false)
MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(*this, x68k_state, fdc_irq))
diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp
index 01b685409c6..a90bcc3d9b2 100644
--- a/src/mame/drivers/xexex.cpp
+++ b/src/mame/drivers/xexex.cpp
@@ -535,14 +535,10 @@ MACHINE_CONFIG_START(xexex_state::xexex)
MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1_l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter1_r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter2_l", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_FILTER_VOLUME_ADD("filter2_r", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ FILTER_VOLUME(config, "filter1_l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter1_r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ FILTER_VOLUME(config, "filter2_l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ FILTER_VOLUME(config, "filter2_r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MACHINE_CONFIG_END
diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h
index 5445758f042..143fb928b0f 100644
--- a/src/mame/includes/8080bw.h
+++ b/src/mame/includes/8080bw.h
@@ -247,9 +247,9 @@ public:
extern const char *const lrescue_sample_names[];
extern const char *const lupin3_sample_names[];
-DISCRETE_SOUND_EXTERN( ballbomb );
-DISCRETE_SOUND_EXTERN( indianbt );
-DISCRETE_SOUND_EXTERN( polaris );
-DISCRETE_SOUND_EXTERN( schaser );
+DISCRETE_SOUND_EXTERN( ballbomb_discrete );
+DISCRETE_SOUND_EXTERN( indianbt_discrete );
+DISCRETE_SOUND_EXTERN( polaris_discrete );
+DISCRETE_SOUND_EXTERN( schaser_discrete );
#endif // MAME_INCLUDES_8080BW_H
diff --git a/src/mame/includes/atarifb.h b/src/mame/includes/atarifb.h
index cbc9b167e98..c7327c47130 100644
--- a/src/mame/includes/atarifb.h
+++ b/src/mame/includes/atarifb.h
@@ -109,5 +109,5 @@ public:
};
/*----------- defined in audio/atarifb.c -----------*/
-DISCRETE_SOUND_EXTERN( atarifb );
-DISCRETE_SOUND_EXTERN( abaseb );
+DISCRETE_SOUND_EXTERN( atarifb_discrete );
+DISCRETE_SOUND_EXTERN( abaseb_discrete );
diff --git a/src/mame/includes/bsktball.h b/src/mame/includes/bsktball.h
index e865bf29d62..5d81556b962 100644
--- a/src/mame/includes/bsktball.h
+++ b/src/mame/includes/bsktball.h
@@ -87,6 +87,6 @@ private:
/*----------- defined in audio/bsktball.c -----------*/
-DISCRETE_SOUND_EXTERN( bsktball );
+DISCRETE_SOUND_EXTERN( bsktball_discrete );
#endif // MAME_INCLUDES_BSKTBALL_H
diff --git a/src/mame/includes/canyon.h b/src/mame/includes/canyon.h
index b4fe2dcc8db..2b7d0f653dc 100644
--- a/src/mame/includes/canyon.h
+++ b/src/mame/includes/canyon.h
@@ -75,6 +75,6 @@ private:
/*----------- defined in audio/canyon.c -----------*/
-DISCRETE_SOUND_EXTERN( canyon );
+DISCRETE_SOUND_EXTERN( canyon_discrete );
#endif // MAME_INCLUDES_CANYON_H
diff --git a/src/mame/includes/circus.h b/src/mame/includes/circus.h
index c60f6e84aa7..a3c16b3d8da 100644
--- a/src/mame/includes/circus.h
+++ b/src/mame/includes/circus.h
@@ -69,9 +69,9 @@ public:
};
/*----------- defined in audio/circus.c -----------*/
-DISCRETE_SOUND_EXTERN( circus );
-DISCRETE_SOUND_EXTERN( robotbwl );
-DISCRETE_SOUND_EXTERN( crash );
+DISCRETE_SOUND_EXTERN( circus_discrete );
+DISCRETE_SOUND_EXTERN( robotbwl_discrete );
+DISCRETE_SOUND_EXTERN( crash_discrete );
extern const char *const circus_sample_names[];
extern const char *const crash_sample_names[];
extern const char *const ripcord_sample_names[];
diff --git a/src/mame/includes/dragrace.h b/src/mame/includes/dragrace.h
index edfbff1d496..be30d8fc8bd 100644
--- a/src/mame/includes/dragrace.h
+++ b/src/mame/includes/dragrace.h
@@ -85,6 +85,6 @@ private:
};
/*----------- defined in audio/dragrace.c -----------*/
-DISCRETE_SOUND_EXTERN( dragrace );
+DISCRETE_SOUND_EXTERN( dragrace_discrete );
#endif // MAME_INCLUDES_DRAGRACE_H
diff --git a/src/mame/includes/firetrk.h b/src/mame/includes/firetrk.h
index 0044bed38de..b5e533cef40 100644
--- a/src/mame/includes/firetrk.h
+++ b/src/mame/includes/firetrk.h
@@ -162,6 +162,6 @@ public:
/*----------- defined in audio/firetrk.c -----------*/
-DISCRETE_SOUND_EXTERN( firetrk );
-DISCRETE_SOUND_EXTERN( superbug );
-DISCRETE_SOUND_EXTERN( montecar );
+DISCRETE_SOUND_EXTERN( firetrk_discrete );
+DISCRETE_SOUND_EXTERN( superbug_discrete );
+DISCRETE_SOUND_EXTERN( montecar_discrete );
diff --git a/src/mame/includes/galaga.h b/src/mame/includes/galaga.h
index b0320f7ab4b..0078fe69ed7 100644
--- a/src/mame/includes/galaga.h
+++ b/src/mame/includes/galaga.h
@@ -102,7 +102,7 @@ public:
void gatsbee_main_map(address_map &map);
};
-DISCRETE_SOUND_EXTERN( galaga );
-DISCRETE_SOUND_EXTERN( bosco );
+DISCRETE_SOUND_EXTERN( galaga_discrete );
+DISCRETE_SOUND_EXTERN( bosco_discrete );
#endif // MAME_INCLUDES_GALAGA_H
diff --git a/src/mame/includes/grchamp.h b/src/mame/includes/grchamp.h
index 3c7d5ea3c76..17d1b1efaea 100644
--- a/src/mame/includes/grchamp.h
+++ b/src/mame/includes/grchamp.h
@@ -137,4 +137,4 @@ private:
/*----------- defined in audio/grchamp.c -----------*/
-DISCRETE_SOUND_EXTERN( grchamp );
+DISCRETE_SOUND_EXTERN( grchamp_discrete );
diff --git a/src/mame/includes/hitme.h b/src/mame/includes/hitme.h
index e8a43f5722e..bfc2a61103e 100644
--- a/src/mame/includes/hitme.h
+++ b/src/mame/includes/hitme.h
@@ -5,6 +5,10 @@
Hitme hardware
*************************************************************************/
+#ifndef MAME_INCLUDES_HITME_H
+#define MAME_INCLUDES_HITME_H
+
+#pragma once
#include "sound/discrete.h"
#include "screen.h"
@@ -62,4 +66,6 @@ public:
/*----------- defined in audio/hitme.c -----------*/
-DISCRETE_SOUND_EXTERN( hitme );
+DISCRETE_SOUND_EXTERN( hitme_discrete );
+
+#endif // MAME_INCLUDES_HITME_H
diff --git a/src/mame/includes/m79amb.h b/src/mame/includes/m79amb.h
index 63a3df47201..367e331efb3 100644
--- a/src/mame/includes/m79amb.h
+++ b/src/mame/includes/m79amb.h
@@ -1,5 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Al Kossow
+#ifndef MAME_INCLUDES_M79AMB_H
+#define MAME_INCLUDES_M79AMB_H
+
+#pragma once
+
#include "sound/discrete.h"
class m79amb_state : public driver_device
@@ -48,4 +53,6 @@ protected:
/*----------- defined in audio/m79amb.c -----------*/
-DISCRETE_SOUND_EXTERN( m79amb );
+DISCRETE_SOUND_EXTERN( m79amb_discrete );
+
+#endif // MAME_INCLUDES_M79AMB_H
diff --git a/src/mame/includes/madalien.h b/src/mame/includes/madalien.h
index 293b9b5f254..e253ccd5ac0 100644
--- a/src/mame/includes/madalien.h
+++ b/src/mame/includes/madalien.h
@@ -7,6 +7,8 @@
Original driver by Norbert Kehrer (February 2004)
***************************************************************************/
+#ifndef MAME_INCLUDES_MADALIEN_H
+#define MAME_INCLUDES_MADALIEN_H
#include "machine/gen_latch.h"
#include "sound/discrete.h"
@@ -91,8 +93,10 @@ public:
/*----------- defined in audio/madalien.c -----------*/
-DISCRETE_SOUND_EXTERN( madalien );
+DISCRETE_SOUND_EXTERN( madalien_discrete );
/* Discrete Sound Input Nodes */
#define MADALIEN_8910_PORTA NODE_01
#define MADALIEN_8910_PORTB NODE_02
+
+#endif // MAME_INCLUDES_MADALIEN_H
diff --git a/src/mame/includes/nitedrvr.h b/src/mame/includes/nitedrvr.h
index c10615ad9a3..e4151e6dc94 100644
--- a/src/mame/includes/nitedrvr.h
+++ b/src/mame/includes/nitedrvr.h
@@ -83,6 +83,6 @@ private:
};
/*----------- defined in audio/nitedrvr.c -----------*/
-DISCRETE_SOUND_EXTERN( nitedrvr );
+DISCRETE_SOUND_EXTERN( nitedrvr_discrete );
#endif // MAME_INCLUDES_NITEDRVR_H
diff --git a/src/mame/includes/norautp.h b/src/mame/includes/norautp.h
index 8e78ffc0548..55ddb2cef2a 100644
--- a/src/mame/includes/norautp.h
+++ b/src/mame/includes/norautp.h
@@ -1,5 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese, Roberto Fresca
+#ifndef MAME_INCLUDES_NORAUTP_H
+#define MAME_INCLUDES_NORAUTP_H
+
+#pragma once
+
#include "machine/i8255.h"
#include "sound/discrete.h"
#include "screen.h"
@@ -73,6 +78,8 @@ public:
};
/*----------- defined in audio/norautp.c -----------*/
-DISCRETE_SOUND_EXTERN( norautp );
-DISCRETE_SOUND_EXTERN( dphl );
-DISCRETE_SOUND_EXTERN( kimble );
+DISCRETE_SOUND_EXTERN( norautp_discrete );
+DISCRETE_SOUND_EXTERN( dphl_discrete );
+DISCRETE_SOUND_EXTERN( kimble_discrete );
+
+#endif // MAME_INCLUDES_NORAUTP_H
diff --git a/src/mame/includes/orbit.h b/src/mame/includes/orbit.h
index 697959510a9..4395aeeae91 100644
--- a/src/mame/includes/orbit.h
+++ b/src/mame/includes/orbit.h
@@ -84,6 +84,6 @@ private:
};
/*----------- defined in audio/orbit.c -----------*/
-DISCRETE_SOUND_EXTERN( orbit );
+DISCRETE_SOUND_EXTERN( orbit_discrete );
#endif // MAME_INCLUDES_ORBIT_H
diff --git a/src/mame/includes/poolshrk.h b/src/mame/includes/poolshrk.h
index d2dccbd175f..6244aba26f8 100644
--- a/src/mame/includes/poolshrk.h
+++ b/src/mame/includes/poolshrk.h
@@ -69,6 +69,6 @@ private:
/*----------- defined in audio/poolshrk.c -----------*/
-DISCRETE_SOUND_EXTERN( poolshrk );
+DISCRETE_SOUND_EXTERN( poolshrk_discrete );
#endif // MAME_INCLUDES_POOLSHRK_H
diff --git a/src/mame/includes/skydiver.h b/src/mame/includes/skydiver.h
index 9c88d887b69..2e8f27545be 100644
--- a/src/mame/includes/skydiver.h
+++ b/src/mame/includes/skydiver.h
@@ -108,6 +108,6 @@ private:
};
/*----------- defined in audio/skydiver.c -----------*/
-DISCRETE_SOUND_EXTERN( skydiver );
+DISCRETE_SOUND_EXTERN( skydiver_discrete );
#endif // MAME_INCLUDES_SKYDIVER_H
diff --git a/src/mame/includes/skyraid.h b/src/mame/includes/skyraid.h
index 1b77e50acd9..c350c39a601 100644
--- a/src/mame/includes/skyraid.h
+++ b/src/mame/includes/skyraid.h
@@ -62,6 +62,6 @@ private:
};
/*----------- defined in audio/skyraid.c -----------*/
-DISCRETE_SOUND_EXTERN( skyraid );
+DISCRETE_SOUND_EXTERN( skyraid_discrete );
#endif // MAME_INCLUDES_SKYRAID_H
diff --git a/src/mame/includes/sprint2.h b/src/mame/includes/sprint2.h
index 6a5b2b8c4f3..975205cd779 100644
--- a/src/mame/includes/sprint2.h
+++ b/src/mame/includes/sprint2.h
@@ -5,6 +5,10 @@
Atari Sprint hardware
*************************************************************************/
+#ifndef MAME_INCLUDES_SPRINT2_H
+#define MAME_INCLUDES_SPRINT2_H
+
+#pragma once
#include "machine/74259.h"
#include "machine/watchdog.h"
@@ -95,6 +99,8 @@ public:
};
/*----------- defined in audio/sprint2.c -----------*/
-DISCRETE_SOUND_EXTERN( sprint2 );
-DISCRETE_SOUND_EXTERN( sprint1 );
-DISCRETE_SOUND_EXTERN( dominos );
+DISCRETE_SOUND_EXTERN( sprint2_discrete );
+DISCRETE_SOUND_EXTERN( sprint1_discrete );
+DISCRETE_SOUND_EXTERN( dominos_discrete );
+
+#endif // MAME_INCLUDES_SPRINT2_H
diff --git a/src/mame/includes/sprint8.h b/src/mame/includes/sprint8.h
index ad1efed31f2..d9149494453 100644
--- a/src/mame/includes/sprint8.h
+++ b/src/mame/includes/sprint8.h
@@ -81,6 +81,6 @@ private:
};
/*----------- defined in audio/sprint8.c -----------*/
-DISCRETE_SOUND_EXTERN( sprint8 );
+DISCRETE_SOUND_EXTERN( sprint8_discrete );
#endif // MAME_INCLUDES_SPRINT8_H
diff --git a/src/mame/includes/starshp1.h b/src/mame/includes/starshp1.h
index 6f4784d2807..d666e9db81d 100644
--- a/src/mame/includes/starshp1.h
+++ b/src/mame/includes/starshp1.h
@@ -140,7 +140,7 @@ private:
/*----------- defined in audio/starshp1.c -----------*/
-DISCRETE_SOUND_EXTERN( starshp1 );
+DISCRETE_SOUND_EXTERN( starshp1_discrete );
/* Discrete Sound Input Nodes */
#define STARSHP1_NOISE_AMPLITUDE NODE_01
diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h
index 8cc15820021..4be02524ac5 100644
--- a/src/mame/includes/subs.h
+++ b/src/mame/includes/subs.h
@@ -5,6 +5,8 @@
Atari Subs hardware
*************************************************************************/
+#ifndef MAME_INCLUDES_SUBS_H
+#define MAME_INCLUDES_SUBS_H
#include "sound/discrete.h"
@@ -70,4 +72,6 @@ public:
/*----------- defined in audio/subs.c -----------*/
-DISCRETE_SOUND_EXTERN( subs );
+DISCRETE_SOUND_EXTERN( subs_discrete );
+
+#endif // MAME_INCLUDES_SUBS_H
diff --git a/src/mame/includes/tank8.h b/src/mame/includes/tank8.h
index 9666cd6cde1..a2210e11992 100644
--- a/src/mame/includes/tank8.h
+++ b/src/mame/includes/tank8.h
@@ -108,6 +108,6 @@ private:
/*----------- defined in audio/tank8.c -----------*/
-DISCRETE_SOUND_EXTERN( tank8 );
+DISCRETE_SOUND_EXTERN( tank8_discrete );
#endif // MAME_INCLUDES_TANK8_H
diff --git a/src/mame/includes/triplhnt.h b/src/mame/includes/triplhnt.h
index bab6e60d32e..edf00b4a0ec 100644
--- a/src/mame/includes/triplhnt.h
+++ b/src/mame/includes/triplhnt.h
@@ -105,7 +105,7 @@ private:
};
/*----------- defined in audio/triplhnt.cpp -----------*/
-DISCRETE_SOUND_EXTERN( triplhnt );
+DISCRETE_SOUND_EXTERN( triplhnt_discrete );
extern const char *const triplhnt_sample_names[];
#endif // MAME_INCLUDES_TRIPLHNT_H
diff --git a/src/mame/includes/videopin.h b/src/mame/includes/videopin.h
index 2ae279b8a07..31049b7fa07 100644
--- a/src/mame/includes/videopin.h
+++ b/src/mame/includes/videopin.h
@@ -86,6 +86,6 @@ private:
};
/*----------- defined in audio/videopin.c -----------*/
-DISCRETE_SOUND_EXTERN( videopin );
+DISCRETE_SOUND_EXTERN( videopin_discrete );
#endif // MAME_INCLUDES_VIDEOPIN_H
diff --git a/src/mame/machine/hec2hrp.cpp b/src/mame/machine/hec2hrp.cpp
index cd0955f87a0..00b7be2b622 100644
--- a/src/mame/machine/hec2hrp.cpp
+++ b/src/mame/machine/hec2hrp.cpp
@@ -798,7 +798,7 @@ void hec2hrp_state::hector_init()
/* sound hardware */
-static DISCRETE_SOUND_START( hec2hrp )
+static DISCRETE_SOUND_START( hec2hrp_discrete )
DISCRETE_INPUT_LOGIC(NODE_01)
DISCRETE_OUTPUT(NODE_01, 5000)
DISCRETE_SOUND_END
@@ -820,8 +820,7 @@ MACHINE_CONFIG_START(hec2hrp_state::hector_audio)
MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1)
- MCFG_DEVICE_ADD("discrete", DISCRETE) /* Son 1bit*/
- MCFG_DISCRETE_INTF(hec2hrp)
+ MCFG_DEVICE_ADD("discrete", DISCRETE, hec2hrp_discrete) /* Son 1bit*/
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/machine/k7659kb.cpp b/src/mame/machine/k7659kb.cpp
index 619b799ff77..e7338a105b2 100644
--- a/src/mame/machine/k7659kb.cpp
+++ b/src/mame/machine/k7659kb.cpp
@@ -53,7 +53,7 @@ const tiny_rom_entry *k7659_keyboard_device::device_rom_region() const
//-------------------------------------------------
-// DISCRETE_SOUND_START( k7659kb )
+// DISCRETE_SOUND_START( k7659kb_discrete )
//-------------------------------------------------
diff --git a/src/mame/machine/v1050kb.cpp b/src/mame/machine/v1050kb.cpp
index e93602c87f7..fdd39b32528 100644
--- a/src/mame/machine/v1050kb.cpp
+++ b/src/mame/machine/v1050kb.cpp
@@ -51,7 +51,7 @@ const tiny_rom_entry *v1050_keyboard_device::device_rom_region() const
//-------------------------------------------------
-// DISCRETE_SOUND_START( v1050kb )
+// DISCRETE_SOUND_START( v1050kb_discrete )
//-------------------------------------------------
static const discrete_555_desc v1050_ne555 =
@@ -61,7 +61,7 @@ static const discrete_555_desc v1050_ne555 =
DEFAULT_555_VALUES
};
-static DISCRETE_SOUND_START( v1050kb )
+static DISCRETE_SOUND_START( v1050kb_discrete )
DISCRETE_INPUT_LOGIC(NODE_01)
DISCRETE_555_ASTABLE(NODE_02, NODE_01, (int) RES_K(68) /* can't read on schematic */ , (int) RES_K(3), (int) CAP_N(10), &v1050_ne555)
DISCRETE_OUTPUT(NODE_02, 5000)
@@ -81,8 +81,7 @@ MACHINE_CONFIG_START(v1050_keyboard_device::device_add_mconfig)
// discrete sound
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE)
- MCFG_DISCRETE_INTF(v1050kb)
+ MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, v1050kb_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_CONFIG_END