summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Andrew Gardner <andrew-gardner@users.noreply.github.com>2013-01-31 15:46:45 +0000
committerGravatarGravatar Andrew Gardner <andrew-gardner@users.noreply.github.com>2013-01-31 15:46:45 +0000
commit0068d9316da7da20b4dbe168e4986c3dc765600e (patch) (github)
treee3ca101ee56c309c396f642b1b3afddca8251740
parentdaea35e7d56d3236188e36d4112ee1a8bf4b0cb3 (diff)
downloadmame-0068d9316da7da20b4dbe168e4986c3dc765600e.tar.bz2
mame-0068d9316da7da20b4dbe168e4986c3dc765600e.zip
Modernize the Volume and RC filter sound devices. [Andrew Gardner]
-rw-r--r--src/emu/sound/flt_rc.c145
-rw-r--r--src/emu/sound/flt_rc.h47
-rw-r--r--src/emu/sound/flt_vol.c79
-rw-r--r--src/emu/sound/flt_vol.h31
-rw-r--r--src/mame/audio/scramble.c2
-rw-r--r--src/mame/audio/timeplt.c14
-rw-r--r--src/mame/drivers/darius.c100
-rw-r--r--src/mame/drivers/ddribble.c12
-rw-r--r--src/mame/drivers/galaxold.c1
-rw-r--r--src/mame/drivers/junofrst.c8
-rw-r--r--src/mame/drivers/lockon.c36
-rw-r--r--src/mame/drivers/megazone.c8
-rw-r--r--src/mame/drivers/ninjaw.c28
-rw-r--r--src/mame/drivers/othunder.c36
-rw-r--r--src/mame/drivers/scramble.c1
-rw-r--r--src/mame/drivers/taito_z.c82
-rw-r--r--src/mame/drivers/tp84.c14
-rw-r--r--src/mame/drivers/warriorb.c28
-rw-r--r--src/mame/drivers/xexex.c24
-rw-r--r--src/mame/includes/darius.h38
-rw-r--r--src/mame/includes/lockon.h14
-rw-r--r--src/mame/includes/ninjaw.h10
-rw-r--r--src/mame/includes/othunder.h13
-rw-r--r--src/mame/includes/warriorb.h10
-rw-r--r--src/mame/includes/xexex.h9
25 files changed, 386 insertions, 404 deletions
diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c
index f4c059b9811..7d026a65253 100644
--- a/src/emu/sound/flt_rc.c
+++ b/src/emu/sound/flt_rc.c
@@ -1,38 +1,65 @@
#include "emu.h"
#include "flt_rc.h"
-struct filter_rc_state
+
+const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)};
+
+
+// device type definition
+const device_type FILTER_RC = &device_creator<filter_rc_device>;
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// qsound_device - constructor
+//-------------------------------------------------
+
+filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_stream(NULL),
+ m_k(0),
+ m_memory(0),
+ m_type(0)
{
- device_t *device;
- sound_stream * stream;
- int k;
- int memory;
- int type;
-};
-
-INLINE filter_rc_state *get_safe_token(device_t *device)
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void filter_rc_device::device_start()
{
- assert(device != NULL);
- assert(device->type() == FILTER_RC);
- return (filter_rc_state *)downcast<filter_rc_device *>(device)->token();
+ const flt_rc_config *conf = (const flt_rc_config *)static_config();
+
+ m_stream = stream_alloc(1, 1, machine().sample_rate());
+ if (conf)
+ set_RC_info(conf->type, conf->R1, conf->R2, conf->R3, conf->C);
+ else
+ set_RC_info(FLT_RC_LOWPASS, 1, 1, 1, 0);
}
-const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)};
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
-static STREAM_UPDATE( filter_rc_update )
+void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
stream_sample_t *src = inputs[0];
stream_sample_t *dst = outputs[0];
- filter_rc_state *info = (filter_rc_state *)param;
- int memory = info->memory;
+ int memory = m_memory;
- switch (info->type)
+ switch (m_type)
{
case FLT_RC_LOWPASS:
while (samples--)
{
- memory += ((*src++ - memory) * info->k) / 0x10000;
+ memory += ((*src++ - memory) * m_k) / 0x10000;
*dst++ = memory;
}
break;
@@ -41,26 +68,27 @@ static STREAM_UPDATE( filter_rc_update )
while (samples--)
{
*dst++ = *src - memory;
- memory += ((*src++ - memory) * info->k) / 0x10000;
+ memory += ((*src++ - memory) * m_k) / 0x10000;
}
break;
}
- info->memory = memory;
+ m_memory = memory;
}
-static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, double R3, double C)
+
+void filter_rc_device::set_RC_info(int type, double R1, double R2, double R3, double C)
{
double Req;
- info->type = type;
+ m_type = type;
- switch (info->type)
+ switch (m_type)
{
case FLT_RC_LOWPASS:
if (C == 0.0)
{
/* filter disabled */
- info->k = 0x10000;
+ m_k = 0x10000;
return;
}
Req = (R1 * (R2 + R3)) / (R1 + R2 + R3);
@@ -70,80 +98,25 @@ static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, d
if (C == 0.0)
{
/* filter disabled */
- info->k = 0x0;
- info->memory = 0x0;
+ m_k = 0x0;
+ m_memory = 0x0;
return;
}
Req = R1;
break;
default:
- fatalerror("filter_rc_setRC: Wrong filter type %d\n", info->type);
+ fatalerror("filter_rc_setRC: Wrong filter type %d\n", m_type);
}
/* Cut Frequency = 1/(2*Pi*Req*C) */
/* k = (1-(EXP(-TIMEDELTA/RC))) */
- info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine().sample_rate()));
-}
-
-
-static DEVICE_START( filter_rc )
-{
- filter_rc_state *info = get_safe_token(device);
- const flt_rc_config *conf = (const flt_rc_config *)device->static_config();
-
- info->device = device;
- info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_rc_update);
- if (conf)
- set_RC_info(info, conf->type, conf->R1, conf->R2, conf->R3, conf->C);
- else
- set_RC_info(info, FLT_RC_LOWPASS, 1, 1, 1, 0);
-}
-
-
-void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R3, double C)
-{
- filter_rc_state *info = get_safe_token(device);
-
- info->stream->update();
-
- set_RC_info(info, type, R1, R2, R3, C);
-
-}
-
-const device_type FILTER_RC = &device_creator<filter_rc_device>;
-
-filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock),
- device_sound_interface(mconfig, *this)
-{
- m_token = global_alloc_clear(filter_rc_state);
+ m_k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / machine().sample_rate()));
}
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-void filter_rc_device::device_config_complete()
+void filter_rc_device::filter_rc_set_RC(int type, double R1, double R2, double R3, double C)
{
+ m_stream->update();
+ set_RC_info(type, R1, R2, R3, C);
}
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void filter_rc_device::device_start()
-{
- DEVICE_START_NAME( filter_rc )(this);
-}
-
-//-------------------------------------------------
-// sound_stream_update - handle a stream update
-//-------------------------------------------------
-
-void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
-{
- // should never get here
- fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
-}
diff --git a/src/emu/sound/flt_rc.h b/src/emu/sound/flt_rc.h
index 7e321d3fd61..aeb18716632 100644
--- a/src/emu/sound/flt_rc.h
+++ b/src/emu/sound/flt_rc.h
@@ -1,14 +1,9 @@
#pragma once
#ifndef __FLT_RC_H__
-#define FLT_RC_H
+#define __FLT_RC_H__
#include "machine/rescap.h"
-#include "devlegcy.h"
-
-#define FLT_RC_LOWPASS 0
-#define FLT_RC_HIGHPASS 1
-#define FLT_RC_AC 2
/*
* FLT_RC_LOWPASS:
@@ -45,6 +40,24 @@
*
*/
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_FILTER_RC_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FILTER_RC, _clock)
+#define MCFG_FILTER_RC_REPLACE(_tag, _clock) \
+ MCFG_DEVICE_REPLACE(_tag, FILTER_RC, _clock)
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+#define FLT_RC_LOWPASS 0
+#define FLT_RC_HIGHPASS 1
+#define FLT_RC_AC 2
+
struct flt_rc_config
{
int type;
@@ -56,27 +69,33 @@ struct flt_rc_config
extern const flt_rc_config flt_rc_ac_default;
-void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R3, double C);
+
+// ======================> filter_rc_device
class filter_rc_device : public device_t,
- public device_sound_interface
+ public device_sound_interface
{
public:
filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- ~filter_rc_device() { global_free(m_token); }
+ ~filter_rc_device() { }
+
+ void filter_rc_set_RC(int type, double R1, double R2, double R3, double C);
- // access to legacy token
- void *token() const { assert(m_token != NULL); return m_token; }
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+private:
+ void set_RC_info(int type, double R1, double R2, double R3, double C);
+
private:
- // internal state
- void *m_token;
+ sound_stream* m_stream;
+ int m_k;
+ int m_memory;
+ int m_type;
};
extern const device_type FILTER_RC;
diff --git a/src/emu/sound/flt_vol.c b/src/emu/sound/flt_vol.c
index 66a5ee55c30..2532371ecb9 100644
--- a/src/emu/sound/flt_vol.c
+++ b/src/emu/sound/flt_vol.c
@@ -2,81 +2,50 @@
#include "flt_vol.h"
-struct filter_volume_state
-{
- sound_stream * stream;
- int gain;
-};
-
-INLINE filter_volume_state *get_safe_token(device_t *device)
-{
- assert(device != NULL);
- assert(device->type() == FILTER_VOLUME);
- return (filter_volume_state *)downcast<filter_volume_device *>(device)->token();
-}
-
-
-
-static STREAM_UPDATE( filter_volume_update )
-{
- stream_sample_t *src = inputs[0];
- stream_sample_t *dst = outputs[0];
- filter_volume_state *info = (filter_volume_state *)param;
-
- while (samples--)
- *dst++ = (*src++ * info->gain) >> 8;
-}
-
-
-static DEVICE_START( filter_volume )
-{
- filter_volume_state *info = get_safe_token(device);
-
- info->gain = 0x100;
- info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_volume_update);
-}
-
-
-void flt_volume_set_volume(device_t *device, float volume)
-{
- filter_volume_state *info = get_safe_token(device);
- info->gain = (int)(volume * 256);
-}
-
+// device type definition
const device_type FILTER_VOLUME = &device_creator<filter_volume_device>;
-filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock),
- device_sound_interface(mconfig, *this)
-{
- m_token = global_alloc_clear(filter_volume_state);
-}
-
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
+// qsound_device - constructor
//-------------------------------------------------
-void filter_volume_device::device_config_complete()
+filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_stream(NULL),
+ m_gain(0)
{
}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void filter_volume_device::device_start()
{
- DEVICE_START_NAME( filter_volume )(this);
+ m_gain = 0x100;
+ m_stream = stream_alloc(1, 1, machine().sample_rate());
}
+
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void filter_volume_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
- // should never get here
- fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+ stream_sample_t *src = inputs[0];
+ stream_sample_t *dst = outputs[0];
+
+ while (samples--)
+ *dst++ = (*src++ * m_gain) >> 8;
+}
+
+
+
+void filter_volume_device::flt_volume_set_volume(float volume)
+{
+ m_gain = (int)(volume * 256);
}
+
diff --git a/src/emu/sound/flt_vol.h b/src/emu/sound/flt_vol.h
index 9c7047acf64..7836930247c 100644
--- a/src/emu/sound/flt_vol.h
+++ b/src/emu/sound/flt_vol.h
@@ -3,30 +3,43 @@
#ifndef __FLT_VOL_H__
#define __FLT_VOL_H__
-#include "devlegcy.h"
-void flt_volume_set_volume(device_t *device, float volume);
+//**************************************************************************
+// 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
+//**************************************************************************
+
+// ======================> filter_volume_device
class filter_volume_device : public device_t,
- public device_sound_interface
+ public device_sound_interface
{
public:
filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- ~filter_volume_device() { global_free(m_token); }
+ ~filter_volume_device() { }
+
+ void flt_volume_set_volume(float volume);
- // access to legacy token
- void *token() const { assert(m_token != NULL); return m_token; }
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
private:
- // internal state
- void *m_token;
+ sound_stream* m_stream;
+ int m_gain;
};
extern const device_type FILTER_VOLUME;
diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c
index 09aadfb4e50..37fe1342855 100644
--- a/src/mame/audio/scramble.c
+++ b/src/mame/audio/scramble.c
@@ -141,7 +141,7 @@ static void filter_w(device_t *device, int data)
if (data & 2)
C += 47000; /* 47000pF = 0.047uF */
if (device != NULL)
- filter_rc_set_RC(device,FLT_RC_LOWPASS,1000,5100,0,CAP_P(C));
+ dynamic_cast<filter_rc_device*>(device)->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(C));
}
WRITE8_MEMBER(scramble_state::scramble_filter_w)
diff --git a/src/mame/audio/timeplt.c b/src/mame/audio/timeplt.c
index 7c54c76000b..6c538237655 100644
--- a/src/mame/audio/timeplt.c
+++ b/src/mame/audio/timeplt.c
@@ -118,7 +118,7 @@ static void filter_w( device_t *device, int data )
if (data & 2)
C += 47000; /* 47000pF = 0.047uF */
- filter_rc_set_RC(device, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(C));
+ dynamic_cast<filter_rc_device*>(device)->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(C));
}
@@ -233,18 +233,18 @@ MACHINE_CONFIG_FRAGMENT( timeplt_sound )
MCFG_SOUND_ROUTE(1, "filter.1.1", 0.60)
MCFG_SOUND_ROUTE(2, "filter.1.2", 0.60)
- MCFG_SOUND_ADD("filter.0.0", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.0", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.0.1", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.1", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.0.2", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.2", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.1.0", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.1.0", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.1.1", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.1.1", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.1.2", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.1.2", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c
index a94fba5b8f2..2ce5a07cd1f 100644
--- a/src/mame/drivers/darius.c
+++ b/src/mame/drivers/darius.c
@@ -307,9 +307,9 @@ static void update_fm0( running_machine &machine )
int right = ((0xff - state->m_pan[0]) * state->m_vol[6]) >> 8;
if (state->m_filter0_3l != NULL)
- flt_volume_set_volume(state->m_filter0_3l, left / 100.0);
+ state->m_filter0_3l->flt_volume_set_volume(left / 100.0);
if (state->m_filter0_3r != NULL)
- flt_volume_set_volume(state->m_filter0_3r, right / 100.0); /* FM #0 */
+ state->m_filter0_3r->flt_volume_set_volume(right / 100.0); /* FM #0 */
}
static void update_fm1( running_machine &machine )
@@ -319,15 +319,15 @@ static void update_fm1( running_machine &machine )
int right = ((0xff - state->m_pan[1]) * state->m_vol[7]) >> 8;
if (state->m_filter1_3l != NULL)
- flt_volume_set_volume(state->m_filter1_3l, left / 100.0);
+ state->m_filter1_3l->flt_volume_set_volume(left / 100.0);
if (state->m_filter1_3r != NULL)
- flt_volume_set_volume(state->m_filter1_3r, right / 100.0); /* FM #1 */
+ state->m_filter1_3r->flt_volume_set_volume(right / 100.0); /* FM #1 */
}
static void update_psg0( running_machine &machine, int port )
{
darius_state *state = machine.driver_data<darius_state>();
- device_t *lvol = NULL, *rvol = NULL;
+ filter_volume_device *lvol = NULL, *rvol = NULL;
int left, right;
switch (port)
@@ -342,15 +342,15 @@ static void update_psg0( running_machine &machine, int port )
right = ((0xff - state->m_pan[2]) * state->m_vol[port]) >> 8;
if (lvol != NULL)
- flt_volume_set_volume(lvol, left / 100.0);
+ lvol->flt_volume_set_volume(left / 100.0);
if (rvol != NULL)
- flt_volume_set_volume(rvol, right / 100.0);
+ rvol->flt_volume_set_volume(right / 100.0);
}
static void update_psg1( running_machine &machine, int port )
{
darius_state *state = machine.driver_data<darius_state>();
- device_t *lvol = NULL, *rvol = NULL;
+ filter_volume_device *lvol = NULL, *rvol = NULL;
int left, right;
switch (port)
@@ -365,9 +365,9 @@ static void update_psg1( running_machine &machine, int port )
right = ((0xff - state->m_pan[3]) * state->m_vol[port + 3]) >> 8;
if (lvol != NULL)
- flt_volume_set_volume(lvol, left / 100.0);
+ lvol->flt_volume_set_volume(left / 100.0);
if (rvol != NULL)
- flt_volume_set_volume(rvol, right / 100.0);
+ rvol->flt_volume_set_volume(right / 100.0);
}
static void update_da( running_machine &machine )
@@ -377,9 +377,9 @@ static void update_da( running_machine &machine )
int right = state->m_def_vol[(state->m_pan[4] >> 0) & 0x0f];
if (state->m_msm5205_l != NULL)
- flt_volume_set_volume(state->m_msm5205_l, left / 100.0);
+ state->m_msm5205_l->flt_volume_set_volume(left / 100.0);
if (state->m_msm5205_r != NULL)
- flt_volume_set_volume(state->m_msm5205_r, right / 100.0);
+ state->m_msm5205_r->flt_volume_set_volume(right / 100.0);
}
WRITE8_MEMBER(darius_state::darius_fm0_pan)
@@ -843,26 +843,26 @@ void darius_state::machine_start()
m_mscreen = machine().device("mscreen");
m_rscreen = machine().device("rscreen");
- m_filter0_0l = machine().device("filter0.0l");
- m_filter0_0r = machine().device("filter0.0r");
- m_filter0_1l = machine().device("filter0.1l");
- m_filter0_1r = machine().device("filter0.1r");
- m_filter0_2l = machine().device("filter0.2l");
- m_filter0_2r = machine().device("filter0.2r");
- m_filter0_3l = machine().device("filter0.3l");
- m_filter0_3r = machine().device("filter0.3r");
-
- m_filter1_0l = machine().device("filter1.0l");
- m_filter1_0r = machine().device("filter1.0r");
- m_filter1_1l = machine().device("filter1.1l");
- m_filter1_1r = machine().device("filter1.1r");
- m_filter1_2l = machine().device("filter1.2l");
- m_filter1_2r = machine().device("filter1.2r");
- m_filter1_3l = machine().device("filter1.3l");
- m_filter1_3r = machine().device("filter1.3r");
-
- m_msm5205_l = machine().device("msm5205.l");
- m_msm5205_r = machine().device("msm5205.r");
+ m_filter0_0l = machine().device<filter_volume_device>("filter0.0l");
+ m_filter0_0r = machine().device<filter_volume_device>("filter0.0r");
+ m_filter0_1l = machine().device<filter_volume_device>("filter0.1l");
+ m_filter0_1r = machine().device<filter_volume_device>("filter0.1r");
+ m_filter0_2l = machine().device<filter_volume_device>("filter0.2l");
+ m_filter0_2r = machine().device<filter_volume_device>("filter0.2r");
+ m_filter0_3l = machine().device<filter_volume_device>("filter0.3l");
+ m_filter0_3r = machine().device<filter_volume_device>("filter0.3r");
+
+ m_filter1_0l = machine().device<filter_volume_device>("filter1.0l");
+ m_filter1_0r = machine().device<filter_volume_device>("filter1.0r");
+ m_filter1_1l = machine().device<filter_volume_device>("filter1.1l");
+ m_filter1_1r = machine().device<filter_volume_device>("filter1.1r");
+ m_filter1_2l = machine().device<filter_volume_device>("filter1.2l");
+ m_filter1_2r = machine().device<filter_volume_device>("filter1.2r");
+ m_filter1_3l = machine().device<filter_volume_device>("filter1.3l");
+ m_filter1_3r = machine().device<filter_volume_device>("filter1.3r");
+
+ m_msm5205_l = machine().device<filter_volume_device>("msm5205.l");
+ m_msm5205_r = machine().device<filter_volume_device>("msm5205.r");
save_item(NAME(m_cpua_ctrl));
save_item(NAME(m_coin_word));
@@ -982,43 +982,43 @@ static MACHINE_CONFIG_START( darius, darius_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.l", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.r", 1.0)
- MCFG_SOUND_ADD("filter0.0l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.0l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter0.0r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.0r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter0.1l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.1l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter0.1r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.1r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter0.2l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.2l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter0.2r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.2r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter0.3l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.3l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter0.3r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter0.3r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.0l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.0l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.0r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.0r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.1l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.1l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.1r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.1r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.2l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.2l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.2r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.2r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.3l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.3l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter1.3r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1.3r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("msm5205.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("msm5205.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("msm5205.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("msm5205.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", darius_tc0140syt_intf)
diff --git a/src/mame/drivers/ddribble.c b/src/mame/drivers/ddribble.c
index 032694fdb75..dec92067a08 100644
--- a/src/mame/drivers/ddribble.c
+++ b/src/mame/drivers/ddribble.c
@@ -98,13 +98,13 @@ WRITE8_MEMBER(ddribble_state::ddribble_vlm5030_ctrl_w)
vlm5030_set_rom(device, &SPEECH_ROM[data & 0x08 ? 0x10000 : 0]);
/* b2 : SSG-C rc filter enable */
- filter_rc_set_RC(m_filter3, FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x04 ? CAP_N(150) : 0); /* YM2203-SSG-C */
+ dynamic_cast<filter_rc_device*>(m_filter3)->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x04 ? CAP_N(150) : 0); /* YM2203-SSG-C */
/* b1 : SSG-B rc filter enable */
- filter_rc_set_RC(m_filter2, FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x02 ? CAP_N(150) : 0); /* YM2203-SSG-B */
+ dynamic_cast<filter_rc_device*>(m_filter2)->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x02 ? CAP_N(150) : 0); /* YM2203-SSG-B */
/* b0 : SSG-A rc filter enable */
- filter_rc_set_RC(m_filter1, FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x01 ? CAP_N(150) : 0); /* YM2203-SSG-A */
+ dynamic_cast<filter_rc_device*>(m_filter1)->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x01 ? CAP_N(150) : 0); /* YM2203-SSG-A */
}
@@ -320,11 +320,11 @@ static MACHINE_CONFIG_START( ddribble, ddribble_state )
MCFG_SOUND_CONFIG(vlm5030_config)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter1", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter1", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter2", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter2", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter3", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter3", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index 3654f5e94d1..ec51c71770a 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -368,7 +368,6 @@ Stephh's notes (based on the games Z80 code and some tests) for other games :
#include "sound/ay8910.h"
#include "sound/sn76496.h"
#include "sound/dac.h"
-#include "sound/flt_rc.h"
#include "audio/galaxian.h"
#include "includes/galaxold.h"
diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c
index 3a69dbdc4f5..faf759b56f4 100644
--- a/src/mame/drivers/junofrst.c
+++ b/src/mame/drivers/junofrst.c
@@ -230,7 +230,7 @@ WRITE8_MEMBER(junofrst_state::junofrst_portB_w)
C += 220000; /* 220000pF = 0.22uF */
data >>= 2;
- filter_rc_set_RC(filter[i], FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(C));
+ dynamic_cast<filter_rc_device*>(filter[i])->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(C));
}
}
@@ -453,11 +453,11 @@ static MACHINE_CONFIG_START( junofrst, junofrst_state )
MCFG_DAC_ADD("dac")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_SOUND_ADD("filter.0.0", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.0", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.0.1", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.1", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.0.2", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.2", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c
index 640cf602bb3..ed9a71f815a 100644
--- a/src/mame/drivers/lockon.c
+++ b/src/mame/drivers/lockon.c
@@ -405,13 +405,13 @@ WRITE8_MEMBER(lockon_state::sound_vol)
double lgain = gains[data & 0xf];
double rgain = gains[data >> 4];
- flt_volume_set_volume(m_f2203_1l, lgain);
- flt_volume_set_volume(m_f2203_2l, lgain);
- flt_volume_set_volume(m_f2203_3l, lgain);
+ m_f2203_1l->flt_volume_set_volume(lgain);
+ m_f2203_2l->flt_volume_set_volume(lgain);
+ m_f2203_3l->flt_volume_set_volume(lgain);
- flt_volume_set_volume(m_f2203_1r, rgain);
- flt_volume_set_volume(m_f2203_2r, rgain);
- flt_volume_set_volume(m_f2203_3r, rgain);
+ m_f2203_1r->flt_volume_set_volume(rgain);
+ m_f2203_2r->flt_volume_set_volume(rgain);
+ m_f2203_3r->flt_volume_set_volume(rgain);
}
static void ym2203_irq(device_t *device, int irq)
@@ -456,12 +456,12 @@ void lockon_state::machine_start()
m_audiocpu = machine().device<cpu_device>("audiocpu");
m_ground = machine().device("ground");
m_object = machine().device("object");
- m_f2203_1l = machine().device("f2203.1l");
- m_f2203_2l = machine().device("f2203.2l");
- m_f2203_3l = machine().device("f2203.3l");
- m_f2203_1r = machine().device("f2203.1r");
- m_f2203_2r = machine().device("f2203.2r");
- m_f2203_3r = machine().device("f2203.3r");
+ m_f2203_1l = machine().device<filter_volume_device>("f2203.1l");
+ m_f2203_2l = machine().device<filter_volume_device>("f2203.2l");
+ m_f2203_3l = machine().device<filter_volume_device>("f2203.3l");
+ m_f2203_1r = machine().device<filter_volume_device>("f2203.1r");
+ m_f2203_2r = machine().device<filter_volume_device>("f2203.2r");
+ m_f2203_3r = machine().device<filter_volume_device>("f2203.3r");
save_item(NAME(m_ground_ctrl));
save_item(NAME(m_scroll_h));
@@ -544,17 +544,17 @@ static MACHINE_CONFIG_START( lockon, lockon_state )
MCFG_SOUND_ROUTE(3, "f2203.3l", 1.0)
MCFG_SOUND_ROUTE(3, "f2203.3r", 1.0)
- MCFG_SOUND_ADD("f2203.1l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("f2203.1l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("f2203.1r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("f2203.1r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("f2203.2l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("f2203.2l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("f2203.2r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("f2203.2r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("f2203.3l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("f2203.3l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("f2203.3r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("f2203.3r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/megazone.c b/src/mame/drivers/megazone.c
index 44134c650e0..ddbfcb4dbae 100644
--- a/src/mame/drivers/megazone.c
+++ b/src/mame/drivers/megazone.c
@@ -51,7 +51,7 @@ WRITE8_MEMBER(megazone_state::megazone_port_b_w)
C += 220000; /* 220000pF = 0.22uF */
data >>= 2;
- filter_rc_set_RC(machine().device(fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C));
+ dynamic_cast<filter_rc_device*>(machine().device(fltname[i]))->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(C));
}
}
@@ -289,11 +289,11 @@ static MACHINE_CONFIG_START( megazone, megazone_state )
MCFG_DAC_ADD("dac")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_SOUND_ADD("filter.0.0", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.0", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.0.1", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.1", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter.0.2", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter.0.2", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index 470b196a063..94954b7ec0f 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -389,7 +389,7 @@ READ16_MEMBER(ninjaw_state::ninjaw_sound_r)
WRITE8_MEMBER(ninjaw_state::ninjaw_pancontrol)
{
- device_t *flt = NULL;
+ filter_volume_device *flt = NULL;
offset &= 3;
switch (offset)
@@ -402,7 +402,7 @@ WRITE8_MEMBER(ninjaw_state::ninjaw_pancontrol)
m_pandata[offset] = (float)data * (100.f / 255.0f);
//popmessage(" pan %02x %02x %02x %02x", m_pandata[0], m_pandata[1], m_pandata[2], m_pandata[3] );
- flt_volume_set_volume(flt, m_pandata[offset] / 100.0);
+ flt->flt_volume_set_volume(m_pandata[offset] / 100.0);
}
@@ -811,10 +811,10 @@ void ninjaw_state::machine_start()
m_mscreen = machine().device("mscreen");
m_rscreen = machine().device("rscreen");
- m_2610_1l = machine().device("2610.1.l");
- m_2610_1r = machine().device("2610.1.r");
- m_2610_2l = machine().device("2610.2.l");
- m_2610_2r = machine().device("2610.2.r");
+ m_2610_1l = machine().device<filter_volume_device>("2610.1.l");
+ m_2610_1r = machine().device<filter_volume_device>("2610.1.r");
+ m_2610_2l = machine().device<filter_volume_device>("2610.2.l");
+ m_2610_2r = machine().device<filter_volume_device>("2610.2.r");
save_item(NAME(m_cpua_ctrl));
save_item(NAME(m_banknum));
@@ -897,13 +897,13 @@ static MACHINE_CONFIG_START( ninjaw, ninjaw_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
// MCFG_SOUND_ADD("subwoofer", SUBWOOFER, 0)
@@ -977,13 +977,13 @@ static MACHINE_CONFIG_START( darius2, ninjaw_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
// MCFG_SOUND_ADD("subwoofer", SUBWOOFER, 0)
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index 1953dadc924..273b16796a3 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -424,20 +424,20 @@ WRITE8_MEMBER(othunder_state::othunder_TC0310FAM_w)
because we are using the AY-3-8910 emulation. */
volr = (m_pan[0] + m_pan[2]) * 100 / (2 * 0x1f);
voll = (m_pan[1] + m_pan[3]) * 100 / (2 * 0x1f);
- flt_volume_set_volume(m_2610_0l, voll / 100.0);
- flt_volume_set_volume(m_2610_0r, volr / 100.0);
+ m_2610_0l->flt_volume_set_volume(voll / 100.0);
+ m_2610_0r->flt_volume_set_volume(volr / 100.0);
/* CH1 */
volr = m_pan[0] * 100 / 0x1f;
voll = m_pan[1] * 100 / 0x1f;
- flt_volume_set_volume(m_2610_1l, voll / 100.0);
- flt_volume_set_volume(m_2610_1r, volr / 100.0);
+ m_2610_1l->flt_volume_set_volume(voll / 100.0);
+ m_2610_1r->flt_volume_set_volume(volr / 100.0);
/* CH2 */
volr = m_pan[2] * 100 / 0x1f;
voll = m_pan[3] * 100 / 0x1f;
- flt_volume_set_volume(m_2610_2l, voll / 100.0);
- flt_volume_set_volume(m_2610_2r, volr / 100.0);
+ m_2610_2l->flt_volume_set_volume(voll / 100.0);
+ m_2610_2r->flt_volume_set_volume(volr / 100.0);
}
@@ -674,12 +674,12 @@ void othunder_state::machine_start()
m_tc0100scn = machine().device("tc0100scn");
m_tc0110pcr = machine().device("tc0110pcr");
m_tc0140syt = machine().device("tc0140syt");
- m_2610_0l = machine().device("2610.0l");
- m_2610_0r = machine().device("2610.0r");
- m_2610_1l = machine().device("2610.1l");
- m_2610_1r = machine().device("2610.1r");
- m_2610_2l = machine().device("2610.2l");
- m_2610_2r = machine().device("2610.2r");
+ m_2610_0l = machine().device<filter_volume_device>("2610.0l");
+ m_2610_0r = machine().device<filter_volume_device>("2610.0r");
+ m_2610_1l = machine().device<filter_volume_device>("2610.1l");
+ m_2610_1r = machine().device<filter_volume_device>("2610.1r");
+ m_2610_2l = machine().device<filter_volume_device>("2610.2l");
+ m_2610_2r = machine().device<filter_volume_device>("2610.2r");
save_item(NAME(m_vblank_irq));
save_item(NAME(m_ad_irq));
@@ -738,17 +738,17 @@ static MACHINE_CONFIG_START( othunder, othunder_state )
MCFG_SOUND_ROUTE(2, "2610.2l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2r", 1.0)
- MCFG_SOUND_ADD("2610.0l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.0l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.0r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.0r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", othunder_tc0140syt_intf)
diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c
index bfdb6a24556..55556ac33b4 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -30,7 +30,6 @@ Notes:
#include "cpu/s2650/s2650.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "sound/flt_rc.h"
#include "machine/7474.h"
#include "machine/i8255.h"
#include "includes/scramble.h"
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index a13bc5b8e64..18fd94e8c06 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -1475,7 +1475,7 @@ READ16_MEMBER(taitoz_state::taitoz_msb_sound_r)
WRITE8_MEMBER(taitoz_state::taitoz_pancontrol)
{
static const char *const fltname[] = { "2610.1.r", "2610.1.l", "2610.2.r", "2610.2.l" };
- flt_volume_set_volume(machine().device(fltname[offset & 3]), data / 255.0f);
+ dynamic_cast<filter_volume_device*>(machine().device(fltname[offset & 3]))->flt_volume_set_volume(data / 255.0f);
}
WRITE16_MEMBER(taitoz_state::spacegun_pancontrol)
@@ -3122,13 +3122,13 @@ static MACHINE_CONFIG_START( contcirc, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3184,13 +3184,13 @@ static MACHINE_CONFIG_START( chasehq, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3247,13 +3247,13 @@ static MACHINE_CONFIG_START( enforce, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 20.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 20.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3306,13 +3306,13 @@ static MACHINE_CONFIG_START( bshark, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 28.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 28.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3377,13 +3377,13 @@ static MACHINE_CONFIG_START( sci, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3441,13 +3441,13 @@ static MACHINE_CONFIG_START( nightstr, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3504,13 +3504,13 @@ static MACHINE_CONFIG_START( aquajack, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3563,13 +3563,13 @@ static MACHINE_CONFIG_START( spacegun, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3625,13 +3625,13 @@ static MACHINE_CONFIG_START( dblaxle, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
@@ -3687,13 +3687,13 @@ static MACHINE_CONFIG_START( racingb, taitoz_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
diff --git a/src/mame/drivers/tp84.c b/src/mame/drivers/tp84.c
index 03a08da7fc7..4d291b6df38 100644
--- a/src/mame/drivers/tp84.c
+++ b/src/mame/drivers/tp84.c
@@ -98,23 +98,23 @@ WRITE8_MEMBER(tp84_state::tp84_filter_w)
C = 0;
if (offset & 0x008) C += 47000; /* 47000pF = 0.047uF */
if (offset & 0x010) C += 470000; /* 470000pF = 0.47uF */
- filter_rc_set_RC(machine().device("filter1"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
+ dynamic_cast<filter_rc_device*>(machine().device("filter1"))->filter_rc_set_RC(FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
/* 76489 #1 (optional) */
C = 0;
if (offset & 0x020) C += 47000; /* 47000pF = 0.047uF */
if (offset & 0x040) C += 470000; /* 470000pF = 0.47uF */
-// filter_rc_set_RC(machine().device("filter2"),1000,2200,1000,C);
+ // dynamic_cast<filter_rc_device*>(machine().device("filter2"))->filter_rc_set_RC(,1000,2200,1000,C);
/* 76489 #2 */
C = 0;
if (offset & 0x080) C += 470000; /* 470000pF = 0.47uF */
- filter_rc_set_RC(machine().device("filter2"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
+ dynamic_cast<filter_rc_device*>(machine().device("filter2"))->filter_rc_set_RC(FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
/* 76489 #3 */
C = 0;
if (offset & 0x100) C += 470000; /* 470000pF = 0.47uF */
- filter_rc_set_RC(machine().device("filter3"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
+ dynamic_cast<filter_rc_device*>(machine().device("filter3"))->filter_rc_set_RC(FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
}
WRITE8_MEMBER(tp84_state::tp84_sh_irqtrigger_w)
@@ -346,11 +346,11 @@ static MACHINE_CONFIG_START( tp84, tp84_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter3", 0.75)
MCFG_SOUND_CONFIG(psg_intf)
- MCFG_SOUND_ADD("filter1", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter1", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter2", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter2", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_SOUND_ADD("filter3", FILTER_RC, 0)
+ MCFG_FILTER_RC_ADD("filter3", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c
index 53d73606223..9175e3e171f 100644
--- a/src/mame/drivers/warriorb.c
+++ b/src/mame/drivers/warriorb.c
@@ -195,7 +195,7 @@ READ16_MEMBER(warriorb_state::warriorb_sound_r)
WRITE8_MEMBER(warriorb_state::warriorb_pancontrol)
{
- device_t *flt = NULL;
+ filter_volume_device *flt = NULL;
offset &= 3;
switch (offset)
@@ -208,7 +208,7 @@ WRITE8_MEMBER(warriorb_state::warriorb_pancontrol)
m_pandata[offset] = (data << 1) + data; /* original volume*3 */
//popmessage(" pan %02x %02x %02x %02x", m_pandata[0], m_pandata[1], m_pandata[2], m_pandata[3] );
- flt_volume_set_volume(flt, m_pandata[offset] / 100.0);
+ flt->flt_volume_set_volume(m_pandata[offset] / 100.0);
}
@@ -517,10 +517,10 @@ void warriorb_state::machine_start()
m_lscreen = machine().device("lscreen");
m_rscreen = machine().device("rscreen");
- m_2610_1l = machine().device("2610.1.l");
- m_2610_1r = machine().device("2610.1.r");
- m_2610_2l = machine().device("2610.2.l");
- m_2610_2r = machine().device("2610.2.r");
+ m_2610_1l = machine().device<filter_volume_device>("2610.1.l");
+ m_2610_1r = machine().device<filter_volume_device>("2610.1.r");
+ m_2610_2l = machine().device<filter_volume_device>("2610.2.l");
+ m_2610_2r = machine().device<filter_volume_device>("2610.2.r");
save_item(NAME(m_banknum));
save_item(NAME(m_pandata));
@@ -585,13 +585,13 @@ static MACHINE_CONFIG_START( darius2d, warriorb_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", warriorb_tc0140syt_intf)
@@ -648,13 +648,13 @@ static MACHINE_CONFIG_START( warriorb, warriorb_state )
MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0)
MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0)
- MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.1.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MCFG_TC0140SYT_ADD("tc0140syt", warriorb_tc0140syt_intf)
diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c
index 0e6febf21bc..68079151e96 100644
--- a/src/mame/drivers/xexex.c
+++ b/src/mame/drivers/xexex.c
@@ -245,10 +245,10 @@ WRITE8_MEMBER(xexex_state::sound_bankswitch_w)
static void ym_set_mixing(device_t *device, double left, double right)
{
xexex_state *state = device->machine().driver_data<xexex_state>();
- flt_volume_set_volume(state->m_filter1l, (71.0 * left) / 55.0);
- flt_volume_set_volume(state->m_filter1r, (71.0 * right) / 55.0);
- flt_volume_set_volume(state->m_filter2l, (71.0 * left) / 55.0);
- flt_volume_set_volume(state->m_filter2r, (71.0 * right) / 55.0);
+ state->m_filter1l->flt_volume_set_volume((71.0 * left) / 55.0);
+ state->m_filter1r->flt_volume_set_volume((71.0 * right) / 55.0);
+ state->m_filter2l->flt_volume_set_volume((71.0 * left) / 55.0);
+ state->m_filter2r->flt_volume_set_volume((71.0 * right) / 55.0);
}
TIMER_CALLBACK_MEMBER(xexex_state::dmaend_callback)
@@ -462,10 +462,10 @@ void xexex_state::machine_start()
m_k056832 = machine().device("k056832");
m_k054338 = machine().device("k054338");
m_k054539 = machine().device("k054539");
- m_filter1l = machine().device("filter1l");
- m_filter1r = machine().device("filter1r");
- m_filter2l = machine().device("filter2l");
- m_filter2r = machine().device("filter2r");
+ m_filter1l = machine().device<filter_volume_device>("filter1l");
+ m_filter1r = machine().device<filter_volume_device>("filter1r");
+ m_filter2l = machine().device<filter_volume_device>("filter2l");
+ m_filter2r = machine().device<filter_volume_device>("filter2r");
save_item(NAME(m_cur_alpha));
save_item(NAME(m_sprite_colorbase));
@@ -555,13 +555,13 @@ static MACHINE_CONFIG_START( xexex, xexex_state )
MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter1l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter1r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter1r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_SOUND_ADD("filter2l", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter2l", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("filter2r", FILTER_VOLUME, 0)
+ MCFG_FILTER_VOLUME_ADD("filter2r", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/includes/darius.h b/src/mame/includes/darius.h
index fcff015b0fa..3bbaf88e043 100644
--- a/src/mame/includes/darius.h
+++ b/src/mame/includes/darius.h
@@ -4,6 +4,8 @@
*************************************************************************/
+#include <sound/flt_vol.h>
+
#define DARIUS_VOL_MAX (3*2 + 2)
#define DARIUS_PAN_MAX (2 + 2 + 1) /* FM 2port + PSG 2port + DA 1port */
@@ -44,24 +46,24 @@ public:
device_t *m_mscreen;
device_t *m_rscreen;
- device_t *m_filter0_0l;
- device_t *m_filter0_0r;
- device_t *m_filter0_1l;
- device_t *m_filter0_1r;
- device_t *m_filter0_2l;
- device_t *m_filter0_2r;
- device_t *m_filter0_3l;
- device_t *m_filter0_3r;
- device_t *m_filter1_0l;
- device_t *m_filter1_0r;
- device_t *m_filter1_1l;
- device_t *m_filter1_1r;
- device_t *m_filter1_2l;
- device_t *m_filter1_2r;
- device_t *m_filter1_3l;
- device_t *m_filter1_3r;
- device_t *m_msm5205_l;
- device_t *m_msm5205_r;
+ filter_volume_device *m_filter0_0l;
+ filter_volume_device *m_filter0_0r;
+ filter_volume_device *m_filter0_1l;
+ filter_volume_device *m_filter0_1r;
+ filter_volume_device *m_filter0_2l;
+ filter_volume_device *m_filter0_2r;
+ filter_volume_device *m_filter0_3l;
+ filter_volume_device *m_filter0_3r;
+ filter_volume_device *m_filter1_0l;
+ filter_volume_device *m_filter1_0r;
+ filter_volume_device *m_filter1_1l;
+ filter_volume_device *m_filter1_1r;
+ filter_volume_device *m_filter1_2l;
+ filter_volume_device *m_filter1_2r;
+ filter_volume_device *m_filter1_3l;
+ filter_volume_device *m_filter1_3r;
+ filter_volume_device *m_msm5205_l;
+ filter_volume_device *m_msm5205_r;
DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
DECLARE_WRITE16_MEMBER(darius_watchdog_w);
DECLARE_READ16_MEMBER(darius_ioc_r);
diff --git a/src/mame/includes/lockon.h b/src/mame/includes/lockon.h
index 68318c42f92..d12a7e6654e 100644
--- a/src/mame/includes/lockon.h
+++ b/src/mame/includes/lockon.h
@@ -4,6 +4,8 @@
*************************************************************************/
+#include <sound/flt_vol.h>
+
/* Calculated from CRT controller writes */
#define PIXEL_CLOCK (XTAL_21MHz / 3)
#define FRAMEBUFFER_CLOCK XTAL_10MHz
@@ -68,12 +70,12 @@ public:
cpu_device *m_audiocpu;
device_t *m_ground;
device_t *m_object;
- device_t *m_f2203_1l;
- device_t *m_f2203_2l;
- device_t *m_f2203_3l;
- device_t *m_f2203_1r;
- device_t *m_f2203_2r;
- device_t *m_f2203_3r;
+ filter_volume_device *m_f2203_1l;
+ filter_volume_device *m_f2203_2l;
+ filter_volume_device *m_f2203_3l;
+ filter_volume_device *m_f2203_1r;
+ filter_volume_device *m_f2203_2r;
+ filter_volume_device *m_f2203_3r;
DECLARE_READ16_MEMBER(lockon_crtc_r);
DECLARE_WRITE16_MEMBER(lockon_crtc_w);
DECLARE_WRITE16_MEMBER(lockon_char_w);
diff --git a/src/mame/includes/ninjaw.h b/src/mame/includes/ninjaw.h
index d57d53a909c..3737262e137 100644
--- a/src/mame/includes/ninjaw.h
+++ b/src/mame/includes/ninjaw.h
@@ -4,6 +4,8 @@
*************************************************************************/
+#include <sound/flt_vol.h>
+
class ninjaw_state : public driver_device
{
public:
@@ -30,10 +32,10 @@ public:
device_t *m_lscreen;
device_t *m_mscreen;
device_t *m_rscreen;
- device_t *m_2610_1l;
- device_t *m_2610_1r;
- device_t *m_2610_2l;
- device_t *m_2610_2r;
+ filter_volume_device *m_2610_1l;
+ filter_volume_device *m_2610_1r;
+ filter_volume_device *m_2610_2l;
+ filter_volume_device *m_2610_2r;
DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
DECLARE_WRITE16_MEMBER(ninjaw_sound_w);
diff --git a/src/mame/includes/othunder.h b/src/mame/includes/othunder.h
index 4bf409f0fdc..3e0e31adf8f 100644
--- a/src/mame/includes/othunder.h
+++ b/src/mame/includes/othunder.h
@@ -5,6 +5,7 @@
*************************************************************************/
#include "machine/eeprom.h"
+#include <sound/flt_vol.h>
struct othunder_tempsprite
{
@@ -44,12 +45,12 @@ public:
device_t *m_tc0100scn;
device_t *m_tc0110pcr;
device_t *m_tc0140syt;
- device_t *m_2610_0l;
- device_t *m_2610_0r;
- device_t *m_2610_1l;
- device_t *m_2610_1r;
- device_t *m_2610_2l;
- device_t *m_2610_2r;
+ filter_volume_device *m_2610_0l;
+ filter_volume_device *m_2610_0r;
+ filter_volume_device *m_2610_1l;
+ filter_volume_device *m_2610_1r;
+ filter_volume_device *m_2610_2l;
+ filter_volume_device *m_2610_2r;
DECLARE_WRITE16_MEMBER(irq_ack_w);
DECLARE_WRITE16_MEMBER(othunder_tc0220ioc_w);
DECLARE_READ16_MEMBER(othunder_tc0220ioc_r);
diff --git a/src/mame/includes/warriorb.h b/src/mame/includes/warriorb.h
index 7a0f5f241a5..7753b5d0263 100644
--- a/src/mame/includes/warriorb.h
+++ b/src/mame/includes/warriorb.h
@@ -4,6 +4,8 @@
*************************************************************************/
+#include <sound/flt_vol.h>
+
class warriorb_state : public driver_device
{
public:
@@ -26,10 +28,10 @@ public:
device_t *m_tc0100scn_2;
device_t *m_lscreen;
device_t *m_rscreen;
- device_t *m_2610_1l;
- device_t *m_2610_1r;
- device_t *m_2610_2l;
- device_t *m_2610_2r;
+ filter_volume_device *m_2610_1l;
+ filter_volume_device *m_2610_1r;
+ filter_volume_device *m_2610_2l;
+ filter_volume_device *m_2610_2r;
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
DECLARE_WRITE16_MEMBER(warriorb_sound_w);
DECLARE_READ16_MEMBER(warriorb_sound_r);
diff --git a/src/mame/includes/xexex.h b/src/mame/includes/xexex.h
index 49f1e695f22..ba3c7503137 100644
--- a/src/mame/includes/xexex.h
+++ b/src/mame/includes/xexex.h
@@ -5,6 +5,7 @@
*************************************************************************/
#include <video/k053250.h>
+#include <sound/flt_vol.h>
class xexex_state : public driver_device
{
@@ -38,10 +39,10 @@ public:
cpu_device *m_maincpu;
cpu_device *m_audiocpu;
device_t *m_k054539;
- device_t *m_filter1l;
- device_t *m_filter1r;
- device_t *m_filter2l;
- device_t *m_filter2r;
+ filter_volume_device *m_filter1l;
+ filter_volume_device *m_filter1r;
+ filter_volume_device *m_filter2l;
+ filter_volume_device *m_filter2r;
device_t *m_k056832;
device_t *m_k053246;
k053250_t *m_k053250;