summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2018-08-28 18:11:03 +0200
committerGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2018-08-28 18:11:03 +0200
commit310d867d4b77ac93c3e3c3fd0ec83f76ec5579e3 (patch) (github)
tree13583f29b6e650f229918f4d32f1e57ccd0acb22
parent1be95fa5ed6300c89ee1a8a1895582b305ec5595 (diff)
downloadmame-310d867d4b77ac93c3e3c3fd0ec83f76ec5579e3.tar.bz2
mame-310d867d4b77ac93c3e3c3fd0ec83f76ec5579e3.zip
z80pio.cpp: removed macros (nw)
-rw-r--r--src/devices/bus/abcbus/fd2.cpp20
-rw-r--r--src/devices/bus/abcbus/lux10828.cpp14
-rw-r--r--src/devices/bus/cpc/cpc_pds.cpp7
-rw-r--r--src/devices/bus/imi7000/imi5000h.cpp48
-rw-r--r--src/devices/bus/msx_cart/bm_012.cpp12
-rw-r--r--src/devices/cpu/z80/tmpz84c015.cpp16
-rw-r--r--src/devices/machine/z80pio.h33
-rw-r--r--src/mame/drivers/a5105.cpp4
-rw-r--r--src/mame/drivers/abc80.cpp10
-rw-r--r--src/mame/drivers/ac1.cpp10
-rw-r--r--src/mame/drivers/altos5.cpp18
-rw-r--r--src/mame/drivers/avt.cpp10
-rw-r--r--src/mame/drivers/babbage.cpp16
-rw-r--r--src/mame/drivers/bbcbc.cpp9
-rw-r--r--src/mame/drivers/binbug.cpp10
-rw-r--r--src/mame/drivers/br8641.cpp20
-rw-r--r--src/mame/drivers/bullet.cpp20
-rw-r--r--src/mame/drivers/c80.cpp18
-rw-r--r--src/mame/drivers/ccs300.cpp4
-rw-r--r--src/mame/drivers/cedar_magnet.cpp26
-rw-r--r--src/mame/drivers/chessmst.cpp44
-rw-r--r--src/mame/drivers/czk80.cpp4
-rw-r--r--src/mame/drivers/dmax8000.cpp8
-rw-r--r--src/mame/drivers/einstein.cpp14
-rw-r--r--src/mame/drivers/fidelz80.cpp8
-rw-r--r--src/mame/drivers/hazelgr.cpp12
-rw-r--r--src/mame/drivers/huebler.cpp8
-rw-r--r--src/mame/drivers/jupace.cpp10
-rw-r--r--src/mame/drivers/kaypro.cpp21
-rw-r--r--src/mame/drivers/kc.cpp32
-rw-r--r--src/mame/drivers/kramermc.cpp8
-rw-r--r--src/mame/drivers/lc80.cpp32
-rw-r--r--src/mame/drivers/llc.cpp26
-rw-r--r--src/mame/drivers/mbee.cpp26
-rw-r--r--src/mame/drivers/mc8020.cpp8
-rw-r--r--src/mame/drivers/mc8030.cpp24
-rw-r--r--src/mame/drivers/mccpm.cpp2
-rw-r--r--src/mame/drivers/mcr.cpp10
-rw-r--r--src/mame/drivers/mes.cpp4
-rw-r--r--src/mame/drivers/mpf1.cpp12
-rw-r--r--src/mame/drivers/mz2000.cpp8
-rw-r--r--src/mame/drivers/mz2500.cpp8
-rw-r--r--src/mame/drivers/mz700.cpp10
-rw-r--r--src/mame/drivers/nanos.cpp16
-rw-r--r--src/mame/drivers/nascom1.cpp2
-rw-r--r--src/mame/drivers/onyx.cpp33
-rw-r--r--src/mame/drivers/p8k.cpp26
-rw-r--r--src/mame/drivers/pasopia.cpp8
-rw-r--r--src/mame/drivers/pasopia7.cpp8
-rw-r--r--src/mame/drivers/pcm.cpp16
-rw-r--r--src/mame/drivers/poly880.cpp16
-rw-r--r--src/mame/drivers/polyplay.cpp12
-rw-r--r--src/mame/drivers/pro80.cpp2
-rw-r--r--src/mame/drivers/proconn.cpp88
-rw-r--r--src/mame/drivers/rt1715.cpp4
-rw-r--r--src/mame/drivers/sc1.cpp6
-rw-r--r--src/mame/drivers/sc2.cpp10
-rw-r--r--src/mame/drivers/senjyo.cpp6
-rw-r--r--src/mame/drivers/super6.cpp4
-rw-r--r--src/mame/drivers/super80.cpp16
-rw-r--r--src/mame/drivers/superslave.cpp4
-rw-r--r--src/mame/drivers/sys2900.cpp4
-rw-r--r--src/mame/drivers/system1.cpp9
-rw-r--r--src/mame/drivers/tiki100.cpp12
-rw-r--r--src/mame/drivers/tranz330.cpp8
-rw-r--r--src/mame/drivers/trs80m2.cpp32
-rw-r--r--src/mame/drivers/ts816.cpp10
-rw-r--r--src/mame/drivers/vcs80.cpp8
-rw-r--r--src/mame/drivers/victory.cpp12
-rw-r--r--src/mame/drivers/xerox820.cpp50
-rw-r--r--src/mame/drivers/z1013.cpp13
-rw-r--r--src/mame/drivers/z9001.cpp10
-rw-r--r--src/mame/machine/cedar_magnet_plane.cpp26
-rw-r--r--src/mame/machine/cedar_magnet_sprite.cpp41
74 files changed, 572 insertions, 604 deletions
diff --git a/src/devices/bus/abcbus/fd2.cpp b/src/devices/bus/abcbus/fd2.cpp
index ef6af85b9ac..02131c32269 100644
--- a/src/devices/bus/abcbus/fd2.cpp
+++ b/src/devices/bus/abcbus/fd2.cpp
@@ -128,7 +128,7 @@ void abc_fd2_device::abc_fd2_mem(address_map &map)
void abc_fd2_device::abc_fd2_io(address_map &map)
{
map.global_mask(0x73);
- map(0x30, 0x33).rw(Z80PIO_TAG, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt));
+ map(0x30, 0x33).rw(m_pio, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt));
map(0x50, 0x53).rw(FD1771_TAG, FUNC(fd1771_device::read), FUNC(fd1771_device::write));
map(0x60, 0x60).w(FUNC(abc_fd2_device::status_w));
}
@@ -243,17 +243,17 @@ MACHINE_CONFIG_START(abc_fd2_device::device_add_mconfig)
MCFG_DEVICE_IO_MAP(abc_fd2_io)
MCFG_Z80_DAISY_CHAIN(daisy_chain)
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 4_MHz_XTAL / 2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, abc_fd2_device, pio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, abc_fd2_device, pio_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, abc_fd2_device, pio_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, abc_fd2_device, pio_pb_w))
+ Z80PIO(config, m_pio, 4_MHz_XTAL / 2);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set(FUNC(abc_fd2_device::pio_pa_r));
+ m_pio->out_pa_callback().set(FUNC(abc_fd2_device::pio_pa_w));
+ m_pio->in_pb_callback().set(FUNC(abc_fd2_device::pio_pb_r));
+ m_pio->out_pb_callback().set(FUNC(abc_fd2_device::pio_pb_w));
MCFG_DEVICE_ADD(FD1771_TAG, FD1771, 4_MHz_XTAL / 4)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(Z80PIO_TAG, z80pio_device, pb7_w))
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(Z80PIO_TAG, z80pio_device, pb5_w))
- MCFG_WD_FDC_HLD_CALLBACK(WRITELINE(Z80PIO_TAG, z80pio_device, pb6_w))
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(m_pio, z80pio_device, pb7_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(m_pio, z80pio_device, pb5_w))
+ MCFG_WD_FDC_HLD_CALLBACK(WRITELINE(m_pio, z80pio_device, pb6_w))
MCFG_FLOPPY_DRIVE_ADD(FD1771_TAG ":0", abc_fd2_floppies, "525sssd", abc_fd2_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FD1771_TAG ":1", abc_fd2_floppies, "525sssd", abc_fd2_device::floppy_formats)
diff --git a/src/devices/bus/abcbus/lux10828.cpp b/src/devices/bus/abcbus/lux10828.cpp
index 9978ebeeb81..834f852dadc 100644
--- a/src/devices/bus/abcbus/lux10828.cpp
+++ b/src/devices/bus/abcbus/lux10828.cpp
@@ -186,7 +186,7 @@ void luxor_55_10828_device::luxor_55_10828_mem(address_map &map)
void luxor_55_10828_device::luxor_55_10828_io(address_map &map)
{
map.global_mask(0xff);
- map(0x70, 0x73).mirror(0x0c).rw(Z80PIO_TAG, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt));
+ map(0x70, 0x73).mirror(0x0c).rw(m_pio, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt));
map(0xb0, 0xb3).mirror(0x0c).rw(FUNC(luxor_55_10828_device::fdc_r), FUNC(luxor_55_10828_device::fdc_w));
map(0xd0, 0xd0).mirror(0x0f).w(FUNC(luxor_55_10828_device::status_w));
map(0xe0, 0xe0).mirror(0x0f).w(FUNC(luxor_55_10828_device::ctrl_w));
@@ -326,12 +326,12 @@ MACHINE_CONFIG_START(luxor_55_10828_device::device_add_mconfig)
MCFG_DEVICE_IO_MAP(luxor_55_10828_io)
MCFG_Z80_DAISY_CHAIN(daisy_chain)
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 4_MHz_XTAL / 2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, luxor_55_10828_device, pio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, luxor_55_10828_device, pio_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, luxor_55_10828_device, pio_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, luxor_55_10828_device, pio_pb_w))
+ Z80PIO(config, m_pio, 4_MHz_XTAL / 2);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set(FUNC(luxor_55_10828_device::pio_pa_r));
+ m_pio->out_pa_callback().set(FUNC(luxor_55_10828_device::pio_pa_w));
+ m_pio->in_pb_callback().set(FUNC(luxor_55_10828_device::pio_pb_r));
+ m_pio->out_pb_callback().set(FUNC(luxor_55_10828_device::pio_pb_w));
MCFG_DEVICE_ADD(MB8876_TAG, MB8876, 4_MHz_XTAL / 4)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, luxor_55_10828_device, fdc_intrq_w))
diff --git a/src/devices/bus/cpc/cpc_pds.cpp b/src/devices/bus/cpc/cpc_pds.cpp
index bc170675a51..c1000939152 100644
--- a/src/devices/bus/cpc/cpc_pds.cpp
+++ b/src/devices/bus/cpc/cpc_pds.cpp
@@ -17,11 +17,12 @@
DEFINE_DEVICE_TYPE(CPC_PDS, cpc_pds_device, "cpc_pds", "Programmers Development System (CPC Target)")
-MACHINE_CONFIG_START(cpc_pds_device::device_add_mconfig)
- MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(4'000'000)) // no clock on the PCB, so will presume that it uses the CPC's clock
+void cpc_pds_device::device_add_mconfig(machine_config &config)
+{
+ Z80PIO(config, m_pio, XTAL(4'000'000)); // no clock on the PCB, so will presume that it uses the CPC's clock
// no pass-through seen on remake PCBs, unknown if actual hardware had a pass-through port or not
-MACHINE_CONFIG_END
+}
//**************************************************************************
diff --git a/src/devices/bus/imi7000/imi5000h.cpp b/src/devices/bus/imi7000/imi5000h.cpp
index e826a81663f..ec8ac8c8347 100644
--- a/src/devices/bus/imi7000/imi5000h.cpp
+++ b/src/devices/bus/imi7000/imi5000h.cpp
@@ -354,30 +354,30 @@ MACHINE_CONFIG_START(imi5000h_device::device_add_mconfig)
MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, imi5000h_device, ctc_z1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, imi5000h_device, ctc_z2_w))
- MCFG_DEVICE_ADD(Z80PIO_0_TAG, Z80PIO, XTAL(8'000'000)/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, imi5000h_device, pio0_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, imi5000h_device, pio0_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(Z80PIO_0_TAG, z80pio_device, strobe_a))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, imi5000h_device, pio0_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, imi5000h_device, pio0_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(Z80PIO_0_TAG, z80pio_device, strobe_b))
-
- MCFG_DEVICE_ADD(Z80PIO_2_TAG, Z80PIO, XTAL(8'000'000)/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, imi5000h_device, pio2_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, imi5000h_device, pio2_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(Z80PIO_2_TAG, z80pio_device, strobe_a))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, imi5000h_device, pio2_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, imi5000h_device, pio2_pb_w))
-
- MCFG_DEVICE_ADD(Z80PIO_3_TAG, Z80PIO, XTAL(8'000'000)/2)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, imi5000h_device, pio3_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, imi5000h_device, pio3_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(Z80PIO_3_TAG, z80pio_device, strobe_a))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, imi5000h_device, pio3_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, imi5000h_device, pio3_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(Z80PIO_3_TAG, z80pio_device, strobe_b))
+ z80pio_device& pio0(Z80PIO(config, Z80PIO_0_TAG, XTAL(8'000'000)/2));
+ pio0.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio0.in_pa_callback().set(FUNC(imi5000h_device::pio0_pa_r));
+ pio0.out_pa_callback().set(FUNC(imi5000h_device::pio0_pa_w));
+ pio0.out_ardy_callback().set(Z80PIO_0_TAG, FUNC(z80pio_device::strobe_a));
+ pio0.in_pb_callback().set(FUNC(imi5000h_device::pio0_pb_r));
+ pio0.out_pb_callback().set(FUNC(imi5000h_device::pio0_pb_w));
+ pio0.out_brdy_callback().set(Z80PIO_0_TAG, FUNC(z80pio_device::strobe_b));
+
+ z80pio_device& pio2(Z80PIO(config, Z80PIO_2_TAG, XTAL(8'000'000)/2));
+ pio2.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio2.in_pa_callback().set(FUNC(imi5000h_device::pio2_pa_r));
+ pio2.out_pa_callback().set(FUNC(imi5000h_device::pio2_pa_w));
+ pio2.out_ardy_callback().set(Z80PIO_2_TAG, FUNC(z80pio_device::strobe_a));
+ pio2.in_pb_callback().set(FUNC(imi5000h_device::pio2_pb_r));
+ pio2.out_pb_callback().set(FUNC(imi5000h_device::pio2_pb_w));
+
+ z80pio_device& pio3(Z80PIO(config, Z80PIO_3_TAG, XTAL(8'000'000)/2));
+ pio3.in_pa_callback().set(FUNC(imi5000h_device::pio3_pa_r));
+ pio3.out_pa_callback().set(FUNC(imi5000h_device::pio3_pa_w));
+ pio3.out_ardy_callback().set(Z80PIO_3_TAG, FUNC(z80pio_device::strobe_a));
+ pio3.in_pb_callback().set(FUNC(imi5000h_device::pio3_pb_r));
+ pio3.out_pb_callback().set(FUNC(imi5000h_device::pio3_pb_w));
+ pio3.out_brdy_callback().set(Z80PIO_3_TAG, FUNC(z80pio_device::strobe_b));
//MCFG_HARDDISK_ADD("harddisk1")
MACHINE_CONFIG_END
diff --git a/src/devices/bus/msx_cart/bm_012.cpp b/src/devices/bus/msx_cart/bm_012.cpp
index be5eb7a60c0..dd4154a137f 100644
--- a/src/devices/bus/msx_cart/bm_012.cpp
+++ b/src/devices/bus/msx_cart/bm_012.cpp
@@ -61,12 +61,12 @@ MACHINE_CONFIG_START(msx_cart_bm_012_device::device_add_mconfig)
// Sony CXK5864BSP-10L (8KB ram)
// Sharp LH0081A Z80A-PIO-0 - For communicating between the MSX and the TMP
- MCFG_DEVICE_ADD("bm012_pio", Z80PIO, XTAL(3'579'545)) // ?????
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("tmpz84c015af", tmpz84c015_device, pa_w))
- MCFG_Z80PIO_IN_PA_CB(READ8("tmpz84c015af", tmpz84c015_device, pa_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8("tmpz84c015af", tmpz84c015_device, pb_w))
- MCFG_Z80PIO_IN_PB_CB(READ8("tmpz84c015af", tmpz84c015_device, pb_r))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE("tmpz84c015af", tmpz84c015_device, strobe_b))
+ Z80PIO(config, m_bm012_pio, XTAL(3'579'545)); // ?????
+ m_bm012_pio->out_pa_callback().set("tmpz84c015af", FUNC(tmpz84c015_device::pa_w));
+ m_bm012_pio->in_pa_callback().set("tmpz84c015af", FUNC(tmpz84c015_device::pa_r));
+ m_bm012_pio->out_pb_callback().set("tmpz84c015af", FUNC(tmpz84c015_device::pb_w));
+ m_bm012_pio->in_pb_callback().set("tmpz84c015af", FUNC(tmpz84c015_device::pb_r));
+ m_bm012_pio->out_brdy_callback().set("tmpz84c015af", FUNC(tmpz84c015_device::strobe_b));
// MIDI ports
MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin")
diff --git a/src/devices/cpu/z80/tmpz84c015.cpp b/src/devices/cpu/z80/tmpz84c015.cpp
index 3ea871f8df4..78e515ecece 100644
--- a/src/devices/cpu/z80/tmpz84c015.cpp
+++ b/src/devices/cpu/z80/tmpz84c015.cpp
@@ -208,14 +208,14 @@ MACHINE_CONFIG_START(tmpz84c015_device::device_add_mconfig)
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, tmpz84c015_device, zc_cb_trampoline_w<2>))
MCFG_Z80CTC_ZC3_CB(WRITELINE(*this, tmpz84c015_device, zc_cb_trampoline_w<3>))
- MCFG_DEVICE_ADD("tmpz84c015_pio", Z80PIO, DERIVED_CLOCK(1,1) )
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(DEVICE_SELF, INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio, DERIVED_CLOCK(1,1));
+ m_pio->out_int_callback().set_inputline(DEVICE_SELF, INPUT_LINE_IRQ0);
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, tmpz84c015_device, in_pa_cb_trampoline_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, tmpz84c015_device, out_pa_cb_trampoline_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, tmpz84c015_device, out_ardy_cb_trampoline_w))
+ m_pio->in_pa_callback().set(FUNC(tmpz84c015_device::in_pa_cb_trampoline_r));
+ m_pio->out_pa_callback().set(FUNC(tmpz84c015_device::out_pa_cb_trampoline_w));
+ m_pio->out_ardy_callback().set(FUNC(tmpz84c015_device::out_ardy_cb_trampoline_w));
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, tmpz84c015_device, in_pb_cb_trampoline_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, tmpz84c015_device, out_pb_cb_trampoline_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, tmpz84c015_device, out_brdy_cb_trampoline_w))
+ m_pio->in_pb_callback().set(FUNC(tmpz84c015_device::in_pb_cb_trampoline_r));
+ m_pio->out_pb_callback().set(FUNC(tmpz84c015_device::out_pb_cb_trampoline_w));
+ m_pio->out_brdy_callback().set(FUNC(tmpz84c015_device::out_brdy_cb_trampoline_w));
MACHINE_CONFIG_END
diff --git a/src/devices/machine/z80pio.h b/src/devices/machine/z80pio.h
index f0bfad62351..f5314351a09 100644
--- a/src/devices/machine/z80pio.h
+++ b/src/devices/machine/z80pio.h
@@ -38,32 +38,6 @@
//**************************************************************************
-// DEVICE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_Z80PIO_OUT_INT_CB(_devcb) \
- downcast<z80pio_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
-
-#define MCFG_Z80PIO_IN_PA_CB(_devcb) \
- downcast<z80pio_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
-
-#define MCFG_Z80PIO_OUT_PA_CB(_devcb) \
- downcast<z80pio_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
-
-#define MCFG_Z80PIO_OUT_ARDY_CB(_devcb) \
- downcast<z80pio_device &>(*device).set_out_ardy_callback(DEVCB_##_devcb);
-
-#define MCFG_Z80PIO_IN_PB_CB(_devcb) \
- downcast<z80pio_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
-
-#define MCFG_Z80PIO_OUT_PB_CB(_devcb) \
- downcast<z80pio_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
-
-#define MCFG_Z80PIO_OUT_BRDY_CB(_devcb) \
- downcast<z80pio_device &>(*device).set_out_brdy_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -84,13 +58,6 @@ public:
// construction/destruction
z80pio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_out_int_callback(Object &&cb) { return m_out_int_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_out_ardy_callback(Object &&cb) { return m_out_ardy_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_out_brdy_callback(Object &&cb) { return m_out_brdy_cb.set_callback(std::forward<Object>(cb)); }
auto out_int_callback() { return m_out_int_cb.bind(); }
auto in_pa_callback() { return m_in_pa_cb.bind(); }
auto out_pa_callback() { return m_out_pa_cb.bind(); }
diff --git a/src/mame/drivers/a5105.cpp b/src/mame/drivers/a5105.cpp
index bb0901ff2a9..6a84ce93084 100644
--- a/src/mame/drivers/a5105.cpp
+++ b/src/mame/drivers/a5105.cpp
@@ -603,8 +603,8 @@ MACHINE_CONFIG_START(a5105_state::a5105)
MCFG_Z80CTC_ZC0_CB(WRITELINE("z80ctc", z80ctc_device, trg2))
MCFG_Z80CTC_ZC2_CB(WRITELINE("z80ctc", z80ctc_device, trg3))
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(15'000'000) / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ z80pio_device& pio(Z80PIO(config, "z80pio", XTAL(15'000'000) / 4));
+ pio.out_int_callback().set_inputline(m_maincpu, 0);
MCFG_CASSETTE_ADD( "cassette" )
diff --git a/src/mame/drivers/abc80.cpp b/src/mame/drivers/abc80.cpp
index 57961e69dc3..a86917d7c0b 100644
--- a/src/mame/drivers/abc80.cpp
+++ b/src/mame/drivers/abc80.cpp
@@ -512,11 +512,11 @@ MACHINE_CONFIG_START(abc80_state::abc80)
WAVE(config, "wave", CASSETTE_TAG).add_route(ALL_OUTPUTS, "mono", 0.25);
// devices
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(11'980'800)/2/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, abc80_state, pio_pa_r))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, abc80_state, pio_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, abc80_state, pio_pb_w))
+ Z80PIO(config, m_pio, XTAL(11'980'800)/2/2);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set(FUNC(abc80_state::pio_pa_r));
+ m_pio->in_pb_callback().set(FUNC(abc80_state::pio_pb_r));
+ m_pio->out_pb_callback().set(FUNC(abc80_state::pio_pb_w));
MCFG_CASSETTE_ADD(CASSETTE_TAG)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
diff --git a/src/mame/drivers/ac1.cpp b/src/mame/drivers/ac1.cpp
index b2398af04d9..8493a919c6c 100644
--- a/src/mame/drivers/ac1.cpp
+++ b/src/mame/drivers/ac1.cpp
@@ -135,11 +135,11 @@ MACHINE_CONFIG_START(ac1_state::ac1)
MCFG_DEVICE_PROGRAM_MAP(ac1_mem)
MCFG_DEVICE_IO_MAP(ac1_io)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(8'000'000) / 4)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, ac1_state, ac1_port_a_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, ac1_state, ac1_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, ac1_state, ac1_port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, ac1_state, ac1_port_b_w))
+ z80pio_device& pio(Z80PIO(config, "z80pio", XTAL(8'000'000)/4));
+ pio.in_pa_callback().set(FUNC(ac1_state::ac1_port_a_r));
+ pio.out_pa_callback().set(FUNC(ac1_state::ac1_port_a_w));
+ pio.in_pb_callback().set(FUNC(ac1_state::ac1_port_b_r));
+ pio.out_pb_callback().set(FUNC(ac1_state::ac1_port_b_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/altos5.cpp b/src/mame/drivers/altos5.cpp
index 76b829df42e..1ff3e82bd9b 100644
--- a/src/mame/drivers/altos5.cpp
+++ b/src/mame/drivers/altos5.cpp
@@ -430,15 +430,15 @@ MACHINE_CONFIG_START(altos5_state::altos5)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, altos5_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, altos5_state, io_write_byte))
- MCFG_DEVICE_ADD("pio0", Z80PIO, 8_MHz_XTAL / 2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, altos5_state, port08_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, altos5_state, port08_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, altos5_state, port09_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, altos5_state, port09_w))
-
- MCFG_DEVICE_ADD("pio1", Z80PIO, 8_MHz_XTAL / 2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio0, 8_MHz_XTAL / 2);
+ m_pio0->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio0->in_pa_callback().set(FUNC(altos5_state::port08_r));
+ m_pio0->out_pa_callback().set(FUNC(altos5_state::port08_w));
+ m_pio0->in_pb_callback().set(FUNC(altos5_state::port09_r));
+ m_pio0->out_pb_callback().set(FUNC(altos5_state::port09_w));
+
+ z80pio_device& pio1(Z80PIO(config, "pio1", 8_MHz_XTAL / 2));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD("dart", Z80DART, 8_MHz_XTAL / 2)
// Channel A - console #3
diff --git a/src/mame/drivers/avt.cpp b/src/mame/drivers/avt.cpp
index 20536778729..f175dddfc3e 100644
--- a/src/mame/drivers/avt.cpp
+++ b/src/mame/drivers/avt.cpp
@@ -1000,14 +1000,14 @@ MACHINE_CONFIG_START(avt_state::avt)
// ZC1 not connected
// TRG2 to TP18; ZC2 to TP9; TRG3 to VSYNC; TRG0 to cpu_clock/4
- MCFG_DEVICE_ADD("pio0", Z80PIO, CPU_CLOCK) // U23
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PB_CB(IOPORT("IN0"))
+ Z80PIO(config, m_pio0, CPU_CLOCK); // U23
+ m_pio0->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio0->in_pb_callback().set_ioport("IN0");
// PORT A appears to be lamp drivers
// PORT B d0-d5 = muxed inputs; d6 = SW2 pushbutton; d7 = ?
- MCFG_DEVICE_ADD("pio1", Z80PIO, CPU_CLOCK) // U22
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio1, CPU_CLOCK); // U22
+ m_pio1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
// PORT A d0-d7 = TP13,TP12,TP11,TP10,TP8,TP7,TP5,TP3
// PORT B d0-d7 = "Player2", DCOM, CCOM, BCOM, ACOM, LOCKOUT/TP6, TP4, 50/60HZ (held high, jumper on JP13 grounds it)
// DCOM,CCOM,BCOM,ACOM appear to be muxes
diff --git a/src/mame/drivers/babbage.cpp b/src/mame/drivers/babbage.cpp
index 7dab7381653..675b4c364c1 100644
--- a/src/mame/drivers/babbage.cpp
+++ b/src/mame/drivers/babbage.cpp
@@ -247,14 +247,14 @@ MACHINE_CONFIG_START(babbage_state::babbage)
MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, babbage_state, ctc_z1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, babbage_state, ctc_z2_w))
- MCFG_DEVICE_ADD("z80pio_1", Z80PIO, MAIN_CLOCK)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, babbage_state, pio1_b_w))
-
- MCFG_DEVICE_ADD("z80pio_2", Z80PIO, MAIN_CLOCK)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, babbage_state, pio2_a_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, babbage_state, pio2_b_w))
+ Z80PIO(config, m_pio_1, MAIN_CLOCK);
+ m_pio_1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio_1->out_pb_callback().set(FUNC(babbage_state::pio1_b_w));
+
+ Z80PIO(config, m_pio_2, MAIN_CLOCK);
+ m_pio_2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio_2->in_pa_callback().set(FUNC(babbage_state::pio2_a_r));
+ m_pio_2->out_pb_callback().set(FUNC(babbage_state::pio2_b_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", babbage_state, keyboard_callback, attotime::from_hz(30))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/bbcbc.cpp b/src/mame/drivers/bbcbc.cpp
index cdbe8b388f9..3fa5e1c20ac 100644
--- a/src/mame/drivers/bbcbc.cpp
+++ b/src/mame/drivers/bbcbc.cpp
@@ -124,11 +124,10 @@ MACHINE_CONFIG_START(bbcbc_state::bbcbc)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_Z80_DAISY_CHAIN(bbcbc_daisy_chain)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, 10.6875_MHz_XTAL / 3)
- //MCFG_Z80PIO_OUT_PA_CB(???)
- //MCFG_Z80PIO_IN_STROBE_CB(???)
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, bbcbc_state, input_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, bbcbc_state, input_select_w))
+ Z80PIO(config, m_z80pio, 10.6875_MHz_XTAL / 3);
+ //m_z80pio->out_pa_callback().set(???);
+ m_z80pio->in_pb_callback().set(FUNC(bbcbc_state::input_r));
+ m_z80pio->out_pb_callback().set(FUNC(bbcbc_state::input_select_w));
tms9129_device &vdp(TMS9129(config, "tms9129", 10.6875_MHz_XTAL));
vdp.set_screen("screen");
diff --git a/src/mame/drivers/binbug.cpp b/src/mame/drivers/binbug.cpp
index 8cf0ece1dae..7b8f9ebb6fb 100644
--- a/src/mame/drivers/binbug.cpp
+++ b/src/mame/drivers/binbug.cpp
@@ -568,12 +568,12 @@ MACHINE_CONFIG_START(dg680_state::dg680)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MCFG_Z80CTC_ZC0_CB(WRITELINE("z80ctc", z80ctc_device, trg1))
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(8'000'000) / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, dg680_state, porta_r))
+ z80pio_device& pio(Z80PIO(config, "z80pio", XTAL(8'000'000) / 4));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio.in_pa_callback().set(FUNC(dg680_state::porta_r));
// OUT_ARDY - this activates to ask for kbd data but not known if actually used
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, dg680_state, portb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, dg680_state, portb_w))
+ pio.in_pb_callback().set(FUNC(dg680_state::portb_r));
+ pio.out_pb_callback().set(FUNC(dg680_state::portb_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc0", dg680_state, time_tick, attotime::from_hz(200))
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc3", dg680_state, uart_tick, attotime::from_hz(4800))
diff --git a/src/mame/drivers/br8641.cpp b/src/mame/drivers/br8641.cpp
index 784bf0ab3f1..da04a510f15 100644
--- a/src/mame/drivers/br8641.cpp
+++ b/src/mame/drivers/br8641.cpp
@@ -173,19 +173,19 @@ MACHINE_CONFIG_START(brandt8641_state::brandt8641)
// Z80APIO U9
// Z80APIO U14
// Z80PIO U7 - unknown which is which
- MCFG_DEVICE_ADD("pio1", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio1, XTAL(4'000'000));
+ m_pio1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("pio2", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, brandt8641_state, port08_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, brandt8641_state, port08_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, brandt8641_state, port09_w))
+ Z80PIO(config, m_pio2, XTAL(4'000'000));
+ m_pio2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio2->in_pa_callback().set(FUNC(brandt8641_state::port08_r));
+ m_pio2->out_pa_callback().set(FUNC(brandt8641_state::port08_w));
+ m_pio2->out_pb_callback().set(FUNC(brandt8641_state::port09_w));
- MCFG_DEVICE_ADD("pio3", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio3, XTAL(4'000'000));
+ m_pio3->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(4'000'000)) // Z80CTC U8
+ Z80CTC(config, "ctc", XTAL(4'000'000)); // Z80CTC U8
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/bullet.cpp b/src/mame/drivers/bullet.cpp
index a61fe71f23f..93749e31694 100644
--- a/src/mame/drivers/bullet.cpp
+++ b/src/mame/drivers/bullet.cpp
@@ -1141,10 +1141,10 @@ MACHINE_CONFIG_START(bullet_state::bullet)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, bullet_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, bullet_state, io_write_byte))
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 16_MHz_XTAL / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, bullet_state, pio_pb_r))
+ z80pio_device& pio(Z80PIO(config, Z80PIO_TAG, 16_MHz_XTAL / 4));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio.out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ pio.in_pb_callback().set(FUNC(bullet_state::pio_pb_r));
MCFG_DEVICE_ADD(MB8877_TAG, MB8877, 16_MHz_XTAL / 16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(Z80DART_TAG, z80dart_device, dcda_w))
@@ -1220,12 +1220,12 @@ MACHINE_CONFIG_START(bulletf_state::bulletf)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, bullet_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, bullet_state, io_write_byte))
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 16_MHz_XTAL / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8("scsi_ctrl_in", input_buffer_device, bus_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, bulletf_state, pio_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, bulletf_state, cstrb_w))
+ z80pio_device& pio(Z80PIO(config, Z80PIO_TAG, 16_MHz_XTAL / 4));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio.in_pa_callback().set("scsi_ctrl_in", FUNC(input_buffer_device::bus_r));
+ pio.out_pa_callback().set(FUNC(bulletf_state::pio_pa_w));
+ pio.out_ardy_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ pio.out_brdy_callback().set(FUNC(bulletf_state::cstrb_w));
MCFG_DEVICE_ADD(MB8877_TAG, MB8877, 16_MHz_XTAL / 16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(Z80DART_TAG, z80dart_device, rib_w))
diff --git a/src/mame/drivers/c80.cpp b/src/mame/drivers/c80.cpp
index 5991651f614..6a614e5c8b5 100644
--- a/src/mame/drivers/c80.cpp
+++ b/src/mame/drivers/c80.cpp
@@ -265,15 +265,15 @@ MACHINE_CONFIG_START(c80_state::c80)
config.set_default_layout(layout_c80);
/* devices */
- MCFG_DEVICE_ADD(Z80PIO1_TAG, Z80PIO, 2500000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, c80_state, pio1_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, c80_state, pio1_pa_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, c80_state, pio1_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, c80_state, pio1_brdy_w))
-
- MCFG_DEVICE_ADD(Z80PIO2_TAG, Z80PIO, 2500000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio1, 2500000);
+ m_pio1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio1->in_pa_callback().set(FUNC(c80_state::pio1_pa_r));
+ m_pio1->out_pa_callback().set(FUNC(c80_state::pio1_pa_w));
+ m_pio1->out_pb_callback().set(FUNC(c80_state::pio1_pb_w));
+ m_pio1->out_brdy_callback().set(FUNC(c80_state::pio1_brdy_w));
+
+ z80pio_device& pio2(Z80PIO(config, Z80PIO2_TAG, XTAL(2500000)));
+ pio2.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED )
diff --git a/src/mame/drivers/ccs300.cpp b/src/mame/drivers/ccs300.cpp
index 089b178547c..506521f357b 100644
--- a/src/mame/drivers/ccs300.cpp
+++ b/src/mame/drivers/ccs300.cpp
@@ -143,8 +143,8 @@ MACHINE_CONFIG_START(ccs300_state::ccs300)
MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(4'000'000))
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ z80pio_device& pio(Z80PIO(config, "pio", XTAL(4'000'000)));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/cedar_magnet.cpp b/src/mame/drivers/cedar_magnet.cpp
index 843d5adcb45..2187c04669c 100644
--- a/src/mame/drivers/cedar_magnet.cpp
+++ b/src/mame/drivers/cedar_magnet.cpp
@@ -779,19 +779,19 @@ MACHINE_CONFIG_START(cedar_magnet_state::cedar_magnet)
ADDRESS_MAP_BANK(config, "mb_sub_ram").set_map(&cedar_magnet_state::cedar_magnet_mainboard_sub_ram_map).set_options(ENDIANNESS_LITTLE, 8, 18, 0x10000);
ADDRESS_MAP_BANK(config, "mb_sub_pal").set_map(&cedar_magnet_state::cedar_magnet_mainboard_sub_pal_map).set_options(ENDIANNESS_LITTLE, 8, 8+6, 0x100);
- MCFG_DEVICE_ADD("z80pio_ic48", Z80PIO, 4000000/2)
-// MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, cedar_magnet_state, ic48_pio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, cedar_magnet_state, ic48_pio_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, cedar_magnet_state, ic48_pio_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, cedar_magnet_state, ic48_pio_pb_w))
-
- MCFG_DEVICE_ADD("z80pio_ic49", Z80PIO, 4000000/2)
-// MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
-// MCFG_Z80PIO_IN_PA_CB(READ8(*this, cedar_magnet_state, ic49_pio_pa_r)) // NOT USED
-// MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, cedar_magnet_state, ic49_pio_pa_w)) // NOT USED
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, cedar_magnet_state, ic49_pio_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, cedar_magnet_state, ic49_pio_pb_w))
+ Z80PIO(config, m_ic48_pio, 4000000/2);
+// m_ic48_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_ic48_pio->in_pa_callback().set(FUNC(cedar_magnet_state::ic48_pio_pa_r));
+ m_ic48_pio->out_pa_callback().set(FUNC(cedar_magnet_state::ic48_pio_pa_w));
+ m_ic48_pio->in_pb_callback().set(FUNC(cedar_magnet_state::ic48_pio_pb_r));
+ m_ic48_pio->out_pb_callback().set(FUNC(cedar_magnet_state::ic48_pio_pb_w));
+
+ Z80PIO(config, m_ic49_pio, 4000000/2);
+// m_ic49_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+// m_ic49_pio->in_pa_callback().set(FUNC(cedar_magnet_state::ic49_pio_pa_r)); // NOT USED
+// m_ic49_pio->out_pa_callback().set(FUNC(cedar_magnet_state::ic49_pio_pa_w)); // NOT USED
+ m_ic49_pio->in_pb_callback().set(FUNC(cedar_magnet_state::ic49_pio_pb_r));
+ m_ic49_pio->out_pb_callback().set(FUNC(cedar_magnet_state::ic49_pio_pb_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/chessmst.cpp b/src/mame/drivers/chessmst.cpp
index 1876b061339..bcb50b77787 100644
--- a/src/mame/drivers/chessmst.cpp
+++ b/src/mame/drivers/chessmst.cpp
@@ -386,14 +386,14 @@ MACHINE_CONFIG_START(chessmst_state::chessmst)
MCFG_DEVICE_IO_MAP(chessmst_io)
MCFG_Z80_DAISY_CHAIN(chessmst_daisy_chain)
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, 9.8304_MHz_XTAL/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, chessmst_state, pio1_port_a_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, chessmst_state, pio1_port_b_w))
+ z80pio_device& pio1(Z80PIO(config, "z80pio1", 9.8304_MHz_XTAL/4));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio1.out_pa_callback().set(FUNC(chessmst_state::pio1_port_a_w));
+ pio1.out_pb_callback().set(FUNC(chessmst_state::pio1_port_b_w));
- MCFG_DEVICE_ADD("z80pio2", Z80PIO, 9.8304_MHz_XTAL/4)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, chessmst_state, pio2_port_a_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, chessmst_state, pio2_port_b_w))
+ Z80PIO(config, m_pia2, 9.8304_MHz_XTAL/4);
+ m_pia2->in_pa_callback().set(FUNC(chessmst_state::pio2_port_a_r));
+ m_pia2->out_pb_callback().set(FUNC(chessmst_state::pio2_port_b_w));
config.set_default_layout(layout_chessmst);
@@ -411,14 +411,14 @@ MACHINE_CONFIG_START(chessmst_state::chessmsta)
MCFG_DEVICE_IO_MAP(chessmst_io)
MCFG_Z80_DAISY_CHAIN(chessmst_daisy_chain)
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, 8_MHz_XTAL/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, chessmst_state, pio1_port_a_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, chessmst_state, pio1_port_b_w))
+ z80pio_device& pio1(Z80PIO(config, "z80pio1", 8_MHz_XTAL/4));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio1.out_pa_callback().set(FUNC(chessmst_state::pio1_port_a_w));
+ pio1.out_pb_callback().set(FUNC(chessmst_state::pio1_port_b_w));
- MCFG_DEVICE_ADD("z80pio2", Z80PIO, 8_MHz_XTAL/4)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, chessmst_state, pio2_port_a_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, chessmst_state, pio2_port_b_w))
+ Z80PIO(config, m_pia2, 8_MHz_XTAL/4);
+ m_pia2->in_pa_callback().set(FUNC(chessmst_state::pio2_port_a_r));
+ m_pia2->out_pb_callback().set(FUNC(chessmst_state::pio2_port_b_w));
config.set_default_layout(layout_chessmst);
@@ -436,15 +436,15 @@ MACHINE_CONFIG_START(chessmst_state::chessmstdm)
MCFG_DEVICE_IO_MAP(chessmstdm_io)
MCFG_Z80_DAISY_CHAIN(chessmstdm_daisy_chain)
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, 8_MHz_XTAL/4)
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, chessmst_state, pio1_port_a_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, chessmst_state, pio1_port_b_dm_w))
- MCFG_Z80PIO_IN_PB_CB(IOPORT("EXTRA"))
+ z80pio_device& pio1(Z80PIO(config, "z80pio1", 8_MHz_XTAL/4));
+ pio1.out_pa_callback().set(FUNC(chessmst_state::pio1_port_a_w));
+ pio1.out_pb_callback().set(FUNC(chessmst_state::pio1_port_b_dm_w));
+ pio1.in_pb_callback().set_ioport("EXTRA");
- MCFG_DEVICE_ADD("z80pio2", Z80PIO, 8_MHz_XTAL/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, chessmst_state, pio2_port_a_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, chessmst_state, pio2_port_b_w))
+ Z80PIO(config, m_pia2, 8_MHz_XTAL/4);
+ m_pia2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pia2->in_pa_callback().set(FUNC(chessmst_state::pio2_port_a_r));
+ m_pia2->out_pb_callback().set(FUNC(chessmst_state::pio2_port_b_w));
config.set_default_layout(layout_chessmstdm);
diff --git a/src/mame/drivers/czk80.cpp b/src/mame/drivers/czk80.cpp
index 725299bd79a..d3ebf864f1f 100644
--- a/src/mame/drivers/czk80.cpp
+++ b/src/mame/drivers/czk80.cpp
@@ -209,8 +209,8 @@ MACHINE_CONFIG_START(czk80_state::czk80)
//MCFG_Z80DART_OUT_RTSA_CB(WRITELINE("rs232", rs232_port_device, write_rts))
MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(16'000'000)/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ z80pio_device& pio(Z80PIO(config, "pio", XTAL(16'000'000)/4));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dmax8000.cpp b/src/mame/drivers/dmax8000.cpp
index 8e2bb019f5d..0dfadd4f1c3 100644
--- a/src/mame/drivers/dmax8000.cpp
+++ b/src/mame/drivers/dmax8000.cpp
@@ -185,11 +185,11 @@ MACHINE_CONFIG_START(dmax8000_state::dmax8000)
MCFG_DEVICE_ADD("dart2", Z80DART, 4'000'000) // RS232 ports
- MCFG_DEVICE_ADD("pio1", Z80PIO, 4'000'000)
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, dmax8000_state, port0c_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, dmax8000_state, port0d_w))
+ z80pio_device& pio1(Z80PIO(config, "pio1", 4'000'000));
+ pio1.out_pa_callback().set(FUNC(dmax8000_state::port0c_w));
+ pio1.out_pb_callback().set(FUNC(dmax8000_state::port0d_w));
- MCFG_DEVICE_ADD("pio2", Z80PIO, 4'000'000)
+ Z80PIO(config, "pio2", 4'000'000);
MCFG_DEVICE_ADD("fdc", FD1793, 2'000'000) // no idea
MCFG_WD_FDC_INTRQ_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp
index 0d90fd42ee4..ce680ac2deb 100644
--- a/src/mame/drivers/einstein.cpp
+++ b/src/mame/drivers/einstein.cpp
@@ -588,13 +588,13 @@ MACHINE_CONFIG_START(einstein_state::einstein)
driver. So we update at 50Hz and hope this is good enough. */
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", einstein_state, keyboard_timer_callback, attotime::from_hz(50))
- MCFG_DEVICE_ADD(IC_I063, Z80PIO, XTAL_X002 / 2)
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, einstein_state, int_w<0>))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, einstein_state, ardy_w))
- MCFG_Z80PIO_IN_PB_CB(READ8("user", einstein_userport_device, read))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8("user", einstein_userport_device, write))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE("user", einstein_userport_device, brdy_w))
+ z80pio_device& pio(Z80PIO(config, IC_I063, XTAL_X002 / 2));
+ pio.out_int_callback().set(FUNC(einstein_state::int_w<0>));
+ pio.out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ pio.out_ardy_callback().set(FUNC(einstein_state::ardy_w));
+ pio.in_pb_callback().set("user", FUNC(einstein_userport_device::read));
+ pio.out_pb_callback().set("user", FUNC(einstein_userport_device::write));
+ pio.out_brdy_callback().set("user", FUNC(einstein_userport_device::brdy_w));
MCFG_DEVICE_ADD(IC_I058, Z80CTC, XTAL_X002 / 2)
MCFG_Z80CTC_INTR_CB(WRITELINE(*this, einstein_state, int_w<1>))
diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp
index f0a02bbb372..7af9e8f97be 100644
--- a/src/mame/drivers/fidelz80.cpp
+++ b/src/mame/drivers/fidelz80.cpp
@@ -1760,10 +1760,10 @@ MACHINE_CONFIG_START(fidelz80_state::vsc)
MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, fidelz80_state, vsc_ppi_portb_w))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fidelz80_state, vsc_ppi_portc_w))
- MCFG_DEVICE_ADD("z80pio", Z80PIO, 3.9_MHz_XTAL)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, fidelz80_state, vsc_pio_porta_r))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, fidelz80_state, vsc_pio_portb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, fidelz80_state, vsc_pio_portb_w))
+ Z80PIO(config, m_z80pio, 3.9_MHz_XTAL);
+ m_z80pio->in_pa_callback().set(FUNC(fidelz80_state::vsc_pio_porta_r));
+ m_z80pio->in_pb_callback().set(FUNC(fidelz80_state::vsc_pio_portb_r));
+ m_z80pio->out_pb_callback().set(FUNC(fidelz80_state::vsc_pio_portb_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
config.set_default_layout(layout_fidel_vsc);
diff --git a/src/mame/drivers/hazelgr.cpp b/src/mame/drivers/hazelgr.cpp
index 9fa626940b0..b2b4f41335b 100644
--- a/src/mame/drivers/hazelgr.cpp
+++ b/src/mame/drivers/hazelgr.cpp
@@ -97,15 +97,15 @@ MACHINE_CONFIG_START(haze_state::haze)
MCFG_DEVICE_ADD("ctc3", Z80CTC, 1'000'000 )
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("pio1", Z80PIO, 1'000'000 )
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(IOPORT("TEST"))
+ z80pio_device& pio1(Z80PIO(config, "pio1", 1'000'000));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio1.in_pa_callback().set_ioport("TEST");
- MCFG_DEVICE_ADD("pio2", Z80PIO, 1'000'000 )
+ Z80PIO(config, "pio2", 1'000'000);
- MCFG_DEVICE_ADD("pio3", Z80PIO, 1'000'000 )
+ Z80PIO(config, "pio3", 1'000'000);
- MCFG_DEVICE_ADD("pio4", Z80PIO, 1'000'000 )
+ Z80PIO(config, "pio4", 1'000'000);
MACHINE_CONFIG_END
ROM_START( hg_frd )
diff --git a/src/mame/drivers/huebler.cpp b/src/mame/drivers/huebler.cpp
index 32ff93fa4b5..f3f64d746ce 100644
--- a/src/mame/drivers/huebler.cpp
+++ b/src/mame/drivers/huebler.cpp
@@ -335,11 +335,11 @@ MACHINE_CONFIG_START(amu880_state::amu880)
MCFG_Z80CTC_ZC1_CB(WRITELINE(Z80SIO_TAG, z80dart_device, rxtxcb_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, amu880_state, ctc_z2_w))
- MCFG_DEVICE_ADD(Z80PIO1_TAG, Z80PIO, XTAL(10'000'000)/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio1(Z80PIO(config, Z80PIO1_TAG, XTAL(10'000'000)/4));
+ pio1.out_int_callback().set_inputline(Z80_TAG, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD(Z80PIO2_TAG, Z80PIO, XTAL(10'000'000)/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio2(Z80PIO(config, Z80PIO2_TAG, XTAL(10'000'000)/4));
+ pio2.out_int_callback().set_inputline(Z80_TAG, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(Z80SIO_TAG, Z80SIO0, XTAL(10'000'000)/4) // U856
MCFG_Z80DART_OUT_TXDA_CB(WRITELINE(*this, amu880_state, cassette_w))
diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp
index 4d673d07a4f..89bb34163a9 100644
--- a/src/mame/drivers/jupace.cpp
+++ b/src/mame/drivers/jupace.cpp
@@ -797,11 +797,11 @@ MACHINE_CONFIG_START(ace_state::ace)
MCFG_I8255_IN_PORTB_CB(READ8(*this, ace_state, sby_r))
MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ace_state, ald_w))
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(6'500'000)/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, ace_state, pio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, ace_state, pio_pa_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
+ Z80PIO(config, m_z80pio, XTAL(6'500'000)/2);
+ m_z80pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_z80pio->in_pa_callback().set(FUNC(ace_state::pio_pa_r));
+ m_z80pio->out_pa_callback().set(FUNC(ace_state::pio_pa_w));
+ m_z80pio->out_pb_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG)
diff --git a/src/mame/drivers/kaypro.cpp b/src/mame/drivers/kaypro.cpp
index 27a26ff0b95..33b2ebc14e7 100644
--- a/src/mame/drivers/kaypro.cpp
+++ b/src/mame/drivers/kaypro.cpp
@@ -246,14 +246,14 @@ MACHINE_CONFIG_START(kaypro_state::kayproii)
brg.ft_handler().append("sio", FUNC(z80sio_device::txca_w));
brg.fr_handler().set("sio", FUNC(z80sio_device::rxtxcb_w));
- MCFG_DEVICE_ADD("z80pio_g", Z80PIO, 20_MHz_XTAL / 8)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
+ Z80PIO(config, m_pio_g, 20_MHz_XTAL / 8);
+ m_pio_g->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio_g->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
- MCFG_DEVICE_ADD("z80pio_s", Z80PIO, 20_MHz_XTAL / 8)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, kaypro_state, pio_system_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, kaypro_state, kayproii_pio_system_w))
+ Z80PIO(config, m_pio_s, 20_MHz_XTAL / 8);
+ m_pio_s->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio_s->in_pa_callback().set(FUNC(kaypro_state::pio_system_r));
+ m_pio_s->out_pa_callback().set(FUNC(kaypro_state::kayproii_pio_system_w));
z80sio_device& sio(Z80SIO(config, "sio", 20_MHz_XTAL / 8));
sio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
@@ -275,11 +275,8 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(kaypro_state::kayproiv)
kayproii(config);
- MCFG_DEVICE_REMOVE("z80pio_s")
- MCFG_DEVICE_ADD("z80pio_s", Z80PIO, 2500000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, kaypro_state, pio_system_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, kaypro_state, kayproiv_pio_system_w))
+ m_pio_s->set_clock(2500000);
+ m_pio_s->out_pa_callback().set(FUNC(kaypro_state::kayproiv_pio_system_w));
MCFG_DEVICE_REMOVE("fdc:0")
MCFG_DEVICE_REMOVE("fdc:1")
MCFG_FLOPPY_DRIVE_ADD("fdc:0", kaypro_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mame/drivers/kc.cpp b/src/mame/drivers/kc.cpp
index 35065d147e7..176627250e8 100644
--- a/src/mame/drivers/kc.cpp
+++ b/src/mame/drivers/kc.cpp
@@ -104,14 +104,14 @@ MACHINE_CONFIG_START(kc_state::kc85_3)
MCFG_Z80_DAISY_CHAIN(kc85_daisy_chain)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- MCFG_DEVICE_ADD("z80pio", Z80PIO, KC85_3_CLOCK)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, kc_state, pio_porta_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, kc_state, pio_porta_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, kc_state, pio_ardy_cb))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, kc_state, pio_portb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, kc_state, pio_portb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, kc_state, pio_brdy_cb))
+ Z80PIO(config, m_z80pio, KC85_3_CLOCK);
+ m_z80pio->out_int_callback().set_inputline(m_maincpu, 0);
+ m_z80pio->in_pa_callback().set(FUNC(kc_state::pio_porta_r));
+ m_z80pio->out_pa_callback().set(FUNC(kc_state::pio_porta_w));
+ m_z80pio->out_ardy_callback().set(FUNC(kc_state::pio_ardy_cb));
+ m_z80pio->in_pb_callback().set(FUNC(kc_state::pio_portb_r));
+ m_z80pio->out_pb_callback().set(FUNC(kc_state::pio_portb_w));
+ m_z80pio->out_brdy_callback().set(FUNC(kc_state::pio_brdy_cb));
MCFG_DEVICE_ADD("z80ctc", Z80CTC, KC85_3_CLOCK)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", 0))
@@ -185,14 +185,14 @@ MACHINE_CONFIG_START(kc85_4_state::kc85_4)
MCFG_Z80_DAISY_CHAIN(kc85_daisy_chain)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- MCFG_DEVICE_ADD("z80pio", Z80PIO, KC85_4_CLOCK)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, kc_state, pio_porta_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, kc_state, pio_porta_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, kc_state, pio_ardy_cb))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, kc_state, pio_portb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, kc_state, pio_portb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, kc_state, pio_brdy_cb))
+ Z80PIO(config, m_z80pio, KC85_4_CLOCK);
+ m_z80pio->out_int_callback().set_inputline(m_maincpu, 0);
+ m_z80pio->in_pa_callback().set(FUNC(kc_state::pio_porta_r));
+ m_z80pio->out_pa_callback().set(FUNC(kc_state::pio_porta_w));
+ m_z80pio->out_ardy_callback().set(FUNC(kc_state::pio_ardy_cb));
+ m_z80pio->in_pb_callback().set(FUNC(kc_state::pio_portb_r));
+ m_z80pio->out_pb_callback().set(FUNC(kc_state::pio_portb_w));
+ m_z80pio->out_brdy_callback().set(FUNC(kc_state::pio_brdy_cb));
MCFG_DEVICE_ADD("z80ctc", Z80CTC, KC85_4_CLOCK)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", 0))
diff --git a/src/mame/drivers/kramermc.cpp b/src/mame/drivers/kramermc.cpp
index 0d9337fe5fa..143c453aa6f 100644
--- a/src/mame/drivers/kramermc.cpp
+++ b/src/mame/drivers/kramermc.cpp
@@ -117,10 +117,10 @@ MACHINE_CONFIG_START(kramermc_state::kramermc)
MCFG_DEVICE_PROGRAM_MAP(kramermc_mem)
MCFG_DEVICE_IO_MAP(kramermc_io)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, 1500000)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, kramermc_state, kramermc_port_a_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, kramermc_state, kramermc_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, kramermc_state, kramermc_port_b_r))
+ z80pio_device& pio(Z80PIO(config, "z80pio", 1500000));
+ pio.in_pa_callback().set(FUNC(kramermc_state::kramermc_port_a_r));
+ pio.out_pa_callback().set(FUNC(kramermc_state::kramermc_port_a_w));
+ pio.in_pb_callback().set(FUNC(kramermc_state::kramermc_port_b_r));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/lc80.cpp b/src/mame/drivers/lc80.cpp
index b8fe5530823..03723b879ee 100644
--- a/src/mame/drivers/lc80.cpp
+++ b/src/mame/drivers/lc80.cpp
@@ -351,15 +351,15 @@ MACHINE_CONFIG_START(lc80_state::lc80)
MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, lc80_state, ctc_z1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, lc80_state, ctc_z2_w))
- MCFG_DEVICE_ADD(Z80PIO1_TAG, Z80PIO, 900000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, lc80_state, pio1_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, lc80_state, pio1_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, lc80_state, pio1_pb_w))
+ z80pio_device& pio1(Z80PIO(config, Z80PIO1_TAG, 900000));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio1.out_pa_callback().set(FUNC(lc80_state::pio1_pa_w));
+ pio1.in_pb_callback().set(FUNC(lc80_state::pio1_pb_r));
+ pio1.out_pb_callback().set(FUNC(lc80_state::pio1_pb_w));
- MCFG_DEVICE_ADD(Z80PIO2_TAG, Z80PIO, 900000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, lc80_state, pio2_pb_r))
+ Z80PIO(config, m_pio2, 900000);
+ m_pio2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio2->in_pb_callback().set(FUNC(lc80_state::pio2_pb_r));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED)
@@ -388,15 +388,15 @@ MACHINE_CONFIG_START(lc80_state::lc80_2)
MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, lc80_state, ctc_z1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, lc80_state, ctc_z2_w))
- MCFG_DEVICE_ADD(Z80PIO1_TAG, Z80PIO, 900000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, lc80_state, pio1_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, lc80_state, pio1_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, lc80_state, pio1_pb_w))
+ z80pio_device& pio1(Z80PIO(config, Z80PIO1_TAG, 900000));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio1.out_pa_callback().set(FUNC(lc80_state::pio1_pa_w));
+ pio1.in_pb_callback().set(FUNC(lc80_state::pio1_pb_r));
+ pio1.out_pb_callback().set(FUNC(lc80_state::pio1_pb_w));
- MCFG_DEVICE_ADD(Z80PIO2_TAG, Z80PIO, 900000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, lc80_state, pio2_pb_r))
+ Z80PIO(config, m_pio2, 900000);
+ m_pio2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio2->in_pb_callback().set(FUNC(lc80_state::pio2_pb_r));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED)
diff --git a/src/mame/drivers/llc.cpp b/src/mame/drivers/llc.cpp
index c6056525986..06cf7bd8b95 100644
--- a/src/mame/drivers/llc.cpp
+++ b/src/mame/drivers/llc.cpp
@@ -223,14 +223,14 @@ MACHINE_CONFIG_START(llc_state::llc1)
MCFG_PALETTE_ADD_MONOCHROME("palette")
config.set_default_layout(layout_llc1);
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, XTAL(3'000'000))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, llc_state, llc1_port1_a_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, llc_state, llc1_port1_a_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, llc_state, llc1_port1_b_w))
+ z80pio_device& pio1(Z80PIO(config, "z80pio1", XTAL(3'000'000)));
+ pio1.in_pa_callback().set(FUNC(llc_state::llc1_port1_a_r));
+ pio1.out_pa_callback().set(FUNC(llc_state::llc1_port1_a_w));
+ pio1.out_pb_callback().set(FUNC(llc_state::llc1_port1_b_w));
- MCFG_DEVICE_ADD("z80pio2", Z80PIO, XTAL(3'000'000))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, llc_state, llc1_port2_a_r))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, llc_state, llc1_port2_b_r))
+ z80pio_device& pio2(Z80PIO(config, "z80pio2", XTAL(3'000'000)));
+ pio2.in_pa_callback().set(FUNC(llc_state::llc1_port2_a_r));
+ pio2.in_pb_callback().set(FUNC(llc_state::llc1_port2_b_r));
MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL(3'000'000))
// timer 0 irq does digit display, and timer 3 irq does scan of the
@@ -270,13 +270,13 @@ MACHINE_CONFIG_START(llc_state::llc2)
MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, XTAL(3'000'000))
- MCFG_Z80PIO_IN_PA_CB(READ8(K7659_KEYBOARD_TAG, k7659_keyboard_device, read))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, llc_state, llc2_port1_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, llc_state, llc2_port1_b_w))
+ z80pio_device& pio1(Z80PIO(config, "z80pio1", XTAL(3'000'000)));
+ pio1.in_pa_callback().set(K7659_KEYBOARD_TAG, FUNC(k7659_keyboard_device::read));
+ pio1.in_pb_callback().set(FUNC(llc_state::llc2_port1_b_r));
+ pio1.out_pb_callback().set(FUNC(llc_state::llc2_port1_b_w));
- MCFG_DEVICE_ADD("z80pio2", Z80PIO, XTAL(3'000'000))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, llc_state, llc2_port2_a_r))
+ z80pio_device& pio2(Z80PIO(config, "z80pio2", XTAL(3'000'000)));
+ pio2.in_pa_callback().set(FUNC(llc_state::llc2_port2_a_r));
MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL(3'000'000))
diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp
index dbe2515160e..6c71e6a1263 100644
--- a/src/mame/drivers/mbee.cpp
+++ b/src/mame/drivers/mbee.cpp
@@ -654,12 +654,12 @@ MACHINE_CONFIG_START(mbee_state::mbee)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, 12_MHz_XTAL / 6)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, mbee_state, pio_ardy))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, mbee_state, pio_port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, mbee_state, pio_port_b_w))
+ Z80PIO(config, m_pio, 12_MHz_XTAL / 6);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_pio->out_ardy_callback().set(FUNC(mbee_state::pio_ardy));
+ m_pio->in_pb_callback().set(FUNC(mbee_state::pio_port_b_r));
+ m_pio->out_pb_callback().set(FUNC(mbee_state::pio_port_b_w));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(50)
@@ -711,12 +711,12 @@ MACHINE_CONFIG_START(mbee_state::mbeeic)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, 3375000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, mbee_state, pio_ardy))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, mbee_state, pio_port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, mbee_state, pio_port_b_w))
+ Z80PIO(config, m_pio, 3375000);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_pio->out_ardy_callback().set(FUNC(mbee_state::pio_ardy));
+ m_pio->in_pb_callback().set(FUNC(mbee_state::pio_port_b_r));
+ m_pio->out_pb_callback().set(FUNC(mbee_state::pio_port_b_w));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(50)
@@ -749,7 +749,7 @@ MACHINE_CONFIG_START(mbee_state::mbeeic)
MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2)
MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer")
- MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("z80pio", z80pio_device, strobe_a))
+ MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(m_pio, z80pio_device, strobe_a))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
diff --git a/src/mame/drivers/mc8020.cpp b/src/mame/drivers/mc8020.cpp
index ac848e7c1f9..70a23be711e 100644
--- a/src/mame/drivers/mc8020.cpp
+++ b/src/mame/drivers/mc8020.cpp
@@ -316,10 +316,10 @@ MACHINE_CONFIG_START(mc8020_state::mc8020)
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* devices */
- MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(2'457'600))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, mc8020_state, port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, mc8020_state, port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, mc8020_state, port_b_w))
+ z80pio_device& pio(Z80PIO(config, "pio", XTAL(2'457'600)));
+ pio.out_pa_callback().set(FUNC(mc8020_state::port_a_w));
+ pio.in_pb_callback().set(FUNC(mc8020_state::port_b_r));
+ pio.out_pb_callback().set(FUNC(mc8020_state::port_b_w));
MCFG_DEVICE_ADD("ctc_clock", CLOCK, XTAL(2'457'600) / 64) // guess
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg2))
diff --git a/src/mame/drivers/mc8030.cpp b/src/mame/drivers/mc8030.cpp
index be216b3e7df..7cc5140cdd1 100644
--- a/src/mame/drivers/mc8030.cpp
+++ b/src/mame/drivers/mc8030.cpp
@@ -203,23 +203,23 @@ MACHINE_CONFIG_START(mc8030_state::mc8030)
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* Devices */
- MCFG_DEVICE_ADD("zve_pio", Z80PIO, XTAL(2'457'600))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, mc8030_state, zve_port_a_r))
- //MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, mc8030_state, zve_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, mc8030_state, zve_port_b_r))
- //MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, mc8030_state, zve_port_b_w))
+ z80pio_device& zve_pio(Z80PIO(config, "zve_pio", XTAL(2'457'600)));
+ zve_pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ zve_pio.in_pa_callback().set(FUNC(mc8030_state::zve_port_a_r));
+ //zve_pio.out_pa_callback().set(FUNC(mc8030_state::zve_port_a_w));
+ zve_pio.in_pb_callback().set(FUNC(mc8030_state::zve_port_b_r));
+ //zve_pio.out_pb_callback().set(FUNC(mc8030_state::zve_port_b_w));
MCFG_DEVICE_ADD("zve_ctc", Z80CTC, XTAL(2'457'600))
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
// ZC0, ZC1, ZC2 for user
- MCFG_DEVICE_ADD("asp_pio", Z80PIO, XTAL(2'457'600))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, mc8030_state, asp_port_a_r))
- //MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, mc8030_state, asp_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, mc8030_state, asp_port_b_r))
- //MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, mc8030_state, asp_port_b_w))
+ z80pio_device& asp_pio(Z80PIO(config, "asp_pio", XTAL(2'457'600)));
+ asp_pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ asp_pio.in_pa_callback().set(FUNC(mc8030_state::asp_port_a_r));
+ //asp_pio.out_pa_callback().set(FUNC(mc8030_state::asp_port_a_w));
+ asp_pio.in_pb_callback().set(FUNC(mc8030_state::asp_port_b_r));
+ //asp_pio.out_pb_callback().set(FUNC(mc8030_state::asp_port_b_w));
MCFG_DEVICE_ADD("asp_ctc", Z80CTC, XTAL(2'457'600))
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/mccpm.cpp b/src/mame/drivers/mccpm.cpp
index 302c89cc0c0..abff5e29dcb 100644
--- a/src/mame/drivers/mccpm.cpp
+++ b/src/mame/drivers/mccpm.cpp
@@ -101,7 +101,7 @@ MACHINE_CONFIG_START(mccpm_state::mccpm)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio", z80sio_device, rxa_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio", z80sio_device, ctsa_w))
- MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(4'000'000))
+ Z80PIO(config, "pio", XTAL(4'000'000));
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/mcr.cpp b/src/mame/drivers/mcr.cpp
index 7d091ae8232..9aad9555e92 100644
--- a/src/mame/drivers/mcr.cpp
+++ b/src/mame/drivers/mcr.cpp
@@ -1878,7 +1878,7 @@ MACHINE_CONFIG_START(mcr_nflfoot_state::mcr_91490_ipu)
mcr_91490_snt(config);
/* basic machine hardware */
- MCFG_DEVICE_ADD("ipu", Z80, 7372800/2)
+ MCFG_DEVICE_ADD(m_ipu, Z80, 7372800/2)
MCFG_Z80_DAISY_CHAIN(mcr_ipu_daisy_chain)
MCFG_DEVICE_PROGRAM_MAP(ipu_91695_map)
MCFG_DEVICE_IO_MAP(ipu_91695_portmap)
@@ -1888,11 +1888,11 @@ MACHINE_CONFIG_START(mcr_nflfoot_state::mcr_91490_ipu)
MCFG_DEVICE_ADD("ipu_ctc", Z80CTC, 7372800/2 /* same as "ipu" */)
MCFG_Z80CTC_INTR_CB(INPUTLINE("ipu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("ipu_pio0", Z80PIO, 7372800/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("ipu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_ipu_pio0, 7372800/2);
+ m_ipu_pio0->out_int_callback().set_inputline(m_ipu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("ipu_pio1", Z80PIO, 7372800/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("ipu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_ipu_pio1, 7372800/2);
+ m_ipu_pio1->out_int_callback().set_inputline(m_ipu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD("ipu_sio", Z80SIO0, 7372800/2)
MCFG_Z80DART_OUT_INT_CB(INPUTLINE("ipu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/mes.cpp b/src/mame/drivers/mes.cpp
index d6d3a8ed9de..04f6a0c5193 100644
--- a/src/mame/drivers/mes.cpp
+++ b/src/mame/drivers/mes.cpp
@@ -148,8 +148,8 @@ MACHINE_CONFIG_START(mes_state::mes)
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_DEVICE_ADD("ctc", Z80CTC, 0)
- MCFG_DEVICE_ADD("pio", Z80PIO, 0)
+ Z80CTC(config, "ctc", 0);
+ Z80PIO(config, "pio", 0);
Z80SIO(config, "sio", 0);
MCFG_DEVICE_ADD("keybd", GENERIC_KEYBOARD, 0)
diff --git a/src/mame/drivers/mpf1.cpp b/src/mame/drivers/mpf1.cpp
index fedc0334e2f..0acdf1726bf 100644
--- a/src/mame/drivers/mpf1.cpp
+++ b/src/mame/drivers/mpf1.cpp
@@ -365,8 +365,8 @@ MACHINE_CONFIG_START(mpf1_state::mpf1)
MCFG_Z80_DAISY_CHAIN(mpf1_daisy_chain)
/* devices */
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(3'579'545)/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio(Z80PIO(config, Z80PIO_TAG, XTAL(3'579'545)/2));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, XTAL(3'579'545)/2)
MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
@@ -399,8 +399,8 @@ MACHINE_CONFIG_START(mpf1_state::mpf1b)
MCFG_Z80_DAISY_CHAIN(mpf1_daisy_chain)
/* devices */
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(3'579'545)/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio(Z80PIO(config, Z80PIO_TAG, XTAL(3'579'545)/2));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, XTAL(3'579'545)/2)
MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
@@ -439,8 +439,8 @@ MACHINE_CONFIG_START(mpf1_state::mpf1p)
config.set_default_layout(layout_mpf1p);
/* devices */
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 2500000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio(Z80PIO(config, Z80PIO_TAG, 2500000));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, 2500000)
MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/mz2000.cpp b/src/mame/drivers/mz2000.cpp
index c445b16681d..b56e84163df 100644
--- a/src/mame/drivers/mz2000.cpp
+++ b/src/mame/drivers/mz2000.cpp
@@ -889,10 +889,10 @@ MACHINE_CONFIG_START(mz2000_state::mz2000)
MCFG_I8255_IN_PORTC_CB(READ8(*this, mz2000_state, mz2000_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz2000_state, mz2000_portc_w))
- MCFG_DEVICE_ADD("z80pio_1", Z80PIO, MASTER_CLOCK)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, mz2000_state, mz2000_pio1_porta_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, mz2000_state, mz2000_pio1_porta_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, mz2000_state, mz2000_pio1_portb_r))
+ z80pio_device& pio(Z80PIO(config, "z80pio_1", MASTER_CLOCK));
+ pio.in_pa_callback().set(FUNC(mz2000_state::mz2000_pio1_porta_r));
+ pio.out_pa_callback().set(FUNC(mz2000_state::mz2000_pio1_porta_w));
+ pio.in_pb_callback().set(FUNC(mz2000_state::mz2000_pio1_portb_r));
/* TODO: clocks aren't known */
MCFG_DEVICE_ADD("pit", PIT8253, 0)
diff --git a/src/mame/drivers/mz2500.cpp b/src/mame/drivers/mz2500.cpp
index 5f6a73b9b83..e48dc84b0cd 100644
--- a/src/mame/drivers/mz2500.cpp
+++ b/src/mame/drivers/mz2500.cpp
@@ -1814,10 +1814,10 @@ MACHINE_CONFIG_START(mz2500_state::mz2500)
MCFG_I8255_IN_PORTC_CB(READ8(*this, mz2500_state, mz2500_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz2500_state, mz2500_portc_w))
- MCFG_DEVICE_ADD("z80pio_1", Z80PIO, 6000000)
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, mz2500_state, mz2500_pio1_porta_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, mz2500_state, mz2500_pio1_porta_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, mz2500_state, mz2500_pio1_porta_r))
+ z80pio_device& pio(Z80PIO(config, "z80pio_1", 6000000));
+ pio.in_pa_callback().set(FUNC(mz2500_state::mz2500_pio1_porta_r));
+ pio.out_pa_callback().set(FUNC(mz2500_state::mz2500_pio1_porta_w));
+ pio.in_pb_callback().set(FUNC(mz2500_state::mz2500_pio1_porta_r));
Z80SIO(config, "z80sio", 6000000);
diff --git a/src/mame/drivers/mz700.cpp b/src/mame/drivers/mz700.cpp
index 66e672bfe01..22e17fae496 100644
--- a/src/mame/drivers/mz700.cpp
+++ b/src/mame/drivers/mz700.cpp
@@ -456,11 +456,11 @@ MACHINE_CONFIG_START(mz_state::mz800)
MCFG_DEVICE_MODIFY("pit8253")
MCFG_PIT8253_CLK0(XTAL(17'734'470)/16)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(17'734'470)/5)
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, mz_state, mz800_z80pio_irq))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, mz_state, mz800_z80pio_port_a_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, mz_state, mz800_z80pio_port_a_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
+ z80pio_device& pio(Z80PIO(config, "z80pio", XTAL(17'734'470)/5));
+ pio.out_int_callback().set(FUNC(mz_state::mz800_z80pio_irq));
+ pio.in_pa_callback().set(FUNC(mz_state::mz800_z80pio_port_a_r));
+ pio.out_pa_callback().set(FUNC(mz_state::mz800_z80pio_port_a_w));
+ pio.out_pb_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
diff --git a/src/mame/drivers/nanos.cpp b/src/mame/drivers/nanos.cpp
index bb1199b1108..6f861789bd2 100644
--- a/src/mame/drivers/nanos.cpp
+++ b/src/mame/drivers/nanos.cpp
@@ -497,11 +497,11 @@ MACHINE_CONFIG_START(nanos_state::nanos)
MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, nanos_state, ctc_z1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, nanos_state, ctc_z2_w))
- MCFG_DEVICE_ADD(m_pio_0, Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio_0, XTAL(4'000'000));
+ m_pio_0->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD(m_pio_1, Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio_1, XTAL(4'000'000));
+ m_pio_1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
Z80SIO(config, m_sio_0, XTAL(4'000'000));
m_sio_0->out_int_callback().set(FUNC(nanos_state::z80daisy_interrupt));
@@ -509,10 +509,10 @@ MACHINE_CONFIG_START(nanos_state::nanos)
Z80SIO(config, m_sio_1, XTAL(4'000'000));
m_sio_1->out_int_callback().set(FUNC(nanos_state::z80daisy_interrupt));
- MCFG_DEVICE_ADD(m_pio, Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, nanos_state, port_a_r))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, nanos_state, port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, nanos_state, port_b_w))
+ Z80PIO(config, m_pio, XTAL(4'000'000));
+ m_pio->in_pa_callback().set(FUNC(nanos_state::port_a_r));
+ m_pio->in_pb_callback().set(FUNC(nanos_state::port_b_r));
+ m_pio->out_pb_callback().set(FUNC(nanos_state::port_b_w));
/* UPD765 */
MCFG_UPD765A_ADD(m_fdc, false, true)
diff --git a/src/mame/drivers/nascom1.cpp b/src/mame/drivers/nascom1.cpp
index 472c3071bbc..c2b2f0f8faf 100644
--- a/src/mame/drivers/nascom1.cpp
+++ b/src/mame/drivers/nascom1.cpp
@@ -690,7 +690,7 @@ MACHINE_CONFIG_START(nascom_state::nascom)
MCFG_CASSETTE_ADD("cassette")
// pio
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(16'000'000)/8)
+ Z80PIO(config, "z80pio", XTAL(16'000'000)/8);
// internal extra ram
RAM(config, m_ram).set_default_size("48K").set_extra_options("8K,16K,32K");
diff --git a/src/mame/drivers/onyx.cpp b/src/mame/drivers/onyx.cpp
index fc08a2b0856..57b6addba5b 100644
--- a/src/mame/drivers/onyx.cpp
+++ b/src/mame/drivers/onyx.cpp
@@ -155,13 +155,13 @@ MACHINE_CONFIG_START(onyx_state::c8002)
sio1_clock.signal_handler().append(m_sio[0], FUNC(z80sio_device::txca_w));
/* peripheral hardware */
- MCFG_DEVICE_ADD("pio1", Z80PIO, XTAL(16'000'000)/4)
- //MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("pio2", Z80PIO, XTAL(16'000'000)/4)
- //MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("ctc1", Z80CTC, XTAL(16'000'000) /4)
- MCFG_DEVICE_ADD("ctc2", Z80CTC, XTAL(16'000'000) /4)
- MCFG_DEVICE_ADD("ctc3", Z80CTC, XTAL(16'000'000) /4)
+ Z80PIO(config, m_pio[0], XTAL(16'000'000)/4);
+ //m_pio[0]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ Z80PIO(config, m_pio[1], XTAL(16'000'000)/4);
+ //m_pio[1]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ Z80CTC(config, m_ctc[0], XTAL(16'000'000) /4);
+ Z80CTC(config, m_ctc[1], XTAL(16'000'000) /4);
+ Z80CTC(config, m_ctc[2], XTAL(16'000'000) /4);
Z80SIO(config, m_sio[0], XTAL(16'000'000) /4);
m_sio[0]->out_txda_callback().set("rs232", FUNC(rs232_port_device::write_txd));
m_sio[0]->out_dtra_callback().set("rs232", FUNC(rs232_port_device::write_dtr));
@@ -176,8 +176,9 @@ MACHINE_CONFIG_START(onyx_state::c8002)
MCFG_RS232_DCD_HANDLER(WRITELINE("sio1", z80sio_device, dcda_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio1", z80sio_device, ctsa_w))
- MCFG_DEVICE_ADD("pio1s", Z80PIO, XTAL(16'000'000)/4)
- //MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("subcpu", INPUT_LINE_IRQ0))
+ Z80PIO(config, "pio1s", XTAL(16'000'000)/4);
+ //z80pio_device& pio1s(Z80PIO(config, "pio1s", XTAL(16'000'000)/4));
+ //pio1s->out_int_callback().set_inputline("subcpu", INPUT_LINE_IRQ0);
clock_device &sio1s_clock(CLOCK(config, "sio1s_clock", 614400));
sio1s_clock.signal_handler().set("sio1s", FUNC(z80sio_device::rxtxcb_w));
@@ -261,13 +262,13 @@ MACHINE_CONFIG_START(onyx_state::c5000)
//MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(m_sio[0] ,z80sio_device, txca_w))
/* peripheral hardware */
- //MCFG_DEVICE_ADD("pio1", Z80PIO, XTAL(16'000'000)/4)
- //MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- //MCFG_DEVICE_ADD("pio2", Z80PIO, XTAL(16'000'000)/4)
- //MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- //MCFG_DEVICE_ADD("ctc1", Z80CTC, XTAL(16'000'000) /4)
- //MCFG_DEVICE_ADD("ctc2", Z80CTC, XTAL(16'000'000) /4)
- //MCFG_DEVICE_ADD("ctc3", Z80CTC, XTAL(16'000'000) /4)
+ //Z80PIO(config, m_pio[0], XTAL(16'000'000)/4);
+ //m_pio[0]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ //Z80PIO(config, m_pio[1], XTAL(16'000'000)/4);
+ //m_pio[1]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ //Z80CTC(config, m_ctc[0], XTAL(16'000'000) /4);
+ //Z80CTC(config, m_ctc[1], XTAL(16'000'000) /4);
+ //Z80CTC(config, m_ctc[2], XTAL(16'000'000) /4);
Z80SIO(config, m_sio[0], XTAL(16'000'000) /4);
m_sio[0]->out_txdb_callback().set("rs232", FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/p8k.cpp b/src/mame/drivers/p8k.cpp
index 4e94c0b5d90..5aa1240db72 100644
--- a/src/mame/drivers/p8k.cpp
+++ b/src/mame/drivers/p8k.cpp
@@ -461,15 +461,15 @@ MACHINE_CONFIG_START(p8k_state::p8k)
z80sio_device& sio1(Z80SIO(config, "sio1", XTAL(4'000'000)));
sio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("pio0", Z80PIO, 1229000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ z80pio_device& pio0(Z80PIO(config, "pio0", 1229000));
+ pio0.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("pio1", Z80PIO, 1229000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ z80pio_device& pio1(Z80PIO(config, "pio1", 1229000));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("pio2", Z80PIO, 1229000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(IOPORT("DSW"))
+ Z80PIO(config, m_pio2, 1229000);
+ m_pio2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio2->in_pa_callback().set_ioport("DSW");
MCFG_I8272A_ADD("i8272", true)
MCFG_UPD765_DRQ_CALLBACK(WRITELINE("dma", z80dma_device, rdy_w))
@@ -518,14 +518,14 @@ MACHINE_CONFIG_START(p8k_state::p8k_16)
z80sio_device& sio1(Z80SIO(config, "sio1", XTAL(4'000'000)));
sio1.out_int_callback().set(FUNC(p8k_state::p8k_16_daisy_interrupt));
- MCFG_DEVICE_ADD("pio0", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, p8k_state, p8k_16_daisy_interrupt))
+ z80pio_device& pio0(Z80PIO(config, "pio0", XTAL(4'000'000)));
+ pio0.out_int_callback().set(FUNC(p8k_state::p8k_16_daisy_interrupt));
- MCFG_DEVICE_ADD("pio1", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, p8k_state, p8k_16_daisy_interrupt))
+ z80pio_device& pio1(Z80PIO(config, "pio1", XTAL(4'000'000)));
+ pio1.out_int_callback().set(FUNC(p8k_state::p8k_16_daisy_interrupt));
- MCFG_DEVICE_ADD("pio2", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, p8k_state, p8k_16_daisy_interrupt))
+ Z80PIO(config, m_pio2, XTAL(4'000'000));
+ m_pio2->out_int_callback().set(FUNC(p8k_state::p8k_16_daisy_interrupt));
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/pasopia.cpp b/src/mame/drivers/pasopia.cpp
index 4876283539c..a2e8618584b 100644
--- a/src/mame/drivers/pasopia.cpp
+++ b/src/mame/drivers/pasopia.cpp
@@ -328,10 +328,10 @@ MACHINE_CONFIG_START(pasopia_state::pasopia)
MCFG_Z80CTC_ZC1_CB(WRITELINE("z80ctc", z80ctc_device, trg2))
MCFG_Z80CTC_ZC2_CB(WRITELINE("z80ctc", z80ctc_device, trg3))
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, pasopia_state, mux_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, pasopia_state, keyb_r))
+ Z80PIO(config, m_pio, XTAL(4'000'000));
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->out_pa_callback().set(FUNC(pasopia_state::mux_w));
+ m_pio->in_pb_callback().set(FUNC(pasopia_state::keyb_r));
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/pasopia7.cpp b/src/mame/drivers/pasopia7.cpp
index f356aa8ee58..81752f73fad 100644
--- a/src/mame/drivers/pasopia7.cpp
+++ b/src/mame/drivers/pasopia7.cpp
@@ -945,10 +945,10 @@ MACHINE_CONFIG_START(pasopia7_state::p7_base)
MCFG_Z80CTC_ZC1_CB(WRITELINE("z80ctc", z80ctc_device, trg2)) // beep interface
MCFG_Z80CTC_ZC2_CB(WRITELINE("z80ctc", z80ctc_device, trg3))
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, pasopia7_state, mux_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, pasopia7_state, keyb_r))
+ Z80PIO(config, m_pio, XTAL(4'000'000));
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->out_pa_callback().set(FUNC(pasopia7_state::mux_w));
+ m_pio->in_pb_callback().set(FUNC(pasopia7_state::keyb_r));
MCFG_DEVICE_ADD("ppi8255_0", I8255, 0)
MCFG_I8255_IN_PORTA_CB(READ8(*this, pasopia7_state, unk_r))
diff --git a/src/mame/drivers/pcm.cpp b/src/mame/drivers/pcm.cpp
index b7a75ad0afb..4f521bd362b 100644
--- a/src/mame/drivers/pcm.cpp
+++ b/src/mame/drivers/pcm.cpp
@@ -284,14 +284,14 @@ MACHINE_CONFIG_START(pcm_state::pcm)
MCFG_K7659_KEYBOARD_ADD()
MCFG_CASSETTE_ADD("cassette")
- MCFG_DEVICE_ADD("pio_u", Z80PIO, XTAL(10'000'000)/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
-
- MCFG_DEVICE_ADD("pio_s", Z80PIO, XTAL(10'000'000)/4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(K7659_KEYBOARD_TAG, k7659_keyboard_device, read))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, pcm_state, pcm_85_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, pcm_state, pcm_85_w))
+ Z80PIO(config, m_pio_u, XTAL(10'000'000)/4);
+ m_pio_u->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+
+ Z80PIO(config, m_pio_s, XTAL(10'000'000)/4);
+ m_pio_s->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio_s->in_pa_callback().set(K7659_KEYBOARD_TAG, FUNC(k7659_keyboard_device::read));
+ m_pio_s->in_pb_callback().set(FUNC(pcm_state::pcm_85_r));
+ m_pio_s->out_pb_callback().set(FUNC(pcm_state::pcm_85_w));
Z80SIO(config, "sio", XTAL(10'000'000) /4);
diff --git a/src/mame/drivers/poly880.cpp b/src/mame/drivers/poly880.cpp
index e9e13331aea..75a8e30aeb3 100644
--- a/src/mame/drivers/poly880.cpp
+++ b/src/mame/drivers/poly880.cpp
@@ -261,14 +261,14 @@ MACHINE_CONFIG_START(poly880_state::poly880)
MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, poly880_state, ctc_z1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(Z80CTC_TAG, z80ctc_device, trg3))
- MCFG_DEVICE_ADD(Z80PIO1_TAG, Z80PIO, XTAL(7'372'800)/16)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, poly880_state, pio1_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, poly880_state, pio1_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, poly880_state, pio1_pb_w))
-
- MCFG_DEVICE_ADD(Z80PIO2_TAG, Z80PIO, XTAL(7'372'800)/16)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio1(Z80PIO(config, Z80PIO1_TAG, XTAL(7'372'800)/16));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio1.out_pa_callback().set(FUNC(poly880_state::pio1_pa_w));
+ pio1.in_pb_callback().set(FUNC(poly880_state::pio1_pb_r));
+ pio1.out_pb_callback().set(FUNC(poly880_state::pio1_pb_w));
+
+ z80pio_device& pio2(Z80PIO(config, Z80PIO2_TAG, XTAL(7'372'800)/16));
+ pio2.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED)
diff --git a/src/mame/drivers/polyplay.cpp b/src/mame/drivers/polyplay.cpp
index 7f724b8d678..9e1f33e4674 100644
--- a/src/mame/drivers/polyplay.cpp
+++ b/src/mame/drivers/polyplay.cpp
@@ -292,12 +292,12 @@ MACHINE_CONFIG_START(polyplay_state::polyplay_zre)
MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, polyplay_state, ctc_zc1_w))
//MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, polyplay_state, ctc_zc2_w))
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, POLYPLAY_MAIN_CLOCK / 4) /* UB855D */
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80CPU_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, polyplay_state, pio_porta_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, polyplay_state, pio_porta_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, polyplay_state, pio_portb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, polyplay_state, pio_portb_w))
+ Z80PIO(config, m_z80pio, POLYPLAY_MAIN_CLOCK / 4); /* UB855D */
+ m_z80pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_z80pio->in_pa_callback().set(FUNC(polyplay_state::pio_porta_r));
+ m_z80pio->out_pa_callback().set(FUNC(polyplay_state::pio_porta_w));
+ m_z80pio->in_pb_callback().set(FUNC(polyplay_state::pio_portb_r));
+ m_z80pio->out_pb_callback().set(FUNC(polyplay_state::pio_portb_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/pro80.cpp b/src/mame/drivers/pro80.cpp
index 0a519b3057d..67643c7a06a 100644
--- a/src/mame/drivers/pro80.cpp
+++ b/src/mame/drivers/pro80.cpp
@@ -190,7 +190,7 @@ MACHINE_CONFIG_START(pro80_state::pro80)
/* Devices */
MCFG_CASSETTE_ADD( "cassette" )
- MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(4'000'000) / 2)
+ Z80PIO(config, "pio", XTAL(4'000'000) / 2);
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_p", pro80_state, timer_p, attotime::from_hz(40000)) // cass read
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/proconn.cpp b/src/mame/drivers/proconn.cpp
index c3b29977d27..443290a563c 100644
--- a/src/mame/drivers/proconn.cpp
+++ b/src/mame/drivers/proconn.cpp
@@ -272,50 +272,50 @@ MACHINE_CONFIG_START(proconn_state::proconn)
MCFG_DEVICE_IO_MAP(proconn_portmap)
MCFG_S16LF01_ADD("vfd",0)
- MCFG_DEVICE_ADD("z80pio_1", Z80PIO, 4000000) /* ?? Mhz */
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, proconn_state,pio_1_m_out_int_w))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, proconn_state, pio_1_m_in_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, proconn_state, pio_1_m_out_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, proconn_state, pio_1_m_out_ardy_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, proconn_state, pio_1_m_in_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, proconn_state, pio_1_m_out_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, proconn_state, pio_1_m_out_brdy_w))
-
- MCFG_DEVICE_ADD("z80pio_2", Z80PIO, 4000000) /* ?? Mhz */
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, proconn_state,pio_2_m_out_int_w))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, proconn_state, pio_2_m_in_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, proconn_state, pio_2_m_out_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, proconn_state, pio_2_m_out_ardy_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, proconn_state, pio_2_m_in_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, proconn_state, pio_2_m_out_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, proconn_state, pio_2_m_out_brdy_w))
-
- MCFG_DEVICE_ADD("z80pio_3", Z80PIO, 4000000) /* ?? Mhz */
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, proconn_state,pio_3_m_out_int_w))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, proconn_state, pio_3_m_in_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, proconn_state, pio_3_m_out_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, proconn_state, pio_3_m_out_ardy_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, proconn_state, pio_3_m_in_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, proconn_state, pio_3_m_out_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, proconn_state, pio_3_m_out_brdy_w))
-
- MCFG_DEVICE_ADD("z80pio_4", Z80PIO, 4000000) /* ?? Mhz */
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, proconn_state,pio_4_m_out_int_w))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, proconn_state, pio_4_m_in_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, proconn_state, pio_4_m_out_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, proconn_state, pio_4_m_out_ardy_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, proconn_state, pio_4_m_in_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, proconn_state, pio_4_m_out_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, proconn_state, pio_4_m_out_brdy_w))
-
- MCFG_DEVICE_ADD("z80pio_5", Z80PIO, 4000000) /* ?? Mhz */
- MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, proconn_state,pio_5_m_out_int_w))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, proconn_state, pio_5_m_in_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, proconn_state, pio_5_m_out_pa_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, proconn_state, pio_5_m_out_ardy_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, proconn_state, pio_5_m_in_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, proconn_state, pio_5_m_out_pb_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, proconn_state, pio_5_m_out_brdy_w))
+ Z80PIO(config, m_z80pio[0], 4000000); /* ?? Mhz */
+ m_z80pio[0]->out_int_callback().set(FUNC(proconn_state::pio_1_m_out_int_w));
+ m_z80pio[0]->in_pa_callback().set(FUNC(proconn_state::pio_1_m_in_pa_r));
+ m_z80pio[0]->out_pa_callback().set(FUNC(proconn_state::pio_1_m_out_pa_w));
+ m_z80pio[0]->out_ardy_callback().set(FUNC(proconn_state::pio_1_m_out_ardy_w));
+ m_z80pio[0]->in_pb_callback().set(FUNC(proconn_state::pio_1_m_in_pb_r));
+ m_z80pio[0]->out_pb_callback().set(FUNC(proconn_state::pio_1_m_out_pb_w));
+ m_z80pio[0]->out_brdy_callback().set(FUNC(proconn_state::pio_1_m_out_brdy_w));
+
+ Z80PIO(config, m_z80pio[1], 4000000); /* ?? Mhz */
+ m_z80pio[1]->out_int_callback().set(FUNC(proconn_state::pio_2_m_out_int_w));
+ m_z80pio[1]->in_pa_callback().set(FUNC(proconn_state::pio_2_m_in_pa_r));
+ m_z80pio[1]->out_pa_callback().set(FUNC(proconn_state::pio_2_m_out_pa_w));
+ m_z80pio[1]->out_ardy_callback().set(FUNC(proconn_state::pio_2_m_out_ardy_w));
+ m_z80pio[1]->in_pb_callback().set(FUNC(proconn_state::pio_2_m_in_pb_r));
+ m_z80pio[1]->out_pb_callback().set(FUNC(proconn_state::pio_2_m_out_pb_w));
+ m_z80pio[1]->out_brdy_callback().set(FUNC(proconn_state::pio_2_m_out_brdy_w));
+
+ Z80PIO(config, m_z80pio[2], 4000000); /* ?? Mhz */
+ m_z80pio[2]->out_int_callback().set(FUNC(proconn_state::pio_3_m_out_int_w));
+ m_z80pio[2]->in_pa_callback().set(FUNC(proconn_state::pio_3_m_in_pa_r));
+ m_z80pio[2]->out_pa_callback().set(FUNC(proconn_state::pio_3_m_out_pa_w));
+ m_z80pio[2]->out_ardy_callback().set(FUNC(proconn_state::pio_3_m_out_ardy_w));
+ m_z80pio[2]->in_pb_callback().set(FUNC(proconn_state::pio_3_m_in_pb_r));
+ m_z80pio[2]->out_pb_callback().set(FUNC(proconn_state::pio_3_m_out_pb_w));
+ m_z80pio[2]->out_brdy_callback().set(FUNC(proconn_state::pio_3_m_out_brdy_w));
+
+ Z80PIO(config, m_z80pio[3], 4000000); /* ?? Mhz */
+ m_z80pio[3]->out_int_callback().set(FUNC(proconn_state::pio_4_m_out_int_w));
+ m_z80pio[3]->in_pa_callback().set(FUNC(proconn_state::pio_4_m_in_pa_r));
+ m_z80pio[3]->out_pa_callback().set(FUNC(proconn_state::pio_4_m_out_pa_w));
+ m_z80pio[3]->out_ardy_callback().set(FUNC(proconn_state::pio_4_m_out_ardy_w));
+ m_z80pio[3]->in_pb_callback().set(FUNC(proconn_state::pio_4_m_in_pb_r));
+ m_z80pio[3]->out_pb_callback().set(FUNC(proconn_state::pio_4_m_out_pb_w));
+ m_z80pio[3]->out_brdy_callback().set(FUNC(proconn_state::pio_4_m_out_brdy_w));
+
+ Z80PIO(config, m_z80pio[4], 4000000); /* ?? Mhz */
+ m_z80pio[4]->out_int_callback().set(FUNC(proconn_state::pio_5_m_out_int_w));
+ m_z80pio[4]->in_pa_callback().set(FUNC(proconn_state::pio_5_m_in_pa_r));
+ m_z80pio[4]->out_pa_callback().set(FUNC(proconn_state::pio_5_m_out_pa_w));
+ m_z80pio[4]->out_ardy_callback().set(FUNC(proconn_state::pio_5_m_out_ardy_w));
+ m_z80pio[4]->in_pb_callback().set(FUNC(proconn_state::pio_5_m_in_pb_r));
+ m_z80pio[4]->out_pb_callback().set(FUNC(proconn_state::pio_5_m_out_pb_w));
+ m_z80pio[4]->out_brdy_callback().set(FUNC(proconn_state::pio_5_m_out_brdy_w));
MCFG_DEVICE_ADD("z80ctc", Z80CTC, 4000000)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/rt1715.cpp b/src/mame/drivers/rt1715.cpp
index 2cd7d6d1136..c9f1ecee025 100644
--- a/src/mame/drivers/rt1715.cpp
+++ b/src/mame/drivers/rt1715.cpp
@@ -317,8 +317,8 @@ MACHINE_CONFIG_START(rt1715_state::rt1715)
Z80SIO(config, "a29", 9.832_MHz_XTAL / 4);
/* floppy */
- MCFG_DEVICE_ADD("a71", Z80PIO, 9.832_MHz_XTAL / 4)
- MCFG_DEVICE_ADD("a72", Z80PIO, 9.832_MHz_XTAL / 4)
+ Z80PIO(config, "a71", 9.832_MHz_XTAL / 4);
+ Z80PIO(config, "a72", 9.832_MHz_XTAL / 4);
/* internal ram */
RAM(config, RAM_TAG).set_default_size("64K").set_default_value(0);
diff --git a/src/mame/drivers/sc1.cpp b/src/mame/drivers/sc1.cpp
index ece405cc9e8..55772bc1337 100644
--- a/src/mame/drivers/sc1.cpp
+++ b/src/mame/drivers/sc1.cpp
@@ -168,9 +168,9 @@ MACHINE_CONFIG_START(sc1_state::sc1)
config.set_default_layout(layout_sc1);
/* devices */
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, sc1_state, pio_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, sc1_state, pio_port_b_r))
+ z80pio_device& pio(Z80PIO(config, "z80pio", XTAL(4'000'000)));
+ pio.out_pa_callback().set(FUNC(sc1_state::pio_port_a_w));
+ pio.in_pb_callback().set(FUNC(sc1_state::pio_port_b_r));
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/sc2.cpp b/src/mame/drivers/sc2.cpp
index cc685a0a641..abe351f6cd7 100644
--- a/src/mame/drivers/sc2.cpp
+++ b/src/mame/drivers/sc2.cpp
@@ -223,11 +223,11 @@ MACHINE_CONFIG_START(sc2_state::sc2)
config.set_default_layout(layout_sc2);
/* devices */
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(4'000'000))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, sc2_state, pio_port_a_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, sc2_state, pio_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, sc2_state, pio_port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, sc2_state, pio_port_b_w))
+ z80pio_device& pio(Z80PIO(config, "z80pio", XTAL(4'000'000)));
+ pio.in_pa_callback().set(FUNC(sc2_state::pio_port_a_r));
+ pio.out_pa_callback().set(FUNC(sc2_state::pio_port_a_w));
+ pio.in_pb_callback().set(FUNC(sc2_state::pio_port_b_r));
+ pio.out_pb_callback().set(FUNC(sc2_state::pio_port_b_w));
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/senjyo.cpp b/src/mame/drivers/senjyo.cpp
index 24df8de20d3..6e120ed45ed 100644
--- a/src/mame/drivers/senjyo.cpp
+++ b/src/mame/drivers/senjyo.cpp
@@ -560,9 +560,9 @@ MACHINE_CONFIG_START(senjyo_state::senjyo)
MCFG_DEVICE_PROGRAM_MAP(senjyo_sound_map)
MCFG_DEVICE_IO_MAP(senjyo_sound_io_map)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, 2000000)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("sub", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, senjyo_state, pio_pa_r))
+ Z80PIO(config, m_pio, 2000000);
+ m_pio->out_int_callback().set_inputline("sub", INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set(FUNC(senjyo_state::pio_pa_r));
MCFG_DEVICE_ADD("z80ctc", Z80CTC, 2000000 /* same as "sub" */)
MCFG_Z80CTC_INTR_CB(INPUTLINE("sub", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/super6.cpp b/src/mame/drivers/super6.cpp
index a704a203c95..447070fb556 100644
--- a/src/mame/drivers/super6.cpp
+++ b/src/mame/drivers/super6.cpp
@@ -466,8 +466,8 @@ MACHINE_CONFIG_START(super6_state::super6)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, super6_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, super6_state, io_write_byte))
- MCFG_DEVICE_ADD(m_pio, Z80PIO, 24_MHz_XTAL / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ Z80PIO(config, m_pio, 24_MHz_XTAL / 4);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(m_fdc, WD2793, 24_MHz_XTAL / 12)
MCFG_WD_FDC_FORCE_READY
diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp
index e113b2daab3..432a1be75bf 100644
--- a/src/mame/drivers/super80.cpp
+++ b/src/mame/drivers/super80.cpp
@@ -713,10 +713,10 @@ MACHINE_CONFIG_START(super80_state::super80)
MCFG_Z80_DAISY_CHAIN(super80_daisy_chain)
MCFG_MACHINE_RESET_OVERRIDE(super80_state, super80)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, MASTER_CLOCK/6)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, super80_state, pio_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, super80_state,pio_port_b_r))
+ Z80PIO(config, m_pio, MASTER_CLOCK/6);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->out_pa_callback().set(FUNC(super80_state::pio_port_a_w));
+ m_pio->in_pb_callback().set(FUNC(super80_state::pio_port_b_r));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(48.8)
@@ -800,10 +800,10 @@ MACHINE_CONFIG_START(super80_state::super80v)
MCFG_Z80_DAISY_CHAIN(super80_daisy_chain)
MCFG_MACHINE_RESET_OVERRIDE(super80_state, super80r)
- MCFG_DEVICE_ADD("z80pio", Z80PIO, MASTER_CLOCK/6)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, super80_state, pio_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, super80_state,pio_port_b_r))
+ Z80PIO(config, m_pio, MASTER_CLOCK/6);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->out_pa_callback().set(FUNC(super80_state::pio_port_a_w));
+ m_pio->in_pb_callback().set(FUNC(super80_state::pio_port_b_r));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(50)
diff --git a/src/mame/drivers/superslave.cpp b/src/mame/drivers/superslave.cpp
index e3ce203ec06..0c8122eed14 100644
--- a/src/mame/drivers/superslave.cpp
+++ b/src/mame/drivers/superslave.cpp
@@ -372,8 +372,8 @@ MACHINE_CONFIG_START(superslave_state::superslave)
am9519_device &am9519(AM9519(config, AM9519_TAG, 0));
am9519.out_int_callback().set_inputline(Z80_TAG, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(8'000'000)/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio(Z80PIO(config, Z80PIO_TAG, XTAL(8'000'000)/2));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(Z80DART_0_TAG, Z80DART, XTAL(8'000'000)/2)
MCFG_Z80DART_OUT_TXDA_CB(WRITELINE(RS232_A_TAG, rs232_port_device, write_txd))
diff --git a/src/mame/drivers/sys2900.cpp b/src/mame/drivers/sys2900.cpp
index 090749163dc..0e1b84e7872 100644
--- a/src/mame/drivers/sys2900.cpp
+++ b/src/mame/drivers/sys2900.cpp
@@ -158,8 +158,8 @@ MACHINE_CONFIG_START(sys2900_state::sys2900)
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_DEVICE_ADD("ctc", Z80CTC, 0)
- MCFG_DEVICE_ADD("pio", Z80PIO, 0)
+ Z80CTC(config, "ctc", 0);
+ Z80PIO(config, "pio", 0);
Z80SIO(config, "sio1", 0);
Z80SIO(config, "sio2", 0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp
index b21125b0a31..5343d36a559 100644
--- a/src/mame/drivers/system1.cpp
+++ b/src/mame/drivers/system1.cpp
@@ -2219,10 +2219,11 @@ MACHINE_CONFIG_START(system1_state::sys1pio)
MCFG_DEVICE_IO_MAP(system1_pio_io_map)
MCFG_DEVICE_REMOVE("ppi8255")
- MCFG_DEVICE_ADD("pio", Z80PIO, MASTER_CLOCK)
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, system1_state, soundport_w))
- MCFG_Z80PIO_OUT_ARDY_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, system1_state, videomode_w))
+
+ Z80PIO(config, m_pio, MASTER_CLOCK);
+ m_pio->out_pa_callback().set(FUNC(system1_state::soundport_w));
+ m_pio->out_ardy_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
+ m_pio->out_pb_callback().set(FUNC(system1_state::videomode_w));
MACHINE_CONFIG_END
#define ENCRYPTED_SYS1PPI_MAPS \
diff --git a/src/mame/drivers/tiki100.cpp b/src/mame/drivers/tiki100.cpp
index 7bbc95a861b..8526b77efb8 100644
--- a/src/mame/drivers/tiki100.cpp
+++ b/src/mame/drivers/tiki100.cpp
@@ -733,12 +733,12 @@ MACHINE_CONFIG_START(tiki100_state::tiki100)
MCFG_Z80DART_OUT_RTSB_CB(WRITELINE(RS232_B_TAG, rs232_port_device, write_rts))
MCFG_Z80DART_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 8_MHz_XTAL / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8("cent_data_in", input_buffer_device, bus_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, tiki100_state, pio_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, tiki100_state, pio_pb_w))
+ Z80PIO(config, m_pio, 8_MHz_XTAL / 4);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set("cent_data_in", FUNC(input_buffer_device::bus_r));
+ m_pio->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_pio->in_pb_callback().set(FUNC(tiki100_state::pio_pb_r));
+ m_pio->out_pb_callback().set(FUNC(tiki100_state::pio_pb_w));
MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, 8_MHz_XTAL / 4)
MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/tranz330.cpp b/src/mame/drivers/tranz330.cpp
index 3968a1e49f9..5dbd12c4257 100644
--- a/src/mame/drivers/tranz330.cpp
+++ b/src/mame/drivers/tranz330.cpp
@@ -156,10 +156,10 @@ void tranz330_state::tranz330(machine_config &config)
.output_handler().set_inputline(m_cpu, INPUT_LINE_IRQ0);
Z80PIO(config, m_pio, XTAL(7'159'090)/2); //*
- m_pio->set_out_int_callback(DEVCB_WRITELINE("irq", input_merger_device, in_w<0>)); //*
- m_pio->set_out_pa_callback(DEVCB_WRITE8(*this, tranz330_state, pio_a_w));
- m_pio->set_in_pa_callback(DEVCB_READ8(*this, tranz330_state, card_r));
- m_pio->set_in_pb_callback(DEVCB_READ8(*this, tranz330_state, pio_b_r));
+ m_pio->out_int_callback().set("irq", FUNC(input_merger_device::in_w<0>)); //*
+ m_pio->out_pa_callback().set(FUNC(tranz330_state::pio_a_w));
+ m_pio->in_pa_callback().set(FUNC(tranz330_state::card_r));
+ m_pio->in_pb_callback().set(FUNC(tranz330_state::pio_b_r));
Z80DART(config, m_dart, XTAL(7'159'090)/2); //*
m_dart->set_out_syncb_callback(DEVCB_WRITELINE(*this, tranz330_state, syncb_w));
diff --git a/src/mame/drivers/trs80m2.cpp b/src/mame/drivers/trs80m2.cpp
index 031240ccbba..8081d8488ab 100644
--- a/src/mame/drivers/trs80m2.cpp
+++ b/src/mame/drivers/trs80m2.cpp
@@ -733,7 +733,7 @@ MACHINE_CONFIG_START(trs80m2_state::trs80m2)
// devices
MCFG_DEVICE_ADD(FD1791_TAG, FD1791, 8_MHz_XTAL / 4)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITE8(Z80PIO_TAG, z80pio_device, pa_w))
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITE8(m_pio, z80pio_device, pa_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(Z80DMA_TAG, z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD(FD1791_TAG":0", trs80m2_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FD1791_TAG":1", trs80m2_floppies, nullptr, floppy_image_device::default_floppy_formats)
@@ -756,18 +756,18 @@ MACHINE_CONFIG_START(trs80m2_state::trs80m2)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, trs80m2_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, trs80m2_state, io_write_byte))
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 8_MHz_XTAL / 2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, trs80m2_state, pio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, trs80m2_state, pio_pa_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, trs80m2_state, strobe_w))
+ Z80PIO(config, m_pio, 8_MHz_XTAL / 2);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set(FUNC(trs80m2_state::pio_pa_r));
+ m_pio->out_pa_callback().set(FUNC(trs80m2_state::pio_pa_w));
+ m_pio->out_pb_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_pio->out_brdy_callback().set(FUNC(trs80m2_state::strobe_w));
MCFG_DEVICE_ADD(Z80SIO_TAG, Z80SIO0, 8_MHz_XTAL / 2)
MCFG_Z80DART_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
- MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(Z80PIO_TAG, z80pio_device, strobe_b))
+ MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(m_pio, z80pio_device, strobe_b))
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_busy))
MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_fault))
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_perror))
@@ -821,7 +821,7 @@ MACHINE_CONFIG_START(trs80m16_state::trs80m16)
// devices
MCFG_DEVICE_ADD(FD1791_TAG, FD1791, 8_MHz_XTAL / 4)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITE8(Z80PIO_TAG, z80pio_device, pa_w))
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITE8(m_pio, z80pio_device, pa_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(Z80DMA_TAG, z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD(FD1791_TAG":0", trs80m2_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FD1791_TAG":1", trs80m2_floppies, nullptr, floppy_image_device::default_floppy_formats)
@@ -844,12 +844,12 @@ MACHINE_CONFIG_START(trs80m16_state::trs80m16)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, trs80m2_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, trs80m2_state, io_write_byte))
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, 8_MHz_XTAL / 2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, trs80m2_state, pio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, trs80m2_state, pio_pa_w))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(*this, trs80m2_state, strobe_w))
+ Z80PIO(config, m_pio, 8_MHz_XTAL / 2);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set(FUNC(trs80m2_state::pio_pa_r));
+ m_pio->out_pa_callback().set(FUNC(trs80m2_state::pio_pa_w));
+ m_pio->out_pb_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_pio->out_brdy_callback().set(FUNC(trs80m2_state::strobe_w));
MCFG_DEVICE_ADD(Z80SIO_TAG, Z80SIO0, 8_MHz_XTAL / 2)
MCFG_Z80DART_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
@@ -858,7 +858,7 @@ MACHINE_CONFIG_START(trs80m16_state::trs80m16)
m_uic->out_int_callback().set_inputline(M68000_TAG, M68K_IRQ_5);
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
- MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(Z80PIO_TAG, z80pio_device, strobe_b))
+ MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(m_pio, z80pio_device, strobe_b))
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_busy))
MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_fault))
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_perror))
diff --git a/src/mame/drivers/ts816.cpp b/src/mame/drivers/ts816.cpp
index c1706da9907..c6972a3827b 100644
--- a/src/mame/drivers/ts816.cpp
+++ b/src/mame/drivers/ts816.cpp
@@ -295,11 +295,11 @@ MACHINE_CONFIG_START(ts816_state::ts816)
z80sio_device& sio9(Z80SIO(config, "sio9", XTAL(16'000'000) / 4));
sio9.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(16'000'000) / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- //MCFG_Z80PIO_IN_PA_CB(READ8(*this, ts816_state, porta_r))
- //MCFG_Z80PIO_IN_PB_CB(READ8(*this, ts816_state, portb_r))
- //MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, ts816_state, portb_w))
+ z80pio_device& pio(Z80PIO(config, "pio", XTAL(16'000'000) / 4));
+ pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ //pio.in_pa_callback().set(FUNC(ts816_state::porta_r));
+ //pio.in_pb_callback().set(FUNC(ts816_state::portb_r));
+ //pio.out_pb_callback().set(FUNC(ts816_state::portb_w));
MCFG_DEVICE_ADD("ctc1", Z80CTC, XTAL(16'000'000) / 4)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/vcs80.cpp b/src/mame/drivers/vcs80.cpp
index 18dfb6f43d0..dda437ae35e 100644
--- a/src/mame/drivers/vcs80.cpp
+++ b/src/mame/drivers/vcs80.cpp
@@ -227,10 +227,10 @@ MACHINE_CONFIG_START(vcs80_state::vcs80)
config.set_default_layout(layout_vcs80);
/* devices */
- MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(5'000'000)/2)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, vcs80_state, pio_pa_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, vcs80_state, pio_pb_w))
+ Z80PIO(config, m_pio, XTAL(5'000'000)/2);
+ m_pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio->in_pa_callback().set(FUNC(vcs80_state::pio_pa_r));
+ m_pio->out_pb_callback().set(FUNC(vcs80_state::pio_pb_w));
/* internal ram */
RAM(config, RAM_TAG).set_default_size("1K");
diff --git a/src/mame/drivers/victory.cpp b/src/mame/drivers/victory.cpp
index 91ff2451263..b71305b08a8 100644
--- a/src/mame/drivers/victory.cpp
+++ b/src/mame/drivers/victory.cpp
@@ -221,13 +221,13 @@ MACHINE_CONFIG_START(victory_state::victory)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
// PIO interrupts are disconnected
- MCFG_DEVICE_ADD("pio1", Z80PIO, VICTORY_MAIN_CPU_CLOCK) // at K8
- MCFG_Z80PIO_IN_PA_CB(IOPORT("DIAL"))
- MCFG_Z80PIO_IN_PB_CB(IOPORT("COIN"))
+ z80pio_device& pio1(Z80PIO(config, "pio1", VICTORY_MAIN_CPU_CLOCK)); // at K8
+ pio1.in_pa_callback().set_ioport("DIAL");
+ pio1.in_pb_callback().set_ioport("COIN");
- MCFG_DEVICE_ADD("pio2", Z80PIO, VICTORY_MAIN_CPU_CLOCK) // at L8
- MCFG_Z80PIO_IN_PA_CB(IOPORT("BUTTONS"))
- MCFG_Z80PIO_IN_PB_CB(IOPORT("UNUSED"))
+ z80pio_device& pio2(Z80PIO(config, "pio2", VICTORY_MAIN_CPU_CLOCK)); // at L8
+ pio2.in_pa_callback().set_ioport("BUTTONS");
+ pio2.in_pb_callback().set_ioport("UNUSED");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/xerox820.cpp b/src/mame/drivers/xerox820.cpp
index 8ffbd51c03a..0596f45d028 100644
--- a/src/mame/drivers/xerox820.cpp
+++ b/src/mame/drivers/xerox820.cpp
@@ -611,14 +611,14 @@ MACHINE_CONFIG_START(xerox820_state::xerox820)
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* devices */
- MCFG_DEVICE_ADD(Z80PIO_KB_TAG, Z80PIO, 20_MHz_XTAL / 8)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, xerox820_state, kbpio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, xerox820_state, kbpio_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, xerox820_state, kbpio_pb_r))
+ Z80PIO(config, m_kbpio, 20_MHz_XTAL / 8);
+ m_kbpio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_kbpio->in_pa_callback().set(FUNC(xerox820_state::kbpio_pa_r));
+ m_kbpio->out_pa_callback().set(FUNC(xerox820_state::kbpio_pa_w));
+ m_kbpio->in_pb_callback().set(FUNC(xerox820_state::kbpio_pb_r));
- MCFG_DEVICE_ADD(Z80PIO_GP_TAG, Z80PIO, 20_MHz_XTAL / 8)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ z80pio_device& pio_gp(Z80PIO(config, Z80PIO_GP_TAG, 20_MHz_XTAL / 8));
+ pio_gp.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, 20_MHz_XTAL / 8)
MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
@@ -653,7 +653,7 @@ MACHINE_CONFIG_START(xerox820_state::xerox820)
dbrg.ft_handler().set(m_sio, FUNC(z80dart_device::rxtxcb_w));
MCFG_DEVICE_ADD(KEYBOARD_TAG, XEROX_820_KEYBOARD, 0)
- MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(WRITELINE(Z80PIO_KB_TAG, z80pio_device, strobe_b))
+ MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(WRITELINE(m_kbpio, z80pio_device, strobe_b))
/* internal ram */
RAM(config, m_ram).set_default_size("64K");
@@ -692,22 +692,22 @@ MACHINE_CONFIG_START(xerox820ii_state::xerox820ii)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* devices */
- MCFG_DEVICE_ADD(Z80PIO_KB_TAG, Z80PIO, 16_MHz_XTAL / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, xerox820_state, kbpio_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, xerox820_state, kbpio_pa_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, xerox820_state, kbpio_pb_r))
-
- MCFG_DEVICE_ADD(Z80PIO_GP_TAG, Z80PIO, 16_MHz_XTAL / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
-
- MCFG_DEVICE_ADD(Z80PIO_RD_TAG, Z80PIO, 20_MHz_XTAL / 8)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8("sasi_data_in", input_buffer_device, bus_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("sasi_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, xerox820ii_state, rdpio_pardy_w))
- MCFG_Z80PIO_IN_PB_CB(READ8("sasi_ctrl_in", input_buffer_device, bus_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, xerox820ii_state, rdpio_pb_w))
+ Z80PIO(config, m_kbpio, 16_MHz_XTAL / 4);
+ m_kbpio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_kbpio->in_pa_callback().set(FUNC(xerox820_state::kbpio_pa_r));
+ m_kbpio->out_pa_callback().set(FUNC(xerox820_state::kbpio_pa_w));
+ m_kbpio->in_pb_callback().set(FUNC(xerox820_state::kbpio_pb_r));
+
+ z80pio_device& pio_gp(Z80PIO(config, Z80PIO_GP_TAG, 16_MHz_XTAL / 4));
+ pio_gp.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+
+ z80pio_device& pio_rd(Z80PIO(config, Z80PIO_RD_TAG, 20_MHz_XTAL / 8));
+ pio_rd.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio_rd.in_pa_callback().set("sasi_data_in", FUNC(input_buffer_device::bus_r));
+ pio_rd.out_pa_callback().set("sasi_data_out", FUNC(output_latch_device::bus_w));
+ pio_rd.out_ardy_callback().set(FUNC(xerox820ii_state::rdpio_pardy_w));
+ pio_rd.in_pb_callback().set("sasi_ctrl_in", FUNC(input_buffer_device::bus_r));
+ pio_rd.out_pb_callback().set(FUNC(xerox820ii_state::rdpio_pb_w));
MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, 16_MHz_XTAL / 4)
MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
@@ -742,7 +742,7 @@ MACHINE_CONFIG_START(xerox820ii_state::xerox820ii)
dbrg.ft_handler().set(m_sio, FUNC(z80dart_device::rxtxcb_w));
MCFG_DEVICE_ADD(KEYBOARD_TAG, XEROX_820_KEYBOARD, 0)
- MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(WRITELINE(Z80PIO_KB_TAG, z80pio_device, strobe_b))
+ MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(WRITELINE(m_kbpio, z80pio_device, strobe_b))
// SASI bus
SCSI_PORT(config, m_sasibus, 0);
diff --git a/src/mame/drivers/z1013.cpp b/src/mame/drivers/z1013.cpp
index 5692af62a33..69242021885 100644
--- a/src/mame/drivers/z1013.cpp
+++ b/src/mame/drivers/z1013.cpp
@@ -394,9 +394,9 @@ MACHINE_CONFIG_START(z1013_state::z1013)
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25);
/* devices */
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(1'000'000))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, z1013_state, port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, z1013_state, port_b_w))
+ z80pio_device& pio(Z80PIO(config, "z80pio", XTAL(1'000'000)));
+ pio.in_pb_callback().set(FUNC(z1013_state::port_b_r));
+ pio.out_pb_callback().set(FUNC(z1013_state::port_b_w));
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
@@ -406,9 +406,10 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(z1013_state::z1013k76)
z1013(config);
- MCFG_DEVICE_REMOVE("z80pio")
- MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(1'000'000))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, z1013_state, k7659_port_b_r))
+
+ z80pio_device &pio(*subdevice<z80pio_device>("z80pio"));
+ pio.in_pb_callback().set(FUNC(z1013_state::k7659_port_b_r));
+ pio.out_pb_callback().set_nop();
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/z9001.cpp b/src/mame/drivers/z9001.cpp
index 489451bf276..336d723a0b7 100644
--- a/src/mame/drivers/z9001.cpp
+++ b/src/mame/drivers/z9001.cpp
@@ -235,12 +235,12 @@ MACHINE_CONFIG_START(z9001_state::z9001)
MCFG_GENERIC_KEYBOARD_CB(PUT(z9001_state, kbd_put))
MCFG_TIMER_DRIVER_ADD_PERIODIC("z9001_timer", z9001_state, timer_callback, attotime::from_msec(10))
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, XTAL(9'830'400) / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, z9001_state, port88_w))
+ z80pio_device& pio1(Z80PIO(config, "z80pio1", XTAL(9'830'400) / 4));
+ pio1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ pio1.out_pa_callback().set(FUNC(z9001_state::port88_w));
- MCFG_DEVICE_ADD("z80pio2", Z80PIO, XTAL(9'830'400) / 4) // keyboard PIO
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ z80pio_device& pio2(Z80PIO(config, "z80pio2", XTAL(9'830'400) / 4)); // keyboard PIO
+ pio2.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL(9'830'400) / 4)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/machine/cedar_magnet_plane.cpp b/src/mame/machine/cedar_magnet_plane.cpp
index 0c74542281a..0fd0301d2c9 100644
--- a/src/mame/machine/cedar_magnet_plane.cpp
+++ b/src/mame/machine/cedar_magnet_plane.cpp
@@ -76,19 +76,19 @@ MACHINE_CONFIG_START(cedar_magnet_plane_device::device_add_mconfig)
MCFG_DEVICE_PROGRAM_MAP(cedar_magnet_plane_map)
MCFG_DEVICE_IO_MAP(cedar_magnet_plane_io)
- MCFG_DEVICE_ADD("z80pio0", Z80PIO, 4000000/2)
-// MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, cedar_magnet_plane_device, pio0_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, cedar_magnet_plane_device, pio0_pa_w))
-// MCFG_Z80PIO_IN_PB_CB(READ8(*this, cedar_magnet_plane_device, pio0_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, cedar_magnet_plane_device, pio0_pb_w))
-
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, 4000000/2)
-// MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
-// MCFG_Z80PIO_IN_PA_CB(READ8(*this, cedar_magnet_plane_device, pio1_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, cedar_magnet_plane_device, pio1_pa_w))
-// MCFG_Z80PIO_IN_PB_CB(READ8(*this, cedar_magnet_plane_device, pio1_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, cedar_magnet_plane_device, pio1_pb_w))
+ z80pio_device& pio0(Z80PIO(config, "z80pio0", 4000000/2));
+// pio0.out_int_callback().set_inputline("maincpu", INPUT_LINE_IRQ0);
+ pio0.in_pa_callback().set(FUNC(cedar_magnet_plane_device::pio0_pa_r));
+ pio0.out_pa_callback().set(FUNC(cedar_magnet_plane_device::pio0_pa_w));
+// pio0.in_pb_callback().set(FUNC(cedar_magnet_plane_device::pio0_pb_r));
+ pio0.out_pb_callback().set(FUNC(cedar_magnet_plane_device::pio0_pb_w));
+
+ z80pio_device& pio1(Z80PIO(config, "z80pio1", 4000000/2));
+// pio1.out_int_callback().set_inputline("maincpu", INPUT_LINE_IRQ0);
+// pio1.in_pa_callback().set(FUNC(cedar_magnet_plane_device::pio1_pa_r));
+ pio1.out_pa_callback().set(FUNC(cedar_magnet_plane_device::pio1_pa_w));
+// pio1.in_pb_callback().set(FUNC(cedar_magnet_plane_device::pio1_pb_r));
+ pio1.out_pb_callback().set(FUNC(cedar_magnet_plane_device::pio1_pb_w));
MACHINE_CONFIG_END
diff --git a/src/mame/machine/cedar_magnet_sprite.cpp b/src/mame/machine/cedar_magnet_sprite.cpp
index af8c3e85b71..4c21f4da167 100644
--- a/src/mame/machine/cedar_magnet_sprite.cpp
+++ b/src/mame/machine/cedar_magnet_sprite.cpp
@@ -206,26 +206,27 @@ MACHINE_CONFIG_START(cedar_magnet_sprite_device::device_add_mconfig)
MCFG_DEVICE_PROGRAM_MAP(cedar_magnet_sprite_map)
MCFG_DEVICE_IO_MAP(cedar_magnet_sprite_io)
- MCFG_DEVICE_ADD("z80pio0", Z80PIO, 4000000/2)
-// MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, cedar_magnet_sprite_device, pio0_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, cedar_magnet_sprite_device, pio0_pa_w))
-// MCFG_Z80PIO_IN_PB_CB(READ8(*this, cedar_magnet_sprite_device, pio0_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, cedar_magnet_sprite_device, pio0_pb_w))
-
- MCFG_DEVICE_ADD("z80pio1", Z80PIO, 4000000/2)
-// MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
-// MCFG_Z80PIO_IN_PA_CB(READ8(*this, cedar_magnet_sprite_device, pio1_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, cedar_magnet_sprite_device, pio1_pa_w))
-// MCFG_Z80PIO_IN_PB_CB(READ8(*this, cedar_magnet_sprite_device, pio1_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, cedar_magnet_sprite_device, pio1_pb_w))
-
- MCFG_DEVICE_ADD("z80pio2", Z80PIO, 4000000/2)
-// MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
-// MCFG_Z80PIO_IN_PA_CB(READ8(*this, cedar_magnet_sprite_device, pio2_pa_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, cedar_magnet_sprite_device, pio2_pa_w))
-// MCFG_Z80PIO_IN_PB_CB(READ8(*this, cedar_magnet_sprite_device, pio2_pb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, cedar_magnet_sprite_device, pio2_pb_w))
+ Z80PIO(config, m_pio0, 4000000/2);
+// m_pio0->out_int_callback().set_inputline("maincpu", INPUT_LINE_IRQ0);
+ m_pio0->in_pa_callback().set(FUNC(cedar_magnet_sprite_device::pio0_pa_r));
+ m_pio0->out_pa_callback().set(FUNC(cedar_magnet_sprite_device::pio0_pa_w));
+// m_pio0->in_pb_callback().set(FUNC(cedar_magnet_sprite_device::pio0_pb_r));
+ m_pio0->out_pb_callback().set(FUNC(cedar_magnet_sprite_device::pio0_pb_w));
+
+ Z80PIO(config, m_pio1, 4000000/2);
+// m_pio1->out_int_callback().set_inputline("maincpu", INPUT_LINE_IRQ0);
+// m_pio1->in_pa_callback().set(FUNC(cedar_magnet_sprite_device::pio1_pa_r));
+ m_pio1->out_pa_callback().set(FUNC(cedar_magnet_sprite_device::pio1_pa_w));
+// m_pio1->in_pb_callback().set(FUNC(cedar_magnet_sprite_device::pio1_pb_r));
+ m_pio1->out_pb_callback().set(FUNC(cedar_magnet_sprite_device::pio1_pb_w));
+
+ Z80PIO(config, m_pio2, 4000000/2);
+// m_pio2->out_int_callback().set_inputline("maincpu", INPUT_LINE_IRQ0);
+// m_pio2->in_pa_callback().set(FUNC(cedar_magnet_sprite_device::pio2_pa_r));
+ m_pio2->out_pa_callback().set(FUNC(cedar_magnet_sprite_device::pio2_pa_w));
+// m_pio2->in_pb_callback().set(FUNC(cedar_magnet_sprite_device::pio2_pb_r));
+ m_pio2->out_pb_callback().set(FUNC(cedar_magnet_sprite_device::pio2_pb_w));
+
ADDRESS_MAP_BANK(config, "sp_sub_ram").set_map(&cedar_magnet_sprite_device::cedar_magnet_sprite_sub_ram_map).set_options(ENDIANNESS_LITTLE, 8, 18, 0x10000);
MACHINE_CONFIG_END