summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2014-05-12 15:14:02 +0000
committer Ivan Vangelista <mesgnet@yahoo.it>2014-05-12 15:14:02 +0000
commitd8ff82006fff2b280fc9dd31f96558ada062dec5 (patch)
treef97847fc5460d45a30e067d110301420cb3d8f16 /src
parent425f05bc75355744cde0e37cfe20b751fdfbce07 (diff)
pokey_device: converted to devcb2 (nw)
Diffstat (limited to 'src')
-rw-r--r--src/emu/sound/pokey.c258
-rw-r--r--src/emu/sound/pokey.h80
-rw-r--r--src/mame/audio/atarijsa.c2
-rw-r--r--src/mame/audio/bwidow.c29
-rw-r--r--src/mame/audio/bzone.c10
-rw-r--r--src/mame/audio/jedi.c8
-rw-r--r--src/mame/drivers/asteroid.c19
-rw-r--r--src/mame/drivers/atarisy1.c2
-rw-r--r--src/mame/drivers/atarisy2.c29
-rw-r--r--src/mame/drivers/atetris.c28
-rw-r--r--src/mame/drivers/bartop52.c24
-rw-r--r--src/mame/drivers/bzone.c20
-rw-r--r--src/mame/drivers/ccastles.c21
-rw-r--r--src/mame/drivers/centiped.c49
-rw-r--r--src/mame/drivers/cloak.c29
-rw-r--r--src/mame/drivers/cloud9.c21
-rw-r--r--src/mame/drivers/firefox.c8
-rw-r--r--src/mame/drivers/foodf.c31
-rw-r--r--src/mame/drivers/gauntlet.c2
-rw-r--r--src/mame/drivers/irobot.c25
-rw-r--r--src/mame/drivers/liberatr.c30
-rw-r--r--src/mame/drivers/maxaflex.c9
-rw-r--r--src/mame/drivers/mhavoc.c28
-rw-r--r--src/mame/drivers/missile.c19
-rw-r--r--src/mame/drivers/quantum.c57
-rw-r--r--src/mame/drivers/runaway.c36
-rw-r--r--src/mame/drivers/starwars.c8
-rw-r--r--src/mame/drivers/tempest.c59
-rw-r--r--src/mame/drivers/tomcat.c4
-rw-r--r--src/mame/drivers/tunhunt.c42
-rw-r--r--src/mess/drivers/a7800.c8
-rw-r--r--src/mess/drivers/atari400.c56
32 files changed, 425 insertions, 626 deletions
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index f9d081f1eb7..623ea4b7a1d 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -185,42 +185,26 @@ pokey_device::pokey_device(const machine_config &mconfig, const char *tag, devic
device_sound_interface(mconfig, *this),
device_execute_interface(mconfig, *this),
device_state_interface(mconfig, *this),
- pokey_interface(),
m_kbd_r(NULL),
m_irq_f(NULL),
m_output_type(LEGACY_LINEAR),
m_icount(0),
- m_stream(NULL)
+ m_stream(NULL),
+ m_pot0_r_cb(*this),
+ m_pot1_r_cb(*this),
+ m_pot2_r_cb(*this),
+ m_pot3_r_cb(*this),
+ m_pot4_r_cb(*this),
+ m_pot5_r_cb(*this),
+ m_pot6_r_cb(*this),
+ m_pot7_r_cb(*this),
+ m_allpot_r_cb(*this),
+ m_serin_r_cb(*this),
+ m_serout_w_cb(*this)
{
}
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void pokey_device::device_config_complete()
-{
- // inherit a copy of the static data
- const pokey_interface *intf = reinterpret_cast<const pokey_interface *>(static_config());
- if (intf != NULL)
- {
- *static_cast<pokey_interface *>(this) = *intf;
- }
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_allpot_r_cb, 0, sizeof(m_allpot_r_cb));
- memset(&m_pot_r_cb, 0, sizeof(m_pot_r_cb));
- memset(&m_serin_r_cb, 0, sizeof(m_serin_r_cb));
- memset(&m_serout_w_cb, 0, sizeof(m_serout_w_cb));
- }
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -288,13 +272,20 @@ void pokey_device::device_start()
for (i=0; i<8; i++)
{
- m_pot_r[i].resolve(m_pot_r_cb[i], *this);
m_POTx[i] = 0;
}
-
- m_allpot_r.resolve(m_allpot_r_cb, *this);
- m_serin_r.resolve(m_serin_r_cb, *this);
- m_serout_w.resolve(m_serout_w_cb, *this);
+
+ m_pot0_r_cb.resolve();
+ m_pot1_r_cb.resolve();
+ m_pot2_r_cb.resolve();
+ m_pot3_r_cb.resolve();
+ m_pot4_r_cb.resolve();
+ m_pot5_r_cb.resolve();
+ m_pot6_r_cb.resolve();
+ m_pot7_r_cb.resolve();
+ m_allpot_r_cb.resolve();
+ m_serin_r_cb.resolve();
+ m_serout_w_cb.resolve_safe();
m_stream = stream_alloc(0, 1, clock());
@@ -844,9 +835,9 @@ UINT8 pokey_device::read(offs_t offset)
data = 0;
LOG(("POKEY '%s' ALLPOT internal $%02x (reset)\n", tag(), data));
}
- else if( !m_allpot_r.isnull() )
+ else if( !m_allpot_r_cb.isnull() )
{
- data = m_allpot_r(offset);
+ data = m_allpot_r_cb(offset);
LOG(("%s: POKEY '%s' ALLPOT callback $%02x\n", machine().describe_context(), tag(), data));
}
else
@@ -874,8 +865,8 @@ UINT8 pokey_device::read(offs_t offset)
break;
case SERIN_C:
- if( !m_serin_r.isnull() )
- m_SERIN = m_serin_r(offset);
+ if( !m_serin_r_cb.isnull() )
+ m_SERIN = m_serin_r_cb(offset);
data = m_SERIN;
LOG(("POKEY '%s' SERIN $%02x\n", tag(), data));
break;
@@ -1000,7 +991,7 @@ void pokey_device::write_internal(offs_t offset, UINT8 data)
case SEROUT_C:
LOG(("POKEY '%s' SEROUT $%02x\n", tag(), data));
- m_serout_w(offset, data);
+ m_serout_w_cb(offset, data);
m_SKSTAT |= SK_SEROUT;
/*
* These are arbitrary values, tested with some custom boot
@@ -1100,25 +1091,184 @@ void pokey_device::pokey_potgo(void)
for( pot = 0; pot < 8; pot++ )
{
m_POTx[pot] = 228;
- if( !m_pot_r[pot].isnull() )
+ switch (pot)
{
- int r = m_pot_r[pot](pot);
+ case 0:
+ if( !m_pot0_r_cb.isnull() )
+ {
+ int r = m_pot0_r_cb(pot);
- LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
- if (r >= 228)
- {
- r = 228;
- }
- if (r == 0)
- {
- /* immediately set the ready - bit of m_ALLPOT
- * In this case, most likely no capacitor is connected
- */
- m_ALLPOT |= (1<<pot);
- }
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
+
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
+ case 1:
+ if( !m_pot1_r_cb.isnull() )
+ {
+ int r = m_pot1_r_cb(pot);
+
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
+
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
+ case 2:
+ if( !m_pot2_r_cb.isnull() )
+ {
+ int r = m_pot2_r_cb(pot);
+
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
+
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
+ case 3:
+ if( !m_pot3_r_cb.isnull() )
+ {
+ int r = m_pot3_r_cb(pot);
+
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
+
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
+ case 4:
+ if( !m_pot4_r_cb.isnull() )
+ {
+ int r = m_pot4_r_cb(pot);
+
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
+
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
+ case 5:
+ if( !m_pot5_r_cb.isnull() )
+ {
+ int r = m_pot5_r_cb(pot);
+
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
+
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
+ case 6:
+ if( !m_pot6_r_cb.isnull() )
+ {
+ int r = m_pot6_r_cb(pot);
+
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
+
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
+ case 7:
+ if( !m_pot7_r_cb.isnull() )
+ {
+ int r = m_pot7_r_cb(pot);
+
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", tag(), pot, r));
+ if (r >= 228)
+ {
+ r = 228;
+ }
+ if (r == 0)
+ {
+ /* immediately set the ready - bit of m_ALLPOT
+ * In this case, most likely no capacitor is connected
+ */
+ m_ALLPOT |= (1<<pot);
+ }
- /* final value */
- m_POTx[pot] = r;
+ /* final value */
+ m_POTx[pot] = r;
+ }
+ break;
}
}
}
diff --git a/src/emu/sound/pokey.h b/src/emu/sound/pokey.h
index 0e30a8f1c90..35e2567459e 100644
--- a/src/emu/sound/pokey.h
+++ b/src/emu/sound/pokey.h
@@ -1,6 +1,6 @@
/*****************************************************************************
*
- * POKEY chip emulator 4.3
+ * POKEY chip emulator 4.6
* Copyright Nicola Salmoria and the MAME Team
*
* Based on original info found in Ron Fries' Pokey emulator,
@@ -66,14 +66,38 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_POKEY_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, POKEY, _clock)
+#define MCFG_POKEY_POT0_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot0_r_callback(*device, DEVCB2_##_devcb);
-#define MCFG_POKEY_REPLACE(_tag, _clock) \
- MCFG_DEVICE_REPLACE(_tag, POKEY, _clock)
+#define MCFG_POKEY_POT1_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot1_r_callback(*device, DEVCB2_##_devcb);
-#define MCFG_POKEY_CONFIG(_intf) \
- MCFG_DEVICE_CONFIG(_intf)
+#define MCFG_POKEY_POT2_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot2_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_POT3_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot3_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_POT4_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot4_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_POT5_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot5_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_POT6_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot6_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_POT7_R_CB(_devcb) \
+ devcb = &pokey_device::set_pot7_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_ALLPOT_R_CB(_devcb) \
+ devcb = &pokey_device::set_allpot_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_SERIN_R_CB(_devcb) \
+ devcb = &pokey_device::set_serin_r_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_POKEY_SEROUT_W_CB(_devcb) \
+ devcb = &pokey_device::set_serout_w_callback(*device, DEVCB2_##_devcb);
/* k543210 = k5 ... k0 returns bit0: kr1, bit1: kr2 */
/* all are, in contrast to actual hardware, ACTIVE_HIGH */
@@ -110,24 +134,12 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> pokey_interface
-
-struct pokey_interface
-{
- devcb_read8 m_pot_r_cb[8];
- devcb_read8 m_allpot_r_cb;
- devcb_read8 m_serin_r_cb;
- devcb_write8 m_serout_w_cb;
-};
-
-
// ======================> pokey_device
class pokey_device : public device_t,
public device_sound_interface,
public device_execute_interface,
- public device_state_interface,
- public pokey_interface
+ public device_state_interface
{
public:
@@ -197,6 +209,18 @@ public:
// construction/destruction
pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _Object> static devcb2_base &set_pot0_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot0_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_pot1_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot1_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_pot2_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot2_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_pot3_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot3_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_pot4_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot4_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_pot5_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot5_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_pot6_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot6_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_pot7_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_pot7_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_allpot_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_allpot_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_serin_r_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_serin_r_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_serout_w_callback(device_t &device, _Object object) { return downcast<pokey_device &>(device).m_serout_w_cb.set_callback(object); }
+
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -219,7 +243,6 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load();
@@ -311,10 +334,17 @@ private:
UINT32 m_p9; /* poly9 index */
UINT32 m_p17; /* poly17 index */
- devcb_resolved_read8 m_pot_r[8];
- devcb_resolved_read8 m_allpot_r;
- devcb_resolved_read8 m_serin_r;
- devcb_resolved_write8 m_serout_w;
+ devcb2_read8 m_pot0_r_cb;
+ devcb2_read8 m_pot1_r_cb;
+ devcb2_read8 m_pot2_r_cb;
+ devcb2_read8 m_pot3_r_cb;
+ devcb2_read8 m_pot4_r_cb;
+ devcb2_read8 m_pot5_r_cb;
+ devcb2_read8 m_pot6_r_cb;
+ devcb2_read8 m_pot7_r_cb;
+ devcb2_read8 m_allpot_r_cb;
+ devcb2_read8 m_serin_r_cb;
+ devcb2_write8 m_serout_w_cb;
UINT8 m_POTx[8]; /* POTx (R/D200-D207) */
UINT8 m_AUDCTL; /* AUDCTL (W/D208) */
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 8c6bb52f360..69180d61031 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -179,7 +179,7 @@ MACHINE_CONFIG_FRAGMENT( jsa_i_config )
MCFG_MIXER_ROUTE(0, DEVICE_SELF_OWNER, 0.60, 0)
MCFG_MIXER_ROUTE(1, DEVICE_SELF_OWNER, 0.60, 1)
- MCFG_POKEY_ADD("pokey", JSA_MASTER_CLOCK/2)
+ MCFG_SOUND_ADD("pokey", POKEY, JSA_MASTER_CLOCK/2)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.40, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.40, 1)
diff --git a/src/mame/audio/bwidow.c b/src/mame/audio/bwidow.c
index 28878a56041..60ea502f46d 100644
--- a/src/mame/audio/bwidow.c
+++ b/src/mame/audio/bwidow.c
@@ -10,27 +10,6 @@
/*************************************
*
- * Sound interfaces
- *
- *************************************/
-
-/* C/D3 */
-static const pokey_interface pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW0")
-};
-
-
-/* B3 */
-static const pokey_interface pokey_interface_2 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW1")
-};
-
-/*************************************
- *
* Discrete Sound Blocks
*
*************************************/
@@ -169,13 +148,13 @@ MACHINE_CONFIG_FRAGMENT( bwidow_audio )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK / 8)
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK / 8) /* C/D3 */
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW0"))
MCFG_POKEY_OUTPUT_OPAMP(BW_R51, BW_C31, 5.0)
MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 0)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK / 8)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK / 8) /* B3 */
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1"))
MCFG_POKEY_OUTPUT_OPAMP(BW_R47, BW_C32, 5.0)
MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 1)
diff --git a/src/mame/audio/bzone.c b/src/mame/audio/bzone.c
index 97c7e18bf23..fab0af357c7 100644
--- a/src/mame/audio/bzone.c
+++ b/src/mame/audio/bzone.c
@@ -383,12 +383,6 @@ static DISCRETE_SOUND_START(bzone)
DISCRETE_SOUND_END
-static const pokey_interface bzone_pokey_interface =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("IN3")
-};
-
WRITE8_MEMBER(bzone_state::bzone_sounds_w)
{
m_discrete->write(space, BZ_INPUT, data);
@@ -402,8 +396,8 @@ MACHINE_CONFIG_FRAGMENT( bzone_audio )
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey", BZONE_MASTER_CLOCK / 8)
- MCFG_POKEY_CONFIG(bzone_pokey_interface)
+ MCFG_SOUND_ADD("pokey", POKEY, BZONE_MASTER_CLOCK / 8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("IN3"))
MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0)
MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 0)
diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c
index 7aa71aa684f..12503ccd752 100644
--- a/src/mame/audio/jedi.c
+++ b/src/mame/audio/jedi.c
@@ -196,21 +196,21 @@ MACHINE_CONFIG_FRAGMENT( jedi_audio )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_POKEY_ADD("pokey1", JEDI_POKEY_CLOCK)
+ MCFG_SOUND_ADD("pokey1", POKEY, JEDI_POKEY_CLOCK)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
- MCFG_POKEY_ADD("pokey2", JEDI_POKEY_CLOCK)
+ MCFG_SOUND_ADD("pokey2", POKEY, JEDI_POKEY_CLOCK)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
- MCFG_POKEY_ADD("pokey3", JEDI_POKEY_CLOCK)
+ MCFG_SOUND_ADD("pokey3", POKEY, JEDI_POKEY_CLOCK)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
- MCFG_POKEY_ADD("pokey4", JEDI_POKEY_CLOCK)
+ MCFG_SOUND_ADD("pokey4", POKEY, JEDI_POKEY_CLOCK)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
diff --git a/src/mame/drivers/asteroid.c b/src/mame/drivers/asteroid.c
index e9b47e10a0f..af2760818fa 100644
--- a/src/mame/drivers/asteroid.c
+++ b/src/mame/drivers/asteroid.c
@@ -607,21 +607,6 @@ static INPUT_PORTS_START( llander1 )
INPUT_PORTS_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_config =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW2")
-};
-
-
-
/*************************************
*
* Machine drivers
@@ -675,8 +660,8 @@ static MACHINE_CONFIG_DERIVED( astdelux, asteroid )
MCFG_SOUND_CONFIG_DISCRETE(astdelux)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_POKEY_ADD("pokey", MASTER_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_SOUND_ADD("pokey", POKEY, MASTER_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2"))
MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index 19cdda0bf1b..e86a64be198 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -757,7 +757,7 @@ static MACHINE_CONFIG_START( atarisy1, atarisy1_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
- MCFG_POKEY_ADD("pokey", ATARI_CLOCK_14MHz/8)
+ MCFG_SOUND_ADD("pokey", POKEY, ATARI_CLOCK_14MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index b37e4b6a72e..9b42d5d8519 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -1190,27 +1190,6 @@ static GFXDECODE_START( atarisy2 )
GFXDECODE_END
-
-/*************************************
- *
- * Sound definitions
- *
- *************************************/
-
-static const pokey_interface pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW0")
-};
-
-static const pokey_interface pokey_interface_2 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW1")
-};
-
-
-
/*************************************
*
* Machine driver
@@ -1259,12 +1238,12 @@ static MACHINE_CONFIG_START( atarisy2, atarisy2_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
- MCFG_POKEY_ADD("pokey1", SOUND_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, SOUND_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW0"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.35)
- MCFG_POKEY_ADD("pokey2", SOUND_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, SOUND_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.35)
MCFG_SOUND_ADD("tms", TMS5220C, MASTER_CLOCK/4/4/2)
diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c
index ed8cc5159a7..6d51ace6ef9 100644
--- a/src/mame/drivers/atetris.c
+++ b/src/mame/drivers/atetris.c
@@ -296,26 +296,6 @@ static GFXDECODE_START( atetris )
GFXDECODE_END
-
-/*************************************
- *
- * Sound definitions
- *
- *************************************/
-
-static const pokey_interface pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("IN0")
-};
-
-
-static const pokey_interface pokey_interface_2 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("IN1")
-};
-
/*************************************
*
* Machine driver
@@ -347,12 +327,12 @@ static MACHINE_CONFIG_START( atetris, atetris_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("IN0"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("IN1"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/bartop52.c b/src/mame/drivers/bartop52.c
index 6fe376e051a..60ae4e97c54 100644
--- a/src/mame/drivers/bartop52.c
+++ b/src/mame/drivers/bartop52.c
@@ -100,23 +100,6 @@ static INPUT_PORTS_START(bartop52)
INPUT_PORTS_END
-static const pokey_interface atari_pokey_interface =
-{
- {
- DEVCB_INPUT_PORT("analog_0"),
- DEVCB_INPUT_PORT("analog_1"),
- DEVCB_INPUT_PORT("analog_2"),
- DEVCB_INPUT_PORT("analog_3"),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- },
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
-};
-
static MACHINE_CONFIG_START( a5200, bartop52_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, FREQ_17_EXACT)
@@ -138,8 +121,11 @@ static MACHINE_CONFIG_START( a5200, bartop52_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey", FREQ_17_EXACT)
- MCFG_POKEY_CONFIG(atari_pokey_interface)
+ MCFG_SOUND_ADD("pokey", POKEY, FREQ_17_EXACT)
+ MCFG_POKEY_POT0_R_CB(IOPORT("analog_0"))
+ MCFG_POKEY_POT1_R_CB(IOPORT("analog_1"))
+ MCFG_POKEY_POT2_R_CB(IOPORT("analog_2"))
+ MCFG_POKEY_POT3_R_CB(IOPORT("analog_3"))
MCFG_POKEY_KEYBOARD_HANDLER(atari_a5200_keypads)
MCFG_POKEY_INTERRUPT_HANDLER(atari_interrupt_cb)
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index 2e5c8923b4c..ee43a90f094 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -523,22 +523,6 @@ static INPUT_PORTS_START( bradley )
INPUT_PORTS_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-
-static const pokey_interface redbaron_pokey_interface =
-{
- { DEVCB_NULL },
- DEVCB_DRIVER_MEMBER(bzone_state,redbaron_joy_r)
-};
-
-
-
/*************************************
*
* Machine driver
@@ -596,8 +580,8 @@ static MACHINE_CONFIG_DERIVED( redbaron, bzone_base )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey", 1500000)
- MCFG_POKEY_CONFIG(redbaron_pokey_interface)
+ MCFG_SOUND_ADD("pokey", POKEY, 1500000)
+ MCFG_POKEY_ALLPOT_R_CB(READ8(bzone_state, redbaron_joy_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("custom", REDBARON, 0)
diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c
index 538556a95ee..79484cafba5 100644
--- a/src/mame/drivers/ccastles.c
+++ b/src/mame/drivers/ccastles.c
@@ -442,21 +442,6 @@ static GFXDECODE_START( ccastles )
GFXDECODE_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_config =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("IN1")
-};
-
-
-
/*************************************
*
* Machine driver
@@ -486,15 +471,15 @@ static MACHINE_CONFIG_START( ccastles, ccastles_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK/8)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/8)
/* NOTE: 1k + 0.2k is not 100% exact, but should not make an audible difference */
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1) + RES_K(0.2), CAP_U(0.01), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK/8)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/8)
/* NOTE: 1k + 0.2k is not 100% exact, but should not make an audible difference */
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1) + RES_K(0.2), CAP_U(0.01), 5.0)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("IN1"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 782cec77460..2b2679aea02 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -1685,38 +1685,6 @@ static GFXDECODE_START( warlords )
GFXDECODE_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface milliped_pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW1")
-};
-
-
-static const pokey_interface milliped_pokey_interface_2 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW2")
-};
-
-
-static const pokey_interface warlords_pokey_interface =
-{
- {
- DEVCB_INPUT_PORT("PADDLE0"),
- DEVCB_INPUT_PORT("PADDLE1"),
- DEVCB_INPUT_PORT("PADDLE2"),
- DEVCB_INPUT_PORT("PADDLE3")
- }
-};
-
-
/*************************************
*
* Machine drivers
@@ -1758,7 +1726,7 @@ static MACHINE_CONFIG_DERIVED( centiped, centiped_base )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey", 12096000/8)
+ MCFG_DEVICE_ADD("pokey", POKEY, 12096000/8)
MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(3.3), CAP_U(0.01), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
@@ -1826,12 +1794,12 @@ static MACHINE_CONFIG_DERIVED( milliped, centiped )
MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_milliped)
/* sound hardware */
- MCFG_POKEY_REPLACE("pokey", 12096000/8)
- MCFG_POKEY_CONFIG(milliped_pokey_interface_1)
+ MCFG_SOUND_REPLACE("pokey", POKEY, 12096000/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_ADD("pokey2", 12096000/8)
- MCFG_POKEY_CONFIG(milliped_pokey_interface_2)
+ MCFG_DEVICE_ADD("pokey2", POKEY, 12096000/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -1864,8 +1832,11 @@ static MACHINE_CONFIG_DERIVED( warlords, centiped )
MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_warlords)
/* sound hardware */
- MCFG_POKEY_REPLACE("pokey", 12096000/8)
- MCFG_POKEY_CONFIG(warlords_pokey_interface)
+ MCFG_SOUND_REPLACE("pokey", POKEY, 12096000/8)
+ MCFG_POKEY_POT0_R_CB(IOPORT("PADDLE0"))
+ MCFG_POKEY_POT1_R_CB(IOPORT("PADDLE1"))
+ MCFG_POKEY_POT2_R_CB(IOPORT("PADDLE2"))
+ MCFG_POKEY_POT3_R_CB(IOPORT("PADDLE3"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cloak.c b/src/mame/drivers/cloak.c
index 6f5b251eeea..0c8d0fbcb0e 100644
--- a/src/mame/drivers/cloak.c
+++ b/src/mame/drivers/cloak.c
@@ -301,27 +301,6 @@ static GFXDECODE_START( cloak )
GFXDECODE_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("START"),
-};
-
-static const pokey_interface pokey_interface_2 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW"),
-};
-
-
-
/*************************************
*
* Machine driver
@@ -360,13 +339,13 @@ static MACHINE_CONFIG_START( cloak, cloak_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
/* more low pass filters ==> DISCRETE processing */
- MCFG_POKEY_ADD("pokey1", XTAL_10MHz/8) /* Accurate to recording */
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, XTAL_10MHz/8) /* Accurate to recording */
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("START"))
MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(1), CAP_U(0.047), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_ADD("pokey2", XTAL_10MHz/8) /* Accurate to recording */
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, XTAL_10MHz/8) /* Accurate to recording */
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW"))
MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(1), CAP_U(0.022), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c
index 4b9b98c83fc..7d7e832a6c6 100644
--- a/src/mame/drivers/cloud9.c
+++ b/src/mame/drivers/cloud9.c
@@ -393,21 +393,6 @@ static GFXDECODE_START( cloud9 )
GFXDECODE_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_config =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW"),
-};
-
-
-
/*************************************
*
* Machine driver
@@ -439,11 +424,11 @@ static MACHINE_CONFIG_START( cloud9, cloud9_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK/8)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index 9be1151eeb9..0880a380334 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -738,19 +738,19 @@ static MACHINE_CONFIG_START( firefox, firefox_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_POKEY_ADD("pokey1", MASTER_XTAL/8)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_XTAL/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
- MCFG_POKEY_ADD("pokey2", MASTER_XTAL/8)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_XTAL/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
- MCFG_POKEY_ADD("pokey3", MASTER_XTAL/8)
+ MCFG_SOUND_ADD("pokey3", POKEY, MASTER_XTAL/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
- MCFG_POKEY_ADD("pokey4", MASTER_XTAL/8)
+ MCFG_SOUND_ADD("pokey4", POKEY, MASTER_XTAL/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index 85712f78cdb..3fca1504639 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -327,22 +327,6 @@ READ8_MEMBER(foodf_state::pot_r)
return (ioport("DSW")->read() >> offset) << 7;
}
-static const pokey_interface pokey_config =
-{
- {
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r),
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r),
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r),
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r),
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r),
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r),
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r),
- DEVCB_DRIVER_MEMBER(foodf_state,pot_r)
- }
-};
-
-
-
/*************************************
*
* Machine driver
@@ -381,14 +365,21 @@ static MACHINE_CONFIG_START( foodf, foodf_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK/2/10)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/2/10)
+ MCFG_POKEY_POT0_R_CB(READ8(foodf_state, pot_r))
+ MCFG_POKEY_POT1_R_CB(READ8(foodf_state, pot_r))
+ MCFG_POKEY_POT2_R_CB(READ8(foodf_state, pot_r))
+ MCFG_POKEY_POT3_R_CB(READ8(foodf_state, pot_r))
+ MCFG_POKEY_POT4_R_CB(READ8(foodf_state, pot_r))
+ MCFG_POKEY_POT5_R_CB(READ8(foodf_state, pot_r))
+ MCFG_POKEY_POT6_R_CB(READ8(foodf_state, pot_r))
+ MCFG_POKEY_POT7_R_CB(READ8(foodf_state, pot_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK/2/10)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/2/10)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
- MCFG_POKEY_ADD("pokey3", MASTER_CLOCK/2/10)
+ MCFG_SOUND_ADD("pokey3", POKEY, MASTER_CLOCK/2/10)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index 3a6b8cc0a63..b80b0dd5cd0 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -536,7 +536,7 @@ static MACHINE_CONFIG_START( gauntlet, gauntlet_state )
MCFG_SOUND_ROUTE(1, "lspeaker", 0.48)
MCFG_SOUND_ROUTE(0, "rspeaker", 0.48)
- MCFG_POKEY_ADD("pokey", ATARI_CLOCK_14MHz/8)
+ MCFG_SOUND_ADD("pokey", POKEY, ATARI_CLOCK_14MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.32)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.32)
diff --git a/src/mame/drivers/irobot.c b/src/mame/drivers/irobot.c
index 7f9732a1403..66cc058132d 100644
--- a/src/mame/drivers/irobot.c
+++ b/src/mame/drivers/irobot.c
@@ -289,21 +289,6 @@ static GFXDECODE_START( irobot )
GFXDECODE_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_config =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW2")
-};
-
-
-
/*************************************
*
* Machine driver
@@ -340,17 +325,17 @@ static MACHINE_CONFIG_START( irobot, irobot_state )
/* FIXME: I-Robot has all channels of the quad-pokey tied together
* This needs to be taken into account in the design.
*/
- MCFG_POKEY_ADD("pokey1", MAIN_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_SOUND_ADD("pokey1", POKEY, MAIN_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_POKEY_ADD("pokey2", MAIN_CLOCK/8)
+ MCFG_SOUND_ADD("pokey2", POKEY, MAIN_CLOCK/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_POKEY_ADD("pokey3", MAIN_CLOCK/8)
+ MCFG_SOUND_ADD("pokey3", POKEY, MAIN_CLOCK/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_POKEY_ADD("pokey4", MAIN_CLOCK/8)
+ MCFG_SOUND_ADD("pokey4", POKEY, MAIN_CLOCK/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/liberatr.c b/src/mame/drivers/liberatr.c
index b2c655d100e..e106e8637c0 100644
--- a/src/mame/drivers/liberatr.c
+++ b/src/mame/drivers/liberatr.c
@@ -356,28 +356,6 @@ static INPUT_PORTS_START( liberatr )
INPUT_PORTS_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW2")
-};
-
-
-static const pokey_interface pokey_interface_2 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW1")
-};
-
-
-
/*************************************
*
* Machine driver
@@ -404,14 +382,14 @@ static MACHINE_CONFIG_START( liberatr, liberatr_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK/16) /* 1.25Mhz from Phi2 signal from 6502 */
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/16) /* 1.25Mhz from Phi2 signal from 6502 */
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2"))
MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(4.7), CAP_U(0.01), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK/16) /* 1.25Mhz from Phi2 signal from 6502 */
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/16) /* 1.25Mhz from Phi2 signal from 6502 */
MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(4.7), CAP_U(0.01), 5.0)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index 9897e9c7fe5..8695bc099c5 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -374,12 +374,6 @@ static INPUT_PORTS_START( a600xl )
INPUT_PORTS_END
-static const pokey_interface pokey_config = {
- { DEVCB_NULL },
- DEVCB_NULL,
- DEVCB_NULL,DEVCB_NULL,
-};
-
READ8_MEMBER(maxaflex_state::maxaflex_atari_pia_pa_r)
{
return atari_input_disabled() ? 0xFF : ioport("djoy_0_1")->read_safe(0);
@@ -429,8 +423,7 @@ static MACHINE_CONFIG_START( a600xl, maxaflex_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey", FREQ_17_EXACT)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_SOUND_ADD("pokey", POKEY, FREQ_17_EXACT)
MCFG_POKEY_INTERRUPT_HANDLER(atari_interrupt_cb)
MCFG_POKEY_OUTPUT_RC(RES_K(1), CAP_U(0.0), 5.0)
diff --git a/src/mame/drivers/mhavoc.c b/src/mame/drivers/mhavoc.c
index 67b11989b13..b8361b55c0a 100644
--- a/src/mame/drivers/mhavoc.c
+++ b/src/mame/drivers/mhavoc.c
@@ -476,20 +476,6 @@ static INPUT_PORTS_START( alphaone )
INPUT_PORTS_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_config =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW1")
-};
-
-
/*************************************
*
* Machine drivers
@@ -529,20 +515,20 @@ static MACHINE_CONFIG_START( mhavoc, mhavoc_state )
* ==> DISCRETE emulation, below is just an approximation.
*/
- MCFG_POKEY_ADD("pokey1", MHAVOC_CLOCK_1_25M)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_SOUND_ADD("pokey1", POKEY, MHAVOC_CLOCK_1_25M)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1"))
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_POKEY_ADD("pokey2", MHAVOC_CLOCK_1_25M)
+ MCFG_SOUND_ADD("pokey2", POKEY, MHAVOC_CLOCK_1_25M)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_POKEY_ADD("pokey3", MHAVOC_CLOCK_1_25M)
+ MCFG_SOUND_ADD("pokey3", POKEY, MHAVOC_CLOCK_1_25M)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_POKEY_ADD("pokey4", MHAVOC_CLOCK_1_25M)
+ MCFG_SOUND_ADD("pokey4", POKEY, MHAVOC_CLOCK_1_25M)
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
@@ -566,10 +552,10 @@ static MACHINE_CONFIG_DERIVED( alphaone, mhavoc )
MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 500)
/* sound hardware */
- MCFG_POKEY_REPLACE("pokey1", MHAVOC_CLOCK_1_25M)
+ MCFG_SOUND_REPLACE("pokey1", POKEY, MHAVOC_CLOCK_1_25M)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_REPLACE("pokey2", MHAVOC_CLOCK_1_25M)
+ MCFG_SOUND_REPLACE("pokey2", POKEY, MHAVOC_CLOCK_1_25M)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_DEVICE_REMOVE("pokey3")
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index f3f0f771ca6..9184bcfb5e7 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -1004,21 +1004,6 @@ static INPUT_PORTS_START( suprmatk )
INPUT_PORTS_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_config =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("R8")
-};
-
-
-
/*************************************
*
* Machine driver
@@ -1044,8 +1029,8 @@ static MACHINE_CONFIG_START( missile, missile_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey", MASTER_CLOCK/8)
- MCFG_POKEY_CONFIG(pokey_config)
+ MCFG_SOUND_ADD("pokey", POKEY, MASTER_CLOCK/8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("R8"))
MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.1), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/quantum.c b/src/mame/drivers/quantum.c
index 1c58a98793b..60e16f4482c 100644
--- a/src/mame/drivers/quantum.c
+++ b/src/mame/drivers/quantum.c
@@ -202,41 +202,6 @@ static INPUT_PORTS_START( quantum )
INPUT_PORTS_END
-
-/*************************************
- *
- * Sound definitions
- *
- *************************************/
-
-static const pokey_interface pokey_interface_1 =
-{
- {
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_1_r)
- }
-};
-
-static const pokey_interface pokey_interface_2 =
-{
- {
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r),
- DEVCB_DRIVER_MEMBER(quantum_state,input_2_r)
- }
-};
-
/*************************************
*
* Discrete Sound Blocks
@@ -314,13 +279,27 @@ static MACHINE_CONFIG_START( quantum, quantum_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", 600000)
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, 600000)
+ MCFG_POKEY_POT0_R_CB(READ8(quantum_state, input_1_r))
+ MCFG_POKEY_POT1_R_CB(READ8(quantum_state, input_1_r))
+ MCFG_POKEY_POT2_R_CB(READ8(quantum_state, input_1_r))
+ MCFG_POKEY_POT3_R_CB(READ8(quantum_state, input_1_r))
+ MCFG_POKEY_POT4_R_CB(READ8(quantum_state, input_1_r))
+ MCFG_POKEY_POT5_R_CB(READ8(quantum_state, input_1_r))
+ MCFG_POKEY_POT6_R_CB(READ8(quantum_state, input_1_r))
+ MCFG_POKEY_POT7_R_CB(READ8(quantum_state, input_1_r))
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0)
MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 0)
- MCFG_POKEY_ADD("pokey2", 600000)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, 600000)
+ MCFG_POKEY_POT0_R_CB(READ8(quantum_state, input_2_r))
+ MCFG_POKEY_POT1_R_CB(READ8(quantum_state, input_2_r))
+ MCFG_POKEY_POT2_R_CB(READ8(quantum_state, input_2_r))
+ MCFG_POKEY_POT3_R_CB(READ8(quantum_state, input_2_r))
+ MCFG_POKEY_POT4_R_CB(READ8(quantum_state, input_2_r))
+ MCFG_POKEY_POT5_R_CB(READ8(quantum_state, input_2_r))
+ MCFG_POKEY_POT6_R_CB(READ8(quantum_state, input_2_r))
+ MCFG_POKEY_POT7_R_CB(READ8(quantum_state, input_2_r))
MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0)
MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 1)
diff --git a/src/mame/drivers/runaway.c b/src/mame/drivers/runaway.c
index c3ff0d002e9..419577f7a47 100644
--- a/src/mame/drivers/runaway.c
+++ b/src/mame/drivers/runaway.c
@@ -323,27 +323,6 @@ static GFXDECODE_START( qwak )
GFXDECODE_END
-static const pokey_interface pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("6008")
-};
-
-static const pokey_interface pokey_interface_2 =
-{
- {
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r),
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r),
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r),
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r),
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r),
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r),
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r),
- DEVCB_DRIVER_MEMBER(runaway_state,runaway_pot_r)
- }
-};
-
-
static MACHINE_CONFIG_START( runaway, runaway_state )
/* basic machine hardware */
@@ -368,12 +347,19 @@ static MACHINE_CONFIG_START( runaway, runaway_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", 12096000 / 8)
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, 12096000 / 8)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("6008"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_ADD("pokey2", 12096000 / 8)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, 12096000 / 8)
+ MCFG_POKEY_POT0_R_CB(READ8(runaway_state, runaway_pot_r))
+ MCFG_POKEY_POT1_R_CB(READ8(runaway_state, runaway_pot_r))
+ MCFG_POKEY_POT2_R_CB(READ8(runaway_state, runaway_pot_r))
+ MCFG_POKEY_POT3_R_CB(READ8(runaway_state, runaway_pot_r))
+ MCFG_POKEY_POT4_R_CB(READ8(runaway_state, runaway_pot_r))
+ MCFG_POKEY_POT5_R_CB(READ8(runaway_state, runaway_pot_r))
+ MCFG_POKEY_POT6_R_CB(READ8(runaway_state, runaway_pot_r))
+ MCFG_POKEY_POT7_R_CB(READ8(runaway_state, runaway_pot_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index e689cb1c5f4..9784ec386cd 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -357,16 +357,16 @@ static MACHINE_CONFIG_START( starwars, starwars_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK / 8)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK / 8)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
- MCFG_POKEY_ADD("pokey3", MASTER_CLOCK / 8)
+ MCFG_SOUND_ADD("pokey3", POKEY, MASTER_CLOCK / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
- MCFG_POKEY_ADD("pokey4", MASTER_CLOCK / 8)
+ MCFG_SOUND_ADD("pokey4", POKEY, MASTER_CLOCK / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
MCFG_SOUND_ADD("tms", TMS5220, MASTER_CLOCK/2/9)
diff --git a/src/mame/drivers/tempest.c b/src/mame/drivers/tempest.c
index b3a14023db2..0be7784c7fc 100644
--- a/src/mame/drivers/tempest.c
+++ b/src/mame/drivers/tempest.c
@@ -577,43 +577,6 @@ static INPUT_PORTS_START( tempest )
INPUT_PORTS_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_interface_1 =
-{
- {
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_1_bit_r)
- }
-};
-
-static const pokey_interface pokey_interface_2 =
-{
- {
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r),
- DEVCB_DRIVER_MEMBER(tempest_state,input_port_2_bit_r)
- }
-};
-
-
-
/*************************************
*
* Machine drivers
@@ -648,14 +611,28 @@ static MACHINE_CONFIG_START( tempest, tempest_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", MASTER_CLOCK / 8)
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK / 8)
+ MCFG_POKEY_POT0_R_CB(READ8(tempest_state, input_port_1_bit_r))
+ MCFG_POKEY_POT1_R_CB(READ8(tempest_state, input_port_1_bit_r))
+ MCFG_POKEY_POT2_R_CB(READ8(tempest_state, input_port_1_bit_r))
+ MCFG_POKEY_POT3_R_CB(READ8(tempest_state, input_port_1_bit_r))
+ MCFG_POKEY_POT4_R_CB(READ8(tempest_state, input_port_1_bit_r))
+ MCFG_POKEY_POT5_R_CB(READ8(tempest_state, input_port_1_bit_r))
+ MCFG_POKEY_POT6_R_CB(READ8(tempest_state, input_port_1_bit_r))
+ MCFG_POKEY_POT7_R_CB(READ8(tempest_state, input_port_1_bit_r))
MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
- MCFG_POKEY_ADD("pokey2", MASTER_CLOCK / 8)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK / 8)
+ MCFG_POKEY_POT0_R_CB(READ8(tempest_state, input_port_2_bit_r))
+ MCFG_POKEY_POT1_R_CB(READ8(tempest_state, input_port_2_bit_r))
+ MCFG_POKEY_POT2_R_CB(READ8(tempest_state, input_port_2_bit_r))
+ MCFG_POKEY_POT3_R_CB(READ8(tempest_state, input_port_2_bit_r))
+ MCFG_POKEY_POT4_R_CB(READ8(tempest_state, input_port_2_bit_r))
+ MCFG_POKEY_POT5_R_CB(READ8(tempest_state, input_port_2_bit_r))
+ MCFG_POKEY_POT6_R_CB(READ8(tempest_state, input_port_2_bit_r))
+ MCFG_POKEY_POT7_R_CB(READ8(tempest_state, input_port_2_bit_r))
MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
diff --git a/src/mame/drivers/tomcat.c b/src/mame/drivers/tomcat.c
index 2f5576ffa65..8dbbdfc3cf7 100644
--- a/src/mame/drivers/tomcat.c
+++ b/src/mame/drivers/tomcat.c
@@ -428,10 +428,10 @@ static MACHINE_CONFIG_START( tomcat, tomcat_state )
MCFG_AVGDVG_VECTOR("vector")
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_POKEY_ADD("pokey1", XTAL_14_31818MHz / 8)
+ MCFG_SOUND_ADD("pokey1", POKEY, XTAL_14_31818MHz / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.20)
- MCFG_POKEY_ADD("pokey2", XTAL_14_31818MHz / 8)
+ MCFG_SOUND_ADD("pokey2", POKEY, XTAL_14_31818MHz / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.20)
MCFG_SOUND_ADD("tms", TMS5220, 325000)
diff --git a/src/mame/drivers/tunhunt.c b/src/mame/drivers/tunhunt.c
index 43086ebfa3f..31512cab0b3 100644
--- a/src/mame/drivers/tunhunt.c
+++ b/src/mame/drivers/tunhunt.c
@@ -258,34 +258,6 @@ static GFXDECODE_START( tunhunt )
GFXDECODE_END
-
-/*************************************
- *
- * Sound interfaces
- *
- *************************************/
-
-static const pokey_interface pokey_interface_1 =
-{
- { DEVCB_NULL },
- DEVCB_INPUT_PORT("DSW")
-};
-
-static const pokey_interface pokey_interface_2 =
-{
- {
- DEVCB_INPUT_PORT("IN1"),
- DEVCB_INPUT_PORT("IN2"),
- DEVCB_DRIVER_MEMBER(tunhunt_state,dsw2_0r),
- DEVCB_DRIVER_MEMBER(tunhunt_state,dsw2_1r),
- DEVCB_DRIVER_MEMBER(tunhunt_state,dsw2_2r),
- DEVCB_DRIVER_MEMBER(tunhunt_state,dsw2_3r),
- DEVCB_DRIVER_MEMBER(tunhunt_state,dsw2_4r)
- }
-};
-
-
-
/*************************************
*
* Machine driver
@@ -316,13 +288,19 @@ static MACHINE_CONFIG_START( tunhunt, tunhunt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey1", XTAL_12_096MHz/10)
- MCFG_POKEY_CONFIG(pokey_interface_1)
+ MCFG_SOUND_ADD("pokey1", POKEY, XTAL_12_096MHz/10)
+ MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW"))
MCFG_POKEY_OUTPUT_RC(RES_K(1), CAP_U(0.047), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_POKEY_ADD("pokey2", XTAL_12_096MHz/10)
- MCFG_POKEY_CONFIG(pokey_interface_2)
+ MCFG_SOUND_ADD("pokey2", POKEY, XTAL_12_096MHz/10)
+ MCFG_POKEY_POT0_R_CB(IOPORT("IN1"))
+ MCFG_POKEY_POT1_R_CB(IOPORT("IN2"))
+ MCFG_POKEY_POT2_R_CB(READ8(tunhunt_state, dsw2_0r))
+ MCFG_POKEY_POT3_R_CB(READ8(tunhunt_state, dsw2_1r))
+ MCFG_POKEY_POT4_R_CB(READ8(tunhunt_state, dsw2_2r))
+ MCFG_POKEY_POT5_R_CB(READ8(tunhunt_state, dsw2_3r))
+ MCFG_POKEY_POT6_R_CB(READ8(tunhunt_state, dsw2_4r))
MCFG_POKEY_OUTPUT_RC(RES_K(1), CAP_U(0.047), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c
index 71ea30ffc4c..33c6fc3da3b 100644
--- a/src/mess/drivers/a7800.c
+++ b/src/mess/drivers/a7800.c
@@ -1154,7 +1154,7 @@ static MACHINE_CONFIG_START( a7800_ntsc, a7800_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_TIA_ADD("tia", 31400)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
- MCFG_POKEY_ADD("pokey", A7800_NTSC_Y1/8)
+ MCFG_SOUND_ADD("pokey", POKEY, A7800_NTSC_Y1/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* devices */
@@ -1184,14 +1184,14 @@ static MACHINE_CONFIG_DERIVED( a7800_pal, a7800_ntsc )
// MCFG_TIMER_ADD_SCANLINE("scantimer", a7800_interrupt, "screen", 0, 1)
MCFG_SCREEN_MODIFY( "screen" )
- MCFG_SCREEN_RAW_PARAMS( 7093788, 454, 0, 320, 313, 35, 35 + 228 + 32 )
+ MCFG_SCREEN_RAW_PARAMS( 7093788, 454, 0, 320, 313, 35, 35 + 228 + 32 )
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_INIT_OWNER(a7800_state, a7800p )
/* sound hardware */
- MCFG_DEVICE_REMOVE("pokey")
- MCFG_POKEY_ADD("pokey", CLK_PAL)
+ MCFG_SOUND_MODIFY("pokey")
+ MCFG_SOUND_CLOCK(CLK_PAL)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* devices */
diff --git a/src/mess/drivers/atari400.c b/src/mess/drivers/atari400.c
index 6b84442e43d..18ed201129a 100644
--- a/src/mess/drivers/atari400.c
+++ b/src/mess/drivers/atari400.c
@@ -2391,24 +2391,6 @@ WRITE8_MEMBER(a400_state::xegs_pia_pb_w)
xegs_mmu(data);
}
-static const pokey_interface atari_pokey_interface =
-{
- {
- DEVCB_INPUT_PORT("analog_0"),
- DEVCB_INPUT_PORT("analog_1"),
- DEVCB_INPUT_PORT("analog_2"),
- DEVCB_INPUT_PORT("analog_3"),
- DEVCB_INPUT_PORT("analog_4"),
- DEVCB_INPUT_PORT("analog_5"),
- DEVCB_INPUT_PORT("analog_6"),
- DEVCB_INPUT_PORT("analog_7")
- },
- DEVCB_NULL,
- DEVCB_DEVICE_MEMBER("fdc", atari_fdc_device, serin_r),
- DEVCB_DEVICE_MEMBER("fdc", atari_fdc_device, serout_w)
-};
-
-
/**************************************************************
*
* PIA interface
@@ -2425,24 +2407,6 @@ READ8_MEMBER(a400_state::atari_pia_pb_r)
return ioport("djoy_2_3")->read_safe(0);
}
-// FIXME: should there be anything connected where other system have the fdc?
-static const pokey_interface a5200_pokey_interface =
-{
- {
- DEVCB_INPUT_PORT("analog_0"),
- DEVCB_INPUT_PORT("analog_1"),
- DEVCB_INPUT_PORT("analog_2"),
- DEVCB_INPUT_PORT("analog_3"),
- DEVCB_INPUT_PORT("analog_4"),
- DEVCB_INPUT_PORT("analog_5"),
- DEVCB_INPUT_PORT("analog_6"),
- DEVCB_INPUT_PORT("analog_7")
- },
- DEVCB_NULL,
- DEVCB_NULL, // FIXME: is there anything connected here?
- DEVCB_NULL // FIXME: is there anything connected here?
-};
-
/**************************************************************
*
* Machine drivers
@@ -2495,8 +2459,17 @@ static MACHINE_CONFIG_START( atari_common_nodac, a400_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_POKEY_ADD("pokey", FREQ_17_EXACT)
- MCFG_POKEY_CONFIG(atari_pokey_interface)
+ MCFG_SOUND_ADD("pokey", POKEY, FREQ_17_EXACT)
+ MCFG_POKEY_POT0_R_CB(IOPORT("analog_0"))
+ MCFG_POKEY_POT1_R_CB(IOPORT("analog_1"))
+ MCFG_POKEY_POT2_R_CB(IOPORT("analog_2"))
+ MCFG_POKEY_POT3_R_CB(IOPORT("analog_3"))
+ MCFG_POKEY_POT4_R_CB(IOPORT("analog_4"))
+ MCFG_POKEY_POT5_R_CB(IOPORT("analog_5"))
+ MCFG_POKEY_POT6_R_CB(IOPORT("analog_6"))
+ MCFG_POKEY_POT7_R_CB(IOPORT("analog_7"))
+ MCFG_POKEY_SERIN_R_CB(DEVREAD8("fdc", atari_fdc_device, serin_r))
+ MCFG_POKEY_SEROUT_W_CB(DEVWRITE8("fdc", atari_fdc_device, serout_w))
MCFG_POKEY_KEYBOARD_HANDLER(atari_a800_keyboard)
MCFG_POKEY_INTERRUPT_HANDLER(atari_interrupt_cb)
@@ -2691,9 +2664,10 @@ static MACHINE_CONFIG_DERIVED( a5200, atari_common_nodac )
MCFG_CPU_PROGRAM_MAP(a5200_mem)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", atari_common_state, a5200_interrupt, "screen", 0, 1)
- MCFG_DEVICE_REMOVE("pokey")
- MCFG_POKEY_ADD("pokey", FREQ_17_EXACT)
- MCFG_POKEY_CONFIG(a5200_pokey_interface)
+ // FIXME: should there be anything connected where other system have the fdc?
+ MCFG_SOUND_MODIFY("pokey")
+ MCFG_POKEY_SERIN_R_CB(NULL)
+ MCFG_POKEY_SEROUT_W_CB(NULL)
MCFG_POKEY_KEYBOARD_HANDLER(atari_a5200_keypads)
MCFG_POKEY_INTERRUPT_HANDLER(atari_interrupt_cb)