summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-08-10 00:49:07 +0200
committer mooglyguy <therealmogminer@gmail.com>2018-08-10 00:49:19 +0200
commit47a730bc5056e55e428146508dcafc65f85af1b4 (patch)
treeac070da9af8ada5e7db8815c9c9f3dca0669dd6f
parenta4a0bcc3b4f12712fdc7aa8e731a6cfa2b74596a (diff)
-6525tpi, 6532riot: Removed MCFG and old devcb accessors, nw
-rw-r--r--src/devices/bus/c64/exp.cpp10
-rw-r--r--src/devices/bus/c64/exp.h18
-rw-r--r--src/devices/bus/c64/ieee488.cpp28
-rw-r--r--src/devices/bus/c64/magic_voice.cpp44
-rw-r--r--src/devices/cpu/arm7/arm7.cpp10
-rw-r--r--src/devices/cpu/arm7/arm7.h7
-rw-r--r--src/devices/machine/40105.h3
-rw-r--r--src/devices/machine/6525tpi.h39
-rw-r--r--src/devices/machine/6532riot.h25
-rw-r--r--src/devices/sound/t6721a.h4
-rw-r--r--src/mame/audio/exidy.cpp24
-rw-r--r--src/mame/drivers/a2600.cpp24
-rw-r--r--src/mame/drivers/amiga.cpp6
-rw-r--r--src/mame/drivers/cbm2.cpp109
-rw-r--r--src/mame/drivers/firefox.cpp12
-rw-r--r--src/mame/drivers/gts80.cpp38
-rw-r--r--src/mame/drivers/gts80a.cpp38
-rw-r--r--src/mame/drivers/gts80b.cpp38
-rw-r--r--src/mame/drivers/spectra.cpp12
-rw-r--r--src/mame/drivers/starwars.cpp12
-rw-r--r--src/mame/drivers/tourtabl.cpp18
-rw-r--r--src/mame/drivers/tvboy.cpp12
22 files changed, 269 insertions, 262 deletions
diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp
index 7b11051da9b..521bc3e041f 100644
--- a/src/devices/bus/c64/exp.cpp
+++ b/src/devices/bus/c64/exp.cpp
@@ -295,6 +295,16 @@ int c64_expansion_slot_device::exrom_r(offs_t offset, int sphi2, int ba, int rw,
}
+void c64_expansion_slot_device::set_passthrough()
+{
+ irq_wr_callback().set(DEVICE_SELF_OWNER, FUNC(c64_expansion_slot_device::irq_w));
+ nmi_wr_callback().set(DEVICE_SELF_OWNER, FUNC(c64_expansion_slot_device::nmi_w));
+ reset_wr_callback().set(DEVICE_SELF_OWNER, FUNC(c64_expansion_slot_device::reset_w));
+ cd_rd_callback().set(DEVICE_SELF_OWNER, FUNC(c64_expansion_slot_device::dma_cd_r));
+ cd_wr_callback().set(DEVICE_SELF_OWNER, FUNC(c64_expansion_slot_device::dma_cd_w));
+ dma_wr_callback().set(DEVICE_SELF_OWNER, FUNC(c64_expansion_slot_device::dma_w));
+}
+
//-------------------------------------------------
// SLOT_INTERFACE( c64_expansion_cards )
//-------------------------------------------------
diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h
index ff3c8eadbab..403625bf220 100644
--- a/src/devices/bus/c64/exp.h
+++ b/src/devices/bus/c64/exp.h
@@ -101,6 +101,16 @@ class c64_expansion_slot_device : public device_t,
{
public:
// construction/destruction
+ template <typename T>
+ c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
+ : c64_expansion_slot_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
@@ -109,6 +119,12 @@ public:
template <class Object> devcb_base &set_cd_rd_callback(Object &&cb) { return m_read_dma_cd.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_cd_wr_callback(Object &&cb) { return m_write_dma_cd.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_dma_wr_callback(Object &&cb) { return m_write_dma.set_callback(std::forward<Object>(cb)); }
+ auto irq_wr_callback() { return m_write_irq.bind(); }
+ auto nmi_wr_callback() { return m_write_nmi.bind(); }
+ auto reset_wr_callback() { return m_write_reset.bind(); }
+ auto cd_rd_callback() { return m_read_dma_cd.bind(); }
+ auto cd_wr_callback() { return m_write_dma_cd.bind(); }
+ auto dma_wr_callback() { return m_write_dma.bind(); }
// computer interface
uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2);
@@ -127,6 +143,8 @@ public:
int dotclock() { return phi2() * 8; }
int hiram() { return m_hiram; }
+ void set_passthrough();
+
protected:
// device-level overrides
virtual void device_validity_check(validity_checker &valid) const override;
diff --git a/src/devices/bus/c64/ieee488.cpp b/src/devices/bus/c64/ieee488.cpp
index ef33798bdfc..ee07023f2cc 100644
--- a/src/devices/bus/c64/ieee488.cpp
+++ b/src/devices/bus/c64/ieee488.cpp
@@ -141,18 +141,22 @@ WRITE8_MEMBER( c64_ieee488_device::tpi_pc_w )
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(c64_ieee488_device::device_add_mconfig)
- MCFG_DEVICE_ADD(MOS6525_TAG, TPI6525, 0)
- MCFG_TPI6525_IN_PA_CB(READ8(*this, c64_ieee488_device, tpi_pa_r))
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, c64_ieee488_device, tpi_pa_w))
- MCFG_TPI6525_IN_PB_CB(READ8(IEEE488_TAG, ieee488_device, dio_r))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(IEEE488_TAG, ieee488_device, host_dio_w))
- MCFG_TPI6525_IN_PC_CB(READ8(*this, c64_ieee488_device, tpi_pc_r))
- MCFG_TPI6525_OUT_PC_CB(WRITE8(*this, c64_ieee488_device, tpi_pc_w))
-
- MCFG_CBM_IEEE488_ADD(nullptr)
- MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD()
-MACHINE_CONFIG_END
+void c64_ieee488_device::device_add_mconfig(machine_config &config)
+{
+ TPI6525(config, m_tpi, 0);
+ m_tpi->in_pa_cb().set(FUNC(c64_ieee488_device::tpi_pa_r));
+ m_tpi->out_pa_cb().set(FUNC(c64_ieee488_device::tpi_pa_w));
+ m_tpi->in_pb_cb().set(m_bus, FUNC(ieee488_device::dio_r));
+ m_tpi->out_pb_cb().set(m_bus, FUNC(ieee488_device::host_dio_w));
+ m_tpi->in_pc_cb().set(FUNC(c64_ieee488_device::tpi_pc_r));
+ m_tpi->out_pc_cb().set(FUNC(c64_ieee488_device::tpi_pc_w));
+
+ IEEE488(config, m_bus, 0);
+ ieee488_slot_device::add_cbm_defaults(config, nullptr);
+
+ C64_EXPANSION_SLOT(config, m_exp, c64_expansion_cards, nullptr);
+ m_exp->set_passthrough();
+}
diff --git a/src/devices/bus/c64/magic_voice.cpp b/src/devices/bus/c64/magic_voice.cpp
index 8ec79474d50..d7223c4efd3 100644
--- a/src/devices/bus/c64/magic_voice.cpp
+++ b/src/devices/bus/c64/magic_voice.cpp
@@ -219,29 +219,31 @@ WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::apd_w )
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(c64_magic_voice_cartridge_device::device_add_mconfig)
- MCFG_DEVICE_ADD(MOS6525_TAG, TPI6525, 0)
- MCFG_TPI6525_OUT_IRQ_CB(WRITELINE(*this, c64_magic_voice_cartridge_device, tpi_irq_w))
- MCFG_TPI6525_IN_PA_CB(READ8(*this, c64_magic_voice_cartridge_device, tpi_pa_r))
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, c64_magic_voice_cartridge_device, tpi_pa_w))
- MCFG_TPI6525_IN_PB_CB(READ8(*this, c64_magic_voice_cartridge_device, tpi_pb_r))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, c64_magic_voice_cartridge_device, tpi_pb_w))
- MCFG_TPI6525_OUT_CA_CB(WRITELINE(*this, c64_magic_voice_cartridge_device, tpi_ca_w))
- MCFG_TPI6525_OUT_CA_CB(WRITELINE(*this, c64_magic_voice_cartridge_device, tpi_cb_w))
-
- MCFG_DEVICE_ADD(CD40105_TAG, CD40105, 0)
- MCFG_40105_DATA_IN_READY_CB(WRITELINE(MOS6525_TAG, tpi6525_device, i3_w))
+void c64_magic_voice_cartridge_device::device_add_mconfig(machine_config &config)
+{
+ TPI6525(config, m_tpi, 0);
+ m_tpi->out_irq_cb().set(FUNC(c64_magic_voice_cartridge_device::tpi_irq_w));
+ m_tpi->in_pa_cb().set(FUNC(c64_magic_voice_cartridge_device::tpi_pa_r));
+ m_tpi->out_pa_cb().set(FUNC(c64_magic_voice_cartridge_device::tpi_pa_w));
+ m_tpi->in_pb_cb().set(FUNC(c64_magic_voice_cartridge_device::tpi_pb_r));
+ m_tpi->out_pb_cb().set(FUNC(c64_magic_voice_cartridge_device::tpi_pb_w));
+ m_tpi->out_ca_cb().set(FUNC(c64_magic_voice_cartridge_device::tpi_ca_w));
+ m_tpi->out_cb_cb().set(FUNC(c64_magic_voice_cartridge_device::tpi_cb_w));
+
+ CD40105(config, m_fifo, 0);
+ m_fifo->in_ready_cb().set(m_tpi, FUNC(tpi6525_device::i3_w));
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD(T6721A_TAG, T6721A, XTAL(640'000))
- MCFG_T6721A_EOS_HANDLER(WRITELINE(MOS6525_TAG, tpi6525_device, i2_w))
- MCFG_T6721A_PHI2_HANDLER(WRITELINE(DEVICE_SELF, c64_magic_voice_cartridge_device, phi2_w))
- MCFG_T6721A_DTRD_HANDLER(WRITELINE(DEVICE_SELF, c64_magic_voice_cartridge_device, dtrd_w))
- MCFG_T6721A_APD_HANDLER(WRITELINE(DEVICE_SELF, c64_magic_voice_cartridge_device, apd_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD()
-MACHINE_CONFIG_END
+ T6721A(config, m_vslsi, XTAL(640'000));
+ m_vslsi->eos_handler().set(m_tpi, FUNC(tpi6525_device::i2_w));
+ m_vslsi->phi2_handler().set(FUNC(c64_magic_voice_cartridge_device::phi2_w));
+ m_vslsi->dtrd_handler().set(FUNC(c64_magic_voice_cartridge_device::dtrd_w));
+ m_vslsi->apd_handler().set(FUNC(c64_magic_voice_cartridge_device::apd_w));
+ m_vslsi->add_route(ALL_OUTPUTS, "mono", 0.25);
+
+ C64_EXPANSION_SLOT(config, m_exp, c64_expansion_cards, nullptr);
+ m_exp->set_passthrough();
+}
diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp
index 86cb34eb344..154d6ad405e 100644
--- a/src/devices/cpu/arm7/arm7.cpp
+++ b/src/devices/cpu/arm7/arm7.cpp
@@ -47,6 +47,7 @@ void (*arm7_coproc_dt_w_callback)(arm_state *arm, uint32_t insn, uint32_t *prn,
DEFINE_DEVICE_TYPE(ARM7, arm7_cpu_device, "arm7_le", "ARM7 (little)")
DEFINE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device, "arm7_be", "ARM7 (big)")
+DEFINE_DEVICE_TYPE(ARM710A, arm710a_cpu_device, "arm710a", "ARM710a")
DEFINE_DEVICE_TYPE(ARM7500, arm7500_cpu_device, "arm7500", "ARM7500")
DEFINE_DEVICE_TYPE(ARM9, arm9_cpu_device, "arm9", "ARM9")
DEFINE_DEVICE_TYPE(ARM920T, arm920t_cpu_device, "arm920t", "ARM920T")
@@ -96,6 +97,15 @@ arm7_be_cpu_device::arm7_be_cpu_device(const machine_config &mconfig, const char
}
+arm710a_cpu_device::arm710a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : arm7_cpu_device(mconfig, ARM710A, tag, owner, clock, 4, ARCHFLAG_MODE26, ENDIANNESS_LITTLE)
+{
+ m_copro_id = ARM9_COPRO_ID_MFR_ARM
+ | ARM9_COPRO_ID_ARCH_V4
+ | ARM9_COPRO_ID_PART_ARM710;
+}
+
+
arm7500_cpu_device::arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: arm7_cpu_device(mconfig, ARM7500, tag, owner, clock, 4, ARCHFLAG_MODE26, ENDIANNESS_LITTLE)
{
diff --git a/src/devices/cpu/arm7/arm7.h b/src/devices/cpu/arm7/arm7.h
index d7d66766664..d59eb7ed732 100644
--- a/src/devices/cpu/arm7/arm7.h
+++ b/src/devices/cpu/arm7/arm7.h
@@ -599,6 +599,12 @@ public:
arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
+class arm710a_cpu_device : public arm7_cpu_device
+{
+public:
+ // construction/destruction
+ arm710a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
class arm9_cpu_device : public arm7_cpu_device
{
@@ -691,6 +697,7 @@ public:
DECLARE_DEVICE_TYPE(ARM7, arm7_cpu_device)
DECLARE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device)
+DECLARE_DEVICE_TYPE(ARM710A, arm710a_cpu_device)
DECLARE_DEVICE_TYPE(ARM7500, arm7500_cpu_device)
DECLARE_DEVICE_TYPE(ARM9, arm9_cpu_device)
DECLARE_DEVICE_TYPE(ARM920T, arm920t_cpu_device)
diff --git a/src/devices/machine/40105.h b/src/devices/machine/40105.h
index 77b58bbaf08..6edea9cc6f6 100644
--- a/src/devices/machine/40105.h
+++ b/src/devices/machine/40105.h
@@ -56,6 +56,9 @@ public:
template <class Object> devcb_base &set_dir_callback(Object &&dir) { return m_write_dir.set_callback(std::forward<Object>(dir)); }
template <class Object> devcb_base &set_dor_callback(Object &&dor) { return m_write_dor.set_callback(std::forward<Object>(dor)); }
template <class Object> devcb_base &set_data_out_callback(Object &&out) { return m_write_q.set_callback(std::forward<Object>(out)); }
+ auto in_ready_cb() { return m_write_dir.bind(); }
+ auto out_ready_cb() { return m_write_dor.bind(); }
+ auto out_cb() { return m_write_q.bind(); }
u8 read();
void write(u8 data);
diff --git a/src/devices/machine/6525tpi.h b/src/devices/machine/6525tpi.h
index d1f3c66c7bb..5e1ec394fe4 100644
--- a/src/devices/machine/6525tpi.h
+++ b/src/devices/machine/6525tpi.h
@@ -43,16 +43,6 @@ class tpi6525_device : public device_t
public:
tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pa_callback(Object &&cb) { return m_in_pa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pa_callback(Object &&cb) { return m_out_pa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pb_callback(Object &&cb) { return m_in_pb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pb_callback(Object &&cb) { return m_out_pb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pc_callback(Object &&cb) { return m_in_pc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pc_callback(Object &&cb) { return m_out_pc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_ca_callback(Object &&cb) { return m_out_ca_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_cb_callback(Object &&cb) { return m_out_cb_cb.set_callback(std::forward<Object>(cb)); }
-
auto out_irq_cb() { return m_out_irq_cb.bind(); }
auto in_pa_cb() { return m_in_pa_cb.bind(); }
auto out_pa_cb() { return m_out_pa_cb.bind(); }
@@ -133,33 +123,4 @@ private:
DECLARE_DEVICE_TYPE(TPI6525, tpi6525_device)
-
-#define MCFG_TPI6525_OUT_IRQ_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_IN_PA_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_OUT_PA_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_IN_PB_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_OUT_PB_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_IN_PC_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_OUT_PC_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_OUT_CA_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_out_ca_callback(DEVCB_##_devcb);
-
-#define MCFG_TPI6525_OUT_CB_CB(_devcb) \
- downcast<tpi6525_device &>(*device).set_out_cb_callback(DEVCB_##_devcb);
-
-
#endif // MAME_MACHINE_6525TPI_H
diff --git a/src/devices/machine/6532riot.h b/src/devices/machine/6532riot.h
index fb700312475..fc70dd82624 100644
--- a/src/devices/machine/6532riot.h
+++ b/src/devices/machine/6532riot.h
@@ -13,26 +13,6 @@
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_RIOT6532_IN_PA_CB(_devcb) \
- downcast<riot6532_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
-
-#define MCFG_RIOT6532_OUT_PA_CB(_devcb) \
- downcast<riot6532_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
-
-#define MCFG_RIOT6532_IN_PB_CB(_devcb) \
- downcast<riot6532_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
-
-#define MCFG_RIOT6532_OUT_PB_CB(_devcb) \
- downcast<riot6532_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
-
-#define MCFG_RIOT6532_IRQ_CB(_devcb) \
- downcast<riot6532_device &>(*device).set_irq_callback(DEVCB_##_devcb);
-
-
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
@@ -46,11 +26,6 @@ public:
// construction/destruction
riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_in_pa_callback(Object &&cb) { return m_in_pa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pa_callback(Object &&cb) { return m_out_pa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pb_callback(Object &&cb) { return m_in_pb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pb_callback(Object &&cb) { return m_out_pb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_irq_cb.set_callback(std::forward<Object>(cb)); }
auto in_pa_callback() { return m_in_pa_cb.bind(); }
auto out_pa_callback() { return m_out_pa_cb.bind(); }
auto in_pb_callback() { return m_in_pb_cb.bind(); }
diff --git a/src/devices/sound/t6721a.h b/src/devices/sound/t6721a.h
index 49e77498118..4fd78923dd0 100644
--- a/src/devices/sound/t6721a.h
+++ b/src/devices/sound/t6721a.h
@@ -73,6 +73,10 @@ public:
template <class Object> devcb_base &set_phi2_callback(Object &&phi2) { return m_write_phi2.set_callback(std::forward<Object>(phi2)); }
template <class Object> devcb_base &set_dtrd_callback(Object &&dtrd) { return m_write_dtrd.set_callback(std::forward<Object>(dtrd)); }
template <class Object> devcb_base &set_apd_callback(Object &&apd) { return m_write_apd.set_callback(std::forward<Object>(apd)); }
+ auto eos_handler() { return m_write_eos.bind(); }
+ auto phi2_handler() { return m_write_phi2.bind(); }
+ auto dtrd_handler() { return m_write_dtrd.bind(); }
+ auto apd_handler() { return m_write_apd.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/mame/audio/exidy.cpp b/src/mame/audio/exidy.cpp
index 973a5a255aa..da7d8966e78 100644
--- a/src/mame/audio/exidy.cpp
+++ b/src/mame/audio/exidy.cpp
@@ -754,12 +754,12 @@ MACHINE_CONFIG_START(venture_sound_device::device_add_mconfig)
MCFG_DEVICE_ADD("audiocpu", M6502, 3579545/4)
MCFG_DEVICE_PROGRAM_MAP(venture_audio_map)
- MCFG_DEVICE_ADD("riot", RIOT6532, SH6532_CLOCK)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, venture_sound_device, r6532_porta_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, venture_sound_device, r6532_porta_w))
- MCFG_RIOT6532_IN_PB_CB(READ8(*this, venture_sound_device, r6532_portb_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, venture_sound_device, r6532_portb_w))
- MCFG_RIOT6532_IRQ_CB(WRITELINE("audioirq", input_merger_device, in_w<0>))
+ RIOT6532(config, m_riot, SH6532_CLOCK);
+ m_riot->in_pa_callback().set(FUNC(venture_sound_device::r6532_porta_r));
+ m_riot->out_pa_callback().set(FUNC(venture_sound_device::r6532_porta_w));
+ m_riot->in_pb_callback().set(FUNC(venture_sound_device::r6532_portb_r));
+ m_riot->out_pb_callback().set(FUNC(venture_sound_device::r6532_portb_w));
+ m_riot->irq_callback().set("audioirq", FUNC(input_merger_device::in_w<0>));
MCFG_DEVICE_ADD("pia", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(WRITE8(*this, venture_sound_device, pia_pa_w))
@@ -985,12 +985,12 @@ MACHINE_CONFIG_START(victory_sound_device::device_add_mconfig)
MCFG_DEVICE_ADD("audiocpu", M6502, VICTORY_AUDIO_CPU_CLOCK)
MCFG_DEVICE_PROGRAM_MAP(victory_audio_map)
- MCFG_DEVICE_ADD("riot", RIOT6532, SH6532_CLOCK)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, victory_sound_device, r6532_porta_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, victory_sound_device, r6532_porta_w))
- MCFG_RIOT6532_IN_PB_CB(READ8(*this, victory_sound_device, r6532_portb_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, victory_sound_device, r6532_portb_w))
- MCFG_RIOT6532_IRQ_CB(WRITELINE("audioirq", input_merger_device, in_w<0>))
+ RIOT6532(config, m_riot, SH6532_CLOCK);
+ m_riot->in_pa_callback().set(FUNC(victory_sound_device::r6532_porta_r));
+ m_riot->out_pa_callback().set(FUNC(victory_sound_device::r6532_porta_w));
+ m_riot->in_pb_callback().set(FUNC(victory_sound_device::r6532_portb_r));
+ m_riot->out_pb_callback().set(FUNC(victory_sound_device::r6532_portb_w));
+ m_riot->irq_callback().set("audioirq", FUNC(input_merger_device::in_w<0>));
MCFG_DEVICE_ADD("pia", PIA6821, 0)
MCFG_PIA_CA2_HANDLER(WRITELINE(*this, victory_sound_device, irq_clear_w))
diff --git a/src/mame/drivers/a2600.cpp b/src/mame/drivers/a2600.cpp
index ea2b6f73960..de364526c90 100644
--- a/src/mame/drivers/a2600.cpp
+++ b/src/mame/drivers/a2600.cpp
@@ -535,12 +535,12 @@ MACHINE_CONFIG_START(a2600_state::a2600)
MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, a2600_state, switch_B_w))
MCFG_MOS6530n_IRQ_CB(WRITELINE(*this, a2600_state, irq_callback))
#else
- MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK_NTSC / 3)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, a2600_state, switch_A_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, a2600_state, switch_A_w))
- MCFG_RIOT6532_IN_PB_CB(READ8(*this, a2600_state, riot_input_port_8_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, a2600_state, switch_B_w))
- MCFG_RIOT6532_IRQ_CB(WRITELINE(*this, a2600_state, irq_callback))
+ RIOT6532(config, m_riot, MASTER_CLOCK_NTSC / 3);
+ m_riot->in_pa_callback().set(FUNC(a2600_state::switch_A_r));
+ m_riot->out_pa_callback().set(FUNC(a2600_state::switch_A_w));
+ m_riot->in_pb_callback().set(FUNC(a2600_state::riot_input_port_8_r));
+ m_riot->out_pb_callback().set(FUNC(a2600_state::switch_B_w));
+ m_riot->irq_callback().set(FUNC(a2600_state::irq_callback));
#endif
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
@@ -583,12 +583,12 @@ MACHINE_CONFIG_START(a2600_state::a2600p)
MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, a2600_state, switch_B_w))
MCFG_MOS6530n_IRQ_CB(WRITELINE(*this, a2600_state, irq_callback))
#else
- MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK_PAL / 3)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, a2600_state, switch_A_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, a2600_state, switch_A_w))
- MCFG_RIOT6532_IN_PB_CB(READ8(*this, a2600_state, riot_input_port_8_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, a2600_state, switch_B_w))
- MCFG_RIOT6532_IRQ_CB(WRITELINE(*this, a2600_state, irq_callback))
+ RIOT6532(config, m_riot, MASTER_CLOCK_PAL / 3);
+ m_riot->in_pa_callback().set(FUNC(a2600_state::switch_A_r));
+ m_riot->out_pa_callback().set(FUNC(a2600_state::switch_A_w));
+ m_riot->in_pb_callback().set(FUNC(a2600_state::riot_input_port_8_r));
+ m_riot->out_pb_callback().set(FUNC(a2600_state::switch_B_w));
+ m_riot->irq_callback().set(FUNC(a2600_state::irq_callback));
#endif
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index 7ab188c6467..91cb1fe3449 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -1613,9 +1613,9 @@ MACHINE_CONFIG_START(cdtv_state::cdtv)
m_dmac->io_write_handler().set(FUNC(cdtv_state::dmac_io_write));
m_dmac->int_handler().set(FUNC(cdtv_state::dmac_int_w));
- MCFG_DEVICE_ADD("u32", TPI6525, 0)
- MCFG_TPI6525_OUT_IRQ_CB(WRITELINE(*this, cdtv_state, tpi_int_w))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cdtv_state, tpi_port_b_write))
+ tpi6525_device &tpi(TPI6525(config, "u32", 0));
+ tpi.out_irq_cb().set(FUNC(cdtv_state::tpi_int_w));
+ tpi.out_pb_cb().set(FUNC(cdtv_state::tpi_port_b_write));
// cd-rom
CR511B(config, m_cdrom, 0);
diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp
index e69661d8526..a212bccd53c 100644
--- a/src/mame/drivers/cbm2.cpp
+++ b/src/mame/drivers/cbm2.cpp
@@ -2343,19 +2343,22 @@ MACHINE_CONFIG_START(p500_state::p500_ntsc)
// devices
MCFG_PLS100_ADD(PLA1_TAG)
MCFG_PLS100_ADD(PLA2_TAG)
- MCFG_DEVICE_ADD(MOS6525_1_TAG, TPI6525, 0)
- MCFG_TPI6525_OUT_IRQ_CB(WRITELINE(*this, p500_state, tpi1_irq_w))
- MCFG_TPI6525_IN_PA_CB(READ8(*this, cbm2_state, tpi1_pa_r))
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, cbm2_state, tpi1_pa_w))
- MCFG_TPI6525_IN_PB_CB(READ8(*this, cbm2_state, tpi1_pb_r))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, tpi1_pb_w))
- MCFG_TPI6525_OUT_CA_CB(WRITELINE(*this, p500_state, tpi1_ca_w))
- MCFG_TPI6525_OUT_CB_CB(WRITELINE(*this, p500_state, tpi1_cb_w))
- MCFG_DEVICE_ADD(MOS6525_2_TAG, TPI6525, 0)
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, cbm2_state, tpi2_pa_w))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, tpi2_pb_w))
- MCFG_TPI6525_IN_PC_CB(READ8(*this, p500_state, tpi2_pc_r))
- MCFG_TPI6525_OUT_PC_CB(WRITE8(*this, p500_state, tpi2_pc_w))
+
+ TPI6525(config, m_tpi1, 0);
+ m_tpi1->out_irq_cb().set(FUNC(p500_state::tpi1_irq_w));
+ m_tpi1->in_pa_cb().set(FUNC(cbm2_state::tpi1_pa_r));
+ m_tpi1->out_pa_cb().set(FUNC(cbm2_state::tpi1_pa_w));
+ m_tpi1->in_pb_cb().set(FUNC(cbm2_state::tpi1_pb_r));
+ m_tpi1->out_pa_cb().set(FUNC(cbm2_state::tpi1_pb_w));
+ m_tpi1->out_ca_cb().set(FUNC(p500_state::tpi1_ca_w));
+ m_tpi1->out_cb_cb().set(FUNC(p500_state::tpi1_cb_w));
+
+ TPI6525(config, m_tpi2, 0);
+ m_tpi2->out_pa_cb().set(FUNC(cbm2_state::tpi2_pa_w));
+ m_tpi2->out_pb_cb().set(FUNC(cbm2_state::tpi2_pb_w));
+ m_tpi2->in_pc_cb().set(FUNC(p500_state::tpi2_pc_r));
+ m_tpi2->out_pc_cb().set(FUNC(p500_state::tpi2_pc_w));
+
MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, VIC6567_CLOCK)
MCFG_MOS6551_XTAL(XTAL(1'843'200))
MCFG_MOS6551_IRQ_HANDLER(WRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w))
@@ -2459,19 +2462,22 @@ MACHINE_CONFIG_START(p500_state::p500_pal)
// devices
MCFG_PLS100_ADD(PLA1_TAG)
MCFG_PLS100_ADD(PLA2_TAG)
- MCFG_DEVICE_ADD(MOS6525_1_TAG, TPI6525, 0)
- MCFG_TPI6525_OUT_IRQ_CB(WRITELINE(*this, p500_state, tpi1_irq_w))
- MCFG_TPI6525_IN_PA_CB(READ8(*this, cbm2_state, tpi1_pa_r))
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, cbm2_state, tpi1_pa_w))
- MCFG_TPI6525_IN_PB_CB(READ8(*this, cbm2_state, tpi1_pb_r))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, tpi1_pb_w))
- MCFG_TPI6525_OUT_CA_CB(WRITELINE(*this, p500_state, tpi1_ca_w))
- MCFG_TPI6525_OUT_CB_CB(WRITELINE(*this, p500_state, tpi1_cb_w))
- MCFG_DEVICE_ADD(MOS6525_2_TAG, TPI6525, 0)
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, cbm2_state, tpi2_pa_w))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, tpi2_pb_w))
- MCFG_TPI6525_IN_PC_CB(READ8(*this, p500_state, tpi2_pc_r))
- MCFG_TPI6525_OUT_PC_CB(WRITE8(*this, p500_state, tpi2_pc_w))
+
+ TPI6525(config, m_tpi1, 0);
+ m_tpi1->out_irq_cb().set(FUNC(p500_state::tpi1_irq_w));
+ m_tpi1->in_pa_cb().set(FUNC(cbm2_state::tpi1_pa_r));
+ m_tpi1->out_pa_cb().set(FUNC(cbm2_state::tpi1_pa_w));
+ m_tpi1->in_pb_cb().set(FUNC(cbm2_state::tpi1_pb_r));
+ m_tpi1->out_pa_cb().set(FUNC(cbm2_state::tpi1_pb_w));
+ m_tpi1->out_ca_cb().set(FUNC(p500_state::tpi1_ca_w));
+ m_tpi1->out_cb_cb().set(FUNC(p500_state::tpi1_cb_w));
+
+ TPI6525(config, m_tpi2, 0);
+ m_tpi2->out_pa_cb().set(FUNC(cbm2_state::tpi2_pa_w));
+ m_tpi2->out_pb_cb().set(FUNC(cbm2_state::tpi2_pb_w));
+ m_tpi2->in_pc_cb().set(FUNC(p500_state::tpi2_pc_r));
+ m_tpi2->out_pc_cb().set(FUNC(p500_state::tpi2_pc_w));
+
MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, 0)
MCFG_MOS6551_XTAL(XTAL(1'843'200))
MCFG_MOS6551_IRQ_HANDLER(WRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w))
@@ -2574,17 +2580,20 @@ MACHINE_CONFIG_START(cbm2_state::cbm2lp_ntsc)
// devices
MCFG_PLS100_ADD(PLA1_TAG)
- MCFG_DEVICE_ADD(MOS6525_1_TAG, TPI6525, 0)
- MCFG_TPI6525_OUT_IRQ_CB(WRITELINE(*this, cbm2_state, tpi1_irq_w))
- MCFG_TPI6525_IN_PA_CB(READ8(*this, cbm2_state, tpi1_pa_r))
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, cbm2_state, tpi1_pa_w))
- MCFG_TPI6525_IN_PA_CB(READ8(*this, cbm2_state, tpi1_pb_r))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, tpi1_pb_w))
- MCFG_TPI6525_OUT_CA_CB(WRITELINE(*this, cbm2_state, tpi1_ca_w))
- MCFG_DEVICE_ADD(MOS6525_2_TAG, TPI6525, 0)
- MCFG_TPI6525_OUT_PA_CB(WRITE8(*this, cbm2_state, tpi2_pa_w))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, tpi2_pb_w))
- MCFG_TPI6525_IN_PC_CB(READ8(*this, cbm2_state, tpi2_pc_r))
+
+ TPI6525(config, m_tpi1, 0);
+ m_tpi1->out_irq_cb().set(FUNC(cbm2_state::tpi1_irq_w));
+ m_tpi1->in_pa_cb().set(FUNC(cbm2_state::tpi1_pa_r));
+ m_tpi1->out_pa_cb().set(FUNC(cbm2_state::tpi1_pa_w));
+ m_tpi1->in_pb_cb().set(FUNC(cbm2_state::tpi1_pb_r));
+ m_tpi1->out_pb_cb().set(FUNC(cbm2_state::tpi1_pb_w));
+ m_tpi1->out_ca_cb().set(FUNC(cbm2_state::tpi1_ca_w));
+
+ TPI6525(config, m_tpi2, 0);
+ m_tpi2->out_pa_cb().set(FUNC(cbm2_state::tpi2_pa_w));
+ m_tpi2->out_pb_cb().set(FUNC(cbm2_state::tpi2_pb_w));
+ m_tpi2->in_pc_cb().set(FUNC(cbm2_state::tpi2_pc_r));
+
MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, 0)
MCFG_MOS6551_XTAL(XTAL(1'843'200))
MCFG_MOS6551_IRQ_HANDLER(WRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w))
@@ -2703,8 +2712,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(cbm2_state::cbm2hp_ntsc)
cbm2lp_ntsc(config);
- MCFG_DEVICE_MODIFY(MOS6525_2_TAG)
- MCFG_TPI6525_IN_PC_CB(READ8(*this, cbm2hp_state, tpi2_pc_r))
+ m_tpi2->in_pc_cb().set(FUNC(cbm2hp_state::tpi2_pc_r));
MACHINE_CONFIG_END
@@ -2744,11 +2752,11 @@ MACHINE_CONFIG_START(cbm2hp_state::bx256hp)
MCFG_DEVICE_ADD(EXT_I8259A_TAG, PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD(EXT_MOS6525_TAG, TPI6525, 0)
- MCFG_TPI6525_IN_PA_CB(READ8(EXT_MOS6526_TAG, mos6526_device, pa_r))
- MCFG_TPI6525_IN_PB_CB(READ8(*this, cbm2_state, ext_tpi_pb_r))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, ext_tpi_pb_w))
- MCFG_TPI6525_OUT_PC_CB(WRITE8(*this, cbm2_state, ext_tpi_pc_w))
+ TPI6525(config, m_ext_tpi, 0);
+ m_ext_tpi->in_pa_cb().set(EXT_MOS6526_TAG, FUNC(mos6526_device::pa_r));
+ m_ext_tpi->in_pb_cb().set(FUNC(cbm2_state::ext_tpi_pb_r));
+ m_ext_tpi->out_pb_cb().set(FUNC(cbm2_state::ext_tpi_pb_w));
+ m_ext_tpi->out_pc_cb().set(FUNC(cbm2_state::ext_tpi_pc_w));
MCFG_DEVICE_ADD(EXT_MOS6526_TAG, MOS6526, XTAL(18'000'000)/9)
MCFG_MOS6526_TOD(60)
@@ -2770,8 +2778,7 @@ MACHINE_CONFIG_START(cbm2_state::cbm2hp_pal)
MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal)
// devices
- MCFG_DEVICE_MODIFY(MOS6525_2_TAG)
- MCFG_TPI6525_IN_PC_CB(READ8(*this, cbm2hp_state, tpi2_pc_r))
+ m_tpi2->in_pc_cb().set(FUNC(cbm2hp_state::tpi2_pc_r));
MCFG_DEVICE_MODIFY(MOS6526_TAG)
MCFG_MOS6526_TOD(50)
@@ -2814,11 +2821,11 @@ MACHINE_CONFIG_START(cbm2hp_state::cbm730)
MCFG_DEVICE_ADD(EXT_I8259A_TAG, PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD(EXT_MOS6525_TAG, TPI6525, 0)
- MCFG_TPI6525_IN_PA_CB(READ8(EXT_MOS6526_TAG, mos6526_device, pa_r))
- MCFG_TPI6525_IN_PB_CB(READ8(*this, cbm2_state, ext_tpi_pb_r))
- MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cbm2_state, ext_tpi_pb_w))
- MCFG_TPI6525_OUT_PC_CB(WRITE8(*this, cbm2_state, ext_tpi_pc_w))
+ TPI6525(config, m_ext_tpi, 0);
+ m_ext_tpi->in_pa_cb().set(EXT_MOS6526_TAG, FUNC(mos6526_device::pa_r));
+ m_ext_tpi->in_pb_cb().set(FUNC(cbm2_state::ext_tpi_pb_r));
+ m_ext_tpi->out_pb_cb().set(FUNC(cbm2_state::ext_tpi_pb_w));
+ m_ext_tpi->out_pc_cb().set(FUNC(cbm2_state::ext_tpi_pc_w));
MCFG_DEVICE_ADD(EXT_MOS6526_TAG, MOS6526, XTAL(18'000'000)/9)
MCFG_MOS6526_TOD(50)
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index bbd1994f3f9..8aaf78ffc7b 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -701,12 +701,12 @@ MACHINE_CONFIG_START(firefox_state::firefox)
X2212(config, "nvram_1c").set_auto_save(true);
X2212(config, "nvram_1d").set_auto_save(true);
- MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_XTAL/8)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, firefox_state, riot_porta_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, firefox_state, riot_porta_w))
- MCFG_RIOT6532_IN_PB_CB(READ8("tms", tms5220_device, status_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8("tms", tms5220_device, data_w))
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("audiocpu", M6502_IRQ_LINE))
+ riot6532_device &riot(RIOT6532(config, "riot", MASTER_XTAL/8));
+ riot.in_pa_callback().set(FUNC(firefox_state::riot_porta_r));
+ riot.out_pa_callback().set(FUNC(firefox_state::riot_porta_w));
+ riot.in_pb_callback().set("tms", FUNC(tms5220_device::status_r));
+ riot.out_pb_callback().set("tms", FUNC(tms5220_device::data_w));
+ riot.irq_callback().set_inputline("audiocpu", M6502_IRQ_LINE);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/gts80.cpp b/src/mame/drivers/gts80.cpp
index 3c525acea07..80e2c2b2e59 100644
--- a/src/mame/drivers/gts80.cpp
+++ b/src/mame/drivers/gts80.cpp
@@ -367,24 +367,26 @@ MACHINE_CONFIG_START(gts80_state::gts80)
config.set_default_layout(layout_gts80);
/* Devices */
- MCFG_DEVICE_ADD("riot1", RIOT6532, XTAL(3'579'545)/4)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80_state, port1a_r)) // sw_r
- //MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80_state, port1a_w))
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80_state, port1b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80_state, port1b_w)) // sw_w
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
- MCFG_DEVICE_ADD("riot2", RIOT6532, XTAL(3'579'545)/4)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80_state, port2a_r)) // pa7 - slam tilt
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80_state, port2a_w)) // digit select
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80_state, port2b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80_state, port2b_w)) // seg
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
- MCFG_DEVICE_ADD("riot3", RIOT6532, XTAL(3'579'545)/4)
- //MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80_state, port3a_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80_state, port3a_w)) // sol, snd
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80_state, port3b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80_state, port3b_w)) // lamps
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
+ riot6532_device &riot1(RIOT6532(config, "riot1", XTAL(3'579'545)/4));
+ riot1.in_pa_callback().set(FUNC(gts80_state::port1a_r)); // sw_r
+ //riot1.out_pa_callback().set(FUNC(gts80_state::port1a_w));
+ //riot1.in_pb_callback().set(FUNC(gts80_state::port1b_r));
+ riot1.out_pb_callback().set(FUNC(gts80_state::port1b_w)); // sw_w
+ riot1.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
+
+ riot6532_device &riot2(RIOT6532(config, "riot2", XTAL(3'579'545)/4));
+ riot2.in_pa_callback().set(FUNC(gts80_state::port2a_r)); // pa7 - slam tilt
+ riot2.out_pa_callback().set(FUNC(gts80_state::port2a_w)); // digit select
+ //riot2.in_pb_callback().set(FUNC(gts80_state::port2b_r));
+ riot2.out_pb_callback().set(FUNC(gts80_state::port2b_w)); // seg
+ riot2.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
+
+ riot6532_device &riot3(RIOT6532(config, "riot3", XTAL(3'579'545)/4));
+ //riot3.in_pa_callback().set(FUNC(gts80_state::port3a_r));
+ riot3.out_pa_callback().set(FUNC(gts80_state::port3a_w)); // sol, snd
+ //riot3.in_pb_callback().set(FUNC(gts80_state::port3b_r));
+ riot3.out_pb_callback().set(FUNC(gts80_state::port3b_w)); // lamps
+ riot3.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
/* Sound */
genpin_audio(config);
diff --git a/src/mame/drivers/gts80a.cpp b/src/mame/drivers/gts80a.cpp
index d0ff17e18b2..fb42ca45704 100644
--- a/src/mame/drivers/gts80a.cpp
+++ b/src/mame/drivers/gts80a.cpp
@@ -358,24 +358,26 @@ MACHINE_CONFIG_START(gts80a_state::gts80a)
config.set_default_layout(layout_gts80a);
/* Devices */
- MCFG_DEVICE_ADD("riot1", RIOT6532, XTAL(3'579'545)/4)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80a_state, port1a_r)) // sw_r
- //MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80a_state, port1a_w))
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80a_state, port1b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80a_state, port1b_w)) // sw_w
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
- MCFG_DEVICE_ADD("riot2", RIOT6532, XTAL(3'579'545)/4)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80a_state, port2a_r)) // pa7 - slam tilt
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80a_state, port2a_w)) // digit select
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80a_state, port2b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80a_state, port2b_w)) // seg
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
- MCFG_DEVICE_ADD("riot3", RIOT6532, XTAL(3'579'545)/4)
- //MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80a_state, port3a_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80a_state, port3a_w)) // sol, snd
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80a_state, port3b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80a_state, port3b_w)) // lamps
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
+ riot6532_device &riot1(RIOT6532(config, "riot1", XTAL(3'579'545)/4));
+ riot1.in_pa_callback().set(FUNC(gts80a_state::port1a_r)); // sw_r
+ //riot1.out_pa_callback().set(FUNC(gts80a_state::port1a_w));
+ //riot1.in_pb_callback().set(FUNC(gts80a_state::port1b_r));
+ riot1.out_pb_callback().set(FUNC(gts80a_state::port1b_w)); // sw_w
+ riot1.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
+
+ riot6532_device &riot2(RIOT6532(config, "riot2", XTAL(3'579'545)/4));
+ riot2.in_pa_callback().set(FUNC(gts80a_state::port2a_r)); // pa7 - slam tilt
+ riot2.out_pa_callback().set(FUNC(gts80a_state::port2a_w)); // digit select
+ //riot2.in_pb_callback().set(FUNC(gts80a_state::port2b_r));
+ riot2.out_pb_callback().set(FUNC(gts80a_state::port2b_w)); // seg
+ riot2.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
+
+ riot6532_device &riot3(RIOT6532(config, "riot3", XTAL(3'579'545)/4));
+ //riot3.in_pa_callback().set(FUNC(gts80a_state::port3a_r));
+ riot3.out_pa_callback().set(FUNC(gts80a_state::port3a_w)); // sol, snd
+ //riot3.in_pb_callback().set(FUNC(gts80a_state::port3b_r));
+ riot3.out_pb_callback().set(FUNC(gts80a_state::port3b_w)); // lamps
+ riot3.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
/* Sound */
genpin_audio(config);
diff --git a/src/mame/drivers/gts80b.cpp b/src/mame/drivers/gts80b.cpp
index 2a5663d8c03..92e0efd4e06 100644
--- a/src/mame/drivers/gts80b.cpp
+++ b/src/mame/drivers/gts80b.cpp
@@ -399,24 +399,26 @@ MACHINE_CONFIG_START(gts80b_state::gts80b)
config.set_default_layout(layout_gts80b);
/* Devices */
- MCFG_DEVICE_ADD("riot1", RIOT6532, XTAL(3'579'545)/4)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80b_state, port1a_r)) // sw_r
- //MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80b_state, port1a_w))
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80b_state, port1b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80b_state, port1b_w)) // sw_w
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
- MCFG_DEVICE_ADD("riot2", RIOT6532, XTAL(3'579'545)/4)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80b_state, port2a_r)) // pa7 - slam tilt
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80b_state, port2a_w)) // digit select
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80b_state, port2b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80b_state, port2b_w)) // seg
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
- MCFG_DEVICE_ADD("riot3", RIOT6532, XTAL(3'579'545)/4)
- //MCFG_RIOT6532_IN_PA_CB(READ8(*this, gts80b_state, port3a_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, gts80b_state, port3a_w)) // sol, snd
- //MCFG_RIOT6532_IN_PB_CB(READ8(*this, gts80b_state, port3b_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, gts80b_state, port3b_w)) // lamps
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
+ riot6532_device &riot1(RIOT6532(config, "riot1", XTAL(3'579'545)/4));
+ riot1.in_pa_callback().set(FUNC(gts80b_state::port1a_r)); // sw_r
+ //riot1.out_pa_callback().set(FUNC(gts80b_state::port1a_w));
+ //riot1.in_pb_callback().set(FUNC(gts80b_state::port1b_r));
+ riot1.out_pb_callback().set(FUNC(gts80b_state::port1b_w)); // sw_w
+ riot1.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
+
+ riot6532_device &riot2(RIOT6532(config, "riot2", XTAL(3'579'545)/4));
+ riot2.in_pa_callback().set(FUNC(gts80b_state::port2a_r)); // pa7 - slam tilt
+ riot2.out_pa_callback().set(FUNC(gts80b_state::port2a_w)); // digit select
+ //riot2.in_pb_callback().set(FUNC(gts80b_state::port2b_r));
+ riot2.out_pb_callback().set(FUNC(gts80b_state::port2b_w)); // seg
+ riot2.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
+
+ riot6532_device &riot3(RIOT6532(config, "riot3", XTAL(3'579'545)/4));
+ //riot3.in_pa_callback().set(FUNC(gts80b_state::port3a_r));
+ riot3.out_pa_callback().set(FUNC(gts80b_state::port3a_w)); // sol, snd
+ //riot3.in_pb_callback().set(FUNC(gts80b_state::port3b_r));
+ riot3.out_pb_callback().set(FUNC(gts80b_state::port3b_w)); // lamps
+ riot3.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
/* Sound */
genpin_audio(config);
diff --git a/src/mame/drivers/spectra.cpp b/src/mame/drivers/spectra.cpp
index f150554d0f6..ea512f79daf 100644
--- a/src/mame/drivers/spectra.cpp
+++ b/src/mame/drivers/spectra.cpp
@@ -234,12 +234,12 @@ MACHINE_CONFIG_START(spectra_state::spectra)
MCFG_DEVICE_ADD("maincpu", M6502, XTAL(3'579'545)/4) // actually a M6503
MCFG_DEVICE_PROGRAM_MAP(spectra_map)
- MCFG_DEVICE_ADD("riot", RIOT6532, XTAL(3'579'545)/4)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, spectra_state, porta_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, spectra_state, porta_w))
- MCFG_RIOT6532_IN_PB_CB(READ8(*this, spectra_state, portb_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, spectra_state, portb_w))
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
+ riot6532_device &riot(RIOT6532(config, "riot", XTAL(3'579'545)/4));
+ riot.in_pa_callback().set(FUNC(spectra_state::porta_r));
+ riot.out_pa_callback().set(FUNC(spectra_state::porta_w));
+ riot.in_pb_callback().set(FUNC(spectra_state::portb_r));
+ riot.out_pb_callback().set(FUNC(spectra_state::portb_w));
+ riot.irq_callback().set_inputline("maincpu", M6502_IRQ_LINE);
MCFG_NVRAM_ADD_1FILL("nvram")
diff --git a/src/mame/drivers/starwars.cpp b/src/mame/drivers/starwars.cpp
index 9608e0bf09f..72aa87e5513 100644
--- a/src/mame/drivers/starwars.cpp
+++ b/src/mame/drivers/starwars.cpp
@@ -316,12 +316,12 @@ MACHINE_CONFIG_START(starwars_state::starwars)
MCFG_ADC0808_IN1_CB(IOPORT("STICKX")) // yaw
MCFG_ADC0808_IN2_CB(CONSTANT(0)) // thrust (unused)
- MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK / 8)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, starwars_state, r6532_porta_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, starwars_state, r6532_porta_w))
- MCFG_RIOT6532_IN_PB_CB(READ8("tms", tms5220_device, status_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8("tms", tms5220_device, data_w))
- MCFG_RIOT6532_IRQ_CB(INPUTLINE("audiocpu", M6809_IRQ_LINE))
+ RIOT6532(config, m_riot, MASTER_CLOCK / 8);
+ m_riot->in_pa_callback().set(FUNC(starwars_state::r6532_porta_r));
+ m_riot->out_pa_callback().set(FUNC(starwars_state::r6532_porta_w));
+ m_riot->in_pb_callback().set("tms", FUNC(tms5220_device::status_r));
+ m_riot->out_pb_callback().set("tms", FUNC(tms5220_device::data_w));
+ m_riot->irq_callback().set_inputline("audiocpu", M6809_IRQ_LINE);
X2212(config, "x2212").set_auto_save(true); /* nvram */
diff --git a/src/mame/drivers/tourtabl.cpp b/src/mame/drivers/tourtabl.cpp
index 93d55150bd5..340c8fbfc60 100644
--- a/src/mame/drivers/tourtabl.cpp
+++ b/src/mame/drivers/tourtabl.cpp
@@ -160,15 +160,15 @@ MACHINE_CONFIG_START(tourtabl_state::tourtabl)
MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK / 3) /* actually M6507 */
MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_ADD("riot1", RIOT6532, MASTER_CLOCK / 3)
- MCFG_RIOT6532_IN_PA_CB(IOPORT("RIOT0_SWA"))
- MCFG_RIOT6532_IN_PB_CB(IOPORT("RIOT0_SWB"))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8("watchdog", watchdog_timer_device, reset_w))
-
- MCFG_DEVICE_ADD("riot2", RIOT6532, MASTER_CLOCK / 3)
- MCFG_RIOT6532_IN_PA_CB(IOPORT("RIOT1_SWA"))
- MCFG_RIOT6532_IN_PB_CB(IOPORT("RIOT1_SWB"))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, tourtabl_state, tourtabl_led_w))
+ riot6532_device &riot1(RIOT6532(config, "riot1", MASTER_CLOCK / 3));
+ riot1.in_pa_callback().set_ioport("RIOT0_SWA");
+ riot1.in_pb_callback().set_ioport("RIOT0_SWB");
+ riot1.out_pb_callback().set("watchdog", FUNC(watchdog_timer_device::reset_w));
+
+ riot6532_device &riot2(RIOT6532(config, "riot2", MASTER_CLOCK / 3));
+ riot2.in_pa_callback().set_ioport("RIOT1_SWA");
+ riot2.in_pb_callback().set_ioport("RIOT1_SWB");
+ riot2.out_pb_callback().set(FUNC(tourtabl_state::tourtabl_led_w));
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/tvboy.cpp b/src/mame/drivers/tvboy.cpp
index 5a9f0bae655..1a37960360e 100644
--- a/src/mame/drivers/tvboy.cpp
+++ b/src/mame/drivers/tvboy.cpp
@@ -107,12 +107,12 @@ MACHINE_CONFIG_START(tvboy_state::tvboyii)
MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, tvboy_state, switch_B_w))
MCFG_MOS6530n_IRQ_CB(WRITELINE(*this, tvboy_state, irq_callback))
#else
- MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK_PAL / 3)
- MCFG_RIOT6532_IN_PA_CB(READ8(*this, tvboy_state, switch_A_r))
- MCFG_RIOT6532_OUT_PA_CB(WRITE8(*this, tvboy_state, switch_A_w))
- MCFG_RIOT6532_IN_PB_CB(READ8(*this, tvboy_state, riot_input_port_8_r))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(*this, tvboy_state, switch_B_w))
- MCFG_RIOT6532_IRQ_CB(WRITELINE(*this, tvboy_state, irq_callback))
+ RIOT6532(config, m_riot, MASTER_CLOCK_PAL / 3);
+ m_riot->in_pa_callback().set(FUNC(tvboy_state::switch_A_r));
+ m_riot->out_pa_callback().set(FUNC(tvboy_state::switch_A_w));
+ m_riot->in_pb_callback().set(FUNC(tvboy_state::riot_input_port_8_r));
+ m_riot->out_pb_callback().set(FUNC(tvboy_state::switch_B_w));
+ m_riot->irq_callback().set(FUNC(tvboy_state::irq_callback));
#endif
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")