summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-09-03 20:48:47 +0200
committer mooglyguy <therealmogminer@gmail.com>2018-09-03 20:51:58 +0200
commit11fa365606e26ec551cc4f9746b3d51b3d8ebbcf (patch)
treea000962004b7f0698af15ed4f819ee09f863bb0d
parent21cca10414b4b0b86aad4926fba47f7b9d8e51b6 (diff)
-i8255: Removed MCFG, nw
-rw-r--r--src/devices/bus/a2bus/agat7ports.cpp10
-rw-r--r--src/devices/bus/a2bus/agat840k_hle.cpp18
-rw-r--r--src/devices/bus/dmv/k220.cpp8
-rw-r--r--src/devices/bus/ecbbus/grip.cpp10
-rw-r--r--src/devices/bus/ieee488/hardbox.cpp20
-rw-r--r--src/devices/bus/ieee488/softbox.cpp20
-rw-r--r--src/devices/bus/iq151/grafik.cpp13
-rw-r--r--src/devices/bus/iq151/staper.cpp17
-rw-r--r--src/devices/bus/isa/ibm_mfc.cpp24
-rw-r--r--src/devices/bus/pofo/hpc101.cpp8
-rw-r--r--src/devices/bus/sg1000_exp/sk1100.cpp8
-rw-r--r--src/devices/bus/spc1000/fdd.cpp20
-rw-r--r--src/devices/bus/spc1000/fdd.h2
-rw-r--r--src/devices/machine/busmouse.cpp13
-rw-r--r--src/devices/machine/genpc.cpp10
-rw-r--r--src/devices/machine/i8255.h2
-rw-r--r--src/devices/machine/ldv1000.cpp20
-rw-r--r--src/devices/machine/mb89363b.cpp35
-rw-r--r--src/devices/sound/s14001a.h2
-rw-r--r--src/mame/audio/segag80r.cpp6
-rw-r--r--src/mame/audio/tx1.cpp18
-rw-r--r--src/mame/drivers/24cdjuke.cpp26
-rw-r--r--src/mame/drivers/a7150.cpp8
-rw-r--r--src/mame/drivers/aces1.cpp24
-rw-r--r--src/mame/drivers/albazg.cpp8
-rw-r--r--src/mame/drivers/amaticmg.cpp20
-rw-r--r--src/mame/drivers/amico2k.cpp10
-rw-r--r--src/mame/drivers/amstrad.cpp30
-rw-r--r--src/mame/drivers/amusco.cpp18
-rw-r--r--src/mame/drivers/amust.cpp26
-rw-r--r--src/mame/drivers/angelkds.cpp20
-rw-r--r--src/mame/drivers/apogee.cpp10
-rw-r--r--src/mame/drivers/astinvad.cpp21
-rw-r--r--src/mame/drivers/atom.cpp20
-rw-r--r--src/mame/drivers/b2m.cpp26
-rw-r--r--src/mame/drivers/bw2.cpp10
-rw-r--r--src/mame/drivers/cabaret.cpp30
-rw-r--r--src/mame/drivers/cb2001.cpp18
-rw-r--r--src/mame/drivers/cdc721.cpp6
-rw-r--r--src/mame/drivers/chinsan.cpp8
-rw-r--r--src/mame/drivers/clayshoo.cpp8
-rw-r--r--src/mame/drivers/clpoker.cpp18
-rw-r--r--src/mame/drivers/compis.cpp10
-rw-r--r--src/mame/drivers/dblcrown.cpp8
-rw-r--r--src/mame/drivers/dfruit.cpp8
-rw-r--r--src/mame/drivers/dribling.cpp20
-rw-r--r--src/mame/drivers/dvk_ksm.cpp10
-rw-r--r--src/mame/drivers/ecoinf2.cpp46
-rw-r--r--src/mame/drivers/ecoinf3.cpp126
-rw-r--r--src/mame/drivers/epos.cpp6
-rw-r--r--src/mame/drivers/excali64.cpp10
-rw-r--r--src/mame/drivers/fidel6502.cpp117
-rw-r--r--src/mame/drivers/fidelz80.cpp40
-rw-r--r--src/mame/drivers/fk1.cpp42
-rw-r--r--src/mame/drivers/flipjack.cpp10
-rw-r--r--src/mame/drivers/fortecar.cpp10
-rw-r--r--src/mame/drivers/freekick.cpp18
-rw-r--r--src/mame/drivers/galaxian.cpp58
-rw-r--r--src/mame/drivers/gatron.cpp8
-rw-r--r--src/mame/drivers/gei.cpp76
-rw-r--r--src/mame/drivers/goldstar.cpp269
-rw-r--r--src/mame/drivers/gp_1.cpp18
-rw-r--r--src/mame/drivers/gp_2.cpp8
-rw-r--r--src/mame/drivers/gsword.cpp8
-rw-r--r--src/mame/drivers/guab.cpp42
-rw-r--r--src/mame/drivers/himesiki.cpp18
-rw-r--r--src/mame/drivers/homerun.cpp8
-rw-r--r--src/mame/drivers/ibm6580.cpp10
-rw-r--r--src/mame/drivers/ibmpcjr.cpp8
-rw-r--r--src/mame/drivers/ice_tbd.cpp8
-rw-r--r--src/mame/drivers/idsa.cpp17
-rw-r--r--src/mame/drivers/igs009.cpp18
-rw-r--r--src/mame/drivers/igs017.cpp56
-rw-r--r--src/mame/drivers/igspoker.cpp8
-rw-r--r--src/mame/drivers/inder.cpp56
-rw-r--r--src/mame/drivers/iq151.cpp10
-rw-r--r--src/mame/drivers/iqblock.cpp10
-rw-r--r--src/mame/drivers/irisha.cpp12
-rw-r--r--src/mame/drivers/isbc.cpp12
-rw-r--r--src/mame/drivers/istrebiteli.cpp30
-rw-r--r--src/mame/drivers/jackie.cpp16
-rw-r--r--src/mame/drivers/jankenmn.cpp16
-rw-r--r--src/mame/drivers/jeutel.cpp46
-rw-r--r--src/mame/drivers/jpmimpct.cpp10
-rw-r--r--src/mame/drivers/jpmmps.cpp14
-rw-r--r--src/mame/drivers/jupace.cpp6
-rw-r--r--src/mame/drivers/kingdrby.cpp57
-rw-r--r--src/mame/drivers/kingpin.cpp10
-rw-r--r--src/mame/drivers/kopunch.cpp14
-rw-r--r--src/mame/drivers/kungfur.cpp18
-rw-r--r--src/mame/drivers/lordgun.cpp56
-rw-r--r--src/mame/drivers/lucky74.cpp28
-rw-r--r--src/mame/drivers/luckybal.cpp34
-rw-r--r--src/mame/drivers/lviv.cpp30
-rw-r--r--src/mame/drivers/m5.cpp12
-rw-r--r--src/mame/drivers/mbc200.cpp13
-rw-r--r--src/mame/drivers/mbc55x.cpp14
-rw-r--r--src/mame/drivers/mc1502.cpp22
-rw-r--r--src/mame/drivers/megaphx.cpp10
-rw-r--r--src/mame/drivers/merit.cpp68
-rw-r--r--src/mame/drivers/meritm.cpp12
-rw-r--r--src/mame/drivers/mikro80.cpp8
-rw-r--r--src/mame/drivers/mikrosha.cpp16
-rw-r--r--src/mame/drivers/mjkjidai.cpp20
-rw-r--r--src/mame/drivers/mpf1.cpp24
-rw-r--r--src/mame/drivers/mrgame.cpp9
-rw-r--r--src/mame/drivers/ms0515.cpp8
-rw-r--r--src/mame/drivers/msx.cpp24
-rw-r--r--src/mame/drivers/multi8.cpp8
-rw-r--r--src/mame/drivers/myb3k.cpp8
-rw-r--r--src/mame/drivers/mycom.cpp28
-rw-r--r--src/mame/drivers/mz2000.cpp14
-rw-r--r--src/mame/drivers/mz2500.cpp14
-rw-r--r--src/mame/drivers/mz3500.cpp8
-rw-r--r--src/mame/drivers/mz700.cpp10
-rw-r--r--src/mame/drivers/mz80.cpp10
-rw-r--r--src/mame/drivers/okean240.cpp29
-rw-r--r--src/mame/drivers/olyboss.cpp6
-rw-r--r--src/mame/drivers/pasopia.cpp24
-rw-r--r--src/mame/drivers/pasopia7.cpp32
-rw-r--r--src/mame/drivers/pc100.cpp18
-rw-r--r--src/mame/drivers/pc6001.cpp14
-rw-r--r--src/mame/drivers/pc8401a.cpp12
-rw-r--r--src/mame/drivers/pc8801.cpp22
-rw-r--r--src/mame/drivers/pc88va.cpp38
-rw-r--r--src/mame/drivers/pc9801.cpp32
-rw-r--r--src/mame/drivers/pengadvb.cpp10
-rw-r--r--src/mame/drivers/photon.cpp18
-rw-r--r--src/mame/drivers/piggypas.cpp8
-rw-r--r--src/mame/drivers/pipeline.cpp16
-rw-r--r--src/mame/drivers/pk8000.cpp18
-rw-r--r--src/mame/drivers/pk8020.cpp16
-rw-r--r--src/mame/drivers/poisk1.cpp22
-rw-r--r--src/mame/drivers/pp01.cpp14
-rw-r--r--src/mame/drivers/pulsar.cpp10
-rw-r--r--src/mame/drivers/radio86.cpp74
-rw-r--r--src/mame/drivers/rc759.cpp8
-rw-r--r--src/mame/drivers/rgum.cpp8
-rw-r--r--src/mame/drivers/rotaryf.cpp10
-rw-r--r--src/mame/drivers/sage2.cpp18
-rw-r--r--src/mame/drivers/savia84.cpp21
-rw-r--r--src/mame/drivers/sbrain.cpp14
-rw-r--r--src/mame/drivers/scobra.cpp44
-rw-r--r--src/mame/drivers/scramble.cpp29
-rw-r--r--src/mame/drivers/segae.cpp22
-rw-r--r--src/mame/drivers/segag80r.cpp16
-rw-r--r--src/mame/drivers/segahang.cpp16
-rw-r--r--src/mame/drivers/segaorun.cpp28
-rw-r--r--src/mame/drivers/segas16a.cpp8
-rw-r--r--src/mame/drivers/segas32.cpp16
-rw-r--r--src/mame/drivers/sfkick.cpp8
-rw-r--r--src/mame/drivers/sg1000.cpp8
-rw-r--r--src/mame/drivers/sg1000a.cpp10
-rw-r--r--src/mame/drivers/sitcom.cpp32
-rw-r--r--src/mame/drivers/skylncr.cpp18
-rw-r--r--src/mame/drivers/slotcarn.cpp18
-rw-r--r--src/mame/drivers/sm1800.cpp10
-rw-r--r--src/mame/drivers/smsmcorp.cpp18
-rw-r--r--src/mame/drivers/softbox.cpp20
-rw-r--r--src/mame/drivers/spc1500.cpp10
-rw-r--r--src/mame/drivers/special.cpp60
-rw-r--r--src/mame/drivers/spinb.cpp86
-rw-r--r--src/mame/drivers/spoker.cpp18
-rw-r--r--src/mame/drivers/statriv2.cpp10
-rw-r--r--src/mame/drivers/subsino.cpp60
-rw-r--r--src/mame/drivers/suprgolf.cpp22
-rw-r--r--src/mame/drivers/sv8000.cpp14
-rw-r--r--src/mame/drivers/svi318.cpp8
-rw-r--r--src/mame/drivers/system1.cpp8
-rw-r--r--src/mame/drivers/tandy2k.cpp8
-rw-r--r--src/mame/drivers/tatsumi.cpp10
-rw-r--r--src/mame/drivers/taxidriv.cpp52
-rw-r--r--src/mame/drivers/thief.cpp8
-rw-r--r--src/mame/drivers/tiamc1.cpp10
-rw-r--r--src/mame/drivers/timetrv.cpp16
-rw-r--r--src/mame/drivers/tk80.cpp96
-rw-r--r--src/mame/drivers/tk80bs.cpp6
-rw-r--r--src/mame/drivers/trs80.cpp10
-rw-r--r--src/mame/drivers/turbo.cpp70
-rw-r--r--src/mame/drivers/tvgame.cpp6
-rw-r--r--src/mame/drivers/unior.cpp18
-rw-r--r--src/mame/drivers/upscope.cpp8
-rw-r--r--src/mame/drivers/ut88.cpp8
-rw-r--r--src/mame/drivers/v1050.cpp40
-rw-r--r--src/mame/drivers/vector06.cpp22
-rw-r--r--src/mame/drivers/vega.cpp14
-rw-r--r--src/mame/drivers/videopkr.cpp10
-rw-r--r--src/mame/drivers/votrpss.cpp14
-rw-r--r--src/mame/drivers/vp415.cpp8
-rw-r--r--src/mame/drivers/vroulet.cpp18
-rw-r--r--src/mame/drivers/wacky_gator.cpp28
-rw-r--r--src/mame/drivers/witch.cpp24
-rw-r--r--src/mame/drivers/x1.cpp14
-rw-r--r--src/mame/drivers/x1twin.cpp14
-rw-r--r--src/mame/drivers/xor100.cpp8
-rw-r--r--src/mame/drivers/zaccaria.cpp10
-rw-r--r--src/mame/drivers/zaxxon.cpp16
-rw-r--r--src/mame/includes/goldstar.h3
-rw-r--r--src/mame/includes/witch.h2
-rw-r--r--src/mame/includes/zaxxon.h3
200 files changed, 2151 insertions, 2165 deletions
diff --git a/src/devices/bus/a2bus/agat7ports.cpp b/src/devices/bus/a2bus/agat7ports.cpp
index b74b941f600..aee242fb6fb 100644
--- a/src/devices/bus/a2bus/agat7ports.cpp
+++ b/src/devices/bus/a2bus/agat7ports.cpp
@@ -52,16 +52,16 @@ INPUT_PORTS_END
//-------------------------------------------------
MACHINE_CONFIG_START(a2bus_agat7_ports_device::device_add_mconfig)
- MCFG_DEVICE_ADD("d9", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, a2bus_agat7_ports_device, write_portb))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, a2bus_agat7_ports_device, read_portc))
+ I8255(config, m_d9);
+ m_d9->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_d9->out_pb_callback().set(FUNC(a2bus_agat7_ports_device::write_portb));
+ m_d9->in_pc_callback().set(FUNC(a2bus_agat7_ports_device::read_portc));
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, a2bus_agat7_ports_device, write_centronics_busy))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
- MCFG_DEVICE_ADD("d10", I8251, 0)
+ I8251(config, "d10", 0);
MACHINE_CONFIG_END
//-------------------------------------------------
diff --git a/src/devices/bus/a2bus/agat840k_hle.cpp b/src/devices/bus/a2bus/agat840k_hle.cpp
index 5a7c3484910..7dac678feb2 100644
--- a/src/devices/bus/a2bus/agat840k_hle.cpp
+++ b/src/devices/bus/a2bus/agat840k_hle.cpp
@@ -59,16 +59,16 @@ MACHINE_CONFIG_START(a2bus_agat840k_hle_device::device_add_mconfig)
MCFG_LEGACY_FLOPPY_CONFIG(agat840k_hle_floppy_interface)
MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(*this, a2bus_agat840k_hle_device, index_1_w))
- MCFG_DEVICE_ADD("d14", I8255, 0)
+ I8255(config, m_d14);
// PA not connected
- MCFG_I8255_IN_PORTB_CB(READ8(*this, a2bus_agat840k_hle_device, d14_i_b)) // status signals from drive
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, a2bus_agat840k_hle_device, d14_o_c)) // control
-
- MCFG_DEVICE_ADD("d15", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, a2bus_agat840k_hle_device, d15_i_a)) // read data
-// MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, a2bus_agat840k_hle_device, d15_o_b)) // write data
- MCFG_I8255_IN_PORTC_CB(READ8(*this, a2bus_agat840k_hle_device, d15_i_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, a2bus_agat840k_hle_device, d15_o_c))
+ m_d14->in_pb_callback().set(FUNC(a2bus_agat840k_hle_device::d14_i_b)); // status signals from drive
+ m_d14->out_pc_callback().set(FUNC(a2bus_agat840k_hle_device::d14_o_c)); // control
+
+ I8255(config, m_d15);
+ m_d15->in_pa_callback().set(FUNC(a2bus_agat840k_hle_device::d15_i_a)); // read data
+// m_d15->out_pb_callback().set(FUNC(a2bus_agat840k_hle_device::d15_o_b)); // write data
+ m_d15->in_pc_callback().set(FUNC(a2bus_agat840k_hle_device::d15_i_c));
+ m_d15->out_pc_callback().set(FUNC(a2bus_agat840k_hle_device::d15_o_c));
MACHINE_CONFIG_END
//-------------------------------------------------
diff --git a/src/devices/bus/dmv/k220.cpp b/src/devices/bus/dmv/k220.cpp
index 0efe7609dbe..52e33d0db09 100644
--- a/src/devices/bus/dmv/k220.cpp
+++ b/src/devices/bus/dmv/k220.cpp
@@ -159,10 +159,10 @@ void dmv_k220_device::device_reset()
//-------------------------------------------------
MACHINE_CONFIG_START(dmv_k220_device::device_add_mconfig)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, dmv_k220_device, porta_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SWITCH"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, dmv_k220_device, portc_w))
+ I8255(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(dmv_k220_device::porta_w));
+ m_ppi->in_pb_callback().set_ioport("SWITCH");
+ m_ppi->out_pc_callback().set(FUNC(dmv_k220_device::portc_w));
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL(1'000'000)) // CLK1
diff --git a/src/devices/bus/ecbbus/grip.cpp b/src/devices/bus/ecbbus/grip.cpp
index 5390e3a2015..dcde8594016 100644
--- a/src/devices/bus/ecbbus/grip.cpp
+++ b/src/devices/bus/ecbbus/grip.cpp
@@ -438,11 +438,11 @@ MACHINE_CONFIG_START(ecb_grip21_device::device_add_mconfig)
// MCFG_MC6845_ADD(HD6345_TAG, HD6345, SCREEN_TAG, XTAL(16'000'000)/4)
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecb_grip21_device, ppi_pa_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecb_grip21_device, ppi_pa_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecb_grip21_device, ppi_pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecb_grip21_device, ppi_pc_w))
+ I8255A(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(ecb_grip21_device::ppi_pa_r));
+ m_ppi->out_pa_callback().set(FUNC(ecb_grip21_device::ppi_pa_w));
+ m_ppi->in_pb_callback().set(FUNC(ecb_grip21_device::ppi_pb_r));
+ m_ppi->out_pc_callback().set(FUNC(ecb_grip21_device::ppi_pc_w));
Z80STI(config, m_sti, XTAL(16'000'000)/4);
m_sti->out_int_cb().set_inputline(Z80_TAG, INPUT_LINE_IRQ0);
diff --git a/src/devices/bus/ieee488/hardbox.cpp b/src/devices/bus/ieee488/hardbox.cpp
index 824df58aabb..677037c5ba7 100644
--- a/src/devices/bus/ieee488/hardbox.cpp
+++ b/src/devices/bus/ieee488/hardbox.cpp
@@ -274,16 +274,16 @@ MACHINE_CONFIG_START(hardbox_device::device_add_mconfig)
MCFG_DEVICE_IO_MAP(hardbox_io)
// devices
- MCFG_DEVICE_ADD(I8255_0_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, hardbox_device, ppi0_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, hardbox_device, ppi0_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, hardbox_device, ppi0_pc_r))
-
- MCFG_DEVICE_ADD(I8255_1_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, hardbox_device, ppi1_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, hardbox_device, ppi1_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, hardbox_device, ppi1_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, hardbox_device, ppi1_pc_w))
+ i8255_device &ppi0(I8255A(config, I8255_0_TAG));
+ ppi0.in_pa_callback().set(FUNC(hardbox_device::ppi0_pa_r));
+ ppi0.out_pb_callback().set(FUNC(hardbox_device::ppi0_pb_w));
+ ppi0.in_pc_callback().set(FUNC(hardbox_device::ppi0_pc_r));
+
+ i8255_device &ppi1(I8255A(config, I8255_1_TAG));
+ ppi1.in_pa_callback().set(FUNC(hardbox_device::ppi1_pa_r));
+ ppi1.out_pb_callback().set(FUNC(hardbox_device::ppi1_pb_w));
+ ppi1.in_pc_callback().set(FUNC(hardbox_device::ppi1_pc_r));
+ ppi1.out_pc_callback().set(FUNC(hardbox_device::ppi1_pc_w));
MCFG_DEVICE_ADD(CORVUS_HDC_TAG, CORVUS_HDC, 0)
MCFG_HARDDISK_ADD("harddisk1")
diff --git a/src/devices/bus/ieee488/softbox.cpp b/src/devices/bus/ieee488/softbox.cpp
index 6529282f2b3..66c5caf8969 100644
--- a/src/devices/bus/ieee488/softbox.cpp
+++ b/src/devices/bus/ieee488/softbox.cpp
@@ -249,16 +249,16 @@ MACHINE_CONFIG_START(softbox_device::device_add_mconfig)
MCFG_RS232_DSR_HANDLER(WRITELINE(I8251_TAG, i8251_device, write_dsr))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", terminal)
- MCFG_DEVICE_ADD(I8255_0_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, softbox_device, ppi0_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, softbox_device, ppi0_pb_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SW1"))
-
- MCFG_DEVICE_ADD(I8255_1_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, softbox_device, ppi1_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, softbox_device, ppi1_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, softbox_device, ppi1_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, softbox_device, ppi1_pc_w))
+ i8255_device &ppi0(I8255A(config, I8255_0_TAG));
+ ppi0.in_pa_callback().set(FUNC(softbox_device::ppi0_pa_r));
+ ppi0.out_pb_callback().set(FUNC(softbox_device::ppi0_pb_w));
+ ppi0.in_pc_callback().set_ioport("SW1");
+
+ i8255_device &ppi1(I8255A(config, I8255_1_TAG));
+ ppi1.in_pa_callback().set(FUNC(softbox_device::ppi1_pa_r));
+ ppi1.out_pb_callback().set(FUNC(softbox_device::ppi1_pb_w));
+ ppi1.in_pc_callback().set(FUNC(softbox_device::ppi1_pc_r));
+ ppi1.out_pc_callback().set(FUNC(softbox_device::ppi1_pc_w));
COM8116(config, m_dbrg, 5.0688_MHz_XTAL);
m_dbrg->fr_handler().set(I8251_TAG, FUNC(i8251_device::write_rxc));
diff --git a/src/devices/bus/iq151/grafik.cpp b/src/devices/bus/iq151/grafik.cpp
index 68fe967ae2f..3ff61a188de 100644
--- a/src/devices/bus/iq151/grafik.cpp
+++ b/src/devices/bus/iq151/grafik.cpp
@@ -66,12 +66,13 @@ void iq151_grafik_device::device_reset()
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(iq151_grafik_device::device_add_mconfig)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, iq151_grafik_device, x_write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, iq151_grafik_device, y_write))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, iq151_grafik_device, control_w))
-MACHINE_CONFIG_END
+void iq151_grafik_device::device_add_mconfig(machine_config &config)
+{
+ I8255(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set(FUNC(iq151_grafik_device::x_write));
+ m_ppi8255->out_pb_callback().set(FUNC(iq151_grafik_device::y_write));
+ m_ppi8255->out_pc_callback().set(FUNC(iq151_grafik_device::control_w));
+}
//-------------------------------------------------
// I8255 port a
diff --git a/src/devices/bus/iq151/staper.cpp b/src/devices/bus/iq151/staper.cpp
index 82036a61572..2c7acb98bfa 100644
--- a/src/devices/bus/iq151/staper.cpp
+++ b/src/devices/bus/iq151/staper.cpp
@@ -60,14 +60,15 @@ void iq151_staper_device::device_start()
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(iq151_staper_device::device_add_mconfig)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, iq151_staper_device, ppi_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, iq151_staper_device, ppi_portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, iq151_staper_device, ppi_portc_w))
-
- MCFG_DEVICE_ADD("printer", PRINTER, 0)
-MACHINE_CONFIG_END
+void iq151_staper_device::device_add_mconfig(machine_config &config)
+{
+ I8255A(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(iq151_staper_device::ppi_porta_r));
+ m_ppi->out_pb_callback().set(FUNC(iq151_staper_device::ppi_portb_w));
+ m_ppi->out_pc_callback().set(FUNC(iq151_staper_device::ppi_portc_w));
+
+ PRINTER(config, "printer", 0);
+}
//-------------------------------------------------
// device_timer - handler timer events
diff --git a/src/devices/bus/isa/ibm_mfc.cpp b/src/devices/bus/isa/ibm_mfc.cpp
index 786739ed4e2..cabcb0c8db6 100644
--- a/src/devices/bus/isa/ibm_mfc.cpp
+++ b/src/devices/bus/isa/ibm_mfc.cpp
@@ -379,18 +379,18 @@ MACHINE_CONFIG_START(isa8_ibm_mfc_device::device_add_mconfig)
MCFG_DEVICE_PROGRAM_MAP(prg_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_DEVICE_ADD("d71055c_0", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, isa8_ibm_mfc_device, ppi0_i_a))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, isa8_ibm_mfc_device, ppi0_o_b))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, isa8_ibm_mfc_device, ppi0_i_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, isa8_ibm_mfc_device, ppi0_o_c))
-
- MCFG_DEVICE_ADD("d71055c_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, isa8_ibm_mfc_device, ppi1_o_a))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, isa8_ibm_mfc_device, ppi1_i_b))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, isa8_ibm_mfc_device, ppi1_o_c))
-
- MCFG_DEVICE_ADD("d71051", I8251, 0)
+ I8255(config, m_d71055c_0);
+ m_d71055c_0->in_pa_callback().set(FUNC(isa8_ibm_mfc_device::ppi0_i_a));
+ m_d71055c_0->out_pb_callback().set(FUNC(isa8_ibm_mfc_device::ppi0_o_b));
+ m_d71055c_0->in_pc_callback().set(FUNC(isa8_ibm_mfc_device::ppi0_i_c));
+ m_d71055c_0->out_pc_callback().set(FUNC(isa8_ibm_mfc_device::ppi0_o_c));
+
+ I8255(config, m_d71055c_1);
+ m_d71055c_1->out_pa_callback().set(FUNC(isa8_ibm_mfc_device::ppi1_o_a));
+ m_d71055c_1->in_pb_callback().set(FUNC(isa8_ibm_mfc_device::ppi1_i_b));
+ m_d71055c_1->out_pc_callback().set(FUNC(isa8_ibm_mfc_device::ppi1_o_c));
+
+ I8251(config, "d71051", 0);
MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL(4'000'000) / 8) // 500KHz
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, isa8_ibm_mfc_device, write_usart_clock))
diff --git a/src/devices/bus/pofo/hpc101.cpp b/src/devices/bus/pofo/hpc101.cpp
index b7d31727615..de0e7db1f6d 100644
--- a/src/devices/bus/pofo/hpc101.cpp
+++ b/src/devices/bus/pofo/hpc101.cpp
@@ -34,10 +34,10 @@ DEFINE_DEVICE_TYPE(POFO_HPC101, pofo_hpc101_device, "pofo_hpc101", "Atari Portfo
//-------------------------------------------------
MACHINE_CONFIG_START(pofo_hpc101_device::device_add_mconfig)
- MCFG_DEVICE_ADD(M82C55A_TAG, I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8("cent_ctrl_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTC_CB(READ8("cent_status_in", input_buffer_device, bus_r))
+ I8255A(config, m_ppi);
+ m_ppi->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_ppi->out_pb_callback().set("cent_ctrl_out", FUNC(output_latch_device::bus_w));
+ m_ppi->in_pc_callback().set("cent_status_in", FUNC(input_buffer_device::bus_r));
MCFG_DEVICE_ADD(CENTRONICS_TAG, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit5))
diff --git a/src/devices/bus/sg1000_exp/sk1100.cpp b/src/devices/bus/sg1000_exp/sk1100.cpp
index c3b1c89d981..91f077bdbfa 100644
--- a/src/devices/bus/sg1000_exp/sk1100.cpp
+++ b/src/devices/bus/sg1000_exp/sk1100.cpp
@@ -156,10 +156,10 @@ ioport_constructor sega_sk1100_device::device_input_ports() const
MACHINE_CONFIG_START(sega_sk1100_device::device_add_mconfig)
/* devices */
- MCFG_DEVICE_ADD(UPD9255_0_TAG, I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, sega_sk1100_device, ppi_pa_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, sega_sk1100_device, ppi_pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sega_sk1100_device, ppi_pc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(sega_sk1100_device::ppi_pa_r));
+ m_ppi->in_pb_callback().set(FUNC(sega_sk1100_device::ppi_pb_r));
+ m_ppi->out_pc_callback().set(FUNC(sega_sk1100_device::ppi_pc_w));
// MCFG_PRINTER_ADD("sp400") /* serial printer */
diff --git a/src/devices/bus/spc1000/fdd.cpp b/src/devices/bus/spc1000/fdd.cpp
index 7b67284a048..6a216752d55 100644
--- a/src/devices/bus/spc1000/fdd.cpp
+++ b/src/devices/bus/spc1000/fdd.cpp
@@ -87,12 +87,12 @@ MACHINE_CONFIG_START(spc1000_fdd_exp_device::device_add_mconfig)
MCFG_DEVICE_PROGRAM_MAP(sd725_mem)
MCFG_DEVICE_IO_MAP(sd725_io)
- MCFG_DEVICE_ADD("d8255_master", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("d8255_master", i8255_device, pb_r))
- MCFG_I8255_IN_PORTB_CB(READ8("d8255_master", i8255_device, pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spc1000_fdd_exp_device, i8255_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, spc1000_fdd_exp_device, i8255_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spc1000_fdd_exp_device, i8255_c_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(m_ppi, FUNC(i8255_device::pb_r));
+ m_ppi->in_pb_callback().set(m_ppi, FUNC(i8255_device::pa_r));
+ m_ppi->out_pb_callback().set(FUNC(spc1000_fdd_exp_device::i8255_b_w));
+ m_ppi->in_pc_callback().set(FUNC(spc1000_fdd_exp_device::i8255_c_r));
+ m_ppi->out_pc_callback().set(FUNC(spc1000_fdd_exp_device::i8255_c_w));
// floppy disk controller
MCFG_UPD765A_ADD("upd765", true, true)
@@ -137,7 +137,7 @@ spc1000_fdd_exp_device::spc1000_fdd_exp_device(const machine_config &mconfig, co
device_spc1000_card_interface(mconfig, *this),
m_cpu(*this, "fdccpu"),
m_fdc(*this, "upd765"),
- m_pio(*this, "d8255_master"),
+ m_ppi(*this, "d8255_master"),
m_fd0(nullptr), m_fd1(nullptr), m_timer_tc(nullptr), m_i8255_0_pc(0), m_i8255_1_pc(0), m_i8255_portb(0)
{
}
@@ -184,7 +184,7 @@ void spc1000_fdd_exp_device::device_timer(emu_timer &timer, device_timer_id id,
READ8_MEMBER(spc1000_fdd_exp_device::read)
{
- // this should be m_pio->read on the whole 0x00-0x03 range?
+ // this should be m_ppi->read on the whole 0x00-0x03 range?
if (offset >= 3)
return 0xff;
else
@@ -209,13 +209,13 @@ READ8_MEMBER(spc1000_fdd_exp_device::read)
WRITE8_MEMBER(spc1000_fdd_exp_device::write)
{
- // this should be m_pio->write on the whole 0x00-0x03 range?
+ // this should be m_ppi->write on the whole 0x00-0x03 range?
if (offset < 3)
{
switch (offset)
{
case 0:
- m_pio->write(space, 1, data);
+ m_ppi->write(space, 1, data);
break;
case 2:
m_i8255_0_pc = data;
diff --git a/src/devices/bus/spc1000/fdd.h b/src/devices/bus/spc1000/fdd.h
index 236ef9ba55e..27d6415e7b9 100644
--- a/src/devices/bus/spc1000/fdd.h
+++ b/src/devices/bus/spc1000/fdd.h
@@ -39,7 +39,7 @@ private:
// internal state
required_device<z80_device> m_cpu;
required_device<upd765a_device> m_fdc;
- required_device<i8255_device> m_pio;
+ required_device<i8255_device> m_ppi;
floppy_image_device *m_fd0;
floppy_image_device *m_fd1;
diff --git a/src/devices/machine/busmouse.cpp b/src/devices/machine/busmouse.cpp
index f8c62069b50..298c82c5124 100644
--- a/src/devices/machine/busmouse.cpp
+++ b/src/devices/machine/busmouse.cpp
@@ -126,12 +126,13 @@ bus_mouse_device::bus_mouse_device(const machine_config &mconfig, const char *ta
}
-MACHINE_CONFIG_START(bus_mouse_device::device_add_mconfig)
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, bus_mouse_device, ppi_a_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, bus_mouse_device, ppi_c_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, bus_mouse_device, ppi_c_r))
-MACHINE_CONFIG_END
+void bus_mouse_device::device_add_mconfig(machine_config &config)
+{
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.in_pa_callback().set(FUNC(bus_mouse_device::ppi_a_r));
+ ppi.out_pc_callback().set(FUNC(bus_mouse_device::ppi_c_w));
+ ppi.in_pc_callback().set(FUNC(bus_mouse_device::ppi_c_r));
+}
//-------------------------------------------------
diff --git a/src/devices/machine/genpc.cpp b/src/devices/machine/genpc.cpp
index 8cd87d0f72f..7f49ee888b3 100644
--- a/src/devices/machine/genpc.cpp
+++ b/src/devices/machine/genpc.cpp
@@ -596,9 +596,8 @@ MACHINE_CONFIG_START(ibm5150_mb_device::device_add_mconfig)
MCFG_DEVICE_MODIFY("pc_kbdc")
MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE(*this, ibm5150_mb_device, keyboard_clock_w))
- MCFG_DEVICE_MODIFY("ppi8255")
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ibm5150_mb_device, pc_ppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ibm5150_mb_device, pc_ppi_portc_r))
+ m_ppi8255->out_pb_callback().set(FUNC(ibm5150_mb_device::pc_ppi_portb_w));
+ m_ppi8255->in_pc_callback().set(FUNC(ibm5150_mb_device::pc_ppi_portc_r));
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
@@ -771,9 +770,8 @@ DEFINE_DEVICE_TYPE(EC1841_MOTHERBOARD, ec1841_mb_device, "ec1841_mb", "EC-1840 m
MACHINE_CONFIG_START(ec1841_mb_device::device_add_mconfig)
ibm5160_mb_device::device_add_mconfig(config);
- MCFG_DEVICE_MODIFY("ppi8255")
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ec1841_mb_device, pc_ppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ec1841_mb_device, pc_ppi_portc_r))
+ m_ppi8255->out_pb_callback().set(FUNC(ec1841_mb_device::pc_ppi_portb_w));
+ m_ppi8255->in_pc_callback().set(FUNC(ec1841_mb_device::pc_ppi_portc_r));
MCFG_DEVICE_MODIFY("pc_kbdc")
MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE(*this, ec1841_mb_device, keyboard_clock_w))
diff --git a/src/devices/machine/i8255.h b/src/devices/machine/i8255.h
index 0426ea09ae6..44d129b7a3c 100644
--- a/src/devices/machine/i8255.h
+++ b/src/devices/machine/i8255.h
@@ -172,7 +172,7 @@ class ams40489_ppi_device : public i8255_device
{
public:
// construction/destruction
- ams40489_ppi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ ams40489_ppi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
};
// device type definition
diff --git a/src/devices/machine/ldv1000.cpp b/src/devices/machine/ldv1000.cpp
index e0724381c98..4a9b1295b75 100644
--- a/src/devices/machine/ldv1000.cpp
+++ b/src/devices/machine/ldv1000.cpp
@@ -281,16 +281,16 @@ MACHINE_CONFIG_START(pioneer_ldv1000_device::device_add_mconfig)
Z80CTC(config, m_z80_ctc, XTAL(5'000'000)/2);
m_z80_ctc->intr_callback().set(FUNC(pioneer_ldv1000_device::ctc_interrupt));
- MCFG_DEVICE_ADD("ldvppi0", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pioneer_ldv1000_device, ppi0_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pioneer_ldv1000_device, ppi0_portb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pioneer_ldv1000_device, ppi0_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pioneer_ldv1000_device, ppi0_portc_w))
-
- MCFG_DEVICE_ADD("ldvppi1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pioneer_ldv1000_device, ppi1_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pioneer_ldv1000_device, ppi1_portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pioneer_ldv1000_device, ppi1_portc_w))
+ i8255_device &ldvppi0(I8255(config, "ldvppi0"));
+ ldvppi0.out_pa_callback().set(FUNC(pioneer_ldv1000_device::ppi0_porta_w));
+ ldvppi0.in_pb_callback().set(FUNC(pioneer_ldv1000_device::ppi0_portb_r));
+ ldvppi0.in_pc_callback().set(FUNC(pioneer_ldv1000_device::ppi0_portc_r));
+ ldvppi0.out_pc_callback().set(FUNC(pioneer_ldv1000_device::ppi0_portc_w));
+
+ i8255_device &ldvppi1(I8255(config, "ldvppi1"));
+ ldvppi1.in_pa_callback().set(FUNC(pioneer_ldv1000_device::ppi1_porta_r));
+ ldvppi1.out_pb_callback().set(FUNC(pioneer_ldv1000_device::ppi1_portb_w));
+ ldvppi1.out_pc_callback().set(FUNC(pioneer_ldv1000_device::ppi1_portc_w));
MACHINE_CONFIG_END
diff --git a/src/devices/machine/mb89363b.cpp b/src/devices/machine/mb89363b.cpp
index d2c79b36c5f..f06bba6b3ac 100644
--- a/src/devices/machine/mb89363b.cpp
+++ b/src/devices/machine/mb89363b.cpp
@@ -134,23 +134,24 @@ WRITE8_MEMBER( mb89363b_device::write )
}
-MACHINE_CONFIG_START(mb89363b_device::device_add_mconfig)
- MCFG_DEVICE_ADD("i8255_a", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mb89363b_device, i8255_a_port_a_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mb89363b_device, i8255_a_port_b_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mb89363b_device, i8255_a_port_c_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mb89363b_device, i8255_a_port_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mb89363b_device, i8255_a_port_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mb89363b_device, i8255_a_port_c_w))
-
- MCFG_DEVICE_ADD("i8255_b", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mb89363b_device, i8255_b_port_a_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mb89363b_device, i8255_b_port_b_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mb89363b_device, i8255_b_port_c_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mb89363b_device, i8255_b_port_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mb89363b_device, i8255_b_port_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mb89363b_device, i8255_b_port_c_w))
-MACHINE_CONFIG_END
+void mb89363b_device::device_add_mconfig(machine_config &config)
+{
+ I8255(config, m_i8255_a);
+ m_i8255_a->in_pa_callback().set(FUNC(mb89363b_device::i8255_a_port_a_r));
+ m_i8255_a->in_pb_callback().set(FUNC(mb89363b_device::i8255_a_port_b_r));
+ m_i8255_a->in_pc_callback().set(FUNC(mb89363b_device::i8255_a_port_c_r));
+ m_i8255_a->out_pa_callback().set(FUNC(mb89363b_device::i8255_a_port_a_w));
+ m_i8255_a->out_pb_callback().set(FUNC(mb89363b_device::i8255_a_port_b_w));
+ m_i8255_a->out_pc_callback().set(FUNC(mb89363b_device::i8255_a_port_c_w));
+
+ I8255(config, m_i8255_b);
+ m_i8255_b->in_pa_callback().set(FUNC(mb89363b_device::i8255_b_port_a_r));
+ m_i8255_b->in_pb_callback().set(FUNC(mb89363b_device::i8255_b_port_b_r));
+ m_i8255_b->in_pc_callback().set(FUNC(mb89363b_device::i8255_b_port_c_r));
+ m_i8255_b->out_pa_callback().set(FUNC(mb89363b_device::i8255_b_port_a_w));
+ m_i8255_b->out_pb_callback().set(FUNC(mb89363b_device::i8255_b_port_b_w));
+ m_i8255_b->out_pc_callback().set(FUNC(mb89363b_device::i8255_b_port_c_w));
+}
void mb89363b_device::device_start()
diff --git a/src/devices/sound/s14001a.h b/src/devices/sound/s14001a.h
index a7294559fb4..5c80f99be5d 100644
--- a/src/devices/sound/s14001a.h
+++ b/src/devices/sound/s14001a.h
@@ -23,6 +23,8 @@ public:
// configuration helpers
template <class Object> devcb_base &set_bsy_handler(Object &&cb) { return m_bsy_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_ext_read_handler(Object &&cb) { return m_ext_read_handler.set_callback(std::forward<Object>(cb)); }
+ auto bsy() { return m_bsy_handler.bind(); }
+ auto ext_read() { return m_ext_read_handler.bind(); }
DECLARE_READ_LINE_MEMBER(busy_r); // /BUSY (pin 40)
DECLARE_READ_LINE_MEMBER(romen_r); // ROM /EN (pin 9)
diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp
index 0120a039723..50704c5a648 100644
--- a/src/mame/audio/segag80r.cpp
+++ b/src/mame/audio/segag80r.cpp
@@ -417,9 +417,9 @@ static const char *const sega005_sample_names[] =
MACHINE_CONFIG_START(segag80r_state::sega005_sound_board)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, segag80r_state, sega005_sound_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, segag80r_state, sega005_sound_b_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(segag80r_state::sega005_sound_a_w));
+ ppi.out_pb_callback().set(FUNC(segag80r_state::sega005_sound_b_w));
/* sound hardware */
diff --git a/src/mame/audio/tx1.cpp b/src/mame/audio/tx1.cpp
index 355a501a09e..68aaf9e103a 100644
--- a/src/mame/audio/tx1.cpp
+++ b/src/mame/audio/tx1.cpp
@@ -558,11 +558,11 @@ MACHINE_CONFIG_START(tx1_sound_device::device_add_mconfig)
MCFG_DEVICE_IO_MAP(tx1_sound_io)
MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, tx1_sound_device, z80_irq, TX1_PIXEL_CLOCK / 4 / 2048 / 2)
- MCFG_DEVICE_ADD(m_ppi, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, tx1_sound_device, tx1_ppi_porta_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, tx1_sound_device, tx1_ppi_portb_r))
- MCFG_I8255_IN_PORTC_CB(IOPORT("PPI_PORTC"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tx1_sound_device, tx1_coin_cnt_w))
+ I8255A(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(tx1_sound_device::tx1_ppi_porta_r));
+ m_ppi->in_pb_callback().set(FUNC(tx1_sound_device::tx1_ppi_portb_r));
+ m_ppi->in_pc_callback().set_ioport("PPI_PORTC");
+ m_ppi->out_pc_callback().set(FUNC(tx1_sound_device::tx1_coin_cnt_w));
SPEAKER(config, "frontleft", -0.2, 0.0, 1.0);
SPEAKER(config, "frontright", 0.2, 0.0, 1.0);
@@ -1065,11 +1065,11 @@ MACHINE_CONFIG_START(buggyboy_sound_device::device_add_mconfig)
MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, buggyboy_sound_device, z80_irq, BUGGYBOY_ZCLK / 2 / 4 / 2048)
MCFG_DEVICE_IO_MAP(buggyboy_sound_io)
- MCFG_DEVICE_ADD(m_ppi, I8255A, 0)
+ I8255A(config, m_ppi);
/* Buggy Boy uses an 8255 PPI instead of YM2149 ports for inputs! */
- MCFG_I8255_IN_PORTA_CB(IOPORT("PPI_PORTA"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, buggyboy_sound_device, bb_coin_cnt_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("PPI_PORTC"))
+ m_ppi->in_pa_callback().set_ioport("PPI_PORTA");
+ m_ppi->out_pb_callback().set(FUNC(buggyboy_sound_device::bb_coin_cnt_w));
+ m_ppi->in_pc_callback().set_ioport("PPI_PORTC");
SPEAKER(config, "frontleft", -0.2, 0.0, 1.0);
SPEAKER(config, "frontright", 0.2, 0.0, 1.0);
diff --git a/src/mame/drivers/24cdjuke.cpp b/src/mame/drivers/24cdjuke.cpp
index 6b052a6ce62..b0136b54929 100644
--- a/src/mame/drivers/24cdjuke.cpp
+++ b/src/mame/drivers/24cdjuke.cpp
@@ -292,19 +292,19 @@ MACHINE_CONFIG_START(midcoin24cdjuke_state::midcoin24cdjuke)
config.set_default_layout(layout_24cdjuke);
- MCFG_DEVICE_ADD("ic11", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("MD1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("MD2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("MD3"))
-
- MCFG_DEVICE_ADD("ic25", I8255A, 0)
- MCFG_I8255_IN_PORTB_CB(IOPORT("PB"))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, midcoin24cdjuke_state, kb_row_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, midcoin24cdjuke_state, kb_col_w))
-
- i8255_device &ic32(I8255A(config, "ic31", 0));
- ic32.out_pb_callback().set_log("PPI8255 - unmapped write port B");
- ic32.in_pc_callback().set_ioport("MD4");
+ i8255_device &ic11(I8255A(config, "ic11"));
+ ic11.in_pa_callback().set_ioport("MD1");
+ ic11.in_pb_callback().set_ioport("MD2");
+ ic11.in_pc_callback().set_ioport("MD3");
+
+ i8255_device &ic25(I8255A(config, "ic25"));
+ ic25.in_pb_callback().set_ioport("PB");
+ ic25.in_pc_callback().set(FUNC(midcoin24cdjuke_state::kb_row_r));
+ ic25.out_pc_callback().set(FUNC(midcoin24cdjuke_state::kb_col_w));
+
+ i8255_device &ic31(I8255A(config, "ic31", 0));
+ ic31.out_pb_callback().set_log("PPI8255 - unmapped write port B");
+ ic31.in_pc_callback().set_ioport("MD4");
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/a7150.cpp b/src/mame/drivers/a7150.cpp
index 183362b8d12..ff46df7a1d8 100644
--- a/src/mame/drivers/a7150.cpp
+++ b/src/mame/drivers/a7150.cpp
@@ -485,10 +485,10 @@ MACHINE_CONFIG_START(a7150_state::a7150)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
// IFSP port on processor card
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
-// MCFG_I8255_IN_PORTA_CB(READ8("cent_status_in", input_buffer_device, bus_r))
-// MCFG_I8255_OUT_PORTB_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, a7150_state, ppi_c_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+// ppi.in_pa_callback().set("cent_status_in", FUNC(input_buffer_device::bus_r));
+// ppi.out_pb_callback().set("cent_data_out", output_latch_device::bus_w));
+ ppi.out_pc_callback().set(FUNC(a7150_state::ppi_c_w));
PIT8253(config, m_pit8253, 0);
m_pit8253->set_clk<0>(14.7456_MHz_XTAL/4);
diff --git a/src/mame/drivers/aces1.cpp b/src/mame/drivers/aces1.cpp
index c1063e456d6..6d461fc62d1 100644
--- a/src/mame/drivers/aces1.cpp
+++ b/src/mame/drivers/aces1.cpp
@@ -457,22 +457,22 @@ MACHINE_CONFIG_START(aces1_state::aces1)
MCFG_DEVICE_IO_MAP(aces1_portmap)
// 0xafb0 IC24 - lamps, 7segs
- MCFG_DEVICE_ADD("ic24", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, aces1_state, ic24_write_a)) // 7segs
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, aces1_state, ic24_write_b)) // lamps
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, aces1_state, ic24_write_c)) // strobe
+ i8255_device &ic24(I8255A(config, "ic24"));
+ ic24.out_pa_callback().set(FUNC(aces1_state::ic24_write_a)); // 7segs
+ ic24.out_pb_callback().set(FUNC(aces1_state::ic24_write_b)); // lamps
+ ic24.out_pc_callback().set(FUNC(aces1_state::ic24_write_c)); // strobe
// 0xafd0 IC25 - lamps, meters, reel comms (writes)
- MCFG_DEVICE_ADD("ic25", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, aces1_state, ic25_write_a)) // extra lamps
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, aces1_state, ic25_write_b)) // meters, extra lamp select
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, aces1_state, ic25_write_c)) // reel write, extra lamp strobe
+ i8255_device &ic25(I8255A(config, "ic25"));
+ ic25.out_pa_callback().set(FUNC(aces1_state::ic25_write_a)); // extra lamps
+ ic25.out_pb_callback().set(FUNC(aces1_state::ic25_write_b)); // meters, extra lamp select
+ ic25.out_pc_callback().set(FUNC(aces1_state::ic25_write_c)); // reel write, extra lamp strobe
// 0xafe0 IC37 - doors, coins, reel optics (reads)
- MCFG_DEVICE_ADD("ic37", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, aces1_state, ic37_read_a)) // extra lamps
- MCFG_I8255_IN_PORTB_CB(READ8(*this, aces1_state, ic37_read_b)) // meters, extra lamp select
- MCFG_I8255_IN_PORTC_CB(READ8(*this, aces1_state, ic37_read_c)) // reel write, extra lamp strobe
+ i8255_device &ic37(I8255A(config, "ic37"));
+ ic37.in_pa_callback().set(FUNC(aces1_state::ic37_read_a)); // extra lamps
+ ic37.in_pb_callback().set(FUNC(aces1_state::ic37_read_b)); // meters, extra lamp select
+ ic37.in_pc_callback().set(FUNC(aces1_state::ic37_read_c)); // reel write, extra lamp strobe
config.set_default_layout(layout_aces1);
diff --git a/src/mame/drivers/albazg.cpp b/src/mame/drivers/albazg.cpp
index 99211bc5d87..09f007269b4 100644
--- a/src/mame/drivers/albazg.cpp
+++ b/src/mame/drivers/albazg.cpp
@@ -372,10 +372,10 @@ MACHINE_CONFIG_START(albazg_state::yumefuda)
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8) // timing is unknown
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, albazg_state, mux_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, albazg_state, mux_r))
+ i8255_device &ppi(I8255A(config, "ppi8255_0"));
+ ppi.out_pa_callback().set(FUNC(albazg_state::mux_w));
+ ppi.in_pb_callback().set_ioport("SYSTEM");
+ ppi.in_pc_callback().set(FUNC(albazg_state::mux_r));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/amaticmg.cpp b/src/mame/drivers/amaticmg.cpp
index bc575f01d2f..cb6b0d475b4 100644
--- a/src/mame/drivers/amaticmg.cpp
+++ b/src/mame/drivers/amaticmg.cpp
@@ -852,15 +852,15 @@ MACHINE_CONFIG_START(amaticmg_state::amaticmg)
// NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* 3x 8255 */
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("IN0");
+ ppi0.in_pb_callback().set_ioport("IN1");
+ ppi0.in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amaticmg_state, out_a_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SW1"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, amaticmg_state, out_c_w))
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(amaticmg_state::out_a_w));
+ ppi1.in_pb_callback().set_ioport("SW1");
+ ppi1.out_pc_callback().set(FUNC(amaticmg_state::out_c_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -902,7 +902,7 @@ MACHINE_CONFIG_START(amaticmg_state::amaticmg2)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_IO_MAP(amaticmg2_portmap)
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0) // MG4: 0x89 -> A:out; B:out; C(h):in; C(l):in.
+ I8255A(config, "ppi8255_2"); // MG4: 0x89 -> A:out; B:out; C(h):in; C(l):in.
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(amaticmg_state, screen_update_amaticmg2)
@@ -923,7 +923,7 @@ MACHINE_CONFIG_START(amaticmg_state::amaticmg4)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_IO_MAP(amaticmg4_portmap)
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0) // MG4: 0x89 -> A:out; B:out; C(h):in; C(l):in.
+ I8255A(config, "ppi8255_2"); // MG4: 0x89 -> A:out; B:out; C(h):in; C(l):in.
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(amaticmg_state, screen_update_amaticmg2)
diff --git a/src/mame/drivers/amico2k.cpp b/src/mame/drivers/amico2k.cpp
index 015f0534e91..f6dcebdf5b7 100644
--- a/src/mame/drivers/amico2k.cpp
+++ b/src/mame/drivers/amico2k.cpp
@@ -223,11 +223,11 @@ MACHINE_CONFIG_START(amico2k_state::amico2k)
/* video hardware */
config.set_default_layout(layout_amico2k);
- MCFG_DEVICE_ADD("i8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, amico2k_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amico2k_state, ppi_pa_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, amico2k_state, ppi_pb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, amico2k_state, ppi_pb_w))
+ i8255_device &ppi(I8255(config, "i8255"));
+ ppi.in_pa_callback().set(FUNC(amico2k_state::ppi_pa_r));
+ ppi.out_pa_callback().set(FUNC(amico2k_state::ppi_pa_w));
+ ppi.in_pb_callback().set(FUNC(amico2k_state::ppi_pb_r));
+ ppi.out_pb_callback().set(FUNC(amico2k_state::ppi_pb_w));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/amstrad.cpp b/src/mame/drivers/amstrad.cpp
index 6552ebd8a02..f1531b47de5 100644
--- a/src/mame/drivers/amstrad.cpp
+++ b/src/mame/drivers/amstrad.cpp
@@ -919,11 +919,11 @@ MACHINE_CONFIG_START(amstrad_state::amstrad_base)
MCFG_MACHINE_START_OVERRIDE(amstrad_state, amstrad )
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state, amstrad )
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, amstrad_state, amstrad_ppi_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amstrad_state, amstrad_ppi_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, amstrad_state, amstrad_ppi_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, amstrad_state, amstrad_ppi_portc_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(amstrad_state::amstrad_ppi_porta_r));
+ ppi.out_pa_callback().set(FUNC(amstrad_state::amstrad_ppi_porta_w));
+ ppi.in_pb_callback().set(FUNC(amstrad_state::amstrad_ppi_portb_r));
+ ppi.out_pc_callback().set(FUNC(amstrad_state::amstrad_ppi_portc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1041,11 +1041,11 @@ MACHINE_CONFIG_START(amstrad_state::cpcplus)
MCFG_MACHINE_START_OVERRIDE(amstrad_state, plus )
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state, plus )
- MCFG_DEVICE_ADD("ppi8255", AMS40489_PPI, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, amstrad_state, amstrad_ppi_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amstrad_state, amstrad_ppi_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, amstrad_state, amstrad_ppi_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, amstrad_state, amstrad_ppi_portc_w))
+ ams40489_ppi_device &ppi(AMS40489_PPI(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(amstrad_state::amstrad_ppi_porta_r));
+ ppi.out_pa_callback().set(FUNC(amstrad_state::amstrad_ppi_porta_w));
+ ppi.in_pb_callback().set(FUNC(amstrad_state::amstrad_ppi_portb_r));
+ ppi.out_pc_callback().set(FUNC(amstrad_state::amstrad_ppi_portc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1119,11 +1119,11 @@ MACHINE_CONFIG_START(amstrad_state::gx4000)
MCFG_MACHINE_START_OVERRIDE(amstrad_state, gx4000 )
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state, gx4000 )
- MCFG_DEVICE_ADD("ppi8255", AMS40489_PPI, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, amstrad_state, amstrad_ppi_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amstrad_state, amstrad_ppi_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, amstrad_state, amstrad_ppi_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, amstrad_state, amstrad_ppi_portc_w))
+ ams40489_ppi_device &ppi(AMS40489_PPI(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(amstrad_state::amstrad_ppi_porta_r));
+ ppi.out_pa_callback().set(FUNC(amstrad_state::amstrad_ppi_porta_w));
+ ppi.in_pb_callback().set(FUNC(amstrad_state::amstrad_ppi_portb_r));
+ ppi.out_pc_callback().set(FUNC(amstrad_state::amstrad_ppi_portc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/amusco.cpp b/src/mame/drivers/amusco.cpp
index 54263f56049..ca7a0a4b692 100644
--- a/src/mame/drivers/amusco.cpp
+++ b/src/mame/drivers/amusco.cpp
@@ -548,15 +548,15 @@ MACHINE_CONFIG_START(amusco_state::amusco)
MCFG_PIT8253_CLK1(PIT_CLOCK1)
MCFG_PIT8253_OUT1_HANDLER(WRITELINE("pic8259", pic8259_device, ir2_w))
- MCFG_DEVICE_ADD("ppi_outputs", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amusco_state, output_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, amusco_state, output_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, amusco_state, output_c_w))
-
- MCFG_DEVICE_ADD("ppi_inputs", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi_outputs(I8255(config, "ppi_outputs"));
+ ppi_outputs.out_pa_callback().set(FUNC(amusco_state::output_a_w));
+ ppi_outputs.out_pb_callback().set(FUNC(amusco_state::output_b_w));
+ ppi_outputs.out_pc_callback().set(FUNC(amusco_state::output_c_w));
+
+ i8255_device &ppi_inputs(I8255(config, "ppi_inputs"));
+ ppi_inputs.in_pa_callback().set_ioport("IN0");
+ ppi_inputs.in_pb_callback().set_ioport("IN1");
+ ppi_inputs.in_pc_callback().set_ioport("IN2");
i8155_device &i8155a(I8155(config, "lpt_interface", 0));
i8155a.out_pa_callback().set(FUNC(amusco_state::lpt_data_w));
diff --git a/src/mame/drivers/amust.cpp b/src/mame/drivers/amust.cpp
index 3b0f301f46d..5224f8e363d 100644
--- a/src/mame/drivers/amust.cpp
+++ b/src/mame/drivers/amust.cpp
@@ -436,19 +436,19 @@ MACHINE_CONFIG_START(amust_state::amust)
MCFG_DEVICE_ADD("pit", PIT8253, 0)
- MCFG_DEVICE_ADD("ppi1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, amust_state, port04_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amust_state, port04_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, amust_state, port05_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, amust_state, port06_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, amust_state, port06_w))
-
- MCFG_DEVICE_ADD("ppi2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, amust_state, port08_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, amust_state, port08_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, amust_state, port09_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, amust_state, port0a_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, amust_state, port0a_w))
+ i8255_device &ppi1(I8255A(config, "ppi1"));
+ ppi1.in_pa_callback().set(FUNC(amust_state::port04_r));
+ ppi1.out_pa_callback().set(FUNC(amust_state::port04_w));
+ ppi1.in_pb_callback().set(FUNC(amust_state::port05_r));
+ ppi1.in_pc_callback().set(FUNC(amust_state::port06_r));
+ ppi1.out_pc_callback().set(FUNC(amust_state::port06_w));
+
+ i8255_device &ppi2(I8255A(config, "ppi2"));
+ ppi2.in_pa_callback().set(FUNC(amust_state::port08_r));
+ ppi2.out_pa_callback().set(FUNC(amust_state::port08_w));
+ ppi2.in_pb_callback().set(FUNC(amust_state::port09_r));
+ ppi2.in_pc_callback().set(FUNC(amust_state::port0a_r));
+ ppi2.out_pc_callback().set(FUNC(amust_state::port0a_w));
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/angelkds.cpp b/src/mame/drivers/angelkds.cpp
index f1fb093f8e7..55135a7deee 100644
--- a/src/mame/drivers/angelkds.cpp
+++ b/src/mame/drivers/angelkds.cpp
@@ -528,16 +528,16 @@ MACHINE_CONFIG_START(angelkds_state::angelkds)
MCFG_DEVICE_PROGRAM_MAP(sub_map)
MCFG_DEVICE_IO_MAP(sub_portmap)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("I40"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("I41"))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, angelkds_state, angeklds_ff_r)) // or left inputs don't work
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, angelkds_state, angelkds_cpu_bank_write))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("I80"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("I81"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("I82"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("I40");
+ ppi0.in_pb_callback().set_ioport("I41");
+ ppi0.in_pc_callback().set(FUNC(angelkds_state::angeklds_ff_r)); // or left inputs don't work
+ ppi0.out_pc_callback().set(FUNC(angelkds_state::angelkds_cpu_bank_write));
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("I80");
+ ppi1.in_pb_callback().set_ioport("I81");
+ ppi1.in_pc_callback().set_ioport("I82");
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
diff --git a/src/mame/drivers/apogee.cpp b/src/mame/drivers/apogee.cpp
index b1cba5b0635..b22547a14e8 100644
--- a/src/mame/drivers/apogee.cpp
+++ b/src/mame/drivers/apogee.cpp
@@ -228,11 +228,11 @@ MACHINE_CONFIG_START(apogee_state::apogee)
MCFG_PIT8253_CLK2(XTAL(16'000'000)/9)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, apogee_state,pit8253_out2_changed))
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, radio86_state, radio86_8255_porta_w2))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, radio86_state, radio86_8255_portb_r2))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, radio86_state, radio86_8255_portc_r2))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_8255_portc_w2))
+ I8255(config, m_ppi8255_1);
+ m_ppi8255_1->out_pa_callback().set(FUNC(radio86_state::radio86_8255_porta_w2));
+ m_ppi8255_1->in_pb_callback().set(FUNC(radio86_state::radio86_8255_portb_r2));
+ m_ppi8255_1->in_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_r2));
+ m_ppi8255_1->out_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_w2));
//MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
diff --git a/src/mame/drivers/astinvad.cpp b/src/mame/drivers/astinvad.cpp
index 5f9bc6b5823..af986b232f2 100644
--- a/src/mame/drivers/astinvad.cpp
+++ b/src/mame/drivers/astinvad.cpp
@@ -678,14 +678,14 @@ MACHINE_CONFIG_START(astinvad_state::kamikaze)
MCFG_MACHINE_START_OVERRIDE(astinvad_state, kamikaze)
MCFG_MACHINE_RESET_OVERRIDE(astinvad_state, kamikaze)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi8255_0);
+ m_ppi8255_0->in_pa_callback().set_ioport("IN0");
+ m_ppi8255_0->in_pb_callback().set_ioport("IN1");
+ m_ppi8255_0->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, astinvad_state, kamikaze_sound1_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, astinvad_state, kamikaze_sound2_w))
+ I8255A(config, m_ppi8255_1);
+ m_ppi8255_1->out_pa_callback().set(FUNC(astinvad_state::kamikaze_sound1_w));
+ m_ppi8255_1->out_pb_callback().set(FUNC(astinvad_state::kamikaze_sound2_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -708,10 +708,9 @@ MACHINE_CONFIG_START(astinvad_state::spcking2)
kamikaze(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("ppi8255_1")
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, astinvad_state, spcking2_sound1_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, astinvad_state, spcking2_sound2_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, astinvad_state, spcking2_sound3_w))
+ m_ppi8255_1->out_pa_callback().set(FUNC(astinvad_state::spcking2_sound1_w));
+ m_ppi8255_1->out_pb_callback().set(FUNC(astinvad_state::spcking2_sound2_w));
+ m_ppi8255_1->out_pc_callback().set(FUNC(astinvad_state::spcking2_sound3_w));
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
diff --git a/src/mame/drivers/atom.cpp b/src/mame/drivers/atom.cpp
index 71e9f271c69..7e3588e92d3 100644
--- a/src/mame/drivers/atom.cpp
+++ b/src/mame/drivers/atom.cpp
@@ -732,11 +732,11 @@ MACHINE_CONFIG_START(atom_state::atom)
via.ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe));
via.irq_handler().set_inputline(SY6502_TAG, M6502_IRQ_LINE);
- MCFG_DEVICE_ADD(INS8255_TAG, I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, atom_state, ppi_pa_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, atom_state, ppi_pb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, atom_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, atom_state, ppi_pc_w))
+ i8255_device &ppi(I8255(config, INS8255_TAG));
+ ppi.out_pa_callback().set(FUNC(atom_state::ppi_pa_w));
+ ppi.in_pb_callback().set(FUNC(atom_state::ppi_pb_r));
+ ppi.in_pc_callback().set(FUNC(atom_state::ppi_pc_r));
+ ppi.out_pc_callback().set(FUNC(atom_state::ppi_pc_w));
I8271(config, m_fdc, 0);
m_fdc->intrq_wr_callback().set(FUNC(atom_state::atom_8271_interrupt_callback));
@@ -839,11 +839,11 @@ MACHINE_CONFIG_START(atom_state::atombb)
via.ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe));
via.irq_handler().set_inputline(SY6502_TAG, M6502_IRQ_LINE);
- MCFG_DEVICE_ADD(INS8255_TAG, I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, atom_state, ppi_pa_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, atom_state, ppi_pb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, atom_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, atom_state, ppi_pc_w))
+ i8255_device &ppi(I8255(config, INS8255_TAG));
+ ppi.out_pa_callback().set(FUNC(atom_state::ppi_pa_w));
+ ppi.in_pb_callback().set(FUNC(atom_state::ppi_pb_r));
+ ppi.in_pc_callback().set(FUNC(atom_state::ppi_pc_r));
+ ppi.out_pc_callback().set(FUNC(atom_state::ppi_pc_w));
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(R6522_TAG, via6522_device, write_ca1))
diff --git a/src/mame/drivers/b2m.cpp b/src/mame/drivers/b2m.cpp
index 66ca1690b6d..7fa08c09810 100644
--- a/src/mame/drivers/b2m.cpp
+++ b/src/mame/drivers/b2m.cpp
@@ -217,19 +217,19 @@ MACHINE_CONFIG_START(b2m_state::b2m)
MCFG_PIT8253_CLK2(2000000)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE("pit8253", pit8253_device, write_clk0))
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, b2m_state, b2m_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, b2m_state, b2m_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, b2m_state, b2m_8255_portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, b2m_state, b2m_8255_portc_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, b2m_state, b2m_ext_8255_portc_w))
-
- MCFG_DEVICE_ADD("ppi8255_3", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, b2m_state, b2m_romdisk_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, b2m_state, b2m_romdisk_portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, b2m_state, b2m_romdisk_portc_w))
+ i8255_device &ppi1(I8255(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(b2m_state::b2m_8255_porta_w));
+ ppi1.in_pb_callback().set(FUNC(b2m_state::b2m_8255_portb_r));
+ ppi1.out_pb_callback().set(FUNC(b2m_state::b2m_8255_portb_w));
+ ppi1.out_pc_callback().set(FUNC(b2m_state::b2m_8255_portc_w));
+
+ i8255_device &ppi2(I8255(config, "ppi8255_2"));
+ ppi2.out_pc_callback().set(FUNC(b2m_state::b2m_ext_8255_portc_w));
+
+ i8255_device &ppi3(I8255(config, "ppi8255_3"));
+ ppi3.in_pa_callback().set(FUNC(b2m_state::b2m_romdisk_porta_r));
+ ppi3.out_pb_callback().set(FUNC(b2m_state::b2m_romdisk_portb_w));
+ ppi3.out_pc_callback().set(FUNC(b2m_state::b2m_romdisk_portc_w));
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
diff --git a/src/mame/drivers/bw2.cpp b/src/mame/drivers/bw2.cpp
index 8a1e68e9078..6dce244ec2c 100644
--- a/src/mame/drivers/bw2.cpp
+++ b/src/mame/drivers/bw2.cpp
@@ -569,11 +569,11 @@ MACHINE_CONFIG_START(bw2_state::bw2)
m_pit->set_clk<2>(0); // Floppy /MTRON
m_pit->out_handler<2>().set(FUNC(bw2_state::mtron_w));
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, bw2_state, ppi_pa_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, bw2_state, ppi_pb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, bw2_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, bw2_state, ppi_pc_w))
+ i8255_device &ppi(I8255A(config, I8255A_TAG));
+ ppi.out_pa_callback().set(FUNC(bw2_state::ppi_pa_w));
+ ppi.in_pb_callback().set(FUNC(bw2_state::ppi_pb_r));
+ ppi.in_pc_callback().set(FUNC(bw2_state::ppi_pc_r));
+ ppi.out_pc_callback().set(FUNC(bw2_state::ppi_pc_w));
MCFG_DEVICE_ADD(MSM6255_TAG, MSM6255, 16_MHz_XTAL)
MCFG_DEVICE_ADDRESS_MAP(0, lcdc_map)
diff --git a/src/mame/drivers/cabaret.cpp b/src/mame/drivers/cabaret.cpp
index 299a58d35c1..8174eb50152 100644
--- a/src/mame/drivers/cabaret.cpp
+++ b/src/mame/drivers/cabaret.cpp
@@ -372,21 +372,21 @@ MACHINE_CONFIG_START(cabaret_state::cabaret)
MCFG_DEVICE_IO_MAP(cabaret_portmap)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cabaret_state, cabaret_interrupt)
- MCFG_DEVICE_ADD("ppi1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("BUTTONS2"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SERVICE"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("COINS"))
-
- MCFG_DEVICE_ADD("ppi2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("BUTTONS1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, cabaret_state, ppi2_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, cabaret_state, ppi2_c_w))
-
- MCFG_DEVICE_ADD("ppi3", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, cabaret_state, nmi_and_coins_w))
- MCFG_I8255_TRISTATE_PORTA_CB(CONSTANT(0xf0))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW2"))
+ i8255_device &ppi1(I8255(config, "ppi1"));
+ ppi1.in_pa_callback().set_ioport("BUTTONS2");
+ ppi1.in_pb_callback().set_ioport("SERVICE");
+ ppi1.in_pc_callback().set_ioport("COINS");
+
+ i8255_device &ppi2(I8255(config, "ppi2"));
+ ppi2.in_pa_callback().set_ioport("BUTTONS1");
+ ppi2.out_pb_callback().set(FUNC(cabaret_state::ppi2_b_w));
+ ppi2.out_pc_callback().set(FUNC(cabaret_state::ppi2_c_w));
+
+ i8255_device &ppi3(I8255(config, "ppi3"));
+ ppi3.out_pa_callback().set(FUNC(cabaret_state::nmi_and_coins_w));
+ ppi3.tri_pa_callback().set_constant(0xf0);
+ ppi3.in_pb_callback().set_ioport("DSW1");
+ ppi3.in_pc_callback().set_ioport("DSW2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/cb2001.cpp b/src/mame/drivers/cb2001.cpp
index c5e0da8751c..c0df4f2fa6d 100644
--- a/src/mame/drivers/cb2001.cpp
+++ b/src/mame/drivers/cb2001.cpp
@@ -828,15 +828,15 @@ MACHINE_CONFIG_START(cb2001_state::cb2001)
MCFG_DEVICE_IO_MAP(cb2001_io)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cb2001_state, vblank_irq)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("IN0");
+ ppi0.in_pb_callback().set_ioport("IN1");
+ ppi0.in_pc_callback().set_ioport("IN2");
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("DSW1");
+ ppi1.in_pb_callback().set_ioport("DSW2");
+ ppi1.in_pc_callback().set_ioport("DSW3");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_cb2001)
diff --git a/src/mame/drivers/cdc721.cpp b/src/mame/drivers/cdc721.cpp
index 775f9b3ea83..f7c3f1eb563 100644
--- a/src/mame/drivers/cdc721.cpp
+++ b/src/mame/drivers/cdc721.cpp
@@ -334,9 +334,9 @@ MACHINE_CONFIG_START(cdc721_state::cdc721)
ctc.zc_callback<1>().set("ctc", FUNC(z80ctc_device::trg2));
//ctc.zc_callback<2>().set("comuart", FUNC(ins8250_device::rclk_w));
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, cdc721_state, interrupt_mask_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, cdc721_state, misc_w))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pb_callback().set(FUNC(cdc721_state::interrupt_mask_w));
+ ppi.out_pc_callback().set(FUNC(cdc721_state::misc_w));
output_latch_device &ledlatch(OUTPUT_LATCH(config, "ledlatch"));
ledlatch.bit_handler<0>().set_output("error").invert();
diff --git a/src/mame/drivers/chinsan.cpp b/src/mame/drivers/chinsan.cpp
index cb533c2893b..ab72d68d0e6 100644
--- a/src/mame/drivers/chinsan.cpp
+++ b/src/mame/drivers/chinsan.cpp
@@ -515,10 +515,10 @@ MACHINE_CONFIG_START(chinsan_state::chinsan)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, chinsan_state, input_select_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, chinsan_state, input_p2_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, chinsan_state, input_p1_r))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(chinsan_state::input_select_w));
+ ppi.in_pb_callback().set(FUNC(chinsan_state::input_p2_r));
+ ppi.in_pc_callback().set(FUNC(chinsan_state::input_p1_r));
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/clayshoo.cpp b/src/mame/drivers/clayshoo.cpp
index f7acdc51792..2aa90a41087 100644
--- a/src/mame/drivers/clayshoo.cpp
+++ b/src/mame/drivers/clayshoo.cpp
@@ -340,11 +340,11 @@ MACHINE_CONFIG_START(clayshoo_state::clayshoo)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_UPDATE_DRIVER(clayshoo_state, screen_update_clayshoo)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
+ I8255A(config, "ppi8255_0");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, clayshoo_state, input_port_select_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, clayshoo_state, input_port_r))
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(clayshoo_state::input_port_select_w));
+ ppi1.in_pb_callback().set(FUNC(clayshoo_state::input_port_r));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/clpoker.cpp b/src/mame/drivers/clpoker.cpp
index a785e9731d7..d06d490b615 100644
--- a/src/mame/drivers/clpoker.cpp
+++ b/src/mame/drivers/clpoker.cpp
@@ -261,15 +261,15 @@ MACHINE_CONFIG_START(clpoker_state::clpoker)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // HY6116ALP-12
- MCFG_DEVICE_ADD("ppi_outputs", I8255, 0) // M5L8255AP-5
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, clpoker_state, output_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, clpoker_state, output_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, clpoker_state, output_c_w))
-
- MCFG_DEVICE_ADD("ppi_inputs", I8255, 0) // M5L8255AP-5
- MCFG_I8255_IN_PORTA_CB(IOPORT("INA"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("INB"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("INC"))
+ i8255_device &ppi_outputs(I8255(config, "ppi_outputs")); // M5L8255AP-5
+ ppi_outputs.out_pa_callback().set(FUNC(clpoker_state::output_a_w));
+ ppi_outputs.out_pb_callback().set(FUNC(clpoker_state::output_b_w));
+ ppi_outputs.out_pc_callback().set(FUNC(clpoker_state::output_c_w));
+
+ i8255_device &ppi_inputs(I8255(config, "ppi_inputs")); // M5L8255AP-5
+ ppi_inputs.in_pa_callback().set_ioport("INA");
+ ppi_inputs.in_pb_callback().set_ioport("INB");
+ ppi_inputs.in_pc_callback().set_ioport("INC");
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(60), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
diff --git a/src/mame/drivers/compis.cpp b/src/mame/drivers/compis.cpp
index 5306646ef6e..ce70b1e4a79 100644
--- a/src/mame/drivers/compis.cpp
+++ b/src/mame/drivers/compis.cpp
@@ -421,7 +421,7 @@ void compis_state::compis2_mem(address_map &map)
void compis_state::compis_io(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0x0007) /* PCS0 */ .mirror(0x78).rw(I8255_TAG, FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0xff00);
+ map(0x0000, 0x0007) /* PCS0 */ .mirror(0x78).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0xff00);
map(0x0080, 0x0087) /* PCS1 */ .mirror(0x78).rw(I8253_TAG, FUNC(pit8253_device::read), FUNC(pit8253_device::write)).umask16(0x00ff);
map(0x0100, 0x011f) /* PCS2 */ .mirror(0x60).rw(MM58174A_TAG, FUNC(mm58274c_device::read), FUNC(mm58274c_device::write)).umask16(0x00ff);
map(0x0180, 0x01ff) /* PCS3 */ .rw(GRAPHICS_TAG, FUNC(compis_graphics_slot_device::pcs3_r), FUNC(compis_graphics_slot_device::pcs3_w));
@@ -774,10 +774,10 @@ MACHINE_CONFIG_START(compis_state::compis)
MCFG_PIT8253_CLK2(15.36_MHz_XTAL/8)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, compis_state, tmr5_w))
- MCFG_DEVICE_ADD(I8255_TAG, I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, compis_state, ppi_pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, compis_state, ppi_pc_w))
+ I8255(config, m_ppi);
+ m_ppi->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_ppi->in_pb_callback().set(FUNC(compis_state::ppi_pb_r));
+ m_ppi->out_pc_callback().set(FUNC(compis_state::ppi_pc_w));
I8251(config, m_uart, 0);
m_uart->txd_handler().set(COMPIS_KEYBOARD_TAG, FUNC(compis_keyboard_device::si_w));
diff --git a/src/mame/drivers/dblcrown.cpp b/src/mame/drivers/dblcrown.cpp
index d3441120833..b931af1c121 100644
--- a/src/mame/drivers/dblcrown.cpp
+++ b/src/mame/drivers/dblcrown.cpp
@@ -626,10 +626,10 @@ MACHINE_CONFIG_START(dblcrown_state::dblcrown)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, dblcrown_state, lamps_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, dblcrown_state, bank_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, dblcrown_state, mux_w))
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(dblcrown_state::lamps_w));
+ ppi.out_pb_callback().set(FUNC(dblcrown_state::bank_w));
+ ppi.out_pc_callback().set(FUNC(dblcrown_state::mux_w));
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/dfruit.cpp b/src/mame/drivers/dfruit.cpp
index 1608a03b732..49b9884d593 100644
--- a/src/mame/drivers/dfruit.cpp
+++ b/src/mame/drivers/dfruit.cpp
@@ -397,10 +397,10 @@ MACHINE_CONFIG_START(dfruit_state::dfruit)
MCFG_DEVICE_ADD("tc0091lvc", TC0091LVC, 0)
MCFG_TC0091LVC_GFXDECODE("gfxdecode")
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi(I8255A(config, "ppi8255_0"));
+ ppi.in_pa_callback().set_ioport("IN0");
+ ppi.in_pb_callback().set_ioport("IN1");
+ ppi.in_pc_callback().set_ioport("IN2");
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/dribling.cpp b/src/mame/drivers/dribling.cpp
index 4ff4841942e..dfe6aab3ace 100644
--- a/src/mame/drivers/dribling.cpp
+++ b/src/mame/drivers/dribling.cpp
@@ -276,16 +276,16 @@ MACHINE_CONFIG_START(dribling_state::dribling)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", dribling_state, dribling_irq_gen)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, dribling_state, dsr_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, dribling_state, input_mux0_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, dribling_state, misc_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, dribling_state, sound_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, dribling_state, pb_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, dribling_state, shr_w))
+ I8255A(config, m_ppi8255_0);
+ m_ppi8255_0->in_pa_callback().set(FUNC(dribling_state::dsr_r));
+ m_ppi8255_0->in_pb_callback().set(FUNC(dribling_state::input_mux0_r));
+ m_ppi8255_0->out_pc_callback().set(FUNC(dribling_state::misc_w));
+
+ I8255A(config, m_ppi8255_1);
+ m_ppi8255_1->out_pa_callback().set(FUNC(dribling_state::sound_w));
+ m_ppi8255_1->out_pb_callback().set(FUNC(dribling_state::pb_w));
+ m_ppi8255_1->in_pc_callback().set_ioport("IN0");
+ m_ppi8255_1->out_pc_callback().set(FUNC(dribling_state::shr_w));
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/dvk_ksm.cpp b/src/mame/drivers/dvk_ksm.cpp
index b3b62ea0ef0..cc9e8188705 100644
--- a/src/mame/drivers/dvk_ksm.cpp
+++ b/src/mame/drivers/dvk_ksm.cpp
@@ -441,11 +441,11 @@ MACHINE_CONFIG_START(ksm_state::ksm)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
// D30
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ksm_state, ksm_ppi_porta_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SA1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SA2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ksm_state, ksm_ppi_portc_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(ksm_state::ksm_ppi_porta_w));
+ ppi.in_pb_callback().set_ioport("SA1");
+ ppi.in_pc_callback().set_ioport("SA2");
+ ppi.out_pc_callback().set(FUNC(ksm_state::ksm_ppi_portc_w));
// D42 - serial connection to host
I8251(config, m_i8251line, 0);
diff --git a/src/mame/drivers/ecoinf2.cpp b/src/mame/drivers/ecoinf2.cpp
index b18959b4f03..04d62472bc0 100644
--- a/src/mame/drivers/ecoinf2.cpp
+++ b/src/mame/drivers/ecoinf2.cpp
@@ -505,31 +505,31 @@ MACHINE_CONFIG_START(ecoinf2_state::ecoinf2_oxo)
config.set_default_layout(layout_ecoinf2);
- MCFG_DEVICE_ADD("ic10_lamp", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic10_write_a_strobedat0))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic10_write_b_strobedat1))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic10_write_c_strobe))
+ i8255_device &ic10_lamp(I8255(config, "ic10_lamp"));
+ ic10_lamp.out_pa_callback().set(FUNC(ecoinf2_state::ppi8255_ic10_write_a_strobedat0));
+ ic10_lamp.out_pb_callback().set(FUNC(ecoinf2_state::ppi8255_ic10_write_b_strobedat1));
+ ic10_lamp.out_pc_callback().set(FUNC(ecoinf2_state::ppi8255_ic10_write_c_strobe));
// IC24 is the workhorse of the Phoenix, it seems to handle meters, payslides, coin lamps, inhibits and the watchdog! */
- MCFG_DEVICE_ADD("ic24_coin", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic24_write_a_meters))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic24_write_b_payouts))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic24_write_c_inhibits))
-
- MCFG_DEVICE_ADD("ic22_inpt", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf2_state, ppi8255_ic22_read_a_levels)) // manual says level switches
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf2_state, ppi8255_ic22_read_b_coins))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf2_state, ppi8255_ic22_read_c_misc)) // 0x20 appears to be meter power
-
- MCFG_DEVICE_ADD("ic23_reel", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic23_write_a_reel01))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic23_write_b_reel23))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf2_state, ppi8255_ic23_read_c_key)) // optos and keys
-
- MCFG_DEVICE_ADD("ic13_leds", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic13_write_a_strobedat0))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf2_state, ppi8255_ic13_write_b_strobedat1))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf2_state, ppi8255_ic13_read_c_panel))
+ i8255_device &ic24_coin(I8255(config, "ic24_coin"));
+ ic24_coin.out_pa_callback().set(FUNC(ecoinf2_state::ppi8255_ic24_write_a_meters));
+ ic24_coin.out_pb_callback().set(FUNC(ecoinf2_state::ppi8255_ic24_write_b_payouts));
+ ic24_coin.out_pc_callback().set(FUNC(ecoinf2_state::ppi8255_ic24_write_c_inhibits));
+
+ i8255_device &ic22_inpt(I8255(config, "ic22_inpt"));
+ ic22_inpt.in_pa_callback().set(FUNC(ecoinf2_state::ppi8255_ic22_read_a_levels)); // manual says level switches
+ ic22_inpt.in_pb_callback().set(FUNC(ecoinf2_state::ppi8255_ic22_read_b_coins));
+ ic22_inpt.in_pc_callback().set(FUNC(ecoinf2_state::ppi8255_ic22_read_c_misc)); // 0x20 appears to be meter power
+
+ i8255_device &ic23_reel(I8255(config, "ic23_reel"));
+ ic23_reel.out_pa_callback().set(FUNC(ecoinf2_state::ppi8255_ic23_write_a_reel01));
+ ic23_reel.out_pb_callback().set(FUNC(ecoinf2_state::ppi8255_ic23_write_b_reel23));
+ ic23_reel.in_pc_callback().set(FUNC(ecoinf2_state::ppi8255_ic23_read_c_key)); // optos and keys
+
+ i8255_device &ic13_leds(I8255(config, "ic13_leds"));
+ ic13_leds.out_pa_callback().set(FUNC(ecoinf2_state::ppi8255_ic13_write_a_strobedat0));
+ ic13_leds.out_pb_callback().set(FUNC(ecoinf2_state::ppi8255_ic13_write_b_strobedat1));
+ ic13_leds.in_pc_callback().set(FUNC(ecoinf2_state::ppi8255_ic13_read_c_panel));
MCFG_DEVICE_ADD("reel0", REEL, ECOIN_200STEP_REEL, 12, 24, 0x09, 7, 200*2)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(*this, ecoinf2_state, reel_optic_cb<0>))
diff --git a/src/mame/drivers/ecoinf3.cpp b/src/mame/drivers/ecoinf3.cpp
index 47a40ee347b..e5207424b26 100644
--- a/src/mame/drivers/ecoinf3.cpp
+++ b/src/mame/drivers/ecoinf3.cpp
@@ -675,69 +675,69 @@ MACHINE_CONFIG_START(ecoinf3_state::ecoinf3_pyramid)
MCFG_DEVICE_ADD("sn1", SN76489, 4000000) // no idea what the sound chip is, this sounds terrible
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
- MCFG_DEVICE_ADD("ppi8255_a", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_a_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_a_write_a_strobedat0))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_a_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_a_write_b_strobedat1))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_a_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_a_write_c_strobe))
-
- MCFG_DEVICE_ADD("ppi8255_b", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_b_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_b_write_a))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_b_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_b_write_b))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_b_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_b_write_c))
-
- MCFG_DEVICE_ADD("ppi8255_c", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_c_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_c_write_a))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_c_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_c_write_b))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_c_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_c_write_c))
-
- MCFG_DEVICE_ADD("ppi8255_d", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_d_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_d_write_a_reel01))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_d_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_d_write_b_reel23))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_d_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_d_write_c))
-
- MCFG_DEVICE_ADD("ppi8255_e", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_e_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_e_write_a_alpha_display)) // alpha display characters
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_e_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_e_write_b)) // not written at an appropriate time for it to be a 'send' address for the text
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_e_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_e_write_c)) // not written at an appropriate time for it to be a 'send' address for the text
-
- MCFG_DEVICE_ADD("ppi8255_f", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_f_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_f_write_a))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_f_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_f_write_b))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_f_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_f_write_c))
-
- MCFG_DEVICE_ADD("ppi8255_g", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_g_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_g_write_a))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_g_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_g_write_b))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_g_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_g_write_c))
-
- MCFG_DEVICE_ADD("ppi8255_h", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ecoinf3_state, ppi8255_intf_h_read_a))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_h_write_a))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ecoinf3_state, ppi8255_intf_h_read_b))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_h_write_b))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ecoinf3_state, ppi8255_intf_h_read_c))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ecoinf3_state, ppi8255_intf_h_write_c))
+ i8255_device &ppia(I8255(config, "ppi8255_a"));
+ ppia.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_a_read_a));
+ ppia.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_a_write_a_strobedat0));
+ ppia.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_a_read_b));
+ ppia.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_a_write_b_strobedat1));
+ ppia.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_a_read_c));
+ ppia.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_a_write_c_strobe));
+
+ i8255_device &ppib(I8255(config, "ppi8255_b"));
+ ppib.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_b_read_a));
+ ppib.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_b_write_a));
+ ppib.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_b_read_b));
+ ppib.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_b_write_b));
+ ppib.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_b_read_c));
+ ppib.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_b_write_c));
+
+ i8255_device &ppic(I8255(config, "ppi8255_c"));
+ ppic.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_c_read_a));
+ ppic.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_c_write_a));
+ ppic.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_c_read_b));
+ ppic.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_c_write_b));
+ ppic.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_c_read_c));
+ ppic.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_c_write_c));
+
+ i8255_device &ppid(I8255(config, "ppi8255_d"));
+ ppid.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_d_read_a));
+ ppid.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_d_write_a_reel01));
+ ppid.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_d_read_b));
+ ppid.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_d_write_b_reel23));
+ ppid.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_d_read_c));
+ ppid.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_d_write_c));
+
+ i8255_device &ppie(I8255(config, "ppi8255_e"));
+ ppie.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_e_read_a));
+ ppie.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_e_write_a_alpha_display)); // alpha display characters
+ ppie.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_e_read_b));
+ ppie.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_e_write_b)); // not written at an appropriate time for it to be a 'send' address for the text
+ ppie.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_e_read_c));
+ ppie.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_e_write_c)); // not written at an appropriate time for it to be a 'send' address for the text
+
+ i8255_device &ppif(I8255(config, "ppi8255_f"));
+ ppif.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_f_read_a));
+ ppif.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_f_write_a));
+ ppif.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_f_read_b));
+ ppif.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_f_write_b));
+ ppif.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_f_read_c));
+ ppif.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_f_write_c));
+
+ i8255_device &ppig(I8255(config, "ppi8255_g"));
+ ppig.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_g_read_a));
+ ppig.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_g_write_a));
+ ppig.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_g_read_b));
+ ppig.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_g_write_b));
+ ppig.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_g_read_c));
+ ppig.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_g_write_c));
+
+ i8255_device &ppih(I8255(config, "ppi8255_h"));
+ ppih.in_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_h_read_a));
+ ppih.out_pa_callback().set(FUNC(ecoinf3_state::ppi8255_intf_h_write_a));
+ ppih.in_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_h_read_b));
+ ppih.out_pb_callback().set(FUNC(ecoinf3_state::ppi8255_intf_h_write_b));
+ ppih.in_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_h_read_c));
+ ppih.out_pc_callback().set(FUNC(ecoinf3_state::ppi8255_intf_h_write_c));
MCFG_DEVICE_ADD("reel0", REEL, ECOIN_200STEP_REEL, 12, 24, 0x09, 7, 200*2)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(*this, ecoinf3_state, reel_optic_cb<0>))
diff --git a/src/mame/drivers/epos.cpp b/src/mame/drivers/epos.cpp
index 355a24ad907..c480cd19feb 100644
--- a/src/mame/drivers/epos.cpp
+++ b/src/mame/drivers/epos.cpp
@@ -493,9 +493,9 @@ MACHINE_CONFIG_START(epos_state::dealer) /* EPOS TRISTAR 9000 PCB */
MCFG_DEVICE_IO_MAP(dealer_io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", epos_state, irq0_line_hold)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, epos_state, i8255_porta_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, epos_state, i8255_portc_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(epos_state::i8255_porta_r));
+ ppi.out_pc_callback().set(FUNC(epos_state::i8255_portc_w));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/excali64.cpp b/src/mame/drivers/excali64.cpp
index e61be693a91..ec64995e75e 100644
--- a/src/mame/drivers/excali64.cpp
+++ b/src/mame/drivers/excali64.cpp
@@ -571,11 +571,11 @@ MACHINE_CONFIG_START(excali64_state::excali64)
//MCFG_PIT8253_OUT1_HANDLER(WRITELINE(*this, excali64_state, write_uart_clock))
//MCFG_PIT8253_CLK2(16_MHz_XTAL / 16) /* Timer 2: not used */
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w)) // parallel port
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, excali64_state, ppib_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, excali64_state, ppic_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, excali64_state, ppic_w))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w)); // parallel port
+ ppi.out_pb_callback().set(FUNC(excali64_state::ppib_w));
+ ppi.in_pc_callback().set(FUNC(excali64_state::ppic_r));
+ ppi.out_pc_callback().set(FUNC(excali64_state::ppic_w));
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp
index ce174d455f9..094442a5397 100644
--- a/src/mame/drivers/fidel6502.cpp
+++ b/src/mame/drivers/fidel6502.cpp
@@ -471,6 +471,7 @@ class fidel6502_state : public fidelbase_state
public:
fidel6502_state(const machine_config &mconfig, device_type type, const char *tag)
: fidelbase_state(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
m_ppi8255(*this, "ppi8255"),
m_rombank(*this, "rombank"),
m_mainmap(*this, "mainmap"),
@@ -482,7 +483,7 @@ public:
void rsc(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(su9_cpu_freq);
- void eas(machine_config &config);
+ void eas(machine_config &config, bool with_ppi_and_nvram = true);
void eag(machine_config &config);
void pc(machine_config &config);
void init_eag();
@@ -523,6 +524,7 @@ public:
private:
// devices/pointers
+ required_device<cpu_device> m_maincpu;
optional_device<i8255_device> m_ppi8255;
optional_memory_bank m_rombank;
optional_device<address_map_bank_device> m_mainmap;
@@ -1833,10 +1835,12 @@ INPUT_PORTS_END
MACHINE_CONFIG_START(fidel6502_state::rsc)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502, 1800000) // measured approx 1.81MHz
- MCFG_DEVICE_PROGRAM_MAP(rsc_map)
+ M6502(config, m_maincpu, 1800000); // measured approx 1.81MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &fidel6502_state::rsc_map);
+
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(546)) // from 555 timer, measured
MCFG_TIMER_START_DELAY(attotime::from_hz(546) - attotime::from_usec(38)) // active for 38us
+
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(546))
pia6821_device &pia(PIA6821(config, "pia", 0)); // MOS 6520
@@ -1853,16 +1857,18 @@ MACHINE_CONFIG_START(fidel6502_state::rsc)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+ DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25);
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
+ vref.set_output(5.0);
+ vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(fidel6502_state::csc)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502, 3.9_MHz_XTAL/2) // from 3.9MHz resonator
- MCFG_DEVICE_PROGRAM_MAP(csc_map)
+ M6502(config, m_maincpu, 3.9_MHz_XTAL/2); // from 3.9MHz resonator
+ m_maincpu->set_addrmap(AS_PROGRAM, &fidel6502_state::csc_map);
+
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(38.4_kHz_XTAL/64)) // through 4060 IC, 600Hz
MCFG_TIMER_START_DELAY(attotime::from_hz(38.4_kHz_XTAL/64) - attotime::from_hz(38.4_kHz_XTAL*2)) // edge!
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(38.4_kHz_XTAL/64))
@@ -1887,82 +1893,84 @@ MACHINE_CONFIG_START(fidel6502_state::csc)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
- MCFG_S14001A_EXT_READ_HANDLER(READ8(*this, fidel6502_state, csc_speech_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
-
- MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+ s14001a_device &speech(S14001A(config, "speech", 25000)); // R/C circuit, around 25khz
+ speech.ext_read().set(FUNC(fidel6502_state::csc_speech_r));
+ speech.add_route(ALL_OUTPUTS, "speaker", 0.75);
+
+ DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25);
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
+ vref.set_output(5.0);
+ vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(fidel6502_state::su9)
+void fidel6502_state::su9(machine_config &config)
+{
csc(config);
- /* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(su9_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &fidel6502_state::su9_map);
MCFG_MACHINE_RESET_OVERRIDE(fidel6502_state, su9)
config.set_default_layout(layout_fidel_su9);
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(fidel6502_state::eas)
+}
+void fidel6502_state::eas(machine_config &config, bool with_ppi_and_nvram)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", R65C02, 3_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(div_trampoline)
+ R65C02(config, m_maincpu, 3_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &fidel6502_state::div_trampoline);
+
+ device_t *device;
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(38.4_kHz_XTAL/64)) // through 4060 IC, 600Hz
MCFG_TIMER_START_DELAY(attotime::from_hz(38.4_kHz_XTAL/64) - attotime::from_hz(38.4_kHz_XTAL*2)) // edge!
- MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(38.4_kHz_XTAL/64))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(38.4_kHz_XTAL/64))
MCFG_TIMER_DRIVER_ADD_PERIODIC("dummy_timer", fidel6502_state, dummy, attotime::from_hz(3_MHz_XTAL))
- ADDRESS_MAP_BANK(config, "mainmap").set_map(&fidel6502_state::eas_map).set_options(ENDIANNESS_LITTLE, 8, 16);
+ ADDRESS_MAP_BANK(config, m_mainmap).set_map(&fidel6502_state::eas_map).set_options(ENDIANNESS_LITTLE, 8, 16);
- MCFG_DEVICE_ADD("ppi8255", I8255, 0) // port B: input, port A & C: output
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, fidel6502_state, eas_ppi_porta_w))
- MCFG_I8255_TRISTATE_PORTA_CB(CONSTANT(0))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, fidel6502_state, eas_ppi_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fidel6502_state, eas_ppi_portc_w))
+ if (with_ppi_and_nvram)
+ {
+ I8255(config, m_ppi8255); // port B: input, port A & C: output
+ m_ppi8255->out_pa_callback().set(FUNC(fidel6502_state::eas_ppi_porta_w));
+ m_ppi8255->tri_pa_callback().set_constant(0);
+ m_ppi8255->in_pb_callback().set(FUNC(fidel6502_state::eas_ppi_portb_r));
+ m_ppi8255->out_pc_callback().set(FUNC(fidel6502_state::eas_ppi_portc_w));
- NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+ }
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
config.set_default_layout(layout_fidel_eas);
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
- MCFG_S14001A_EXT_READ_HANDLER(READ8(*this, fidel6502_state, csc_speech_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
+ s14001a_device &speech(S14001A(config, "speech", 25000)); // R/C circuit, around 25khz
+ speech.ext_read().set(FUNC(fidel6502_state::csc_speech_r));
+ speech.add_route(ALL_OUTPUTS, "speaker", 0.75);
- MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+ DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25);
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
+ vref.set_output(5.0);
+ vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
/* cartridge */
- MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
- MCFG_GENERIC_EXTENSIONS("bin,dat")
- MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge)
- MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc")
-MACHINE_CONFIG_END
+ generic_cartslot_device &cartslot(GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "fidel_scc", "bin,dat"));
+ cartslot.set_device_load(device_image_load_delegate(&fidelbase_state::device_image_load_scc_cartridge, this));
+
+ SOFTWARE_LIST(config, "cart_list").set_original("fidel_scc");
+}
MACHINE_CONFIG_START(fidel6502_state::pc)
- eas(config);
+ eas(config, false);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(4_MHz_XTAL) // R65C02P4
+ m_maincpu->set_clock(4_MHz_XTAL); // R65C02P4
+
MCFG_DEVICE_REMOVE("dummy_timer")
MCFG_TIMER_DRIVER_ADD_PERIODIC("dummy_timer", fidel6502_state, dummy, attotime::from_hz(4_MHz_XTAL))
- MCFG_DEVICE_MODIFY("mainmap")
- MCFG_DEVICE_PROGRAM_MAP(pc_map)
-
- MCFG_DEVICE_REMOVE("ppi8255")
- MCFG_DEVICE_REMOVE("nvram")
+ m_mainmap->set_addrmap(AS_PROGRAM, &fidel6502_state::pc_map);
config.set_default_layout(layout_fidel_pc);
MACHINE_CONFIG_END
@@ -1971,13 +1979,12 @@ MACHINE_CONFIG_START(fidel6502_state::eag)
eas(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(5_MHz_XTAL) // R65C02P4
+ m_maincpu->set_clock(5_MHz_XTAL); // R65C02P4
+
MCFG_DEVICE_REMOVE("dummy_timer")
MCFG_TIMER_DRIVER_ADD_PERIODIC("dummy_timer", fidel6502_state, dummy, attotime::from_hz(5_MHz_XTAL))
- MCFG_DEVICE_MODIFY("mainmap")
- MCFG_DEVICE_PROGRAM_MAP(eag_map)
+ m_mainmap->set_addrmap(AS_PROGRAM, &fidel6502_state::eag_map);
config.set_default_layout(layout_fidel_eag);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp
index db0f270340a..dd0a799b59c 100644
--- a/src/mame/drivers/fidelz80.cpp
+++ b/src/mame/drivers/fidelz80.cpp
@@ -1700,14 +1700,14 @@ MACHINE_CONFIG_START(fidelz80_state::cc10)
MCFG_DEVICE_PROGRAM_MAP(cc10_map)
MCFG_DEVICE_IO_MAP(vcc_io)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, fidelz80_state, cc10_ppi_porta_w))
- MCFG_I8255_TRISTATE_PORTA_CB(CONSTANT(0))
- MCFG_I8255_IN_PORTB_CB(IOPORT("LEVEL"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, fidelz80_state, vcc_ppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, fidelz80_state, vcc_ppi_portc_r))
- MCFG_I8255_TRISTATE_PORTB_CB(CONSTANT(0))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fidelz80_state, vcc_ppi_portc_w))
+ I8255(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set(FUNC(fidelz80_state::cc10_ppi_porta_w));
+ m_ppi8255->tri_pa_callback().set_constant(0);
+ m_ppi8255->in_pb_callback().set_ioport("LEVEL");
+ m_ppi8255->out_pb_callback().set(FUNC(fidelz80_state::vcc_ppi_portb_w));
+ m_ppi8255->in_pc_callback().set(FUNC(fidelz80_state::vcc_ppi_portc_r));
+ m_ppi8255->tri_pb_callback().set_constant(0);
+ m_ppi8255->out_pc_callback().set(FUNC(fidelz80_state::vcc_ppi_portc_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
config.set_default_layout(layout_fidel_cc);
@@ -1726,14 +1726,14 @@ MACHINE_CONFIG_START(fidelz80_state::vcc)
MCFG_DEVICE_PROGRAM_MAP(vcc_map)
MCFG_DEVICE_IO_MAP(vcc_io)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, fidelz80_state, vcc_ppi_porta_w))
- MCFG_I8255_TRISTATE_PORTA_CB(CONSTANT(0))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, fidelz80_state, vcc_ppi_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, fidelz80_state, vcc_ppi_portb_w))
- MCFG_I8255_TRISTATE_PORTB_CB(CONSTANT(0))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, fidelz80_state, vcc_ppi_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fidelz80_state, vcc_ppi_portc_w))
+ I8255(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set(FUNC(fidelz80_state::vcc_ppi_porta_w));
+ m_ppi8255->tri_pa_callback().set_constant(0);
+ m_ppi8255->in_pb_callback().set(FUNC(fidelz80_state::vcc_ppi_portb_r));
+ m_ppi8255->out_pb_callback().set(FUNC(fidelz80_state::vcc_ppi_portb_w));
+ m_ppi8255->tri_pb_callback().set_constant(0);
+ m_ppi8255->in_pc_callback().set(FUNC(fidelz80_state::vcc_ppi_portc_r));
+ m_ppi8255->out_pc_callback().set(FUNC(fidelz80_state::vcc_ppi_portc_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
config.set_default_layout(layout_fidel_vcc);
@@ -1755,10 +1755,10 @@ MACHINE_CONFIG_START(fidelz80_state::vsc)
MCFG_DEVICE_IO_MAP(vsc_io)
MCFG_DEVICE_PERIODIC_INT_DRIVER(fidelz80_state, nmi_line_pulse, 587) // 555 timer, measured
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, fidelz80_state, vsc_ppi_porta_w))
- 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))
+ I8255(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set(FUNC(fidelz80_state::vsc_ppi_porta_w));
+ m_ppi8255->out_pb_callback().set(FUNC(fidelz80_state::vsc_ppi_portb_w));
+ m_ppi8255->out_pc_callback().set(FUNC(fidelz80_state::vsc_ppi_portc_w));
Z80PIO(config, m_z80pio, 3.9_MHz_XTAL);
m_z80pio->in_pa_callback().set(FUNC(fidelz80_state::vsc_pio_porta_r));
diff --git a/src/mame/drivers/fk1.cpp b/src/mame/drivers/fk1.cpp
index ca74ef58a36..16b8bde9d5f 100644
--- a/src/mame/drivers/fk1.cpp
+++ b/src/mame/drivers/fk1.cpp
@@ -439,27 +439,27 @@ MACHINE_CONFIG_START(fk1_state::fk1)
MCFG_PIT8253_CLK2(0)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, fk1_state, fk1_pit_out2))
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, fk1_state, fk1_ppi_1_a_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, fk1_state, fk1_ppi_1_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, fk1_state, fk1_ppi_1_b_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, fk1_state, fk1_ppi_1_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, fk1_state, fk1_ppi_1_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fk1_state, fk1_ppi_1_c_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, fk1_state, fk1_ppi_2_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, fk1_state, fk1_ppi_2_b_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, fk1_state, fk1_ppi_2_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fk1_state, fk1_ppi_2_c_w))
-
- MCFG_DEVICE_ADD("ppi8255_3", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, fk1_state, fk1_ppi_3_a_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, fk1_state, fk1_ppi_3_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, fk1_state, fk1_ppi_3_b_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, fk1_state, fk1_ppi_3_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, fk1_state, fk1_ppi_3_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fk1_state, fk1_ppi_3_c_w))
+ i8255_device &ppi1(I8255(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set(FUNC(fk1_state::fk1_ppi_1_a_r));
+ ppi1.out_pa_callback().set(FUNC(fk1_state::fk1_ppi_1_a_w));
+ ppi1.in_pb_callback().set(FUNC(fk1_state::fk1_ppi_1_b_r));
+ ppi1.out_pb_callback().set(FUNC(fk1_state::fk1_ppi_1_b_w));
+ ppi1.in_pc_callback().set(FUNC(fk1_state::fk1_ppi_1_c_r));
+ ppi1.out_pc_callback().set(FUNC(fk1_state::fk1_ppi_1_c_w));
+
+ i8255_device &ppi2(I8255(config, "ppi8255_2"));
+ ppi2.out_pa_callback().set(FUNC(fk1_state::fk1_ppi_2_a_w));
+ ppi2.in_pb_callback().set(FUNC(fk1_state::fk1_ppi_2_b_r));
+ ppi2.in_pc_callback().set(FUNC(fk1_state::fk1_ppi_2_c_r));
+ ppi2.out_pc_callback().set(FUNC(fk1_state::fk1_ppi_2_c_w));
+
+ i8255_device &ppi3(I8255(config, "ppi8255_3"));
+ ppi3.in_pa_callback().set(FUNC(fk1_state::fk1_ppi_3_a_r));
+ ppi3.out_pa_callback().set(FUNC(fk1_state::fk1_ppi_3_a_w));
+ ppi3.in_pb_callback().set(FUNC(fk1_state::fk1_ppi_3_b_r));
+ ppi3.out_pb_callback().set(FUNC(fk1_state::fk1_ppi_3_b_w));
+ ppi3.in_pc_callback().set(FUNC(fk1_state::fk1_ppi_3_c_r));
+ ppi3.out_pc_callback().set(FUNC(fk1_state::fk1_ppi_3_c_w));
/* uart */
MCFG_DEVICE_ADD("uart", I8251, 0)
diff --git a/src/mame/drivers/flipjack.cpp b/src/mame/drivers/flipjack.cpp
index 0e492642d8e..95ea39780dc 100644
--- a/src/mame/drivers/flipjack.cpp
+++ b/src/mame/drivers/flipjack.cpp
@@ -461,11 +461,11 @@ MACHINE_CONFIG_START(flipjack_state::flipjack)
MCFG_DEVICE_IO_MAP(flipjack_sound_io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", flipjack_state, nmi_line_assert)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("P3"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, flipjack_state, flipjack_portc_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("P1");
+ ppi.in_pb_callback().set_ioport("P2");
+ ppi.in_pc_callback().set_ioport("P3");
+ ppi.out_pc_callback().set(FUNC(flipjack_state::flipjack_portc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/fortecar.cpp b/src/mame/drivers/fortecar.cpp
index 7f452fcd14f..8f34f86ffa2 100644
--- a/src/mame/drivers/fortecar.cpp
+++ b/src/mame/drivers/fortecar.cpp
@@ -703,13 +703,13 @@ MACHINE_CONFIG_START(fortecar_state::fortecar)
EEPROM_93C56_16BIT(config, "eeprom").default_value(0);
- MCFG_DEVICE_ADD("fcppi0", I8255A, 0)
+ i8255_device &fcppi0(I8255A(config, "fcppi0"));
/* Init with 0x9a... A, B and high C as input
Serial Eprom connected to Port C */
- MCFG_I8255_IN_PORTA_CB(IOPORT("SYSTEM"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("INPUT"))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, fortecar_state, ppi0_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, fortecar_state, ppi0_portc_w))
+ fcppi0.in_pa_callback().set_ioport("SYSTEM");
+ fcppi0.in_pb_callback().set_ioport("INPUT");
+ fcppi0.in_pc_callback().set(FUNC(fortecar_state::ppi0_portc_r));
+ fcppi0.out_pc_callback().set(FUNC(fortecar_state::ppi0_portc_w));
MCFG_V3021_ADD("rtc")
diff --git a/src/mame/drivers/freekick.cpp b/src/mame/drivers/freekick.cpp
index b8386e62032..797d222c714 100644
--- a/src/mame/drivers/freekick.cpp
+++ b/src/mame/drivers/freekick.cpp
@@ -844,15 +844,15 @@ MACHINE_CONFIG_START(freekick_state::freekick)
MCFG_MACHINE_START_OVERRIDE(freekick_state,freekick)
MCFG_MACHINE_RESET_OVERRIDE(freekick_state,freekick)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, freekick_state, snd_rom_addr_l_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, freekick_state, snd_rom_addr_h_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, freekick_state, snd_rom_r))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.out_pa_callback().set(FUNC(freekick_state::snd_rom_addr_l_w));
+ ppi0.out_pb_callback().set(FUNC(freekick_state::snd_rom_addr_h_w));
+ ppi0.in_pc_callback().set(FUNC(freekick_state::snd_rom_r));
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("DSW1");
+ ppi1.in_pb_callback().set_ioport("DSW2");
+ ppi1.in_pc_callback().set_ioport("DSW3");
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index 5c8f2ac370c..7eaf2b9c53c 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -5966,21 +5966,22 @@ MACHINE_CONFIG_START(galaxian_state::sidam_bootleg_base)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(galaxian_state::konami_base)
+void galaxian_state::konami_base(machine_config &config)
+{
galaxian_base(config);
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, konami_portc_0_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, galaxian_state, konami_sound_control_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN3"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, konami_portc_1_w))
-MACHINE_CONFIG_END
+ I8255A(config, m_ppi8255[0]);
+ m_ppi8255[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi8255[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi8255[0]->in_pc_callback().set_ioport("IN2");
+ m_ppi8255[0]->out_pc_callback().set(FUNC(galaxian_state::konami_portc_0_w));
+
+ I8255A(config, m_ppi8255[1]);
+ m_ppi8255[1]->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255[1]->out_pb_callback().set(FUNC(galaxian_state::konami_sound_control_w));
+ m_ppi8255[1]->in_pc_callback().set_ioport("IN3");
+ m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::konami_portc_1_w));
+}
MACHINE_CONFIG_START(galaxian_state::konami_sound_1x_ay8910)
@@ -6358,12 +6359,10 @@ MACHINE_CONFIG_START(galaxian_state::theend)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(theend_map)
- MCFG_DEVICE_MODIFY("ppi8255_0")
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, theend_coin_counter_w))
+ m_ppi8255[0]->out_pc_callback().set(FUNC(galaxian_state::theend_coin_counter_w));
- MCFG_DEVICE_MODIFY("ppi8255_1")
- MCFG_I8255_IN_PORTC_CB(READ8(*this, galaxian_state, theend_protection_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, theend_protection_w))
+ m_ppi8255[1]->in_pc_callback().set(FUNC(galaxian_state::theend_protection_r));
+ m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::theend_protection_w));
MACHINE_CONFIG_END
@@ -6374,9 +6373,8 @@ MACHINE_CONFIG_START(galaxian_state::scramble)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(theend_map)
- MCFG_DEVICE_MODIFY("ppi8255_1")
- MCFG_I8255_IN_PORTC_CB(READ8(*this, galaxian_state, theend_protection_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, theend_protection_w))
+ m_ppi8255[1]->in_pc_callback().set(FUNC(galaxian_state::theend_protection_r));
+ m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::theend_protection_w));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxian_state::jungsub)
@@ -6473,9 +6471,8 @@ MACHINE_CONFIG_START(galaxian_state::scorpion)
MCFG_DEVICE_PROGRAM_MAP(scorpion_sound_map)
MCFG_DEVICE_IO_MAP(scorpion_sound_portmap)
- MCFG_DEVICE_MODIFY("ppi8255_1")
- MCFG_I8255_IN_PORTC_CB(READ8(*this, galaxian_state, scorpion_protection_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, scorpion_protection_w))
+ m_ppi8255[1]->in_pc_callback().set(FUNC(galaxian_state::scorpion_protection_r));
+ m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::scorpion_protection_w));
/* extra AY8910 with I/O ports */
MCFG_DEVICE_ADD("8910.2", AY8910, KONAMI_SOUND_CLOCK/8)
@@ -6501,8 +6498,8 @@ MACHINE_CONFIG_START(galaxian_state::sfx)
MCFG_DEVICE_PROGRAM_MAP(sfx_sample_map)
MCFG_DEVICE_IO_MAP(sfx_sample_portmap)
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("soundlatch2", generic_latch_8_device, read))
+ I8255A(config, m_ppi8255[2]);
+ m_ppi8255[2]->in_pa_callback().set("soundlatch2", FUNC(generic_latch_8_device::read));
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
@@ -6526,9 +6523,9 @@ MACHINE_CONFIG_START(galaxian_state::monsterz)
MCFG_DEVICE_PROGRAM_MAP(monsterz_map)
MCFG_DEVICE_MODIFY("ppi8255_1")
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, galaxian_state, monsterz_porta_1_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, galaxian_state, monsterz_portb_1_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, monsterz_portc_1_w))
+ m_ppi8255[1]->out_pa_callback().set(FUNC(galaxian_state::monsterz_porta_1_w));
+ m_ppi8255[1]->out_pb_callback().set(FUNC(galaxian_state::monsterz_portb_1_w));
+ m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::monsterz_portc_1_w));
/* there are likely other differences too, but those can wait until after protection is sorted out */
@@ -6662,8 +6659,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxian_state::moonwar)
scobra(config);
- MCFG_DEVICE_MODIFY("ppi8255_0")
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, galaxian_state, moonwar_port_select_w))
+ m_ppi8255[0]->out_pc_callback().set(FUNC(galaxian_state::moonwar_port_select_w));
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_INIT_OWNER(galaxian_state,moonwar) // bullets are less yellow
diff --git a/src/mame/drivers/gatron.cpp b/src/mame/drivers/gatron.cpp
index 887c8f73349..69ba8132478 100644
--- a/src/mame/drivers/gatron.cpp
+++ b/src/mame/drivers/gatron.cpp
@@ -572,10 +572,10 @@ MACHINE_CONFIG_START(gatron_state::gat)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gatron_state, output_port_1_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("IN0");
+ ppi.in_pb_callback().set_ioport("IN1");
+ ppi.out_pc_callback().set(FUNC(gatron_state::output_port_1_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/gei.cpp b/src/mame/drivers/gei.cpp
index e6da3f1ccb0..9af0823a872 100644
--- a/src/mame/drivers/gei.cpp
+++ b/src/mame/drivers/gei.cpp
@@ -89,6 +89,7 @@ public:
gei_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_ppi(*this, "ppi8255_%u", 0U)
, m_dac(*this, "dac")
, m_ticket(*this, "ticket")
, m_screen(*this, "screen")
@@ -157,6 +158,7 @@ private:
uint8_t m_nmi_mask;
required_device<cpu_device> m_maincpu;
+ required_device_array<i8255_device, 2> m_ppi;
required_device<dac_bit_interface> m_dac;
optional_device<ticket_dispenser_device> m_ticket;
required_device<screen_device> m_screen;
@@ -355,8 +357,8 @@ void gei_state::getrivia_map(address_map &map)
map(0x0000, 0x1fff).rom();
map(0x2000, 0x3fff).bankr("rombank");
map(0x4000, 0x47ff).ram().share("nvram");
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x600f, 0x600f).w(FUNC(gei_state::banksel_w<8>));
map(0x6017, 0x6017).w(FUNC(gei_state::banksel_w<6>));
map(0x601b, 0x601b).w(FUNC(gei_state::banksel_w<4>));
@@ -382,8 +384,8 @@ void gei_state::gselect_map(address_map &map)
map(0x4401, 0x4401).w(FUNC(gei_state::banksel_w<1>));
map(0x4402, 0x4402).w(FUNC(gei_state::banksel_w<2>));
map(0x4403, 0x4403).w(FUNC(gei_state::banksel_w<3>));
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x8000, 0x8002).w(FUNC(gei_state::gei_drawctrl_w));
map(0xc000, 0xffff).ram().w(FUNC(gei_state::gei_bitmap_w));
}
@@ -394,8 +396,8 @@ void gei_state::amuse_map(address_map &map)
map(0x0000, 0x1fff).rom();
map(0x2000, 0x3fff).bankr("rombank");
map(0x4000, 0x47ff).ram().share("nvram");
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x606f, 0x606f).w(FUNC(gei_state::banksel_w<8>));
map(0x6077, 0x6077).w(FUNC(gei_state::banksel_w<6>));
map(0x607b, 0x607b).w(FUNC(gei_state::banksel_w<4>));
@@ -411,8 +413,8 @@ void gei_state::gepoker_map(address_map &map)
map(0x0000, 0x1fff).rom();
map(0x2000, 0x3fff).bankr("rombank");
map(0x4000, 0x47ff).ram().share("nvram");
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x60ef, 0x60ef).w(FUNC(gei_state::banksel_w<4>));
map(0x60f7, 0x60f7).w(FUNC(gei_state::banksel_w<3>));
map(0x60fb, 0x60fb).w(FUNC(gei_state::banksel_w<2>));
@@ -433,8 +435,8 @@ void gei_state::amuse1_map(address_map &map)
map(0x4401, 0x4401).w(FUNC(gei_state::banksel_w<2>));
map(0x4402, 0x4402).w(FUNC(gei_state::banksel_w<4>));
map(0x4403, 0x4403).w(FUNC(gei_state::banksel_w<6>));
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x5800, 0x5fff).rom();
map(0x8000, 0x8002).w(FUNC(gei_state::gei_drawctrl_w));
map(0x8000, 0xbfff).rom(); /* space for diagnostic ROM? */
@@ -447,8 +449,8 @@ void gei_state::findout_map(address_map &map)
map(0x0000, 0xffff).r(FUNC(gei_state::catchall));
map(0x0000, 0x3fff).rom();
map(0x4000, 0x47ff).ram().share("nvram");
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
/* banked ROMs are enabled by low 6 bits of the address */
map(0x601f, 0x601f).w(FUNC(gei_state::banksel_w<0>));
map(0x602f, 0x602f).w(FUNC(gei_state::banksel_w<5>));
@@ -469,8 +471,8 @@ void gei_state::quizvid_map(address_map &map)
map(0x0000, 0xffff).r(FUNC(gei_state::catchall));
map(0x0000, 0x3fff).rom();
map(0x4000, 0x47ff).ram().share("nvram");
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
/* banked ROMs are enabled by low 6 bits of the address */
map(0x602f, 0x602f).r(FUNC(gei_state::banksel_r<5>));
map(0x6037, 0x6037).r(FUNC(gei_state::banksel_r<4>));
@@ -487,8 +489,8 @@ void gei_state::suprpokr_map(address_map &map)
{
map(0x0000, 0x3fff).rom();
map(0x4000, 0x47ff).ram().share("nvram");
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x6200, 0x6200).w(FUNC(gei_state::signature_w));
map(0x6400, 0x6400).r(FUNC(gei_state::signature_r));
map(0x8000, 0x8002).w(FUNC(gei_state::gei_drawctrl_w));
@@ -500,8 +502,8 @@ void gei_state::sprtauth_map(address_map &map)
{
map(0x0000, 0x3fff).rom();
map(0x4000, 0x47ff).ram().share("nvram");
- map(0x4800, 0x4803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0x5000, 0x5003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x4800, 0x4803).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x5000, 0x5003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x5600, 0x5600).r(FUNC(gei_state::signature_r));
map(0x5800, 0x5800).w(FUNC(gei_state::signature_w));
map(0x5a00, 0x5cff).w(FUNC(gei_state::geimulti_bank_w));
@@ -994,15 +996,15 @@ MACHINE_CONFIG_START(gei_state::getrivia)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSWA"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gei_state, sound_w))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("DSWA");
+ m_ppi[0]->in_pb_callback().set_ioport("IN0");
+ m_ppi[0]->out_pc_callback().set(FUNC(gei_state::sound_w));
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, gei_state, lamps_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gei_state, lamps2_w))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN1");
+ m_ppi[1]->out_pb_callback().set(FUNC(gei_state::lamps_w));
+ m_ppi[1]->out_pc_callback().set(FUNC(gei_state::lamps2_w));
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
@@ -1019,11 +1021,8 @@ MACHINE_CONFIG_START(gei_state::findout)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(findout_map)
- MCFG_DEVICE_REMOVE("ppi8255_1")
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, gei_state, lamps_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, gei_state, portC_r))
+ m_ppi[1]->in_pc_callback().set(FUNC(gei_state::portC_r));
+ m_ppi[1]->out_pc_callback().set_nop();
MACHINE_CONFIG_END
MACHINE_CONFIG_START(gei_state::quizvid)
@@ -1046,19 +1045,10 @@ MACHINE_CONFIG_START(gei_state::gselect)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(gselect_map)
- MCFG_DEVICE_REMOVE("ppi8255_0")
- MCFG_DEVICE_REMOVE("ppi8255_1")
+ m_ppi[0]->out_pc_callback().set(FUNC(gei_state::sound2_w));
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSWA"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gei_state, sound2_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, gei_state, lamps_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gei_state, nmi_w))
+ m_ppi[1]->in_pc_callback().set_ioport("IN2");
+ m_ppi[1]->out_pc_callback().set(FUNC(gei_state::nmi_w));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(gei_state::jokpokera)
diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp
index 942326cf61d..5adf78da874 100644
--- a/src/mame/drivers/goldstar.cpp
+++ b/src/mame/drivers/goldstar.cpp
@@ -217,7 +217,6 @@
#include "cpu/z80/z80.h"
#include "cpu/mcs51/mcs51.h"
-#include "machine/i8255.h"
#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "sound/okim6295.h"
@@ -8516,17 +8515,17 @@ MACHINE_CONFIG_START(cb3_state::ncb3)
MCFG_DEVICE_PROGRAM_MAP(ncb3_map)
MCFG_DEVICE_IO_MAP(ncb3_readwriteport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN3"); //Player2 controls, confirmed
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN1");
+ m_ppi[1]->in_pb_callback().set_ioport("IN2");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW1");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -8591,17 +8590,17 @@ MACHINE_CONFIG_START(goldstar_state::wcherry)
MCFG_DEVICE_PROGRAM_MAP(wcherry_map)
MCFG_DEVICE_IO_MAP(wcherry_readwriteport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN3"); //Player2 controls, confirmed
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN1");
+ m_ppi[1]->in_pb_callback().set_ioport("IN2");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW1");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -8640,15 +8639,15 @@ MACHINE_CONFIG_START(cmaster_state::cm)
MCFG_DEVICE_PROGRAM_MAP(cm_map)
MCFG_DEVICE_IO_MAP(cm_portmap)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("DSW1");
+ m_ppi[1]->in_pb_callback().set_ioport("DSW2");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW3");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -8688,15 +8687,15 @@ MACHINE_CONFIG_START(goldstar_state::cmast91)
MCFG_DEVICE_PROGRAM_MAP(cm_map)
MCFG_DEVICE_IO_MAP(cmast91_portmap)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("DSW1");
+ m_ppi[1]->in_pb_callback().set_ioport("DSW2");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW3");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -8738,21 +8737,21 @@ MACHINE_CONFIG_START(wingco_state::lucky8)
MCFG_DEVICE_PROGRAM_MAP(lucky8_map)
//MCFG_DEVICE_IO_MAP(goldstar_readport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN4"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN3");
+ m_ppi[1]->in_pb_callback().set_ioport("IN4");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW1");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, wingco_state, system_outputa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, wingco_state, system_outputb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, system_outputc_w))
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW2");
+ m_ppi[2]->out_pa_callback().set(FUNC(wingco_state::system_outputa_w));
+ m_ppi[2]->out_pb_callback().set(FUNC(wingco_state::system_outputb_w));
+ m_ppi[2]->out_pc_callback().set(FUNC(wingco_state::system_outputc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -8793,21 +8792,21 @@ MACHINE_CONFIG_START(wingco_state::bingowng)
MCFG_DEVICE_PROGRAM_MAP(lucky8_map)
//MCFG_DEVICE_IO_MAP(goldstar_readport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN4"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN3");
+ m_ppi[1]->in_pb_callback().set_ioport("IN4");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW1");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, wingco_state, system_outputa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, wingco_state, system_outputb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, system_outputc_w))
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW2");
+ m_ppi[2]->out_pa_callback().set(FUNC(wingco_state::system_outputa_w));
+ m_ppi[2]->out_pb_callback().set(FUNC(wingco_state::system_outputb_w));
+ m_ppi[2]->out_pc_callback().set(FUNC(wingco_state::system_outputc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -8852,8 +8851,7 @@ MACHINE_CONFIG_START(wingco_state::flam7_w4)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(flaming7_map)
- MCFG_DEVICE_MODIFY("ppi8255_0")
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, fl7w4_outc802_w))
+ m_ppi[0]->out_pc_callback().set(FUNC(wingco_state::fl7w4_outc802_w));
MCFG_DEVICE_ADD(m_fl7w4_id, DS2401)
MACHINE_CONFIG_END
@@ -8867,8 +8865,7 @@ MACHINE_CONFIG_START(wingco_state::flaming7)
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_flaming7)
// to do serial protection.
- MCFG_DEVICE_MODIFY("ppi8255_0")
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, fl7w4_outc802_w))
+ m_ppi[0]->out_pc_callback().set(FUNC(wingco_state::fl7w4_outc802_w));
MCFG_DEVICE_ADD(m_fl7w4_id, DS2401)
MACHINE_CONFIG_END
@@ -8882,8 +8879,7 @@ MACHINE_CONFIG_START(wingco_state::flam7_tw)
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_flam7_tw)
// to do serial protection.
- MCFG_DEVICE_MODIFY("ppi8255_0")
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, fl7w4_outc802_w))
+ m_ppi[0]->out_pc_callback().set(FUNC(wingco_state::fl7w4_outc802_w));
MCFG_DEVICE_ADD(m_fl7w4_id, DS2401)
MACHINE_CONFIG_END
@@ -8920,21 +8916,21 @@ MACHINE_CONFIG_START(wingco_state::magodds)
MCFG_DEVICE_PROGRAM_MAP(magodds_map)
//MCFG_DEVICE_IO_MAP(goldstar_readport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN4"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN3");
+ m_ppi[1]->in_pb_callback().set_ioport("IN4");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW1");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, wingco_state, system_outputa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, wingco_state, system_outputb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, system_outputc_w))
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW2");
+ m_ppi[2]->out_pa_callback().set(FUNC(wingco_state::system_outputa_w));
+ m_ppi[2]->out_pb_callback().set(FUNC(wingco_state::system_outputb_w));
+ m_ppi[2]->out_pc_callback().set(FUNC(wingco_state::system_outputc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -8975,17 +8971,17 @@ MACHINE_CONFIG_START(goldstar_state::kkotnoli)
MCFG_DEVICE_PROGRAM_MAP(kkotnoli_map)
//MCFG_DEVICE_IO_MAP(goldstar_readport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN4"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN3");
+ m_ppi[1]->in_pb_callback().set_ioport("IN4");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW1");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -9019,13 +9015,13 @@ MACHINE_CONFIG_START(goldstar_state::ladylinr)
MCFG_DEVICE_PROGRAM_MAP(ladylinr_map)
//MCFG_DEVICE_IO_MAP(goldstar_readport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("DSW1");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -9062,21 +9058,21 @@ MACHINE_CONFIG_START(wingco_state::wcat3)
MCFG_DEVICE_PROGRAM_MAP(wcat3_map)
//MCFG_DEVICE_IO_MAP(goldstar_readport)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN4"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN3");
+ m_ppi[1]->in_pb_callback().set_ioport("IN4");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW1");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, wingco_state, system_outputa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, wingco_state, system_outputb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, system_outputc_w))
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW2");
+ m_ppi[2]->out_pa_callback().set(FUNC(wingco_state::system_outputa_w));
+ m_ppi[2]->out_pb_callback().set(FUNC(wingco_state::system_outputb_w));
+ m_ppi[2]->out_pc_callback().set(FUNC(wingco_state::system_outputc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -9119,15 +9115,15 @@ MACHINE_CONFIG_START(cmaster_state::amcoe1)
MCFG_DEVICE_PROGRAM_MAP(cm_map)
MCFG_DEVICE_IO_MAP(amcoe1_portmap)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("DSW1");
+ m_ppi[1]->in_pb_callback().set_ioport("DSW2");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW3");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -9176,15 +9172,15 @@ MACHINE_CONFIG_START(cmaster_state::amcoe2)
MCFG_DEVICE_PROGRAM_MAP(cm_map)
MCFG_DEVICE_IO_MAP(amcoe2_portmap)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("DSW1");
+ m_ppi[1]->in_pb_callback().set_ioport("DSW2");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW3");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -9398,20 +9394,21 @@ MACHINE_CONFIG_START(unkch_state::feverch)
MCFG_DEVICE_PROGRAM_MAP(feverch_map)
MCFG_DEVICE_IO_MAP(feverch_portmap)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN4"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("IN3");
+ m_ppi[1]->in_pb_callback().set_ioport("IN4");
+ m_ppi[1]->in_pc_callback().set_ioport("DSW1");
+
+ I8255A(config, m_ppi[2]);
+ m_ppi[2]->in_pa_callback().set_ioport("DSW4");
+ m_ppi[2]->in_pb_callback().set_ioport("DSW2");
+ m_ppi[2]->in_pc_callback().set_ioport("DSW3");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW4"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_SIZE(64*8, 32*8)
diff --git a/src/mame/drivers/gp_1.cpp b/src/mame/drivers/gp_1.cpp
index a2c3a71cfcc..44ce1385b17 100644
--- a/src/mame/drivers/gp_1.cpp
+++ b/src/mame/drivers/gp_1.cpp
@@ -38,6 +38,7 @@ public:
gp_1_state(const machine_config &mconfig, device_type type, const char *tag)
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_ppi(*this, "ppi")
, m_ctc(*this, "ctc")
, m_sn(*this, "snsnd")
, m_io_dsw0(*this, "DSW0")
@@ -72,6 +73,7 @@ private:
virtual void machine_reset() override;
virtual void machine_start() override { m_digits.resolve(); }
required_device<z80_device> m_maincpu;
+ required_device<i8255_device> m_ppi;
required_device<z80ctc_device> m_ctc;
optional_device<sn76477_device> m_sn;
required_ioport m_io_dsw0;
@@ -96,7 +98,7 @@ void gp_1_state::gp_1_map(address_map &map)
void gp_1_state::gp_1_io(address_map &map)
{
map.global_mask(0x0f);
- map(0x04, 0x07).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x04, 0x07).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x08, 0x0b).rw(m_ctc, FUNC(z80ctc_device::read), FUNC(z80ctc_device::write));
}
@@ -449,10 +451,10 @@ MACHINE_CONFIG_START(gp_1_state::gp_1)
genpin_audio(config);
/* Devices */
- MCFG_DEVICE_ADD("ppi", I8255A, 0 )
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, gp_1_state, porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, gp_1_state, portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gp_1_state, portc_w))
+ I8255A(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(gp_1_state::porta_w));
+ m_ppi->in_pb_callback().set(FUNC(gp_1_state::portb_r));
+ m_ppi->out_pc_callback().set(FUNC(gp_1_state::portc_w));
Z80CTC(config, m_ctc, 2457600);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); // Todo: absence of ints will cause a watchdog reset
@@ -478,11 +480,7 @@ MACHINE_CONFIG_START(gp_1_state::gp_1s)
MCFG_SN76477_ENABLE(1) // enable
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_DEVICE_REMOVE("ppi")
- MCFG_DEVICE_ADD("ppi", I8255A, 0 )
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, gp_1_state, portas_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, gp_1_state, portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gp_1_state, portc_w))
+ m_ppi->out_pa_callback().set(FUNC(gp_1_state::portas_w));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gp_2.cpp b/src/mame/drivers/gp_2.cpp
index 4c7cdbb2a5d..6056960d33a 100644
--- a/src/mame/drivers/gp_2.cpp
+++ b/src/mame/drivers/gp_2.cpp
@@ -598,10 +598,10 @@ MACHINE_CONFIG_START(gp_2_state::gp_2)
genpin_audio(config);
/* Devices */
- MCFG_DEVICE_ADD("ppi", I8255A, 0 )
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, gp_2_state, porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, gp_2_state, portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gp_2_state, portc_w))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(gp_2_state::porta_w));
+ ppi.in_pb_callback().set(FUNC(gp_2_state::portb_r));
+ ppi.out_pc_callback().set(FUNC(gp_2_state::portc_w));
Z80CTC(config, m_ctc, 2457600);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); // Todo: absence of ints will cause a watchdog reset
diff --git a/src/mame/drivers/gsword.cpp b/src/mame/drivers/gsword.cpp
index 02c4d71f35a..2b10e977403 100644
--- a/src/mame/drivers/gsword.cpp
+++ b/src/mame/drivers/gsword.cpp
@@ -868,10 +868,10 @@ MACHINE_CONFIG_START(josvolly_state::josvolly)
mcu2.t0_in_cb().set("mcu1", FUNC(i8741_device::p2_r)).bit(0);
mcu2.t1_in_cb().set("mcu1", FUNC(i8741_device::p2_r)).bit(1);
- MCFG_DEVICE_ADD("aa_007", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) // 1PL
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN2")) // 2PL / ACK
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN0")) // START
+ i8255_device &ppi(I8255(config, "aa_007"));
+ ppi.in_pa_callback().set_ioport("IN1"); // 1PL
+ ppi.in_pb_callback().set_ioport("IN2"); // 2PL / ACK
+ ppi.in_pc_callback().set_ioport("IN0"); // START
// the second MCU polls the first MCU's outputs, so it needs tight sync
MCFG_QUANTUM_PERFECT_CPU("mcu2")
diff --git a/src/mame/drivers/guab.cpp b/src/mame/drivers/guab.cpp
index c759d3121ee..5414121802f 100644
--- a/src/mame/drivers/guab.cpp
+++ b/src/mame/drivers/guab.cpp
@@ -507,27 +507,27 @@ MACHINE_CONFIG_START(guab_state::guab)
ptm.set_external_clocks(0, 0, 0);
ptm.irq_callback().set_inputline("maincpu", 3);
- MCFG_DEVICE_ADD("i8255_1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
-
- MCFG_DEVICE_ADD("i8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, guab_state, output1_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, guab_state, output2_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, guab_state, output3_w))
-
- MCFG_DEVICE_ADD("i8255_3", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, guab_state, output4_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, guab_state, output5_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, guab_state, output6_w))
-
- MCFG_DEVICE_ADD("i8255_4", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, guab_state, sn76489_ready_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, guab_state, sn76489_buffer_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, guab_state, system_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, guab_state, watchdog_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, guab_state, watchdog_w))
+ i8255_device &ppi1(I8255(config, "i8255_1"));
+ ppi1.in_pa_callback().set_ioport("IN0");
+ ppi1.in_pb_callback().set_ioport("IN1");
+ ppi1.in_pc_callback().set_ioport("IN2");
+
+ i8255_device &ppi2(I8255(config, "i8255_2"));
+ ppi2.out_pa_callback().set(FUNC(guab_state::output1_w));
+ ppi2.out_pb_callback().set(FUNC(guab_state::output2_w));
+ ppi2.out_pc_callback().set(FUNC(guab_state::output3_w));
+
+ i8255_device &ppi3(I8255(config, "i8255_3"));
+ ppi3.out_pa_callback().set(FUNC(guab_state::output4_w));
+ ppi3.out_pb_callback().set(FUNC(guab_state::output5_w));
+ ppi3.out_pc_callback().set(FUNC(guab_state::output6_w));
+
+ i8255_device &ppi4(I8255(config, "i8255_4"));
+ ppi4.in_pa_callback().set(FUNC(guab_state::sn76489_ready_r));
+ ppi4.out_pa_callback().set(FUNC(guab_state::sn76489_buffer_w));
+ ppi4.out_pb_callback().set(FUNC(guab_state::system_w));
+ ppi4.in_pc_callback().set(FUNC(guab_state::watchdog_r));
+ ppi4.out_pc_callback().set(FUNC(guab_state::watchdog_w));
acia6850_device &acia1(ACIA6850(config, "acia6850_1", 0));
acia1.txd_handler().set("rs232_1", FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/himesiki.cpp b/src/mame/drivers/himesiki.cpp
index a9b51b1a2c8..99054c5fed5 100644
--- a/src/mame/drivers/himesiki.cpp
+++ b/src/mame/drivers/himesiki.cpp
@@ -438,15 +438,15 @@ MACHINE_CONFIG_START(himesiki_state::himesiki)
MCFG_DEVICE_PROGRAM_MAP(himesiki_prm1)
MCFG_DEVICE_IO_MAP(himesiki_iom1)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("1P"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("2P"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("OTHERS"))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, himesiki_state, himesiki_rombank_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("1P");
+ ppi0.in_pb_callback().set_ioport("2P");
+ ppi0.in_pc_callback().set_ioport("OTHERS");
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("DSW1");
+ ppi1.in_pb_callback().set_ioport("DSW2");
+ ppi1.out_pc_callback().set(FUNC(himesiki_state::himesiki_rombank_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/homerun.cpp b/src/mame/drivers/homerun.cpp
index de928024833..ae2d7d59aa1 100644
--- a/src/mame/drivers/homerun.cpp
+++ b/src/mame/drivers/homerun.cpp
@@ -358,10 +358,10 @@ MACHINE_CONFIG_START(homerun_state::dynashot)
MCFG_DEVICE_IO_MAP(homerun_iomap)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", homerun_state, irq0_line_hold)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, homerun_state, homerun_scrollhi_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, homerun_state, homerun_scrolly_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, homerun_state, homerun_scrollx_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(homerun_state::homerun_scrollhi_w));
+ ppi.out_pb_callback().set(FUNC(homerun_state::homerun_scrolly_w));
+ ppi.out_pc_callback().set(FUNC(homerun_state::homerun_scrollx_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/ibm6580.cpp b/src/mame/drivers/ibm6580.cpp
index bc441e2de96..754bce9a6e2 100644
--- a/src/mame/drivers/ibm6580.cpp
+++ b/src/mame/drivers/ibm6580.cpp
@@ -904,11 +904,11 @@ MACHINE_CONFIG_START(ibm6580_state::ibm6580)
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, ibm6580_state, ppi_a_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ibm6580_state, led_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ibm6580_state, ppi_c_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ibm6580_state, ppi_c_r))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(ibm6580_state::ppi_a_r));
+ ppi.out_pb_callback().set(FUNC(ibm6580_state::led_w));
+ ppi.out_pc_callback().set(FUNC(ibm6580_state::ppi_c_w));
+ ppi.in_pc_callback().set(FUNC(ibm6580_state::ppi_c_r));
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp
index cd4e138f1ba..de23ec2cd99 100644
--- a/src/mame/drivers/ibmpcjr.cpp
+++ b/src/mame/drivers/ibmpcjr.cpp
@@ -612,10 +612,10 @@ MACHINE_CONFIG_START(pcjr_state::ibmpcjr)
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, pcjr_state, pic8259_set_int_line))
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(CONSTANT(0xff))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pcjr_state, pcjr_ppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pcjr_state, pcjr_ppi_portc_r))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.in_pa_callback().set_constant(0xff);
+ ppi.out_pb_callback().set(FUNC(pcjr_state::pcjr_ppi_portb_w));
+ ppi.in_pc_callback().set(FUNC(pcjr_state::pcjr_ppi_portc_r));
MCFG_DEVICE_ADD( "ins8250", INS8250, XTAL(1'843'200) )
MCFG_INS8250_OUT_TX_CB(WRITELINE("serport", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/ice_tbd.cpp b/src/mame/drivers/ice_tbd.cpp
index 1cd013c8c13..22955fde737 100644
--- a/src/mame/drivers/ice_tbd.cpp
+++ b/src/mame/drivers/ice_tbd.cpp
@@ -73,10 +73,10 @@ MACHINE_CONFIG_START(ice_tbd_state::ice_tbd)
MCFG_DEVICE_PROGRAM_MAP(ice_tbd_map)
MCFG_DEVICE_IO_MAP(ice_tbd_io_map)
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(NOOP) // ?
- MCFG_I8255_OUT_PORTB_CB(NOOP) // ?
- MCFG_I8255_IN_PORTC_CB(CONSTANT(0)) // ?
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.out_pa_callback().set_nop(); // ?
+ ppi.out_pb_callback().set_nop(); // ?
+ ppi.in_pc_callback().set_constant(0); // ?
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/idsa.cpp b/src/mame/drivers/idsa.cpp
index a27a3977f8d..11b2bfcac01 100644
--- a/src/mame/drivers/idsa.cpp
+++ b/src/mame/drivers/idsa.cpp
@@ -368,14 +368,15 @@ MACHINE_CONFIG_START(idsa_state::bsktbllp)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, idsa_state, ppi_control_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, idsa_state, ppi_data_w))
- MCFG_DEVICE_ADD("ppi1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, idsa_state, ppi1_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, idsa_state, ppi1_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, idsa_state, ppi1_c_w))
- MCFG_DEVICE_ADD("ppi2", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, idsa_state, ppi2_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, idsa_state, ppi2_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, idsa_state, ppi2_c_w))
+ I8255(config, m_ppi[0]);
+ m_ppi[0]->out_pa_callback().set(FUNC(idsa_state::ppi1_a_w));
+ m_ppi[0]->out_pb_callback().set(FUNC(idsa_state::ppi1_b_w));
+ m_ppi[0]->out_pc_callback().set(FUNC(idsa_state::ppi1_c_w));
+
+ I8255(config, m_ppi[1]);
+ m_ppi[1]->out_pa_callback().set(FUNC(idsa_state::ppi2_a_w));
+ m_ppi[1]->out_pb_callback().set(FUNC(idsa_state::ppi2_b_w));
+ m_ppi[1]->out_pc_callback().set(FUNC(idsa_state::ppi2_c_w));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/igs009.cpp b/src/mame/drivers/igs009.cpp
index 3fe9425892a..d8d3767caa1 100644
--- a/src/mame/drivers/igs009.cpp
+++ b/src/mame/drivers/igs009.cpp
@@ -836,15 +836,15 @@ MACHINE_CONFIG_START(igs009_state::jingbell)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, igs009_state, nmi_and_coins_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SERVICE"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("COINS"))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("BUTTONS1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, igs009_state, video_and_leds_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, igs009_state, leds_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.out_pa_callback().set(FUNC(igs009_state::nmi_and_coins_w));
+ ppi0.in_pb_callback().set_ioport("SERVICE");
+ ppi0.in_pc_callback().set_ioport("COINS");
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("BUTTONS1");
+ ppi1.out_pb_callback().set(FUNC(igs009_state::video_and_leds_w));
+ ppi1.out_pc_callback().set(FUNC(igs009_state::leds_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp
index c7a45dc6489..52cd90d5dae 100644
--- a/src/mame/drivers/igs017.cpp
+++ b/src/mame/drivers/igs017.cpp
@@ -3562,10 +3562,10 @@ MACHINE_CONFIG_START(igs017_state::iqblocka)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,iqblocka)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("DSW1");
+ ppi.in_pb_callback().set_ioport("DSW2");
+ ppi.in_pc_callback().set_ioport("DSW3");
// protection
MCFG_DEVICE_ADD("igs_bitswap", IGS_BITSWAP, 0)
@@ -3659,9 +3659,9 @@ MACHINE_CONFIG_START(igs017_state::mgcs)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("COINS"))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, igs017_state, mgcs_keys_r))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("COINS");
+ ppi.in_pb_callback().set(FUNC(igs017_state::mgcs_keys_r));
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW )
@@ -3698,10 +3698,10 @@ MACHINE_CONFIG_START(igs017_state::lhzb2)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("COINS"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW2"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("COINS");
+ ppi.in_pb_callback().set_ioport("DSW1");
+ ppi.in_pc_callback().set_ioport("DSW2");
// protection
MCFG_DEVICE_ADD("igs025", IGS025, 0)
@@ -3794,10 +3794,10 @@ MACHINE_CONFIG_START(igs017_state::slqz2)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("COINS"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW2"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("COINS");
+ ppi.in_pb_callback().set_ioport("DSW1");
+ ppi.in_pc_callback().set_ioport("DSW2");
// protection
MCFG_DEVICE_ADD("igs025", IGS025, 0)
@@ -3838,9 +3838,9 @@ MACHINE_CONFIG_START(igs017_state::sdmg2)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("DSW1");
+ ppi.in_pb_callback().set_ioport("DSW2");
// video
MCFG_SCREEN_ADD("screen", RASTER)
@@ -3885,8 +3885,8 @@ MACHINE_CONFIG_START(igs017_state::mgdha)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("DSW1");
// video
MCFG_SCREEN_ADD("screen", RASTER)
@@ -3921,10 +3921,10 @@ MACHINE_CONFIG_START(igs017_state::tjsb)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,iqblocka)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("DSW1");
+ ppi.in_pb_callback().set_ioport("DSW2");
+ ppi.in_pc_callback().set_ioport("DSW3");
// video
MCFG_SCREEN_ADD("screen", RASTER)
@@ -3963,10 +3963,10 @@ MACHINE_CONFIG_START(igs017_state::spkrform)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,iqblocka)
// i/o
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("DSW1");
+ ppi.in_pb_callback().set_ioport("DSW2");
+ ppi.in_pc_callback().set_ioport("DSW3");
// video
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/igspoker.cpp b/src/mame/drivers/igspoker.cpp
index e213001a994..e29eb7cd45c 100644
--- a/src/mame/drivers/igspoker.cpp
+++ b/src/mame/drivers/igspoker.cpp
@@ -1929,10 +1929,10 @@ MACHINE_CONFIG_START(igspoker_state::igspoker)
MCFG_DEVICE_IO_MAP(igspoker_io_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igspoker_state, igs_interrupt, "screen", 0, 1)
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, igspoker_state, igs_nmi_and_coins_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SERVICE"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("COINS"))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(igspoker_state::igs_nmi_and_coins_w));
+ ppi.in_pb_callback().set_ioport("SERVICE");
+ ppi.in_pc_callback().set_ioport("COINS");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/inder.cpp b/src/mame/drivers/inder.cpp
index a6da752246c..7d3f6647514 100644
--- a/src/mame/drivers/inder.cpp
+++ b/src/mame/drivers/inder.cpp
@@ -1441,45 +1441,23 @@ MACHINE_CONFIG_START(inder_state::inder)
m_msm->add_route(ALL_OUTPUTS, "msmvol", 1.0);
/* Devices */
- MCFG_DEVICE_ADD("ppi60", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, inder_state, ppi60a_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, inder_state, ppi60a_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, inder_state, ppi60b_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, inder_state, ppi60b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, inder_state, sw_r))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, inder_state, ppi60c_w))
-
- MCFG_DEVICE_ADD("ppi64", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, inder_state, ppi64a_r))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, inder_state, ppi64a_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, inder_state, ppi64b_r))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, inder_state, ppi64b_w))
- //MCFG_I8255_IN_PORTC_CB(READ8(*this, inder_state, ppi64c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, inder_state, ppi64c_w))
-
- MCFG_DEVICE_ADD("ppi68", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, inder_state, ppi68a_r))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, inder_state, ppi68a_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, inder_state, ppi68b_r))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, inder_state, ppi68b_w))
- //MCFG_I8255_IN_PORTC_CB(READ8(*this, inder_state, ppi68c_r))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, inder_state, ppi68c_w))
-
- MCFG_DEVICE_ADD("ppi6c", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, inder_state, ppi6ca_r))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, inder_state, ppi6ca_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, inder_state, ppi6cb_r))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, inder_state, ppi6cb_w))
- //MCFG_I8255_IN_PORTC_CB(READ8(*this, inder_state, ppi6cc_r))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, inder_state, ppi6cc_w))
-
- MCFG_DEVICE_ADD("ppi", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, inder_state, ppia_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, inder_state, ppia_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, inder_state, ppib_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, inder_state, ppib_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, inder_state, ppic_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, inder_state, ppic_w))
+ i8255_device &ppi60(I8255A(config, "ppi60"));
+ ppi60.out_pa_callback().set(FUNC(inder_state::ppi60a_w));
+ ppi60.out_pb_callback().set(FUNC(inder_state::ppi60b_w));
+ ppi60.in_pc_callback().set(FUNC(inder_state::sw_r));
+
+ i8255_device &ppi64(I8255A(config, "ppi64"));
+ ppi64.out_pc_callback().set(FUNC(inder_state::ppi64c_w));
+
+ I8255A(config, "ppi68");
+
+ I8255A(config, "ppi6c");
+
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(inder_state::ppia_w));
+ ppi.out_pb_callback().set(FUNC(inder_state::ppib_w));
+ ppi.in_pc_callback().set(FUNC(inder_state::ppic_r));
+ ppi.out_pc_callback().set(FUNC(inder_state::ppic_w));
TTL7474(config, m_7a, 0);
m_7a->comp_output_cb().set(FUNC(inder_state::qc7a_w));
diff --git a/src/mame/drivers/iq151.cpp b/src/mame/drivers/iq151.cpp
index 1a522c39821..0c2f60197c7 100644
--- a/src/mame/drivers/iq151.cpp
+++ b/src/mame/drivers/iq151.cpp
@@ -415,11 +415,11 @@ MACHINE_CONFIG_START(iq151_state::iq151)
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, iq151_state, keyboard_row_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, iq151_state, keyboard_column_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, iq151_state, ppi_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, iq151_state, ppi_portc_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(iq151_state::keyboard_row_r));
+ ppi.in_pb_callback().set(FUNC(iq151_state::keyboard_column_r));
+ ppi.in_pc_callback().set(FUNC(iq151_state::ppi_portc_r));
+ ppi.out_pc_callback().set(FUNC(iq151_state::ppi_portc_w));
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED)
diff --git a/src/mame/drivers/iqblock.cpp b/src/mame/drivers/iqblock.cpp
index 3c747a0ba2f..526b25f5b89 100644
--- a/src/mame/drivers/iqblock.cpp
+++ b/src/mame/drivers/iqblock.cpp
@@ -348,11 +348,11 @@ MACHINE_CONFIG_START(iqblock_state::iqblock)
MCFG_DEVICE_IO_MAP(main_portmap)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", iqblock_state, irq, "screen", 0, 1)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("EXTRA"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, iqblock_state, port_C_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("P1");
+ ppi.in_pb_callback().set_ioport("P2");
+ ppi.in_pc_callback().set_ioport("EXTRA");
+ ppi.out_pc_callback().set(FUNC(iqblock_state::port_C_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/irisha.cpp b/src/mame/drivers/irisha.cpp
index 725b16c2d5c..b468d88bd40 100644
--- a/src/mame/drivers/irisha.cpp
+++ b/src/mame/drivers/irisha.cpp
@@ -400,12 +400,12 @@ MACHINE_CONFIG_START(irisha_state::irisha)
m_pit->set_clk<2>(16_MHz_XTAL / 9);
m_pit->out_handler<2>().set(FUNC(irisha_state::speaker_w));
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, irisha_state, irisha_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, irisha_state, irisha_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, irisha_state, irisha_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, irisha_state, irisha_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, irisha_state, irisha_8255_portc_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(irisha_state::irisha_8255_porta_w));
+ ppi.in_pb_callback().set(FUNC(irisha_state::irisha_8255_portb_r));
+ ppi.out_pb_callback().set(FUNC(irisha_state::irisha_8255_portb_w));
+ ppi.in_pc_callback().set(FUNC(irisha_state::irisha_8255_portc_r));
+ ppi.out_pc_callback().set(FUNC(irisha_state::irisha_8255_portc_w));
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
diff --git a/src/mame/drivers/isbc.cpp b/src/mame/drivers/isbc.cpp
index 730517e0490..052249359c8 100644
--- a/src/mame/drivers/isbc.cpp
+++ b/src/mame/drivers/isbc.cpp
@@ -342,7 +342,7 @@ MACHINE_CONFIG_START(isbc_state::isbc86)
MCFG_PIT8253_CLK2(XTAL(22'118'400)/18)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, isbc_state, isbc86_tmr2_w))
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
+ I8255A(config, "ppi");
I8251(config, m_uart8251, 0);
m_uart8251->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
@@ -375,7 +375,7 @@ MACHINE_CONFIG_START(isbc_state::rpc86)
MCFG_PIT8253_CLK2(XTAL(22'118'400)/18)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, isbc_state, isbc86_tmr2_w))
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
+ I8255A(config, "ppi");
I8251(config, m_uart8251, 0);
m_uart8251->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
@@ -453,10 +453,10 @@ MACHINE_CONFIG_START(isbc_state::isbc286)
MCFG_PIT8253_CLK2(XTAL(22'118'400)/18)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, isbc_state, isbc286_tmr2_w))
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTB_CB(READ8("cent_status_in", input_buffer_device, bus_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, isbc_state, ppi_c_w))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ ppi.in_pb_callback().set("cent_status_in", FUNC(input_buffer_device::bus_r));
+ ppi.out_pc_callback().set(FUNC(isbc_state::ppi_c_w));
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(*this, isbc_state, write_centronics_ack))
diff --git a/src/mame/drivers/istrebiteli.cpp b/src/mame/drivers/istrebiteli.cpp
index 658592f0609..e078cd65be8 100644
--- a/src/mame/drivers/istrebiteli.cpp
+++ b/src/mame/drivers/istrebiteli.cpp
@@ -585,15 +585,15 @@ MACHINE_CONFIG_START(istrebiteli_state::istreb)
MCFG_DEVICE_PROGRAM_MAP(mem_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_DEVICE_ADD("ppi0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, istrebiteli_state, sound_w))
+ i8255_device &ppi0(I8255A(config, "ppi0"));
+ ppi0.in_pa_callback().set_ioport("IN1");
+ ppi0.in_pb_callback().set_ioport("IN0");
+ ppi0.out_pc_callback().set(FUNC(istrebiteli_state::sound_w));
- MCFG_DEVICE_ADD("ppi1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, istrebiteli_state, spr0_ctrl_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, istrebiteli_state, spr1_ctrl_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi1(I8255A(config, "ppi1"));
+ ppi1.out_pa_callback().set(FUNC(istrebiteli_state::spr0_ctrl_w));
+ ppi1.out_pb_callback().set(FUNC(istrebiteli_state::spr1_ctrl_w));
+ ppi1.in_pc_callback().set_ioport("IN2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -617,14 +617,14 @@ MACHINE_CONFIG_START(istrebiteli_state::motogonki)
MCFG_DEVICE_PROGRAM_MAP(moto_mem_map)
MCFG_DEVICE_IO_MAP(moto_io_map)
- MCFG_DEVICE_ADD("ppi0", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, istrebiteli_state, spr0_ctrl_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, istrebiteli_state, spr1_ctrl_w))
+ i8255_device &ppi0(I8255A(config, "ppi0"));
+ ppi0.out_pa_callback().set(FUNC(istrebiteli_state::spr0_ctrl_w));
+ ppi0.out_pb_callback().set(FUNC(istrebiteli_state::spr1_ctrl_w));
- MCFG_DEVICE_ADD("ppi1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, istrebiteli_state, road_ctrl_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN1"))
+ i8255_device &ppi1(I8255A(config, "ppi1"));
+ ppi1.in_pa_callback().set_ioport("IN0");
+ ppi1.out_pb_callback().set(FUNC(istrebiteli_state::road_ctrl_w));
+ ppi1.in_pc_callback().set_ioport("IN1");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/jackie.cpp b/src/mame/drivers/jackie.cpp
index e74456d48d1..c9a86ceed6a 100644
--- a/src/mame/drivers/jackie.cpp
+++ b/src/mame/drivers/jackie.cpp
@@ -622,14 +622,14 @@ MACHINE_CONFIG_START(jackie_state::jackie)
MCFG_DEVICE_IO_MAP(jackie_io_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", jackie_state, irq, "screen", 0, 1)
- MCFG_DEVICE_ADD("ppi1", I8255A, 0) // D8255AC
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, jackie_state, nmi_and_coins_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SERVICE"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("COINS"))
-
- MCFG_DEVICE_ADD("ppi2", I8255A, 0) // D8255AC
- MCFG_I8255_IN_PORTA_CB(IOPORT("BUTTONS1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, jackie_state, lamps_w))
+ i8255_device &ppi1(I8255A(config, "ppi1")); // D8255AC
+ ppi1.out_pa_callback().set(FUNC(jackie_state::nmi_and_coins_w));
+ ppi1.in_pb_callback().set_ioport("SERVICE");
+ ppi1.in_pc_callback().set_ioport("COINS");
+
+ i8255_device &ppi2(I8255A(config, "ppi2")); // D8255AC
+ ppi2.in_pa_callback().set_ioport("BUTTONS1");
+ ppi2.out_pb_callback().set(FUNC(jackie_state::lamps_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/jankenmn.cpp b/src/mame/drivers/jankenmn.cpp
index d3d451b697a..9f836a121d0 100644
--- a/src/mame/drivers/jankenmn.cpp
+++ b/src/mame/drivers/jankenmn.cpp
@@ -390,17 +390,17 @@ MACHINE_CONFIG_START(jankenmn_state::jankenmn)
m_maincpu->set_addrmap(AS_PROGRAM, &jankenmn_state::jankenmn_map);
m_maincpu->set_addrmap(AS_IO, &jankenmn_state::jankenmn_port_map);
- MCFG_DEVICE_ADD("ppi8255_0", I8255, 0)
+ i8255_device &ppi0(I8255(config, "ppi8255_0"));
/* (10-13) Mode 0 - Ports A & B set as input, high C & low C as output. */
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jankenmn_state, lamps3_w))
+ ppi0.in_pa_callback().set_ioport("DSW");
+ ppi0.in_pb_callback().set_ioport("IN0");
+ ppi0.out_pc_callback().set(FUNC(jankenmn_state::lamps3_w));
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
+ i8255_device &ppi1(I8255(config, "ppi8255_1"));
/* (20-23) Mode 0 - Ports A, B, high C & low C set as output. */
- MCFG_I8255_OUT_PORTA_CB(WRITE8("dac", dac_byte_interface, data_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, jankenmn_state, lamps1_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jankenmn_state, lamps2_w))
+ ppi1.out_pa_callback().set("dac", FUNC(dac_byte_interface::data_w));
+ ppi1.out_pb_callback().set(FUNC(jankenmn_state::lamps1_w));
+ ppi1.out_pc_callback().set(FUNC(jankenmn_state::lamps2_w));
z80ctc_device& ctc(Z80CTC(config, "ctc", MASTER_CLOCK));
ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/jeutel.cpp b/src/mame/drivers/jeutel.cpp
index 93e60159ac7..2993eca74d7 100644
--- a/src/mame/drivers/jeutel.cpp
+++ b/src/mame/drivers/jeutel.cpp
@@ -228,29 +228,29 @@ MACHINE_CONFIG_START(jeutel_state::jeutel)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
/* Devices */
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- //MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, jeutel_state, ppi0a_w))
- //MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, jeutel_state, ppi0b_w))
- //MCFG_I8255_IN_PORTC_CB(IOPORT("EXTRA"))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jeutel_state, ppi0c_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- //MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, jeutel_state, ppi1a_w))
- //MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, jeutel_state, ppi1b_w))
- //MCFG_I8255_IN_PORTC_CB(IOPORT("EXTRA"))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jeutel_state, ppi1c_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- //MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, jeutel_state, ppi2a_w))
- //MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, jeutel_state, ppi2b_w))
- //MCFG_I8255_IN_PORTC_CB(IOPORT("EXTRA"))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jeutel_state, ppi2c_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ //ppi0.in_pa_callback().set_ioport("P1");
+ ppi0.out_pa_callback().set(FUNC(jeutel_state::ppi0a_w));
+ //ppi0.in_pb_callback().set_ioport("P2");
+ ppi0.out_pb_callback().set(FUNC(jeutel_state::ppi0b_w));
+ //ppi0.in_pc_callback().set_ioport("EXTRA");
+ //ppi0.out_pc_callback().set(FUNC(jeutel_state::ppi0c_w));
+
+ I8255A(config, "ppi8255_1");
+ //ppi1.in_pa_callback().set_ioport("P1");
+ //ppi1.out_pa_callback().set(FUNC(jeutel_state::ppi1a_w));
+ //ppi1.in_pb_callback().set_ioport("P2");
+ //ppi1.out_pb_callback().set(FUNC(jeutel_state::ppi1b_w));
+ //ppi1.in_pc_callback().set_ioport("EXTRA");
+ //ppi1.out_pc_callback().set(FUNC(jeutel_state::ppi1c_w));
+
+ I8255A(config, "ppi8255_2");
+ //ppi2.in_pa_callback().set_ioport("P1");
+ //ppi2.out_pa_callback().set(FUNC(jeutel_state::ppi2a_w));
+ //ppi2.in_pb_callback().set_ioport("P2");
+ //ppi2.out_pb_callback().set(FUNC(jeutel_state::ppi2b_w));
+ //ppi2.in_pc_callback().set_ioport("EXTRA");
+ //ppi2.out_pc_callback().set(FUNC(jeutel_state::ppi2c_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_a", jeutel_state, timer_a, attotime::from_hz(120))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/jpmimpct.cpp b/src/mame/drivers/jpmimpct.cpp
index 466297947de..5b2199a561d 100644
--- a/src/mame/drivers/jpmimpct.cpp
+++ b/src/mame/drivers/jpmimpct.cpp
@@ -1322,11 +1322,11 @@ MACHINE_CONFIG_START(jpmimpct_state::impctawp)
MCFG_MACHINE_RESET_OVERRIDE(jpmimpct_state,impctawp)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, jpmimpct_state, payen_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, jpmimpct_state, hopper_b_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, jpmimpct_state, hopper_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jpmimpct_state, display_c_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(jpmimpct_state::payen_a_w));
+ ppi.in_pb_callback().set(FUNC(jpmimpct_state::hopper_b_r));
+ ppi.in_pc_callback().set(FUNC(jpmimpct_state::hopper_c_r));
+ ppi.out_pc_callback().set(FUNC(jpmimpct_state::display_c_w));
MCFG_TIMER_DRIVER_ADD("duart_1_timer", jpmimpct_state, duart_1_timer_event)
diff --git a/src/mame/drivers/jpmmps.cpp b/src/mame/drivers/jpmmps.cpp
index 6f7b8e512e4..80ec4239389 100644
--- a/src/mame/drivers/jpmmps.cpp
+++ b/src/mame/drivers/jpmmps.cpp
@@ -267,17 +267,17 @@ MACHINE_CONFIG_START(jpmmps_state::jpmmps)
//MCFG_DEVICE_ADD("reelmcu", TMS7041, XTAL(5'000'000))
- MCFG_DEVICE_ADD("ppi8255_ic26", I8255, 0)
+ i8255_device &ic26(I8255(config, "ppi8255_ic26"));
// Port B 0 is coin lockout
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jpmmps_state, jpmmps_meters_w))
+ ic26.out_pc_callback().set(FUNC(jpmmps_state::jpmmps_meters_w));
- MCFG_DEVICE_ADD("ppi8255_ic21", I8255, 0)
+ I8255(config, "ppi8255_ic21");
- MCFG_DEVICE_ADD("ppi8255_ic22", I8255, 0)
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, jpmmps_state, jpmmps_psg_buf_w)) // SN chip data
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, jpmmps_state, jpmmps_ic22_portc_w)) // C3 is last meter, C2 latches in data
+ i8255_device &ic22(I8255(config, "ppi8255_ic22"));
+ ic22.out_pb_callback().set(FUNC(jpmmps_state::jpmmps_psg_buf_w)); // SN chip data
+ ic22.out_pc_callback().set(FUNC(jpmmps_state::jpmmps_ic22_portc_w)); // C3 is last meter, C2 latches in data
- MCFG_DEVICE_ADD("ppi8255_ic25", I8255, 0)
+ I8255(config, "ppi8255_ic25");
TMS9902(config, m_uart_ic10, DUART_CLOCK); // Communication with Reel MCU
TMS9902(config, m_uart_ic5, DUART_CLOCK); // Communication with Security / Printer
diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp
index 89bb34163a9..4b016b66190 100644
--- a/src/mame/drivers/jupace.cpp
+++ b/src/mame/drivers/jupace.cpp
@@ -793,9 +793,9 @@ MACHINE_CONFIG_START(ace_state::ace)
MCFG_SNAPSHOT_ADD("snapshot", ace_state, ace, "ace", 1)
- MCFG_DEVICE_ADD(I8255_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ace_state, sby_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, ace_state, ald_w))
+ I8255A(config, m_ppi);
+ m_ppi->in_pb_callback().set(FUNC(ace_state::sby_r));
+ m_ppi->out_pb_callback().set(FUNC(ace_state::ald_w));
Z80PIO(config, m_z80pio, XTAL(6'500'000)/2);
m_z80pio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/kingdrby.cpp b/src/mame/drivers/kingdrby.cpp
index 83f4a0e23fd..807c5797569 100644
--- a/src/mame/drivers/kingdrby.cpp
+++ b/src/mame/drivers/kingdrby.cpp
@@ -94,6 +94,7 @@ public:
: driver_device(mconfig, type, tag)
, m_vram(*this, "vram")
, m_attr(*this, "attr")
+ , m_ppi(*this, "ppi8255_%u", 0U)
, m_spriteram(*this, "spriteram")
, m_soundcpu(*this, "soundcpu")
, m_gfxdecode(*this, "gfxdecode")
@@ -146,6 +147,7 @@ private:
uint8_t m_p1_hopper;
uint8_t m_p2_hopper;
uint8_t m_mux_data;
+ required_device_array<i8255_device, 2> m_ppi;
required_shared_ptr<uint8_t> m_spriteram;
required_device<cpu_device> m_soundcpu;
required_device<gfxdecode_device> m_gfxdecode;
@@ -448,8 +450,8 @@ void kingdrby_state::slave_map(address_map &map)
map(0x0000, 0x2fff).rom();
map(0x3000, 0x3fff).rom(); //sound rom, tested for the post check
map(0x4000, 0x43ff).ram().share("nvram"); //backup ram
- map(0x5000, 0x5003).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); /* I/O Ports */
- map(0x6000, 0x6003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); /* I/O Ports */
+ map(0x5000, 0x5003).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); /* I/O Ports */
+ map(0x6000, 0x6003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write)); /* I/O Ports */
map(0x7000, 0x73ff).ram().share("share1");
map(0x7400, 0x74ff).ram().share("spriteram");
map(0x7600, 0x7600).w("crtc", FUNC(mc6845_device::address_w));
@@ -469,8 +471,8 @@ void kingdrby_state::slave_1986_map(address_map &map)
map(0x0000, 0x2fff).rom();
map(0x3000, 0x3fff).rom(); //sound rom tested for the post check
map(0x4000, 0x47ff).ram().share("nvram"); //backup ram
- map(0x5000, 0x5003).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); /* I/O Ports */
-// AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) /* I/O Ports */
+ map(0x5000, 0x5003).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); /* I/O Ports */
+// AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE(m_ppi[1], i8255_device, read, write) /* I/O Ports */
map(0x7000, 0x73ff).ram().share("share1");
map(0x7400, 0x74ff).ram().share("spriteram");
map(0x7600, 0x7600).w("crtc", FUNC(mc6845_device::address_w));
@@ -979,18 +981,18 @@ MACHINE_CONFIG_START(kingdrby_state::kingdrby)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
// 5000-5003 PPI group modes 0/0 - A & B as input, C (all) as output.
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, kingdrby_state, hopper_io_r))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, kingdrby_state, hopper_io_w))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set(FUNC(kingdrby_state::hopper_io_r));
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->out_pc_callback().set(FUNC(kingdrby_state::hopper_io_w));
// 6000-6003 PPI group modes 0/0 - B & C (lower) as input, A & C (upper) as output.
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, kingdrby_state, sound_cmd_w))
- MCFG_I8255_TRISTATE_PORTA_CB(CONSTANT(0x7f))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, kingdrby_state, key_matrix_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, kingdrby_state, input_mux_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, kingdrby_state, outport2_w))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->out_pa_callback().set(FUNC(kingdrby_state::sound_cmd_w));
+ m_ppi[1]->tri_pa_callback().set_constant(0x7f);
+ m_ppi[1]->in_pb_callback().set(FUNC(kingdrby_state::key_matrix_r));
+ m_ppi[1]->in_pc_callback().set(FUNC(kingdrby_state::input_mux_r));
+ m_ppi[1]->out_pc_callback().set(FUNC(kingdrby_state::outport2_w));
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_kingdrby)
MCFG_PALETTE_ADD("palette", 0x200)
@@ -1023,19 +1025,22 @@ MACHINE_CONFIG_START(kingdrby_state::kingdrbb)
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_INIT_OWNER(kingdrby_state,kingdrbb)
- MCFG_DEVICE_REMOVE("ppi8255_0")
- MCFG_DEVICE_REMOVE("ppi8255_1")
-
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
/* C as input, (all) as output */
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, kingdrby_state, sound_cmd_w))
- MCFG_I8255_TRISTATE_PORTA_CB(CONSTANT(0x7f))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, kingdrby_state, outportb_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN1"))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- /* actually unused */
+ m_ppi[0]->out_pa_callback().set(FUNC(kingdrby_state::sound_cmd_w));
+ m_ppi[0]->in_pa_callback().set_constant(0);
+ m_ppi[0]->tri_pa_callback().set_constant(0x7f);
+ m_ppi[0]->in_pb_callback().set_ioport("IN0");
+ m_ppi[0]->out_pb_callback().set(FUNC(kingdrby_state::outportb_w));
+ m_ppi[0]->in_pc_callback().set_ioport("IN1");
+ m_ppi[0]->out_pc_callback().set_nop();
+
+ /* PPI1 is actually unused */
+ m_ppi[1]->in_pa_callback().set_constant(0);
+ m_ppi[1]->in_pb_callback().set_constant(0);
+ m_ppi[1]->in_pc_callback().set_constant(0);
+ m_ppi[1]->out_pa_callback().set_nop();
+ m_ppi[1]->out_pb_callback().set_nop();
+ m_ppi[1]->out_pc_callback().set_nop();
MACHINE_CONFIG_END
MACHINE_CONFIG_START(kingdrby_state::cowrace)
diff --git a/src/mame/drivers/kingpin.cpp b/src/mame/drivers/kingpin.cpp
index 271faa362fe..16e377978ec 100644
--- a/src/mame/drivers/kingpin.cpp
+++ b/src/mame/drivers/kingpin.cpp
@@ -152,14 +152,14 @@ MACHINE_CONFIG_START(kingpin_state::kingpin)
MCFG_DEVICE_PROGRAM_MAP(kingpin_program_map)
MCFG_DEVICE_IO_MAP(kingpin_io_map)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
// PORT A read = watchdog?
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW1"))
+ ppi0.in_pb_callback().set_ioport("DSW1");
// PORT C read = unused?
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("IN0");
+ ppi1.in_pb_callback().set_ioport("IN1");
// PORT C read = unknown
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/kopunch.cpp b/src/mame/drivers/kopunch.cpp
index 249bcd57a5a..860b7c0ddbc 100644
--- a/src/mame/drivers/kopunch.cpp
+++ b/src/mame/drivers/kopunch.cpp
@@ -241,25 +241,25 @@ MACHINE_CONFIG_START(kopunch_state::kopunch)
MCFG_DEVICE_IO_MAP(kopunch_io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", kopunch_state, vblank_interrupt)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
// $30 - always $9b (PPI mode 0, ports A & B & C as input)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, kopunch_state, sensors1_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, kopunch_state, sensors2_r))
+ ppi0.in_pa_callback().set_ioport("P1");
+ ppi0.in_pb_callback().set(FUNC(kopunch_state::sensors1_r));
+ ppi0.in_pc_callback().set(FUNC(kopunch_state::sensors2_r));
- i8255_device &ppi1(I8255A(config, "ppi8255_1", 0));
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
// $34 - always $80 (PPI mode 0, ports A & B & C as output)
ppi1.out_pa_callback().set(FUNC(kopunch_state::coin_w));
ppi1.out_pb_callback().set_log("PPI8255 - unmapped write port B");
ppi1.out_pc_callback().set_log("PPI8255 - unmapped write port C");
- i8255_device &ppi2(I8255A(config, "ppi8255_2", 0));
+ i8255_device &ppi2(I8255A(config, "ppi8255_2"));
// $38 - always $89 (PPI mode 0, ports A & B as output, port C as input)
ppi2.out_pa_callback().set(FUNC(kopunch_state::lamp_w));
ppi2.out_pb_callback().set_log("PPI8255 - unmapped write port B");
ppi2.in_pc_callback().set_ioport("DSW");
- i8255_device &ppi3(I8255A(config, "ppi8255_3", 0));
+ i8255_device &ppi3(I8255A(config, "ppi8255_3"));
// $3c - always $88 (PPI mode 0, ports A & B & lower C as output, upper C as input)
ppi3.out_pa_callback().set(FUNC(kopunch_state::scroll_x_w));
ppi3.out_pb_callback().set(FUNC(kopunch_state::scroll_y_w));
diff --git a/src/mame/drivers/kungfur.cpp b/src/mame/drivers/kungfur.cpp
index 97c26686d6a..e7cd67bbb86 100644
--- a/src/mame/drivers/kungfur.cpp
+++ b/src/mame/drivers/kungfur.cpp
@@ -303,18 +303,18 @@ MACHINE_CONFIG_START(kungfur_state::kungfur)
MCFG_DEVICE_PROGRAM_MAP(kungfur_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(kungfur_state, kungfur_irq, 975) // close approximation
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
// $4008 - always $83 (PPI mode 0, ports B & lower C as input)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, kungfur_state, kungfur_output_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, kungfur_state, kungfur_control_w))
+ ppi0.out_pa_callback().set(FUNC(kungfur_state::kungfur_output_w));
+ ppi0.in_pb_callback().set_ioport("IN0");
+ ppi0.in_pc_callback().set_ioport("IN1");
+ ppi0.out_pc_callback().set(FUNC(kungfur_state::kungfur_control_w));
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
// $400c - always $80 (PPI mode 0, all ports as output)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, kungfur_state, kungfur_latch1_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, kungfur_state, kungfur_latch2_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, kungfur_state, kungfur_latch3_w))
+ ppi1.out_pa_callback().set(FUNC(kungfur_state::kungfur_latch1_w));
+ ppi1.out_pb_callback().set(FUNC(kungfur_state::kungfur_latch2_w));
+ ppi1.out_pc_callback().set(FUNC(kungfur_state::kungfur_latch3_w));
/* no video! */
diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp
index e85126c0dca..131b25bdab6 100644
--- a/src/mame/drivers/lordgun.cpp
+++ b/src/mame/drivers/lordgun.cpp
@@ -647,20 +647,20 @@ MACHINE_CONFIG_START(lordgun_state::lordgun)
MCFG_DEVICE_PROGRAM_MAP(lordgun_soundmem_map)
MCFG_DEVICE_IO_MAP(lordgun_soundio_map)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DIP"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, lordgun_state, fake_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, lordgun_state, lordgun_eeprom_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SERVICE"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, lordgun_state, fake2_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("START1"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, lordgun_state, fake_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("START2"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, lordgun_state, fake_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("COIN"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, lordgun_state, fake_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("DIP");
+ ppi0.out_pa_callback().set(FUNC(lordgun_state::fake_w));
+ ppi0.out_pb_callback().set(FUNC(lordgun_state::lordgun_eeprom_w));
+ ppi0.in_pc_callback().set_ioport("SERVICE");
+ ppi0.out_pc_callback().set(FUNC(lordgun_state::fake2_w));
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("START1");
+ ppi1.out_pa_callback().set(FUNC(lordgun_state::fake_w));
+ ppi1.in_pb_callback().set_ioport("START2");
+ ppi1.out_pb_callback().set(FUNC(lordgun_state::fake_w));
+ ppi1.in_pc_callback().set_ioport("COIN");
+ ppi1.out_pc_callback().set(FUNC(lordgun_state::fake_w));
EEPROM_93C46_16BIT(config, "eeprom");
@@ -699,20 +699,20 @@ MACHINE_CONFIG_START(lordgun_state::aliencha)
MCFG_DEVICE_PROGRAM_MAP(lordgun_soundmem_map)
MCFG_DEVICE_IO_MAP(aliencha_soundio_map)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, lordgun_state, aliencha_dip_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, lordgun_state, fake2_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, lordgun_state, aliencha_eeprom_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SERVICE"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, lordgun_state, aliencha_dip_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, lordgun_state, fake_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, lordgun_state, fake_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("COIN"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, lordgun_state, fake_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set(FUNC(lordgun_state::aliencha_dip_r));
+ ppi0.out_pa_callback().set(FUNC(lordgun_state::fake2_w));
+ ppi0.out_pb_callback().set(FUNC(lordgun_state::aliencha_eeprom_w));
+ ppi0.in_pc_callback().set_ioport("SERVICE");
+ ppi0.out_pc_callback().set(FUNC(lordgun_state::aliencha_dip_w));
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("P1");
+ ppi1.out_pa_callback().set(FUNC(lordgun_state::fake_w));
+ ppi1.in_pb_callback().set_ioport("P2");
+ ppi1.out_pb_callback().set(FUNC(lordgun_state::fake_w));
+ ppi1.in_pc_callback().set_ioport("COIN");
+ ppi1.out_pc_callback().set(FUNC(lordgun_state::fake_w));
EEPROM_93C46_16BIT(config, "eeprom");
diff --git a/src/mame/drivers/lucky74.cpp b/src/mame/drivers/lucky74.cpp
index 11fcb2ec14e..2960277e07f 100644
--- a/src/mame/drivers/lucky74.cpp
+++ b/src/mame/drivers/lucky74.cpp
@@ -1475,24 +1475,24 @@ MACHINE_CONFIG_START(lucky74_state::lucky74)
// Each 82C255 behaves like 2x 8255 (in mode 0). Since MAME doesn't support it yet, I replaced
// both 82C255 with 4x 8255...
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("IN0");
+ ppi0.in_pb_callback().set_ioport("IN1");
// Port C write: 0x00 after reset, 0xff during game, and 0xfd when tap F2 for percentage and run count
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN4"))
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("IN2");
+ ppi1.in_pc_callback().set_ioport("IN4");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW3"))
+ i8255_device &ppi2(I8255A(config, "ppi8255_2"));
+ ppi2.in_pa_callback().set_ioport("DSW1");
+ ppi2.in_pb_callback().set_ioport("DSW2");
+ ppi2.in_pc_callback().set_ioport("DSW3");
- MCFG_DEVICE_ADD("ppi8255_3", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW4"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, lucky74_state, lamps_a_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, lucky74_state, lamps_b_w))
+ i8255_device &ppi3(I8255A(config, "ppi8255_3"));
+ ppi3.in_pa_callback().set_ioport("DSW4");
+ ppi3.out_pb_callback().set(FUNC(lucky74_state::lamps_a_w));
+ ppi3.out_pc_callback().set(FUNC(lucky74_state::lamps_b_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/luckybal.cpp b/src/mame/drivers/luckybal.cpp
index 5527821d3db..4a4b5219ac9 100644
--- a/src/mame/drivers/luckybal.cpp
+++ b/src/mame/drivers/luckybal.cpp
@@ -217,7 +217,7 @@
Inputs...
4512 #0 4512 #1 4512 #2
- .----v----. .----v----. .----v----.
+ .----v----. .----v----. .----v----.
| D0 |----> AUX IN | D0 |----> CREDITS IN | D0 |----> DSW #1
| D1 |----> N/C | D1 |----> PLAYER UP | D1 |----> DSW #2
| D2 |----> N/C | D2 |----> PLAYER BET | D2 |----> DSW #3
@@ -232,7 +232,7 @@
Outputs...
4099 #0 4099 #1 4099 #2
- .----v----. .----v----. .----v----.
+ .----v----. .----v----. .----v----.
| Q0 |----> PL. 1 | Q0 |----> AUX OUT1 | Q0 |----> N/C
| Q1 |----> PL. 2 | Q1 |----> AUX OUT2 (ULN2004) | Q1 |----> N/C
| Q2 |----> PL. 3 | Q2 |----> AUX OUT3 (ULN2004) | Q2 |----> N/C
@@ -315,7 +315,7 @@ private:
DECLARE_WRITE8_MEMBER(output_port_c_w);
uint8_t m_trdr;
- uint8_t m_led_on = 0;
+ uint8_t m_led_on = 0;
required_device<v9938_device> m_v9938;
required_device<cpu_device> m_maincpu;
@@ -328,7 +328,7 @@ private:
void main_io(address_map &map);
void main_map(address_map &map);
-
+
virtual void machine_start() override { m_lamps.resolve(); }
output_finder<38> m_lamps;
};
@@ -413,7 +413,7 @@ WRITE8_MEMBER(luckybal_state::output_port_a_w)
m_lamps[m_led_on] = 0;
m_lamps[m_trdr] = 1;
m_led_on = m_trdr;
-
+
m_dac->write(data);
}
@@ -521,7 +521,7 @@ static INPUT_PORTS_START( luckybal )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(6) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Player 6 - Down")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // 'Player 6 - Coins' in the schematics. Maybe for another game.
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Player 6 - Left")
-
+
PORT_START("AUX")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -531,7 +531,7 @@ static INPUT_PORTS_START( luckybal )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_0) PORT_NAME("Operator Key") PORT_TOGGLE // Allow to credit in/out for all players.
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Test Mode / Books / Page") // Need the Oper Key active to work.
-
+
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, "Setting Access" ) PORT_DIPLOCATION("DSW:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
@@ -572,11 +572,11 @@ MACHINE_CONFIG_START(luckybal_state::luckybal)
MCFG_DEVICE_PROGRAM_MAP(main_map)
MCFG_DEVICE_IO_MAP(main_io)
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, luckybal_state, output_port_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, luckybal_state, output_port_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, luckybal_state, input_port_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, luckybal_state, output_port_c_w))
+ I8255A(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(luckybal_state::output_port_a_w));
+ m_ppi->out_pb_callback().set(FUNC(luckybal_state::output_port_b_w));
+ m_ppi->in_pc_callback().set(FUNC(luckybal_state::input_port_c_r));
+ m_ppi->out_pc_callback().set(FUNC(luckybal_state::output_port_c_w));
MCFG_DEVICE_ADD("latch1", CD4099, 0)
@@ -586,7 +586,7 @@ MACHINE_CONFIG_START(luckybal_state::luckybal)
/* nvram */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
-
+
/* video hardware */
MCFG_V9938_ADD("v9938", "screen", VDP_MEM, VID_CLOCK)
MCFG_V99X8_INTERRUPT_CALLBACK(INPUTLINE("maincpu", 0))
@@ -657,7 +657,7 @@ void luckybal_state::init_luckybal()
}
membank("bank1")->configure_entries(0, 0x40, &rom[0x10000], 0x2000);
-}
+}
void luckybal_state::init_luckybala()
{
@@ -669,7 +669,7 @@ void luckybal_state::init_luckybala()
{
rom[i] = bitswap<8>(rom[i], 6, 7, 4, 5, 2, 3, 0, 1);
}
-
+
/* The following patches are to avoid hardware verifications through
the unemulated synchronic serial comm of the z180...
*/
@@ -682,7 +682,7 @@ void luckybal_state::init_luckybala()
rom[0x1D65] = 0x0E; //0C
rom[0x4499] = 0x00; //FF <------- Checksum.
rom[0x4AB6] = 0xAF; //B9
-
+
membank("bank1")->configure_entries(0, 0x40, &rom[0x10000], 0x2000);
}
@@ -696,7 +696,7 @@ void luckybal_state::init_luckybald()
{
rom[i] = bitswap<8>(rom[i], 6, 7, 4, 5, 2, 3, 0, 1);
}
-
+
/* The following patches are to avoid hardware verifications through
the unemulated synchronic serial comm of the z180...
*/
diff --git a/src/mame/drivers/lviv.cpp b/src/mame/drivers/lviv.cpp
index 77448900723..52b599fba97 100644
--- a/src/mame/drivers/lviv.cpp
+++ b/src/mame/drivers/lviv.cpp
@@ -428,21 +428,21 @@ MACHINE_CONFIG_START(lviv_state::lviv)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- MCFG_DEVICE_ADD(m_ppi[0], I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, lviv_state, ppi_0_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, lviv_state, ppi_0_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, lviv_state, ppi_0_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, lviv_state, ppi_0_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, lviv_state, ppi_0_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, lviv_state, ppi_0_portc_w))
-
- MCFG_DEVICE_ADD(m_ppi[1], I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, lviv_state, ppi_1_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, lviv_state, ppi_1_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, lviv_state, ppi_1_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, lviv_state, ppi_1_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, lviv_state, ppi_1_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, lviv_state, ppi_1_portc_w))
+ I8255(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set(FUNC(lviv_state::ppi_0_porta_r));
+ m_ppi[0]->out_pa_callback().set(FUNC(lviv_state::ppi_0_porta_w));
+ m_ppi[0]->in_pb_callback().set(FUNC(lviv_state::ppi_0_portb_r));
+ m_ppi[0]->out_pb_callback().set(FUNC(lviv_state::ppi_0_portb_w));
+ m_ppi[0]->in_pc_callback().set(FUNC(lviv_state::ppi_0_portc_r));
+ m_ppi[0]->out_pc_callback().set(FUNC(lviv_state::ppi_0_portc_w));
+
+ I8255(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set(FUNC(lviv_state::ppi_1_porta_r));
+ m_ppi[1]->out_pa_callback().set(FUNC(lviv_state::ppi_1_porta_w));
+ m_ppi[1]->in_pb_callback().set(FUNC(lviv_state::ppi_1_portb_r));
+ m_ppi[1]->out_pb_callback().set(FUNC(lviv_state::ppi_1_portb_w));
+ m_ppi[1]->in_pc_callback().set(FUNC(lviv_state::ppi_1_portc_r));
+ m_ppi[1]->out_pc_callback().set(FUNC(lviv_state::ppi_1_portc_w));
MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_REFRESH_RATE(50)
diff --git a/src/mame/drivers/m5.cpp b/src/mame/drivers/m5.cpp
index 2ca3d4818f0..e0548bcf06e 100644
--- a/src/mame/drivers/m5.cpp
+++ b/src/mame/drivers/m5.cpp
@@ -1436,12 +1436,12 @@ MACHINE_CONFIG_START(m5_state::m5)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY)
MCFG_CASSETTE_INTERFACE("m5_cass")
- MCFG_DEVICE_ADD(I8255A_TAG, I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, m5_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, m5_state, ppi_pa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, m5_state, ppi_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, m5_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, m5_state, ppi_pc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(m5_state::ppi_pa_r));
+ m_ppi->out_pa_callback().set(FUNC(m5_state::ppi_pa_w));
+ m_ppi->out_pb_callback().set(FUNC(m5_state::ppi_pb_w));
+ m_ppi->in_pc_callback().set(FUNC(m5_state::ppi_pc_r));
+ m_ppi->out_pc_callback().set(FUNC(m5_state::ppi_pc_w));
MCFG_UPD765A_ADD(UPD765_TAG, true, true)
MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE(Z80_FD5_TAG, INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/mbc200.cpp b/src/mame/drivers/mbc200.cpp
index f075b140322..08ad9f40389 100644
--- a/src/mame/drivers/mbc200.cpp
+++ b/src/mame/drivers/mbc200.cpp
@@ -335,15 +335,12 @@ MACHINE_CONFIG_START(mbc200_state::mbc200)
MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_DEVICE_ADD("ppi_1", I8255, 0)
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mbc200_state, p1_portc_w))
+ I8255(config, "ppi_1").out_pc_callback().set(FUNC(mbc200_state::p1_portc_w));
+ I8255(config, "ppi_2").in_pa_callback().set(FUNC(mbc200_state::p2_porta_r));
- MCFG_DEVICE_ADD("ppi_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mbc200_state, p2_porta_r))
-
- MCFG_DEVICE_ADD("ppi_m", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mbc200_state, pm_porta_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mbc200_state, pm_portb_w))
+ I8255(config, m_ppi_m);
+ m_ppi_m->out_pa_callback().set(FUNC(mbc200_state::pm_porta_w));
+ m_ppi_m->out_pb_callback().set(FUNC(mbc200_state::pm_portb_w));
MCFG_DEVICE_ADD("uart1", I8251, 0) // INS8251N
diff --git a/src/mame/drivers/mbc55x.cpp b/src/mame/drivers/mbc55x.cpp
index 872a9b492b0..ca363b392ed 100644
--- a/src/mame/drivers/mbc55x.cpp
+++ b/src/mame/drivers/mbc55x.cpp
@@ -280,13 +280,13 @@ MACHINE_CONFIG_START(mbc55x_state::mbc55x)
MCFG_DEVICE_ADD(PIC8259_TAG, PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD(PPI8255_TAG, I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mbc55x_state, mbc55x_ppi_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mbc55x_state, mbc55x_ppi_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mbc55x_state, mbc55x_ppi_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mbc55x_state, mbc55x_ppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mbc55x_state, mbc55x_ppi_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mbc55x_state, mbc55x_ppi_portc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(mbc55x_state::mbc55x_ppi_porta_r));
+ m_ppi->out_pa_callback().set(FUNC(mbc55x_state::mbc55x_ppi_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(mbc55x_state::mbc55x_ppi_portb_r));
+ m_ppi->out_pb_callback().set(FUNC(mbc55x_state::mbc55x_ppi_portb_w));
+ m_ppi->in_pc_callback().set(FUNC(mbc55x_state::mbc55x_ppi_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(mbc55x_state::mbc55x_ppi_portc_w));
MCFG_MC6845_ADD(VID_MC6845_NAME, MC6845, SCREEN_TAG, 14.318181_MHz_XTAL / 8)
MCFG_MC6845_SHOW_BORDER_AREA(false)
diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp
index 5a127e04836..72bbcb21df6 100644
--- a/src/mame/drivers/mc1502.cpp
+++ b/src/mame/drivers/mc1502.cpp
@@ -250,17 +250,17 @@ MACHINE_CONFIG_START(mc1502_state::mc1502)
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_DEVICE_ADD("ppi8255n1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mc1502_state, mc1502_ppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mc1502_state, mc1502_ppi_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mc1502_state, mc1502_ppi_portc_w))
-
- MCFG_DEVICE_ADD("ppi8255n2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mc1502_state, mc1502_kppi_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mc1502_state, mc1502_kppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8("cent_status_in", input_buffer_device, bus_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mc1502_state, mc1502_kppi_portc_w))
+ I8255(config, m_ppi8255n1);
+ m_ppi8255n1->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_ppi8255n1->out_pb_callback().set(FUNC(mc1502_state::mc1502_ppi_portb_w));
+ m_ppi8255n1->in_pc_callback().set(FUNC(mc1502_state::mc1502_ppi_portc_r));
+ m_ppi8255n1->out_pc_callback().set(FUNC(mc1502_state::mc1502_ppi_portc_w));
+
+ I8255(config, m_ppi8255n2);
+ m_ppi8255n2->in_pa_callback().set(FUNC(mc1502_state::mc1502_kppi_porta_r));
+ m_ppi8255n2->out_pb_callback().set(FUNC(mc1502_state::mc1502_kppi_portb_w));
+ m_ppi8255n2->in_pc_callback().set("cent_status_in", FUNC(input_buffer_device::bus_r));
+ m_ppi8255n2->out_pc_callback().set(FUNC(mc1502_state::mc1502_kppi_portc_w));
I8251(config, m_upd8251, 0);
m_upd8251->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/megaphx.cpp b/src/mame/drivers/megaphx.cpp
index 9c379b09329..13778f88fc0 100644
--- a/src/mame/drivers/megaphx.cpp
+++ b/src/mame/drivers/megaphx.cpp
@@ -396,11 +396,11 @@ MACHINE_CONFIG_START(megaphx_state::megaphx)
m_dsw_shifter[1]->data_callback().set_ioport("DSW2");
m_dsw_shifter[1]->qh_callback().set(FUNC(megaphx_state::dsw_w));
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, megaphx_state, ppi_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, megaphx_state, ppi_portc_w))
+ I8255A(config, m_ppi);
+ m_ppi->in_pa_callback().set_ioport("P1");
+ m_ppi->in_pb_callback().set_ioport("P2");
+ m_ppi->in_pc_callback().set(FUNC(megaphx_state::ppi_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(megaphx_state::ppi_portc_w));
MCFG_INDER_VIDEO_ADD("inder_vid")
diff --git a/src/mame/drivers/merit.cpp b/src/mame/drivers/merit.cpp
index 65fe447c3c4..0cd46ca556d 100644
--- a/src/mame/drivers/merit.cpp
+++ b/src/mame/drivers/merit.cpp
@@ -95,6 +95,7 @@ public:
, m_ram_video(*this, "ravideo")
, m_backup_ram(*this, "backup_ram")
, m_maincpu(*this, "maincpu")
+ , m_ppi(*this, "ppi8255_%u", 0U)
, m_screen(*this, "screen")
, m_leds(*this, "led%u", 0U)
{ }
@@ -166,6 +167,7 @@ private:
int m_decryption_key;
optional_shared_ptr<uint8_t> m_backup_ram;
required_device<cpu_device> m_maincpu;
+ required_device_array<i8255_device, 2> m_ppi;
required_device<screen_device> m_screen;
output_finder<10> m_leds;
};
@@ -418,8 +420,8 @@ void merit_state::pitboss_map(address_map &map)
{
map(0x0000, 0x5fff).rom();
map(0x6000, 0x67ff).ram();
- map(0xa000, 0xa003).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc000, 0xc003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xa000, 0xa003).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc000, 0xc003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xe000, 0xe000).w("crtc", FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).w("crtc", FUNC(mc6845_device::register_w));
map(0xe800, 0xefff).ram().share("raattr");
@@ -435,8 +437,8 @@ void merit_state::casino5_map(address_map &map)
map(0x6000, 0x6fff).ram().share("nvram");
map(0x7000, 0x7000).w(FUNC(merit_state::casino5_bank_w));
map(0x7001, 0x7fff).ram();
- map(0xa000, 0xa003).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc000, 0xc003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xa000, 0xa003).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc000, 0xc003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xe000, 0xe000).w("crtc", FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).w("crtc", FUNC(mc6845_device::register_w));
map(0xe800, 0xefff).ram().share("raattr");
@@ -448,8 +450,8 @@ void merit_state::bigappg_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0xa000, 0xbfff).ram().share("nvram");
- map(0xc004, 0xc007).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc008, 0xc00b).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc004, 0xc007).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc008, 0xc00b).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xe000, 0xe000).w("crtc", FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).w("crtc", FUNC(mc6845_device::register_w));
map(0xe800, 0xefff).ram().share("raattr");
@@ -462,8 +464,8 @@ void merit_state::misdraw_map(address_map &map)
map(0x0000, 0x7fff).rom();
map(0xa000, 0xbfff).ram().share("nvram");
map(0xb000, 0xb7ff).ram().share("cpunvram"); // overlays other NVRAM? or is it banked?
- map(0xc004, 0xc007).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); // swapped compared to other set?
- map(0xc008, 0xc00b).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc004, 0xc007).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); // swapped compared to other set?
+ map(0xc008, 0xc00b).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xe000, 0xe000).w("crtc", FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).w("crtc", FUNC(mc6845_device::register_w));
map(0xe800, 0xefff).ram().share("raattr");
@@ -475,8 +477,8 @@ void merit_state::dodge_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0xa000, 0xbfff).ram().share("nvram");
- map(0xc004, 0xc007).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc008, 0xc00b).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc004, 0xc007).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc008, 0xc00b).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xe000, 0xe000).w("crtc", FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).w("crtc", FUNC(mc6845_device::register_w));
map(0xe800, 0xefff).ram().share("raattr");
@@ -496,8 +498,8 @@ void merit_state::trvwhiz_map(address_map &map)
map(0x5400, 0x54ff).w(FUNC(merit_state::low_offset_w));
map(0x5800, 0x58ff).w(FUNC(merit_state::med_offset_w));
map(0x6000, 0x67ff).ram();
- map(0xa000, 0xa003).mirror(0x1df0).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc000, 0xc003).mirror(0x1df0).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xa000, 0xa003).mirror(0x1df0).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc000, 0xc003).mirror(0x1df0).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xe000, 0xe000).mirror(0x05f0).w("crtc", FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).mirror(0x05f0).w("crtc", FUNC(mc6845_device::register_w));
map(0xe800, 0xefff).ram().share("raattr");
@@ -516,8 +518,8 @@ void merit_state::phrcraze_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0xa000, 0xbfff).ram();
- map(0xc008, 0xc00b).mirror(0x1df0).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc00c, 0xc00f).mirror(0x1df0).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc008, 0xc00b).mirror(0x1df0).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc00c, 0xc00f).mirror(0x1df0).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xce00, 0xceff).rw(FUNC(merit_state::questions_r), FUNC(merit_state::high_offset_w));
map(0xd600, 0xd6ff).w(FUNC(merit_state::low_offset_w));
map(0xda00, 0xdaff).w(FUNC(merit_state::med_offset_w));
@@ -539,8 +541,8 @@ void merit_state::tictac_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0x9fff).ram();
- map(0xc004, 0xc007).mirror(0x1df0).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc008, 0xc00b).mirror(0x1df0).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc004, 0xc007).mirror(0x1df0).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc008, 0xc00b).mirror(0x1df0).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xce00, 0xceff).rw(FUNC(merit_state::questions_r), FUNC(merit_state::high_offset_w));
map(0xd600, 0xd6ff).w(FUNC(merit_state::low_offset_w));
map(0xda00, 0xdaff).w(FUNC(merit_state::med_offset_w));
@@ -562,8 +564,8 @@ void merit_state::trvwhziv_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0xa000, 0xbfff).ram();
- map(0xc004, 0xc007).mirror(0x1df0).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc008, 0xc00b).mirror(0x1df0).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc004, 0xc007).mirror(0x1df0).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc008, 0xc00b).mirror(0x1df0).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xce00, 0xceff).rw(FUNC(merit_state::questions_r), FUNC(merit_state::high_offset_w));
map(0xd600, 0xd6ff).w(FUNC(merit_state::low_offset_w));
map(0xda00, 0xdaff).w(FUNC(merit_state::med_offset_w));
@@ -579,8 +581,8 @@ void merit_state::dtrvwz5_map(address_map &map)
map(0x0000, 0x7fff).rom();
map(0x8000, 0x9fff).ram().share("nvram");
map(0xb000, 0xb0ff).rom(); /* protection? code jumps here */
- map(0xc004, 0xc007).mirror(0x1df0).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc008, 0xc00b).mirror(0x1df0).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc004, 0xc007).mirror(0x1df0).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc008, 0xc00b).mirror(0x1df0).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xce00, 0xceff).rw(FUNC(merit_state::questions_r), FUNC(merit_state::high_offset_w));
map(0xd600, 0xd6ff).w(FUNC(merit_state::low_offset_w));
map(0xda00, 0xdaff).w(FUNC(merit_state::med_offset_w));
@@ -596,8 +598,8 @@ void merit_state::couple_map(address_map &map)
map(0x0000, 0x7fff).rom();
map(0x8000, 0x9fff).bankr("bank1");
map(0xa000, 0xbfff).ram().share("backup_ram");
- map(0xc004, 0xc007).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xc008, 0xc00b).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc004, 0xc007).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xc008, 0xc00b).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xe000, 0xe000).w("crtc", FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).w("crtc", FUNC(mc6845_device::register_w));
map(0xe800, 0xefff).ram().share("raattr");
@@ -1412,15 +1414,15 @@ MACHINE_CONFIG_START(merit_state::pitboss)
MCFG_DEVICE_PROGRAM_MAP(pitboss_map)
MCFG_DEVICE_IO_MAP(trvwhiz_io_map)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set_ioport("IN0");
+ m_ppi[0]->in_pb_callback().set_ioport("IN1");
+ m_ppi[0]->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, merit_state, led1_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, merit_state, misc_w))
+ I8255A(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("DSW");
+ m_ppi[1]->out_pb_callback().set(FUNC(merit_state::led1_w));
+ m_ppi[1]->out_pc_callback().set(FUNC(merit_state::misc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1530,11 +1532,7 @@ MACHINE_CONFIG_START(merit_state::couple)
MCFG_DEVICE_PROGRAM_MAP(couple_map)
MCFG_DEVICE_IO_MAP(tictac_io_map)
- MCFG_DEVICE_REMOVE("ppi8255_1")
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, merit_state, led1_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, merit_state, misc_couple_w))
+ m_ppi[1]->out_pc_callback().set(FUNC(merit_state::misc_couple_w));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/meritm.cpp b/src/mame/drivers/meritm.cpp
index c626c223c90..d483aa7dbc6 100644
--- a/src/mame/drivers/meritm.cpp
+++ b/src/mame/drivers/meritm.cpp
@@ -197,6 +197,7 @@ public:
: driver_device(mconfig, type, tag),
m_z80pio(*this, "z80pio%u", 0U),
m_ds1204(*this, "ds1204"),
+ m_ppi(*this, "ppi8255"),
m_v9938(*this, "v9938_%u", 0U),
m_microtouch(*this, "microtouch") ,
m_uart(*this, "ns16550"),
@@ -220,6 +221,7 @@ protected:
private:
required_device_array<z80pio_device, 2> m_z80pio;
required_device<ds1204_device> m_ds1204;
+ required_device<i8255_device> m_ppi;
required_device_array<v9938_device, 2> m_v9938;
optional_device<microtouch_device> m_microtouch;
optional_device<ns16550_device> m_uart;
@@ -1106,9 +1108,9 @@ MACHINE_CONFIG_START(meritm_state::crt250)
m_maincpu->set_addrmap(AS_IO, &meritm_state::crt250_io_map);
m_maincpu->set_daisy_config(meritm_daisy_chain);
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, meritm_state, crt250_port_b_w)) // used LMP x DRIVE
- MCFG_I8255_IN_PORTC_CB(READ8(*this, meritm_state, _8255_port_c_r))
+ I8255(config, m_ppi);
+ m_ppi->out_pb_callback().set(FUNC(meritm_state::crt250_port_b_w)); // used LMP x DRIVE
+ m_ppi->in_pc_callback().set(FUNC(meritm_state::_8255_port_c_r));
Z80PIO(config, m_z80pio[0], SYSTEM_CLK/6);
m_z80pio[0]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
@@ -1175,9 +1177,7 @@ MACHINE_CONFIG_START(meritm_state::crt260)
m_maincpu->set_addrmap(AS_PROGRAM, &meritm_state::map);
m_maincpu->set_addrmap(AS_IO, &meritm_state::io_map);
- MCFG_DEVICE_REMOVE("ppi8255")
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTC_CB(READ8(*this, meritm_state, _8255_port_c_r))
+ m_ppi->out_pb_callback().set_nop();
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) // DS1232, TD connected to VCC
diff --git a/src/mame/drivers/mikro80.cpp b/src/mame/drivers/mikro80.cpp
index edfb8b74b60..ed8246ade0c 100644
--- a/src/mame/drivers/mikro80.cpp
+++ b/src/mame/drivers/mikro80.cpp
@@ -171,10 +171,10 @@ MACHINE_CONFIG_START(mikro80_state::mikro80)
MCFG_DEVICE_PROGRAM_MAP(mikro80_mem)
MCFG_DEVICE_IO_MAP(mikro80_io)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mikro80_state, mikro80_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mikro80_state, mikro80_8255_portb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mikro80_state, mikro80_8255_portc_r))
+ I8255(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set(FUNC(mikro80_state::mikro80_8255_porta_w));
+ m_ppi8255->in_pb_callback().set(FUNC(mikro80_state::mikro80_8255_portb_r));
+ m_ppi8255->in_pc_callback().set(FUNC(mikro80_state::mikro80_8255_portc_r));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/mikrosha.cpp b/src/mame/drivers/mikrosha.cpp
index 21adf67b42f..529d264400c 100644
--- a/src/mame/drivers/mikrosha.cpp
+++ b/src/mame/drivers/mikrosha.cpp
@@ -211,14 +211,14 @@ MACHINE_CONFIG_START(mikrosha_state::mikrosha)
MCFG_DEVICE_PROGRAM_MAP(mikrosha_mem)
MCFG_DEVICE_IO_MAP(mikrosha_io)
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, radio86_state, radio86_8255_portb_r2))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, radio86_state, radio86_8255_porta_w2))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, radio86_state, radio86_8255_portc_r2))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_8255_portc_w2))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, radio86_state, mikrosha_8255_font_page_w))
+ I8255(config, m_ppi8255_1);
+ m_ppi8255_1->in_pa_callback().set(FUNC(radio86_state::radio86_8255_portb_r2));
+ m_ppi8255_1->out_pb_callback().set(FUNC(radio86_state::radio86_8255_porta_w2));
+ m_ppi8255_1->in_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_r2));
+ m_ppi8255_1->out_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_w2));
+
+ I8255(config, m_ppi8255_2);
+ m_ppi8255_2->out_pb_callback().set(FUNC(radio86_state::mikrosha_8255_font_page_w));
MCFG_DEVICE_ADD("i8275", I8275, XTAL(16'000'000) / 12)
MCFG_I8275_CHARACTER_WIDTH(6)
diff --git a/src/mame/drivers/mjkjidai.cpp b/src/mame/drivers/mjkjidai.cpp
index 89e65cc02a6..53003806a13 100644
--- a/src/mame/drivers/mjkjidai.cpp
+++ b/src/mame/drivers/mjkjidai.cpp
@@ -305,16 +305,16 @@ MACHINE_CONFIG_START(mjkjidai_state::mjkjidai)
NVRAM(config, "nvram", nvram_device::DEFAULT_NONE);
- MCFG_DEVICE_ADD("ppi1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("KEYBOARD"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mjkjidai_state, keyboard_select_lo_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mjkjidai_state, keyboard_select_hi_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
-
- MCFG_DEVICE_ADD("ppi2", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mjkjidai_state, mjkjidai_ctrl_w)) // rom bank, coin counter, flip screen etc
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW2"))
+ i8255_device &ppi1(I8255A(config, "ppi1"));
+ ppi1.in_pa_callback().set_ioport("KEYBOARD");
+ ppi1.out_pb_callback().set(FUNC(mjkjidai_state::keyboard_select_lo_w));
+ ppi1.out_pc_callback().set(FUNC(mjkjidai_state::keyboard_select_hi_w));
+ ppi1.in_pc_callback().set_ioport("IN2");
+
+ i8255_device &ppi2(I8255A(config, "ppi2"));
+ ppi2.out_pa_callback().set(FUNC(mjkjidai_state::mjkjidai_ctrl_w)); // rom bank, coin counter, flip screen etc
+ ppi2.in_pb_callback().set_ioport("DSW1");
+ ppi2.in_pc_callback().set_ioport("DSW2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/mpf1.cpp b/src/mame/drivers/mpf1.cpp
index 59c6690000b..6eb4640def3 100644
--- a/src/mame/drivers/mpf1.cpp
+++ b/src/mame/drivers/mpf1.cpp
@@ -371,10 +371,10 @@ MACHINE_CONFIG_START(mpf1_state::mpf1)
Z80CTC(config, m_ctc, XTAL(3'579'545)/2);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mpf1_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mpf1_state, ppi_pb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mpf1_state, ppi_pc_w))
+ i8255_device &ppi(I8255A(config, I8255A_TAG));
+ ppi.in_pa_callback().set(FUNC(mpf1_state::ppi_pa_r));
+ ppi.out_pb_callback().set(FUNC(mpf1_state::ppi_pb_w));
+ ppi.out_pc_callback().set(FUNC(mpf1_state::ppi_pc_w));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED)
@@ -405,10 +405,10 @@ MACHINE_CONFIG_START(mpf1_state::mpf1b)
Z80CTC(config, m_ctc, XTAL(3'579'545)/2);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mpf1_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mpf1_state, ppi_pb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mpf1_state, ppi_pc_w))
+ i8255_device &ppi(I8255A(config, I8255A_TAG));
+ ppi.in_pa_callback().set(FUNC(mpf1_state::ppi_pa_r));
+ ppi.out_pb_callback().set(FUNC(mpf1_state::ppi_pb_w));
+ ppi.out_pc_callback().set(FUNC(mpf1_state::ppi_pc_w));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED)
@@ -445,10 +445,10 @@ MACHINE_CONFIG_START(mpf1_state::mpf1p)
Z80CTC(config, m_ctc, 2500000);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mpf1_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mpf1_state, ppi_pb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mpf1_state, ppi_pc_w))
+ i8255_device &ppi(I8255A(config, I8255A_TAG));
+ ppi.in_pa_callback().set(FUNC(mpf1_state::ppi_pa_r));
+ ppi.out_pb_callback().set(FUNC(mpf1_state::ppi_pb_w));
+ ppi.out_pc_callback().set(FUNC(mpf1_state::ppi_pc_w));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED)
diff --git a/src/mame/drivers/mrgame.cpp b/src/mame/drivers/mrgame.cpp
index 6ff51480cff..cf5d2ddc3fa 100644
--- a/src/mame/drivers/mrgame.cpp
+++ b/src/mame/drivers/mrgame.cpp
@@ -594,10 +594,11 @@ MACHINE_CONFIG_START(mrgame_state::mrgame)
/* Devices */
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", mrgame_state, irq_timer, attotime::from_hz(16000)) //ugh
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mrgame_state, porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mrgame_state, portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mrgame_state, portc_r))
+
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.in_pa_callback().set(FUNC(mrgame_state::porta_r));
+ ppi.out_pb_callback().set(FUNC(mrgame_state::portb_w));
+ ppi.in_pc_callback().set(FUNC(mrgame_state::portc_r));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(mrgame_state::wcup90)
diff --git a/src/mame/drivers/ms0515.cpp b/src/mame/drivers/ms0515.cpp
index 4b4ac024d79..f60b8c76f8b 100644
--- a/src/mame/drivers/ms0515.cpp
+++ b/src/mame/drivers/ms0515.cpp
@@ -544,10 +544,10 @@ MACHINE_CONFIG_START(ms0515_state::ms0515)
MCFG_FLOPPY_DRIVE_ADD("vg93:1", ms0515_floppies, "525qd", ms0515_state::floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ms0515_state, ms0515_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ms0515_state, ms0515_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, ms0515_state, ms0515_portc_w))
+ i8255_device &ppi(I8255(config, "ppi8255_1"));
+ ppi.out_pa_callback().set(FUNC(ms0515_state::ms0515_porta_w));
+ ppi.in_pb_callback().set(FUNC(ms0515_state::ms0515_portb_r));
+ ppi.out_pc_callback().set(FUNC(ms0515_state::ms0515_portc_w));
// serial connection to printer
I8251(config, m_i8251line, 0);
diff --git a/src/mame/drivers/msx.cpp b/src/mame/drivers/msx.cpp
index afe2e699990..c2756dc8370 100644
--- a/src/mame/drivers/msx.cpp
+++ b/src/mame/drivers/msx.cpp
@@ -1353,10 +1353,10 @@ MACHINE_CONFIG_START(msx_state::msx)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", msx_state, msx_interrupt) /* Needed for mouse updates */
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, msx_state, msx_ppi_port_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, msx_state, msx_ppi_port_b_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, msx_state, msx_ppi_port_c_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(msx_state::msx_ppi_port_a_w));
+ ppi.in_pb_callback().set(FUNC(msx_state::msx_ppi_port_b_r));
+ ppi.out_pc_callback().set(FUNC(msx_state::msx_ppi_port_c_w));
/* sound hardware */
SPEAKER(config, "speaker").front_center();
@@ -1414,10 +1414,10 @@ MACHINE_CONFIG_START(msx_state::msx2)
MCFG_DEVICE_IO_MAP(msx2_io_map)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, msx_state, msx_ppi_port_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, msx_state, msx_ppi_port_b_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, msx_state, msx_ppi_port_c_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(msx_state::msx_ppi_port_a_w));
+ ppi.in_pb_callback().set(FUNC(msx_state::msx_ppi_port_b_r));
+ ppi.out_pc_callback().set(FUNC(msx_state::msx_ppi_port_c_w));
/* video hardware */
MCFG_V9938_ADD("v9938", "screen", 0x20000, 21.477272_MHz_XTAL)
@@ -1471,10 +1471,10 @@ MACHINE_CONFIG_START(msx_state::msx2p)
MCFG_DEVICE_IO_MAP(msx2p_io_map)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, msx_state, msx_ppi_port_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, msx_state, msx_ppi_port_b_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, msx_state, msx_ppi_port_c_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(msx_state::msx_ppi_port_a_w));
+ ppi.in_pb_callback().set(FUNC(msx_state::msx_ppi_port_b_r));
+ ppi.out_pc_callback().set(FUNC(msx_state::msx_ppi_port_c_w));
/* video hardware */
MCFG_V9958_ADD("v9958", "screen", 0x20000, 21.477272_MHz_XTAL)
diff --git a/src/mame/drivers/multi8.cpp b/src/mame/drivers/multi8.cpp
index 93d34916724..466d08e9f04 100644
--- a/src/mame/drivers/multi8.cpp
+++ b/src/mame/drivers/multi8.cpp
@@ -600,10 +600,10 @@ MACHINE_CONFIG_START(multi8_state::multi8)
MCFG_MC6845_CHAR_WIDTH(8)
MCFG_MC6845_UPDATE_ROW_CB(multi8_state, crtc_update_row)
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, multi8_state, porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, multi8_state, portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, multi8_state, portc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(multi8_state::porta_r));
+ m_ppi->out_pb_callback().set(FUNC(multi8_state::portb_w));
+ m_ppi->out_pc_callback().set(FUNC(multi8_state::portc_w));
clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
uart_clock.signal_handler().set("uart", FUNC(i8251_device::write_txc));
diff --git a/src/mame/drivers/myb3k.cpp b/src/mame/drivers/myb3k.cpp
index 6b75dc10969..9a62e29231d 100644
--- a/src/mame/drivers/myb3k.cpp
+++ b/src/mame/drivers/myb3k.cpp
@@ -945,10 +945,10 @@ MACHINE_CONFIG_START(myb3k_state::myb3k)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, myb3k_state, pic_int_w))
/* Parallel port */
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, myb3k_state, ppi_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, myb3k_state, ppi_portc_w))
+ I8255A(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_ppi8255->in_pb_callback().set(FUNC(myb3k_state::ppi_portb_r));
+ m_ppi8255->out_pc_callback().set(FUNC(myb3k_state::ppi_portc_w));
/* DMA controller */
MCFG_DEVICE_ADD("dma", I8257, XTAL(14'318'181) / 6)
diff --git a/src/mame/drivers/mycom.cpp b/src/mame/drivers/mycom.cpp
index de6b79a11c1..273eac68f22 100644
--- a/src/mame/drivers/mycom.cpp
+++ b/src/mame/drivers/mycom.cpp
@@ -513,20 +513,20 @@ MACHINE_CONFIG_START(mycom_state::mycom)
MCFG_DEVICE_PROGRAM_MAP(mycom_map)
MCFG_DEVICE_IO_MAP(mycom_io)
- MCFG_DEVICE_ADD("ppi8255_0", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mycom_state, mycom_04_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mycom_state, mycom_05_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mycom_state, mycom_06_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mycom_state, mycom_06_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mycom_state, mycom_08_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mycom_state, mycom_0a_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_IN_PORTB_CB(READ8("rtc", msm5832_device, data_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8("rtc", msm5832_device, data_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mycom_state, mycom_rtc_w))
+ I8255(config, m_ppi0);
+ m_ppi0->out_pa_callback().set(FUNC(mycom_state::mycom_04_w));
+ m_ppi0->in_pb_callback().set(FUNC(mycom_state::mycom_05_r));
+ m_ppi0->in_pc_callback().set(FUNC(mycom_state::mycom_06_r));
+ m_ppi0->out_pc_callback().set(FUNC(mycom_state::mycom_06_w));
+
+ I8255(config, m_ppi1);
+ m_ppi1->in_pa_callback().set(FUNC(mycom_state::mycom_08_r));
+ m_ppi1->out_pc_callback().set(FUNC(mycom_state::mycom_0a_w));
+
+ I8255(config, m_ppi2);
+ m_ppi2->in_pb_callback().set("rtc", FUNC(msm5832_device::data_r));
+ m_ppi2->out_pb_callback().set("rtc", FUNC(msm5832_device::data_w));
+ m_ppi2->out_pc_callback().set(FUNC(mycom_state::mycom_rtc_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/mz2000.cpp b/src/mame/drivers/mz2000.cpp
index b56e84163df..55389a15db8 100644
--- a/src/mame/drivers/mz2000.cpp
+++ b/src/mame/drivers/mz2000.cpp
@@ -881,13 +881,13 @@ MACHINE_CONFIG_START(mz2000_state::mz2000)
MCFG_DEVICE_PROGRAM_MAP(mz2000_map)
MCFG_DEVICE_IO_MAP(mz2000_io)
- MCFG_DEVICE_ADD("i8255_0", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mz2000_state, mz2000_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mz2000_state, mz2000_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mz2000_state, mz2000_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mz2000_state, mz2000_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mz2000_state, mz2000_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz2000_state, mz2000_portc_w))
+ i8255_device &ppi(I8255(config, "i8255_0"));
+ ppi.in_pa_callback().set(FUNC(mz2000_state::mz2000_porta_r));
+ ppi.out_pa_callback().set(FUNC(mz2000_state::mz2000_porta_w));;
+ ppi.in_pb_callback().set(FUNC(mz2000_state::mz2000_portb_r));
+ ppi.out_pb_callback().set(FUNC(mz2000_state::mz2000_portb_w));
+ ppi.in_pc_callback().set(FUNC(mz2000_state::mz2000_portc_r));
+ ppi.out_pc_callback().set(FUNC(mz2000_state::mz2000_portc_w));
z80pio_device& pio(Z80PIO(config, "z80pio_1", MASTER_CLOCK));
pio.in_pa_callback().set(FUNC(mz2000_state::mz2000_pio1_porta_r));
diff --git a/src/mame/drivers/mz2500.cpp b/src/mame/drivers/mz2500.cpp
index e48dc84b0cd..5bbacf1d132 100644
--- a/src/mame/drivers/mz2500.cpp
+++ b/src/mame/drivers/mz2500.cpp
@@ -1806,13 +1806,13 @@ MACHINE_CONFIG_START(mz2500_state::mz2500)
ADDRESS_MAP_BANK(config, m_rambank[bank]).set_map(&mz2500_state::mz2500_bank_window_map).set_options(ENDIANNESS_LITTLE, 8, 16+3, 0x2000);
}
- MCFG_DEVICE_ADD("i8255_0", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, mz2500_state, mz2500_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mz2500_state, mz2500_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mz2500_state, mz2500_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mz2500_state, mz2500_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mz2500_state, mz2500_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz2500_state, mz2500_portc_w))
+ i8255_device &ppi(I8255(config, "i8255_0"));
+ ppi.in_pa_callback().set(FUNC(mz2500_state::mz2500_porta_r));
+ ppi.out_pa_callback().set(FUNC(mz2500_state::mz2500_porta_w));
+ ppi.in_pb_callback().set(FUNC(mz2500_state::mz2500_portb_r));
+ ppi.out_pb_callback().set(FUNC(mz2500_state::mz2500_portb_w));
+ ppi.in_pc_callback().set(FUNC(mz2500_state::mz2500_portc_r));
+ ppi.out_pc_callback().set(FUNC(mz2500_state::mz2500_portc_w));
z80pio_device& pio(Z80PIO(config, "z80pio_1", 6000000));
pio.in_pa_callback().set(FUNC(mz2500_state::mz2500_pio1_porta_r));
diff --git a/src/mame/drivers/mz3500.cpp b/src/mame/drivers/mz3500.cpp
index 5ec89120701..083ca202a13 100644
--- a/src/mame/drivers/mz3500.cpp
+++ b/src/mame/drivers/mz3500.cpp
@@ -821,10 +821,10 @@ MACHINE_CONFIG_START(mz3500_state::mz3500)
MCFG_QUANTUM_PERFECT_CPU("master")
- MCFG_DEVICE_ADD("i8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mz3500_state, mz3500_pa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, mz3500_state, mz3500_pb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz3500_state, mz3500_pc_w))
+ i8255_device &ppi(I8255A(config, "i8255"));
+ ppi.out_pa_callback().set(FUNC(mz3500_state::mz3500_pa_w));
+ ppi.out_pb_callback().set(FUNC(mz3500_state::mz3500_pb_w));
+ ppi.out_pc_callback().set(FUNC(mz3500_state::mz3500_pc_w));
MCFG_UPD765A_ADD("upd765a", true, true)
MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("master", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/mz700.cpp b/src/mame/drivers/mz700.cpp
index 22e17fae496..603c11e7395 100644
--- a/src/mame/drivers/mz700.cpp
+++ b/src/mame/drivers/mz700.cpp
@@ -409,11 +409,11 @@ MACHINE_CONFIG_START(mz_state::mz700)
MCFG_PIT8253_CLK2(0)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, mz_state, pit_irq_2))
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mz_state, pio_port_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mz_state, pio_port_b_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mz_state, pio_port_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz_state, pio_port_c_w))
+ I8255(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(mz_state::pio_port_a_w));
+ m_ppi->in_pb_callback().set(FUNC(mz_state::pio_port_b_r));
+ m_ppi->in_pc_callback().set(FUNC(mz_state::pio_port_c_r));
+ m_ppi->out_pc_callback().set(FUNC(mz_state::pio_port_c_w));
TTL74145(config, m_ls145);
diff --git a/src/mame/drivers/mz80.cpp b/src/mame/drivers/mz80.cpp
index 17d91c72d0a..301af9c970e 100644
--- a/src/mame/drivers/mz80.cpp
+++ b/src/mame/drivers/mz80.cpp
@@ -303,11 +303,11 @@ MACHINE_CONFIG_START(mz80_state::mz80k)
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50);
/* Devices */
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mz80_state, mz80k_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, mz80_state, mz80k_8255_portb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, mz80_state, mz80k_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz80_state, mz80k_8255_portc_w))
+ I8255(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(mz80_state::mz80k_8255_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(mz80_state::mz80k_8255_portb_r));
+ m_ppi->in_pc_callback().set(FUNC(mz80_state::mz80k_8255_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(mz80_state::mz80k_8255_portc_w));
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL(8'000'000)/4)
diff --git a/src/mame/drivers/okean240.cpp b/src/mame/drivers/okean240.cpp
index fb30a6eb43a..7114a44014e 100644
--- a/src/mame/drivers/okean240.cpp
+++ b/src/mame/drivers/okean240.cpp
@@ -73,6 +73,7 @@ public:
, m_p_videoram(*this, "videoram")
, m_io_modifiers(*this, "MODIFIERS")
, m_maincpu(*this, "maincpu")
+ , m_ppikbd(*this, "ppikbd")
{ }
void okean240a(machine_config &config);
@@ -118,6 +119,7 @@ private:
optional_ioport m_io_modifiers;
ioport_port *m_io_port[11];
required_device<cpu_device> m_maincpu;
+ required_device<i8255_device> m_ppikbd;
};
// okean240 requires bit 4 to change
@@ -236,7 +238,7 @@ void okean240_state::okean240_mem(address_map &map)
void okean240_state::okean240_io(address_map &map)
{
map.global_mask(0xff);
- map(0x40, 0x43).rw("ppikbd", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x40, 0x43).rw(m_ppikbd, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x60, 0x63).rw("pit", FUNC(pit8253_device::read), FUNC(pit8253_device::write));
map(0x80, 0x81).rw("pic", FUNC(pic8259_device::read), FUNC(pic8259_device::write));
map(0x80, 0x80).r(FUNC(okean240_state::okean240_kbd_status_r));
@@ -249,7 +251,7 @@ void okean240_state::okean240_io(address_map &map)
void okean240_state::okean240a_io(address_map &map)
{
map.global_mask(0xff);
- map(0x40, 0x43).rw("ppikbd", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x40, 0x43).rw(m_ppikbd, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x60, 0x63).rw("pit", FUNC(pit8253_device::read), FUNC(pit8253_device::write));
map(0x80, 0x81).rw("pic", FUNC(pic8259_device::read), FUNC(pic8259_device::write));
map(0x80, 0x80).r(FUNC(okean240_state::okean240a_kbd_status_r));
@@ -273,7 +275,7 @@ void okean240_state::okean240t_io(address_map &map)
{
map.global_mask(0xff);
map(0x20, 0x23).nopw();
- map(0x40, 0x43).rw("ppikbd", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x40, 0x43).rw(m_ppikbd, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x60, 0x63).rw("pit", FUNC(pit8253_device::read), FUNC(pit8253_device::write));
map(0x80, 0x81).rw("pic", FUNC(pic8259_device::read), FUNC(pic8259_device::write));
map(0x80, 0x80).r(FUNC(okean240_state::okean240_kbd_status_r));
@@ -523,15 +525,15 @@ MACHINE_CONFIG_START(okean240_state::okean240t)
MCFG_RS232_DSR_HANDLER(WRITELINE("uart", i8251_device, write_dsr))
MCFG_RS232_CTS_HANDLER(WRITELINE("uart", i8251_device, write_cts))
- MCFG_DEVICE_ADD("ppikbd", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, okean240_state, okean240_port40_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, okean240_state, okean240_port41_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, okean240_state, okean240_port42_w))
+ I8255(config, m_ppikbd);
+ m_ppikbd->in_pa_callback().set(FUNC(okean240_state::okean240_port40_r));
+ m_ppikbd->in_pb_callback().set(FUNC(okean240_state::okean240_port41_r));
+ m_ppikbd->out_pc_callback().set(FUNC(okean240_state::okean240_port42_w));
- MCFG_DEVICE_ADD("ppic", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, okean240_state, scroll_w))
+ i8255_device &ppic(I8255(config, "ppic"));
+ ppic.out_pa_callback().set(FUNC(okean240_state::scroll_w));
- MCFG_DEVICE_ADD("ppie", I8255, 0)
+ I8255(config, "ppie");
pit8253_device &pit(PIT8253(config, "pit", 0));
pit.set_clk<1>(3072000); // artificial rate
@@ -563,10 +565,9 @@ MACHINE_CONFIG_START(okean240_state::okean240a)
MCFG_RS232_DSR_HANDLER(WRITELINE("uart", i8251_device, write_dsr))
MCFG_RS232_CTS_HANDLER(WRITELINE("uart", i8251_device, write_cts))
- MCFG_DEVICE_MODIFY("ppikbd")
- MCFG_I8255_IN_PORTA_CB(READ8(*this, okean240_state, okean240a_port40_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, okean240_state, okean240a_port41_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, okean240_state, okean240a_port42_r))
+ m_ppikbd->in_pa_callback().set(FUNC(okean240_state::okean240a_port40_r));
+ m_ppikbd->in_pb_callback().set(FUNC(okean240_state::okean240a_port41_r));
+ m_ppikbd->in_pc_callback().set(FUNC(okean240_state::okean240a_port42_r));
MCFG_DEVICE_MODIFY("pit")
MCFG_PIT8253_CLK1(1536000) // artificial rate
diff --git a/src/mame/drivers/olyboss.cpp b/src/mame/drivers/olyboss.cpp
index cb58bb8d478..f61f9204af4 100644
--- a/src/mame/drivers/olyboss.cpp
+++ b/src/mame/drivers/olyboss.cpp
@@ -470,9 +470,9 @@ MACHINE_CONFIG_START( olyboss_state::olybossd )
m_crtc->int_wr_callback().set(m_uic, FUNC(am9519_device::ireq0_w)).invert();
m_crtc->set_screen(SCREEN_TAG);
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, olyboss_state, keyboard_read))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, olyboss_state, ppic_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(olyboss_state::keyboard_read));
+ m_ppi->out_pc_callback().set(FUNC(olyboss_state::ppic_w));
/* keyboard */
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
diff --git a/src/mame/drivers/pasopia.cpp b/src/mame/drivers/pasopia.cpp
index c8d41b05797..6e6133314be 100644
--- a/src/mame/drivers/pasopia.cpp
+++ b/src/mame/drivers/pasopia.cpp
@@ -310,18 +310,18 @@ MACHINE_CONFIG_START(pasopia_state::pasopia)
MCFG_MC6845_CHAR_WIDTH(8)
MCFG_MC6845_UPDATE_ROW_CB(pasopia_state, crtc_update_row)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pasopia_state, vram_addr_lo_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pasopia_state, vram_latch_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pasopia_state, vram_latch_r))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pasopia_state, screen_mode_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pasopia_state, portb_1_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pasopia_state, vram_addr_hi_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pasopia_state, rombank_r))
+ I8255A(config, m_ppi0);
+ m_ppi0->out_pa_callback().set(FUNC(pasopia_state::vram_addr_lo_w));
+ m_ppi0->out_pb_callback().set(FUNC(pasopia_state::vram_latch_w));
+ m_ppi0->in_pc_callback().set(FUNC(pasopia_state::vram_latch_r));
+
+ I8255A(config, m_ppi1);
+ m_ppi1->out_pa_callback().set(FUNC(pasopia_state::screen_mode_w));
+ m_ppi1->in_pb_callback().set(FUNC(pasopia_state::portb_1_r));
+ m_ppi1->out_pc_callback().set(FUNC(pasopia_state::vram_addr_hi_w));
+
+ I8255A(config, m_ppi2);
+ m_ppi2->in_pc_callback().set(FUNC(pasopia_state::rombank_r));
Z80CTC(config, m_ctc, XTAL(4'000'000));
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/pasopia7.cpp b/src/mame/drivers/pasopia7.cpp
index e2b4780d3a9..d66dd5232d7 100644
--- a/src/mame/drivers/pasopia7.cpp
+++ b/src/mame/drivers/pasopia7.cpp
@@ -949,22 +949,22 @@ MACHINE_CONFIG_START(pasopia7_state::p7_base)
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))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pasopia7_state, screen_mode_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pasopia7_state, crtc_portb_r))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pasopia7_state, plane_reg_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pasopia7_state, video_attr_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pasopia7_state, video_misc_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pasopia7_state, nmi_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pasopia7_state, nmi_mask_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pasopia7_state, nmi_portb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pasopia7_state, nmi_reg_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pasopia7_state, nmi_reg_w))
+ I8255(config, m_ppi0);
+ m_ppi0->in_pa_callback().set(FUNC(pasopia7_state::unk_r));
+ m_ppi0->out_pa_callback().set(FUNC(pasopia7_state::screen_mode_w));
+ m_ppi0->in_pb_callback().set(FUNC(pasopia7_state::crtc_portb_r));
+
+ I8255(config, m_ppi1);
+ m_ppi1->out_pa_callback().set(FUNC(pasopia7_state::plane_reg_w));
+ m_ppi1->out_pb_callback().set(FUNC(pasopia7_state::video_attr_w));
+ m_ppi1->out_pc_callback().set(FUNC(pasopia7_state::video_misc_w));
+
+ I8255(config, m_ppi2);
+ m_ppi2->in_pa_callback().set(FUNC(pasopia7_state::nmi_porta_r));
+ m_ppi2->out_pa_callback().set(FUNC(pasopia7_state::nmi_mask_w));
+ m_ppi2->in_pb_callback().set(FUNC(pasopia7_state::nmi_portb_r));
+ m_ppi2->in_pc_callback().set(FUNC(pasopia7_state::nmi_reg_r));
+ m_ppi2->out_pc_callback().set(FUNC(pasopia7_state::nmi_reg_w));
MCFG_UPD765A_ADD("fdc", true, true)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pasopia7_floppies, "525hd", floppy_image_device::default_floppy_formats)
diff --git a/src/mame/drivers/pc100.cpp b/src/mame/drivers/pc100.cpp
index 9316338dfb9..b92eaee0d04 100644
--- a/src/mame/drivers/pc100.cpp
+++ b/src/mame/drivers/pc100.cpp
@@ -648,15 +648,15 @@ MACHINE_CONFIG_START(pc100_state::pc100)
MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", pc100_state, pc100_50hz_irq, attotime::from_hz(MASTER_CLOCK/50))
MCFG_TIMER_DRIVER_ADD_PERIODIC("10hz", pc100_state, pc100_10hz_irq, attotime::from_hz(MASTER_CLOCK/10))
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pc100_state, rtc_porta_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc100_state, rtc_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc100_state, rtc_portc_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pc100_state, lower_mask_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pc100_state, upper_mask_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc100_state, crtc_bank_w))
+ i8255_device &ppi1(I8255(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(pc100_state::rtc_porta_w));
+ ppi1.in_pc_callback().set(FUNC(pc100_state::rtc_portc_r));
+ ppi1.out_pc_callback().set(FUNC(pc100_state::rtc_portc_w));
+
+ i8255_device &ppi2(I8255(config, "ppi8255_2"));
+ ppi2.out_pa_callback().set(FUNC(pc100_state::lower_mask_w));
+ ppi2.out_pb_callback().set(FUNC(pc100_state::upper_mask_w));
+ ppi2.out_pc_callback().set(FUNC(pc100_state::crtc_bank_w));
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
diff --git a/src/mame/drivers/pc6001.cpp b/src/mame/drivers/pc6001.cpp
index e9176252c6f..3396f9e1736 100644
--- a/src/mame/drivers/pc6001.cpp
+++ b/src/mame/drivers/pc6001.cpp
@@ -1507,13 +1507,13 @@ MACHINE_CONFIG_START(pc6001_state::pc6001)
MCFG_PALETTE_ADD("palette", 16+4)
MCFG_PALETTE_INIT_OWNER(pc6001_state, pc6001)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pc6001_state, ppi_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pc6001_state, ppi_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pc6001_state, ppi_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pc6001_state, ppi_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc6001_state, ppi_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc6001_state, ppi_portc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(pc6001_state::ppi_porta_r));
+ m_ppi->out_pa_callback().set(FUNC(pc6001_state::ppi_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(pc6001_state::ppi_portb_r));
+ m_ppi->out_pb_callback().set(FUNC(pc6001_state::ppi_portb_w));
+ m_ppi->in_pc_callback().set(FUNC(pc6001_state::ppi_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(pc6001_state::ppi_portc_w));
/* uart */
MCFG_DEVICE_ADD("uart", I8251, 0)
diff --git a/src/mame/drivers/pc8401a.cpp b/src/mame/drivers/pc8401a.cpp
index 28987acefe4..c70d2d835dc 100644
--- a/src/mame/drivers/pc8401a.cpp
+++ b/src/mame/drivers/pc8401a.cpp
@@ -583,9 +583,9 @@ MACHINE_CONFIG_START(pc8401a_state::pc8401a)
/* devices */
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, NOOP)
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc8401a_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc8401a_state, ppi_pc_w))
+ i8255_device &ppi(I8255A(config, I8255A_TAG));
+ ppi.in_pc_callback().set(FUNC(pc8401a_state::ppi_pc_r));
+ ppi.out_pc_callback().set(FUNC(pc8401a_state::ppi_pc_w));
i8251_device &uart(I8251(config, I8251_TAG, 0));
uart.txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd));
@@ -623,9 +623,9 @@ MACHINE_CONFIG_START(pc8500_state::pc8500)
/* devices */
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, NOOP)
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc8401a_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc8401a_state, ppi_pc_w))
+ i8255_device &ppi(I8255A(config, I8255A_TAG));
+ ppi.in_pc_callback().set(FUNC(pc8401a_state::ppi_pc_r));
+ ppi.out_pc_callback().set(FUNC(pc8401a_state::ppi_pc_w));
i8251_device &uart(I8251(config, I8251_TAG, 0));
uart.txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/pc8801.cpp b/src/mame/drivers/pc8801.cpp
index fcd37b3afd9..b75c37bce6a 100644
--- a/src/mame/drivers/pc8801.cpp
+++ b/src/mame/drivers/pc8801.cpp
@@ -2359,17 +2359,17 @@ MACHINE_CONFIG_START(pc8801_state::pc8801)
//MCFG_QUANTUM_TIME(attotime::from_hz(300000))
MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_DEVICE_ADD("d8255_master", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("d8255_slave", i8255_device, pb_r))
- MCFG_I8255_IN_PORTB_CB(READ8("d8255_slave", i8255_device, pa_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc8801_state, cpu_8255_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc8801_state, cpu_8255_c_w))
-
- MCFG_DEVICE_ADD("d8255_slave", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("d8255_master", i8255_device, pb_r))
- MCFG_I8255_IN_PORTB_CB(READ8("d8255_master", i8255_device, pa_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc8801_state, fdc_8255_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc8801_state, fdc_8255_c_w))
+ i8255_device &d8255_master(I8255(config, "d8255_master"));
+ d8255_master.in_pa_callback().set("d8255_slave", FUNC(i8255_device::pb_r));
+ d8255_master.in_pb_callback().set("d8255_slave", FUNC(i8255_device::pa_r));
+ d8255_master.in_pc_callback().set(FUNC(pc8801_state::cpu_8255_c_r));
+ d8255_master.out_pc_callback().set(FUNC(pc8801_state::cpu_8255_c_w));
+
+ i8255_device &d8255_slave(I8255(config, "d8255_slave"));
+ d8255_slave.in_pa_callback().set("d8255_master", FUNC(i8255_device::pb_r));
+ d8255_slave.in_pb_callback().set("d8255_master", FUNC(i8255_device::pa_r));
+ d8255_slave.in_pc_callback().set(FUNC(pc8801_state::fdc_8255_c_r));
+ d8255_slave.out_pc_callback().set(FUNC(pc8801_state::fdc_8255_c_w));
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/pc88va.cpp b/src/mame/drivers/pc88va.cpp
index f4eb0d33f9c..00cd0c6c959 100644
--- a/src/mame/drivers/pc88va.cpp
+++ b/src/mame/drivers/pc88va.cpp
@@ -1611,25 +1611,25 @@ MACHINE_CONFIG_START(pc88va_state::pc88va)
// MCFG_PALETTE_INIT_OWNER(pc88va_state, pc8801 )
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pc88va)
- MCFG_DEVICE_ADD("d8255_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("d8255_2s", i8255_device, pb_r))
- MCFG_I8255_IN_PORTB_CB(READ8("d8255_2s", i8255_device, pa_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc88va_state, cpu_8255_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc88va_state, cpu_8255_c_w))
-
- MCFG_DEVICE_ADD("d8255_3", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pc88va_state, r232_ctrl_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pc88va_state, r232_ctrl_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pc88va_state, r232_ctrl_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pc88va_state, r232_ctrl_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc88va_state, r232_ctrl_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc88va_state, r232_ctrl_portc_w))
-
- MCFG_DEVICE_ADD("d8255_2s", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("d8255_2", i8255_device, pb_r))
- MCFG_I8255_IN_PORTB_CB(READ8("d8255_2", i8255_device, pa_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pc88va_state, fdc_8255_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc88va_state, fdc_8255_c_w))
+ i8255_device &d8255_2(I8255(config, "d8255_2"));
+ d8255_2.in_pa_callback().set("d8255_2s", FUNC(i8255_device::pb_r));
+ d8255_2.in_pb_callback().set("d8255_2s", FUNC(i8255_device::pa_r));
+ d8255_2.in_pc_callback().set(FUNC(pc88va_state::cpu_8255_c_r));
+ d8255_2.out_pc_callback().set(FUNC(pc88va_state::cpu_8255_c_w));
+
+ i8255_device &d8255_3(I8255(config, "d8255_3"));
+ d8255_3.in_pa_callback().set(FUNC(pc88va_state::r232_ctrl_porta_r));
+ d8255_3.out_pa_callback().set(FUNC(pc88va_state::r232_ctrl_porta_w));
+ d8255_3.in_pb_callback().set(FUNC(pc88va_state::r232_ctrl_portb_r));
+ d8255_3.out_pb_callback().set(FUNC(pc88va_state::r232_ctrl_portb_w));
+ d8255_3.in_pc_callback().set(FUNC(pc88va_state::r232_ctrl_portc_r));
+ d8255_3.out_pc_callback().set(FUNC(pc88va_state::r232_ctrl_portc_w));
+
+ i8255_device &d8255_2s(I8255(config, "d8255_2s"));
+ d8255_2s.in_pa_callback().set("d8255_2", FUNC(i8255_device::pb_r));
+ d8255_2s.in_pb_callback().set("d8255_2", FUNC(i8255_device::pa_r));
+ d8255_2s.in_pc_callback().set(FUNC(pc88va_state::fdc_8255_c_r));
+ d8255_2s.out_pc_callback().set(FUNC(pc88va_state::fdc_8255_c_w));
PIC8259(config, m_pic1, 0);
m_pic1->out_int_callback().set_inputline(m_maincpu, 0);
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index 0d3801061f2..f57ddeeb266 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -662,8 +662,8 @@ void pc9801_state::pc9801_common_io(address_map &map)
map(0x0000, 0x001f).rw(m_dmac, FUNC(am9517a_device::read), FUNC(am9517a_device::write)).umask16(0xff00);
map(0x0000, 0x001f).rw(FUNC(pc9801_state::pic_r), FUNC(pc9801_state::pic_w)).umask16(0x00ff); // i8259 PIC (bit 3 ON slave / master) / i8237 DMA
map(0x0020, 0x002f).w(FUNC(pc9801_state::rtc_w)).umask16(0x00ff);
- map(0x0030, 0x0037).rw("ppi8255_sys", FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0xff00); //i8251 RS232c / i8255 system port
- map(0x0040, 0x0047).rw("ppi8255_prn", FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0x00ff);
+ map(0x0030, 0x0037).rw(m_ppi_sys, FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0xff00); //i8251 RS232c / i8255 system port
+ map(0x0040, 0x0047).rw(m_ppi_prn, FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0x00ff);
map(0x0040, 0x0047).rw(m_keyb, FUNC(pc9801_kbd_device::rx_r), FUNC(pc9801_kbd_device::tx_w)).umask16(0xff00); //i8255 printer port / i8251 keyboard
map(0x0050, 0x0057).rw("ppi8255_fdd", FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0xff00);
map(0x0050, 0x0057).w(FUNC(pc9801_state::nmi_ctrl_w)).umask16(0x00ff); // NMI FF / i8255 floppy port (2d?)
@@ -1424,8 +1424,8 @@ void pc9801_state::pc9821_io(address_map &map)
map(0x0000, 0x001f).w(FUNC(pc9801_state::pic_w)).umask32(0x00ff00ff); // i8259 PIC (bit 3 ON slave / master) / i8237 DMA
map(0x0020, 0x002f).w(FUNC(pc9801_state::rtc_w)).umask32(0x000000ff);
map(0x0020, 0x002f).w(FUNC(pc9801_state::dmapg8_w)).umask32(0xff00ff00);
- map(0x0030, 0x0037).rw("ppi8255_sys", FUNC(i8255_device::read), FUNC(i8255_device::write)).umask32(0xff00ff00); //i8251 RS232c / i8255 system port
- map(0x0040, 0x0047).rw("ppi8255_prn", FUNC(i8255_device::read), FUNC(i8255_device::write)).umask32(0x00ff00ff);
+ map(0x0030, 0x0037).rw(m_ppi_sys, FUNC(i8255_device::read), FUNC(i8255_device::write)).umask32(0xff00ff00); //i8251 RS232c / i8255 system port
+ map(0x0040, 0x0047).rw(m_ppi_prn, FUNC(i8255_device::read), FUNC(i8255_device::write)).umask32(0x00ff00ff);
map(0x0040, 0x0047).rw(m_keyb, FUNC(pc9801_kbd_device::rx_r), FUNC(pc9801_kbd_device::tx_w)).umask32(0xff00ff00); //i8255 printer port / i8251 keyboard
map(0x0050, 0x0053).w(FUNC(pc9801_state::nmi_ctrl_w)).umask32(0x00ff00ff);
map(0x005c, 0x005f).r(FUNC(pc9801_state::timestamp_r)).nopw(); // artic
@@ -2215,13 +2215,13 @@ MACHINE_CONFIG_START(pc9801_state::pc9801_keyboard)
MACHINE_CONFIG_END
MACHINE_CONFIG_START(pc9801_state::pc9801_mouse)
- MCFG_DEVICE_ADD("ppi8255_mouse", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pc9801_state, ppi_mouse_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pc9801_state, ppi_mouse_porta_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW3"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pc9801_state, ppi_mouse_portb_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW4"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc9801_state, ppi_mouse_portc_w))
+ i8255_device &ppi_mouse(I8255(config, "ppi8255_mouse"));
+ ppi_mouse.in_pa_callback().set(FUNC(pc9801_state::ppi_mouse_porta_r));
+ ppi_mouse.out_pa_callback().set(FUNC(pc9801_state::ppi_mouse_porta_w));
+ ppi_mouse.in_pb_callback().set_ioport("DSW3");
+ ppi_mouse.out_pb_callback().set(FUNC(pc9801_state::ppi_mouse_portb_w));
+ ppi_mouse.in_pc_callback().set_ioport("DSW4");
+ ppi_mouse.out_pc_callback().set(FUNC(pc9801_state::ppi_mouse_portc_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("mouse_timer", pc9801_state, mouse_irq_cb, attotime::from_hz(120))
MACHINE_CONFIG_END
@@ -2357,11 +2357,11 @@ MACHINE_CONFIG_START(pc9801_state::pc9801_common)
FLOPPY_CONNECTOR(config, "upd765_2hd:0", pc9801_floppies, "525hd", pc9801_state::floppy_formats);
FLOPPY_CONNECTOR(config, "upd765_2hd:1", pc9801_floppies, "525hd", pc9801_state::floppy_formats);
- MCFG_DEVICE_ADD("ppi8255_fdd", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(CONSTANT(0xff))
- MCFG_I8255_IN_PORTB_CB(CONSTANT(0xff))
- MCFG_I8255_IN_PORTC_CB(CONSTANT(0xff))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pc9801_state, ppi_fdd_portc_w))
+ i8255_device &ppi_fdd(I8255(config, "ppi8255_fdd"));
+ ppi_fdd.in_pa_callback().set_constant(0xff);
+ ppi_fdd.in_pb_callback().set_constant(0xff);
+ ppi_fdd.in_pc_callback().set_constant(0xff);
+ //ppi_fdd.out_pc_callback().set(FUNC(pc9801_state::ppi_fdd_portc_w));
MCFG_SOFTWARE_LIST_ADD("disk_list","pc98")
diff --git a/src/mame/drivers/pengadvb.cpp b/src/mame/drivers/pengadvb.cpp
index 409417ee831..b68e6c0dfcb 100644
--- a/src/mame/drivers/pengadvb.cpp
+++ b/src/mame/drivers/pengadvb.cpp
@@ -227,11 +227,11 @@ MACHINE_CONFIG_START(pengadvb_state::pengadvb)
ADDRESS_MAP_BANK(config, "page2").set_map(&pengadvb_state::bank_mem).set_options(ENDIANNESS_LITTLE, 8, 18, 0x10000);
ADDRESS_MAP_BANK(config, "page3").set_map(&pengadvb_state::bank_mem).set_options(ENDIANNESS_LITTLE, 8, 18, 0x10000);
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pengadvb_state, pengadvb_ppi_port_a_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pengadvb_state, pengadvb_ppi_port_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pengadvb_state, pengadvb_ppi_port_b_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pengadvb_state, pengadvb_ppi_port_c_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(pengadvb_state::pengadvb_ppi_port_a_r));
+ ppi.out_pa_callback().set(FUNC(pengadvb_state::pengadvb_ppi_port_a_w));
+ ppi.in_pb_callback().set(FUNC(pengadvb_state::pengadvb_ppi_port_b_r));
+ ppi.out_pc_callback().set(FUNC(pengadvb_state::pengadvb_ppi_port_c_w));
/* video hardware */
tms9128_device &vdp(TMS9128(config, "tms9128", XTAL(10'738'635)));
diff --git a/src/mame/drivers/photon.cpp b/src/mame/drivers/photon.cpp
index 007c00602b3..20cc886fe22 100644
--- a/src/mame/drivers/photon.cpp
+++ b/src/mame/drivers/photon.cpp
@@ -223,15 +223,15 @@ MACHINE_CONFIG_START(photon_state::photon)
MCFG_PALETTE_ADD("palette", 16)
MCFG_PALETTE_INIT_OWNER(pk8000_base_state, pk8000)
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, photon_state, _80_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, photon_state, _80_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, photon_state, _80_portc_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pk8000_base_state, _84_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pk8000_base_state, _84_porta_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pk8000_base_state, _84_portc_w))
+ i8255_device &ppi1(I8255(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(photon_state::_80_porta_w));
+ ppi1.in_pb_callback().set(FUNC(photon_state::_80_portb_r));
+ ppi1.out_pc_callback().set(FUNC(photon_state::_80_portc_w));
+
+ i8255_device &ppi2(I8255(config, "ppi8255_2"));
+ ppi2.in_pa_callback().set(FUNC(pk8000_base_state::_84_porta_r));
+ ppi2.out_pa_callback().set(FUNC(pk8000_base_state::_84_porta_w));
+ ppi2.out_pc_callback().set(FUNC(pk8000_base_state::_84_portc_w));
/* audio hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/piggypas.cpp b/src/mame/drivers/piggypas.cpp
index b75ceb644e3..8583b8eb894 100644
--- a/src/mame/drivers/piggypas.cpp
+++ b/src/mame/drivers/piggypas.cpp
@@ -234,10 +234,10 @@ MACHINE_CONFIG_START(piggypas_state::piggypas)
MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(8'448'000) / 8, okim6295_device::PIN7_HIGH) // clock and pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_DEVICE_ADD("ppi", I8255A, 0) // OKI M82C55A-2
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, piggypas_state, ctrl_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN0"))
+ i8255_device &ppi(I8255A(config, "ppi")); // OKI M82C55A-2
+ ppi.in_pa_callback().set_ioport("IN1");
+ ppi.out_pb_callback().set(FUNC(piggypas_state::ctrl_w));
+ ppi.in_pc_callback().set_ioport("IN0");
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/pipeline.cpp b/src/mame/drivers/pipeline.cpp
index 405f30a04c3..749c134c67e 100644
--- a/src/mame/drivers/pipeline.cpp
+++ b/src/mame/drivers/pipeline.cpp
@@ -376,16 +376,16 @@ MACHINE_CONFIG_START(pipeline_state::pipeline)
z80ctc_device& ctc(Z80CTC(config, "ctc", 7372800/2 /* same as "audiocpu" */));
ctc.intr_callback().set_inputline("audiocpu", INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("P1");
// PORT B Write - related to sound/music : check code at 0x1c0a
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pipeline_state, vidctrl_w))
+ ppi0.out_pc_callback().set(FUNC(pipeline_state::vidctrl_w));
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pipeline_state, protection_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pipeline_state, protection_w))
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("DSW1");
+ ppi1.in_pb_callback().set_ioport("DSW2");
+ ppi1.in_pc_callback().set(FUNC(pipeline_state::protection_r));
+ ppi1.out_pc_callback().set(FUNC(pipeline_state::protection_w));
MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
diff --git a/src/mame/drivers/pk8000.cpp b/src/mame/drivers/pk8000.cpp
index dd99ee2b726..e863bb47310 100644
--- a/src/mame/drivers/pk8000.cpp
+++ b/src/mame/drivers/pk8000.cpp
@@ -380,15 +380,15 @@ MACHINE_CONFIG_START(pk8000_state::pk8000)
MCFG_PALETTE_ADD("palette", 16)
MCFG_PALETTE_INIT_OWNER(pk8000_base_state, pk8000)
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pk8000_state, _80_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pk8000_state, _80_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pk8000_state, _80_portc_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pk8000_base_state, _84_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pk8000_base_state, _84_porta_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pk8000_base_state, _84_portc_w))
+ i8255_device &ppi1(I8255(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(pk8000_state::_80_porta_w));
+ ppi1.in_pb_callback().set(FUNC(pk8000_state::_80_portb_r));
+ ppi1.out_pc_callback().set(FUNC(pk8000_state::_80_portc_w));
+
+ i8255_device &ppi2(I8255(config, "ppi8255_2"));
+ ppi2.in_pa_callback().set(FUNC(pk8000_base_state::_84_porta_r));
+ ppi2.out_pa_callback().set(FUNC(pk8000_base_state::_84_porta_w));
+ ppi2.out_pc_callback().set(FUNC(pk8000_base_state::_84_portc_w));
/* audio hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp
index 7ea21994cab..88ec2c70011 100644
--- a/src/mame/drivers/pk8020.cpp
+++ b/src/mame/drivers/pk8020.cpp
@@ -211,16 +211,16 @@ MACHINE_CONFIG_START(pk8020_state::pk8020)
MCFG_PALETTE_ADD("palette", 16)
MCFG_PALETTE_INIT_OWNER(pk8020_state, pk8020)
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pk8020_state, pk8020_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pk8020_state, pk8020_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pk8020_state, pk8020_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pk8020_state, pk8020_portc_w))
+ I8255(config, m_ppi8255_1);
+ m_ppi8255_1->in_pa_callback().set(FUNC(pk8020_state::pk8020_porta_r));
+ m_ppi8255_1->out_pb_callback().set(FUNC(pk8020_state::pk8020_portb_w));
+ m_ppi8255_1->in_pc_callback().set(FUNC(pk8020_state::pk8020_portc_r));
+ m_ppi8255_1->out_pc_callback().set(FUNC(pk8020_state::pk8020_portc_w));
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pk8020_state, pk8020_2_portc_w))
+ I8255(config, m_ppi8255_2);
+ m_ppi8255_2->out_pc_callback().set(FUNC(pk8020_state::pk8020_2_portc_w));
- MCFG_DEVICE_ADD("ppi8255_3", I8255, 0)
+ I8255(config, m_ppi8255_3);
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
MCFG_PIT8253_CLK0(20_MHz_XTAL / 10)
diff --git a/src/mame/drivers/poisk1.cpp b/src/mame/drivers/poisk1.cpp
index 7236462d5a8..da2b386f184 100644
--- a/src/mame/drivers/poisk1.cpp
+++ b/src/mame/drivers/poisk1.cpp
@@ -666,17 +666,17 @@ MACHINE_CONFIG_START(p1_state::poisk1)
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_DEVICE_ADD("ppi8255n1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, p1_state, p1_ppi_porta_r)) /*60H*/
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, p1_state, p1_ppi_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, p1_state, p1_ppi_portb_r)) /*69H*/
- MCFG_I8255_IN_PORTC_CB(READ8(*this, p1_state, p1_ppi_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, p1_state, p1_ppi_portc_w)) /*6AH*/
-
- MCFG_DEVICE_ADD("ppi8255n2", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, p1_state, p1_ppi2_porta_w)) /*68H*/
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, p1_state, p1_ppi2_portb_w)) /*61H*/
- MCFG_I8255_IN_PORTC_CB(READ8(*this, p1_state, p1_ppi2_portc_r)) /*62H*/
+ I8255A(config, m_ppi8255n1);
+ m_ppi8255n1->in_pa_callback().set(FUNC(p1_state::p1_ppi_porta_r)); /*60H*/
+ m_ppi8255n1->out_pa_callback().set(FUNC(p1_state::p1_ppi_porta_w));
+ m_ppi8255n1->in_pb_callback().set(FUNC(p1_state::p1_ppi_portb_r)); /*69H*/
+ m_ppi8255n1->in_pc_callback().set(FUNC(p1_state::p1_ppi_portc_r));
+ m_ppi8255n1->out_pc_callback().set(FUNC(p1_state::p1_ppi_portc_w)); /*6AH*/
+
+ I8255A(config, m_ppi8255n2);
+ m_ppi8255n2->out_pa_callback().set(FUNC(p1_state::p1_ppi2_porta_w)); /*68H*/
+ m_ppi8255n2->out_pb_callback().set(FUNC(p1_state::p1_ppi2_portb_w)); /*61H*/
+ m_ppi8255n2->in_pc_callback().set(FUNC(p1_state::p1_ppi2_portc_r)); /*62H*/
MCFG_DEVICE_ADD("isa", ISA8, 0)
MCFG_ISA8_CPU("maincpu")
diff --git a/src/mame/drivers/pp01.cpp b/src/mame/drivers/pp01.cpp
index 01729ef2631..1e0a6460d8b 100644
--- a/src/mame/drivers/pp01.cpp
+++ b/src/mame/drivers/pp01.cpp
@@ -235,13 +235,13 @@ MACHINE_CONFIG_START(pp01_state::pp01)
MCFG_PIT8253_CLK2(2000000)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE("pit8253", pit8253_device, write_clk0))
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, pp01_state, pp01_8255_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pp01_state, pp01_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, pp01_state, pp01_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pp01_state, pp01_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pp01_state, pp01_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pp01_state, pp01_8255_portc_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set(FUNC(pp01_state::pp01_8255_porta_r));
+ ppi.out_pa_callback().set(FUNC(pp01_state::pp01_8255_porta_w));
+ ppi.in_pb_callback().set(FUNC(pp01_state::pp01_8255_portb_r));
+ ppi.out_pb_callback().set(FUNC(pp01_state::pp01_8255_portb_w));
+ ppi.in_pc_callback().set(FUNC(pp01_state::pp01_8255_portc_r));
+ ppi.out_pc_callback().set(FUNC(pp01_state::pp01_8255_portc_w));
/* internal ram */
RAM(config, RAM_TAG).set_default_size("64K").set_default_value(0x00);
diff --git a/src/mame/drivers/pulsar.cpp b/src/mame/drivers/pulsar.cpp
index 61d9c26b0de..4b7767e43df 100644
--- a/src/mame/drivers/pulsar.cpp
+++ b/src/mame/drivers/pulsar.cpp
@@ -219,11 +219,11 @@ MACHINE_CONFIG_START(pulsar_state::pulsar)
MCFG_MACHINE_RESET_OVERRIDE(pulsar_state, pulsar)
/* Devices */
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pulsar_state, ppi_pa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pulsar_state, ppi_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, pulsar_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pulsar_state, ppi_pc_w))
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(pulsar_state::ppi_pa_w));
+ ppi.out_pb_callback().set(FUNC(pulsar_state::ppi_pb_w));
+ ppi.in_pc_callback().set(FUNC(pulsar_state::ppi_pc_r));
+ ppi.out_pc_callback().set(FUNC(pulsar_state::ppi_pc_w));
MCFG_DEVICE_ADD("rtc", MSM5832, 32.768_kHz_XTAL)
diff --git a/src/mame/drivers/radio86.cpp b/src/mame/drivers/radio86.cpp
index 1e4f513c3c1..c021faf6604 100644
--- a/src/mame/drivers/radio86.cpp
+++ b/src/mame/drivers/radio86.cpp
@@ -464,20 +464,20 @@ GFXDECODE_END
/* Machine driver */
MACHINE_CONFIG_START(radio86_state::radio86)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",I8080, XTAL(16'000'000) / 9)
- MCFG_DEVICE_PROGRAM_MAP(radio86_mem)
- MCFG_DEVICE_IO_MAP(radio86_io)
+ I8080(config, m_maincpu, XTAL(16'000'000) / 9);
+ m_maincpu->set_addrmap(AS_PROGRAM, &radio86_state::radio86_mem);
+ m_maincpu->set_addrmap(AS_IO, &radio86_state::radio86_io);
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, radio86_state, radio86_8255_porta_w2))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, radio86_state, radio86_8255_portb_r2))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, radio86_state, radio86_8255_portc_r2))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_8255_portc_w2))
+ I8255(config, m_ppi8255_1);
+ m_ppi8255_1->out_pa_callback().set(FUNC(radio86_state::radio86_8255_porta_w2));
+ m_ppi8255_1->in_pb_callback().set(FUNC(radio86_state::radio86_8255_portb_r2));
+ m_ppi8255_1->in_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_r2));
+ m_ppi8255_1->out_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_w2));
- MCFG_DEVICE_ADD("i8275", I8275, XTAL(16'000'000) / 12)
- MCFG_I8275_CHARACTER_WIDTH(6)
- MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(radio86_state, display_pixels)
- MCFG_I8275_DRQ_CALLBACK(WRITELINE("dma8257",i8257_device, dreq2_w))
+ i8275_device &crtc(I8275(config, "i8275", XTAL(16'000'000) / 12));
+ crtc.set_character_width(6);
+ crtc.set_display_callback(FUNC(radio86_state::display_pixels), this);
+ crtc.drq_wr_callback().set("dma8257", FUNC(i8257_device::dreq2_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -506,16 +506,16 @@ MACHINE_CONFIG_START(radio86_state::radio86)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(radio86_state::kr03)
+void radio86_state::kr03(machine_config &config)
+{
radio86(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("ppi8255_1")
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, radio86_state, radio86_8255_porta_w2))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, radio86_state, kr03_8255_portb_r2))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, radio86_state, radio86_8255_portc_r2))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_8255_portc_w2))
-MACHINE_CONFIG_END
+ m_ppi8255_1->out_pa_callback().set(FUNC(radio86_state::radio86_8255_porta_w2));
+ m_ppi8255_1->in_pb_callback().set(FUNC(radio86_state::kr03_8255_portb_r2));
+ m_ppi8255_1->in_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_r2));
+ m_ppi8255_1->out_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_w2));
+}
MACHINE_CONFIG_START(radio86_state::radio16)
radio86(config);
@@ -530,10 +530,10 @@ MACHINE_CONFIG_START(radio86_state::radiorom)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(radio86rom_mem)
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, radio86_state, radio86rom_romdisk_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, radio86_state, radio86_romdisk_portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_romdisk_portc_w))
+ I8255(config, m_ppi8255_2);
+ m_ppi8255_2->in_pa_callback().set(FUNC(radio86_state::radio86rom_romdisk_porta_r));
+ m_ppi8255_2->out_pb_callback().set(FUNC(radio86_state::radio86_romdisk_portb_w));
+ m_ppi8255_2->out_pc_callback().set(FUNC(radio86_state::radio86_romdisk_portc_w));
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "radio86_cart")
MCFG_GENERIC_EXTENSIONS("bin,rom")
@@ -547,10 +547,10 @@ MACHINE_CONFIG_START(radio86_state::radioram)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(radio86ram_mem)
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, radio86_state, radio86ram_romdisk_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, radio86_state, radio86_romdisk_portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_romdisk_portc_w))
+ I8255(config, m_ppi8255_2);
+ m_ppi8255_2->in_pa_callback().set(FUNC(radio86_state::radio86ram_romdisk_porta_r));
+ m_ppi8255_2->out_pb_callback().set(FUNC(radio86_state::radio86_romdisk_portb_w));
+ m_ppi8255_2->out_pc_callback().set(FUNC(radio86_state::radio86_romdisk_portc_w));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(radio86_state::rk7007)
@@ -559,11 +559,11 @@ MACHINE_CONFIG_START(radio86_state::rk7007)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_IO_MAP(rk7007_io)
- MCFG_DEVICE_ADD("ms7007", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, radio86_state, radio86_8255_porta_w2))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, radio86_state, radio86_8255_portb_r2))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, radio86_state, rk7007_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_8255_portc_w2))
+ i8255_device &ms7007(I8255(config, "ms7007"));
+ ms7007.out_pa_callback().set(FUNC(radio86_state::radio86_8255_porta_w2));
+ ms7007.in_pb_callback().set(FUNC(radio86_state::radio86_8255_portb_r2));
+ ms7007.in_pc_callback().set(FUNC(radio86_state::rk7007_8255_portc_r));
+ ms7007.out_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_w2));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(radio86_state::rk700716)
@@ -572,11 +572,11 @@ MACHINE_CONFIG_START(radio86_state::rk700716)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_IO_MAP(rk7007_io)
- MCFG_DEVICE_ADD("ms7007", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, radio86_state, radio86_8255_porta_w2))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, radio86_state, radio86_8255_portb_r2))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, radio86_state, rk7007_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, radio86_state, radio86_8255_portc_w2))
+ i8255_device &ms7007(I8255(config, "ms7007"));
+ ms7007.out_pa_callback().set(FUNC(radio86_state::radio86_8255_porta_w2));
+ ms7007.in_pb_callback().set(FUNC(radio86_state::radio86_8255_portb_r2));
+ ms7007.in_pc_callback().set(FUNC(radio86_state::rk7007_8255_portc_r));
+ ms7007.out_pc_callback().set(FUNC(radio86_state::radio86_8255_portc_w2));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(radio86_state::mikron2)
diff --git a/src/mame/drivers/rc759.cpp b/src/mame/drivers/rc759.cpp
index f6196d16215..70aae956f7f 100644
--- a/src/mame/drivers/rc759.cpp
+++ b/src/mame/drivers/rc759.cpp
@@ -547,10 +547,10 @@ MACHINE_CONFIG_START(rc759_state::rc759)
NVRAM(config, "nvram").set_custom_handler(FUNC(rc759_state::nvram_init));
// ppi
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, rc759_state, ppi_porta_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, rc759_state, ppi_portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, rc759_state, ppi_portc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(rc759_state::ppi_porta_r));
+ m_ppi->in_pb_callback().set(FUNC(rc759_state::ppi_portb_r));
+ m_ppi->out_pc_callback().set(FUNC(rc759_state::ppi_portc_w));
// rtc
MCFG_DEVICE_ADD("rtc", MM58167, 32.768_kHz_XTAL)
diff --git a/src/mame/drivers/rgum.cpp b/src/mame/drivers/rgum.cpp
index 8a9ff68067a..00850ea070a 100644
--- a/src/mame/drivers/rgum.cpp
+++ b/src/mame/drivers/rgum.cpp
@@ -264,10 +264,10 @@ MACHINE_CONFIG_START(rgum_state::rgum)
MCFG_MC6845_CHAR_WIDTH(8)
MCFG_MC6845_OUT_VSYNC_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("IN0");
+ ppi.in_pb_callback().set_ioport("IN1");
+ ppi.in_pc_callback().set_ioport("IN2");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_rgum)
MCFG_PALETTE_ADD("palette", 0x100)
diff --git a/src/mame/drivers/rotaryf.cpp b/src/mame/drivers/rotaryf.cpp
index 51eceb238ab..fa488f63ae0 100644
--- a/src/mame/drivers/rotaryf.cpp
+++ b/src/mame/drivers/rotaryf.cpp
@@ -271,11 +271,11 @@ MACHINE_CONFIG_START(rotaryf_state::rotaryf)
MCFG_DEVICE_IO_MAP(rotaryf_io_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", rotaryf_state, rotaryf_interrupt, "screen", 0, 1)
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, rotaryf_state, porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, rotaryf_state, portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, rotaryf_state, portc_w))
- //MCFG_I8255_TRISTATE_PORTC_CB(CONSTANT(0))
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(rotaryf_state::porta_w));
+ ppi.in_pb_callback().set(FUNC(rotaryf_state::portb_r));
+ ppi.out_pc_callback().set(FUNC(rotaryf_state::portc_w));
+ //ppi.tri_pc_callback().set_constant(0);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/sage2.cpp b/src/mame/drivers/sage2.cpp
index b5cb29a0115..02962af2659 100644
--- a/src/mame/drivers/sage2.cpp
+++ b/src/mame/drivers/sage2.cpp
@@ -419,15 +419,15 @@ MACHINE_CONFIG_START(sage2_state::sage2)
MCFG_DEVICE_ADD(I8259_TAG, PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE(M68000_TAG, M68K_IRQ_1))
- MCFG_DEVICE_ADD(I8255A_0_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("J7"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("J6"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sage2_state, ppi0_pc_w))
-
- MCFG_DEVICE_ADD(I8255A_1_TAG, I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, sage2_state, ppi1_pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sage2_state, ppi1_pc_w))
+ i8255_device &ppi0(I8255A(config, I8255A_0_TAG));
+ ppi0.in_pa_callback().set_ioport("J7");
+ ppi0.in_pb_callback().set_ioport("J6");
+ ppi0.out_pc_callback().set(FUNC(sage2_state::ppi0_pc_w));
+
+ i8255_device &ppi1(I8255A(config, I8255A_1_TAG));
+ ppi1.out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ ppi1.in_pb_callback().set(FUNC(sage2_state::ppi1_pb_r));
+ ppi1.out_pc_callback().set(FUNC(sage2_state::ppi1_pc_w));
MCFG_DEVICE_ADD(I8253_0_TAG, PIT8253, 0)
MCFG_PIT8253_CLK0(0) // from U75 OUT0
diff --git a/src/mame/drivers/savia84.cpp b/src/mame/drivers/savia84.cpp
index 22ffc686b69..d618753ee4b 100644
--- a/src/mame/drivers/savia84.cpp
+++ b/src/mame/drivers/savia84.cpp
@@ -181,22 +181,23 @@ READ8_MEMBER( savia84_state::savia84_8255_portc_r ) // IN FA - read keyboard
return 0xff;
}
-MACHINE_CONFIG_START(savia84_state::savia84)
+void savia84_state::savia84(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",Z80, XTAL(4'000'000) / 2)
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
- MCFG_DEVICE_IO_MAP(io_map)
+ Z80(config, m_maincpu, XTAL(4'000'000) / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &savia84_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &savia84_state::io_map);
/* video hardware */
config.set_default_layout(layout_savia84);
/* Devices */
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, savia84_state, savia84_8255_porta_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, savia84_state, savia84_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, savia84_state, savia84_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, savia84_state, savia84_8255_portc_w))
-MACHINE_CONFIG_END
+ I8255(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set(FUNC(savia84_state::savia84_8255_porta_w));
+ m_ppi8255->out_pb_callback().set(FUNC(savia84_state::savia84_8255_portb_w));
+ m_ppi8255->in_pc_callback().set(FUNC(savia84_state::savia84_8255_portc_r));
+ m_ppi8255->out_pc_callback().set(FUNC(savia84_state::savia84_8255_portc_w));
+}
/* ROM definition */
ROM_START( savia84 )
diff --git a/src/mame/drivers/sbrain.cpp b/src/mame/drivers/sbrain.cpp
index f7b6abc302b..447af06bb1d 100644
--- a/src/mame/drivers/sbrain.cpp
+++ b/src/mame/drivers/sbrain.cpp
@@ -565,13 +565,13 @@ MACHINE_CONFIG_START(sbrain_state::sbrain)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* Devices */
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, sbrain_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, sbrain_state, ppi_pa_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, sbrain_state, ppi_pb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, sbrain_state, ppi_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, sbrain_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sbrain_state, ppi_pc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(sbrain_state::ppi_pa_r));
+ m_ppi->out_pa_callback().set(FUNC(sbrain_state::ppi_pa_w));
+ m_ppi->in_pb_callback().set(FUNC(sbrain_state::ppi_pb_r));
+ m_ppi->out_pb_callback().set(FUNC(sbrain_state::ppi_pb_w));
+ m_ppi->in_pc_callback().set(FUNC(sbrain_state::ppi_pc_r));
+ m_ppi->out_pc_callback().set(FUNC(sbrain_state::ppi_pc_w));
I8251(config, m_u0, 0);
diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp
index 0dc6a83d02a..c575cd684a9 100644
--- a/src/mame/drivers/scobra.cpp
+++ b/src/mame/drivers/scobra.cpp
@@ -881,14 +881,14 @@ MACHINE_CONFIG_START(scobra_state::type1)
MCFG_MACHINE_RESET_OVERRIDE(scobra_state,scramble)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi8255_0);
+ m_ppi8255_0->in_pa_callback().set_ioport("IN0");
+ m_ppi8255_0->in_pb_callback().set_ioport("IN1");
+ m_ppi8255_0->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, scramble_state, scramble_sh_irqtrigger_w))
+ I8255A(config, m_ppi8255_1);
+ m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
ttl7474_device &ttl7474_9m_1(TTL7474(config, "7474_9m_1", 0));
ttl7474_9m_1.output_cb().set(FUNC(scobra_state::galaxold_7474_9m_1_callback));
@@ -954,11 +954,11 @@ MACHINE_CONFIG_START(scobra_state::rescuefe)
MCFG_DEVICE_PROGRAM_MAP(rescuefe_map)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(scobra_state::rescueb)
+void scobra_state::rescueb(machine_config &config)
+{
rescue(config);
- MCFG_DEVICE_MODIFY("ppi8255_1")
- MCFG_I8255_IN_PORTC_CB(READ8(*this, scobra_state, rescueb_a002_r)) // protection? must return 0xfc or the game jumps to 0x00
-MACHINE_CONFIG_END
+ m_ppi8255_1->in_pc_callback().set(FUNC(scobra_state::rescueb_a002_r)); // protection? must return 0xfc or the game jumps to 0x00
+}
MACHINE_CONFIG_START(scobra_state::minefld)
@@ -1016,11 +1016,9 @@ MACHINE_CONFIG_START(scobra_state::stratgyx)
/* basic machine hardware */
- MCFG_DEVICE_REMOVE("ppi8255_1")
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, scramble_state, scramble_sh_irqtrigger_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN3"))
+ m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
+ m_ppi8255_1->in_pc_callback().set_ioport("IN3");
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
@@ -1071,14 +1069,14 @@ MACHINE_CONFIG_START(scobra_state::hustler)
MCFG_WATCHDOG_ADD("watchdog")
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi8255_0);
+ m_ppi8255_0->in_pa_callback().set_ioport("IN0");
+ m_ppi8255_0->in_pb_callback().set_ioport("IN1");
+ m_ppi8255_0->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, scramble_state, scramble_sh_irqtrigger_w))
+ I8255A(config, m_ppi8255_1);
+ m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/scramble.cpp b/src/mame/drivers/scramble.cpp
index 08ead6ba3c3..b941e690536 100644
--- a/src/mame/drivers/scramble.cpp
+++ b/src/mame/drivers/scramble.cpp
@@ -1328,14 +1328,14 @@ MACHINE_CONFIG_START(scramble_state::scramble)
MCFG_MACHINE_RESET_OVERRIDE(scramble_state,scramble)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ I8255A(config, m_ppi8255_0);
+ m_ppi8255_0->in_pa_callback().set_ioport("IN0");
+ m_ppi8255_0->in_pb_callback().set_ioport("IN1");
+ m_ppi8255_0->in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, scramble_state, scramble_sh_irqtrigger_w))
+ I8255A(config, m_ppi8255_1);
+ m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1373,11 +1373,9 @@ MACHINE_CONFIG_START(scramble_state::mars)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(mars_map)
- MCFG_DEVICE_REMOVE("ppi8255_1")
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, scramble_state, scramble_sh_irqtrigger_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN3"))
+ m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
+ m_ppi8255_1->in_pc_callback().set_ioport("IN3");
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
@@ -1422,10 +1420,9 @@ MACHINE_CONFIG_START(scramble_state::mrkougb)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(mrkougar_map)
- MCFG_DEVICE_REMOVE("ppi8255_1")
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, scramble_state, mrkougar_sh_irqtrigger_w))
+ m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::mrkougar_sh_irqtrigger_w));
+ m_ppi8255_1->in_pc_callback().set_constant(0);
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
diff --git a/src/mame/drivers/segae.cpp b/src/mame/drivers/segae.cpp
index 33678d7e2ff..099ccd3bf1e 100644
--- a/src/mame/drivers/segae.cpp
+++ b/src/mame/drivers/segae.cpp
@@ -321,6 +321,7 @@ public:
m_maincpu(*this, "maincpu"),
m_vdp1(*this, "vdp1"),
m_vdp2(*this, "vdp2"),
+ m_ppi(*this, "ppi"),
m_decrypted_opcodes(*this, "decrypted_opcodes"),
m_maincpu_region(*this, "maincpu"),
m_bank1(*this, "bank1"),
@@ -362,6 +363,7 @@ private:
required_device<cpu_device> m_maincpu;
required_device<sega315_5124_device> m_vdp1;
required_device<sega315_5124_device> m_vdp2;
+ required_device<i8255_device> m_ppi;
optional_shared_ptr<uint8_t> m_decrypted_opcodes;
required_memory_region m_maincpu_region;
@@ -422,7 +424,7 @@ void systeme_state::io_map(address_map &map)
map(0xf2, 0xf2).portr("f2");
map(0xf3, 0xf3).portr("f3");
map(0xf7, 0xf7).w(FUNC(systeme_state::bank_write));
- map(0xf8, 0xfb).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xf8, 0xfb).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write));
}
@@ -889,9 +891,9 @@ MACHINE_CONFIG_START(systeme_state::systeme)
MCFG_DEVICE_PROGRAM_MAP(systeme_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, systeme_state, coin_counters_write))
- MCFG_I8255_TRISTATE_PORTB_CB(CONSTANT(0))
+ I8255(config, m_ppi);
+ m_ppi->out_pb_callback().set(FUNC(systeme_state::coin_counters_write));
+ m_ppi->tri_pb_callback().set_constant(0);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL(10'738'635)/2, \
@@ -918,13 +920,13 @@ MACHINE_CONFIG_START(systeme_state::systeme)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(systeme_state::hangonjr)
+void systeme_state::hangonjr(machine_config &config)
+{
systeme(config);
- MCFG_DEVICE_MODIFY("ppi")
- MCFG_I8255_IN_PORTA_CB(READ8(*this, systeme_state, hangonjr_port_f8_read))
- MCFG_I8255_IN_PORTC_CB(CONSTANT(0)) // bit 4 must be the ADC0804 /INTR signal
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, systeme_state, hangonjr_port_fa_write)) // CD4051 selector input
-MACHINE_CONFIG_END
+ m_ppi->in_pa_callback().set(FUNC(systeme_state::hangonjr_port_f8_read));
+ m_ppi->in_pc_callback().set_constant(0); // bit 4 must be the ADC0804 /INTR signal
+ m_ppi->out_pc_callback().set(FUNC(systeme_state::hangonjr_port_fa_write)); // CD4051 selector input
+}
MACHINE_CONFIG_START(systeme_state::ridleofp)
systeme(config);
diff --git a/src/mame/drivers/segag80r.cpp b/src/mame/drivers/segag80r.cpp
index 523cd0929a8..6613695585d 100644
--- a/src/mame/drivers/segag80r.cpp
+++ b/src/mame/drivers/segag80r.cpp
@@ -905,11 +905,11 @@ MACHINE_CONFIG_START(segag80r_state::monsterb)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_IO_MAP(main_ppi8255_portmap)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(m_soundbrd, monsterb_sound_device, sound_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(m_soundbrd, monsterb_sound_device, sound_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(m_soundbrd, monsterb_sound_device, n7751_status_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(m_soundbrd, monsterb_sound_device, n7751_command_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.out_pa_callback().set(m_soundbrd, FUNC(monsterb_sound_device::sound_a_w));
+ ppi.out_pb_callback().set(m_soundbrd, FUNC(monsterb_sound_device::sound_b_w));
+ ppi.in_pc_callback().set(m_soundbrd, FUNC(monsterb_sound_device::n7751_status_r));
+ ppi.out_pc_callback().set(m_soundbrd, FUNC(monsterb_sound_device::n7751_command_w));
/* background board changes */
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_monsterb)
@@ -960,9 +960,9 @@ MACHINE_CONFIG_START(segag80r_state::sindbadm)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segag80r_state, sindbadm_vblank_start)
MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTB_CB(IOPORT("FC"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, segag80r_state, sindbadm_misc_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pb_callback().set_ioport("FC");
+ ppi.out_pc_callback().set(FUNC(segag80r_state::sindbadm_misc_w));
/* video hardware */
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_monsterb)
diff --git a/src/mame/drivers/segahang.cpp b/src/mame/drivers/segahang.cpp
index 54e0a035a0e..97915c88bba 100644
--- a/src/mame/drivers/segahang.cpp
+++ b/src/mame/drivers/segahang.cpp
@@ -769,14 +769,14 @@ MACHINE_CONFIG_START(segahang_state::shared_base)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("i8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, segahang_state, video_lamps_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, segahang_state, tilemap_sound_w))
-
- MCFG_DEVICE_ADD("i8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, segahang_state, sub_control_adc_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, segahang_state, adc_status_r))
+ I8255(config, m_i8255_1);
+ m_i8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_i8255_1->out_pb_callback().set(FUNC(segahang_state::video_lamps_w));
+ m_i8255_1->out_pc_callback().set(FUNC(segahang_state::tilemap_sound_w));
+
+ I8255(config, m_i8255_2);
+ m_i8255_2->out_pa_callback().set(FUNC(segahang_state::sub_control_adc_w));
+ m_i8255_2->in_pc_callback().set(FUNC(segahang_state::adc_status_r));
MCFG_DEVICE_ADD("segaic16vid", SEGAIC16VID, 0, "gfxdecode")
MCFG_DEVICE_ADD("segaic16road", SEGAIC16_ROAD, 0)
diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp
index 3dde01d107f..f447a3be27d 100644
--- a/src/mame/drivers/segaorun.cpp
+++ b/src/mame/drivers/segaorun.cpp
@@ -1161,13 +1161,13 @@ MACHINE_CONFIG_START(segaorun_state::outrun_base)
MCFG_WATCHDOG_ADD("watchdog")
- MCFG_DEVICE_ADD("i8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, segaorun_state, bankmotor_limit_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, segaorun_state, unknown_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, segaorun_state, unknown_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, segaorun_state, bankmotor_control_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, segaorun_state, unknown_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, segaorun_state, video_control_w))
+ I8255(config, m_i8255);
+ m_i8255->in_pa_callback().set(FUNC(segaorun_state::bankmotor_limit_r));
+ m_i8255->out_pa_callback().set(FUNC(segaorun_state::unknown_porta_w));
+ m_i8255->in_pb_callback().set(FUNC(segaorun_state::unknown_portb_r));
+ m_i8255->out_pb_callback().set(FUNC(segaorun_state::bankmotor_control_w));
+ m_i8255->in_pc_callback().set(FUNC(segaorun_state::unknown_portc_r));
+ m_i8255->out_pc_callback().set(FUNC(segaorun_state::video_control_w));
MCFG_DEVICE_ADD("mapper", SEGA_315_5195_MEM_MAPPER, MASTER_CLOCK/4)
MCFG_SEGA_315_5195_CPU("maincpu")
@@ -1245,14 +1245,12 @@ MACHINE_CONFIG_START(segaorun_state::shangon)
outrun_base(config);
// basic machine hardware
- MCFG_DEVICE_REMOVE("i8255")
- MCFG_DEVICE_ADD("i8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, segaorun_state, unknown_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, segaorun_state, unknown_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, segaorun_state, unknown_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, segaorun_state, unknown_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, segaorun_state, unknown_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, segaorun_state, video_control_w))
+ m_i8255->in_pa_callback().set(FUNC(segaorun_state::unknown_porta_r));
+ m_i8255->out_pa_callback().set(FUNC(segaorun_state::unknown_porta_w));
+ m_i8255->in_pb_callback().set(FUNC(segaorun_state::unknown_portb_r));
+ m_i8255->out_pb_callback().set(FUNC(segaorun_state::unknown_portb_w));
+ m_i8255->in_pc_callback().set(FUNC(segaorun_state::unknown_portc_r));
+ m_i8255->out_pc_callback().set(FUNC(segaorun_state::video_control_w));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp
index 4e8f52d3d2f..42e8b3daf86 100644
--- a/src/mame/drivers/segas16a.cpp
+++ b/src/mame/drivers/segas16a.cpp
@@ -1989,10 +1989,10 @@ MACHINE_CONFIG_START(segas16a_state::system16a)
MCFG_WATCHDOG_ADD("watchdog")
- MCFG_DEVICE_ADD("i8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, segas16a_state, misc_control_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, segas16a_state, tilemap_sound_w))
+ I8255(config, m_i8255);
+ m_i8255->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_i8255->out_pb_callback().set(FUNC(segas16a_state::misc_control_w));
+ m_i8255->out_pc_callback().set(FUNC(segas16a_state::tilemap_sound_w));
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp
index f613b4e9f5c..d0a659bb374 100644
--- a/src/mame/drivers/segas32.cpp
+++ b/src/mame/drivers/segas32.cpp
@@ -2365,10 +2365,10 @@ MACHINE_CONFIG_START(segas32_4player_state::device_add_mconfig)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(system32_4player_map)
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("EXTRA1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("EXTRA2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("EXTRA3"))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.in_pa_callback().set_ioport("EXTRA1");
+ ppi.in_pb_callback().set_ioport("EXTRA2");
+ ppi.in_pc_callback().set_ioport("EXTRA3");
MACHINE_CONFIG_END
DEFINE_DEVICE_TYPE(SEGA_S32_4PLAYER_DEVICE, segas32_4player_state, "segas32_pcb_4player", "Sega System 32 4-player/fighting PCB")
@@ -2663,10 +2663,10 @@ MACHINE_CONFIG_START(sega_multi32_6player_state::device_add_mconfig)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(multi32_6player_map)
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("EXTRA1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("EXTRA2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("EXTRA3"))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.in_pa_callback().set_ioport("EXTRA1");
+ ppi.in_pb_callback().set_ioport("EXTRA2");
+ ppi.in_pc_callback().set_ioport("EXTRA3");
MACHINE_CONFIG_END
DEFINE_DEVICE_TYPE(SEGA_MULTI32_6PLAYER_DEVICE, sega_multi32_6player_state, "segas32_pcb_multi_6player", "Sega Multi 32 6-player PCB")
diff --git a/src/mame/drivers/sfkick.cpp b/src/mame/drivers/sfkick.cpp
index 04a3a06c7b3..1e2eda5929e 100644
--- a/src/mame/drivers/sfkick.cpp
+++ b/src/mame/drivers/sfkick.cpp
@@ -609,10 +609,10 @@ MACHINE_CONFIG_START(sfkick_state::sfkick)
MCFG_V99X8_INTERRUPT_CALLBACK(INPUTLINE("maincpu", 0))
MCFG_V99X8_SCREEN_ADD_NTSC("screen", "v9938", MASTER_CLOCK)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, sfkick_state, ppi_port_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, sfkick_state, ppi_port_b_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sfkick_state, ppi_port_c_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.out_pa_callback().set(FUNC(sfkick_state::ppi_port_a_w));
+ ppi.in_pb_callback().set(FUNC(sfkick_state::ppi_port_b_r));
+ ppi.out_pc_callback().set(FUNC(sfkick_state::ppi_port_c_w));
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/sg1000.cpp b/src/mame/drivers/sg1000.cpp
index c427823a80a..5b4b29f1c78 100644
--- a/src/mame/drivers/sg1000.cpp
+++ b/src/mame/drivers/sg1000.cpp
@@ -636,10 +636,10 @@ MACHINE_CONFIG_START(sf7000_state::sf7000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* devices */
- MCFG_DEVICE_ADD(UPD9255_1_TAG, I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, sf7000_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sf7000_state, ppi_pc_w))
+ i8255_device &ppi(I8255(config, UPD9255_1_TAG));
+ ppi.in_pa_callback().set(FUNC(sf7000_state::ppi_pa_r));
+ ppi.out_pb_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ ppi.out_pc_callback().set(FUNC(sf7000_state::ppi_pc_w));
i8251_device &upd8251(I8251(config, UPD8251_TAG, 0));
upd8251.txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/sg1000a.cpp b/src/mame/drivers/sg1000a.cpp
index 79b489ac71f..58bac477532 100644
--- a/src/mame/drivers/sg1000a.cpp
+++ b/src/mame/drivers/sg1000a.cpp
@@ -474,11 +474,11 @@ MACHINE_CONFIG_START(sg1000a_state::sg1000a)
MCFG_DEVICE_PROGRAM_MAP(program_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sg1000a_state, sg1000a_coin_counter_w))
+ i8255_device &ppi(I8255(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("P1");
+ ppi.in_pb_callback().set_ioport("P2");
+ ppi.in_pc_callback().set_ioport("DSW");
+ ppi.out_pc_callback().set(FUNC(sg1000a_state::sg1000a_coin_counter_w));
/* video hardware */
tms9928a_device &vdp(TMS9928A(config, "tms9928a", XTAL(10'738'635)));
diff --git a/src/mame/drivers/sitcom.cpp b/src/mame/drivers/sitcom.cpp
index f9cfdf98c90..52d8685b9dc 100644
--- a/src/mame/drivers/sitcom.cpp
+++ b/src/mame/drivers/sitcom.cpp
@@ -76,8 +76,8 @@ protected:
DECLARE_WRITE_LINE_MEMBER(sod_led) { output().set_value("sod_led", state); }
DECLARE_READ_LINE_MEMBER(sid_line) { return m_rxd ? 1 : 0; }
- virtual DECLARE_WRITE8_MEMBER(update_pia_pa);
- virtual DECLARE_WRITE8_MEMBER(update_pia_pb);
+ virtual DECLARE_WRITE8_MEMBER(update_ppi_pa);
+ virtual DECLARE_WRITE8_MEMBER(update_ppi_pb);
void sitcom_bank(address_map &map);
void sitcom_io(address_map &map);
@@ -107,7 +107,7 @@ public:
sitcom_timer_state(const machine_config &mconfig, device_type type, const char *tag)
: sitcom_state(mconfig, type, tag)
, m_speed(*this, "SPEED")
- , m_pia(*this, "pia")
+ , m_ppi(*this, "ppi")
, m_ds2(*this, "ds2")
, m_shutter_timer(nullptr)
, m_shutter(false)
@@ -123,8 +123,8 @@ public:
void sitcomtmr(machine_config &config);
protected:
- virtual DECLARE_WRITE8_MEMBER(update_pia_pa) override;
- virtual DECLARE_WRITE8_MEMBER(update_pia_pb) override;
+ virtual DECLARE_WRITE8_MEMBER(update_ppi_pa) override;
+ virtual DECLARE_WRITE8_MEMBER(update_ppi_pb) override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
@@ -134,7 +134,7 @@ protected:
void update_dac(uint8_t value);
required_ioport m_speed;
- required_device<i8255_device> m_pia;
+ required_device<i8255_device> m_ppi;
required_device<dl1414_device> m_ds2;
emu_timer *m_shutter_timer;
@@ -161,7 +161,7 @@ void sitcom_state::sitcom_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0xff);
- map(0x00, 0x03).mirror(0x1c).rw("pia", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x00, 0x03).mirror(0x1c).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xc0, 0xc3).mirror(0x1c).w("ds0", FUNC(dl1414_device::bus_w));
map(0xe0, 0xe3).mirror(0x1c).w("ds1", FUNC(dl1414_device::bus_w));
}
@@ -224,13 +224,13 @@ void sitcom_state::machine_reset()
m_bank->set_bank(0);
}
-WRITE8_MEMBER( sitcom_state::update_pia_pa )
+WRITE8_MEMBER( sitcom_state::update_ppi_pa )
{
for (int i = 0; 8 > i; ++i)
m_leds[0][i] = BIT(data, i);
}
-WRITE8_MEMBER( sitcom_state::update_pia_pb )
+WRITE8_MEMBER( sitcom_state::update_ppi_pb )
{
for (int i = 0; 8 > i; ++i)
m_leds[1][i] = BIT(data, i);
@@ -250,7 +250,7 @@ INPUT_CHANGED_MEMBER( sitcom_state::update_buttons )
}
-WRITE8_MEMBER( sitcom_timer_state::update_pia_pa )
+WRITE8_MEMBER( sitcom_timer_state::update_ppi_pa )
{
if (!m_dac_cs && !m_dac_wr)
update_dac(data);
@@ -258,10 +258,10 @@ WRITE8_MEMBER( sitcom_timer_state::update_pia_pa )
m_ds2->data_w(data & 0x7f);
}
-WRITE8_MEMBER( sitcom_timer_state::update_pia_pb )
+WRITE8_MEMBER( sitcom_timer_state::update_ppi_pb )
{
if (!m_dac_cs && !BIT(data, 0))
- update_dac(m_pia->read_pa());
+ update_dac(m_ppi->read_pa());
m_dac_wr = BIT(data, 0);
m_dac_cs = BIT(data, 1);
@@ -360,10 +360,10 @@ MACHINE_CONFIG_START(sitcom_state::sitcom)
MCFG_CLOCK_ADD("100hz", 100)
MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", I8085_RST75_LINE))
- MCFG_DEVICE_ADD("pia", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, sitcom_state, update_pia_pa))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, sitcom_state, update_pia_pb))
- MCFG_I8255_IN_PORTC_CB(IOPORT("PORTC"))
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(sitcom_state::update_ppi_pa));
+ ppi.out_pb_callback().set(FUNC(sitcom_state::update_ppi_pb));
+ ppi.in_pc_callback().set_ioport("PORTC");
// video hardware
MCFG_DEVICE_ADD("ds0", DL1414T, u32(0)) // left display
diff --git a/src/mame/drivers/skylncr.cpp b/src/mame/drivers/skylncr.cpp
index 1d0fb3a2440..3a8b0529a7c 100644
--- a/src/mame/drivers/skylncr.cpp
+++ b/src/mame/drivers/skylncr.cpp
@@ -1656,15 +1656,15 @@ MACHINE_CONFIG_START(skylncr_state::skylncr)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* 1x M5M82C255, or 2x PPI8255 */
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1"))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN4"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("IN1");
+ ppi0.in_pb_callback().set_ioport("IN2");
+ ppi0.in_pc_callback().set_ioport("DSW1");
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("DSW2");
+ ppi1.in_pb_callback().set_ioport("IN3");
+ ppi1.in_pc_callback().set_ioport("IN4");
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
diff --git a/src/mame/drivers/slotcarn.cpp b/src/mame/drivers/slotcarn.cpp
index a1878176215..3b6045b1833 100644
--- a/src/mame/drivers/slotcarn.cpp
+++ b/src/mame/drivers/slotcarn.cpp
@@ -550,17 +550,17 @@ MACHINE_CONFIG_START(slotcarn_state::slotcarn)
MCFG_DEVICE_PROGRAM_MAP(slotcarn_map)
MCFG_DEVICE_IO_MAP(spielbud_io_map)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("IN0");
+ ppi0.in_pb_callback().set_ioport("IN1");
+ ppi0.in_pc_callback().set_ioport("IN2");
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("DSW1");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN3"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN4"))
+ i8255_device &ppi2(I8255A(config, "ppi8255_2"));
+ ppi2.in_pa_callback().set_ioport("IN3");
+ ppi2.in_pb_callback().set_ioport("IN4");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/sm1800.cpp b/src/mame/drivers/sm1800.cpp
index 5709c911a50..b56ae565924 100644
--- a/src/mame/drivers/sm1800.cpp
+++ b/src/mame/drivers/sm1800.cpp
@@ -182,11 +182,11 @@ MACHINE_CONFIG_START(sm1800_state::sm1800)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sm1800)
/* Devices */
- MCFG_DEVICE_ADD("i8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, sm1800_state, sm1800_8255_porta_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, sm1800_state, sm1800_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, sm1800_state, sm1800_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sm1800_state, sm1800_8255_portc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(sm1800_state::sm1800_8255_porta_r));
+ m_ppi->out_pb_callback().set(FUNC(sm1800_state::sm1800_8255_portb_w));
+ m_ppi->in_pc_callback().set(FUNC(sm1800_state::sm1800_8255_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(sm1800_state::sm1800_8255_portc_w));
MCFG_DEVICE_ADD("i8275", I8275, 2000000)
MCFG_I8275_CHARACTER_WIDTH(8)
diff --git a/src/mame/drivers/smsmcorp.cpp b/src/mame/drivers/smsmcorp.cpp
index fe1690684e6..db4a3001a5a 100644
--- a/src/mame/drivers/smsmcorp.cpp
+++ b/src/mame/drivers/smsmcorp.cpp
@@ -560,15 +560,15 @@ MACHINE_CONFIG_START(smsmfg_state::sms)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, smsmfg_state, ppi0_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, smsmfg_state, ppi0_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, smsmfg_state, ppi0_c_r))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.out_pa_callback().set(FUNC(smsmfg_state::ppi0_a_w));
+ ppi0.out_pb_callback().set(FUNC(smsmfg_state::ppi0_b_w));
+ ppi0.in_pc_callback().set(FUNC(smsmfg_state::ppi0_c_r));
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("IN0");
+ ppi1.in_pb_callback().set_ioport("IN1");
+ ppi1.in_pc_callback().set_ioport("IN2");
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/softbox.cpp b/src/mame/drivers/softbox.cpp
index 1838468f8c0..dcb1c435812 100644
--- a/src/mame/drivers/softbox.cpp
+++ b/src/mame/drivers/softbox.cpp
@@ -378,16 +378,16 @@ MACHINE_CONFIG_START(softbox_state::softbox)
MCFG_RS232_CTS_HANDLER(WRITELINE(I8251_TAG, i8251_device, write_cts))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", terminal)
- MCFG_DEVICE_ADD(I8255_0_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, softbox_state, ppi0_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, softbox_state, ppi0_pb_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SW1"))
-
- MCFG_DEVICE_ADD(I8255_1_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, softbox_state, ppi1_pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, softbox_state, ppi1_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, softbox_state, ppi1_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, softbox_state, ppi1_pc_w))
+ i8255_device &ppi0(I8255A(config, I8255_0_TAG));
+ ppi0.in_pa_callback().set(FUNC(softbox_state::ppi0_pa_r));
+ ppi0.out_pb_callback().set(FUNC(softbox_state::ppi0_pb_w));
+ ppi0.in_pc_callback().set_ioport("SW1");
+
+ i8255_device &ppi1(I8255A(config, I8255_1_TAG));
+ ppi1.in_pa_callback().set(FUNC(softbox_state::ppi1_pa_r));
+ ppi1.out_pb_callback().set(FUNC(softbox_state::ppi1_pb_w));
+ ppi1.in_pc_callback().set(FUNC(softbox_state::ppi1_pc_r));
+ ppi1.out_pc_callback().set(FUNC(softbox_state::ppi1_pc_w));
com8116_device &dbrg(COM8116(config, COM8116_TAG, 5.0688_MHz_XTAL));
dbrg.fr_handler().set(I8251_TAG, FUNC(i8251_device::write_rxc));
diff --git a/src/mame/drivers/spc1500.cpp b/src/mame/drivers/spc1500.cpp
index 482e9116a04..59279757096 100644
--- a/src/mame/drivers/spc1500.cpp
+++ b/src/mame/drivers/spc1500.cpp
@@ -902,11 +902,11 @@ MACHINE_CONFIG_START(spc1500_state::spc1500)
MCFG_MC6845_RECONFIGURE_CB(spc1500_state, crtc_reconfig)
MCFG_VIDEO_START_OVERRIDE(spc1500_state, spc)
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, spc1500_state, portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spc1500_state, portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spc1500_state, portc_w))
+ I8255(config, m_pio);
+ m_pio->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_pio->in_pb_callback().set(FUNC(spc1500_state::portb_r));
+ m_pio->out_pb_callback().set(FUNC(spc1500_state::portb_w));
+ m_pio->out_pc_callback().set(FUNC(spc1500_state::portc_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("1hz", spc1500_state, timer, attotime::from_hz(1))
diff --git a/src/mame/drivers/special.cpp b/src/mame/drivers/special.cpp
index 43bd3537eb8..72bf69773bd 100644
--- a/src/mame/drivers/special.cpp
+++ b/src/mame/drivers/special.cpp
@@ -391,13 +391,13 @@ MACHINE_CONFIG_START(special_state::special)
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25);
/* Devices */
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, special_state, specialist_8255_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, special_state, specialist_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, special_state, specialist_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, special_state, specialist_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, special_state, specialist_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, special_state, specialist_8255_portc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(special_state::specialist_8255_porta_r));
+ m_ppi->out_pa_callback().set(FUNC(special_state::specialist_8255_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(special_state::specialist_8255_portb_r));
+ m_ppi->out_pb_callback().set(FUNC(special_state::specialist_8255_portb_w));
+ m_ppi->in_pc_callback().set(FUNC(special_state::specialist_8255_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(special_state::specialist_8255_portc_w));
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_FORMATS(rks_cassette_formats)
@@ -420,17 +420,16 @@ MACHINE_CONFIG_START(special_state::specialp)
MCFG_VIDEO_START_OVERRIDE(special_state,specialp)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(special_state::specialm)
+void special_state::specialm(machine_config &config)
+{
special(config);
- MCFG_DEVICE_REMOVE("ppi8255")
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, special_state, specialist_8255_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, special_state, specialist_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, special_state, specimx_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, special_state, specialist_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, special_state, specialist_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, special_state, specialist_8255_portc_w))
-MACHINE_CONFIG_END
+ m_ppi->in_pa_callback().set(FUNC(special_state::specialist_8255_porta_r));
+ m_ppi->out_pa_callback().set(FUNC(special_state::specialist_8255_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(special_state::specimx_8255_portb_r));
+ m_ppi->out_pb_callback().set(FUNC(special_state::specialist_8255_portb_w));
+ m_ppi->in_pc_callback().set(FUNC(special_state::specialist_8255_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(special_state::specialist_8255_portc_w));
+}
MACHINE_CONFIG_START(special_state::specimx)
special(config);
@@ -462,13 +461,12 @@ MACHINE_CONFIG_START(special_state::specimx)
MCFG_PIT8253_CLK2(2000000)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE("custom", specimx_sound_device, set_input_ch2))
- MCFG_DEVICE_REPLACE("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, special_state, specialist_8255_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, special_state, specialist_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, special_state, specimx_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, special_state, specialist_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, special_state, specialist_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, special_state, specialist_8255_portc_w))
+ m_ppi->in_pa_callback().set(FUNC(special_state::specialist_8255_porta_r));
+ m_ppi->out_pa_callback().set(FUNC(special_state::specialist_8255_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(special_state::specimx_8255_portb_r));
+ m_ppi->out_pb_callback().set(FUNC(special_state::specialist_8255_portb_w));
+ m_ppi->in_pc_callback().set(FUNC(special_state::specialist_8255_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(special_state::specialist_8255_portc_w));
MCFG_DEVICE_ADD("fd1793", FD1793, 8_MHz_XTAL / 8)
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, special_state, fdc_drq))
@@ -514,13 +512,13 @@ MACHINE_CONFIG_START(special_state::erik)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED)
MCFG_CASSETTE_INTERFACE("special_cass")
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, special_state, specialist_8255_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, special_state, specialist_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, special_state, specialist_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, special_state, specialist_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, special_state, specialist_8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, special_state, specialist_8255_portc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(special_state::specialist_8255_porta_r));
+ m_ppi->out_pa_callback().set(FUNC(special_state::specialist_8255_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(special_state::specialist_8255_portb_r));
+ m_ppi->out_pb_callback().set(FUNC(special_state::specialist_8255_portb_w));
+ m_ppi->in_pc_callback().set(FUNC(special_state::specialist_8255_portc_r));
+ m_ppi->out_pc_callback().set(FUNC(special_state::specialist_8255_portc_w));
MCFG_DEVICE_ADD("fd1793", FD1793, 8_MHz_XTAL / 8)
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, special_state, fdc_drq))
diff --git a/src/mame/drivers/spinb.cpp b/src/mame/drivers/spinb.cpp
index 116b0438acc..f86b60db8b9 100644
--- a/src/mame/drivers/spinb.cpp
+++ b/src/mame/drivers/spinb.cpp
@@ -683,49 +683,49 @@ MACHINE_CONFIG_START(spinb_state::spinb)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msmmvol", 1.0)
/* Devices */
- MCFG_DEVICE_ADD("ppi60", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, spinb_state, ppi60a_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, spinb_state, ppi60a_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, spinb_state, ppi60b_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spinb_state, ppi60b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, spinb_state, sw_r))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spinb_state, ppi60c_w))
-
- MCFG_DEVICE_ADD("ppi64", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, spinb_state, ppi64a_r))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, spinb_state, ppi64a_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, spinb_state, ppi64b_r))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spinb_state, ppi64b_w))
- //MCFG_I8255_IN_PORTC_CB(READ8(*this, spinb_state, ppi64c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spinb_state, ppi64c_w))
-
- MCFG_DEVICE_ADD("ppi68", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, spinb_state, ppi68a_r))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, spinb_state, ppi68a_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, spinb_state, ppi68b_r))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spinb_state, ppi68b_w))
- //MCFG_I8255_IN_PORTC_CB(READ8(*this, spinb_state, ppi68c_r))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spinb_state, ppi68c_w))
-
- MCFG_DEVICE_ADD("ppi6c", I8255A, 0 )
- //MCFG_I8255_IN_PORTA_CB(READ8(*this, spinb_state, ppi6ca_r))
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, spinb_state, ppi6ca_w))
- //MCFG_I8255_IN_PORTB_CB(READ8(*this, spinb_state, ppi6cb_r))
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spinb_state, ppi6cb_w))
- //MCFG_I8255_IN_PORTC_CB(READ8(*this, spinb_state, ppi6cc_r))
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spinb_state, ppi6cc_w))
-
- MCFG_DEVICE_ADD("ppia", I8255A, 0 )
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, spinb_state, ppia_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spinb_state, ppia_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, spinb_state, ppia_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spinb_state, ppia_c_w))
-
- MCFG_DEVICE_ADD("ppim", I8255A, 0 )
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, spinb_state, ppim_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spinb_state, ppim_b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, spinb_state, ppim_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spinb_state, ppim_c_w))
+ i8255_device &ppi60(I8255A(config, "ppi60"));
+ //ppi60.in_pa_callback().set(FUNC(spinb_state::ppi60a_r));
+ ppi60.out_pa_callback().set(FUNC(spinb_state::ppi60a_w));
+ //ppi60.in_pb_callback().set(FUNC(spinb_state::ppi60b_r));
+ ppi60.out_pb_callback().set(FUNC(spinb_state::ppi60b_w));
+ ppi60.in_pc_callback().set(FUNC(spinb_state::sw_r));
+ //ppi60.out_pc_callback().set(FUNC(spinb_state::ppi60c_w));
+
+ i8255_device &ppi64(I8255A(config, "ppi64"));
+ //ppi64.in_pa_callback().set(FUNC(spinb_state::ppi64a_r));
+ //ppi64.out_pa_callback().set(FUNC(spinb_state::ppi64a_w));
+ //ppi64.in_pb_callback().set(FUNC(spinb_state::ppi64b_r));
+ //ppi64.out_pb_callback().set(FUNC(spinb_state::ppi64b_w));
+ //ppi64.in_pc_callback().set(FUNC(spinb_state::ppi64c_r));
+ ppi64.out_pc_callback().set(FUNC(spinb_state::ppi64c_w));
+
+ I8255A(config, "ppi68");
+ //ppi68.in_pa_callback().set(FUNC(spinb_state::ppi68a_r));
+ //ppi68.out_pa_callback().set(FUNC(spinb_state::ppi68a_w));
+ //ppi68.in_pb_callback().set(FUNC(spinb_state::ppi68b_r));
+ //ppi68.out_pb_callback().set(FUNC(spinb_state::ppi68b_w));
+ //ppi68.in_pc_callback().set(FUNC(spinb_state::ppi68c_r));
+ //ppi68.out_pc_callback().set(FUNC(spinb_state::ppi68c_w));
+
+ I8255A(config, "ppi6c");
+ //ppi6c.in_pa_callback().set(FUNC(spinb_state::ppi6ca_r));
+ //ppi6c.out_pa_callback().set(FUNC(spinb_state::ppi6ca_w));
+ //ppi6c.in_pb_callback().set(FUNC(spinb_state::ppi6cb_r));
+ //ppi6c.out_pb_callback().set(FUNC(spinb_state::ppi6cb_w));
+ //ppi6c.in_pc_callback().set(FUNC(spinb_state::ppi6cc_r));
+ //ppi6c.out_pc_callback().set(FUNC(spinb_state::ppi6cc_w));
+
+ i8255_device &ppia(I8255A(config, "ppia"));
+ ppia.out_pa_callback().set(FUNC(spinb_state::ppia_a_w));
+ ppia.out_pb_callback().set(FUNC(spinb_state::ppia_b_w));
+ ppia.in_pc_callback().set(FUNC(spinb_state::ppia_c_r));
+ ppia.out_pc_callback().set(FUNC(spinb_state::ppia_c_w));
+
+ i8255_device &ppim(I8255A(config, "ppim"));
+ ppim.out_pa_callback().set(FUNC(spinb_state::ppim_a_w));
+ ppim.out_pb_callback().set(FUNC(spinb_state::ppim_b_w));
+ ppim.in_pc_callback().set(FUNC(spinb_state::ppim_c_r));
+ ppim.out_pc_callback().set(FUNC(spinb_state::ppim_c_w));
TTL7474(config, m_ic5a, 0);
m_ic5a->comp_output_cb().set(FUNC(spinb_state::ic5a_w));
diff --git a/src/mame/drivers/spoker.cpp b/src/mame/drivers/spoker.cpp
index 26bfe9d924d..e784936ab1c 100644
--- a/src/mame/drivers/spoker.cpp
+++ b/src/mame/drivers/spoker.cpp
@@ -617,15 +617,15 @@ MACHINE_CONFIG_START(spoker_state::spoker)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) // Control 0x8b --> A:out; B:input; C:input.
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, spoker_state, nmi_and_coins_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SERVICE"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("COINS"))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0) // Control 0x90 --> A:input; B:out; C:out.
- MCFG_I8255_IN_PORTA_CB(IOPORT("BUTTONS1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, spoker_state, video_and_leds_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spoker_state, leds_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0")); // Control 0x8b --> A:out; B:input; C:input.
+ ppi0.out_pa_callback().set(FUNC(spoker_state::nmi_and_coins_w));
+ ppi0.in_pb_callback().set_ioport("SERVICE");
+ ppi0.in_pc_callback().set_ioport("COINS");
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1")); // Control 0x90 --> A:input; B:out; C:out.
+ ppi1.in_pa_callback().set_ioport("BUTTONS1");
+ ppi1.out_pb_callback().set(FUNC(spoker_state::video_and_leds_w));
+ ppi1.out_pc_callback().set(FUNC(spoker_state::leds_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/statriv2.cpp b/src/mame/drivers/statriv2.cpp
index 363af7989f8..ce1a3e5d27b 100644
--- a/src/mame/drivers/statriv2.cpp
+++ b/src/mame/drivers/statriv2.cpp
@@ -615,14 +615,14 @@ MACHINE_CONFIG_START(statriv2_state::statriv2)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
+ i8255_device &ppi(I8255A(config, "ppi8255"));
/* PPI 8255 group A & B set to Mode 0.
Port A, B and lower 4 bits of C set as Input.
High 4 bits of C set as Output */
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, statriv2_state, ppi_portc_hi_w))
+ ppi.in_pa_callback().set_ioport("IN0");
+ ppi.in_pb_callback().set_ioport("IN1");
+ ppi.in_pc_callback().set_ioport("IN2");
+ ppi.out_pc_callback().set(FUNC(statriv2_state::ppi_portc_hi_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/subsino.cpp b/src/mame/drivers/subsino.cpp
index 71ab1b821c1..939825a3559 100644
--- a/src/mame/drivers/subsino.cpp
+++ b/src/mame/drivers/subsino.cpp
@@ -2710,12 +2710,12 @@ MACHINE_CONFIG_START(subsino_state::victor21)
MCFG_DEVICE_PROGRAM_MAP(victor21_map)
MCFG_DEVICE_IO_MAP(subsino_iomap)
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, subsino_state, out_a_w))
- MCFG_I8255_TRISTATE_PORTA_CB(CONSTANT(0))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, subsino_state, out_b_w))
- MCFG_I8255_TRISTATE_PORTB_CB(CONSTANT(0))
- MCFG_I8255_IN_PORTC_CB(IOPORT("INC"))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(subsino_state::out_a_w));
+ ppi.tri_pa_callback().set_constant(0);
+ ppi.out_pb_callback().set(FUNC(subsino_state::out_b_w));
+ ppi.tri_pb_callback().set_constant(0);
+ ppi.in_pc_callback().set_ioport("INC");
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
@@ -2793,15 +2793,15 @@ MACHINE_CONFIG_START(subsino_state::srider)
MCFG_DEVICE_PROGRAM_MAP(srider_map)
MCFG_DEVICE_IO_MAP(subsino_iomap)
- MCFG_DEVICE_ADD("ppi1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("SW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SW3"))
+ i8255_device &ppi1(I8255A(config, "ppi1"));
+ ppi1.in_pa_callback().set_ioport("SW1");
+ ppi1.in_pb_callback().set_ioport("SW2");
+ ppi1.in_pc_callback().set_ioport("SW3");
- MCFG_DEVICE_ADD("ppi2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("SW4"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("INA"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("INB"))
+ i8255_device &ppi2(I8255A(config, "ppi2"));
+ ppi2.in_pa_callback().set_ioport("SW4");
+ ppi2.in_pb_callback().set_ioport("INA");
+ ppi2.in_pc_callback().set_ioport("INB");
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
@@ -2846,15 +2846,15 @@ MACHINE_CONFIG_START(subsino_state::tisub)
MCFG_DEVICE_PROGRAM_MAP(tisub_map)
MCFG_DEVICE_IO_MAP(subsino_iomap)
- MCFG_DEVICE_ADD("ppi1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("SW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SW3"))
+ i8255_device &ppi1(I8255A(config, "ppi1"));
+ ppi1.in_pa_callback().set_ioport("SW1");
+ ppi1.in_pb_callback().set_ioport("SW2");
+ ppi1.in_pc_callback().set_ioport("SW3");
- MCFG_DEVICE_ADD("ppi2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("SW4"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("INA"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("INB"))
+ i8255_device &ppi2(I8255A(config, "ppi2"));
+ ppi2.in_pa_callback().set_ioport("SW4");
+ ppi2.in_pb_callback().set_ioport("INA");
+ ppi2.in_pc_callback().set_ioport("INB");
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
@@ -2887,15 +2887,15 @@ MACHINE_CONFIG_START(subsino_state::stbsub)
MCFG_DEVICE_PROGRAM_MAP(stbsub_map)
MCFG_DEVICE_IO_MAP(subsino_iomap)
- MCFG_DEVICE_ADD("ppi1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("SW1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("SW2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SW3"))
+ i8255_device &ppi1(I8255A(config, "ppi1"));
+ ppi1.in_pa_callback().set_ioport("SW1");
+ ppi1.in_pb_callback().set_ioport("SW2");
+ ppi1.in_pc_callback().set_ioport("SW3");
- MCFG_DEVICE_ADD("ppi2", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("SW4"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("INB"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("INA"))
+ i8255_device &ppi2(I8255A(config, "ppi2"));
+ ppi2.in_pa_callback().set_ioport("SW4");
+ ppi2.in_pb_callback().set_ioport("INB");
+ ppi2.in_pc_callback().set_ioport("INA");
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
diff --git a/src/mame/drivers/suprgolf.cpp b/src/mame/drivers/suprgolf.cpp
index efa4f7923d5..9247e579d14 100644
--- a/src/mame/drivers/suprgolf.cpp
+++ b/src/mame/drivers/suprgolf.cpp
@@ -504,17 +504,17 @@ MACHINE_CONFIG_START(suprgolf_state::suprgolf)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", suprgolf_state, irq0_line_hold)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, suprgolf_state, p1_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, suprgolf_state, p2_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, suprgolf_state, pedal_extra_bits_r))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("SYSTEM"))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, suprgolf_state, rom_bank_select_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, suprgolf_state, rom_bank_select_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, suprgolf_state, vregs_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, suprgolf_state, vregs_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set(FUNC(suprgolf_state::p1_r));
+ ppi0.in_pb_callback().set(FUNC(suprgolf_state::p2_r));
+ ppi0.in_pc_callback().set(FUNC(suprgolf_state::pedal_extra_bits_r));
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.in_pa_callback().set_ioport("SYSTEM");
+ ppi1.in_pb_callback().set(FUNC(suprgolf_state::rom_bank_select_r));
+ ppi1.out_pb_callback().set(FUNC(suprgolf_state::rom_bank_select_w));
+ ppi1.in_pc_callback().set(FUNC(suprgolf_state::vregs_r));
+ ppi1.out_pc_callback().set(FUNC(suprgolf_state::vregs_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/sv8000.cpp b/src/mame/drivers/sv8000.cpp
index 9560fa76d32..79d72e1671c 100644
--- a/src/mame/drivers/sv8000.cpp
+++ b/src/mame/drivers/sv8000.cpp
@@ -381,13 +381,13 @@ MACHINE_CONFIG_START(sv8000_state::sv8000)
MCFG_DEVICE_IO_MAP(sv8000_io)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", sv8000_state, irq0_line_hold)
- MCFG_DEVICE_ADD("i8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, sv8000_state, i8255_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, sv8000_state, i8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, sv8000_state, i8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, sv8000_state, i8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, sv8000_state, i8255_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sv8000_state, i8255_portc_w))
+ i8255_device &ppi(I8255(config, "i8255"));
+ ppi.in_pa_callback().set(FUNC(sv8000_state::i8255_porta_r));
+ ppi.out_pa_callback().set(FUNC(sv8000_state::i8255_porta_w));
+ ppi.in_pb_callback().set(FUNC(sv8000_state::i8255_portb_r));
+ ppi.out_pb_callback().set(FUNC(sv8000_state::i8255_portb_w));
+ ppi.in_pc_callback().set(FUNC(sv8000_state::i8255_portc_r));
+ ppi.out_pc_callback().set(FUNC(sv8000_state::i8255_portc_w));
/* video hardware */
// S68047P - Unknown whether the internal or an external character rom is used
diff --git a/src/mame/drivers/svi318.cpp b/src/mame/drivers/svi318.cpp
index 846ea103c7b..65461ffdf1f 100644
--- a/src/mame/drivers/svi318.cpp
+++ b/src/mame/drivers/svi318.cpp
@@ -540,10 +540,10 @@ MACHINE_CONFIG_START(svi3x8_state::svi318)
ADDRESS_MAP_BANK(config, "io").set_map(&svi3x8_state::svi3x8_io_bank).set_data_width(8).set_addr_width(9).set_stride(0x100);
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, svi3x8_state, ppi_port_a_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, svi3x8_state, ppi_port_b_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, svi3x8_state, ppi_port_c_w))
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.in_pa_callback().set(FUNC(svi3x8_state::ppi_port_a_r));
+ ppi.in_pb_callback().set(FUNC(svi3x8_state::ppi_port_b_r));
+ ppi.out_pc_callback().set(FUNC(svi3x8_state::ppi_port_c_w));
// sound hardware
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp
index a5598c7a9ef..51975be2023 100644
--- a/src/mame/drivers/system1.cpp
+++ b/src/mame/drivers/system1.cpp
@@ -2166,10 +2166,10 @@ MACHINE_CONFIG_START(system1_state::sys1ppi)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, system1_state, soundport_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, system1_state, videomode_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, system1_state, sound_control_w))
+ I8255A(config, m_ppi8255);
+ m_ppi8255->out_pa_callback().set(FUNC(system1_state::soundport_w));
+ m_ppi8255->out_pb_callback().set(FUNC(system1_state::videomode_w));
+ m_ppi8255->out_pc_callback().set(FUNC(system1_state::sound_control_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/tandy2k.cpp b/src/mame/drivers/tandy2k.cpp
index bd793478727..8f3a0a9d414 100644
--- a/src/mame/drivers/tandy2k.cpp
+++ b/src/mame/drivers/tandy2k.cpp
@@ -819,10 +819,10 @@ MACHINE_CONFIG_START(tandy2k_state::tandy2k)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, tandy2k_state, ppi_pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tandy2k_state, ppi_pc_w))
+ I8255A(config, m_i8255a);
+ m_i8255a->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_i8255a->in_pb_callback().set(FUNC(tandy2k_state::ppi_pb_r));
+ m_i8255a->out_pc_callback().set(FUNC(tandy2k_state::ppi_pc_w));
I8251(config, m_uart, 0);
m_uart->txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp
index f4713f0cf55..c9b41829a1f 100644
--- a/src/mame/drivers/tatsumi.cpp
+++ b/src/mame/drivers/tatsumi.cpp
@@ -895,7 +895,7 @@ MACHINE_CONFIG_START(apache3_state::apache3)
adc.in_callback<6>().set_constant(0); // RPSNC
adc.in_callback<7>().set_constant(0); // LPSNC
- MCFG_DEVICE_ADD("ppi", I8255, 0)
+ I8255(config, "ppi");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -945,10 +945,10 @@ MACHINE_CONFIG_START(roundup5_state::roundup5)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, roundup5_state, output_w))
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.in_pa_callback().set_ioport("IN0");
+ ppi.in_pb_callback().set_ioport("IN1");
+ ppi.out_pc_callback().set(FUNC(roundup5_state::output_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/taxidriv.cpp b/src/mame/drivers/taxidriv.cpp
index ca42ade7369..745e6afebd0 100644
--- a/src/mame/drivers/taxidriv.cpp
+++ b/src/mame/drivers/taxidriv.cpp
@@ -353,32 +353,32 @@ MACHINE_CONFIG_START(taxidriv_state::taxidriv)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, taxidriv_state, p0a_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, taxidriv_state, p0b_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, taxidriv_state, p0c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, taxidriv_state, p0c_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, taxidriv_state, p1a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, taxidriv_state, p1b_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, taxidriv_state, p1c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, taxidriv_state, p1c_w))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, taxidriv_state, p2a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, taxidriv_state, p2b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, taxidriv_state, p2c_w))
-
- MCFG_DEVICE_ADD("ppi8255_3", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, taxidriv_state, p3a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, taxidriv_state, p3b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, taxidriv_state, p3c_w))
-
- MCFG_DEVICE_ADD("ppi8255_4", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, taxidriv_state, p4a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, taxidriv_state, p4b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, taxidriv_state, p4c_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set(FUNC(taxidriv_state::p0a_r));
+ ppi0.out_pb_callback().set(FUNC(taxidriv_state::p0b_w));
+ ppi0.in_pc_callback().set(FUNC(taxidriv_state::p0c_r));
+ ppi0.out_pc_callback().set(FUNC(taxidriv_state::p0c_w));
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(taxidriv_state::p1a_w));
+ ppi1.in_pb_callback().set(FUNC(taxidriv_state::p1b_r));
+ ppi1.in_pc_callback().set(FUNC(taxidriv_state::p1c_r));
+ ppi1.out_pc_callback().set(FUNC(taxidriv_state::p1c_w));
+
+ i8255_device &ppi2(I8255A(config, "ppi8255_2"));
+ ppi2.out_pa_callback().set(FUNC(taxidriv_state::p2a_w));
+ ppi2.out_pb_callback().set(FUNC(taxidriv_state::p2b_w));
+ ppi2.out_pc_callback().set(FUNC(taxidriv_state::p2c_w));
+
+ i8255_device &ppi3(I8255A(config, "ppi8255_3"));
+ ppi3.out_pa_callback().set(FUNC(taxidriv_state::p3a_w));
+ ppi3.out_pb_callback().set(FUNC(taxidriv_state::p3b_w));
+ ppi3.out_pc_callback().set(FUNC(taxidriv_state::p3c_w));
+
+ i8255_device &ppi4(I8255A(config, "ppi8255_4"));
+ ppi4.out_pa_callback().set(FUNC(taxidriv_state::p4a_w));
+ ppi4.out_pb_callback().set(FUNC(taxidriv_state::p4b_w));
+ ppi4.out_pc_callback().set(FUNC(taxidriv_state::p4c_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/thief.cpp b/src/mame/drivers/thief.cpp
index 4b27c7b583e..c6a6970ffb1 100644
--- a/src/mame/drivers/thief.cpp
+++ b/src/mame/drivers/thief.cpp
@@ -399,10 +399,10 @@ MACHINE_CONFIG_START(thief_state::thief)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(thief_state, iack)
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, thief_state, thief_input_select_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, thief_state, thief_io_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, thief_state, tape_control_w))
+ i8255_device &ppi(I8255A(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(thief_state::thief_input_select_w));
+ ppi.in_pb_callback().set(FUNC(thief_state::thief_io_r));
+ ppi.out_pc_callback().set(FUNC(thief_state::tape_control_w));
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/tiamc1.cpp b/src/mame/drivers/tiamc1.cpp
index 1340c8ee84b..20dcb203f5e 100644
--- a/src/mame/drivers/tiamc1.cpp
+++ b/src/mame/drivers/tiamc1.cpp
@@ -333,11 +333,11 @@ MACHINE_CONFIG_START(tiamc1_state::tiamc1)
MCFG_DEVICE_PROGRAM_MAP(tiamc1_map)
MCFG_DEVICE_IO_MAP(tiamc1_io_map)
- MCFG_DEVICE_ADD("kr580vv55a", I8255A, 0) /* soviet clone of i8255 */
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tiamc1_state, tiamc1_control_w))
+ i8255_device &ppi(I8255A(config, "kr580vv55a")); /* soviet clone of i8255 */
+ ppi.in_pa_callback().set_ioport("IN0");
+ ppi.in_pb_callback().set_ioport("IN1");
+ ppi.in_pc_callback().set_ioport("IN2");
+ ppi.out_pc_callback().set(FUNC(tiamc1_state::tiamc1_control_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/timetrv.cpp b/src/mame/drivers/timetrv.cpp
index 34f5efea15b..fcba7d7649e 100644
--- a/src/mame/drivers/timetrv.cpp
+++ b/src/mame/drivers/timetrv.cpp
@@ -151,14 +151,14 @@ MACHINE_CONFIG_START(timetrv_state::timetrv)
EEPROM_2816(config, "eeprom");
- MCFG_DEVICE_ADD("ppi1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, timetrv_state, test1_r)) //inputs
- MCFG_I8255_IN_PORTB_CB(READ8(*this, timetrv_state, test2_r)) //eeprom read bit + inputs
-
- MCFG_DEVICE_ADD("ppi2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, timetrv_state, in_r)) //dsw
- MCFG_I8255_IN_PORTB_CB(READ8(*this, timetrv_state, in_r)) //dsw
- MCFG_I8255_IN_PORTC_CB(READ8(*this, timetrv_state, in_r)) //dsw
+ i8255_device &ppi1(I8255(config, "ppi1"));
+ ppi1.in_pa_callback().set(FUNC(timetrv_state::test1_r)); //inputs
+ ppi1.in_pb_callback().set(FUNC(timetrv_state::test2_r)); //eeprom read bit + inputs
+
+ i8255_device &ppi2(I8255(config, "ppi2"));
+ ppi2.in_pa_callback().set(FUNC(timetrv_state::in_r)); //dsw
+ ppi2.in_pb_callback().set(FUNC(timetrv_state::in_r)); //dsw
+ ppi2.in_pc_callback().set(FUNC(timetrv_state::in_r)); //dsw
MCFG_DEVICE_ADD("uart", NS16450, 1843200) // P82050 (serial interface for laserdisc)
diff --git a/src/mame/drivers/tk80.cpp b/src/mame/drivers/tk80.cpp
index 09f46b3690b..a0cf2808b16 100644
--- a/src/mame/drivers/tk80.cpp
+++ b/src/mame/drivers/tk80.cpp
@@ -60,9 +60,11 @@ public:
tk80_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_ppi(*this, "ppi8255")
, m_digit(*this, "digit%u", 0U)
{ }
+ void add_tk80_ppi(machine_config &config);
void ics8080(machine_config &config);
void tk80(machine_config &config);
void mikrolab(machine_config &config);
@@ -94,6 +96,7 @@ private:
uint8_t m_ppi_portc;
required_device<cpu_device> m_maincpu;
+ required_device<i8255_device> m_ppi;
output_finder<8> m_digit;
};
@@ -152,21 +155,21 @@ void tk80_state::tk80_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0x03);
- map(0x00, 0x03).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x00, 0x03).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write));
}
void tk80_state::mikrolab_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0x03);
- map(0x00, 0x03).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x00, 0x03).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write));
}
void tk80_state::nd80z_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0x03);
- map(0x00, 0x03).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x00, 0x03).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write));
}
/* Input ports */
@@ -283,63 +286,72 @@ WRITE8_MEMBER( tk80_state::mikrolab_serial_w )
m_ppi_portc = data;
}
-MACHINE_CONFIG_START(tk80_state::tk80)
+void tk80_state::add_tk80_ppi(machine_config &config)
+{
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(tk80_state::key_matrix_r));
+ m_ppi->in_pb_callback().set(FUNC(tk80_state::serial_r));
+ m_ppi->out_pc_callback().set(FUNC(tk80_state::serial_w));
+}
+
+void tk80_state::tk80(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8080A, XTAL(18'432'000) / 9)
- MCFG_DEVICE_PROGRAM_MAP(tk80_mem)
- MCFG_DEVICE_IO_MAP(tk80_io)
+ I8080A(config, m_maincpu, XTAL(18'432'000) / 9);
+ m_maincpu->set_addrmap(AS_PROGRAM, &tk80_state::tk80_mem);
+ m_maincpu->set_addrmap(AS_IO, &tk80_state::tk80_io);
/* video hardware */
config.set_default_layout(layout_tk80);
/* Devices */
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, tk80_state, key_matrix_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, tk80_state, serial_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tk80_state, serial_w))
-MACHINE_CONFIG_END
+ add_tk80_ppi(config);
+}
-MACHINE_CONFIG_START(tk80_state::mikrolab)
+void tk80_state::mikrolab(machine_config &config)
+{
tk80(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(tk85_mem)
- MCFG_DEVICE_IO_MAP(mikrolab_io)
+ m_maincpu->set_addrmap(AS_PROGRAM, &tk80_state::tk85_mem);
+ m_maincpu->set_addrmap(AS_IO, &tk80_state::mikrolab_io);
/* Devices */
- MCFG_DEVICE_REMOVE("ppi8255")
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, tk80_state, key_matrix_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, tk80_state, serial_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tk80_state, mikrolab_serial_w))
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(tk80_state::nd80z)
- MCFG_DEVICE_ADD("maincpu", Z80, 1e6 ) // Sharp LH0080A, can't see writing on xtal
- MCFG_DEVICE_PROGRAM_MAP(tk85_mem)
- MCFG_DEVICE_IO_MAP(nd80z_io)
+ m_ppi->out_pc_callback().set(FUNC(tk80_state::mikrolab_serial_w));
+}
+
+void tk80_state::nd80z(machine_config &config)
+{
+ Z80(config, m_maincpu, 1e6); // Sharp LH0080A, can't see writing on xtal
+ m_maincpu->set_addrmap(AS_PROGRAM, &tk80_state::tk85_mem);
+ m_maincpu->set_addrmap(AS_IO, &tk80_state::nd80z_io);
/* video hardware */
config.set_default_layout(layout_tk80);
/* Devices */
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, tk80_state, nd80z_key_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, tk80_state, serial_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tk80_state, mikrolab_serial_w))
-MACHINE_CONFIG_END
+ I8255(config, m_ppi, 0);
+ m_ppi->in_pa_callback().set(FUNC(tk80_state::nd80z_key_r));
+ m_ppi->in_pb_callback().set(FUNC(tk80_state::serial_r));
+ m_ppi->out_pc_callback().set(FUNC(tk80_state::mikrolab_serial_w));
+}
-MACHINE_CONFIG_START(tk80_state::tk85)
- tk80(config);
- MCFG_DEVICE_REPLACE("maincpu", I8085A, XTAL(4'915'200))
- MCFG_DEVICE_PROGRAM_MAP(tk85_mem)
- MCFG_DEVICE_IO_MAP(tk80_io)
-MACHINE_CONFIG_END
+void tk80_state::tk85(machine_config &config)
+{
+ I8085A(config, m_maincpu, XTAL(4'915'200));
+ m_maincpu->set_addrmap(AS_PROGRAM, &tk80_state::tk85_mem);
+ m_maincpu->set_addrmap(AS_IO, &tk80_state::tk80_io);
+
+ /* video hardware */
+ config.set_default_layout(layout_tk80);
-MACHINE_CONFIG_START(tk80_state::ics8080)
+ /* Devices */
+ add_tk80_ppi(config);
+}
+
+void tk80_state::ics8080(machine_config &config)
+{
tk80(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(ics8080_mem)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &tk80_state::ics8080_mem);
+}
/* ROM definition */
diff --git a/src/mame/drivers/tk80bs.cpp b/src/mame/drivers/tk80bs.cpp
index 144a7f6c077..578027f3be9 100644
--- a/src/mame/drivers/tk80bs.cpp
+++ b/src/mame/drivers/tk80bs.cpp
@@ -190,9 +190,9 @@ MACHINE_CONFIG_START(tk80bs_state::tk80bs)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tk80bs)
/* Devices */
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, tk80bs_state, port_a_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, tk80bs_state, port_b_r))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(tk80bs_state::port_a_r));
+ m_ppi->in_pb_callback().set(FUNC(tk80bs_state::port_b_r));
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(PUT(tk80bs_state, kbd_put))
diff --git a/src/mame/drivers/trs80.cpp b/src/mame/drivers/trs80.cpp
index f72091d3b04..4b85d5f5c1e 100644
--- a/src/mame/drivers/trs80.cpp
+++ b/src/mame/drivers/trs80.cpp
@@ -636,11 +636,11 @@ MACHINE_CONFIG_START(trs80_state::radionic)
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_radionic)
// Interface to external circuits
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- //MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, pulsar_state, ppi_pa_w)) // Data for external plugin printer module
- //MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, pulsar_state, ppi_pb_w)) // Control data to external
- //MCFG_I8255_IN_PORTC_CB(READ8(*this, pulsar_state, ppi_pc_r)) // Sensing from external and printer status
- //MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, pulsar_state, ppi_pc_w)) // Printer strobe
+ I8255(config, m_ppi);
+ //m_ppi->in_pc_callback().set(FUNC(pulsar_state::ppi_pc_r)); // Sensing from external and printer status
+ //m_ppi->out_pa_callback().set(FUNC(pulsar_state::ppi_pa_w)); // Data for external plugin printer module
+ //m_ppi->out_pb_callback().set(FUNC(pulsar_state::ppi_pb_w)); // Control data to external
+ //m_ppi->out_pc_callback().set(FUNC(pulsar_state::ppi_pc_w)); // Printer strobe
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/turbo.cpp b/src/mame/drivers/turbo.cpp
index d9e85ff30b1..2b7c5c6e023 100644
--- a/src/mame/drivers/turbo.cpp
+++ b/src/mame/drivers/turbo.cpp
@@ -850,25 +850,25 @@ MACHINE_CONFIG_START(turbo_state::turbo)
MCFG_DEVICE_PROGRAM_MAP(turbo_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", turbo_state, irq0_line_hold)
- MCFG_DEVICE_ADD("i8255_0", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, turbo_state, turbo_ppi0a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, turbo_state, turbo_ppi0b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, turbo_ppi0c_w))
-
- MCFG_DEVICE_ADD("i8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, turbo_state, turbo_ppi1a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, turbo_state, turbo_ppi1b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, turbo_ppi1c_w))
-
- MCFG_DEVICE_ADD("i8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, turbo_state, turbo_sound_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, turbo_state, turbo_sound_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, turbo_sound_c_w))
-
- MCFG_DEVICE_ADD("i8255_3", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, turbo_state, turbo_analog_r))
- MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, turbo_ppi3c_w))
+ I8255(config, m_i8255_0);
+ m_i8255_0->out_pa_callback().set(FUNC(turbo_state::turbo_ppi0a_w));
+ m_i8255_0->out_pb_callback().set(FUNC(turbo_state::turbo_ppi0b_w));
+ m_i8255_0->out_pc_callback().set(FUNC(turbo_state::turbo_ppi0c_w));
+
+ I8255(config, m_i8255_1);
+ m_i8255_1->out_pa_callback().set(FUNC(turbo_state::turbo_ppi1a_w));
+ m_i8255_1->out_pb_callback().set(FUNC(turbo_state::turbo_ppi1b_w));
+ m_i8255_1->out_pc_callback().set(FUNC(turbo_state::turbo_ppi1c_w));
+
+ I8255(config, m_i8255_2);
+ m_i8255_2->out_pa_callback().set(FUNC(turbo_state::turbo_sound_a_w));
+ m_i8255_2->out_pb_callback().set(FUNC(turbo_state::turbo_sound_b_w));
+ m_i8255_2->out_pc_callback().set(FUNC(turbo_state::turbo_sound_c_w));
+
+ I8255(config, m_i8255_3);
+ m_i8255_3->in_pa_callback().set(FUNC(turbo_state::turbo_analog_r));
+ m_i8255_3->in_pb_callback().set_ioport("DSW2");
+ m_i8255_3->out_pc_callback().set(FUNC(turbo_state::turbo_ppi3c_w));
MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4) // unknown clock
MCFG_I8279_OUT_SL_CB(WRITE8(*this, turbo_state, scanlines_w)) // scan SL lines
@@ -905,15 +905,15 @@ MACHINE_CONFIG_START(turbo_state::subroc3d)
MCFG_DEVICE_PROGRAM_MAP(subroc3d_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", turbo_state, irq0_line_hold)
- MCFG_DEVICE_ADD("i8255_0", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, turbo_state, subroc3d_ppi0a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, turbo_state, subroc3d_ppi0b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, subroc3d_ppi0c_w))
+ I8255(config, m_i8255_0);
+ m_i8255_0->out_pa_callback().set(FUNC(turbo_state::subroc3d_ppi0a_w));
+ m_i8255_0->out_pb_callback().set(FUNC(turbo_state::subroc3d_ppi0b_w));
+ m_i8255_0->out_pc_callback().set(FUNC(turbo_state::subroc3d_ppi0c_w));
- MCFG_DEVICE_ADD("i8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, turbo_state, subroc3d_sound_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, turbo_state, subroc3d_sound_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, subroc3d_sound_c_w))
+ I8255(config, m_i8255_1);
+ m_i8255_1->out_pa_callback().set(FUNC(turbo_state::subroc3d_sound_a_w));
+ m_i8255_1->out_pb_callback().set(FUNC(turbo_state::subroc3d_sound_b_w));
+ m_i8255_1->out_pc_callback().set(FUNC(turbo_state::subroc3d_sound_c_w));
MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4) // unknown clock
MCFG_I8279_OUT_SL_CB(WRITE8(*this, turbo_state, scanlines_w)) // scan SL lines
@@ -953,15 +953,15 @@ MACHINE_CONFIG_START(turbo_state::buckrog)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
MCFG_MACHINE_RESET_OVERRIDE(turbo_state,buckrog)
- MCFG_DEVICE_ADD("i8255_0", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, turbo_state, buckrog_ppi0a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, turbo_state, buckrog_ppi0b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, buckrog_ppi0c_w))
+ I8255(config, m_i8255_0);
+ m_i8255_0->out_pa_callback().set(FUNC(turbo_state::buckrog_ppi0a_w));
+ m_i8255_0->out_pb_callback().set(FUNC(turbo_state::buckrog_ppi0b_w));
+ m_i8255_0->out_pc_callback().set(FUNC(turbo_state::buckrog_ppi0c_w));
- MCFG_DEVICE_ADD("i8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, turbo_state, buckrog_sound_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, turbo_state, buckrog_sound_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, turbo_state, buckrog_ppi1c_w))
+ I8255(config, m_i8255_1);
+ m_i8255_1->out_pa_callback().set(FUNC(turbo_state::buckrog_sound_a_w));
+ m_i8255_1->out_pb_callback().set(FUNC(turbo_state::buckrog_sound_b_w));
+ m_i8255_1->out_pc_callback().set(FUNC(turbo_state::buckrog_ppi1c_w));
MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4) // unknown clock
MCFG_I8279_OUT_SL_CB(WRITE8(*this, turbo_state, scanlines_w)) // scan SL lines
diff --git a/src/mame/drivers/tvgame.cpp b/src/mame/drivers/tvgame.cpp
index bbd63648f58..4998d1a3110 100644
--- a/src/mame/drivers/tvgame.cpp
+++ b/src/mame/drivers/tvgame.cpp
@@ -123,9 +123,9 @@ MACHINE_CONFIG_START(tvgame_state::tvgame)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
// Devices
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("LINE0"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tvgame_state, speaker_w))
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.in_pa_callback().set_ioport("LINE0");
+ ppi.out_pc_callback().set(FUNC(tvgame_state::speaker_w));
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/unior.cpp b/src/mame/drivers/unior.cpp
index 51eae5a0cae..5538abc6d0b 100644
--- a/src/mame/drivers/unior.cpp
+++ b/src/mame/drivers/unior.cpp
@@ -409,19 +409,19 @@ MACHINE_CONFIG_START(unior_state::unior)
m_pit->set_clk<2>(16_MHz_XTAL / 9 / 64); // unknown frequency
m_pit->out_handler<2>().set("speaker", FUNC(speaker_sound_device::level_w));
- MCFG_DEVICE_ADD("ppi0", I8255, 0)
+ i8255_device &ppi0(I8255(config, "ppi0"));
// ports a & c connect to an external slot
- MCFG_I8255_IN_PORTB_CB(READ8(*this, unior_state, ppi0_b_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, unior_state, ppi0_b_w))
+ ppi0.in_pb_callback().set(FUNC(unior_state::ppi0_b_r));
+ ppi0.out_pb_callback().set(FUNC(unior_state::ppi0_b_w));
- MCFG_DEVICE_ADD("ppi1", I8255, 0)
+ i8255_device &ppi1(I8255(config, "ppi1"));
// ports a & b are for the keyboard
// port c operates various control lines for mostly unknown purposes
- MCFG_I8255_IN_PORTA_CB(READ8(*this, unior_state, ppi1_a_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, unior_state, ppi1_a_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, unior_state, ppi1_b_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, unior_state, ppi1_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, unior_state, ppi1_c_w))
+ ppi1.in_pa_callback().set(FUNC(unior_state::ppi1_a_r));
+ ppi1.in_pb_callback().set(FUNC(unior_state::ppi1_b_r));
+ ppi1.in_pc_callback().set(FUNC(unior_state::ppi1_c_r));
+ ppi1.out_pa_callback().set(FUNC(unior_state::ppi1_a_w));
+ ppi1.out_pc_callback().set(FUNC(unior_state::ppi1_c_w));
MCFG_DEVICE_ADD("dma", I8257, XTAL(20'000'000) / 9)
MCFG_I8257_OUT_HRQ_CB(WRITELINE(*this, unior_state, hrq_w))
diff --git a/src/mame/drivers/upscope.cpp b/src/mame/drivers/upscope.cpp
index 64f4458473f..fb2410a2b12 100644
--- a/src/mame/drivers/upscope.cpp
+++ b/src/mame/drivers/upscope.cpp
@@ -315,10 +315,10 @@ MACHINE_CONFIG_START(upscope_state::upscope)
m_fdc->dsksyn_callback().set(FUNC(amiga_state::fdc_dsksyn_w));
// i/o extension
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IO0"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, upscope_state, lamps_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, upscope_state, coin_counter_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set_ioport("IO0");
+ m_ppi->out_pb_callback().set(FUNC(upscope_state::lamps_w));
+ m_ppi->out_pc_callback().set(FUNC(upscope_state::coin_counter_w));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ut88.cpp b/src/mame/drivers/ut88.cpp
index 1fb8b37876b..2b0aa80695a 100644
--- a/src/mame/drivers/ut88.cpp
+++ b/src/mame/drivers/ut88.cpp
@@ -216,10 +216,10 @@ MACHINE_CONFIG_START(ut88_state::ut88)
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25);
/* Devices */
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, ut88_state, ut88_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, ut88_state, ut88_8255_portb_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, ut88_state, ut88_8255_portc_r))
+ I8255A(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(ut88_state::ut88_8255_porta_w));
+ m_ppi->in_pb_callback().set(FUNC(ut88_state::ut88_8255_portb_r));
+ m_ppi->in_pc_callback().set(FUNC(ut88_state::ut88_8255_portc_r));
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_FORMATS(rku_cassette_formats)
diff --git a/src/mame/drivers/v1050.cpp b/src/mame/drivers/v1050.cpp
index 1bc28621983..b1a92e0ad87 100644
--- a/src/mame/drivers/v1050.cpp
+++ b/src/mame/drivers/v1050.cpp
@@ -1054,26 +1054,26 @@ MACHINE_CONFIG_START(v1050_state::v1050)
MCFG_MSM58321_D3_HANDLER(WRITELINE(*this, v1050_state, rtc_ppi_pa_3_w))
MCFG_MSM58321_BUSY_HANDLER(WRITELINE(*this, v1050_state, rtc_ppi_pc_3_w))
- MCFG_DEVICE_ADD(I8255A_DISP_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(I8255A_M6502_TAG, i8255_device, pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, v1050_state, disp_ppi_pc_w))
-
- MCFG_DEVICE_ADD(I8255A_MISC_TAG, I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, v1050_state, misc_ppi_pa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, v1050_state,misc_ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, v1050_state,misc_ppi_pc_w))
-
- MCFG_DEVICE_ADD(I8255A_RTC_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, v1050_state, rtc_ppi_pa_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, v1050_state, rtc_ppi_pa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, v1050_state, rtc_ppi_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, v1050_state, rtc_ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, v1050_state, rtc_ppi_pc_w))
-
- MCFG_DEVICE_ADD(I8255A_M6502_TAG, I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(I8255A_DISP_TAG, i8255_device, pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, v1050_state, m6502_ppi_pc_w))
+ I8255A(config, m_ppi_disp);
+ m_ppi_disp->in_pa_callback().set(I8255A_M6502_TAG, FUNC(i8255_device::pb_r));
+ m_ppi_disp->out_pc_callback().set(FUNC(v1050_state::disp_ppi_pc_w));
+
+ i8255_device &ppi_misc(I8255A(config, I8255A_MISC_TAG));
+ ppi_misc.in_pc_callback().set(FUNC(v1050_state::misc_ppi_pc_r));
+ ppi_misc.out_pa_callback().set(FUNC(v1050_state::misc_ppi_pa_w));
+ ppi_misc.out_pb_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ ppi_misc.out_pc_callback().set(FUNC(v1050_state::misc_ppi_pc_w));
+
+ i8255_device &ppi_rtc(I8255A(config, I8255A_RTC_TAG));
+ ppi_rtc.in_pa_callback().set(FUNC(v1050_state::rtc_ppi_pa_r));
+ ppi_rtc.in_pc_callback().set(FUNC(v1050_state::rtc_ppi_pc_r));
+ ppi_rtc.out_pa_callback().set(FUNC(v1050_state::rtc_ppi_pa_w));
+ ppi_rtc.out_pb_callback().set(FUNC(v1050_state::rtc_ppi_pb_w));
+ ppi_rtc.out_pc_callback().set(FUNC(v1050_state::rtc_ppi_pc_w));
+
+ I8255A(config, m_ppi_6502);
+ m_ppi_6502->in_pa_callback().set(m_ppi_disp, FUNC(i8255_device::pb_r));
+ m_ppi_6502->out_pc_callback().set(FUNC(v1050_state::m6502_ppi_pc_w));
I8251(config, m_uart_kb, 0/*16_MHz_XTAL/8,*/);
m_uart_kb->txd_handler().set(V1050_KEYBOARD_TAG, FUNC(v1050_keyboard_device::si_w));
diff --git a/src/mame/drivers/vector06.cpp b/src/mame/drivers/vector06.cpp
index fec272834b9..91aefcdaf16 100644
--- a/src/mame/drivers/vector06.cpp
+++ b/src/mame/drivers/vector06.cpp
@@ -184,17 +184,17 @@ MACHINE_CONFIG_START(vector06_state::vector06)
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25);
/* devices */
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, vector06_state, vector06_8255_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, vector06_state, vector06_8255_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, vector06_state, vector06_8255_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, vector06_state, vector06_8255_portc_r))
-
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, vector06_state, vector06_romdisk_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, vector06_state, vector06_romdisk_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, vector06_state, vector06_romdisk_portb_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, vector06_state, vector06_romdisk_portc_w))
+ I8255(config, m_ppi8255);
+ m_ppi8255->in_pb_callback().set(FUNC(vector06_state::vector06_8255_portb_r));
+ m_ppi8255->in_pc_callback().set(FUNC(vector06_state::vector06_8255_portc_r));
+ m_ppi8255->out_pa_callback().set(FUNC(vector06_state::vector06_8255_porta_w));
+ m_ppi8255->out_pb_callback().set(FUNC(vector06_state::vector06_8255_portb_w));
+
+ I8255(config, m_ppi8255_2);
+ m_ppi8255_2->in_pb_callback().set(FUNC(vector06_state::vector06_romdisk_portb_r));
+ m_ppi8255_2->out_pa_callback().set(FUNC(vector06_state::vector06_romdisk_porta_w));
+ m_ppi8255_2->out_pb_callback().set(FUNC(vector06_state::vector06_romdisk_portb_w));
+ m_ppi8255_2->out_pc_callback().set(FUNC(vector06_state::vector06_romdisk_portc_w));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
diff --git a/src/mame/drivers/vega.cpp b/src/mame/drivers/vega.cpp
index 5456658a03b..33f48771b13 100644
--- a/src/mame/drivers/vega.cpp
+++ b/src/mame/drivers/vega.cpp
@@ -808,13 +808,13 @@ MACHINE_CONFIG_START(vega_state::vega)
MCFG_MCS48_PORT_PROG_OUT_CB(NOOP) /* prog - inputs CLK */
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vega_state, irq0_line_hold)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, vega_state, txtram_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, vega_state, txtram_w))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, vega_state, ppi_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, vega_state, randomizer))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, vega_state, ppi_pc_w))
+ I8255A(config, m_i8255);
+ m_i8255->in_pa_callback().set(FUNC(vega_state::txtram_r));
+ m_i8255->in_pb_callback().set_ioport("IN0");
+ m_i8255->in_pc_callback().set(FUNC(vega_state::randomizer));
+ m_i8255->out_pa_callback().set(FUNC(vega_state::txtram_w));
+ m_i8255->out_pb_callback().set(FUNC(vega_state::ppi_pb_w));
+ m_i8255->out_pc_callback().set(FUNC(vega_state::ppi_pc_w));
MCFG_DEVICE_ADD( "ins8154", INS8154, 0 )
MCFG_INS8154_IN_A_CB(READ8(*this, vega_state, ins8154_pa_r))
diff --git a/src/mame/drivers/videopkr.cpp b/src/mame/drivers/videopkr.cpp
index 144d0382008..53851a0987c 100644
--- a/src/mame/drivers/videopkr.cpp
+++ b/src/mame/drivers/videopkr.cpp
@@ -1365,11 +1365,11 @@ MACHINE_CONFIG_START(videopkr_state::bpoker)
MCFG_MCS51_PORT_P1_IN_CB(CONSTANT(0)) // ???
MCFG_MCS51_PORT_P1_OUT_CB(NOOP) // ???
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- //MCFG_I8255_OUT_PORTA_CB()
- //MCFG_I8255_IN_PORTB_CB()
- //MCFG_I8255_OUT_PORTC_CB()
- //MCFG_I8255_IN_PORTC_CB()
+ I8255A(config, "ppi");
+ //ppi.out_pa_callback()
+ //ppi.in_pb_callback()
+ //ppi.out_pc_callback()
+ //ppi.in_pc_callback()
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/votrpss.cpp b/src/mame/drivers/votrpss.cpp
index ffa77f2d290..29148b476b1 100644
--- a/src/mame/drivers/votrpss.cpp
+++ b/src/mame/drivers/votrpss.cpp
@@ -284,13 +284,13 @@ MACHINE_CONFIG_START(votrpss_state::votrpss)
pit.set_clk<1>(8_MHz_XTAL / 256); // Timer 1: Pitch
pit.set_clk<2>(8_MHz_XTAL / 4096); // Timer 2: Volume
- MCFG_DEVICE_ADD("ppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, votrpss_state, ppi_pa_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, votrpss_state, ppi_pa_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, votrpss_state, ppi_pb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, votrpss_state, ppi_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, votrpss_state, ppi_pc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, votrpss_state, ppi_pc_w))
+ I8255(config, m_ppi);
+ m_ppi->in_pa_callback().set(FUNC(votrpss_state::ppi_pa_r));
+ m_ppi->in_pb_callback().set(FUNC(votrpss_state::ppi_pb_r));
+ m_ppi->in_pc_callback().set(FUNC(votrpss_state::ppi_pc_r));
+ m_ppi->out_pa_callback().set(FUNC(votrpss_state::ppi_pa_w));
+ m_ppi->out_pb_callback().set(FUNC(votrpss_state::ppi_pb_w));
+ m_ppi->out_pc_callback().set(FUNC(votrpss_state::ppi_pc_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", votrpss_state, irq_timer, attotime::from_msec(10))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/vp415.cpp b/src/mame/drivers/vp415.cpp
index 0881c3e66ae..e266d550e8f 100644
--- a/src/mame/drivers/vp415.cpp
+++ b/src/mame/drivers/vp415.cpp
@@ -533,10 +533,10 @@ MACHINE_CONFIG_START(vp415_state::vp415)
i8155.in_pb_callback().set(FUNC(vp415_state::drive_i8155_pb_r));
i8155.in_pc_callback().set(FUNC(vp415_state::drive_i8155_pc_r));
- MCFG_DEVICE_ADD(I8255_TAG, I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, vp415_state, drive_i8255_pa_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, vp415_state, drive_i8255_pb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, vp415_state, drive_i8255_pc_r))
+ i8255_device &ppi(I8255(config, I8255_TAG));
+ ppi.out_pa_callback().set(FUNC(vp415_state::drive_i8255_pa_w));
+ ppi.out_pb_callback().set(FUNC(vp415_state::drive_i8255_pb_w));
+ ppi.in_pc_callback().set(FUNC(vp415_state::drive_i8255_pc_r));
MCFG_DEVICE_ADD(CHARGEN_TAG, MB88303, 0)
diff --git a/src/mame/drivers/vroulet.cpp b/src/mame/drivers/vroulet.cpp
index f311a3810d2..338b3c53d40 100644
--- a/src/mame/drivers/vroulet.cpp
+++ b/src/mame/drivers/vroulet.cpp
@@ -288,15 +288,15 @@ MACHINE_CONFIG_START(vroulet_state::vroulet)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, vroulet_state, ppi8255_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, vroulet_state, ppi8255_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, vroulet_state, ppi8255_c_w))
+ i8255_device &ppi0(I8255A(config, "ppi8255_0"));
+ ppi0.in_pa_callback().set_ioport("IN0");
+ ppi0.in_pb_callback().set_ioport("IN1");
+ ppi0.in_pc_callback().set_ioport("IN2");
+
+ i8255_device &ppi1(I8255A(config, "ppi8255_1"));
+ ppi1.out_pa_callback().set(FUNC(vroulet_state::ppi8255_a_w));
+ ppi1.out_pb_callback().set(FUNC(vroulet_state::ppi8255_b_w));
+ ppi1.out_pc_callback().set(FUNC(vroulet_state::ppi8255_c_w));
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/wacky_gator.cpp b/src/mame/drivers/wacky_gator.cpp
index 63d3434fae7..158aa458af8 100644
--- a/src/mame/drivers/wacky_gator.cpp
+++ b/src/mame/drivers/wacky_gator.cpp
@@ -304,20 +304,20 @@ MACHINE_CONFIG_START(wackygtr_state::wackygtr)
MCFG_DEVICE_ADD("ymsnd", YM2413, XTAL(3'579'545) )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_DEVICE_ADD("i8255_0", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, wackygtr_state, status_lamps_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, wackygtr_state, alligators_ctrl1_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wackygtr_state, alligators_ctrl2_w))
-
- MCFG_DEVICE_ADD("i8255_1", I8255, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, wackygtr_state, timing_lamps_w<0>))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, wackygtr_state, timing_lamps_w<1>))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wackygtr_state, timing_lamps_w<2>))
-
- MCFG_DEVICE_ADD("i8255_2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ i8255_device &ppi0(I8255(config, "i8255_0"));
+ ppi0.out_pa_callback().set(FUNC(wackygtr_state::status_lamps_w));
+ ppi0.out_pb_callback().set(FUNC(wackygtr_state::alligators_ctrl1_w));
+ ppi0.out_pc_callback().set(FUNC(wackygtr_state::alligators_ctrl2_w));
+
+ i8255_device &ppi1(I8255(config, "i8255_1"));
+ ppi1.out_pa_callback().set(FUNC(wackygtr_state::timing_lamps_w<0>));
+ ppi1.out_pb_callback().set(FUNC(wackygtr_state::timing_lamps_w<1>));
+ ppi1.out_pc_callback().set(FUNC(wackygtr_state::timing_lamps_w<2>));
+
+ i8255_device &ppi2(I8255(config, "i8255_2"));
+ ppi2.in_pa_callback().set_ioport("IN0");
+ ppi2.in_pb_callback().set_ioport("IN1");
+ ppi2.in_pc_callback().set_ioport("IN2");
MCFG_DEVICE_ADD("pit8253_0", PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL(3'579'545)/16) // this is a guess
diff --git a/src/mame/drivers/witch.cpp b/src/mame/drivers/witch.cpp
index abbbe13b197..5a26bd4ffa9 100644
--- a/src/mame/drivers/witch.cpp
+++ b/src/mame/drivers/witch.cpp
@@ -570,8 +570,8 @@ WRITE8_MEMBER(keirinou_state::palette_w)
void witch_state::common_map(address_map &map)
{
- map(0xa000, 0xa003).rw("ppi1", FUNC(i8255_device::read), FUNC(i8255_device::write));
- map(0xa004, 0xa007).rw("ppi2", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xa000, 0xa003).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xa004, 0xa007).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xa00c, 0xa00c).portr("SERVICE"); // stats / reset
map(0xa00e, 0xa00e).portr("COINS"); // coins/attendant keys
map(0xc000, 0xc3ff).ram().w(FUNC(witch_state::gfx0_vram_w)).share("gfx0_vram");
@@ -972,15 +972,15 @@ MACHINE_CONFIG_START(witch_state::witch)
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
// 82C255 (actual chip on PCB) is equivalent to two 8255s
- MCFG_DEVICE_ADD("ppi1", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, witch_state, read_a000))
- MCFG_I8255_IN_PORTB_CB(IOPORT("UNK"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, witch_state, write_a002))
+ I8255(config, m_ppi[0]);
+ m_ppi[0]->in_pa_callback().set(FUNC(witch_state::read_a000));
+ m_ppi[0]->in_pb_callback().set_ioport("UNK");
+ m_ppi[0]->out_pc_callback().set(FUNC(witch_state::write_a002));
- MCFG_DEVICE_ADD("ppi2", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("A004"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("A005"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, witch_state, write_a006))
+ I8255(config, m_ppi[1]);
+ m_ppi[1]->in_pa_callback().set_ioport("A004");
+ m_ppi[1]->in_pb_callback().set_ioport("A005");
+ m_ppi[1]->out_pc_callback().set(FUNC(witch_state::write_a006));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1033,8 +1033,8 @@ MACHINE_CONFIG_START(keirinou_state::keirinou)
// MCFG_PALETTE_FORMAT(IIBBGGRR)
- MCFG_DEVICE_MODIFY("ppi1") // Keirin Ou does have two individual PPIs (NEC D8255AC-2)
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, keirinou_state, write_keirinou_a002))
+ // Keirin Ou does have two individual PPIs (NEC D8255AC-2)
+ m_ppi[0]->out_pc_callback().set(FUNC(keirinou_state::write_keirinou_a002));
MCFG_DEVICE_ADD("ay1", AY8910, AY8910_CLOCK)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("YM_PortA"))
diff --git a/src/mame/drivers/x1.cpp b/src/mame/drivers/x1.cpp
index 232e6651bbb..690db018178 100644
--- a/src/mame/drivers/x1.cpp
+++ b/src/mame/drivers/x1.cpp
@@ -2216,13 +2216,13 @@ MACHINE_CONFIG_START(x1_state::x1)
MCFG_DEVICE_ADD("x1kb", X1_KEYBOARD, 0)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, x1_state, x1_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, x1_state, x1_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, x1_state, x1_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, x1_state, x1_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, x1_state, x1_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, x1_state, x1_portc_w))
+ i8255_device &ppi(I8255A(config, "ppi8255_0"));
+ ppi.in_pa_callback().set(FUNC(x1_state::x1_porta_r));
+ ppi.in_pb_callback().set(FUNC(x1_state::x1_portb_r));
+ ppi.in_pc_callback().set(FUNC(x1_state::x1_portc_r));
+ ppi.out_pa_callback().set(FUNC(x1_state::x1_porta_w));
+ ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w));
+ ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w));
MCFG_MACHINE_START_OVERRIDE(x1_state,x1)
MCFG_MACHINE_RESET_OVERRIDE(x1_state,x1)
diff --git a/src/mame/drivers/x1twin.cpp b/src/mame/drivers/x1twin.cpp
index 8e0ebffe984..9967fa24bcd 100644
--- a/src/mame/drivers/x1twin.cpp
+++ b/src/mame/drivers/x1twin.cpp
@@ -427,13 +427,13 @@ MACHINE_CONFIG_START(x1twin_state::x1twin)
MCFG_DEVICE_ADD("x1kb", X1_KEYBOARD, 0)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, x1_state, x1_porta_r))
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, x1_state, x1_porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, x1_state, x1_portb_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, x1_state, x1_portb_w))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, x1_state, x1_portc_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, x1_state, x1_portc_w))
+ i8255_device &ppi(I8255A(config, "ppi8255_0"));
+ ppi.in_pa_callback().set(FUNC(x1_state::x1_porta_r));
+ ppi.in_pb_callback().set(FUNC(x1_state::x1_portb_r));
+ ppi.in_pc_callback().set(FUNC(x1_state::x1_portc_r));
+ ppi.out_pa_callback().set(FUNC(x1_state::x1_porta_w));
+ ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w));
+ ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w));
MCFG_MACHINE_START_OVERRIDE(x1twin_state,x1)
MCFG_MACHINE_RESET_OVERRIDE(x1twin_state,x1)
diff --git a/src/mame/drivers/xor100.cpp b/src/mame/drivers/xor100.cpp
index d120acd7c56..ed963f79e34 100644
--- a/src/mame/drivers/xor100.cpp
+++ b/src/mame/drivers/xor100.cpp
@@ -511,10 +511,10 @@ MACHINE_CONFIG_START(xor100_state::xor100)
brg.ft_handler().set(m_uart_b, FUNC(i8251_device::write_txc));
brg.ft_handler().append(m_uart_b, FUNC(i8251_device::write_rxc));
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_I8255_OUT_PORTB_CB(WRITELINE(m_centronics, centronics_device, write_strobe))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, xor100_state, i8255_pc_r))
+ i8255_device &ppi(I8255A(config, I8255A_TAG));
+ ppi.out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ ppi.out_pb_callback().set(m_centronics, FUNC(centronics_device::write_strobe));
+ ppi.in_pc_callback().set(FUNC(xor100_state::i8255_pc_r));
Z80CTC(config, m_ctc, 8_MHz_XTAL / 2);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/zaccaria.cpp b/src/mame/drivers/zaccaria.cpp
index b5516ae7664..26a0d3c03d8 100644
--- a/src/mame/drivers/zaccaria.cpp
+++ b/src/mame/drivers/zaccaria.cpp
@@ -348,11 +348,11 @@ MACHINE_CONFIG_START(zaccaria_state::zaccaria)
mainlatch.q_out_cb<6>().set(FUNC(zaccaria_state::coin_w)); // COUNT
mainlatch.q_out_cb<7>().set(FUNC(zaccaria_state::nmi_mask_w)); // INTST
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("SYSTEM"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, zaccaria_state, dsw_sel_w))
+ i8255_device &ppi(I8255A(config, "ppi8255"));
+ ppi.in_pa_callback().set_ioport("P1");
+ ppi.in_pb_callback().set_ioport("P2");
+ ppi.in_pc_callback().set_ioport("SYSTEM");
+ ppi.out_pc_callback().set(FUNC(zaccaria_state::dsw_sel_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/zaxxon.cpp b/src/mame/drivers/zaxxon.cpp
index 67efd323c9e..202f3a0ec9f 100644
--- a/src/mame/drivers/zaxxon.cpp
+++ b/src/mame/drivers/zaxxon.cpp
@@ -921,10 +921,10 @@ MACHINE_CONFIG_START(zaxxon_state::root)
MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/16)
MCFG_DEVICE_PROGRAM_MAP(zaxxon_map)
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, zaxxon_state, zaxxon_sound_a_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, zaxxon_state, zaxxon_sound_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, zaxxon_state, zaxxon_sound_c_w))
+ I8255A(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(zaxxon_state::zaxxon_sound_a_w));
+ m_ppi->out_pb_callback().set(FUNC(zaxxon_state::zaxxon_sound_b_w));
+ m_ppi->out_pc_callback().set(FUNC(zaxxon_state::zaxxon_sound_c_w));
LS259(config, m_mainlatch[0]); // U55 on Zaxxon IC Board A
m_mainlatch[0]->q_out_cb<0>().set(FUNC(zaxxon_state::coin_enable_w)); // COIN EN A
@@ -1040,10 +1040,10 @@ MACHINE_CONFIG_START(zaxxon_state::congo)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(congo_map)
- MCFG_DEVICE_REPLACE("ppi8255", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, zaxxon_state, congo_sound_b_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, zaxxon_state, congo_sound_c_w))
+ m_ppi->in_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::read));
+ m_ppi->out_pa_callback().set_nop();
+ m_ppi->out_pb_callback().set(FUNC(zaxxon_state::congo_sound_b_w));
+ m_ppi->out_pc_callback().set(FUNC(zaxxon_state::congo_sound_c_w));
// U52 on Control Board
m_mainlatch[0]->q_out_cb<5>().set(FUNC(zaxxon_state::bg_enable_w)); // BEN
diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h
index 36c2ccf1240..b2aa268f5e2 100644
--- a/src/mame/includes/goldstar.h
+++ b/src/mame/includes/goldstar.h
@@ -2,6 +2,7 @@
// copyright-holders:David Haywood, Roberto Fresca, Vas Crabb
#include "machine/ds2401.h"
+#include "machine/i8255.h"
#include "machine/ticket.h"
#include "emupal.h"
@@ -22,6 +23,7 @@ public:
m_reel2_scroll(*this, "reel2_scroll"),
m_reel3_scroll(*this, "reel3_scroll"),
m_maincpu(*this, "maincpu"),
+ m_ppi(*this, "ppi8255_%u", 0U),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_lamps(*this, "lamp%u", 0U)
@@ -120,6 +122,7 @@ protected:
uint8_t m_cm_girl_scroll;
required_device<cpu_device> m_maincpu;
+ optional_device_array<i8255_device, 3> m_ppi;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
output_finder<16> m_lamps;
diff --git a/src/mame/includes/witch.h b/src/mame/includes/witch.h
index 5da3ef72d86..1615aa853f7 100644
--- a/src/mame/includes/witch.h
+++ b/src/mame/includes/witch.h
@@ -38,6 +38,7 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_subcpu(*this, "sub")
+ , m_ppi(*this, "ppi%u", 1U)
, m_gfxdecode(*this, "gfxdecode")
, m_gfx0_vram(*this, "gfx0_vram")
, m_gfx0_cram(*this, "gfx0_cram")
@@ -77,6 +78,7 @@ protected:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
+ required_device_array<i8255_device, 2> m_ppi;
required_device<gfxdecode_device> m_gfxdecode;
required_shared_ptr<uint8_t> m_gfx0_vram;
diff --git a/src/mame/includes/zaxxon.h b/src/mame/includes/zaxxon.h
index 23ae710ad0f..874fb9b0eab 100644
--- a/src/mame/includes/zaxxon.h
+++ b/src/mame/includes/zaxxon.h
@@ -7,6 +7,7 @@
***************************************************************************/
#include "machine/74259.h"
+#include "machine/i8255.h"
#include "sound/samples.h"
#include "emupal.h"
@@ -17,6 +18,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_mainlatch(*this, "mainlatch%u", 1),
+ m_ppi(*this, "ppi8255"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
@@ -48,6 +50,7 @@ public:
private:
required_device<cpu_device> m_maincpu;
required_device_array<ls259_device, 2> m_mainlatch;
+ optional_device<i8255_device> m_ppi;
optional_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;