summaryrefslogtreecommitdiffstats
path: root/src/mame
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/audio/atarijsa.h14
-rw-r--r--src/mame/audio/cage.h2
-rw-r--r--src/mame/audio/cmi01a.h2
-rw-r--r--src/mame/audio/dsbz80.cpp27
-rw-r--r--src/mame/audio/dsbz80.h2
-rw-r--r--src/mame/audio/efo_zsu.cpp20
-rw-r--r--src/mame/audio/exidy.h8
-rw-r--r--src/mame/audio/harddriv.cpp20
-rw-r--r--src/mame/audio/irem.cpp38
-rw-r--r--src/mame/audio/irem.h7
-rw-r--r--src/mame/audio/namco52.h4
-rw-r--r--src/mame/audio/rad_eu3a05.h2
-rw-r--r--src/mame/audio/segag80r.cpp2
-rw-r--r--src/mame/audio/segam1audio.cpp12
-rw-r--r--src/mame/audio/segam1audio.h8
-rw-r--r--src/mame/audio/segasnd.h2
-rw-r--r--src/mame/audio/seibu.h4
-rw-r--r--src/mame/audio/svis_snd.h2
-rw-r--r--src/mame/audio/tvc.h2
-rw-r--r--src/mame/audio/williams.cpp24
-rw-r--r--src/mame/audio/zaccaria.h2
-rw-r--r--src/mame/drivers/24cdjuke.cpp6
-rw-r--r--src/mame/drivers/2mindril.cpp12
-rw-r--r--src/mame/drivers/68ksbc.cpp29
-rw-r--r--src/mame/drivers/a7150.cpp22
-rw-r--r--src/mame/drivers/abc80x.cpp12
-rw-r--r--src/mame/drivers/aerofgt.cpp18
-rw-r--r--src/mame/drivers/alesis.cpp30
-rw-r--r--src/mame/drivers/alpha68k.cpp8
-rw-r--r--src/mame/drivers/alphatpx.cpp20
-rw-r--r--src/mame/drivers/alphatro.cpp6
-rw-r--r--src/mame/drivers/altair.cpp6
-rw-r--r--src/mame/drivers/altos2.cpp43
-rw-r--r--src/mame/drivers/altos486.cpp10
-rw-r--r--src/mame/drivers/altos5.cpp24
-rw-r--r--src/mame/drivers/altos8600.cpp49
-rw-r--r--src/mame/drivers/amiga.cpp40
-rw-r--r--src/mame/drivers/ampro.cpp20
-rw-r--r--src/mame/drivers/amust.cpp6
-rw-r--r--src/mame/drivers/apc.cpp16
-rw-r--r--src/mame/drivers/apricot.cpp28
-rw-r--r--src/mame/drivers/asteroid.cpp40
-rw-r--r--src/mame/drivers/astrocde.cpp34
-rw-r--r--src/mame/drivers/asuka.cpp96
-rw-r--r--src/mame/drivers/atarist.cpp24
-rw-r--r--src/mame/drivers/atarisy1.cpp12
-rw-r--r--src/mame/drivers/attache.cpp64
-rw-r--r--src/mame/drivers/aussiebyte.cpp38
-rw-r--r--src/mame/drivers/avt.cpp28
-rw-r--r--src/mame/drivers/balsente.cpp28
-rw-r--r--src/mame/drivers/bbc.cpp8
-rw-r--r--src/mame/drivers/bbusters.cpp16
-rw-r--r--src/mame/drivers/bebox.cpp16
-rw-r--r--src/mame/drivers/bigbord2.cpp22
-rw-r--r--src/mame/drivers/bladestl.cpp6
-rw-r--r--src/mame/drivers/bml3.cpp6
-rw-r--r--src/mame/drivers/bombjack.cpp18
-rw-r--r--src/mame/drivers/bw2.cpp16
-rw-r--r--src/mame/drivers/capbowl.cpp24
-rw-r--r--src/mame/drivers/cat.cpp9
-rw-r--r--src/mame/drivers/ccastles.cpp32
-rw-r--r--src/mame/drivers/cclimber.cpp62
-rw-r--r--src/mame/drivers/ccs2810.cpp66
-rw-r--r--src/mame/drivers/ccs300.cpp6
-rw-r--r--src/mame/drivers/cdc721.cpp18
-rw-r--r--src/mame/drivers/centiped.cpp28
-rw-r--r--src/mame/drivers/cgc7900.cpp10
-rw-r--r--src/mame/drivers/cidelsa.cpp24
-rw-r--r--src/mame/drivers/cit101.cpp38
-rw-r--r--src/mame/drivers/clcd.cpp28
-rw-r--r--src/mame/drivers/cloak.cpp14
-rw-r--r--src/mame/drivers/cloud9.cpp28
-rw-r--r--src/mame/drivers/clshroad.cpp20
-rw-r--r--src/mame/drivers/cntsteer.cpp18
-rw-r--r--src/mame/drivers/coco12.cpp70
-rw-r--r--src/mame/drivers/coco3.cpp22
-rw-r--r--src/mame/drivers/codata.cpp16
-rw-r--r--src/mame/drivers/commando.cpp19
-rw-r--r--src/mame/drivers/compucolor.cpp6
-rw-r--r--src/mame/drivers/comx35.cpp4
-rw-r--r--src/mame/drivers/cortex.cpp9
-rw-r--r--src/mame/drivers/cosmicos.cpp2
-rw-r--r--src/mame/drivers/cp1.cpp24
-rw-r--r--src/mame/drivers/cpzodiac.cpp22
-rw-r--r--src/mame/drivers/crshrace.cpp16
-rw-r--r--src/mame/drivers/darkseal.cpp4
-rw-r--r--src/mame/drivers/dblewing.cpp16
-rw-r--r--src/mame/drivers/ddenlovr.cpp55
-rw-r--r--src/mame/drivers/dec8.cpp72
-rw-r--r--src/mame/drivers/deco32.cpp53
-rw-r--r--src/mame/drivers/decwritr.cpp18
-rw-r--r--src/mame/drivers/destroyr.cpp6
-rw-r--r--src/mame/drivers/dietgo.cpp14
-rw-r--r--src/mame/drivers/divebomb.cpp20
-rw-r--r--src/mame/drivers/dkong.cpp39
-rw-r--r--src/mame/drivers/dmax8000.cpp24
-rw-r--r--src/mame/drivers/dms86.cpp57
-rw-r--r--src/mame/drivers/dmv.cpp28
-rw-r--r--src/mame/drivers/docastle.cpp32
-rw-r--r--src/mame/drivers/dragon.cpp24
-rw-r--r--src/mame/drivers/dragrace.cpp44
-rw-r--r--src/mame/drivers/dreambal.cpp12
-rw-r--r--src/mame/drivers/dsb46.cpp18
-rw-r--r--src/mame/drivers/duet16.cpp32
-rw-r--r--src/mame/drivers/dynamoah.cpp29
-rw-r--r--src/mame/drivers/dynax.cpp40
-rw-r--r--src/mame/drivers/dynduke.cpp22
-rw-r--r--src/mame/drivers/einstein.cpp8
-rw-r--r--src/mame/drivers/eti660.cpp14
-rw-r--r--src/mame/drivers/exterm.cpp14
-rw-r--r--src/mame/drivers/f1gp.cpp12
-rw-r--r--src/mame/drivers/fanucspmg.cpp4
-rw-r--r--src/mame/drivers/fc100.cpp10
-rw-r--r--src/mame/drivers/firefox.cpp38
-rw-r--r--src/mame/drivers/fmtowns.cpp4
-rw-r--r--src/mame/drivers/ft68m.cpp14
-rw-r--r--src/mame/drivers/gaelco.cpp34
-rw-r--r--src/mame/drivers/gaelco3d.cpp3
-rw-r--r--src/mame/drivers/gaiden.cpp18
-rw-r--r--src/mame/drivers/galaga.cpp114
-rw-r--r--src/mame/drivers/galastrm.cpp16
-rw-r--r--src/mame/drivers/galaxold.cpp22
-rw-r--r--src/mame/drivers/gaplus.cpp23
-rw-r--r--src/mame/drivers/gimix.cpp10
-rw-r--r--src/mame/drivers/gladiatr.cpp24
-rw-r--r--src/mame/drivers/gng.cpp22
-rw-r--r--src/mame/drivers/gotcha.cpp19
-rw-r--r--src/mame/drivers/groundfx.cpp18
-rw-r--r--src/mame/drivers/gstriker.cpp20
-rw-r--r--src/mame/drivers/gsword.cpp14
-rw-r--r--src/mame/drivers/guab.cpp6
-rw-r--r--src/mame/drivers/gunbustr.cpp18
-rw-r--r--src/mame/drivers/h8.cpp10
-rw-r--r--src/mame/drivers/harriet.cpp6
-rw-r--r--src/mame/drivers/hazelgr.cpp16
-rw-r--r--src/mame/drivers/hazeltin.cpp6
-rw-r--r--src/mame/drivers/hnayayoi.cpp20
-rw-r--r--src/mame/drivers/holeland.cpp16
-rw-r--r--src/mame/drivers/hp16500.cpp29
-rw-r--r--src/mame/drivers/i7000.cpp4
-rw-r--r--src/mame/drivers/ibm6580.cpp10
-rw-r--r--src/mame/drivers/igs017.cpp12
-rw-r--r--src/mame/drivers/imds2.cpp4
-rw-r--r--src/mame/drivers/imolagp.cpp14
-rw-r--r--src/mame/drivers/imsai.cpp12
-rw-r--r--src/mame/drivers/inder.cpp11
-rw-r--r--src/mame/drivers/interpro.cpp8
-rw-r--r--src/mame/drivers/ipc.cpp69
-rw-r--r--src/mame/drivers/irisha.cpp16
-rw-r--r--src/mame/drivers/isbc.cpp52
-rw-r--r--src/mame/drivers/isbc8030.cpp74
-rw-r--r--src/mame/drivers/iteagle.cpp16
-rw-r--r--src/mame/drivers/jade.cpp11
-rw-r--r--src/mame/drivers/jp.cpp36
-rw-r--r--src/mame/drivers/jpmsys5.cpp127
-rw-r--r--src/mame/drivers/kaypro.cpp61
-rw-r--r--src/mame/drivers/kdt6.cpp70
-rw-r--r--src/mame/drivers/kingobox.cpp62
-rw-r--r--src/mame/drivers/kinst.cpp3
-rw-r--r--src/mame/drivers/konin.cpp16
-rw-r--r--src/mame/drivers/kopunch.cpp26
-rw-r--r--src/mame/drivers/kyugo.cpp8
-rw-r--r--src/mame/drivers/liberatr.cpp18
-rw-r--r--src/mame/drivers/m24.cpp2
-rw-r--r--src/mame/drivers/m79152pc.cpp6
-rw-r--r--src/mame/drivers/magmax.cpp6
-rw-r--r--src/mame/drivers/mappy.cpp272
-rw-r--r--src/mame/drivers/marineb.cpp25
-rw-r--r--src/mame/drivers/mbee.cpp28
-rw-r--r--src/mame/drivers/mc8020.cpp8
-rw-r--r--src/mame/drivers/mc8030.cpp6
-rw-r--r--src/mame/drivers/mccpm.cpp6
-rw-r--r--src/mame/drivers/meritm.cpp26
-rw-r--r--src/mame/drivers/metro.cpp2
-rw-r--r--src/mame/drivers/mfabfz.cpp37
-rw-r--r--src/mame/drivers/mice.cpp10
-rw-r--r--src/mame/drivers/micro3d.cpp6
-rw-r--r--src/mame/drivers/microdec.cpp75
-rw-r--r--src/mame/drivers/microkit.cpp2
-rw-r--r--src/mame/drivers/microterm.cpp37
-rw-r--r--src/mame/drivers/milwaukee.cpp55
-rw-r--r--src/mame/drivers/miniframe.cpp22
-rw-r--r--src/mame/drivers/mits680b.cpp6
-rw-r--r--src/mame/drivers/mk14.cpp2
-rw-r--r--src/mame/drivers/mmd1.cpp4
-rw-r--r--src/mame/drivers/model1.cpp18
-rw-r--r--src/mame/drivers/model2.cpp49
-rw-r--r--src/mame/drivers/model3.cpp10
-rw-r--r--src/mame/drivers/mrflea.cpp20
-rw-r--r--src/mame/drivers/multi8.cpp6
-rw-r--r--src/mame/drivers/munchmo.cpp3
-rw-r--r--src/mame/drivers/mx2178.cpp10
-rw-r--r--src/mame/drivers/namcos12.cpp13
-rw-r--r--src/mame/drivers/namcos23.cpp49
-rw-r--r--src/mame/drivers/nbmj9195.cpp20
-rw-r--r--src/mame/drivers/nemesis.cpp18
-rw-r--r--src/mame/drivers/neogeo.cpp16
-rw-r--r--src/mame/drivers/neogeocd.cpp3
-rw-r--r--src/mame/drivers/ngen.cpp20
-rw-r--r--src/mame/drivers/ninjaw.cpp28
-rw-r--r--src/mame/drivers/norautp.cpp22
-rw-r--r--src/mame/drivers/nss.cpp6
-rw-r--r--src/mame/drivers/ob68k1a.cpp70
-rw-r--r--src/mame/drivers/octopus.cpp20
-rw-r--r--src/mame/drivers/okean240.cpp8
-rw-r--r--src/mame/drivers/olyboss.cpp22
-rw-r--r--src/mame/drivers/onyx.cpp12
-rw-r--r--src/mame/drivers/osbexec.cpp43
-rw-r--r--src/mame/drivers/othello.cpp2
-rw-r--r--src/mame/drivers/othunder.cpp16
-rw-r--r--src/mame/drivers/p8k.cpp12
-rw-r--r--src/mame/drivers/pacman.cpp8
-rw-r--r--src/mame/drivers/pandoras.cpp16
-rw-r--r--src/mame/drivers/pc100.cpp2
-rw-r--r--src/mame/drivers/pc88va.cpp4
-rw-r--r--src/mame/drivers/pc9801.cpp38
-rw-r--r--src/mame/drivers/pcd.cpp2
-rw-r--r--src/mame/drivers/pcm.cpp18
-rw-r--r--src/mame/drivers/pecom.cpp2
-rw-r--r--src/mame/drivers/peoplepc.cpp4
-rw-r--r--src/mame/drivers/peyper.cpp4
-rw-r--r--src/mame/drivers/pg685.cpp6
-rw-r--r--src/mame/drivers/pimps.cpp66
-rw-r--r--src/mame/drivers/pktgaldx.cpp10
-rw-r--r--src/mame/drivers/play_2.cpp14
-rw-r--r--src/mame/drivers/play_3.cpp16
-rw-r--r--src/mame/drivers/playch10.cpp52
-rw-r--r--src/mame/drivers/plus4.cpp42
-rw-r--r--src/mame/drivers/pm68k.cpp10
-rw-r--r--src/mame/drivers/pntnpuzl.cpp12
-rw-r--r--src/mame/drivers/pokechmp.cpp26
-rw-r--r--src/mame/drivers/polepos.cpp102
-rw-r--r--src/mame/drivers/polgar.cpp22
-rw-r--r--src/mame/drivers/policetr.cpp9
-rw-r--r--src/mame/drivers/poly.cpp9
-rw-r--r--src/mame/drivers/prof80.cpp42
-rw-r--r--src/mame/drivers/proteus.cpp24
-rw-r--r--src/mame/drivers/pulsar.cpp10
-rw-r--r--src/mame/drivers/punchout.cpp18
-rw-r--r--src/mame/drivers/pve500.cpp34
-rw-r--r--src/mame/drivers/qtsbc.cpp12
-rw-r--r--src/mame/drivers/qvt6800.cpp6
-rw-r--r--src/mame/drivers/qx10.cpp10
-rw-r--r--src/mame/drivers/raiden.cpp22
-rw-r--r--src/mame/drivers/rainbow.cpp6
-rw-r--r--src/mame/drivers/rc702.cpp25
-rw-r--r--src/mame/drivers/retofinv.cpp14
-rw-r--r--src/mame/drivers/rmnimbus.cpp4
-rw-r--r--src/mame/drivers/rohga.cpp32
-rw-r--r--src/mame/drivers/royalmah.cpp18
-rw-r--r--src/mame/drivers/runaway.cpp16
-rw-r--r--src/mame/drivers/s7.cpp18
-rw-r--r--src/mame/drivers/sbrain.cpp14
-rw-r--r--src/mame/drivers/sbrkout.cpp28
-rw-r--r--src/mame/drivers/scopus.cpp6
-rw-r--r--src/mame/drivers/sdk85.cpp12
-rw-r--r--src/mame/drivers/sdk86.cpp10
-rw-r--r--src/mame/drivers/seattle.cpp6
-rw-r--r--src/mame/drivers/seattlecmp.cpp28
-rw-r--r--src/mame/drivers/segac2.cpp29
-rw-r--r--src/mame/drivers/segae.cpp14
-rw-r--r--src/mame/drivers/segajw.cpp26
-rw-r--r--src/mame/drivers/segam1.cpp20
-rw-r--r--src/mame/drivers/segas16a.cpp2
-rw-r--r--src/mame/drivers/segas16b.cpp11
-rw-r--r--src/mame/drivers/segas18.cpp38
-rw-r--r--src/mame/drivers/segas24.cpp57
-rw-r--r--src/mame/drivers/segas32.cpp92
-rw-r--r--src/mame/drivers/segaufo.cpp132
-rw-r--r--src/mame/drivers/segaxbd.cpp22
-rw-r--r--src/mame/drivers/segaybd.cpp18
-rw-r--r--src/mame/drivers/selz80.cpp10
-rw-r--r--src/mame/drivers/seta.cpp8
-rw-r--r--src/mame/drivers/seta2.cpp2
-rw-r--r--src/mame/drivers/sfcbox.cpp6
-rw-r--r--src/mame/drivers/shangkid.cpp61
-rw-r--r--src/mame/drivers/shougi.cpp18
-rw-r--r--src/mame/drivers/slapfght.cpp66
-rw-r--r--src/mame/drivers/slapshot.cpp24
-rw-r--r--src/mame/drivers/snes.cpp6
-rw-r--r--src/mame/drivers/snesb.cpp6
-rw-r--r--src/mame/drivers/splash.cpp10
-rw-r--r--src/mame/drivers/stargame.cpp23
-rw-r--r--src/mame/drivers/starwars.cpp53
-rw-r--r--src/mame/drivers/studio2.cpp8
-rw-r--r--src/mame/drivers/subs.cpp18
-rw-r--r--src/mame/drivers/sun1.cpp67
-rw-r--r--src/mame/drivers/super6.cpp28
-rw-r--r--src/mame/drivers/superchs.cpp16
-rw-r--r--src/mame/drivers/superslave.cpp16
-rw-r--r--src/mame/drivers/suprloco.cpp10
-rw-r--r--src/mame/drivers/suprslam.cpp14
-rw-r--r--src/mame/drivers/supstarf.cpp4
-rw-r--r--src/mame/drivers/swtpc.cpp82
-rw-r--r--src/mame/drivers/swtpc09.cpp16
-rw-r--r--src/mame/drivers/sys9002.cpp10
-rw-r--r--src/mame/drivers/systec.cpp6
-rw-r--r--src/mame/drivers/taito_b.cpp302
-rw-r--r--src/mame/drivers/taito_f2.cpp56
-rw-r--r--src/mame/drivers/taito_h.cpp42
-rw-r--r--src/mame/drivers/taito_l.cpp60
-rw-r--r--src/mame/drivers/taito_z.cpp142
-rw-r--r--src/mame/drivers/taitoair.cpp14
-rw-r--r--src/mame/drivers/taitojc.cpp14
-rw-r--r--src/mame/drivers/taotaido.cpp26
-rw-r--r--src/mame/drivers/tatsumi.cpp6
-rw-r--r--src/mame/drivers/tavernie.cpp6
-rw-r--r--src/mame/drivers/thedealr.cpp18
-rw-r--r--src/mame/drivers/tim100.cpp54
-rw-r--r--src/mame/drivers/timelimt.cpp12
-rw-r--r--src/mame/drivers/tmc1800.cpp8
-rw-r--r--src/mame/drivers/tmc2000e.cpp4
-rw-r--r--src/mame/drivers/tmc600.cpp12
-rw-r--r--src/mame/drivers/toaplan2.cpp859
-rw-r--r--src/mame/drivers/tomcat.cpp18
-rw-r--r--src/mame/drivers/topspeed.cpp24
-rw-r--r--src/mame/drivers/tranz330.cpp12
-rw-r--r--src/mame/drivers/triplhnt.cpp47
-rw-r--r--src/mame/drivers/trs80dt1.cpp20
-rw-r--r--src/mame/drivers/ts803.cpp12
-rw-r--r--src/mame/drivers/tsamurai.cpp18
-rw-r--r--src/mame/drivers/tv912.cpp71
-rw-r--r--src/mame/drivers/twincobr.cpp14
-rw-r--r--src/mame/drivers/undrfire.cpp44
-rw-r--r--src/mame/drivers/unior.cpp21
-rw-r--r--src/mame/drivers/univac.cpp36
-rw-r--r--src/mame/drivers/v100.cpp36
-rw-r--r--src/mame/drivers/v1050.cpp14
-rw-r--r--src/mame/drivers/v550.cpp10
-rw-r--r--src/mame/drivers/v6809.cpp14
-rw-r--r--src/mame/drivers/vaportra.cpp4
-rw-r--r--src/mame/drivers/vastar.cpp8
-rw-r--r--src/mame/drivers/vector4.cpp14
-rw-r--r--src/mame/drivers/victor9k.cpp11
-rw-r--r--src/mame/drivers/vip.cpp2
-rw-r--r--src/mame/drivers/votrpss.cpp12
-rw-r--r--src/mame/drivers/votrtnt.cpp6
-rw-r--r--src/mame/drivers/vt100.cpp30
-rw-r--r--src/mame/drivers/vta2000.cpp28
-rw-r--r--src/mame/drivers/vtech1.cpp33
-rw-r--r--src/mame/drivers/wardner.cpp14
-rw-r--r--src/mame/drivers/warriorb.cpp28
-rw-r--r--src/mame/drivers/wgp.cpp14
-rw-r--r--src/mame/drivers/wicat.cpp18
-rw-r--r--src/mame/drivers/williams.cpp52
-rw-r--r--src/mame/drivers/wiping.cpp13
-rw-r--r--src/mame/drivers/xain.cpp31
-rw-r--r--src/mame/drivers/xerox820.cpp14
-rw-r--r--src/mame/drivers/xor100.cpp10
-rw-r--r--src/mame/drivers/z100.cpp4
-rw-r--r--src/mame/drivers/z88.cpp13
-rw-r--r--src/mame/drivers/zac2650.cpp24
-rw-r--r--src/mame/drivers/zn.cpp37
-rw-r--r--src/mame/drivers/zorba.cpp28
-rw-r--r--src/mame/drivers/zsbc3.cpp52
-rw-r--r--src/mame/includes/alesis.h2
-rw-r--r--src/mame/includes/apexc.h1
-rw-r--r--src/mame/includes/apollo.h10
-rw-r--r--src/mame/includes/asteroid.h7
-rw-r--r--src/mame/includes/balsente.h1
-rw-r--r--src/mame/includes/ccastles.h1
-rw-r--r--src/mame/includes/cloud9.h2
-rw-r--r--src/mame/includes/cvs.h6
-rw-r--r--src/mame/includes/dec8.h1
-rw-r--r--src/mame/includes/dragon.h4
-rw-r--r--src/mame/includes/galaxold.h2
-rw-r--r--src/mame/includes/gng.h2
-rw-r--r--src/mame/includes/jpmsys5.h1
-rw-r--r--src/mame/includes/kopunch.h6
-rw-r--r--src/mame/includes/liberatr.h2
-rw-r--r--src/mame/includes/pgm2.h1
-rw-r--r--src/mame/includes/super6.h26
-rw-r--r--src/mame/includes/taito_b.h34
-rw-r--r--src/mame/includes/triplhnt.h4
-rw-r--r--src/mame/includes/v1050.h4
-rw-r--r--src/mame/includes/xbox_pci.h8
-rw-r--r--src/mame/includes/z88.h6
-rw-r--r--src/mame/machine/315_5296.h102
-rw-r--r--src/mame/machine/315_5338a.h83
-rw-r--r--src/mame/machine/315_5649.h52
-rw-r--r--src/mame/machine/6883sam.h2
-rw-r--r--src/mame/machine/abc80kb.h2
-rw-r--r--src/mame/machine/acs8600_ics.cpp122
-rw-r--r--src/mame/machine/acs8600_ics.h43
-rw-r--r--src/mame/machine/apollo.cpp16
-rw-r--r--src/mame/machine/apollo_kbd.h4
-rw-r--r--src/mame/machine/apricotkb.h2
-rw-r--r--src/mame/machine/at.cpp48
-rw-r--r--src/mame/machine/atarigen.h2
-rw-r--r--src/mame/machine/balsente.cpp5
-rw-r--r--src/mame/machine/c117.h2
-rw-r--r--src/mame/machine/cammu.h2
-rw-r--r--src/mame/machine/cat702.h2
-rw-r--r--src/mame/machine/cit101_kbd.h2
-rw-r--r--src/mame/machine/compiskb.h2
-rw-r--r--src/mame/machine/cuda.h8
-rw-r--r--src/mame/machine/dec_lk201.h2
-rw-r--r--src/mame/machine/deco104.h4
-rw-r--r--src/mame/machine/deco146.h12
-rw-r--r--src/mame/machine/deco_irq.h12
-rw-r--r--src/mame/machine/egret.h8
-rw-r--r--src/mame/machine/esqpanel.h4
-rw-r--r--src/mame/machine/fm_scsi.h4
-rw-r--r--src/mame/machine/gaelco3d.h2
-rw-r--r--src/mame/machine/hp9845_printer.h6
-rw-r--r--src/mame/machine/ibm6580_fdc.h6
-rw-r--r--src/mame/machine/ibm6580_kbd.h15
-rw-r--r--src/mame/machine/interpro_ioga.h27
-rw-r--r--src/mame/machine/interpro_sga.h2
-rw-r--r--src/mame/machine/ioptimer.h2
-rw-r--r--src/mame/machine/isbc_208.h2
-rw-r--r--src/mame/machine/isbc_215g.h2
-rw-r--r--src/mame/machine/k573cass.h18
-rw-r--r--src/mame/machine/kay_kbd.h8
-rw-r--r--src/mame/machine/kc_keyb.h2
-rw-r--r--src/mame/machine/km035.h4
-rw-r--r--src/mame/machine/m24_kbd.h2
-rw-r--r--src/mame/machine/m24_z8000.h2
-rw-r--r--src/mame/machine/mackbd.cpp25
-rw-r--r--src/mame/machine/mackbd.h2
-rw-r--r--src/mame/machine/microdrv.h2
-rw-r--r--src/mame/machine/micropolis.h6
-rw-r--r--src/mame/machine/midikbd.h2
-rw-r--r--src/mame/machine/midwayic.h6
-rw-r--r--src/mame/machine/mm1kb.h2
-rw-r--r--src/mame/machine/model1io.cpp49
-rw-r--r--src/mame/machine/model1io.h32
-rw-r--r--src/mame/machine/model1io2.cpp98
-rw-r--r--src/mame/machine/model1io2.h32
-rw-r--r--src/mame/machine/ms7004.h4
-rw-r--r--src/mame/machine/msx_matsushita.h2
-rw-r--r--src/mame/machine/namco06.h24
-rw-r--r--src/mame/machine/namco51.h14
-rw-r--r--src/mame/machine/namco53.h15
-rw-r--r--src/mame/machine/namco62.h12
-rw-r--r--src/mame/machine/namco_c148.h4
-rw-r--r--src/mame/machine/namcoio.h39
-rw-r--r--src/mame/machine/nb1412m2.h2
-rw-r--r--src/mame/machine/nextkbd.h6
-rw-r--r--src/mame/machine/nextmo.h4
-rw-r--r--src/mame/machine/pc1512kb.h4
-rw-r--r--src/mame/machine/pc9801_kbd.h2
-rw-r--r--src/mame/machine/pcd_kbd.h2
-rw-r--r--src/mame/machine/pcshare.cpp4
-rw-r--r--src/mame/machine/ps2timer.h3
-rw-r--r--src/mame/machine/psxcd.h2
-rw-r--r--src/mame/machine/qimi.h2
-rw-r--r--src/mame/machine/rad_eu3a05gpio.h6
-rw-r--r--src/mame/machine/segaic16.h15
-rw-r--r--src/mame/machine/seibucop/seibucop.h4
-rw-r--r--src/mame/machine/tait8741.h8
-rw-r--r--src/mame/machine/taito68705interface.h6
-rw-r--r--src/mame/machine/taitocchip.h14
-rw-r--r--src/mame/machine/taitoio.h140
-rw-r--r--src/mame/machine/taitosjsec.h8
-rw-r--r--src/mame/machine/tandy2kb.h4
-rw-r--r--src/mame/machine/trs80m2kb.h2
-rw-r--r--src/mame/machine/upd65031.h12
-rw-r--r--src/mame/machine/v1050kb.h2
-rw-r--r--src/mame/machine/victor9k_fdc.h21
-rw-r--r--src/mame/machine/victor9k_kb.h4
-rw-r--r--src/mame/machine/vs9209.h68
-rw-r--r--src/mame/machine/vt100_kbd.h2
-rw-r--r--src/mame/machine/wangpckb.h2
-rw-r--r--src/mame/machine/x820kb.h2
-rw-r--r--src/mame/machine/xbox.cpp4
-rw-r--r--src/mame/machine/znmcu.h10
-rw-r--r--src/mame/machine/zx8302.h28
-rw-r--r--src/mame/video/733_asr.h4
-rw-r--r--src/mame/video/911_vdt.h4
-rw-r--r--src/mame/video/abc800.cpp11
-rw-r--r--src/mame/video/abc802.cpp13
-rw-r--r--src/mame/video/atarivad.h2
-rw-r--r--src/mame/video/bfm_dm01.h2
-rw-r--r--src/mame/video/cidelsa.cpp6
-rw-r--r--src/mame/video/comx35.cpp4
-rw-r--r--src/mame/video/decodmd1.cpp14
-rw-r--r--src/mame/video/dynax_blitter_rev2.h22
-rw-r--r--src/mame/video/exidy440.cpp14
-rw-r--r--src/mame/video/gime.h6
-rw-r--r--src/mame/video/gp9001.h17
-rw-r--r--src/mame/video/gtia.h4
-rw-r--r--src/mame/video/k051960.h6
-rw-r--r--src/mame/video/k052109.h2
-rw-r--r--src/mame/video/k053250_ps.h2
-rw-r--r--src/mame/video/k057714.h2
-rw-r--r--src/mame/video/k1ge.h8
-rw-r--r--src/mame/video/liberatr.cpp6
-rw-r--r--src/mame/video/nick.h2
-rw-r--r--src/mame/video/pcd.h2
-rw-r--r--src/mame/video/pecom.cpp2
-rw-r--r--src/mame/video/runaway.cpp3
-rw-r--r--src/mame/video/segaic24.h4
-rw-r--r--src/mame/video/seibu_crtc.h10
-rw-r--r--src/mame/video/taito_b.cpp6
-rw-r--r--src/mame/video/tc0180vcu.h4
-rw-r--r--src/mame/video/tia.h6
-rw-r--r--src/mame/video/tmc1800.cpp4
-rw-r--r--src/mame/video/tmc600.cpp2
-rw-r--r--src/mame/video/uv201.h6
-rw-r--r--src/mame/video/vsystem_gga.h2
-rw-r--r--src/mame/video/vtvideo.h8
-rw-r--r--src/mame/video/wpc_dmd.h2
-rw-r--r--src/mame/video/ygv608.h4
-rw-r--r--src/mame/video/zx8301.h2
505 files changed, 5353 insertions, 5786 deletions
diff --git a/src/mame/audio/atarijsa.h b/src/mame/audio/atarijsa.h
index f8cef0ca4a4..30e543311f3 100644
--- a/src/mame/audio/atarijsa.h
+++ b/src/mame/audio/atarijsa.h
@@ -38,23 +38,22 @@ DECLARE_DEVICE_TYPE(ATARI_JSA_IIIS, atari_jsa_iiis_device)
#define MCFG_ATARI_JSA_I_ADD(_tag, _intcb) \
MCFG_DEVICE_ADD(_tag, ATARI_JSA_I, 0) \
- devcb = &downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
+ downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
#define MCFG_ATARI_JSA_II_ADD(_tag, _intcb) \
MCFG_DEVICE_ADD(_tag, ATARI_JSA_II, 0) \
- devcb = &downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
+ downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
#define MCFG_ATARI_JSA_III_ADD(_tag, _intcb) \
MCFG_DEVICE_ADD(_tag, ATARI_JSA_III, 0) \
- devcb = &downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
+ downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
#define MCFG_ATARI_JSA_IIIS_ADD(_tag, _intcb) \
MCFG_DEVICE_ADD(_tag, ATARI_JSA_IIIS, 0) \
- devcb = &downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
+ downcast<atari_jsa_base_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
#define MCFG_ATARI_JSA_TEST_PORT(_port, _bitnum) \
- devcb = &downcast<atari_jsa_base_device &>(*device).set_test_read_cb(DEVCB_IOPORT(_port)); \
- MCFG_DEVCB_RSHIFT(_bitnum);
+ downcast<atari_jsa_base_device &>(*device).test_read_cb().set_ioport(_port).bit(_bitnum);
//**************************************************************************
@@ -84,8 +83,9 @@ protected:
public:
// configuration
- template <class Object> devcb_base &set_test_read_cb(Object &&cb) { return m_test_read_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_main_int_cb(Object &&cb) { return m_main_int_cb.set_callback(std::forward<Object>(cb)); }
+ auto test_read_cb() { return m_test_read_cb.bind(); }
+ auto main_int_cb() { return m_main_int_cb.bind(); }
// getters
m6502_device &soundcpu() const { return *m_jsacpu; }
diff --git a/src/mame/audio/cage.h b/src/mame/audio/cage.h
index d54a52888e0..d1202918ac2 100644
--- a/src/mame/audio/cage.h
+++ b/src/mame/audio/cage.h
@@ -17,7 +17,7 @@
#include "sound/dmadac.h"
#define MCFG_ATARI_CAGE_IRQ_CALLBACK(_write) \
- devcb = &downcast<atari_cage_device &>(*device).set_irqhandler_callback(DEVCB_##_write);
+ downcast<atari_cage_device &>(*device).set_irqhandler_callback(DEVCB_##_write);
#define MCFG_ATARI_CAGE_SPEEDUP(_speedup) \
downcast<atari_cage_device &>(*device).set_speedup(_speedup);
diff --git a/src/mame/audio/cmi01a.h b/src/mame/audio/cmi01a.h
index 5f9bbd9f15f..8c8272507ea 100644
--- a/src/mame/audio/cmi01a.h
+++ b/src/mame/audio/cmi01a.h
@@ -16,7 +16,7 @@
#define ENV_DIR_UP 1
#define MCFG_CMI01A_IRQ_CALLBACK(_devcb) \
- devcb = &downcast<cmi01a_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<cmi01a_device &>(*device).set_irq_callback(DEVCB_##_devcb);
class cmi01a_device : public device_t, public device_sound_interface {
public:
diff --git a/src/mame/audio/dsbz80.cpp b/src/mame/audio/dsbz80.cpp
index ea7a83ae824..c521ac825b6 100644
--- a/src/mame/audio/dsbz80.cpp
+++ b/src/mame/audio/dsbz80.cpp
@@ -45,19 +45,20 @@ DEFINE_DEVICE_TYPE(DSBZ80, dsbz80_device, "dsbz80_device", "Sega Z80-based Digit
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(dsbz80_device::device_add_mconfig)
- MCFG_DEVICE_ADD(Z80_TAG, Z80, 4000000) /* unknown clock, but probably pretty slow considering the z80 does like nothing */
- MCFG_DEVICE_PROGRAM_MAP(dsbz80_map)
- MCFG_DEVICE_IO_MAP(dsbz80io_map)
-
- MCFG_DEVICE_ADD("uart", I8251, 4000000)
- MCFG_I8251_RXRDY_HANDLER(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_I8251_TXD_HANDLER(WRITELINE(*this, dsbz80_device, output_txd))
-
- MCFG_CLOCK_ADD("uart_clock", 500000) // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_txc))
-MACHINE_CONFIG_END
+void dsbz80_device::device_add_mconfig(machine_config &config)
+{
+ Z80(config, m_ourcpu, 4000000); // unknown clock, but probably pretty slow considering the z80 does like nothing
+ m_ourcpu->set_addrmap(AS_PROGRAM, &dsbz80_device::dsbz80_map);
+ m_ourcpu->set_addrmap(AS_IO, &dsbz80_device::dsbz80io_map);
+
+ I8251(config, m_uart, 4000000);
+ m_uart->rxrdy_handler().set_inputline(m_ourcpu, INPUT_LINE_IRQ0);
+ m_uart->txd_handler().set(FUNC(dsbz80_device::output_txd));
+
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
+ uart_clock.signal_handler().set("uart", FUNC(i8251_device::write_rxc));
+ uart_clock.signal_handler().append("uart", FUNC(i8251_device::write_txc));
+}
//**************************************************************************
// LIVE DEVICE
diff --git a/src/mame/audio/dsbz80.h b/src/mame/audio/dsbz80.h
index 43f2b0c9fcd..1db717c5484 100644
--- a/src/mame/audio/dsbz80.h
+++ b/src/mame/audio/dsbz80.h
@@ -15,7 +15,7 @@
MCFG_DEVICE_ADD(_tag, DSBZ80, 0)
#define MCFG_DSBZ80_RXD_HANDLER(_devcb) \
- devcb = &downcast<dsbz80_device &>(*device).set_rxd_handler(DEVCB_##_devcb);
+ downcast<dsbz80_device &>(*device).set_rxd_handler(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/audio/efo_zsu.cpp b/src/mame/audio/efo_zsu.cpp
index 0bcb2ea8097..a847c98a177 100644
--- a/src/mame/audio/efo_zsu.cpp
+++ b/src/mame/audio/efo_zsu.cpp
@@ -209,10 +209,10 @@ MACHINE_CONFIG_START(efo_zsu_device::device_add_mconfig)
MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, efo_zsu_device, ctc1_z2_w))
#if 0 // does nothing useful now
- MCFG_DEVICE_ADD("ck1mhz", CLOCK, 4000000/4)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc1", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc1", z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc1", z80ctc_device, trg2))
+ clock_device &ck1mhz(CLOCK(config, "ck1mhz", 4000000/4);
+ ck1mhz.signal_handler().set(m_ctc1, FUNC(z80ctc_device::trg0));
+ ck1mhz.signal_handler().append(m_ctc1, FUNC(z80ctc_device::trg1));
+ ck1mhz.signal_handler().append(m_ctc1, FUNC(z80ctc_device::trg2));
#endif
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
@@ -223,13 +223,13 @@ MACHINE_CONFIG_START(efo_zsu_device::device_add_mconfig)
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd0", AY8910, 4000000/2)
- MCFG_AY8910_PORT_A_WRITE_CB(MEMBANK("rombank")) MCFG_DEVCB_MASK(0x03)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ ay8910_device &aysnd0(AY8910(config, "aysnd0", 4000000/2));
+ aysnd0.port_a_write_callback().set_membank("rombank").mask(0x03);
+ aysnd0.add_route(ALL_OUTPUTS, "mono", 0.5);
- MCFG_DEVICE_ADD("aysnd1", AY8910, 4000000/2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, efo_zsu_device, ay1_porta_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ ay8910_device &aysnd1(AY8910(config, "aysnd1", 4000000/2));
+ aysnd1.port_a_write_callback().set(FUNC(efo_zsu_device::ay1_porta_w));
+ aysnd1.add_route(ALL_OUTPUTS, "mono", 0.5);
MCFG_DEVICE_ADD("fifo", CD40105, 0)
MCFG_40105_DATA_OUT_READY_CB(WRITELINE(*this, efo_zsu_device, fifo_dor_w))
diff --git a/src/mame/audio/exidy.h b/src/mame/audio/exidy.h
index 703c4cd1fe1..b40d4fd489e 100644
--- a/src/mame/audio/exidy.h
+++ b/src/mame/audio/exidy.h
@@ -127,13 +127,13 @@ protected:
};
#define MCFG_EXIDY_VENTURE_WRITEPA_HANDLER(_devcb) \
- devcb = &downcast<venture_sound_device &>(*device).set_pa_callback(DEVCB_##_devcb);
+ downcast<venture_sound_device &>(*device).set_pa_callback(DEVCB_##_devcb);
#define MCFG_EXIDY_VENTURE_WRITEPB_HANDLER(_devcb) \
- devcb = &downcast<venture_sound_device &>(*device).set_pb_callback(DEVCB_##_devcb);
+ downcast<venture_sound_device &>(*device).set_pb_callback(DEVCB_##_devcb);
#define MCFG_EXIDY_VENTURE_CA2_HANDLER(_devcb) \
- devcb = &downcast<venture_sound_device &>(*device).set_ca2_callback(DEVCB_##_devcb);
+ downcast<venture_sound_device &>(*device).set_ca2_callback(DEVCB_##_devcb);
#define MCFG_EXIDY_VENTURE_CB2_HANDLER(_devcb) \
- devcb = &downcast<venture_sound_device &>(*device).set_cb2_callback(DEVCB_##_devcb);
+ downcast<venture_sound_device &>(*device).set_cb2_callback(DEVCB_##_devcb);
class venture_sound_device : public exidy_sh8253_sound_device
{
diff --git a/src/mame/audio/harddriv.cpp b/src/mame/audio/harddriv.cpp
index 70916a3b95f..5bb4c7a4967 100644
--- a/src/mame/audio/harddriv.cpp
+++ b/src/mame/audio/harddriv.cpp
@@ -435,16 +435,16 @@ void harddriv_sound_board_device::driversnd_dsp_io_map(address_map &map)
MACHINE_CONFIG_START(harddriv_sound_board_device::device_add_mconfig)
/* basic machine hardware */
- MCFG_DEVICE_ADD("soundcpu", M68000, XTAL(16'000'000)/2)
- MCFG_DEVICE_PROGRAM_MAP(driversnd_68k_map)
-
- MCFG_DEVICE_ADD("latch", LS259, 0) // 80R
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, harddriv_sound_board_device, speech_write_w)) // SPWR - 5220 write strobe
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, harddriv_sound_board_device, speech_reset_w)) // SPRES - 5220 hard reset
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, harddriv_sound_board_device, speech_rate_w)) // SPRATE
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, harddriv_sound_board_device, cram_enable_w)) // CRAMEN
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("sounddsp", INPUT_LINE_HALT)) MCFG_DEVCB_INVERT // RES320
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, harddriv_sound_board_device, led_w))
+ M68000(config, m_soundcpu, 16_MHz_XTAL/2);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &harddriv_sound_board_device::driversnd_68k_map);
+
+ LS259(config, m_latch, 0); // 80R
+ m_latch->q_out_cb<0>().set(FUNC(harddriv_sound_board_device::speech_write_w)); // SPWR - 5220 write strobe
+ m_latch->q_out_cb<1>().set(FUNC(harddriv_sound_board_device::speech_reset_w)); // SPRES - 5220 hard reset
+ m_latch->q_out_cb<2>().set(FUNC(harddriv_sound_board_device::speech_rate_w)); // SPRATE
+ m_latch->q_out_cb<3>().set(FUNC(harddriv_sound_board_device::cram_enable_w)); // CRAMEN
+ m_latch->q_out_cb<4>().set_inputline(m_sounddsp, INPUT_LINE_HALT).invert(); // RES320
+ m_latch->q_out_cb<7>().set(FUNC(harddriv_sound_board_device::led_w));
MCFG_DEVICE_ADD("sounddsp", TMS32010, XTAL(20'000'000))
MCFG_DEVICE_PROGRAM_MAP(driversnd_dsp_program_map)
diff --git a/src/mame/audio/irem.cpp b/src/mame/audio/irem.cpp
index 88d312bbabc..7898c493a2b 100644
--- a/src/mame/audio/irem.cpp
+++ b/src/mame/audio/irem.cpp
@@ -20,14 +20,14 @@ DEFINE_DEVICE_TYPE(IREM_M52_LARGE_AUDIO, m52_large_audio_device, "m52_large_au
irem_audio_device::irem_audio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
+ , m_cpu(*this, "iremsound")
+ , m_adpcm1(*this, "msm1")
+ , m_adpcm2(*this, "msm2")
, m_port1(0)
, m_port2(0)
, m_soundlatch(0)
- , m_cpu(*this, "iremsound")
, m_ay_45L(*this, "ay_45l")
, m_ay_45M(*this, "ay_45m")
- , m_adpcm1(*this, "msm1")
- , m_adpcm2(*this, "msm2")
, m_audio_BD(*this, "snd_nl:ibd")
, m_audio_SD(*this, "snd_nl:isd")
, m_audio_OH(*this, "snd_nl:ioh")
@@ -431,15 +431,15 @@ MACHINE_CONFIG_START(m62_audio_device::device_add_mconfig)
MCFG_SOUND_ROUTE(1, "snd_nl", 1.0, 4)
MCFG_SOUND_ROUTE(2, "snd_nl", 1.0, 5)
- MCFG_DEVICE_ADD("msm1", MSM5205, XTAL(384'000)) /* verified on pcb */
- MCFG_MSM5205_VCK_CALLBACK(INPUTLINE("iremsound", INPUT_LINE_NMI)) // driven through NPN inverter
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("msm2", msm5205_device, vclk_w)) // the first MSM5205 clocks the second
- MCFG_MSM5205_PRESCALER_SELECTOR(S96_4B) /* default to 4KHz, but can be changed at run time */
- MCFG_SOUND_ROUTE(0, "snd_nl", 1.0, 6)
+ MSM5205(config, m_adpcm1, 384_kHz_XTAL); // verified on PCB
+ m_adpcm1->vck_callback().set_inputline(m_cpu, INPUT_LINE_NMI); // driven through NPN inverter
+ m_adpcm1->vck_callback().append(m_adpcm2, FUNC(msm5205_device::vclk_w)); // the first MSM5205 clocks the second
+ m_adpcm1->set_prescaler_selector(msm5205_device::S96_4B); // default to 4KHz, but can be changed at run time
+ m_adpcm1->add_route(0, "snd_nl", 1.0, 6);
- MCFG_DEVICE_ADD("msm2", MSM5205, XTAL(384'000)) /* verified on pcb */
- MCFG_MSM5205_PRESCALER_SELECTOR(SEX_4B) /* default to 4KHz, but can be changed at run time, slave */
- MCFG_SOUND_ROUTE(0, "snd_nl", 1.0, 7)
+ MSM5205(config, m_adpcm2, 384_kHz_XTAL); // verified on PCB
+ m_adpcm2->set_prescaler_selector(msm5205_device::SEX_4B); // default to 4KHz, but can be changed at run time, slave
+ m_adpcm2->add_route(0, "snd_nl", 1.0, 7);
/* NETLIST configuration using internal AY8910 resistor values */
@@ -530,15 +530,15 @@ MACHINE_CONFIG_START(m52_large_audio_device::device_add_mconfig) /* 10 yard fig
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, irem_audio_device, ay8910_45L_porta_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
- MCFG_DEVICE_ADD("msm1", MSM5205, XTAL(384'000)) /* verified on pcb */
- MCFG_MSM5205_VCK_CALLBACK(INPUTLINE("iremsound", INPUT_LINE_NMI)) // driven through NPN inverter
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("msm2", msm5205_device, vclk_w)) // the first MSM5205 clocks the second
- MCFG_MSM5205_PRESCALER_SELECTOR(S96_4B) /* default to 4KHz, but can be changed at run time */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MSM5205(config, m_adpcm1, 384_kHz_XTAL); // verified on PCB
+ m_adpcm1->vck_callback().set_inputline(m_cpu, INPUT_LINE_NMI); // driven through NPN inverter
+ m_adpcm1->vck_callback().append(m_adpcm2, FUNC(msm5205_device::vclk_w)); // the first MSM5205 clocks the second
+ m_adpcm1->set_prescaler_selector(msm5205_device::S96_4B); // default to 4KHz, but can be changed at run time
+ m_adpcm1->add_route(ALL_OUTPUTS, "mono", 0.80);
- MCFG_DEVICE_ADD("msm2", MSM5205, XTAL(384'000)) /* verified on pcb */
- MCFG_MSM5205_PRESCALER_SELECTOR(SEX_4B) /* default to 4KHz, but can be changed at run time, slave */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MSM5205(config, m_adpcm2, 384_kHz_XTAL); // verified on PCB
+ m_adpcm2->set_prescaler_selector(msm5205_device::SEX_4B); // default to 4KHz, but can be changed at run time, slave
+ m_adpcm2->add_route(ALL_OUTPUTS, "mono", 0.80);
MACHINE_CONFIG_END
diff --git a/src/mame/audio/irem.h b/src/mame/audio/irem.h
index cbe85dd2853..7bbb614e634 100644
--- a/src/mame/audio/irem.h
+++ b/src/mame/audio/irem.h
@@ -39,6 +39,10 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
+ required_device<cpu_device> m_cpu;
+ required_device<msm5205_device> m_adpcm1;
+ optional_device<msm5205_device> m_adpcm2;
+
private:
// internal state
uint8_t m_port1;
@@ -46,11 +50,8 @@ private:
uint8_t m_soundlatch;
- required_device<cpu_device> m_cpu;
required_device<ay8910_device> m_ay_45L;
required_device<ay8910_device> m_ay_45M;
- required_device<msm5205_device> m_adpcm1;
- optional_device<msm5205_device> m_adpcm2;
optional_device<netlist_mame_logic_input_device> m_audio_BD;
optional_device<netlist_mame_logic_input_device> m_audio_SD;
optional_device<netlist_mame_logic_input_device> m_audio_OH;
diff --git a/src/mame/audio/namco52.h b/src/mame/audio/namco52.h
index 97221fb91cb..0412ed14dcb 100644
--- a/src/mame/audio/namco52.h
+++ b/src/mame/audio/namco52.h
@@ -19,10 +19,10 @@
downcast<namco_52xx_device &>(*device).set_extclock(_clock);
#define MCFG_NAMCO_52XX_ROMREAD_CB(_devcb) \
- devcb = &downcast<namco_52xx_device &>(*device).set_romread_callback(DEVCB_##_devcb);
+ downcast<namco_52xx_device &>(*device).set_romread_callback(DEVCB_##_devcb);
#define MCFG_NAMCO_52XX_SI_CB(_devcb) \
- devcb = &downcast<namco_52xx_device &>(*device).set_si_callback(DEVCB_##_devcb);
+ downcast<namco_52xx_device &>(*device).set_si_callback(DEVCB_##_devcb);
class namco_52xx_device : public device_t
diff --git a/src/mame/audio/rad_eu3a05.h b/src/mame/audio/rad_eu3a05.h
index 8dcd61927a4..16325185758 100644
--- a/src/mame/audio/rad_eu3a05.h
+++ b/src/mame/audio/rad_eu3a05.h
@@ -5,7 +5,7 @@
#define MAME_AUDIO_RAD_EU3A05_H
#define MCFG_RADICA6502_SOUND_SPACE_READ_CB(_devcb) \
- devcb = &downcast<radica6502_sound_device &>(*device).set_space_read_callback(DEVCB_##_devcb);
+ downcast<radica6502_sound_device &>(*device).set_space_read_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp
index 12cc48e6b40..4e83f39f723 100644
--- a/src/mame/audio/segag80r.cpp
+++ b/src/mame/audio/segag80r.cpp
@@ -696,7 +696,7 @@ void monsterb_sound_device::device_start()
MACHINE_CONFIG_START(monsterb_sound_device::device_add_mconfig)
/* basic machine hardware */
MCFG_DEVICE_ADD(m_audiocpu, N7751, 6000000)
- MCFG_MCS48_PORT_T1_IN_CB(GND) // labelled as "TEST", connected to ground
+ MCFG_MCS48_PORT_T1_IN_CB(CONSTANT(0)) // labelled as "TEST", connected to ground
MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, monsterb_sound_device, n7751_command_r))
MCFG_MCS48_PORT_BUS_IN_CB(READ8(*this, monsterb_sound_device, n7751_rom_r))
MCFG_MCS48_PORT_P1_OUT_CB(WRITE8("dac", dac_byte_interface, data_w))
diff --git a/src/mame/audio/segam1audio.cpp b/src/mame/audio/segam1audio.cpp
index 85475dc28bb..4638106761a 100644
--- a/src/mame/audio/segam1audio.cpp
+++ b/src/mame/audio/segam1audio.cpp
@@ -80,13 +80,13 @@ MACHINE_CONFIG_START(segam1audio_device::device_add_mconfig)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD(UART_TAG, I8251, 8000000) // T82C51, clock unknown
- MCFG_I8251_RXRDY_HANDLER(INPUTLINE(M68000_TAG, M68K_IRQ_2))
- MCFG_I8251_TXD_HANDLER(WRITELINE(*this, segam1audio_device, output_txd))
+ I8251(config, m_uart, 8000000); // T82C51, clock unknown
+ m_uart->rxrdy_handler().set_inputline(m_audiocpu, M68K_IRQ_2);
+ m_uart->txd_handler().set(FUNC(segam1audio_device::output_txd));
- MCFG_CLOCK_ADD("uart_clock", 500000) // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(UART_TAG, i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(UART_TAG, i8251_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
+ uart_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc));
MACHINE_CONFIG_END
//**************************************************************************
diff --git a/src/mame/audio/segam1audio.h b/src/mame/audio/segam1audio.h
index c31349b5ea2..9dc09cbf84c 100644
--- a/src/mame/audio/segam1audio.h
+++ b/src/mame/audio/segam1audio.h
@@ -15,12 +15,6 @@
#define M1AUDIO_MPCM1_REGION "m1audio:pcm1"
#define M1AUDIO_MPCM2_REGION "m1audio:pcm2"
-#define MCFG_SEGAM1AUDIO_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, SEGAM1AUDIO, 0)
-
-#define MCFG_SEGAM1AUDIO_RXD_HANDLER(_devcb) \
- devcb = &downcast<segam1audio_device &>(*device).set_rxd_handler(DEVCB_##_devcb);
-
//**************************************************************************
// TYPE DEFINITIONS
@@ -33,7 +27,7 @@ public:
segam1audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- template <class Object> devcb_base &set_rxd_handler(Object &&cb) { return m_rxd_handler.set_callback(std::forward<Object>(cb)); }
+ auto rxd_handler() { return m_rxd_handler.bind(); }
DECLARE_WRITE16_MEMBER(m1_snd_mpcm_bnk1_w);
DECLARE_WRITE16_MEMBER(m1_snd_mpcm_bnk2_w);
diff --git a/src/mame/audio/segasnd.h b/src/mame/audio/segasnd.h
index 70551a8e39b..8e0f902a13e 100644
--- a/src/mame/audio/segasnd.h
+++ b/src/mame/audio/segasnd.h
@@ -36,7 +36,7 @@ protected:
#define SEGASND_SEGASPEECH_REGION "segaspeech:speech"
#define MCFG_SEGASPEECH_INT_CALLBACK(_devcb) \
- devcb = &downcast<speech_sound_device&>(*device).set_int_cb(DEVCB_##_devcb);
+ downcast<speech_sound_device&>(*device).set_int_cb(DEVCB_##_devcb);
class speech_sound_device : public device_t, public device_sound_interface
{
diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h
index 546ab085b85..e4c8473ffa3 100644
--- a/src/mame/audio/seibu.h
+++ b/src/mame/audio/seibu.h
@@ -189,10 +189,10 @@ DECLARE_DEVICE_TYPE(SEIBU_ADPCM, seibu_adpcm_device)
downcast<seibu_sound_device &>(*device).set_rombank_tag(_banktag);
#define MCFG_SEIBU_SOUND_YM_READ_CB(_devcb) \
- devcb = &downcast<seibu_sound_device &>(*device).set_ym_read_callback(DEVCB_##_devcb);
+ downcast<seibu_sound_device &>(*device).set_ym_read_callback(DEVCB_##_devcb);
#define MCFG_SEIBU_SOUND_YM_WRITE_CB(_devcb) \
- devcb = &downcast<seibu_sound_device &>(*device).set_ym_write_callback(DEVCB_##_devcb);
+ downcast<seibu_sound_device &>(*device).set_ym_write_callback(DEVCB_##_devcb);
/**************************************************************************/
diff --git a/src/mame/audio/svis_snd.h b/src/mame/audio/svis_snd.h
index 44a40e5de86..802d3019371 100644
--- a/src/mame/audio/svis_snd.h
+++ b/src/mame/audio/svis_snd.h
@@ -17,7 +17,7 @@
//**************************************************************************
#define MCFG_SVISION_SOUND_IRQ_CALLBACK(_devcb) \
- devcb = &downcast<svision_sound_device&>(*device).set_irq_cb(DEVCB_##_devcb);
+ downcast<svision_sound_device&>(*device).set_irq_cb(DEVCB_##_devcb);
// ======================> svision_sound_device
diff --git a/src/mame/audio/tvc.h b/src/mame/audio/tvc.h
index b91a103d784..4555598bca7 100644
--- a/src/mame/audio/tvc.h
+++ b/src/mame/audio/tvc.h
@@ -12,7 +12,7 @@
#pragma once
#define MCFG_TVC_SOUND_SNDINT_CALLBACK(_write) \
- devcb = &downcast<tvc_sound_device &>(*device).set_sndint_wr_callback(DEVCB_##_write);
+ downcast<tvc_sound_device &>(*device).set_sndint_wr_callback(DEVCB_##_write);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/audio/williams.cpp b/src/mame/audio/williams.cpp
index dce51aee1d6..c8968b1085a 100644
--- a/src/mame/audio/williams.cpp
+++ b/src/mame/audio/williams.cpp
@@ -177,25 +177,25 @@ void williams_cvsd_sound_device::williams_cvsd_map(address_map &map)
//-------------------------------------------------
MACHINE_CONFIG_START(williams_cvsd_sound_device::device_add_mconfig)
- MCFG_DEVICE_ADD("cpu", MC6809E, CVSD_MASTER_CLOCK / 4)
+ MCFG_DEVICE_ADD(m_cpu, MC6809E, CVSD_MASTER_CLOCK / 4)
MCFG_DEVICE_PROGRAM_MAP(williams_cvsd_map)
- MCFG_DEVICE_ADD("pia", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(WRITE8("dac", dac_byte_interface, data_w))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(*this, williams_cvsd_sound_device, talkback_w))
- MCFG_PIA_IRQA_HANDLER(INPUTLINE("cpu", M6809_FIRQ_LINE))
- MCFG_PIA_IRQB_HANDLER(INPUTLINE("cpu", INPUT_LINE_NMI))
+ PIA6821(config, m_pia, 0);
+ m_pia->writepa_handler().set("dac", FUNC(dac_byte_interface::data_w));
+ m_pia->writepb_handler().set(FUNC(williams_cvsd_sound_device::talkback_w));
+ m_pia->irqa_handler().set_inputline(m_cpu, M6809_FIRQ_LINE);
+ m_pia->irqb_handler().set_inputline(m_cpu, INPUT_LINE_NMI);
- MCFG_DEVICE_ADD("ym2151", YM2151, CVSD_FM_CLOCK)
- MCFG_YM2151_IRQ_HANDLER(WRITELINE("pia", pia6821_device, ca1_w)) MCFG_DEVCB_INVERT // IRQ is not true state
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.10)
+ ym2151_device &ym(YM2151(config, "ym2151", CVSD_FM_CLOCK));
+ ym.irq_handler().set(m_pia, FUNC(pia6821_device::ca1_w)).invert(); // IRQ is not true state
+ ym.add_route(ALL_OUTPUTS, *this, 0.10);
- MCFG_DEVICE_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
+ MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 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) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
- MCFG_DEVICE_ADD("cvsd", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.60)
+ HC55516(config, m_hc55516, 0);
+ m_hc55516->add_route(ALL_OUTPUTS, *this, 0.60);
MACHINE_CONFIG_END
diff --git a/src/mame/audio/zaccaria.h b/src/mame/audio/zaccaria.h
index 63605b079e6..468e9bd1ec7 100644
--- a/src/mame/audio/zaccaria.h
+++ b/src/mame/audio/zaccaria.h
@@ -25,7 +25,7 @@ DECLARE_DEVICE_TYPE(ZACCARIA_1B11142, zac1b11142_audio_device)
//**************************************************************************
#define MCFG_ZACCARIA_1B11142_SET_ACS_CALLBACK(_devcb) \
- devcb = &downcast<zac1b11142_audio_device &>(device).set_acs_cb(DEVCB_##_devcb);
+ downcast<zac1b11142_audio_device &>(device).set_acs_cb(DEVCB_##_devcb);
diff --git a/src/mame/drivers/24cdjuke.cpp b/src/mame/drivers/24cdjuke.cpp
index b75e5c7ec75..e559e700e18 100644
--- a/src/mame/drivers/24cdjuke.cpp
+++ b/src/mame/drivers/24cdjuke.cpp
@@ -302,9 +302,9 @@ MACHINE_CONFIG_START(midcoin24cdjuke_state::midcoin24cdjuke)
MCFG_I8255_IN_PORTC_CB(READ8(*this, midcoin24cdjuke_state, kb_row_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, midcoin24cdjuke_state, kb_col_w))
- MCFG_DEVICE_ADD("ic31", I8255A, 0)
- MCFG_I8255_OUT_PORTB_CB(LOGGER("PPI8255 - unmapped write port B"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("MD4"))
+ 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");
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/2mindril.cpp b/src/mame/drivers/2mindril.cpp
index e66bd8c98b7..639b2c77c80 100644
--- a/src/mame/drivers/2mindril.cpp
+++ b/src/mame/drivers/2mindril.cpp
@@ -366,12 +366,12 @@ MACHINE_CONFIG_START(_2mindril_state::drill)
//MCFG_DEVICE_PERIODIC_INT_DRIVER(_2mindril_state, drill_device_irq, 60)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_2mindril)
- MCFG_DEVICE_ADD("tc0510nio", TC0510NIO, 0)
- MCFG_TC0510NIO_READ_0_CB(IOPORT("DSW"))
- MCFG_TC0510NIO_READ_1_CB(READ8(*this, _2mindril_state, arm_pwr_r))
- MCFG_TC0510NIO_READ_2_CB(READ8(*this, _2mindril_state, sensors_r))
- MCFG_TC0510NIO_WRITE_4_CB(WRITE8(*this, _2mindril_state, coins_w))
- MCFG_TC0510NIO_READ_7_CB(IOPORT("COINS"))
+ tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
+ tc0510nio.read_0_callback().set_ioport("DSW");
+ tc0510nio.read_1_callback().set(FUNC(_2mindril_state::arm_pwr_r));
+ tc0510nio.read_2_callback().set(FUNC(_2mindril_state::sensors_r));
+ tc0510nio.write_4_callback().set(FUNC(_2mindril_state::coins_w));
+ tc0510nio.read_7_callback().set_ioport("COINS");
MCFG_MACHINE_START_OVERRIDE(_2mindril_state,drill)
MCFG_MACHINE_RESET_OVERRIDE(_2mindril_state,drill)
diff --git a/src/mame/drivers/68ksbc.cpp b/src/mame/drivers/68ksbc.cpp
index f0a4b623010..40d635d8d35 100644
--- a/src/mame/drivers/68ksbc.cpp
+++ b/src/mame/drivers/68ksbc.cpp
@@ -45,6 +45,7 @@ public:
private:
void c68ksbc_mem(address_map &map);
+
required_device<cpu_device> m_maincpu;
};
@@ -62,23 +63,23 @@ static INPUT_PORTS_START( c68ksbc )
INPUT_PORTS_END
-MACHINE_CONFIG_START(c68ksbc_state::c68ksbc)
- /* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 8000000) // text says 8MHz, schematic says 10MHz
- MCFG_DEVICE_PROGRAM_MAP(c68ksbc_mem)
+void c68ksbc_state::c68ksbc(machine_config &config)
+{
+ M68000(config, m_maincpu, 8000000); // text says 8MHz, schematic says 10MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &c68ksbc_state::c68ksbc_mem);
- MCFG_DEVICE_ADD("acia", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
- MCFG_ACIA6850_RTS_HANDLER(WRITELINE("rs232", rs232_port_device, write_rts))
+ acia6850_device &acia(ACIA6850(config, "acia", 0));
+ acia.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
+ acia.rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("acia", acia6850_device, write_rxd))
- MCFG_RS232_CTS_HANDLER(WRITELINE("acia", acia6850_device, write_cts))
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
+ rs232.rxd_handler().set("acia", FUNC(acia6850_device::write_rxd));
+ rs232.cts_handler().set("acia", FUNC(acia6850_device::write_cts));
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc))
-MACHINE_CONFIG_END
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 153600));
+ acia_clock.signal_handler().set("acia", FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append("acia", FUNC(acia6850_device::write_rxc));
+}
/* ROM definition */
ROM_START( 68ksbc )
diff --git a/src/mame/drivers/a7150.cpp b/src/mame/drivers/a7150.cpp
index a93a74d0886..3823d23d656 100644
--- a/src/mame/drivers/a7150.cpp
+++ b/src/mame/drivers/a7150.cpp
@@ -526,17 +526,17 @@ MACHINE_CONFIG_START(a7150_state::a7150)
MCFG_ADDRESS_MAP_BANK_DATA_WIDTH(8)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x10000)
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 1230750)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(Z80CTC_TAG, z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(Z80CTC_TAG, z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(Z80CTC_TAG, z80ctc_device, trg2))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(Z80CTC_TAG, z80ctc_device, trg3))
-
- MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, XTAL(16'000'000)/3)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("gfxcpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE(Z80SIO_TAG, z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(Z80SIO_TAG, z80sio_device, txca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE(Z80SIO_TAG, z80sio_device, rxtxcb_w))
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 1230750));
+ ctc_clock.signal_handler().set(m_ctc, FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg1));
+ ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg2));
+ ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg3));
+
+ Z80CTC(config, m_ctc, 16_MHz_XTAL/3);
+ m_ctc->intr_callback().set_inputline(m_gfxcpu, INPUT_LINE_IRQ0);
+ m_ctc->zc_callback<0>().set(Z80SIO_TAG, FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<0>().append(Z80SIO_TAG, FUNC(z80sio_device::txca_w));
+ m_ctc->zc_callback<1>().set(Z80SIO_TAG, FUNC(z80sio_device::rxtxcb_w));
MCFG_DEVICE_ADD(Z80SIO_TAG, Z80SIO, XTAL(16'000'000)/4)
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("gfxcpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/abc80x.cpp b/src/mame/drivers/abc80x.cpp
index e07fa3a445f..c679698c026 100644
--- a/src/mame/drivers/abc80x.cpp
+++ b/src/mame/drivers/abc80x.cpp
@@ -1059,12 +1059,12 @@ MACHINE_CONFIG_START(abc800_state::common)
MCFG_DEVICE_OPCODES_MAP(abc800_m1)
// peripheral hardware
- MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, ABC800_X01/2/2)
- MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE(*this, abc800_state, ctc_z0_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE(*this, abc800_state, ctc_z1_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE(Z80DART_TAG, z80dart_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(Z80DART_TAG, z80dart_device, txca_w))
+ Z80CTC(config, m_ctc, ABC800_X01/2/2);
+ m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_ctc->zc_callback<0>().set(FUNC(abc800_state::ctc_z0_w));
+ m_ctc->zc_callback<1>().set(FUNC(abc800_state::ctc_z1_w));
+ m_ctc->zc_callback<2>().set(m_dart, FUNC(z80dart_device::rxca_w));
+ m_ctc->zc_callback<2>().append(m_dart, FUNC(z80dart_device::txca_w));
MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_CTC_TAG, abc800_state, ctc_tick, attotime::from_hz(ABC800_X01/2/2/2))
MCFG_DEVICE_ADD(Z80SIO_TAG, Z80SIO, ABC800_X01/2/2)
diff --git a/src/mame/drivers/aerofgt.cpp b/src/mame/drivers/aerofgt.cpp
index bc65f9f4d4d..198ba678bbc 100644
--- a/src/mame/drivers/aerofgt.cpp
+++ b/src/mame/drivers/aerofgt.cpp
@@ -1988,15 +1988,15 @@ MACHINE_CONFIG_START(aerofgt_state::aerofgt)
MCFG_MACHINE_START_OVERRIDE(aerofgt_state,aerofgt)
MCFG_MACHINE_RESET_OVERRIDE(aerofgt_state,aerofgt)
- MCFG_DEVICE_ADD("io", VS9209, 0)
- MCFG_VS9209_IN_PORTA_CB(IOPORT("P1"))
- MCFG_VS9209_IN_PORTB_CB(IOPORT("P2"))
- MCFG_VS9209_IN_PORTC_CB(IOPORT("SYSTEM"))
- MCFG_VS9209_IN_PORTD_CB(IOPORT("DSW1"))
- MCFG_VS9209_IN_PORTE_CB(IOPORT("DSW2"))
- MCFG_VS9209_IN_PORTG_CB(READLINE("soundlatch", generic_latch_8_device, pending_r)) MCFG_DEVCB_BIT(0)
- MCFG_VS9209_OUT_PORTG_CB(WRITELINE("watchdog", mb3773_device, write_line_ck)) MCFG_DEVCB_BIT(7)
- MCFG_VS9209_IN_PORTH_CB(IOPORT("JP1"))
+ vs9209_device &io(VS9209(config, "io", 0));
+ io.porta_input_cb().set_ioport("P1");
+ io.portb_input_cb().set_ioport("P2");
+ io.portc_input_cb().set_ioport("SYSTEM");
+ io.portd_input_cb().set_ioport("DSW1");
+ io.porte_input_cb().set_ioport("DSW2");
+ io.portg_input_cb().set(m_soundlatch, FUNC(generic_latch_8_device::pending_r)).lshift(0);
+ io.portg_output_cb().set("watchdog", FUNC(mb3773_device::write_line_ck)).bit(7);
+ io.porth_input_cb().set_ioport("JP1");
MCFG_DEVICE_ADD("watchdog", MB3773, 0)
diff --git a/src/mame/drivers/alesis.cpp b/src/mame/drivers/alesis.cpp
index 8fe0d4fd534..699e4bb5fb7 100644
--- a/src/mame/drivers/alesis.cpp
+++ b/src/mame/drivers/alesis.cpp
@@ -416,12 +416,12 @@ HD44780_PIXEL_UPDATE(alesis_state::sr16_pixel_update)
MACHINE_CONFIG_START(alesis_state::hr16)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",I8031, 12_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(hr16_mem)
- MCFG_DEVICE_IO_MAP(hr16_io)
- MCFG_MCS51_PORT_P1_IN_CB(IOPORT("SELECT"))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, alesis_state, p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, alesis_state, p3_w))
+ I8031(config, m_maincpu, 12_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &alesis_state::hr16_mem);
+ m_maincpu->set_addrmap(AS_IO, &alesis_state::hr16_io);
+ m_maincpu->port_in_cb<1>().set_ioport("SELECT");
+ m_maincpu->port_in_cb<3>().set(FUNC(alesis_state::p3_r));
+ m_maincpu->port_out_cb<3>().set(FUNC(alesis_state::p3_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", LCD)
@@ -451,11 +451,11 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(alesis_state::sr16)
hr16(config);
+
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(sr16_mem)
- MCFG_DEVICE_IO_MAP(sr16_io)
- MCFG_MCS51_PORT_P1_IN_CB(NOOP)
+ m_maincpu->set_addrmap(AS_PROGRAM, &alesis_state::sr16_mem);
+ m_maincpu->set_addrmap(AS_IO, &alesis_state::sr16_io);
+ m_maincpu->port_in_cb<1>().set_constant(0);
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
@@ -470,12 +470,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(alesis_state::mmt8)
hr16(config);
+
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_IO_MAP(mmt8_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, alesis_state, kb_r))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, alesis_state, mmt8_p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, alesis_state, mmt8_p3_w))
+ m_maincpu->set_addrmap(AS_IO, &alesis_state::mmt8_io);
+ m_maincpu->port_in_cb<1>().set(FUNC(alesis_state::kb_r));
+ m_maincpu->port_in_cb<3>().set(FUNC(alesis_state::mmt8_p3_r));
+ m_maincpu->port_out_cb<3>().set(FUNC(alesis_state::mmt8_p3_w));
MCFG_DEVICE_REMOVE("dm3ag")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/alpha68k.cpp b/src/mame/drivers/alpha68k.cpp
index 8a0cb630e86..4fa7f393a99 100644
--- a/src/mame/drivers/alpha68k.cpp
+++ b/src/mame/drivers/alpha68k.cpp
@@ -2105,10 +2105,10 @@ MACHINE_CONFIG_START(alpha68k_state::alpha68k_II)
MCFG_DEVICE_IO_MAP(sound_portmap)
MCFG_DEVICE_PERIODIC_INT_DRIVER(alpha68k_state, alpha68k_sound_nmi, 7614)
- MCFG_DEVICE_ADD("outlatch", LS259, 0) // 14A
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, alpha68k_state, video_control2_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, alpha68k_state, video_control3_w))
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, alpha68k_state, video_bank_w)) MCFG_DEVCB_MASK(0x70) MCFG_DEVCB_RSHIFT(-4)
+ LS259(config, m_outlatch); // 14A
+ m_outlatch->q_out_cb<2>().set(FUNC(alpha68k_state::video_control2_w));
+ m_outlatch->q_out_cb<3>().set(FUNC(alpha68k_state::video_control3_w));
+ m_outlatch->parallel_out_cb().set(FUNC(alpha68k_state::video_bank_w)).rshift(4).mask(0x07);
MCFG_MACHINE_START_OVERRIDE(alpha68k_state,alpha68k_II)
MCFG_MACHINE_RESET_OVERRIDE(alpha68k_state,alpha68k_II)
diff --git a/src/mame/drivers/alphatpx.cpp b/src/mame/drivers/alphatpx.cpp
index e707af694a1..91848adb5d1 100644
--- a/src/mame/drivers/alphatpx.cpp
+++ b/src/mame/drivers/alphatpx.cpp
@@ -1232,11 +1232,11 @@ MACHINE_CONFIG_START(alphatp_12_state::alphatp2)
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_DEVICE_ADD("crtc", CRT5027, 12.8544_MHz_XTAL / 8)
- MCFG_TMS9927_CHAR_WIDTH(8)
- MCFG_TMS9927_HSYN_CALLBACK(INPUTLINE("maincpu", I8085_RST55_LINE))
- MCFG_TMS9927_VSYN_CALLBACK(INPUTLINE("maincpu", I8085_RST65_LINE)) MCFG_DEVCB_XOR(1)
- MCFG_VIDEO_SET_SCREEN("screen")
+ CRT5027(config, m_crtc, 12.8544_MHz_XTAL / 8);
+ m_crtc->set_char_width(8);
+ m_crtc->hsyn_wr_callback().set_inputline("maincpu", I8085_RST55_LINE);
+ m_crtc->vsyn_wr_callback().set_inputline("maincpu", I8085_RST65_LINE).exor(1);
+ m_crtc->set_screen("screen");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_alphatp3)
@@ -1314,10 +1314,10 @@ MACHINE_CONFIG_START(alphatp_34_state::alphatp3)
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_DEVICE_ADD("crtc", CRT5037, 12.8544_MHz_XTAL / 8)
- MCFG_TMS9927_CHAR_WIDTH(8)
- MCFG_TMS9927_VSYN_CALLBACK(INPUTLINE("maincpu", I8085_RST65_LINE)) MCFG_DEVCB_XOR(1)
- MCFG_VIDEO_SET_SCREEN("screen")
+ CRT5037(config, m_crtc, 12.8544_MHz_XTAL / 8);
+ m_crtc->set_char_width(8);
+ m_crtc->vsyn_wr_callback().set_inputline("maincpu", I8085_RST65_LINE).exor(1);
+ m_crtc->set_screen("screen");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_alphatp3)
@@ -1347,7 +1347,7 @@ MACHINE_CONFIG_START(alphatp_34_state::alphatp30)
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("i8088", 0))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("pit", PIT8253, 0)
MCFG_PIT8253_CLK0(100000) // 15Mhz osc with unknown divisor
diff --git a/src/mame/drivers/alphatro.cpp b/src/mame/drivers/alphatro.cpp
index fcebc5d0290..85f30d5ad6a 100644
--- a/src/mame/drivers/alphatro.cpp
+++ b/src/mame/drivers/alphatro.cpp
@@ -746,9 +746,9 @@ MACHINE_CONFIG_START(alphatro_state::alphatro)
MCFG_DEVICE_ADD("usart", I8251, 0)
MCFG_I8251_TXD_HANDLER(WRITELINE(*this, alphatro_state, txdata_callback))
- MCFG_DEVICE_ADD("usart_clock", CLOCK, 19218) // 19218 to load a real tape, 19222 to load a tape made by this driver
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("usart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("usart", i8251_device, write_rxc))
+ clock_device &usart_clock(CLOCK(config, "usart_clock", 19218)); // 19218 to load a real tape, 19222 to load a tape made by this driver
+ usart_clock.signal_handler().set(m_usart, FUNC(i8251_device::write_txc));
+ usart_clock.signal_handler().append(m_usart, FUNC(i8251_device::write_rxc));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
diff --git a/src/mame/drivers/altair.cpp b/src/mame/drivers/altair.cpp
index 8840e4dda67..8929942a73c 100644
--- a/src/mame/drivers/altair.cpp
+++ b/src/mame/drivers/altair.cpp
@@ -113,9 +113,9 @@ MACHINE_CONFIG_START(altair_state::altair)
MCFG_RS232_DCD_HANDLER(WRITELINE("acia", acia6850_device, write_dcd))
MCFG_RS232_CTS_HANDLER(WRITELINE("acia", acia6850_device, write_cts))
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600) // TODO: this is set using jumpers S3/S2/S1/S0
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600)); // TODO: this is set using jumpers S3/S2/S1/S0
+ uart_clock.signal_handler().set("acia", FUNC(acia6850_device::write_txc));
+ uart_clock.signal_handler().append("acia", FUNC(acia6850_device::write_rxc));
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", altair_state, altair, "bin", 0)
diff --git a/src/mame/drivers/altos2.cpp b/src/mame/drivers/altos2.cpp
index db1272a1d8c..7261f9778a5 100644
--- a/src/mame/drivers/altos2.cpp
+++ b/src/mame/drivers/altos2.cpp
@@ -102,31 +102,32 @@ static const z80_daisy_config daisy_chain[] =
MACHINE_CONFIG_START(altos2_state::altos2)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",Z80, XTAL(4'000'000)) // unknown clock
+ MCFG_DEVICE_ADD(m_maincpu, Z80, XTAL(4'000'000)) // unknown clock
MCFG_DEVICE_PROGRAM_MAP(mem_map)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_Z80_DAISY_CHAIN(daisy_chain)
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 4915200) // ctc & dart connections are guesswork
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg2))
-
- MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(4'000'000))
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("dart1", z80dart_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart1", z80dart_device, rxca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("dart1", z80dart_device, rxtxcb_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("dart2", z80dart_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart2", z80dart_device, txca_w))
-
- MCFG_DEVICE_ADD("dart1", Z80DART, XTAL(4'000'000))
- MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("dart2", Z80DART, XTAL(4'000'000)) // channel B not used for communications
- MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80DART_OUT_DTRB_CB(WRITELINE("novram", x2210_device, store)) MCFG_DEVCB_INVERT // FIXME: no inverter should be needed
-
- MCFG_DEVICE_ADD("novram", X2210, 0)
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 4915200)); // ctc & dart connections are guesswork
+ ctc_clock.signal_handler().set("ctc", FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg1));
+ ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg2));
+
+ z80ctc_device &ctc(Z80CTC(config, "ctc", 4_MHz_XTAL));
+ ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ ctc.zc_callback<0>().set("dart1", FUNC(z80dart_device::txca_w));
+ ctc.zc_callback<0>().append("dart1", FUNC(z80dart_device::rxca_w));
+ ctc.zc_callback<1>().set("dart1", FUNC(z80dart_device::rxtxcb_w));
+ ctc.zc_callback<2>().set("dart2", FUNC(z80dart_device::rxca_w));
+ ctc.zc_callback<2>().append("dart2", FUNC(z80dart_device::txca_w));
+
+ z80dart_device &dart1(Z80DART(config, "dart1", 4_MHz_XTAL));
+ dart1.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+
+ z80dart_device &dart2(Z80DART(config, "dart2", 4_MHz_XTAL)); // channel B not used for communications
+ dart2.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ dart2.out_dtrb_callback().set(m_novram, FUNC(x2210_device::store)).invert(); // FIXME: no inverter should be needed
+
+ X2210(config, m_novram, 0);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL(40'000'000) / 2, 960, 0, 800, 347, 0, 325)
diff --git a/src/mame/drivers/altos486.cpp b/src/mame/drivers/altos486.cpp
index 098386f982b..afa25857d3e 100644
--- a/src/mame/drivers/altos486.cpp
+++ b/src/mame/drivers/altos486.cpp
@@ -132,7 +132,7 @@ void altos486_state::altos486_z80_io(address_map &map)
}
MACHINE_CONFIG_START(altos486_state::altos486)
- MCFG_DEVICE_ADD("maincpu", I80186, XTAL(8'000'000))
+ MCFG_DEVICE_ADD(m_maincpu, I80186, XTAL(8'000'000))
MCFG_DEVICE_PROGRAM_MAP(altos486_mem)
MCFG_DEVICE_IO_MAP(altos486_io)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("pic8259", pic8259_device, inta_cb) // yes, really
@@ -141,10 +141,10 @@ MACHINE_CONFIG_START(altos486_state::altos486)
MCFG_DEVICE_PROGRAM_MAP(altos486_z80_mem)
MCFG_DEVICE_IO_MAP(altos486_z80_io)
- MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE("maincpu", i80186_cpu_device, int0_w))
- MCFG_PIC8259_IN_SP_CB(VCC)
- MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, altos486_state, read_rmx_ack))
+ pic8259_device &pic8259(PIC8259(config, "pic8259", 0));
+ pic8259.out_int_callback().set(m_maincpu, FUNC(i80186_cpu_device::int0_w));
+ pic8259.in_sp_callback().set_constant(1);
+ pic8259.read_slave_ack_callback().set(FUNC(altos486_state::read_rmx_ack));
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
diff --git a/src/mame/drivers/altos5.cpp b/src/mame/drivers/altos5.cpp
index 958a81ed330..746039d0a6e 100644
--- a/src/mame/drivers/altos5.cpp
+++ b/src/mame/drivers/altos5.cpp
@@ -415,10 +415,10 @@ MACHINE_CONFIG_START(altos5_state::altos5)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_Z80_DAISY_CHAIN(daisy_chain_intf)
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 8_MHz_XTAL / 4) // 2MHz
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc" ,z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc" ,z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc" ,z80ctc_device, trg2))
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 8_MHz_XTAL / 4)); // 2MHz
+ ctc_clock.signal_handler().set("ctc", FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg1));
+ ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg2));
/* devices */
MCFG_DEVICE_ADD("dma", Z80DMA, 8_MHz_XTAL / 2)
@@ -454,14 +454,14 @@ MACHINE_CONFIG_START(altos5_state::altos5)
MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs232", rs232_port_device, write_rts))
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("ctc", Z80CTC, 8_MHz_XTAL / 2)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio", z80sio_device, rxtxcb_w)) // SIO Ch B
- MCFG_Z80CTC_ZC1_CB(WRITELINE("dart", z80dart_device, txca_w)) // Z80DART Ch A, SIO Ch A
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart" ,z80dart_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio" ,z80sio_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio" ,z80sio_device, rxca_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("dart", z80dart_device, rxtxcb_w)) // Z80DART Ch B
+ z80ctc_device &ctc(Z80CTC(config, "ctc", 8_MHz_XTAL / 2));
+ ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ ctc.zc_callback<0>().set("sio", FUNC(z80sio_device::rxtxcb_w)); // SIO Ch B
+ ctc.zc_callback<1>().set("dart", FUNC(z80dart_device::txca_w)); // Z80DART Ch A, SIO Ch A
+ ctc.zc_callback<1>().append("dart", FUNC(z80dart_device::rxca_w));
+ ctc.zc_callback<1>().append("sio", FUNC(z80sio_device::txca_w));
+ ctc.zc_callback<1>().append("sio", FUNC(z80sio_device::rxca_w));
+ ctc.zc_callback<2>().set("dart", FUNC(z80dart_device::rxtxcb_w)); // Z80DART Ch B
MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(WRITELINE("sio", z80sio_device, rxb_w))
diff --git a/src/mame/drivers/altos8600.cpp b/src/mame/drivers/altos8600.cpp
index 78565331a70..cdad666251b 100644
--- a/src/mame/drivers/altos8600.cpp
+++ b/src/mame/drivers/altos8600.cpp
@@ -725,7 +725,7 @@ static void altos8600_floppies(device_slot_interface &device)
}
MACHINE_CONFIG_START(altos8600_state::altos8600)
- MCFG_DEVICE_ADD("maincpu", I8086, 5_MHz_XTAL)
+ MCFG_DEVICE_ADD(m_maincpu, I8086, 5_MHz_XTAL)
MCFG_DEVICE_PROGRAM_MAP(cpu_mem)
MCFG_DEVICE_IO_MAP(cpu_io)
MCFG_DEVICE_OPCODES_MAP(code_mem)
@@ -735,25 +735,25 @@ MACHINE_CONFIG_START(altos8600_state::altos8600)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(altos8600_state, inta)
MCFG_I8086_IF_HANDLER(WRITELINE(*this, altos8600_state, cpuif_w))
- MCFG_DEVICE_ADD("dmac", I8089, 5_MHz_XTAL)
+ MCFG_DEVICE_ADD(m_dmac, I8089, 5_MHz_XTAL)
MCFG_DEVICE_PROGRAM_MAP(dmac_mem)
MCFG_DEVICE_IO_MAP(dmac_io)
MCFG_I8089_DATA_WIDTH(16)
MCFG_I8089_SINTR1(WRITELINE(*this, altos8600_state, sintr1_w))
- MCFG_I8089_SINTR2(WRITELINE("pic8259_2", pic8259_device, ir4_w))
+ MCFG_I8089_SINTR2(WRITELINE(m_pic2, pic8259_device, ir4_w))
- MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
- MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, altos8600_state, get_slave_ack))
+ PIC8259(config, m_pic1, 0);
+ m_pic1->out_int_callback().set_inputline(m_maincpu, 0);
+ m_pic1->in_sp_callback().set_constant(1);
+ m_pic1->read_slave_ack_callback().set(FUNC(altos8600_state::get_slave_ack));
- MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_1", pic8259_device, ir2_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ PIC8259(config, m_pic2, 0);
+ m_pic2->out_int_callback().set(m_pic1, FUNC(pic8259_device::ir2_w));
+ m_pic2->in_sp_callback().set_constant(0);
- MCFG_DEVICE_ADD("pic8259_3", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_1", pic8259_device, ir3_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ PIC8259(config, m_pic3, 0);
+ m_pic3->out_int_callback().set(m_pic1, FUNC(pic8259_device::ir3_w));
+ m_pic3->in_sp_callback().set_constant(0);
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("1M")
@@ -780,14 +780,14 @@ MACHINE_CONFIG_START(altos8600_state::altos8600)
MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_DEVICE_ADD("pit", PIT8253, 0)
- MCFG_PIT8253_CLK0(1228800)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("uart8274", i8274_new_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart8274", i8274_new_device, txca_w))
- MCFG_PIT8253_CLK1(1228800)
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("uart8274", i8274_new_device, rxtxcb_w))
- MCFG_PIT8253_CLK2(1228800)
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE("pic8259_1", pic8259_device, ir1_w))
+ pit8253_device &pit(PIT8253(config, "pit", 0));
+ pit.set_clk<0>(1228800);
+ pit.out_handler<0>().set(m_uart8274, FUNC(i8274_new_device::rxca_w));
+ pit.out_handler<0>().append(m_uart8274, FUNC(i8274_new_device::txca_w));
+ pit.set_clk<1>(1228800);
+ pit.out_handler<1>().set(m_uart8274, FUNC(i8274_new_device::rxtxcb_w));
+ pit.set_clk<2>(1228800);
+ pit.out_handler<1>().set(m_pic1, FUNC(pic8259_device::ir1_w));
MCFG_DEVICE_ADD("fd1797", FD1797, 2000000)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE("pic8259_2", pic8259_device, ir1_w))
@@ -797,9 +797,10 @@ MACHINE_CONFIG_START(altos8600_state::altos8600)
MCFG_FLOPPY_DRIVE_ADD("fd1797:2", altos8600_floppies, "8dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1797:3", altos8600_floppies, "8dd", floppy_image_device::default_floppy_formats)
- MCFG_DEVICE_ADD("ics", ACS8600_ICS, "dmac")
- MCFG_ACS8600_ICS_IRQ1(WRITELINE("pic8259_1", pic8259_device, ir5_w))
- MCFG_ACS8600_ICS_IRQ2(WRITELINE("pic8259_1", pic8259_device, ir6_w))
+ ACS8600_ICS(config, m_ics, 0);
+ m_ics->set_host_space(m_dmac, AS_PROGRAM); // TODO: fixme
+ m_ics->irq1_callback().set(m_pic1, FUNC(pic8259_device::ir5_w));
+ m_ics->irq2_callback().set(m_pic1, FUNC(pic8259_device::ir6_w));
MCFG_HARDDISK_ADD("hdd")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index c4f178a0f52..debff0fdf97 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -1381,19 +1381,19 @@ MACHINE_CONFIG_START(amiga_state::amiga_base)
MCFG_VIDEO_START_OVERRIDE(amiga_state, amiga)
// cia
- MCFG_DEVICE_ADD("cia_0", MOS8520, amiga_state::CLK_E_PAL)
- MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(*this, amiga_state, cia_0_irq))
- MCFG_MOS6526_PA_INPUT_CALLBACK(IOPORT("cia_0_port_a"))
- MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(*this, amiga_state, cia_0_port_a_write))
- MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_MOS6526_PC_CALLBACK(WRITELINE("centronics", centronics_device, write_strobe))
- MCFG_MOS6526_SP_CALLBACK(WRITELINE("kbd", amiga_keyboard_bus_device, kdat_in_w)) MCFG_DEVCB_INVERT
-
- MCFG_DEVICE_ADD("cia_1", MOS8520, amiga_state::CLK_E_PAL)
- MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(*this, amiga_state, cia_1_irq))
- MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(*this, amiga_state, cia_1_port_a_read))
- MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(*this, amiga_state, cia_1_port_a_write))
- MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8("fdc", amiga_fdc_device, ciaaprb_w))
+ MOS8520(config, m_cia_0, amiga_state::CLK_E_PAL);
+ m_cia_0->irq_wr_callback().set(FUNC(amiga_state::cia_0_irq));
+ m_cia_0->pa_rd_callback().set_ioport("cia_0_port_a");
+ m_cia_0->pa_wr_callback().set(FUNC(amiga_state::cia_0_port_a_write));
+ m_cia_0->pb_wr_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_cia_0->pc_wr_callback().set(m_centronics, FUNC(centronics_device::write_strobe));
+ m_cia_0->sp_wr_callback().set("kbd", FUNC(amiga_keyboard_bus_device::kdat_in_w)).invert();
+
+ MOS8520(config, m_cia_1, amiga_state::CLK_E_PAL);
+ m_cia_1->irq_wr_callback().set(FUNC(amiga_state::cia_1_irq));
+ m_cia_1->pa_rd_callback().set(FUNC(amiga_state::cia_1_port_a_read));
+ m_cia_1->pa_wr_callback().set(FUNC(amiga_state::cia_1_port_a_write));
+ m_cia_1->pb_wr_callback().set(m_fdc, FUNC(amiga_fdc_device::ciaaprb_w));
// audio
SPEAKER(config, "lspeaker").front_left();
@@ -1618,13 +1618,13 @@ MACHINE_CONFIG_START(cdtv_state::cdtv)
MCFG_TPI6525_OUT_PB_CB(WRITE8(*this, cdtv_state, tpi_port_b_write))
// cd-rom
- MCFG_CR511B_ADD("cdrom")
- MCFG_CR511B_SCOR_HANDLER(WRITELINE("u32", tpi6525_device, i1_w)) MCFG_DEVCB_INVERT
- MCFG_CR511B_STCH_HANDLER(WRITELINE("u32", tpi6525_device, i2_w)) MCFG_DEVCB_INVERT
- MCFG_CR511B_STEN_HANDLER(WRITELINE("u32", tpi6525_device, i3_w))
- MCFG_CR511B_XAEN_HANDLER(WRITELINE("u32", tpi6525_device, pb2_w))
- MCFG_CR511B_DRQ_HANDLER(WRITELINE("u36", amiga_dmac_device, xdreq_w))
- MCFG_CR511B_DTEN_HANDLER(WRITELINE("u36", amiga_dmac_device, xdreq_w))
+ CR511B(config, m_cdrom, 0);
+ m_cdrom->scor_handler().set("u32", FUNC(tpi6525_device::i1_w)).invert();
+ m_cdrom->stch_handler().set("u32", FUNC(tpi6525_device::i2_w)).invert();
+ m_cdrom->sten_handler().set("u32", FUNC(tpi6525_device::i3_w));
+ m_cdrom->xaen_handler().set("u32", FUNC(tpi6525_device::pb2_w));
+ m_cdrom->drq_handler().set("u36", FUNC(amiga_dmac_device::xdreq_w));
+ m_cdrom->dten_handler().set("u36", FUNC(amiga_dmac_device::xdreq_w));
// software
MCFG_SOFTWARE_LIST_ADD("cd_list", "cdtv")
diff --git a/src/mame/drivers/ampro.cpp b/src/mame/drivers/ampro.cpp
index 005ef171d3f..f26e4583856 100644
--- a/src/mame/drivers/ampro.cpp
+++ b/src/mame/drivers/ampro.cpp
@@ -39,8 +39,8 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_dart(*this, "dart")
- , m_ctc (*this, "ctc")
- , m_fdc (*this, "fdc")
+ , m_ctc(*this, "ctc")
+ , m_fdc(*this, "fdc")
, m_floppy0(*this, "fdc:0")
{ }
@@ -160,16 +160,16 @@ MACHINE_CONFIG_START(ampro_state::ampro)
MCFG_Z80_DAISY_CHAIN(daisy_chain_intf)
MCFG_MACHINE_RESET_OVERRIDE(ampro_state, ampro)
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 16_MHz_XTAL / 8) // 2MHz
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg1))
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 16_MHz_XTAL / 8)); // 2MHz
+ ctc_clock.signal_handler().set(m_ctc, FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg1));
/* Devices */
- MCFG_DEVICE_ADD("ctc", Z80CTC, 16_MHz_XTAL / 4)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("dart", z80dart_device, txca_w)) // Z80DART Ch A, SIO Ch A
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart", z80dart_device, rxca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("dart", z80dart_device, rxtxcb_w)) // SIO Ch B
+ Z80CTC(config, m_ctc, 16_MHz_XTAL / 4);
+ m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_ctc->zc_callback<0>().set("dart", FUNC(z80dart_device::txca_w)); // Z80DART Ch A, SIO Ch A
+ m_ctc->zc_callback<0>().append("dart", FUNC(z80dart_device::rxca_w));
+ m_ctc->zc_callback<1>().set("dart", FUNC(z80dart_device::rxtxcb_w)); // SIO Ch B
MCFG_DEVICE_ADD("dart", Z80DART, 16_MHz_XTAL / 4)
MCFG_Z80DART_OUT_TXDA_CB(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/amust.cpp b/src/mame/drivers/amust.cpp
index bdc8dd3dfba..bd8377301a3 100644
--- a/src/mame/drivers/amust.cpp
+++ b/src/mame/drivers/amust.cpp
@@ -415,9 +415,9 @@ MACHINE_CONFIG_START(amust_state::amust)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", amust_floppies, "525qd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart1", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart1", i8251_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
+ uart_clock.signal_handler().set("uart1", FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append("uart1", FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD("uart1", I8251, 0)
MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/apc.cpp b/src/mame/drivers/apc.cpp
index 6457de80048..967b000dcdb 100644
--- a/src/mame/drivers/apc.cpp
+++ b/src/mame/drivers/apc.cpp
@@ -949,14 +949,14 @@ MACHINE_CONFIG_START(apc_state::apc)
MCFG_PIT8253_CLK1(MAIN_CLOCK) /* Memory Refresh */
MCFG_PIT8253_CLK2(MAIN_CLOCK) /* RS-232c */
- MCFG_DEVICE_ADD(m_i8259_m, PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(INPUTLINE(m_maincpu, 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
- MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, apc_state, get_slave_ack))
-
- MCFG_DEVICE_ADD(m_i8259_s, PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE(m_i8259_m, pic8259_device, ir7_w)) // TODO: check ir7_w
- MCFG_PIC8259_IN_SP_CB(GND)
+ PIC8259(config, m_i8259_m, 0);
+ m_i8259_m->out_int_callback().set_inputline(m_maincpu, 0);
+ m_i8259_m->in_sp_callback().set_constant(1);
+ m_i8259_m->read_slave_ack_callback().set(FUNC(apc_state::get_slave_ack));
+
+ PIC8259(config, m_i8259_s, 0);
+ m_i8259_s->out_int_callback().set(m_i8259_m, FUNC(pic8259_device::ir7_w)); // TODO: check ir7_w
+ m_i8259_s->in_sp_callback().set_constant(0);
MCFG_DEVICE_ADD(m_dmac, AM9517A, MAIN_CLOCK)
MCFG_I8237_OUT_HREQ_CB(WRITELINE(*this, apc_state, apc_dma_hrq_changed))
diff --git a/src/mame/drivers/apricot.cpp b/src/mame/drivers/apricot.cpp
index 736f9726a59..d6e03a92627 100644
--- a/src/mame/drivers/apricot.cpp
+++ b/src/mame/drivers/apricot.cpp
@@ -408,15 +408,15 @@ MACHINE_CONFIG_START(apricot_state::apricot)
MCFG_DEVICE_ADD("ic31", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("ic91", 0))
- MCFG_DEVICE_ADD("ic16", PIT8253, 0)
- MCFG_PIT8253_CLK0(4_MHz_XTAL / 16)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("ic31", pic8259_device, ir6_w))
- MCFG_PIT8253_CLK1(4_MHz_XTAL / 2)
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("ic14", ttl153_device, i0a_w))
- MCFG_PIT8253_CLK2(4_MHz_XTAL / 2)
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE("ic14", ttl153_device, i0b_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ic14", ttl153_device, i2a_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ic14", ttl153_device, i2b_w))
+ PIT8253(config, m_pit, 0);
+ m_pit->set_clk<0>(4_MHz_XTAL / 16);
+ m_pit->out_handler<0>().set("ic31", FUNC(pic8259_device::ir6_w));
+ m_pit->set_clk<1>(4_MHz_XTAL / 2);
+ m_pit->out_handler<1>().set("ic14", FUNC(ttl153_device::i0a_w));
+ m_pit->set_clk<2>(4_MHz_XTAL / 2);
+ m_pit->out_handler<2>().set("ic14", FUNC(ttl153_device::i0b_w));
+ m_pit->out_handler<2>().append("ic14", FUNC(ttl153_device::i2a_w));
+ m_pit->out_handler<2>().append("ic14", FUNC(ttl153_device::i2b_w));
MCFG_DEVICE_ADD("ic14", TTL153)
MCFG_TTL153_ZA_CB(WRITELINE("ic15", z80sio_device, rxca_w))
@@ -437,12 +437,12 @@ MACHINE_CONFIG_START(apricot_state::apricot)
MCFG_Z80SIO_OUT_INT_CB(WRITELINE("ic31", pic8259_device, ir5_w))
// rs232 port
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr)
+ RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
// note: missing a receive clock callback to support external clock mode (i1 to 153)
- MCFG_RS232_RXD_HANDLER(WRITELINE("ic15", z80sio_device, rxa_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("ic15", z80sio_device, dcda_w))
- MCFG_RS232_DSR_HANDLER(WRITELINE("ic15", z80sio_device, synca_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("ic15", z80sio_device, ctsa_w)) MCFG_DEVCB_XOR(1)
+ m_rs232->rxd_handler().set(m_sio, FUNC(z80sio_device::rxa_w));
+ m_rs232->dcd_handler().set(m_sio, FUNC(z80sio_device::dcda_w));
+ m_rs232->dsr_handler().set(m_sio, FUNC(z80sio_device::synca_w));
+ m_rs232->cts_handler().set(m_sio, FUNC(z80sio_device::ctsa_w)).invert();
// keyboard
MCFG_APRICOT_KEYBOARD_INTERFACE_ADD("kbd", "hle")
diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp
index d652d35c06d..781a6f42aed 100644
--- a/src/mame/drivers/asteroid.cpp
+++ b/src/mame/drivers/asteroid.cpp
@@ -740,17 +740,17 @@ MACHINE_CONFIG_START(asteroid_state::asteroid_base)
MCFG_WATCHDOG_ADD("watchdog")
- MCFG_DEVICE_ADD("dsw_sel", TTL153)
-
- MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) // LS174 at N11
- MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("led1")) MCFG_DEVCB_INVERT // 2 PLYR START LAMP
- MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("led0")) MCFG_DEVCB_INVERT // 1 PLYR START LAMP
- MCFG_OUTPUT_LATCH_BIT2_HANDLER(MEMBANK("ram1")) // RAMSEL
- MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("ram2"))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, asteroid_state, cocktail_inv_w))
- MCFG_OUTPUT_LATCH_BIT3_HANDLER(WRITELINE(*this, asteroid_state, coin_counter_left_w)) // COIN CNTRL
- MCFG_OUTPUT_LATCH_BIT4_HANDLER(WRITELINE(*this, asteroid_state, coin_counter_center_w)) // COIN CNTRC
- MCFG_OUTPUT_LATCH_BIT5_HANDLER(WRITELINE(*this, asteroid_state, coin_counter_right_w)) // COIN CNTRR
+ TTL153(config, m_dsw_sel);
+
+ output_latch_device &outlatch(OUTPUT_LATCH(config, "outlatch")); // LS174 at N11
+ outlatch.bit_handler<0>().set_output("led1").invert(); // 2 PLYR START LAMP
+ outlatch.bit_handler<1>().set_output("led0").invert(); // 1 PLYR START LAMP
+ outlatch.bit_handler<2>().set_membank("ram1"); // RAMSEL
+ outlatch.bit_handler<2>().append_membank("ram2");
+ outlatch.bit_handler<2>().append(FUNC(asteroid_state::cocktail_inv_w));
+ outlatch.bit_handler<3>().set(FUNC(asteroid_state::coin_counter_left_w)); // COIN CNTRL
+ outlatch.bit_handler<4>().set(FUNC(asteroid_state::coin_counter_center_w)); // COIN CNTRC
+ outlatch.bit_handler<5>().set(FUNC(asteroid_state::coin_counter_right_w)); // COIN CNTRR
/* video hardware */
MCFG_VECTOR_ADD("vector")
@@ -798,15 +798,15 @@ MACHINE_CONFIG_START(asteroid_state::astdelux)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_REMOVE("outlatch")
- MCFG_DEVICE_MODIFY("audiolatch")
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // START1
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // START2
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(MEMBANK("ram1")) // RAMSEL
- MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("ram2"))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, asteroid_state, cocktail_inv_w))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, asteroid_state, coin_counter_left_w)) // LEFT COIN
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, asteroid_state, coin_counter_center_w)) // CENTER COIN
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, asteroid_state, coin_counter_right_w)) // RIGHT COIN
+ ls259_device &audiolatch(*subdevice<ls259_device>("audiolatch"));
+ audiolatch.q_out_cb<0>().set_output("led0").invert(); // START1
+ audiolatch.q_out_cb<1>().set_output("led1").invert(); // START2
+ audiolatch.q_out_cb<4>().set_membank("ram1"); // RAMSEL
+ audiolatch.q_out_cb<4>().append_membank("ram2");
+ audiolatch.q_out_cb<4>().append(FUNC(asteroid_state::cocktail_inv_w));
+ audiolatch.q_out_cb<5>().set(FUNC(asteroid_state::coin_counter_left_w)); // LEFT COIN
+ audiolatch.q_out_cb<6>().set(FUNC(asteroid_state::coin_counter_center_w)); // CENTER COIN
+ audiolatch.q_out_cb<7>().set(FUNC(asteroid_state::coin_counter_right_w)); // RIGHT COIN
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp
index 9924585c5f4..fd54719916e 100644
--- a/src/mame/drivers/astrocde.cpp
+++ b/src/mame/drivers/astrocde.cpp
@@ -1266,23 +1266,23 @@ MACHINE_CONFIG_START(seawolf2_state::seawolf2)
MCFG_DEVICE_PROGRAM_MAP(seawolf2_map)
MCFG_DEVICE_IO_MAP(port_map_discrete)
- MCFG_DEVICE_ADD("lamplatch1", OUTPUT_LATCH, 0) // 74174 on game board at N2
- MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("lamp6")) // right player torpedo 4 available
- MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("lamp5")) // right player torpedo 3 available
- MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lamp4")) // right player torpedo 2 available
- MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("lamp3")) // right player torpedo 1 available
- MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("lamp2")) // right player ready
- MCFG_DEVCB_CHAIN_OUTPUT(OUTPUT("lamp1")) MCFG_DEVCB_INVERT // right player reload (active low)
- MCFG_OUTPUT_LATCH_BIT5_HANDLER(OUTPUT("lamp0")) // right player explosion (hit)
-
- MCFG_DEVICE_ADD("lamplatch2", OUTPUT_LATCH, 0) // 74174 on game board at P2
- MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("lamp13")) // left player torpedo 4 available
- MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("lamp12")) // left player torpedo 3 available
- MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lamp11")) // left player torpedo 2 available
- MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("lamp10")) // left player torpedo 1 available
- MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("lamp9")) // left player ready
- MCFG_DEVCB_CHAIN_OUTPUT(OUTPUT("lamp8")) MCFG_DEVCB_INVERT // left player reload (active low)
- MCFG_OUTPUT_LATCH_BIT5_HANDLER(OUTPUT("lamp7")) // left player explosion (hit)
+ output_latch_device &lamplatch1(OUTPUT_LATCH(config, "lamplatch1")); // 74174 on game board at N2
+ lamplatch1.bit_handler<0>().set_output("lamp6"); // right player torpedo 4 available
+ lamplatch1.bit_handler<1>().set_output("lamp5"); // right player torpedo 3 available
+ lamplatch1.bit_handler<2>().set_output("lamp4"); // right player torpedo 2 available
+ lamplatch1.bit_handler<3>().set_output("lamp3"); // right player torpedo 1 available
+ lamplatch1.bit_handler<4>().set_output("lamp2"); // right player ready
+ lamplatch1.bit_handler<4>().append_output("lamp1").invert(); // right player reload (active low)
+ lamplatch1.bit_handler<5>().set_output("lamp0"); // right player explosion (hit)
+
+ output_latch_device &lamplatch2(OUTPUT_LATCH(config, "lamplatch2")); // 74174 on game board at P2
+ lamplatch2.bit_handler<0>().set_output("lamp13"); // left player torpedo 4 available
+ lamplatch2.bit_handler<1>().set_output("lamp12"); // left player torpedo 3 available
+ lamplatch2.bit_handler<2>().set_output("lamp11"); // left player torpedo 2 available
+ lamplatch2.bit_handler<3>().set_output("lamp10"); // left player torpedo 1 available
+ lamplatch2.bit_handler<4>().set_output("lamp9"); // left player ready
+ lamplatch2.bit_handler<4>().append_output("lamp8").invert(); // left player reload (active low)
+ lamplatch2.bit_handler<5>().set_output("lamp7"); // left player explosion (hit)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/asuka.cpp b/src/mame/drivers/asuka.cpp
index 1da7f2756e5..5cc1f8158c2 100644
--- a/src/mame/drivers/asuka.cpp
+++ b/src/mame/drivers/asuka.cpp
@@ -913,13 +913,13 @@ MACHINE_CONFIG_START(asuka_state::asuka)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("tc0220ioc", TC0220IOC, 0)
- MCFG_TC0220IOC_READ_0_CB(IOPORT("DSWA"))
- MCFG_TC0220IOC_READ_1_CB(IOPORT("DSWB"))
- MCFG_TC0220IOC_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0220IOC_READ_3_CB(IOPORT("IN1"))
- MCFG_TC0220IOC_WRITE_4_CB(WRITE8(*this, asuka_state, coin_control_w))
- MCFG_TC0220IOC_READ_7_CB(IOPORT("IN2"))
+ TC0220IOC(config, m_tc0220ioc, 0);
+ m_tc0220ioc->read_0_callback().set_ioport("DSWA");
+ m_tc0220ioc->read_1_callback().set_ioport("DSWB");
+ m_tc0220ioc->read_2_callback().set_ioport("IN0");
+ m_tc0220ioc->read_3_callback().set_ioport("IN1");
+ m_tc0220ioc->write_4_callback().set(FUNC(asuka_state::coin_control_w));
+ m_tc0220ioc->read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -951,11 +951,11 @@ MACHINE_CONFIG_START(asuka_state::asuka)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(16'000'000)/4) /* verified on pcb */
- MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_YM2151_PORT_WRITE_HANDLER(MEMBANK("audiobank")) MCFG_DEVCB_MASK(0x03)
- MCFG_SOUND_ROUTE(0, "mono", 0.50)
- MCFG_SOUND_ROUTE(1, "mono", 0.50)
+ ym2151_device &ymsnd(YM2151(config, "ymsnd", 16_MHz_XTAL/4)); // verified on PCB
+ ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
+ ymsnd.port_write_handler().set_membank(m_audiobank).mask(0x03);
+ ymsnd.add_route(0, "mono", 0.50);
+ ymsnd.add_route(1, "mono", 0.50);
MCFG_DEVICE_ADD("msm", MSM5205, XTAL(384'000)) /* verified on pcb */
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, asuka_state, asuka_msm5205_vck)) /* VCK function */
@@ -987,13 +987,13 @@ MACHINE_CONFIG_START(asuka_state::cadash)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("tc0220ioc", TC0220IOC, 0)
- MCFG_TC0220IOC_READ_0_CB(IOPORT("DSWA"))
- MCFG_TC0220IOC_READ_1_CB(IOPORT("DSWB"))
- MCFG_TC0220IOC_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0220IOC_READ_3_CB(IOPORT("IN1"))
- MCFG_TC0220IOC_WRITE_4_CB(WRITE8(*this, asuka_state, coin_control_w))
- MCFG_TC0220IOC_READ_7_CB(IOPORT("IN2"))
+ TC0220IOC(config, m_tc0220ioc, 0);
+ m_tc0220ioc->read_0_callback().set_ioport("DSWA");
+ m_tc0220ioc->read_1_callback().set_ioport("DSWB");
+ m_tc0220ioc->read_2_callback().set_ioport("IN0");
+ m_tc0220ioc->read_3_callback().set_ioport("IN1");
+ m_tc0220ioc->write_4_callback().set(FUNC(asuka_state::coin_control_w));
+ m_tc0220ioc->read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1026,11 +1026,11 @@ MACHINE_CONFIG_START(asuka_state::cadash)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(8'000'000)/2) /* verified on pcb */
- MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_YM2151_PORT_WRITE_HANDLER(MEMBANK("audiobank")) MCFG_DEVCB_MASK(0x03)
- MCFG_SOUND_ROUTE(0, "mono", 0.50)
- MCFG_SOUND_ROUTE(1, "mono", 0.50)
+ ym2151_device &ymsnd(YM2151(config, "ymsnd", 8_MHz_XTAL/2)); // verified on PCB
+ ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
+ ymsnd.port_write_handler().set_membank(m_audiobank).mask(0x03);
+ ymsnd.add_route(0, "mono", 0.50);
+ ymsnd.add_route(1, "mono", 0.50);
MCFG_DEVICE_ADD("ciu", PC060HA, 0)
MCFG_PC060HA_MASTER_CPU("maincpu")
@@ -1050,13 +1050,13 @@ MACHINE_CONFIG_START(asuka_state::mofflott)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("tc0220ioc", TC0220IOC, 0)
- MCFG_TC0220IOC_READ_0_CB(IOPORT("DSWA"))
- MCFG_TC0220IOC_READ_1_CB(IOPORT("DSWB"))
- MCFG_TC0220IOC_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0220IOC_READ_3_CB(IOPORT("IN1"))
- MCFG_TC0220IOC_WRITE_4_CB(WRITE8(*this, asuka_state, coin_control_w))
- MCFG_TC0220IOC_READ_7_CB(IOPORT("IN2"))
+ TC0220IOC(config, m_tc0220ioc, 0);
+ m_tc0220ioc->read_0_callback().set_ioport("DSWA");
+ m_tc0220ioc->read_1_callback().set_ioport("DSWB");
+ m_tc0220ioc->read_2_callback().set_ioport("IN0");
+ m_tc0220ioc->read_3_callback().set_ioport("IN1");
+ m_tc0220ioc->write_4_callback().set(FUNC(asuka_state::coin_control_w));
+ m_tc0220ioc->read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1088,11 +1088,11 @@ MACHINE_CONFIG_START(asuka_state::mofflott)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymsnd", YM2151, 4000000)
- MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_YM2151_PORT_WRITE_HANDLER(MEMBANK("audiobank")) MCFG_DEVCB_MASK(0x03)
- MCFG_SOUND_ROUTE(0, "mono", 0.50)
- MCFG_SOUND_ROUTE(1, "mono", 0.50)
+ ym2151_device &ymsnd(YM2151(config, "ymsnd", 4000000));
+ ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
+ ymsnd.port_write_handler().set_membank(m_audiobank).mask(0x03);
+ ymsnd.add_route(0, "mono", 0.50);
+ ymsnd.add_route(1, "mono", 0.50);
MCFG_DEVICE_ADD("msm", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, asuka_state, asuka_msm5205_vck)) /* VCK function */
@@ -1120,13 +1120,13 @@ MACHINE_CONFIG_START(asuka_state::eto)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("tc0220ioc", TC0220IOC, 0)
- MCFG_TC0220IOC_READ_0_CB(IOPORT("DSWA"))
- MCFG_TC0220IOC_READ_1_CB(IOPORT("DSWB"))
- MCFG_TC0220IOC_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0220IOC_READ_3_CB(IOPORT("IN1"))
- MCFG_TC0220IOC_WRITE_4_CB(WRITE8(*this, asuka_state, coin_control_w))
- MCFG_TC0220IOC_READ_7_CB(IOPORT("IN2"))
+ TC0220IOC(config, m_tc0220ioc, 0);
+ m_tc0220ioc->read_0_callback().set_ioport("DSWA");
+ m_tc0220ioc->read_1_callback().set_ioport("DSWB");
+ m_tc0220ioc->read_2_callback().set_ioport("IN0");
+ m_tc0220ioc->read_3_callback().set_ioport("IN1");
+ m_tc0220ioc->write_4_callback().set(FUNC(asuka_state::coin_control_w));
+ m_tc0220ioc->read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1158,11 +1158,11 @@ MACHINE_CONFIG_START(asuka_state::eto)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymsnd", YM2151, 4000000)
- MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_YM2151_PORT_WRITE_HANDLER(MEMBANK("audiobank")) MCFG_DEVCB_MASK(0x03)
- MCFG_SOUND_ROUTE(0, "mono", 0.50)
- MCFG_SOUND_ROUTE(1, "mono", 0.50)
+ ym2151_device &ymsnd(YM2151(config, "ymsnd", 4000000));
+ ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
+ ymsnd.port_write_handler().set_membank(m_audiobank).mask(0x03);
+ ymsnd.add_route(0, "mono", 0.50);
+ ymsnd.add_route(1, "mono", 0.50);
MCFG_DEVICE_ADD("ciu", PC060HA, 0)
MCFG_PC060HA_MASTER_CPU("maincpu")
diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp
index b0131e09b30..075a04326b0 100644
--- a/src/mame/drivers/atarist.cpp
+++ b/src/mame/drivers/atarist.cpp
@@ -2055,9 +2055,9 @@ MACHINE_CONFIG_START(st_state::st)
// devices
- MCFG_DEVICE_ADD(WD1772_TAG, WD1772, Y2/4)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, st_state, fdc_drq_w))
+ WD1772(config, m_fdc, Y2/4);
+ m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert();
+ m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w));
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, nullptr, st_state::floppy_formats)
@@ -2146,9 +2146,9 @@ MACHINE_CONFIG_START(megast_state::megast)
// devices
MCFG_DEVICE_ADD(RP5C15_TAG, RP5C15, XTAL(32'768))
- MCFG_DEVICE_ADD(WD1772_TAG, WD1772, Y2/4)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, st_state, fdc_drq_w))
+ WD1772(config, m_fdc, Y2/4);
+ m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert();
+ m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w));
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, nullptr, st_state::floppy_formats)
@@ -2245,9 +2245,9 @@ MACHINE_CONFIG_START(ste_state::ste)
// devices
- MCFG_DEVICE_ADD(WD1772_TAG, WD1772, Y2/4)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, st_state, fdc_drq_w))
+ WD1772(config, m_fdc, Y2/4);
+ m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert();
+ m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w));
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, nullptr, st_state::floppy_formats)
@@ -2359,9 +2359,9 @@ static MACHINE_CONFIG_START(stbook_state::stbook)
MCFG_MC68901_OUT_TDO_CB(WRITELINE(*this, st_state, mfp_tdo_w))
MCFG_MC68901_OUT_SO_CB(WRITELINE(RS232_TAG, rs232_port_device, write_txd))
- MCFG_DEVICE_ADD(WD1772_TAG, WD1772, U517/2)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, st_state, fdc_drq_w))
+ WD1772(config, m_fdc, U517/2);
+ m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert();
+ m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w));
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", 0, st_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, 0, 0, st_state::floppy_formats)
diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp
index 6bd68569a54..40a6027420c 100644
--- a/src/mame/drivers/atarisy1.cpp
+++ b/src/mame/drivers/atarisy1.cpp
@@ -736,12 +736,12 @@ MACHINE_CONFIG_START(atarisy1_state::atarisy1)
MCFG_EEPROM_2804_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
- MCFG_DEVICE_ADD("outlatch", LS259, 0) // 15H (TTL) or 14F (LSI)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("ymsnd", ym2151_device, reset_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // J106 pin 4
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // J106 pin 3
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, atarisy1_state, coin_counter_right_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, atarisy1_state, coin_counter_left_w))
+ LS259(config, m_outlatch); // 15H (TTL) or 14F (LSI)
+ m_outlatch->q_out_cb<0>().set("ymsnd", FUNC(ym2151_device::reset_w));
+ m_outlatch->q_out_cb<4>().set_output("led0").invert(); // J106 pin 4
+ m_outlatch->q_out_cb<5>().set_output("led1").invert(); // J106 pin 3
+ m_outlatch->q_out_cb<6>().set(FUNC(atarisy1_state::coin_counter_right_w));
+ m_outlatch->q_out_cb<7>().set(FUNC(atarisy1_state::coin_counter_left_w));
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/attache.cpp b/src/mame/drivers/attache.cpp
index 97d38b2366e..9182cdfdce1 100644
--- a/src/mame/drivers/attache.cpp
+++ b/src/mame/drivers/attache.cpp
@@ -1162,15 +1162,15 @@ MACHINE_CONFIG_START(attache_state::attache)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio", z80sio_device, rxb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("ctc", Z80CTC, 8_MHz_XTAL / 2)
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, txca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio", z80sio_device, rxtxcb_w))
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80CTC(config, m_ctc, 8_MHz_XTAL / 2);
+ m_ctc->zc_callback<0>().set(m_sio, FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<0>().append(m_sio, FUNC(z80sio_device::txca_w));
+ m_ctc->zc_callback<1>().set(m_sio, FUNC(z80sio_device::rxtxcb_w));
+ m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("brc", CLOCK, 8_MHz_XTAL / 26) // 307.692 KHz
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg1))
+ clock_device &brc(CLOCK(config, "brc", 8_MHz_XTAL / 26)); // 307.692 KHz
+ brc.signal_handler().set(m_ctc, FUNC(z80ctc_device::trg0));
+ brc.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg1));
MCFG_DEVICE_ADD("dma", AM9517A, 8_MHz_XTAL / 4)
MCFG_AM9517A_OUT_HREQ_CB(WRITELINE(*this, attache_state, hreq_w))
@@ -1181,11 +1181,11 @@ MACHINE_CONFIG_START(attache_state::attache)
MCFG_AM9517A_OUT_IOW_0_CB(WRITE8(*this, attache_state, fdc_dma_w))
// MCFG_AM9517A_OUT_DACK_0_CB(WRITELINE(*this, attache_state, fdc_dack_w))
- MCFG_UPD765A_ADD("fdc", true, true)
- MCFG_UPD765_INTRQ_CALLBACK(WRITELINE("ctc", z80ctc_device, trg3))
- MCFG_UPD765_DRQ_CALLBACK(WRITELINE("dma", am9517a_device, dreq0_w)) MCFG_DEVCB_INVERT
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", attache_floppies, "525dd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", attache_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ UPD765A(config, m_fdc, true, true);
+ m_fdc->intrq_wr_callback().set(m_ctc, FUNC(z80ctc_device::trg3));
+ m_fdc->drq_wr_callback().set(m_dma, FUNC(am9517a_device::dreq0_w)).invert();
+ FLOPPY_CONNECTOR(config, "fdc:0", attache_floppies, "525dd", floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:1", attache_floppies, "525dd", floppy_image_device::default_floppy_formats);
MCFG_DEVICE_ADD("crtc", TMS9927, 12324000 / 8)
MCFG_TMS9927_CHAR_WIDTH(8)
@@ -1246,22 +1246,22 @@ MACHINE_CONFIG_START(attache816_state::attache816)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio", z80sio_device, rxb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("ctc", Z80CTC, 8_MHz_XTAL / 2)
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, txca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio", z80sio_device, rxtxcb_w))
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80CTC(config, m_ctc, 8_MHz_XTAL / 2);
+ m_ctc->zc_callback<0>().set(m_sio, FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<0>().append(m_sio, FUNC(z80sio_device::txca_w));
+ m_ctc->zc_callback<1>().set(m_sio, FUNC(z80sio_device::rxtxcb_w));
+ m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- MCFG_DEVICE_ADD("brc", CLOCK, 8_MHz_XTAL / 26) // 307.692 KHz
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg1))
+ clock_device &brc(CLOCK(config, "brc", 8_MHz_XTAL / 26)); // 307.692 KHz
+ brc.signal_handler().set(m_ctc, FUNC(z80ctc_device::trg0));
+ brc.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg1));
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, attache816_state, x86_comms_w))
- MCFG_I8255_IN_PORTA_CB(READ8(*this, attache816_state, x86_comms_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, attache816_state, x86_irq_enable))
- MCFG_I8255_OUT_PORTC_CB(WRITELINE(*this, attache816_state, x86_dsr)) MCFG_DEVCB_BIT(0)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, attache816_state, ppi_irq)) MCFG_DEVCB_BIT(7) MCFG_DEVCB_INVERT
+ I8255A(config, m_ppi, 0);
+ m_ppi->out_pa_callback().set(FUNC(attache816_state::x86_comms_w));
+ m_ppi->in_pa_callback().set(FUNC(attache816_state::x86_comms_r));
+ m_ppi->out_pb_callback().set(FUNC(attache816_state::x86_irq_enable));
+ m_ppi->out_pc_callback().set(FUNC(attache816_state::x86_dsr)).bit(0);
+ m_ppi->out_pc_callback().append(FUNC(attache816_state::ppi_irq)).bit(7).invert();
MCFG_DEVICE_ADD("dma", AM9517A, 8_MHz_XTAL / 4)
MCFG_AM9517A_OUT_HREQ_CB(WRITELINE(*this, attache_state, hreq_w))
@@ -1272,11 +1272,11 @@ MACHINE_CONFIG_START(attache816_state::attache816)
MCFG_AM9517A_OUT_IOW_0_CB(WRITE8(*this, attache_state, fdc_dma_w))
// MCFG_AM9517A_OUT_DACK_0_CB(WRITELINE(*this, attache_state, fdc_dack_w))
- MCFG_UPD765A_ADD("fdc", true, true)
- MCFG_UPD765_INTRQ_CALLBACK(WRITELINE("ctc", z80ctc_device, trg3))
- MCFG_UPD765_DRQ_CALLBACK(WRITELINE("dma", am9517a_device, dreq0_w)) MCFG_DEVCB_INVERT
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", attache_floppies, "525dd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", attache_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ UPD765A(config, m_fdc, true, true);
+ m_fdc->intrq_wr_callback().set(m_ctc, FUNC(z80ctc_device::trg3));
+ m_fdc->drq_wr_callback().set(m_dma, FUNC(am9517a_device::dreq0_w)).invert();
+ FLOPPY_CONNECTOR(config, "fdc:0", attache_floppies, "525dd", floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:1", attache_floppies, "525dd", floppy_image_device::default_floppy_formats);
MCFG_DEVICE_ADD("crtc", TMS9927, 12324000)
MCFG_TMS9927_CHAR_WIDTH(8)
diff --git a/src/mame/drivers/aussiebyte.cpp b/src/mame/drivers/aussiebyte.cpp
index b6ba84a6b58..82932a19a88 100644
--- a/src/mame/drivers/aussiebyte.cpp
+++ b/src/mame/drivers/aussiebyte.cpp
@@ -526,20 +526,20 @@ MACHINE_CONFIG_START(aussiebyte_state::aussiebyte)
MCFG_DEVICE_ADD("cent_data_in", INPUT_BUFFER, 0)
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 4.9152_MHz_XTAL / 4)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg2))
-
- MCFG_DEVICE_ADD("ctc", Z80CTC, 16_MHz_XTAL / 4)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio1", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1", z80sio_device, txca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio1", z80sio_device, rxtxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2", z80sio_device, txca_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, aussiebyte_state, ctc_z2_w)) // SIO2 Ch B, CTC Ch 3
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2", z80sio_device, rxtxcb_w))
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 4.9152_MHz_XTAL / 4));
+ ctc_clock.signal_handler().set(m_ctc, FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg1));
+ ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg2));
+
+ Z80CTC(config, m_ctc, 16_MHz_XTAL / 4);
+ m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_ctc->zc_callback<0>().set("sio1", FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<0>().append("sio1", FUNC(z80sio_device::txca_w));
+ m_ctc->zc_callback<1>().set("sio1", FUNC(z80sio_device::rxtxcb_w));
+ m_ctc->zc_callback<1>().append("sio2", FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<1>().append("sio2", FUNC(z80sio_device::txca_w));
+ m_ctc->zc_callback<2>().set(FUNC(aussiebyte_state::ctc_z2_w)); // SIO2 Ch B, CTC Ch 3
+ m_ctc->zc_callback<2>().append("sio2", FUNC(z80sio_device::rxtxcb_w));
MCFG_DEVICE_ADD("dma", Z80DMA, 16_MHz_XTAL / 4)
MCFG_Z80DMA_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
@@ -550,11 +550,11 @@ MACHINE_CONFIG_START(aussiebyte_state::aussiebyte)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, aussiebyte_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, aussiebyte_state, io_write_byte))
- MCFG_DEVICE_ADD("pio1", Z80PIO, 16_MHz_XTAL / 4)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_Z80PIO_IN_PB_CB(READ8("cent_data_in", input_buffer_device, bus_r))
- MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(m_centronics, centronics_device, write_strobe)) MCFG_DEVCB_INVERT
+ Z80PIO(config, m_pio1, 16_MHz_XTAL / 4);
+ m_pio1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_pio1->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_pio1->in_pb_callback().set("cent_data_in", FUNC(input_buffer_device::bus_r));
+ m_pio1->out_ardy_callback().set(m_centronics, FUNC(centronics_device::write_strobe)).invert();
MCFG_DEVICE_ADD("pio2", Z80PIO, 16_MHz_XTAL / 4)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/avt.cpp b/src/mame/drivers/avt.cpp
index 02a69d01aa0..20536778729 100644
--- a/src/mame/drivers/avt.cpp
+++ b/src/mame/drivers/avt.cpp
@@ -981,11 +981,12 @@ MACHINE_CONFIG_START(avt_state::avt)
MCFG_PALETTE_ADD("palette", 8*16)
MCFG_PALETTE_INIT_OWNER(avt_state, avt)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) /* guess */
- MCFG_MC6845_SHOW_BORDER_AREA(false)
- MCFG_MC6845_CHAR_WIDTH(8)
- MCFG_MC6845_OUT_VSYNC_CB(WRITELINE("ctc0", z80ctc_device, trg3))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, avt_state, avtbingo_w))
+ mc6845_device &crtc(MC6845(config, "crtc", CRTC_CLOCK)); // guess
+ crtc.set_screen("screen");
+ crtc.set_show_border_area(false);
+ crtc.set_char_width(8);
+ crtc.out_vsync_callback().set("ctc0", FUNC(z80ctc_device::trg3));
+ crtc.out_vsync_callback().append(FUNC(avt_state::avtbingo_w));
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -1018,15 +1019,16 @@ WRITE_LINE_MEMBER( avt_state::avtnfl_w )
m_pio1->port_b_write((m_pio1->port_b_read() & 0xbf) | (state ? 0x40 : 0));
}
-MACHINE_CONFIG_START(avt_state::avtnfl)
+void avt_state::avtnfl(machine_config &config)
+{
avt(config);
- MCFG_DEVICE_REMOVE("crtc")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) /* guess */
- MCFG_MC6845_SHOW_BORDER_AREA(false)
- MCFG_MC6845_CHAR_WIDTH(8)
- MCFG_MC6845_OUT_VSYNC_CB(WRITELINE("ctc0", z80ctc_device, trg3))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, avt_state, avtnfl_w))
-MACHINE_CONFIG_END
+ mc6845_device &crtc(MC6845(config.replace(), "crtc", CRTC_CLOCK)); // guess
+ crtc.set_screen("screen");
+ crtc.set_show_border_area(false);
+ crtc.set_char_width(8);
+ crtc.out_vsync_callback().set("ctc0", FUNC(z80ctc_device::trg3));
+ crtc.out_vsync_callback().append(FUNC(avt_state::avtnfl_w));
+}
/*********************************************
* Rom Load *
diff --git a/src/mame/drivers/balsente.cpp b/src/mame/drivers/balsente.cpp
index d10470bd42a..3c3af0fe6cf 100644
--- a/src/mame/drivers/balsente.cpp
+++ b/src/mame/drivers/balsente.cpp
@@ -1315,20 +1315,20 @@ MACHINE_CONFIG_START(balsente_state::balsente)
MCFG_DEVICE_PROGRAM_MAP(cpu2_map)
MCFG_DEVICE_IO_MAP(cpu2_io_map)
- MCFG_DEVICE_ADD("acia", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE("audiouart", acia6850_device, write_rxd))
- MCFG_ACIA6850_IRQ_HANDLER(INPUTLINE("maincpu", M6809_FIRQ_LINE))
-
- MCFG_DEVICE_ADD("audiouart", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE("acia", acia6850_device, write_rxd))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, balsente_state, uint_w))
-
- MCFG_DEVICE_ADD("uartclock", CLOCK, 8_MHz_XTAL / 16) // 500 kHz
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, balsente_state, uint_propagate_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("audiouart", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("audiouart", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_txc)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc)) MCFG_DEVCB_INVERT
+ ACIA6850(config, m_acia, 0);
+ m_acia->txd_handler().set(m_audiouart, FUNC(acia6850_device::write_rxd));
+ m_acia->irq_handler().set_inputline(m_maincpu, M6809_FIRQ_LINE);
+
+ ACIA6850(config, m_audiouart, 0);
+ m_audiouart->txd_handler().set(m_acia, FUNC(acia6850_device::write_rxd));
+ m_audiouart->irq_handler().set([this] (int state) { m_uint = bool(state); });
+
+ clock_device &uartclock(CLOCK(config, "uartclock", 8_MHz_XTAL / 16)); // 500 kHz
+ uartclock.signal_handler().set(FUNC(balsente_state::uint_propagate_w));
+ uartclock.signal_handler().append(m_audiouart, FUNC(acia6850_device::write_txc));
+ uartclock.signal_handler().append(m_audiouart, FUNC(acia6850_device::write_rxc));
+ uartclock.signal_handler().append(m_acia, FUNC(acia6850_device::write_txc)).invert();
+ uartclock.signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc)).invert();
MCFG_X2212_ADD_AUTOSAVE("nov0") // system NOVRAM
MCFG_X2212_ADD_AUTOSAVE("nov1") // cart NOVRAM
diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp
index a4e0c6d9b03..32875e01502 100644
--- a/src/mame/drivers/bbc.cpp
+++ b/src/mame/drivers/bbc.cpp
@@ -953,8 +953,8 @@ MACHINE_CONFIG_START(bbc_state::bbcb)
MCFG_UPD7002_EOC_CB(bbc_state, BBC_uPD7002_EOC)
/* printer */
- MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer")
- MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("via6522_1", via6522_device, write_ca1)) MCFG_DEVCB_INVERT /* ack seems to be inverted? */
+ centronics_device &centronics(CENTRONICS(config, "centronics", centronics_devices, "printer"));
+ centronics.ack_handler().set("via6522_1", FUNC(via6522_device::write_ca1)).invert(); // ack seems to be inverted?
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
/* fdc */
@@ -1352,8 +1352,8 @@ MACHINE_CONFIG_START(bbc_state::bbcm)
MCFG_DEVICE_ADD("rtc", MC146818, 32.768_kHz_XTAL)
/* printer */
- MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer")
- MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("via6522_1", via6522_device, write_ca1)) MCFG_DEVCB_INVERT /* ack seems to be inverted? */
+ centronics_device &centronics(CENTRONICS(config, "centronics", centronics_devices, "printer"));
+ centronics.ack_handler().set("via6522_1", FUNC(via6522_device::write_ca1)).invert(); // ack seems to be inverted?
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
/* cassette */
diff --git a/src/mame/drivers/bbusters.cpp b/src/mame/drivers/bbusters.cpp
index 4cab0f3c6ee..22972485c9d 100644
--- a/src/mame/drivers/bbusters.cpp
+++ b/src/mame/drivers/bbusters.cpp
@@ -667,14 +667,14 @@ MACHINE_CONFIG_START(bbusters_state::bbusters)
MCFG_NVRAM_ADD_0FILL("eeprom")
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(bbusters_state, screen_update_bbuster)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram16_device, vblank_copy_rising))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("spriteram2", buffered_spriteram16_device, vblank_copy_rising))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_size(64*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(bbusters_state::screen_update_bbuster));
+ screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram16_device::vblank_copy_rising));
+ screen.screen_vblank().append(m_spriteram2, FUNC(buffered_spriteram16_device::vblank_copy_rising));
+ screen.set_palette("palette");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bbusters)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/bebox.cpp b/src/mame/drivers/bebox.cpp
index 08008374502..751a7b38b2c 100644
--- a/src/mame/drivers/bebox.cpp
+++ b/src/mame/drivers/bebox.cpp
@@ -176,14 +176,14 @@ MACHINE_CONFIG_START(bebox_state::bebox)
MCFG_DEVICE_ADD( "dma8237_2", AM9517A, XTAL(14'318'181)/3 )
- MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, bebox_state, bebox_pic8259_master_set_int_line))
- MCFG_PIC8259_IN_SP_CB(VCC)
- MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, bebox_state, get_slave_ack))
-
- MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, bebox_state, bebox_pic8259_slave_set_int_line))
- MCFG_PIC8259_IN_SP_CB(GND)
+ PIC8259(config, m_pic8259_1, 0);
+ m_pic8259_1->out_int_callback().set(FUNC(bebox_state::bebox_pic8259_master_set_int_line));
+ m_pic8259_1->in_sp_callback().set_constant(1);
+ m_pic8259_1->read_slave_ack_callback().set(FUNC(bebox_state::get_slave_ack));
+
+ PIC8259(config, m_pic8259_2, 0);
+ m_pic8259_2->out_int_callback().set(FUNC(bebox_state::bebox_pic8259_slave_set_int_line));
+ m_pic8259_2->in_sp_callback().set_constant(0);
MCFG_DEVICE_ADD( "ns16550_0", NS16550, 0 ) /* TODO: Verify model */
MCFG_DEVICE_ADD( "ns16550_1", NS16550, 0 ) /* TODO: Verify model */
diff --git a/src/mame/drivers/bigbord2.cpp b/src/mame/drivers/bigbord2.cpp
index 9c1d69f9f32..191d87f26fa 100644
--- a/src/mame/drivers/bigbord2.cpp
+++ b/src/mame/drivers/bigbord2.cpp
@@ -604,17 +604,17 @@ MACHINE_CONFIG_START(bigbord2_state::bigbord2)
MCFG_DEVICE_ADD("proglatch", LS259, 0) // U41
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("outlatch1", ls259_device, clear_w)) // FCRST - also resets the 8877
- MCFG_DEVICE_ADD("syslatch1", LS259, 0) // U14
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(MEMBANK("bankr")) // D_S
- MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("bankv"))
- MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("banka"))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, bigbord2_state, side_select_w)) // SIDSEL
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, bigbord2_state, smc1_w)) // SMC1
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, bigbord2_state, smc2_w)) // SMC2
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("fdc", mb8877_device, dden_w)) // DDEN
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, bigbord2_state, head_load_w)) // HLD
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, bigbord2_state, disk_motor_w)) // MOTOR
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("beeper", beep_device, set_state)) // BELL
+ LS259(config, m_syslatch1, 0); // U14
+ m_syslatch1->q_out_cb<0>().set_membank(m_bankr); // D_S
+ m_syslatch1->q_out_cb<0>().append_membank(m_bankv);
+ m_syslatch1->q_out_cb<0>().append_membank(m_banka);
+ m_syslatch1->q_out_cb<1>().set(FUNC(bigbord2_state::side_select_w)); // SIDSEL
+ m_syslatch1->q_out_cb<2>().set(FUNC(bigbord2_state::smc1_w)); // SMC1
+ m_syslatch1->q_out_cb<3>().set(FUNC(bigbord2_state::smc2_w)); // SMC2
+ m_syslatch1->q_out_cb<4>().set(m_fdc, FUNC(mb8877_device::dden_w)); // DDEN
+ m_syslatch1->q_out_cb<5>().set(FUNC(bigbord2_state::head_load_w)); // HLD
+ m_syslatch1->q_out_cb<6>().set(FUNC(bigbord2_state::disk_motor_w)); // MOTOR
+ m_syslatch1->q_out_cb<7>().set("beeper", FUNC(beep_device::set_state)); // BELL
MCFG_DEVICE_ADD("outlatch1", LS259, 0) // U96
diff --git a/src/mame/drivers/bladestl.cpp b/src/mame/drivers/bladestl.cpp
index 945e59a2659..468c52779bc 100644
--- a/src/mame/drivers/bladestl.cpp
+++ b/src/mame/drivers/bladestl.cpp
@@ -349,9 +349,9 @@ MACHINE_CONFIG_START(bladestl_state::bladestl)
called at initialization time */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_audiocpu, M6809_IRQ_LINE))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, M6809_IRQ_LINE);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD(m_upd7759, UPD7759)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/bml3.cpp b/src/mame/drivers/bml3.cpp
index 9602b333156..e3a01365976 100644
--- a/src/mame/drivers/bml3.cpp
+++ b/src/mame/drivers/bml3.cpp
@@ -1007,9 +1007,9 @@ MACHINE_CONFIG_START(bml3_state::bml3_common)
MCFG_ACIA6850_RTS_HANDLER(WRITELINE(*this, bml3_state, bml3_acia_rts_w))
MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, bml3_state, bml3_acia_irq_w))
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 9600) // 600 baud x 16(divider) = 9600
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 9'600)); // 600 baud x 16(divider) = 9600
+ acia_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc));
MCFG_CASSETTE_ADD( "cassette" )
diff --git a/src/mame/drivers/bombjack.cpp b/src/mame/drivers/bombjack.cpp
index 510627272c9..2fc76a3f90f 100644
--- a/src/mame/drivers/bombjack.cpp
+++ b/src/mame/drivers/bombjack.cpp
@@ -362,15 +362,15 @@ MACHINE_CONFIG_START(bombjack_state::bombjack)
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(bombjack_state, screen_update_bombjack)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, bombjack_state, vblank_irq))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(bombjack_state::screen_update_bombjack));
+ screen.set_palette(m_palette);
+ screen.screen_vblank().set(FUNC(bombjack_state::vblank_irq));
+ screen.screen_vblank().append_inputline("audiocpu", INPUT_LINE_NMI);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bombjack)
MCFG_PALETTE_ADD("palette", 128)
diff --git a/src/mame/drivers/bw2.cpp b/src/mame/drivers/bw2.cpp
index f0021d272fe..5b3640c2a81 100644
--- a/src/mame/drivers/bw2.cpp
+++ b/src/mame/drivers/bw2.cpp
@@ -561,14 +561,14 @@ MACHINE_CONFIG_START(bw2_state::bw2)
MCFG_PALETTE_INIT_OWNER(bw2_state, bw2)
// devices
- MCFG_DEVICE_ADD(m_pit, PIT8253, 0)
- MCFG_PIT8253_CLK0(16_MHz_XTAL / 4) // 8251 USART TXC, RXC
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE(m_uart, i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(m_uart, i8251_device, write_rxc))
- MCFG_PIT8253_CLK1(11000) // LCD controller
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE(m_pit, pit8253_device, write_clk2))
- MCFG_PIT8253_CLK2(0) // Floppy /MTRON
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, bw2_state, mtron_w))
+ PIT8253(config, m_pit, 0);
+ m_pit->set_clk<0>(16_MHz_XTAL / 4); // 8251 USART TXC, RXC
+ m_pit->out_handler<0>().set(m_uart, FUNC(i8251_device::write_txc));
+ m_pit->out_handler<0>().append(m_uart, FUNC(i8251_device::write_rxc));
+ m_pit->set_clk<1>(11000); // LCD controller
+ m_pit->out_handler<1>().set(m_pit, FUNC(pit8253_device::write_clk2));
+ 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))
diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp
index ff5ae422f27..bd8feea3aa8 100644
--- a/src/mame/drivers/capbowl.cpp
+++ b/src/mame/drivers/capbowl.cpp
@@ -349,18 +349,18 @@ MACHINE_CONFIG_START(capbowl_state::capbowl)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
-
- MCFG_DEVICE_ADD("ymsnd", YM2203, MASTER_CLOCK / 2)
- MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
- MCFG_AY8910_PORT_A_READ_CB(READLINE("ticket", ticket_dispenser_device, line_r)) MCFG_DEVCB_BIT(7)
- MCFG_AY8910_PORT_B_WRITE_CB(WRITELINE("ticket", ticket_dispenser_device, motor_w)) MCFG_DEVCB_BIT(7) /* Also a status LED. See memory map above */
- MCFG_SOUND_ROUTE(0, "speaker", 0.07)
- MCFG_SOUND_ROUTE(1, "speaker", 0.07)
- MCFG_SOUND_ROUTE(2, "speaker", 0.07)
- MCFG_SOUND_ROUTE(3, "speaker", 0.75)
-
- MCFG_DEVICE_ADD("dac", DAC0832, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ GENERIC_LATCH_8(config, m_soundlatch);
+
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", MASTER_CLOCK / 2));
+ ymsnd.irq_handler().set_inputline(m_audiocpu, M6809_FIRQ_LINE);
+ ymsnd.port_a_read_callback().set("ticket", FUNC(ticket_dispenser_device::line_r)).lshift(7);
+ ymsnd.port_b_write_callback().set("ticket", FUNC(ticket_dispenser_device::motor_w)).bit(7); // Also a status LED. See memory map above
+ ymsnd.add_route(0, "speaker", 0.07);
+ ymsnd.add_route(1, "speaker", 0.07);
+ ymsnd.add_route(2, "speaker", 0.07);
+ ymsnd.add_route(3, "speaker", 0.75);
+
+ DAC0832(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5);
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cat.cpp b/src/mame/drivers/cat.cpp
index b61f7bda4de..52b58dc4ad3 100644
--- a/src/mame/drivers/cat.cpp
+++ b/src/mame/drivers/cat.cpp
@@ -1080,14 +1080,13 @@ MACHINE_CONFIG_START(cat_state::cat)
MCFG_MC68681_B_TX_CALLBACK(WRITELINE(*this, cat_state, cat_duart_txb))
MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(*this, cat_state, cat_duart_output))
- MCFG_DEVICE_ADD(m_ctx, CENTRONICS, centronics_devices, "printer")
- MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(*this, cat_state, prn_ack_ff))
- MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE("duartn68681", mc68681_device, ip4_w)) MCFG_DEVCB_XOR(1)
+ CENTRONICS(config, m_ctx, centronics_devices, "printer");
+ m_ctx->ack_handler().set(FUNC(cat_state::prn_ack_ff));
+ m_ctx->busy_handler().set("duartn68681", FUNC(mc68681_device::ip4_w)).invert();
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("ctx_data_out", "ctx")
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.00);
MCFG_NVRAM_ADD_0FILL("nvram")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ccastles.cpp b/src/mame/drivers/ccastles.cpp
index 8f8824da2ad..feeac10c134 100644
--- a/src/mame/drivers/ccastles.cpp
+++ b/src/mame/drivers/ccastles.cpp
@@ -247,12 +247,6 @@ WRITE8_MEMBER(ccastles_state::irq_ack_w)
}
-template<int C> WRITE_LINE_MEMBER(ccastles_state::ccounter_w)
-{
- machine().bookkeeping().coin_counter_w(C, state);
-}
-
-
READ8_MEMBER(ccastles_state::leta_r)
{
static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
@@ -440,19 +434,19 @@ GFXDECODE_END
MACHINE_CONFIG_START(ccastles_state::ccastles)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK/8)
- MCFG_DEVICE_PROGRAM_MAP(main_map)
-
- MCFG_DEVICE_ADD("outlatch0", LS259, 0) // 8N
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, ccastles_state, nvram_store_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, ccastles_state, nvram_store_w))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ccastles_state, ccounter_w<0>))
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, ccastles_state, ccounter_w<1>))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(MEMBANK("bank1"))
-
- MCFG_DEVICE_ADD("outlatch1", LS259, 0) // 6P
+ M6502(config, m_maincpu, MASTER_CLOCK/8);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ccastles_state::main_map);
+
+ LS259(config, m_outlatch[0]); // 8N
+ m_outlatch[0]->q_out_cb<0>().set_output("led0").invert();
+ m_outlatch[0]->q_out_cb<1>().set_output("led1").invert();
+ m_outlatch[0]->q_out_cb<2>().set(FUNC(ccastles_state::nvram_store_w));
+ m_outlatch[0]->q_out_cb<3>().set(FUNC(ccastles_state::nvram_store_w));
+ m_outlatch[0]->q_out_cb<5>().set([this] (int state) { machine().bookkeeping().coin_counter_w(0, state); });
+ m_outlatch[0]->q_out_cb<6>().set([this] (int state) { machine().bookkeeping().coin_counter_w(1, state); });
+ m_outlatch[0]->q_out_cb<7>().set_membank("bank1");
+
+ LS259(config, m_outlatch[1]); // 6P
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
diff --git a/src/mame/drivers/cclimber.cpp b/src/mame/drivers/cclimber.cpp
index ebd5258c9c1..2ecfd8f9d03 100644
--- a/src/mame/drivers/cclimber.cpp
+++ b/src/mame/drivers/cclimber.cpp
@@ -1138,56 +1138,55 @@ MACHINE_CONFIG_START(cclimber_state::root)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(cclimber_state::cclimber)
+void cclimber_state::cclimber(machine_config &config)
+{
root(config);
- MCFG_DEVICE_MODIFY("mainlatch") // 7J on CCG-1
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("cclimber_audio", cclimber_audio_device, sample_trigger))
+
+ // 7J on CCG-1
+ m_mainlatch->q_out_cb<4>().set("cclimber_audio", FUNC(cclimber_audio_device::sample_trigger));
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("cclimber_audio", CCLIMBER_AUDIO, 0)
-MACHINE_CONFIG_END
+ CCLIMBER_AUDIO(config, "cclimber_audio", 0);
+}
-MACHINE_CONFIG_START(cclimber_state::cclimberx)
+void cclimber_state::cclimberx(machine_config &config)
+{
cclimber(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_OPCODES, &cclimber_state::decrypted_opcodes_map);
+}
-MACHINE_CONFIG_START(cclimber_state::ckongb)
+void cclimber_state::ckongb(machine_config &config)
+{
cclimber(config);
- MCFG_DEVICE_MODIFY("mainlatch")
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cclimber_state, nmi_mask_w)) //used by Crazy Kong Bootleg with alt levels and speed up
-MACHINE_CONFIG_END
+ m_mainlatch->q_out_cb<3>().set(FUNC(cclimber_state::nmi_mask_w)); //used by Crazy Kong Bootleg with alt levels and speed up
+}
MACHINE_CONFIG_START(cclimber_state::cannonb)
cclimber(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(cannonb_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &cclimber_state::cannonb_map);
- MCFG_DEVICE_MODIFY("mainlatch")
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cclimber_state, flip_screen_x_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, cclimber_state, flip_screen_y_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // not used
+ m_mainlatch->q_out_cb<1>().set(FUNC(cclimber_state::flip_screen_x_w));
+ m_mainlatch->q_out_cb<1>().append(FUNC(cclimber_state::flip_screen_y_w));
+ m_mainlatch->q_out_cb<2>().set_nop(); // not used
/* video hardware */
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_cannonb)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(cclimber_state::bagmanf)
+void cclimber_state::bagmanf(machine_config &config)
+{
cclimber(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(bagmanf_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &cclimber_state::bagmanf_map);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, cclimber_state, bagmanf_vblank_irq))
-MACHINE_CONFIG_END
+ subdevice<screen_device>("screen")->screen_vblank().set(FUNC(cclimber_state::bagmanf_vblank_irq));
+}
MACHINE_CONFIG_START(cclimber_state::yamato)
@@ -1233,9 +1232,8 @@ MACHINE_CONFIG_START(cclimber_state::toprollr)
MCFG_SEGACRPT_SET_NUMBANKS(3)
MCFG_SEGACRPT_SET_BANKSIZE(0x6000)
- MCFG_DEVICE_MODIFY("mainlatch")
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, cclimber_state, toprollr_rombank_w))
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, cclimber_state, toprollr_rombank_w))
+ m_mainlatch->q_out_cb<5>().set(FUNC(cclimber_state::toprollr_rombank_w));
+ m_mainlatch->q_out_cb<6>().set(FUNC(cclimber_state::toprollr_rombank_w));
/* video hardware */
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_toprollr)
@@ -1295,12 +1293,12 @@ MACHINE_CONFIG_START(cclimber_state::swimmer)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(cclimber_state::guzzler)
+void cclimber_state::guzzler(machine_config &config)
+{
swimmer(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(guzzler_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &cclimber_state::guzzler_map);
+}
/***************************************************************************
diff --git a/src/mame/drivers/ccs2810.cpp b/src/mame/drivers/ccs2810.cpp
index cb26477eea4..d7abac8548d 100644
--- a/src/mame/drivers/ccs2810.cpp
+++ b/src/mame/drivers/ccs2810.cpp
@@ -73,8 +73,8 @@ ToDo:
class ccs_state : public driver_device
{
public:
- ccs_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ ccs_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_ram(*this, RAM_TAG),
m_rom(*this, "maincpu"),
@@ -89,25 +89,31 @@ public:
{
}
+ void init_ccs2810();
+ void init_ccs2422();
+
+ void ccs2810(machine_config &config);
+ void ccs2422(machine_config &config);
+
+protected:
DECLARE_READ8_MEMBER(memory_read);
DECLARE_WRITE8_MEMBER(memory_write);
DECLARE_READ8_MEMBER(io_read);
DECLARE_WRITE8_MEMBER(io_write);
- void init_ccs2810();
- void init_ccs2422();
+
virtual void machine_start() override;
virtual void machine_reset() override;
+
DECLARE_READ8_MEMBER(port04_r);
DECLARE_READ8_MEMBER(port34_r);
DECLARE_WRITE8_MEMBER(port04_w);
DECLARE_WRITE8_MEMBER(port34_w);
DECLARE_WRITE8_MEMBER(port40_w);
- void ccs2810(machine_config &config);
- void ccs2422(machine_config &config);
void ccs2422_io(address_map &map);
void ccs2810_io(address_map &map);
void ccs2810_mem(address_map &map);
+
private:
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
@@ -913,18 +919,18 @@ MACHINE_CONFIG_START(ccs_state::ccs2810)
MCFG_RAM_DEFAULT_SIZE("64K")
/* Devices */
- MCFG_DEVICE_ADD("ins8250", INS8250, 1.8432_MHz_XTAL)
- MCFG_INS8250_OUT_TX_CB(WRITELINE("rs232", rs232_port_device, write_txd))
- MCFG_INS8250_OUT_DTR_CB(WRITELINE("rs232", rs232_port_device, write_dtr))
- MCFG_INS8250_OUT_RTS_CB(WRITELINE("rs232", rs232_port_device, write_rts))
- MCFG_INS8250_OUT_OUT1_CB(WRITELINE("rs232", rs232_port_device, write_spds)) // RLSD
-
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("ins8250", ins8250_device, rx_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ins8250", ins8250_device, ri_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("ins8250", ins8250_device, dcd_w))
- MCFG_RS232_DSR_HANDLER(WRITELINE("ins8250", ins8250_device, dsr_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("ins8250", ins8250_device, cts_w))
+ INS8250(config, m_ins8250, 1.8432_MHz_XTAL);
+ m_ins8250->out_tx_callback().set("rs232", FUNC(rs232_port_device::write_txd));
+ m_ins8250->out_dtr_callback().set("rs232", FUNC(rs232_port_device::write_dtr));
+ m_ins8250->out_rts_callback().set("rs232", FUNC(rs232_port_device::write_rts));
+ m_ins8250->out_out1_callback().set("rs232", FUNC(rs232_port_device::write_spds)); // RLSD
+
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
+ rs232.rxd_handler().set(m_ins8250, FUNC(ins8250_device::rx_w));
+ rs232.rxd_handler().append(m_ins8250, FUNC(ins8250_device::ri_w));
+ rs232.dcd_handler().set(m_ins8250, FUNC(ins8250_device::dcd_w));
+ rs232.dsr_handler().set(m_ins8250, FUNC(ins8250_device::dsr_w));
+ rs232.cts_handler().set(m_ins8250, FUNC(ins8250_device::cts_w));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(ccs_state::ccs2422)
@@ -937,18 +943,18 @@ MACHINE_CONFIG_START(ccs_state::ccs2422)
MCFG_RAM_DEFAULT_SIZE("64K")
/* Devices */
- MCFG_DEVICE_ADD("ins8250", INS8250, 1.8432_MHz_XTAL)
- MCFG_INS8250_OUT_TX_CB(WRITELINE("rs232", rs232_port_device, write_txd))
- MCFG_INS8250_OUT_DTR_CB(WRITELINE("rs232", rs232_port_device, write_dtr))
- MCFG_INS8250_OUT_RTS_CB(WRITELINE("rs232", rs232_port_device, write_rts))
- MCFG_INS8250_OUT_OUT1_CB(WRITELINE("rs232", rs232_port_device, write_etc)) // RLSD
-
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("ins8250", ins8250_device, rx_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ins8250", ins8250_device, ri_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("ins8250", ins8250_device, dcd_w))
- MCFG_RS232_DSR_HANDLER(WRITELINE("ins8250", ins8250_device, dsr_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("ins8250", ins8250_device, cts_w))
+ INS8250(config, m_ins8250, 1.8432_MHz_XTAL);
+ m_ins8250->out_tx_callback().set("rs232", FUNC(rs232_port_device::write_txd));
+ m_ins8250->out_dtr_callback().set("rs232", FUNC(rs232_port_device::write_dtr));
+ m_ins8250->out_rts_callback().set("rs232", FUNC(rs232_port_device::write_rts));
+ m_ins8250->out_out1_callback().set("rs232", FUNC(rs232_port_device::write_etc)); // RLSD
+
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
+ rs232.rxd_handler().set(m_ins8250, FUNC(ins8250_device::rx_w));
+ rs232.rxd_handler().append(m_ins8250, FUNC(ins8250_device::ri_w));
+ rs232.dcd_handler().set(m_ins8250, FUNC(ins8250_device::dcd_w));
+ rs232.dsr_handler().set(m_ins8250, FUNC(ins8250_device::dsr_w));
+ rs232.cts_handler().set(m_ins8250, FUNC(ins8250_device::cts_w));
MCFG_DEVICE_ADD("fdc", MB8877, 16_MHz_XTAL / 8) // UB1793 or MB8877
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ccs_floppies, "8sssd", floppy_image_device::default_floppy_formats)
diff --git a/src/mame/drivers/ccs300.cpp b/src/mame/drivers/ccs300.cpp
index a852ac599f8..170f211315c 100644
--- a/src/mame/drivers/ccs300.cpp
+++ b/src/mame/drivers/ccs300.cpp
@@ -125,9 +125,9 @@ MACHINE_CONFIG_START(ccs300_state::ccs300)
MCFG_MACHINE_RESET_OVERRIDE(ccs300_state, ccs300)
/* video hardware */
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("sio", z80sio_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, rxca_w))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153'600));
+ uart_clock.signal_handler().set("sio", FUNC(z80sio_device::txca_w));
+ uart_clock.signal_handler().append("sio", FUNC(z80sio_device::rxca_w));
/* Devices */
MCFG_DEVICE_ADD("sio", Z80SIO, XTAL(4'000'000))
diff --git a/src/mame/drivers/cdc721.cpp b/src/mame/drivers/cdc721.cpp
index e3bd4e15691..8095ba851c1 100644
--- a/src/mame/drivers/cdc721.cpp
+++ b/src/mame/drivers/cdc721.cpp
@@ -357,15 +357,15 @@ MACHINE_CONFIG_START(cdc721_state::cdc721)
MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, cdc721_state, interrupt_mask_w))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, cdc721_state, misc_w))
- MCFG_DEVICE_ADD("ledlatch", OUTPUT_LATCH, 0)
- MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("error")) MCFG_DEVCB_INVERT
- MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("alert")) MCFG_DEVCB_INVERT
- MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lock")) MCFG_DEVCB_INVERT
- MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("message")) MCFG_DEVCB_INVERT
- MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("prog1")) MCFG_DEVCB_INVERT
- MCFG_OUTPUT_LATCH_BIT5_HANDLER(OUTPUT("prog2")) MCFG_DEVCB_INVERT
- MCFG_OUTPUT_LATCH_BIT6_HANDLER(OUTPUT("prog3")) MCFG_DEVCB_INVERT
- MCFG_OUTPUT_LATCH_BIT7_HANDLER(OUTPUT("dsr")) MCFG_DEVCB_INVERT
+ output_latch_device &ledlatch(OUTPUT_LATCH(config, "ledlatch"));
+ ledlatch.bit_handler<0>().set_output("error").invert();
+ ledlatch.bit_handler<1>().set_output("alert").invert();
+ ledlatch.bit_handler<2>().set_output("lock").invert();
+ ledlatch.bit_handler<3>().set_output("message").invert();
+ ledlatch.bit_handler<4>().set_output("prog1").invert();
+ ledlatch.bit_handler<5>().set_output("prog2").invert();
+ ledlatch.bit_handler<6>().set_output("prog3").invert();
+ ledlatch.bit_handler<7>().set_output("dsr").invert();
MCFG_DEVICE_ADD("comuart", INS8250, 1.8432_MHz_XTAL)
MCFG_INS8250_OUT_INT_CB(WRITELINE(*this, cdc721_state, int_w<0>))
diff --git a/src/mame/drivers/centiped.cpp b/src/mame/drivers/centiped.cpp
index 404e900c10c..7a2249e9f73 100644
--- a/src/mame/drivers/centiped.cpp
+++ b/src/mame/drivers/centiped.cpp
@@ -1749,12 +1749,12 @@ MACHINE_CONFIG_START(centiped_state::centiped_base)
MCFG_DEVICE_ADD("earom", ER2055)
- MCFG_DEVICE_ADD("outlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, centiped_state, coin_counter_left_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, centiped_state, coin_counter_center_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, centiped_state, coin_counter_right_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // LED 1
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // LED 2
+ ls259_device &outlatch(LS259(config, "outlatch"));
+ outlatch.q_out_cb<0>().set(FUNC(centiped_state::coin_counter_left_w));
+ outlatch.q_out_cb<1>().set(FUNC(centiped_state::coin_counter_center_w));
+ outlatch.q_out_cb<2>().set(FUNC(centiped_state::coin_counter_right_w));
+ outlatch.q_out_cb<3>().set_output("led0").invert(); // LED 1
+ outlatch.q_out_cb<4>().set_output("led1").invert(); // LED 2
MCFG_WATCHDOG_ADD("watchdog")
@@ -1915,9 +1915,9 @@ MACHINE_CONFIG_START(centiped_state::warlords)
MCFG_DEVICE_REMOVE("earom")
// these extra LEDs also appear on Centipede schematics
- MCFG_DEVICE_MODIFY("outlatch") // P9
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led2")) MCFG_DEVCB_INVERT // LED 3
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led3")) MCFG_DEVCB_INVERT // LED 4
+ ls259_device &outlatch(*subdevice<ls259_device>("outlatch")); // P9
+ outlatch.q_out_cb<5>().set_output("led2").invert(); // LED 3
+ outlatch.q_out_cb<6>().set_output("led3").invert(); // LED 4
/* video hardware */
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_warlords)
@@ -1966,11 +1966,11 @@ MACHINE_CONFIG_START(centiped_state::bullsdrt)
MCFG_DEVICE_ADD("earom", ER2055)
- MCFG_DEVICE_ADD("outlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, centiped_state, bullsdrt_coin_count_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, centiped_state, flip_screen_w))
+ ls259_device &outlatch(LS259(config, "outlatch"));
+ outlatch.q_out_cb<1>().set(FUNC(centiped_state::bullsdrt_coin_count_w));
+ outlatch.q_out_cb<3>().set_output("led0").invert();
+ outlatch.q_out_cb<4>().set_output("led1").invert();
+ outlatch.q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w));
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/cgc7900.cpp b/src/mame/drivers/cgc7900.cpp
index 3f9c2bae652..6547c5312f5 100644
--- a/src/mame/drivers/cgc7900.cpp
+++ b/src/mame/drivers/cgc7900.cpp
@@ -494,11 +494,11 @@ MACHINE_CONFIG_START(cgc7900_state::cgc7900)
MCFG_DEVICE_ADD(MM58167_TAG, MM58167, XTAL(32'768))
MCFG_MM58167_IRQ_CALLBACK(WRITELINE(*this, cgc7900_state, irq<0x0>))
- MCFG_DEVICE_ADD(K1135A_TAG, COM8116, XTAL(5'068'800))
- MCFG_COM8116_FR_HANDLER(WRITELINE(INS8251_0_TAG, i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(INS8251_0_TAG, i8251_device, write_rxc))
- MCFG_COM8116_FT_HANDLER(WRITELINE(INS8251_1_TAG, i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(INS8251_1_TAG, i8251_device, write_rxc))
+ com8116_device &k1135a(COM8116(config, K1135A_TAG, XTAL(5'068'800)));
+ k1135a.fr_handler().set(m_i8251_0, FUNC(i8251_device::write_txc));
+ k1135a.fr_handler().append(m_i8251_0, FUNC(i8251_device::write_rxc));
+ k1135a.ft_handler().set(m_i8251_1, FUNC(i8251_device::write_txc));
+ k1135a.ft_handler().append(m_i8251_1, FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD(INS8251_0_TAG, I8251, 0)
MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/cidelsa.cpp b/src/mame/drivers/cidelsa.cpp
index 09337876144..5a9cb6a0ff0 100644
--- a/src/mame/drivers/cidelsa.cpp
+++ b/src/mame/drivers/cidelsa.cpp
@@ -405,7 +405,7 @@ MACHINE_CONFIG_START(cidelsa_state::destryer)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, DESTRYER_CHR1)
MCFG_DEVICE_PROGRAM_MAP(destryer_map)
MCFG_DEVICE_IO_MAP(destryer_io_map)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, cidelsa_state, clear_r))
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, cidelsa_state, q_w))
@@ -420,7 +420,7 @@ MACHINE_CONFIG_START(cidelsa_state::destryera)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, DESTRYER_CHR1)
MCFG_DEVICE_PROGRAM_MAP(destryera_map)
MCFG_DEVICE_IO_MAP(destryer_io_map)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, cidelsa_state, clear_r))
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, cidelsa_state, q_w))
@@ -435,7 +435,7 @@ MACHINE_CONFIG_START(cidelsa_state::altair)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, ALTAIR_CHR1)
MCFG_DEVICE_PROGRAM_MAP(altair_map)
MCFG_DEVICE_IO_MAP(altair_io_map)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, cidelsa_state, clear_r))
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, cidelsa_state, q_w))
@@ -443,16 +443,16 @@ MACHINE_CONFIG_START(cidelsa_state::altair)
/* input/output hardware */
MCFG_DEVICE_ADD("ic23", CDP1852, 0) // clock is really tied to CDP1869 CMSEL (pin 37)
- MCFG_CDP1852_MODE_CALLBACK(GND)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN0"))
MCFG_DEVICE_ADD("ic24", CDP1852, 0)
- MCFG_CDP1852_MODE_CALLBACK(GND)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN1"))
MCFG_DEVICE_ADD("ic25", CDP1852, 0)
- MCFG_CDP1852_MODE_CALLBACK(GND)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN2"))
MCFG_DEVICE_ADD("ic26", CDP1852, ALTAIR_CHR1 / 8) // clock is CDP1802 TPB
- MCFG_CDP1852_MODE_CALLBACK(VCC)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(1))
MCFG_CDP1852_DO_CALLBACK(WRITE8(*this, cidelsa_state, altair_out1_w))
/* sound and video hardware */
@@ -464,7 +464,7 @@ MACHINE_CONFIG_START(draco_state::draco)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, DRACO_CHR1)
MCFG_DEVICE_PROGRAM_MAP(draco_map)
MCFG_DEVICE_IO_MAP(draco_io_map)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, cidelsa_state, clear_r))
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, cidelsa_state, q_w))
@@ -481,16 +481,16 @@ MACHINE_CONFIG_START(draco_state::draco)
/* input/output hardware */
MCFG_DEVICE_ADD("ic29", CDP1852, 0) // clock is really tied to CDP1869 CMSEL (pin 37)
- MCFG_CDP1852_MODE_CALLBACK(GND)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN0"))
MCFG_DEVICE_ADD("ic30", CDP1852, 0)
- MCFG_CDP1852_MODE_CALLBACK(GND)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN1"))
MCFG_DEVICE_ADD("ic31", CDP1852, 0)
- MCFG_CDP1852_MODE_CALLBACK(GND)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN2"))
MCFG_DEVICE_ADD("ic32", CDP1852, ALTAIR_CHR1 / 8) // clock is CDP1802 TPB
- MCFG_CDP1852_MODE_CALLBACK(VCC)
+ MCFG_CDP1852_MODE_CALLBACK(CONSTANT(1))
MCFG_CDP1852_DO_CALLBACK(WRITE8(*this, draco_state, out1_w))
/* sound and video hardware */
diff --git a/src/mame/drivers/cit101.cpp b/src/mame/drivers/cit101.cpp
index 26612a5d5d0..b7ed97eb12c 100644
--- a/src/mame/drivers/cit101.cpp
+++ b/src/mame/drivers/cit101.cpp
@@ -335,7 +335,7 @@ MACHINE_CONFIG_START(cit101_state::cit101)
MCFG_DEVICE_ADD("maincpu", I8085A, 6.144_MHz_XTAL)
MCFG_DEVICE_PROGRAM_MAP(mem_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_I8085A_SID(GND) // used to time NVR reads
+ MCFG_I8085A_SID(CONSTANT(0)) // used to time NVR reads
MCFG_I8085A_SOD(WRITELINE(*this, cit101_state, blink_w))
MCFG_SCREEN_ADD("screen", RASTER)
@@ -385,24 +385,24 @@ MACHINE_CONFIG_START(cit101_state::cit101)
// OUT2 might be used for an internal expansion similar to the VT100 STP.
// The output appears to be fixed to a 307.2 kHz rate; turning this off boosts driver performance.
- MCFG_DEVICE_ADD("pit1", PIT8253, 0)
- MCFG_PIT8253_CLK0(6.144_MHz_XTAL / 4)
- MCFG_PIT8253_CLK1(6.144_MHz_XTAL / 4)
- MCFG_PIT8253_CLK2(6.144_MHz_XTAL / 4)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("comuart", i8251_device, write_txc))
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("comuart", i8251_device, write_rxc))
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE("kbduart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("kbduart", i8251_device, write_rxc))
-
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, cit101_state, nvr_address_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, cit101_state, nvr_data_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, cit101_state, nvr_data_w))
- MCFG_I8255_IN_PORTC_CB(READLINE("comm", rs232_port_device, cts_r)) MCFG_DEVCB_BIT(0)
- MCFG_DEVCB_CHAIN_INPUT(READLINE("comm", rs232_port_device, dcd_r)) MCFG_DEVCB_BIT(1) // tied to DSR for loopback test
- MCFG_DEVCB_CHAIN_INPUT(READLINE("comm", rs232_port_device, ri_r)) MCFG_DEVCB_BIT(2) // tied to CTS for loopback test
- MCFG_DEVCB_CHAIN_INPUT(READLINE("comm", rs232_port_device, si_r)) MCFG_DEVCB_BIT(3) // tied to CTS for loopback test
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, cit101_state, nvr_control_w))
+ pit8253_device &pit1(PIT8253(config, "pit1", 0));
+ pit1.set_clk<0>(6.144_MHz_XTAL / 4);
+ pit1.set_clk<1>(6.144_MHz_XTAL / 4);
+ pit1.set_clk<2>(6.144_MHz_XTAL / 4);
+ pit1.out_handler<0>().set("comuart", FUNC(i8251_device::write_txc));
+ pit1.out_handler<1>().set("comuart", FUNC(i8251_device::write_rxc));
+ pit1.out_handler<2>().set("kbduart", FUNC(i8251_device::write_txc));
+ pit1.out_handler<2>().append("kbduart", FUNC(i8251_device::write_rxc));
+
+ i8255_device &ppi(I8255A(config, "ppi", 0));
+ ppi.out_pa_callback().set(FUNC(cit101_state::nvr_address_w));
+ ppi.in_pb_callback().set(FUNC(cit101_state::nvr_data_r));
+ ppi.out_pb_callback().set(FUNC(cit101_state::nvr_data_w));
+ ppi.in_pc_callback().set("comm", FUNC(rs232_port_device::cts_r)).lshift(0);
+ ppi.in_pc_callback().append("comm", FUNC(rs232_port_device::dcd_r)).lshift(1); // tied to DSR for loopback test
+ ppi.in_pc_callback().append("comm", FUNC(rs232_port_device::ri_r)).lshift(2); // tied to CTS for loopback test
+ ppi.in_pc_callback().append("comm", FUNC(rs232_port_device::si_r)).lshift(3); // tied to CTS for loopback test
+ ppi.out_pc_callback().set(FUNC(cit101_state::nvr_control_w));
MCFG_DEVICE_ADD("nvr", ER2055, 0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/clcd.cpp b/src/mame/drivers/clcd.cpp
index 2f2db635bc4..6accadc5021 100644
--- a/src/mame/drivers/clcd.cpp
+++ b/src/mame/drivers/clcd.cpp
@@ -745,18 +745,18 @@ MACHINE_CONFIG_START(clcd_state::clcd)
MCFG_DEVICE_ADD("maincpu", M65C02, 2000000)
MCFG_DEVICE_PROGRAM_MAP(clcd_mem)
- MCFG_DEVICE_ADD("via0", VIA6522, 2000000)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, clcd_state, via0_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, clcd_state, via0_pb_w))
- MCFG_VIA6522_CB1_HANDLER(WRITELINE(*this, clcd_state, via0_cb1_w))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, clcd_state, write_irq_via0))
-
- MCFG_DEVICE_ADD("via1", VIA6522, 2000000)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, clcd_state, via1_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, clcd_state, via1_pb_w))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, clcd_state, write_irq_via1))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_centronics, centronics_device, write_strobe)) MCFG_DEVCB_XOR(1)
- MCFG_VIA6522_CB2_HANDLER(WRITELINE("speaker", speaker_sound_device, level_w))
+ via6522_device &via0(VIA6522(config, "via0", 2000000));
+ via0.writepa_handler().set(FUNC(clcd_state::via0_pa_w));
+ via0.writepb_handler().set(FUNC(clcd_state::via0_pb_w));
+ via0.cb1_handler().set(FUNC(clcd_state::via0_cb1_w));
+ via0.irq_handler().set(FUNC(clcd_state::write_irq_via0));
+
+ via6522_device &via1(VIA6522(config, "via1", 2000000));
+ via1.writepa_handler().set(FUNC(clcd_state::via1_pa_w));
+ via1.writepb_handler().set(FUNC(clcd_state::via1_pb_w));
+ via1.irq_handler().set(FUNC(clcd_state::write_irq_via1));
+ via1.ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe)).invert();
+ via1.cb2_handler().set("speaker", FUNC(speaker_sound_device::level_w));
MCFG_DEVICE_ADD("acia", MOS6551, 2000000)
MCFG_MOS6551_XTAL(XTAL(1'843'200))
@@ -771,8 +771,8 @@ MACHINE_CONFIG_START(clcd_state::clcd)
MCFG_RS232_DSR_HANDLER(WRITELINE("acia", mos6551_device, write_dsr))
MCFG_RS232_CTS_HANDLER(WRITELINE("via1", via6522_device, write_pb4))
- MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, nullptr)
- MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE("via1", via6522_device, write_pb6)) MCFG_DEVCB_XOR(1)
+ CENTRONICS(config, m_centronics, centronics_devices, nullptr);
+ m_centronics->busy_handler().set("via1", FUNC(via6522_device::write_pb6)).invert();
MCFG_DEVICE_ADD("bank1", ADDRESS_MAP_BANK, 0)
MCFG_DEVICE_PROGRAM_MAP(clcd_banked_mem)
diff --git a/src/mame/drivers/cloak.cpp b/src/mame/drivers/cloak.cpp
index 97cdc984c3a..66cb8278daf 100644
--- a/src/mame/drivers/cloak.cpp
+++ b/src/mame/drivers/cloak.cpp
@@ -328,13 +328,13 @@ MACHINE_CONFIG_START(cloak_state::cloak)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("outlatch", LS259, 0) // 10B
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cloak_state, coin_counter_r_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cloak_state, coin_counter_l_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cloak_state, cocktail_w))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // ???
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // START LED 2
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // START LED 1
+ ls259_device &outlatch(LS259(config, "outlatch")); // 10B
+ outlatch.q_out_cb<0>().set(FUNC(cloak_state::coin_counter_r_w));
+ outlatch.q_out_cb<1>().set(FUNC(cloak_state::coin_counter_l_w));
+ outlatch.q_out_cb<3>().set(FUNC(cloak_state::cocktail_w));
+ outlatch.q_out_cb<5>().set_nop(); // ???
+ outlatch.q_out_cb<6>().set_output("led1").invert(); // START LED 2
+ outlatch.q_out_cb<7>().set_output("led0").invert(); // START LED 1
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/cloud9.cpp b/src/mame/drivers/cloud9.cpp
index a69700dafe4..d89f0811fef 100644
--- a/src/mame/drivers/cloud9.cpp
+++ b/src/mame/drivers/cloud9.cpp
@@ -216,18 +216,6 @@ WRITE8_MEMBER(cloud9_state::irq_ack_w)
}
-WRITE_LINE_MEMBER(cloud9_state::coin1_counter_w)
-{
- machine().bookkeeping().coin_counter_w(0, state);
-}
-
-
-WRITE_LINE_MEMBER(cloud9_state::coin2_counter_w)
-{
- machine().bookkeeping().coin_counter_w(1, state);
-}
-
-
READ8_MEMBER(cloud9_state::leta_r)
{
return ioport(offset ? "TRACKX" : "TRACKY")->read();
@@ -407,14 +395,14 @@ GFXDECODE_END
MACHINE_CONFIG_START(cloud9_state::cloud9)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK/8)
- MCFG_DEVICE_PROGRAM_MAP(cloud9_map)
-
- MCFG_DEVICE_ADD("outlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cloud9_state, coin1_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cloud9_state, coin2_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT
+ M6502(config, m_maincpu, MASTER_CLOCK/8);
+ m_maincpu->set_addrmap(AS_PROGRAM, &cloud9_state::cloud9_map);
+
+ ls259_device &outlatch(LS259(config, "outlatch"));
+ outlatch.q_out_cb<0>().set([this] (int state) { machine().bookkeeping().coin_counter_w(0, state); });
+ outlatch.q_out_cb<1>().set([this] (int state) { machine().bookkeeping().coin_counter_w(1, state); });
+ outlatch.q_out_cb<2>().set_output("led0").invert();
+ outlatch.q_out_cb<3>().set_output("led1").invert();
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
diff --git a/src/mame/drivers/clshroad.cpp b/src/mame/drivers/clshroad.cpp
index f53d7385874..e30127ebc0b 100644
--- a/src/mame/drivers/clshroad.cpp
+++ b/src/mame/drivers/clshroad.cpp
@@ -283,11 +283,11 @@ MACHINE_CONFIG_START(clshroad_state::firebatl)
MCFG_DEVICE_PROGRAM_MAP(clshroad_sound_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(clshroad_state, sound_timer_irq, 120) /* periodic interrupt, don't know about the frequency */
- MCFG_DEVICE_ADD("mainlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(INPUTLINE("audiocpu", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, clshroad_state, main_irq_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, clshroad_state, sound_irq_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, clshroad_state, flipscreen_w))
+ ls259_device &mainlatch(LS259(config, "mainlatch"));
+ mainlatch.q_out_cb<0>().set_inputline(m_audiocpu, INPUT_LINE_RESET).invert();
+ mainlatch.q_out_cb<1>().set(FUNC(clshroad_state::main_irq_mask_w));
+ mainlatch.q_out_cb<3>().set(FUNC(clshroad_state::sound_irq_mask_w));
+ mainlatch.q_out_cb<4>().set(FUNC(clshroad_state::flipscreen_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -324,11 +324,11 @@ MACHINE_CONFIG_START(clshroad_state::clshroad)
//MCFG_DEVICE_VBLANK_INT_DRIVER("screen", clshroad_state, irq0_line_hold) /* IRQ, no NMI */
MCFG_DEVICE_PERIODIC_INT_DRIVER(clshroad_state, sound_timer_irq, 60) /* periodic interrupt, don't know about the frequency */
- MCFG_DEVICE_ADD("mainlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // never writes here?
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, clshroad_state, main_irq_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, clshroad_state, sound_irq_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, clshroad_state, flipscreen_w))
+ ls259_device &mainlatch(LS259(config, "mainlatch"));
+ mainlatch.q_out_cb<0>().set_nop(); // never writes here?
+ mainlatch.q_out_cb<1>().set(FUNC(clshroad_state::main_irq_mask_w));
+ mainlatch.q_out_cb<3>().set(FUNC(clshroad_state::sound_irq_mask_w));
+ mainlatch.q_out_cb<4>().set(FUNC(clshroad_state::flipscreen_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp
index 9677b7328a6..f34bf620848 100644
--- a/src/mame/drivers/cntsteer.cpp
+++ b/src/mame/drivers/cntsteer.cpp
@@ -938,15 +938,15 @@ MACHINE_CONFIG_START(cntsteer_state::cntsteer)
MCFG_MACHINE_RESET_OVERRIDE(cntsteer_state,cntsteer)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(256, 256)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(cntsteer_state, screen_update_cntsteer)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) // ?
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, cntsteer_state, subcpu_vblank_irq)) // ?
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(256, 256);
+ screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
+ screen.set_screen_update(FUNC(cntsteer_state::screen_update_cntsteer));
+ screen.set_palette(m_palette);
+ screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); // ?
+ screen.screen_vblank().append(FUNC(cntsteer_state::subcpu_vblank_irq)); // ?
MCFG_QUANTUM_PERFECT_CPU("maincpu")
MCFG_QUANTUM_PERFECT_CPU("subcpu")
diff --git a/src/mame/drivers/coco12.cpp b/src/mame/drivers/coco12.cpp
index 22e3d9e27a2..b9e22c24f8c 100644
--- a/src/mame/drivers/coco12.cpp
+++ b/src/mame/drivers/coco12.cpp
@@ -474,10 +474,10 @@ MACHINE_CONFIG_START(coco12_state::coco)
MCFG_RS232_DCD_HANDLER(WRITELINE(PIA1_TAG, pia6821_device, ca1_w))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("printer", printer)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_cart, "pak")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
+ cococart_slot_device &cartslot(COCOCART_SLOT(config, CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "pak"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
// video hardware
MCFG_SCREEN_MC6847_NTSC_ADD(SCREEN_TAG, VDG_TAG)
@@ -516,11 +516,10 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(coco12_state::cocoe)
coco(config);
- MCFG_COCO_CARTRIDGE_REMOVE(CARTRIDGE_TAG)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_cart, "fdc")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
+ cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "fdc"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
MCFG_COCO_VHD_ADD(VHD0_TAG)
MCFG_COCO_VHD_ADD(VHD1_TAG)
MACHINE_CONFIG_END
@@ -535,11 +534,10 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(coco12_state::coco2)
coco(config);
- MCFG_COCO_CARTRIDGE_REMOVE(CARTRIDGE_TAG)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_cart, "fdcv11")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
+ cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "fdcv11"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
MCFG_COCO_VHD_ADD(VHD0_TAG)
MCFG_COCO_VHD_ADD(VHD1_TAG)
MACHINE_CONFIG_END
@@ -569,33 +567,33 @@ MACHINE_CONFIG_START(coco12_state::coco2bh)
MCFG_RAM_DEFAULT_SIZE("64K")
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(coco12_state::cp400)
+void coco12_state::cp400(machine_config &config)
+{
coco(config);
- MCFG_COCO_CARTRIDGE_REMOVE(CARTRIDGE_TAG)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_cart, "cp450_fdc")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
-MACHINE_CONFIG_END
+ cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "cp450_fdc"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
+}
-MACHINE_CONFIG_START(coco12_state::t4426)
+void coco12_state::t4426(machine_config &config)
+{
coco2(config);
- MCFG_COCO_CARTRIDGE_REMOVE(CARTRIDGE_TAG)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, t4426_cart, "t4426")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
- MCFG_SLOT_FIXED(true) // This cart is fixed so no way to change it
-MACHINE_CONFIG_END
+ cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), t4426_cart, "t4426"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
+ cartslot.set_fixed(true); // This cart is fixed so no way to change it
+}
-MACHINE_CONFIG_START(coco12_state::cd6809)
+void coco12_state::cd6809(machine_config &config)
+{
coco(config);
- MCFG_COCO_CARTRIDGE_REMOVE(CARTRIDGE_TAG)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_cart, "cd6809_fdc")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
-MACHINE_CONFIG_END
+ cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "cd6809_fdc"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
+}
//**************************************************************************
// ROMS
diff --git a/src/mame/drivers/coco3.cpp b/src/mame/drivers/coco3.cpp
index 2419e5b9358..1ae287a428f 100644
--- a/src/mame/drivers/coco3.cpp
+++ b/src/mame/drivers/coco3.cpp
@@ -281,10 +281,10 @@ MACHINE_CONFIG_START(coco3_state::coco3)
MCFG_RS232_DCD_HANDLER(WRITELINE(PIA1_TAG, pia6821_device, ca1_w))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("printer", printer)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_cart, "fdcv11")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
+ cococart_slot_device &cartslot(COCOCART_SLOT(config, CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "fdcv11"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
MCFG_COCO_VHD_ADD(VHD0_TAG)
MCFG_COCO_VHD_ADD(VHD1_TAG)
@@ -354,14 +354,14 @@ MACHINE_CONFIG_START(coco3_state::coco3h)
MCFG_DEVICE_PROGRAM_MAP(coco3_mem)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(coco3_state::coco3dw1)
+void coco3_state::coco3dw1(machine_config &config)
+{
coco3(config);
- MCFG_COCO_CARTRIDGE_REMOVE(CARTRIDGE_TAG)
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_cart, "cc3hdb1")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
-MACHINE_CONFIG_END
+ cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "cc3hdb1"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
+}
//**************************************************************************
// ROMS
diff --git a/src/mame/drivers/codata.cpp b/src/mame/drivers/codata.cpp
index d47767f90e1..7fa5f64e27c 100644
--- a/src/mame/drivers/codata.cpp
+++ b/src/mame/drivers/codata.cpp
@@ -74,14 +74,14 @@ MACHINE_CONFIG_START(codata_state::codata)
MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs423b", rs232_port_device, write_txd))
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", M68K_IRQ_5))
- MCFG_DEVICE_ADD("timer", AM9513A, XTAL(16'000'000) / 4)
- MCFG_AM9513_OUT1_CALLBACK(NOOP) // Timer 1 = "Abort/Reset" (watchdog)
- MCFG_AM9513_OUT2_CALLBACK(INPUTLINE("maincpu", M68K_IRQ_6)) // Timer 2
- MCFG_AM9513_OUT3_CALLBACK(INPUTLINE("maincpu", M68K_IRQ_7)) // Refresh
- MCFG_AM9513_OUT4_CALLBACK(WRITELINE("uart", upd7201_new_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", upd7201_new_device, txca_w))
- MCFG_AM9513_OUT5_CALLBACK(WRITELINE("uart", upd7201_new_device, rxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", upd7201_new_device, txcb_w))
+ am9513_device &timer(AM9513A(config, "timer", 16_MHz_XTAL / 4));
+ timer.out1_cb().set_nop(); // Timer 1 = "Abort/Reset" (watchdog)
+ timer.out2_cb().set_inputline(m_maincpu, M68K_IRQ_6); // Timer 2
+ timer.out3_cb().set_inputline(m_maincpu, M68K_IRQ_7); // Refresh
+ timer.out4_cb().set("uart", FUNC(upd7201_new_device::rxca_w));
+ timer.out4_cb().append("uart", FUNC(upd7201_new_device::txca_w));
+ timer.out5_cb().set("uart", FUNC(upd7201_new_device::rxcb_w));
+ timer.out5_cb().append("uart", FUNC(upd7201_new_device::txcb_w));
MCFG_DEVICE_ADD("rs423a", RS232_PORT, default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(WRITELINE("uart", upd7201_new_device, rxa_w))
diff --git a/src/mame/drivers/commando.cpp b/src/mame/drivers/commando.cpp
index e628310992d..be69b8b2dc1 100644
--- a/src/mame/drivers/commando.cpp
+++ b/src/mame/drivers/commando.cpp
@@ -263,17 +263,16 @@ MACHINE_CONFIG_START(commando_state::commando)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(commando_state, irq0_line_hold, 4*60)
-
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(commando_state, screen_update_commando)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram8_device, vblank_copy_rising))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, commando_state, vblank_irq))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(commando_state::screen_update_commando));
+ screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram8_device::vblank_copy_rising));
+ screen.screen_vblank().append(FUNC(commando_state::vblank_irq));
+ screen.set_palette(m_palette);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_commando)
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
diff --git a/src/mame/drivers/compucolor.cpp b/src/mame/drivers/compucolor.cpp
index 4a3d829ae4a..264048fab80 100644
--- a/src/mame/drivers/compucolor.cpp
+++ b/src/mame/drivers/compucolor.cpp
@@ -414,9 +414,9 @@ MACHINE_CONFIG_START(compucolor2_state::compucolor2)
MCFG_TMS9927_VSYN_CALLBACK(WRITELINE("blink", ripple_counter_device, clock_w))
MCFG_VIDEO_SET_SCREEN("screen")
- MCFG_DEVICE_ADD("blink", RIPPLE_COUNTER, 0) // 74LS393 at UG10
- MCFG_RIPPLE_COUNTER_STAGES(8)
- MCFG_RIPPLE_COUNTER_COUNT_OUT_CB(WRITELINE(TMS5501_TAG, tms5501_device, sens_w)) MCFG_DEVCB_BIT(4)
+ ripple_counter_device &blink(RIPPLE_COUNTER(config, "blink", 0)); // 74LS393 at UG10
+ blink.set_stages(8);
+ blink.count_out_cb().set(m_mioc, FUNC(tms5501_device::sens_w)).bit(4);
// devices
MCFG_DEVICE_ADD(TMS5501_TAG, TMS5501, XTAL(17'971'200)/9)
diff --git a/src/mame/drivers/comx35.cpp b/src/mame/drivers/comx35.cpp
index dd1fa84c61f..47f4da2ced4 100644
--- a/src/mame/drivers/comx35.cpp
+++ b/src/mame/drivers/comx35.cpp
@@ -600,7 +600,7 @@ MACHINE_CONFIG_START(comx35_state::pal)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, cdp1869_device::CPU_CLK_PAL)
MCFG_DEVICE_PROGRAM_MAP(comx35_mem)
MCFG_DEVICE_IO_MAP(comx35_io)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, comx35_state, clear_r))
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, comx35_state, ef2_r))
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, comx35_state, ef4_r))
@@ -650,7 +650,7 @@ MACHINE_CONFIG_START(comx35_state::ntsc)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, cdp1869_device::CPU_CLK_NTSC)
MCFG_DEVICE_PROGRAM_MAP(comx35_mem)
MCFG_DEVICE_IO_MAP(comx35_io)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, comx35_state, clear_r))
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, comx35_state, ef2_r))
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, comx35_state, ef4_r))
diff --git a/src/mame/drivers/cortex.cpp b/src/mame/drivers/cortex.cpp
index f685fbbc61c..bdecceeafdb 100644
--- a/src/mame/drivers/cortex.cpp
+++ b/src/mame/drivers/cortex.cpp
@@ -196,10 +196,11 @@ MACHINE_CONFIG_START(cortex_state::cortex)
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("beeper", beep_device, set_state))
/* video hardware */
- MCFG_DEVICE_ADD( "crtc", TMS9929A, XTAL(10'738'635) / 2 )
- MCFG_TMS9928A_OUT_INT_LINE_CB(INPUTLINE("maincpu", INT_9995_INT1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, cortex_state, vdp_int_w))
- MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ tms9929a_device &crtc(TMS9929A(config, "crtc", XTAL(10'738'635) / 2));
+ crtc.out_int_line_callback().set_inputline(m_maincpu, INT_9995_INT1);
+ crtc.out_int_line_callback().append(FUNC(cortex_state::vdp_int_w));
+ crtc.set_vram_size(0x4000);
+ device = &crtc; // FIXME: this line is needed because the following macro is nasty
MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" )
MCFG_SCREEN_UPDATE_DEVICE( "crtc", tms9928a_device, screen_update )
diff --git a/src/mame/drivers/cosmicos.cpp b/src/mame/drivers/cosmicos.cpp
index 160883b0e1e..4121cb9c32b 100644
--- a/src/mame/drivers/cosmicos.cpp
+++ b/src/mame/drivers/cosmicos.cpp
@@ -536,7 +536,7 @@ MACHINE_CONFIG_START(cosmicos_state::cosmicos)
MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_CDP1864_ADD(CDP1864_TAG, SCREEN_TAG, XTAL(1'750'000), GND, INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_INT), WRITELINE(*this, cosmicos_state, dmaout_w), WRITELINE(*this, cosmicos_state, efx_w), NOOP, VCC, VCC, VCC)
+ MCFG_CDP1864_ADD(CDP1864_TAG, SCREEN_TAG, XTAL(1'750'000), CONSTANT(0), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_INT), WRITELINE(*this, cosmicos_state, dmaout_w), WRITELINE(*this, cosmicos_state, efx_w), NOOP, CONSTANT(1), CONSTANT(1), CONSTANT(1))
MCFG_CDP1864_CHROMINANCE(RES_K(2), 0, 0, 0) // R2
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/cp1.cpp b/src/mame/drivers/cp1.cpp
index 233cea9e3ab..5fe52c736e8 100644
--- a/src/mame/drivers/cp1.cpp
+++ b/src/mame/drivers/cp1.cpp
@@ -22,8 +22,8 @@
class cp1_state : public driver_device
{
public:
- cp1_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag) ,
+ cp1_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_i8155(*this, "i8155"),
m_i8155_cp3(*this, "i8155_cp3"),
@@ -266,16 +266,16 @@ QUICKLOAD_LOAD_MEMBER( cp1_state, quickload )
MACHINE_CONFIG_START(cp1_state::cp1)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8049, XTAL(6'000'000))
- MCFG_DEVICE_IO_MAP(cp1_io)
- MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, cp1_state, port1_r))
- MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, cp1_state, port1_w))
- MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, cp1_state, port2_r))
- MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, cp1_state, port2_w))
- MCFG_MCS48_PORT_BUS_IN_CB(LOGGER("getbus"))
- MCFG_MCS48_PORT_BUS_OUT_CB(LOGGER("putbus"))
- MCFG_MCS48_PORT_T0_IN_CB(LOGGER("t0_r"))
- MCFG_MCS48_PORT_T1_IN_CB(LOGGER("t1_r"))
+ i8049_device &maincpu(I8049(config, m_maincpu, 6_MHz_XTAL));
+ maincpu.set_addrmap(AS_IO, &cp1_state::cp1_io);
+ maincpu.p1_in_cb().set(FUNC(cp1_state::port1_r));
+ maincpu.p1_out_cb().set(FUNC(cp1_state::port1_w));
+ maincpu.p2_in_cb().set(FUNC(cp1_state::port2_r));
+ maincpu.p2_out_cb().set(FUNC(cp1_state::port2_w));
+ maincpu.bus_in_cb().set_log("getbus");
+ maincpu.bus_out_cb().set_log("putbus");
+ maincpu.t0_in_cb().set_log("t0_r");
+ maincpu.t1_in_cb().set_log("t1_r");
MCFG_DEVICE_ADD("i8155", I8155, 0)
MCFG_I8155_OUT_PORTA_CB(WRITE8(*this, cp1_state, i8155_porta_w))
diff --git a/src/mame/drivers/cpzodiac.cpp b/src/mame/drivers/cpzodiac.cpp
index b8d71521228..170aa5e188e 100644
--- a/src/mame/drivers/cpzodiac.cpp
+++ b/src/mame/drivers/cpzodiac.cpp
@@ -168,20 +168,20 @@ MACHINE_CONFIG_START(cpzodiac_state::cpzodiac)
MCFG_DEVICE_IO_MAP(main_io_map)
MCFG_Z80_DAISY_CHAIN(daisy_chain)
- MCFG_DEVICE_ADD("io", TE7750, 0)
- MCFG_TE7750_IOS_CB(CONSTANT(4))
- MCFG_TE7750_IN_PORT1_CB(IOPORT("IN1"))
- MCFG_TE7750_IN_PORT2_CB(IOPORT("IN2"))
- MCFG_TE7750_IN_PORT3_CB(IOPORT("IN3"))
- MCFG_TE7750_IN_PORT4_CB(IOPORT("IN4"))
- MCFG_TE7750_OUT_PORT8_CB(MEMBANK("databank")) MCFG_DEVCB_RSHIFT(-4)
+ te7750_device &io(TE7750(config, "io", 0));
+ io.ios_cb().set_constant(4);
+ io.in_port1_cb().set_ioport("IN1");
+ io.in_port2_cb().set_ioport("IN2");
+ io.in_port3_cb().set_ioport("IN3");
+ io.in_port4_cb().set_ioport("IN4");
+ io.out_port8_cb().set_membank(m_bank).rshift(4);
// Code initializes Port 3 and 4 latches to 0 by mistake?
- MCFG_DEVICE_ADD("ctc", Z80CTC, 12_MHz_XTAL/2)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", 0))
+ z80ctc_device &ctc(Z80CTC(config, "ctc", 12_MHz_XTAL/2));
+ ctc.intr_callback().set_inputline(m_maincpu, 0);
- MCFG_DEVICE_ADD("audiocpu", Z80, 12_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ Z80(config, m_audiocpu, 12_MHz_XTAL/2);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &cpzodiac_state::sound_map);
/* video hardware */
// TODO
diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp
index 7a0aee56d55..6c4524725c7 100644
--- a/src/mame/drivers/crshrace.cpp
+++ b/src/mame/drivers/crshrace.cpp
@@ -415,14 +415,14 @@ MACHINE_CONFIG_START(crshrace_state::crshrace)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(crshrace_state, screen_update_crshrace)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram16_device, vblank_copy_rising))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("spriteram2", buffered_spriteram16_device, vblank_copy_rising))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_size(64*8, 32*8);
+ screen.set_visarea(0*8, 40*8-1, 0*8, 28*8-1);
+ screen.set_screen_update(FUNC(crshrace_state::screen_update_crshrace));
+ screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram16_device::vblank_copy_rising));
+ screen.screen_vblank().append(m_spriteram2, FUNC(buffered_spriteram16_device::vblank_copy_rising));
+ screen.set_palette(m_palette);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_crshrace)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/darkseal.cpp b/src/mame/drivers/darkseal.cpp
index 5a13e860963..636785a7103 100644
--- a/src/mame/drivers/darkseal.cpp
+++ b/src/mame/drivers/darkseal.cpp
@@ -263,8 +263,8 @@ MACHINE_CONFIG_START(darkseal_state::darkseal)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_audiocpu, 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(32'220'000)/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp
index f1503af323c..bf81eb8dc90 100644
--- a/src/mame/drivers/dblewing.cpp
+++ b/src/mame/drivers/dblewing.cpp
@@ -404,14 +404,14 @@ MACHINE_CONFIG_START(dblewing_state::dblewing)
MCFG_DECO_SPRITE_PRIORITY_CB(dblewing_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
- MCFG_DECO104_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
- MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
- MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(WRITELINE(*this, dblewing_state, soundlatch_irq_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("soundirq", input_merger_device, in_w<0>))
+ DECO104PROT(config, m_deco104, 0);
+ m_deco104->port_a_cb().set_ioport("INPUTS");
+ m_deco104->port_b_cb().set_ioport("SYSTEM");
+ m_deco104->port_c_cb().set_ioport("DSW");
+ m_deco104->set_interface_scramble_interleave();
+ m_deco104->set_use_magic_read_address_xor(true);
+ m_deco104->soundlatch_irq_cb().set(FUNC(dblewing_state::soundlatch_irq_w));
+ m_deco104->soundlatch_irq_cb().append("soundirq", FUNC(input_merger_device::in_w<0>));
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp
index f2594ab4691..eb9a78db775 100644
--- a/src/mame/drivers/ddenlovr.cpp
+++ b/src/mame/drivers/ddenlovr.cpp
@@ -9859,15 +9859,15 @@ MACHINE_CONFIG_START(ddenlovr_state::quizchq)
MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(336, 256+22)
- MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-16+5-1)
- MCFG_SCREEN_UPDATE_DRIVER(ddenlovr_state, screen_update_ddenlovr)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, strobe_a)) MCFG_DEVCB_INVERT
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(336, 256+22);
+ m_screen->set_visarea(0, 336-1, 5, 256-16+5-1);
+ m_screen->set_screen_update(FUNC(ddenlovr_state::screen_update_ddenlovr));
+ m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE);
+ m_screen->set_palette("palette");
+ m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::strobe_a)).invert();
MCFG_PALETTE_ADD("palette", 0x100)
@@ -9885,8 +9885,7 @@ MACHINE_CONFIG_START(ddenlovr_state::quizchq)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* devices */
- MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768))
- MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, trg2)) MCFG_DEVCB_INVERT
+ MSM6242(config, "rtc", 32.768_kHz_XTAL).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg2)).invert();
MACHINE_CONFIG_END
MACHINE_CONFIG_START(ddenlovr_state::rongrong)
@@ -10175,12 +10174,10 @@ MACHINE_CONFIG_START(ddenlovr_state::funkyfig)
MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,funkyfig)
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, ddenlovr_state, funkyfig_sound_irq))
+ m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0));
+ m_screen->screen_vblank().append(FUNC(ddenlovr_state::funkyfig_sound_irq));
- MCFG_DEVICE_MODIFY("rtc")
- MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, trg1)) MCFG_DEVCB_INVERT
+ subdevice<msm6242_device>("rtc")->out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)).invert();
MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, funkyfig_blitter_irq)
@@ -10237,8 +10234,7 @@ MACHINE_CONFIG_START(ddenlovr_state::mjschuka)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
/* devices */
- MCFG_DEVICE_ADD("rtc", RTC62421, XTAL(32'768)) // internal oscillator
- MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, pa7_w)) MCFG_DEVCB_INVERT
+ RTC62421(config, "rtc", 32.768_kHz_XTAL).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::pa7_w)).invert(); // internal oscillator
MACHINE_CONFIG_END
@@ -10264,8 +10260,7 @@ MACHINE_CONFIG_START(ddenlovr_state::mjmyster)
MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w))
MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mmpanic_rombank_w))
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) MCFG_DEVCB_INVERT
+ m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert();
MCFG_DEVICE_MODIFY("rtc")
MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
@@ -10305,8 +10300,7 @@ MACHINE_CONFIG_START(ddenlovr_state::hginga)
MCFG_DEVICE_MODIFY("screen")
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0))
- MCFG_DEVICE_MODIFY("rtc")
- MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, pa7_w)) MCFG_DEVCB_INVERT
+ subdevice<msm6242_device>("rtc")->out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::pa7_w)).invert();
MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq)
@@ -10332,8 +10326,7 @@ MACHINE_CONFIG_START(ddenlovr_state::hgokou)
MCFG_DEVICE_MODIFY("screen")
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0))
- MCFG_DEVICE_MODIFY("rtc")
- MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, pa7_w)) MCFG_DEVCB_INVERT
+ subdevice<msm6242_device>("rtc")->out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::pa7_w)).invert();
MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq)
@@ -10375,8 +10368,7 @@ MACHINE_CONFIG_START(ddenlovr_state::mjmyuniv)
MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w))
MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mmpanic_rombank_w))
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) MCFG_DEVCB_INVERT
+ m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert();
MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjmyster)
@@ -10401,8 +10393,7 @@ MACHINE_CONFIG_START(ddenlovr_state::mjmyornt)
MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w))
MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mmpanic_rombank_w))
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) MCFG_DEVCB_INVERT
+ m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert();
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 4, 256-16+4-1)
@@ -10457,12 +10448,10 @@ MACHINE_CONFIG_START(ddenlovr_state::mjflove)
MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjflove)
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, ddenlovr_state, mjflove_irq))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("maincpu", tmpz84c015_device, trg0)) // frame counter?
+ m_screen->screen_vblank().set(FUNC(ddenlovr_state::mjflove_irq));
+ m_screen->screen_vblank().append(m_maincpu, FUNC(tmpz84c015_device::trg0)); // frame counter?
- MCFG_DEVICE_REPLACE("rtc", RTC72421, XTAL(32'768))
- MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, ddenlovr_state, mjflove_rtc_irq))
+ RTC72421(config.replace(), "rtc", 32.768_kHz_XTAL).out_int_handler().set(FUNC(ddenlovr_state::mjflove_rtc_irq));
MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjflove_blitter_irq)
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index eb914d7598f..ab40ed28395 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -349,12 +349,6 @@ WRITE8_MEMBER(dec8_state::ghostb_bank_w)
flip_screen_set(BIT(data, 3));
}
-WRITE_LINE_MEMBER(dec8_state::ghostb_nmi_w)
-{
- if (state && m_nmi_enable)
- m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
-}
-
WRITE8_MEMBER(dec8_state::csilver_control_w)
{
/*
@@ -2090,19 +2084,18 @@ MACHINE_CONFIG_START(dec8_state::gondo)
MCFG_DECO_KARNOVSPRITES_GFX_REGION(1)
MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode")
- MCFG_SCREEN_ADD("screen", RASTER)
-// MCFG_SCREEN_REFRESH_RATE(58)
-// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529) /* 58Hz, 529ms Vblank duration */)
-// MCFG_SCREEN_SIZE(32*8, 32*8)
-// MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_RAW_PARAMS_DATA_EAST
- MCFG_SCREEN_UPDATE_DRIVER(dec8_state, screen_update_gondo)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, dec8_state, screen_vblank_dec8))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("nmigate", input_merger_device, in_w<1>))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+// screen.set_refresh_hz(58);
+// screen.set_vblank_time(ATTOSECONDS_IN_USEC(529) /* 58Hz, 529ms Vblank duration */);
+// screen.set_size(32*8, 32*8);
+// screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
+ device = &screen; MCFG_SCREEN_RAW_PARAMS_DATA_EAST
+ screen.set_screen_update(FUNC(dec8_state::screen_update_gondo));
+ screen.screen_vblank().set(FUNC(dec8_state::screen_vblank_dec8));
+ screen.screen_vblank().append(m_nmigate, FUNC(input_merger_device::in_w<1>));
+ screen.set_palette("palette");
- MCFG_INPUT_MERGER_ALL_HIGH("nmigate")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
+ INPUT_MERGER_ALL_HIGH(config, m_nmigate).output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_gondo)
MCFG_DEVICE_ADD("palette", DECO_RMC3, 0) // xxxxBBBBGGGGRRRR with custom weighting
@@ -2151,19 +2144,18 @@ MACHINE_CONFIG_START(dec8_state::garyoret)
MCFG_DECO_KARNOVSPRITES_GFX_REGION(1)
MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode")
- MCFG_SCREEN_ADD("screen", RASTER)
-// MCFG_SCREEN_REFRESH_RATE(58)
-// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529) /* 58Hz, 529ms Vblank duration */)
-// MCFG_SCREEN_SIZE(32*8, 32*8)
-// MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_RAW_PARAMS_DATA_EAST
- MCFG_SCREEN_UPDATE_DRIVER(dec8_state, screen_update_garyoret)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, dec8_state, screen_vblank_dec8))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("nmigate", input_merger_device, in_w<1>))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+// screen.set_refresh_hz(58);
+// screen.set_vblank_time(ATTOSECONDS_IN_USEC(529) /* 58Hz, 529ms Vblank duration */);
+// screen.set_size(32*8, 32*8);
+// screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
+ device = &screen; MCFG_SCREEN_RAW_PARAMS_DATA_EAST
+ screen.set_screen_update(FUNC(dec8_state::screen_update_garyoret));
+ screen.screen_vblank().set(FUNC(dec8_state::screen_vblank_dec8));
+ screen.screen_vblank().append(m_nmigate, FUNC(input_merger_device::in_w<1>));
+ screen.set_palette("palette");
- MCFG_INPUT_MERGER_ALL_HIGH("nmigate")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
+ INPUT_MERGER_ALL_HIGH(config, m_nmigate).output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_gondo)
MCFG_DEVICE_ADD("palette", DECO_RMC3, 0) // xxxxBBBBGGGGRRRR with custom weighting
@@ -2216,16 +2208,16 @@ MACHINE_CONFIG_START(dec8_state::ghostb)
MCFG_DECO_KARNOVSPRITES_GFX_REGION(1)
MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode")
- MCFG_SCREEN_ADD("screen", RASTER)
-// MCFG_SCREEN_REFRESH_RATE(58)
-// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* 58Hz, 529ms Vblank duration */)
-// MCFG_SCREEN_SIZE(32*8, 32*8)
-// MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_RAW_PARAMS_DATA_EAST
- MCFG_SCREEN_UPDATE_DRIVER(dec8_state, screen_update_ghostb)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, dec8_state, screen_vblank_dec8))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, dec8_state, ghostb_nmi_w))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+// screen.set_refresh_hz(58);
+// screen.set_vblank_time(ATTOSECONDS_IN_USEC(529) /* 58Hz, 529ms Vblank duration */);
+// screen.set_size(32*8, 32*8);
+// screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
+ device = &screen; MCFG_SCREEN_RAW_PARAMS_DATA_EAST
+ screen.set_screen_update(FUNC(dec8_state::screen_update_ghostb));
+ screen.screen_vblank().set(FUNC(dec8_state::screen_vblank_dec8));
+ screen.screen_vblank().append([this] (int state) { if (state && m_nmi_enable) m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); });
+ screen.set_palette("palette");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ghostb)
MCFG_DECO_RMC3_ADD_PROMS("palette","proms",1024) // xxxxBBBBGGGGRRRR with custom weighting
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp
index e3568125696..e182c7bcd40 100644
--- a/src/mame/drivers/deco32.cpp
+++ b/src/mame/drivers/deco32.cpp
@@ -2004,12 +2004,12 @@ MACHINE_CONFIG_START(fghthist_state::fghthist)
MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
- MCFG_DECO146_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_DECO146_IN_PORTB_CB(READLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
- MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1"))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
- MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
+ DECO146PROT(config, m_ioprot, 0);
+ m_ioprot->port_a_cb().set_ioport("IN0");
+ m_ioprot->port_b_cb().set("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)).lshift(0);
+ m_ioprot->port_c_cb().set_ioport("IN1");
+ m_ioprot->set_interface_scramble_interleave();
+ m_ioprot->set_use_magic_read_address_xor(true);
MCFG_VIDEO_START_OVERRIDE(fghthist_state, fghthist)
@@ -2170,11 +2170,11 @@ MACHINE_CONFIG_START(dragngun_state::dragngun)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "gun_speaker", 1.0)
MCFG_DEVICE_ADD("vol_main", LC7535)
- MCFG_LC7535_SELECT_CB(VCC)
+ MCFG_LC7535_SELECT_CB(CONSTANT(1))
MCFG_LC7535_VOLUME_CB(dragngun_state, volume_main_changed)
MCFG_DEVICE_ADD("vol_gun", LC7535)
- MCFG_LC7535_SELECT_CB(GND)
+ MCFG_LC7535_SELECT_CB(CONSTANT(0))
MCFG_LC7535_VOLUME_CB(dragngun_state, volume_gun_changed)
MACHINE_CONFIG_END
@@ -2298,7 +2298,7 @@ MACHINE_CONFIG_START(dragngun_state::lockload)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35)
MCFG_DEVICE_ADD("vol_main", LC7535)
- MCFG_LC7535_SELECT_CB(VCC)
+ MCFG_LC7535_SELECT_CB(CONSTANT(1))
MCFG_LC7535_VOLUME_CB(dragngun_state, volume_main_changed)
MACHINE_CONFIG_END
@@ -2359,12 +2359,12 @@ MACHINE_CONFIG_START(nslasher_state::tattass)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "deco_ace", gfx_tattass)
- MCFG_DECO104_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_DECO146_IN_PORTB_CB(READ16(*this, nslasher_state, port_b_tattass))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1"))
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(WRITELINE(*this, nslasher_state, tattass_sound_irq_w))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
+ DECO104PROT(config, m_ioprot, 0);
+ m_ioprot->port_a_cb().set_ioport("IN0");
+ m_ioprot->port_b_cb().set(FUNC(nslasher_state::port_b_tattass));
+ m_ioprot->port_c_cb().set_ioport("IN1");
+ m_ioprot->soundlatch_irq_cb().set(FUNC(nslasher_state::tattass_sound_irq_w));
+ m_ioprot->set_interface_scramble_interleave();
MCFG_VIDEO_START_OVERRIDE(nslasher_state,nslasher)
@@ -2440,12 +2440,12 @@ MACHINE_CONFIG_START(nslasher_state::nslasher)
MCFG_VIDEO_START_OVERRIDE(nslasher_state, nslasher)
- MCFG_DECO104_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_DECO146_IN_PORTB_CB(READLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
- MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1"))
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(WRITELINE("sound_irq_merger", input_merger_any_high_device, in_w<0>))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
+ DECO104PROT(config, m_ioprot, 0);
+ m_ioprot->port_a_cb().set_ioport("IN0");
+ m_ioprot->port_b_cb().set("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)).lshift(0);
+ m_ioprot->port_c_cb().set_ioport("IN1");
+ m_ioprot->soundlatch_irq_cb().set("sound_irq_merger", FUNC(input_merger_any_high_device::in_w<0>));
+ m_ioprot->set_interface_scramble_interleave();
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
@@ -2469,19 +2469,16 @@ MACHINE_CONFIG_END
// the US release uses a H6280 instead of a Z80, much like Lock 'n' Loaded
MACHINE_CONFIG_START(nslasher_state::nslasheru)
nslasher(config);
+
MCFG_DEVICE_REPLACE("audiocpu", H6280, 32220000/8)
MCFG_DEVICE_PROGRAM_MAP(h6280_sound_map)
+ MCFG_DEVICE_REMOVE("sound_irq_merger")
+
MCFG_DEVICE_MODIFY("ymsnd")
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
- MCFG_DEVICE_REMOVE("ioprot")
- MCFG_DECO104_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_DECO146_IN_PORTB_CB(READLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
- MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1"))
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
+ m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/decwritr.cpp b/src/mame/drivers/decwritr.cpp
index 8290ac08105..34753234ef9 100644
--- a/src/mame/drivers/decwritr.cpp
+++ b/src/mame/drivers/decwritr.cpp
@@ -429,15 +429,15 @@ MACHINE_CONFIG_START(decwriter_state::la120)
//MCFG_DC305_OUT_TXC_CB(WRITELINE("usart", i8251_device, write_txc))
//MCFG_DC305_OUT_INT_CB(WRITELINE("mainint", input_merger_device, in_w<0>))
- MCFG_DEVICE_ADD("ledlatch", LS259, 0) // E2 on keyboard
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // ON LINE
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led2")) MCFG_DEVCB_INVERT // LOCAL
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led3")) MCFG_DEVCB_INVERT // ALT CHAR SET
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led4")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led5")) MCFG_DEVCB_INVERT // CTS
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led6")) MCFG_DEVCB_INVERT // DSR
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led7")) MCFG_DEVCB_INVERT // SETUP
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led8")) MCFG_DEVCB_INVERT // PAPER OUT
+ LS259(config, m_ledlatch); // E2 on keyboard
+ m_ledlatch->q_out_cb<0>().set_output("led1").invert(); // ON LINE
+ m_ledlatch->q_out_cb<1>().set_output("led2").invert(); // LOCAL
+ m_ledlatch->q_out_cb<2>().set_output("led3").invert(); // ALT CHAR SET
+ m_ledlatch->q_out_cb<3>().set_output("led4").invert();
+ m_ledlatch->q_out_cb<4>().set_output("led5").invert(); // CTS
+ m_ledlatch->q_out_cb<5>().set_output("led6").invert(); // DSR
+ m_ledlatch->q_out_cb<6>().set_output("led7").invert(); // SETUP
+ m_ledlatch->q_out_cb<7>().set_output("led8").invert(); // PAPER OUT
//MCFG_DEFAULT_LAYOUT( layout_la120 )
diff --git a/src/mame/drivers/destroyr.cpp b/src/mame/drivers/destroyr.cpp
index 07fdbad8d54..da185a09194 100644
--- a/src/mame/drivers/destroyr.cpp
+++ b/src/mame/drivers/destroyr.cpp
@@ -472,9 +472,9 @@ MACHINE_CONFIG_START(destroyr_state::destroyr)
MCFG_DEVICE_PROGRAM_MAP(destroyr_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(destroyr_state, irq0_line_assert, 4*60)
- MCFG_DEVICE_ADD("outlatch", F9334, 0) // F8
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // LED 1
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // LED 2 (no second LED present on cab)
+ f9334_device &outlatch(F9334(config, "outlatch")); // F8
+ outlatch.q_out_cb<0>().set_output("led0").invert(); // LED 1
+ outlatch.q_out_cb<1>().set_output("led1").invert(); // LED 2 (no second LED present on cab)
// Q2 => songate
// Q3 => launch
// Q4 => explosion
diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp
index 667bc2a9a90..9ce2b3f3273 100644
--- a/src/mame/drivers/dietgo.cpp
+++ b/src/mame/drivers/dietgo.cpp
@@ -252,13 +252,13 @@ MACHINE_CONFIG_START(dietgo_state::dietgo)
MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
- MCFG_DECO104_ADD("ioprot104")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
- MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
- MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
+ DECO104PROT(config, m_deco104, 0);
+ m_deco104->port_a_cb().set_ioport("INPUTS");
+ m_deco104->port_b_cb().set_ioport("SYSTEM");
+ m_deco104->port_c_cb().set_ioport("DSW");
+ m_deco104->soundlatch_irq_cb().set_inputline(m_audiocpu, 0);
+ m_deco104->set_interface_scramble_interleave();
+ m_deco104->set_use_magic_read_address_xor(true);
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp
index 340571645eb..284199f4f5c 100644
--- a/src/mame/drivers/divebomb.cpp
+++ b/src/mame/drivers/divebomb.cpp
@@ -437,16 +437,16 @@ MACHINE_CONFIG_START(divebomb_state::divebomb)
MCFG_VIDEO_START_OVERRIDE(divebomb_state, divebomb)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(256, 256)
- MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1-32)
- MCFG_SCREEN_UPDATE_DRIVER(divebomb_state, screen_update_divebomb)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("fgcpu", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("spritecpu", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("rozcpu", INPUT_LINE_NMI))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(256, 256);
+ screen.set_visarea(0, 256-1, 0, 256-1-32);
+ screen.set_screen_update(FUNC(divebomb_state::screen_update_divebomb));
+ screen.set_palette("palette");
+ screen.screen_vblank().set_inputline(m_fgcpu, INPUT_LINE_NMI);
+ screen.screen_vblank().append_inputline(m_spritecpu, INPUT_LINE_NMI);
+ screen.screen_vblank().append_inputline(m_rozcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_divebomb)
MCFG_PALETTE_ADD("palette", 0x400+0x400+0x400+0x100)
diff --git a/src/mame/drivers/dkong.cpp b/src/mame/drivers/dkong.cpp
index c0252f2cbdf..c8e760fb189 100644
--- a/src/mame/drivers/dkong.cpp
+++ b/src/mame/drivers/dkong.cpp
@@ -1695,7 +1695,7 @@ WRITE_LINE_MEMBER(dkong_state::busreq_w )
MACHINE_CONFIG_START(dkong_state::dkong_base)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, CLOCK_1H)
+ MCFG_DEVICE_ADD(m_maincpu, Z80, CLOCK_1H)
MCFG_DEVICE_PROGRAM_MAP(dkong_map)
MCFG_MACHINE_START_OVERRIDE(dkong_state,dkong2b)
@@ -1710,7 +1710,7 @@ MACHINE_CONFIG_START(dkong_state::dkong_base)
MCFG_I8257_REVERSE_RW_MODE(1) // why?
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
MCFG_SCREEN_UPDATE_DRIVER(dkong_state, screen_update_dkong)
MCFG_SCREEN_PALETTE("palette")
@@ -1791,7 +1791,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(dkong_state::dkong3)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(8'000'000) / 2) /* verified in schematics */
+ MCFG_DEVICE_ADD(m_maincpu, Z80, XTAL(8'000'000) / 2) /* verified in schematics */
MCFG_DEVICE_PROGRAM_MAP(dkong3_map)
MCFG_DEVICE_IO_MAP(dkong3_io_map)
@@ -1803,13 +1803,13 @@ MACHINE_CONFIG_START(dkong_state::dkong3)
MCFG_Z80DMA_OUT_MREQ_CB(WRITE8(*this, dkong_state, memory_write_byte))
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
- MCFG_SCREEN_UPDATE_DRIVER(dkong_state, screen_update_dkong)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, dkong_state, vblank_irq))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("n2a03a", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("n2a03b", INPUT_LINE_NMI))
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
+ m_screen->set_screen_update(FUNC(dkong_state::screen_update_dkong));
+ m_screen->set_palette(m_palette);
+ m_screen->screen_vblank().set(FUNC(dkong_state::vblank_irq));
+ m_screen->screen_vblank().append_inputline(m_dev_n2a03a, INPUT_LINE_NMI);
+ m_screen->screen_vblank().append_inputline(m_dev_n2a03b, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dkong)
MCFG_PALETTE_ADD("palette", DK3_PALETTE_LENGTH)
@@ -1839,8 +1839,7 @@ MACHINE_CONFIG_START(dkong_state::pestplce)
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_INIT_OWNER(dkong_state,dkong2b) /* wrong! */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(dkong_state, screen_update_pestplce)
+ m_screen->set_screen_update(FUNC(dkong_state::screen_update_pestplce));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(dkong_state::dkong3b)
@@ -1861,15 +1860,14 @@ MACHINE_CONFIG_START(dkong_state::s2650)
dkong2b(config);
/* basic machine hardware */
- MCFG_DEVICE_REPLACE("maincpu", S2650, CLOCK_1H / 2) /* ??? */
+ MCFG_DEVICE_REPLACE(m_maincpu, S2650, CLOCK_1H / 2) /* ??? */
MCFG_DEVICE_PROGRAM_MAP(s2650_map)
MCFG_DEVICE_IO_MAP(s2650_io_map)
MCFG_DEVICE_DATA_MAP(s2650_data_map)
MCFG_S2650_SENSE_INPUT(READLINE("screen", screen_device, vblank))
MCFG_S2650_FLAG_OUTPUT(WRITELINE(*this, dkong_state, s2650_fo_w))
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, dkong_state, s2650_interrupt))
+ m_screen->screen_vblank().set(FUNC(dkong_state::s2650_interrupt));
MCFG_DEVICE_MODIFY("dma8257")
MCFG_I8257_IN_MEMR_CB(READ8(*this, dkong_state, hb_dma_read_byte))
@@ -1878,11 +1876,11 @@ MACHINE_CONFIG_START(dkong_state::s2650)
MCFG_MACHINE_START_OVERRIDE(dkong_state,s2650)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(dkong_state::herbiedk)
+void dkong_state::herbiedk(machine_config &config)
+{
s2650(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_S2650_SENSE_INPUT(READLINE("screen", screen_device, vblank)) MCFG_DEVCB_INVERT // ???
-MACHINE_CONFIG_END
+ downcast<s2650_device &>(*m_maincpu).sense_handler().set(m_screen, FUNC(screen_device::vblank)).invert(); // ???
+}
MACHINE_CONFIG_START(dkong_state::spclforc)
herbiedk(config);
@@ -1891,8 +1889,7 @@ MACHINE_CONFIG_START(dkong_state::spclforc)
MCFG_DEVICE_REMOVE("soundcpu")
/* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(dkong_state, screen_update_spclforc)
+ m_screen->set_screen_update(FUNC(dkong_state::screen_update_spclforc));
MACHINE_CONFIG_END
/*************************************
diff --git a/src/mame/drivers/dmax8000.cpp b/src/mame/drivers/dmax8000.cpp
index ae667a9ae28..8e2bb019f5d 100644
--- a/src/mame/drivers/dmax8000.cpp
+++ b/src/mame/drivers/dmax8000.cpp
@@ -159,18 +159,18 @@ MACHINE_CONFIG_START(dmax8000_state::dmax8000)
MCFG_DEVICE_IO_MAP(dmax8000_io)
MCFG_MACHINE_RESET_OVERRIDE(dmax8000_state, dmax8000)
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 4'000'000 / 2) // 2MHz
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg2))
-
- MCFG_DEVICE_ADD("ctc", Z80CTC, 4'000'000)
- MCFG_Z80CTC_ZC0_CB(WRITELINE("dart1", z80dart_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart1", z80dart_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart2", z80dart_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart2", z80dart_device, txca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("dart2", z80dart_device, rxtxcb_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("dart1", z80dart_device, rxtxcb_w))
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 4_MHz_XTAL / 2)); // 2MHz
+ ctc_clock.signal_handler().set("ctc", FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg1));
+ ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg2));
+
+ z80ctc_device &ctc(Z80CTC(config, "ctc", 4_MHz_XTAL));
+ ctc.zc_callback<0>().set("dart1", FUNC(z80dart_device::rxca_w));
+ ctc.zc_callback<0>().append("dart1", FUNC(z80dart_device::txca_w));
+ ctc.zc_callback<0>().append("dart2", FUNC(z80dart_device::rxca_w));
+ ctc.zc_callback<0>().append("dart2", FUNC(z80dart_device::txca_w));
+ ctc.zc_callback<1>().set("dart2", FUNC(z80dart_device::rxtxcb_w));
+ ctc.zc_callback<2>().set("dart1", FUNC(z80dart_device::rxtxcb_w));
MCFG_DEVICE_ADD("dart1", Z80DART, 4'000'000) // A = terminal; B = aux
MCFG_Z80DART_OUT_TXDA_CB(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/dms86.cpp b/src/mame/drivers/dms86.cpp
index 40cff98c1d7..20127eb5637 100644
--- a/src/mame/drivers/dms86.cpp
+++ b/src/mame/drivers/dms86.cpp
@@ -135,38 +135,39 @@ void dms86_state::kbd_put(u8 data)
MACHINE_CONFIG_START(dms86_state::dms86)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8086, XTAL(14'745'600) / 3) // according to the manual... hmm
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
- MCFG_DEVICE_IO_MAP(io_map)
+ I8086(config, m_maincpu, XTAL(14'745'600) / 3); // according to the manual... hmm
+ m_maincpu->set_addrmap(AS_PROGRAM, &dms86_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &dms86_state::io_map);
// According to the manual the clock is 14,765,600 / 4 but that couldn't possibly work.
// By maths, clock should be 9600*32*4*16 = 19,660,800 but not working either
// So, commented out because it makes the whole thing crawl, only get 18% on my machine
- //MCFG_DEVICE_ADD("ctc_clock", CLOCK, 19660800) //XTAL(14'745'600) / 4)
- //MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc" ,z80ctc_device, trg0))
- //MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc" ,z80ctc_device, trg1))
- //MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc" ,z80ctc_device, trg2))
-
- MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(14'745'600) / 3)
- //MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) // frame rate interrupt to maincpu
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio1", z80sio_device, rxtxcb_w)) // SIO1 Ch B
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio1", z80sio_device, txca_w)) // SIO1 Ch A
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1" ,z80sio_device, rxca_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("sio2", z80sio_device, rxtxcb_w)) // SIO2
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2" ,z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2" ,z80sio_device, rxca_w))
-
- MCFG_DEVICE_ADD("sio1", Z80SIO, XTAL(14'745'600) / 3)
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs232", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs232", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs232", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("sio1", z80sio_device, rxb_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("sio1", z80sio_device, dcdb_w)) // HiNet / Monitor switch
- MCFG_RS232_CTS_HANDLER(WRITELINE("sio1", z80sio_device, ctsb_w)) MCFG_DEVCB_INVERT
-
- MCFG_DEVICE_ADD("sio2", Z80SIO, XTAL(14'745'600) / 3)
+ //clock_device &ctc_clock(CLOCK(config, "ctc_clock", 19660800)); //XTAL(14'745'600) / 4
+ //ctc_clock.signal_handler().set(m_ctc, FUNC(z80ctc_device::trg0));
+ //ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg1));
+ //ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg2));
+
+ Z80CTC(config, m_ctc, XTAL(14'745'600) / 3);
+ //m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); // frame rate interrupt to maincpu
+ m_ctc->zc_callback<0>().set(m_sio[0], FUNC(z80sio_device::rxtxcb_w)); // SIO1 Ch B
+ m_ctc->zc_callback<1>().set(m_sio[0], FUNC(z80sio_device::txca_w)); // SIO1 Ch A
+ m_ctc->zc_callback<1>().append(m_sio[0], FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<2>().set(m_sio[1], FUNC(z80sio_device::rxtxcb_w)); // SIO2
+ m_ctc->zc_callback<2>().append(m_sio[1], FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<2>().append(m_sio[1], FUNC(z80sio_device::rxca_w));
+
+ Z80SIO(config, m_sio[0], XTAL(14'745'600) / 3);
+ m_sio[0]->out_txdb_callback().set("rs232", FUNC(rs232_port_device::write_txd));
+ m_sio[0]->out_dtrb_callback().set("rs232", FUNC(rs232_port_device::write_dtr));
+ m_sio[0]->out_rtsb_callback().set("rs232", FUNC(rs232_port_device::write_rts));
+
+ Z80SIO(config, m_sio[1], XTAL(14'745'600) / 3);
+
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr));
+ rs232.rxd_handler().set(m_sio[0], FUNC(z80sio_device::rxb_w));
+ rs232.dcd_handler().set(m_sio[0], FUNC(z80sio_device::dcdb_w)); // HiNet / Monitor switch
+ rs232.cts_handler().set(m_sio[0], FUNC(z80sio_device::ctsb_w)).invert();
+
MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(dms86_state, kbd_put))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dmv.cpp b/src/mame/drivers/dmv.cpp
index 01466c1edf4..28317f8ab69 100644
--- a/src/mame/drivers/dmv.cpp
+++ b/src/mame/drivers/dmv.cpp
@@ -806,20 +806,20 @@ MACHINE_CONFIG_START(dmv_state::dmv)
MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(dmv_state, hgdc_display_pixels)
MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(dmv_state, hgdc_draw_text)
- MCFG_DEVICE_ADD( "dma8237", AM9517A, XTAL(4'000'000) )
- MCFG_I8237_OUT_HREQ_CB(WRITELINE(*this, dmv_state, dma_hrq_changed))
- MCFG_I8237_OUT_EOP_CB(WRITELINE(*this, dmv_state, dmac_eop))
- MCFG_I8237_IN_MEMR_CB(READ8(*this, dmv_state, program_r))
- MCFG_I8237_OUT_MEMW_CB(WRITE8(*this, dmv_state, program_w))
- MCFG_I8237_IN_IOR_0_CB(LOGGER("Read DMA CH1"))
- MCFG_I8237_OUT_IOW_0_CB(LOGGER("Write DMA CH1"))
- MCFG_I8237_IN_IOR_1_CB(LOGGER("Read DMA CH2"))
- MCFG_I8237_OUT_IOW_1_CB(LOGGER("Write DMA CH2"))
- MCFG_I8237_IN_IOR_2_CB(READ8("upd7220", upd7220_device, dack_r))
- MCFG_I8237_OUT_IOW_2_CB(WRITE8("upd7220", upd7220_device, dack_w))
- MCFG_I8237_IN_IOR_3_CB(READ8("i8272", i8272a_device, mdma_r))
- MCFG_I8237_OUT_IOW_3_CB(WRITE8("i8272", i8272a_device, mdma_w))
- MCFG_I8237_OUT_DACK_3_CB(WRITELINE(*this, dmv_state, dmac_dack3))
+ AM9517A(config, m_dmac, 4_MHz_XTAL);
+ m_dmac->out_hreq_callback().set(FUNC(dmv_state::dma_hrq_changed));
+ m_dmac->out_eop_callback().set(FUNC(dmv_state::dmac_eop));
+ m_dmac->in_memr_callback().set(FUNC(dmv_state::program_r));
+ m_dmac->out_memw_callback().set(FUNC(dmv_state::program_w));
+ m_dmac->in_ior_callback<0>().set_log("Read DMA CH1");
+ m_dmac->out_iow_callback<0>().set_log("Write DMA CH1");
+ m_dmac->in_ior_callback<1>().set_log("Read DMA CH2");
+ m_dmac->out_iow_callback<1>().set_log("Write DMA CH2");
+ m_dmac->in_ior_callback<2>().set(m_hgdc, FUNC(upd7220_device::dack_r));
+ m_dmac->out_iow_callback<2>().set(m_hgdc, FUNC(upd7220_device::dack_w));
+ m_dmac->in_ior_callback<3>().set(m_fdc, FUNC(i8272a_device::mdma_r));
+ m_dmac->out_iow_callback<3>().set(m_fdc, FUNC(i8272a_device::mdma_w));
+ m_dmac->out_dack_callback<3>().set(FUNC(dmv_state::dmac_dack3));
MCFG_I8272A_ADD( "i8272", true )
MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(*this, dmv_state, fdc_irq))
diff --git a/src/mame/drivers/docastle.cpp b/src/mame/drivers/docastle.cpp
index 37cc08a423b..25075d579bd 100644
--- a/src/mame/drivers/docastle.cpp
+++ b/src/mame/drivers/docastle.cpp
@@ -609,19 +609,19 @@ MACHINE_CONFIG_START(docastle_state::docastle)
MCFG_DEVICE_ADD("cpu3", Z80, XTAL(4'000'000))
MCFG_DEVICE_PROGRAM_MAP(docastle_map3)
- MCFG_DEVICE_ADD("inp1", TMS1025, 0)
- MCFG_TMS1025_READ_PORT_CB(PORT1, IOPORT("DSW2"))
- MCFG_TMS1025_READ_PORT_CB(PORT2, IOPORT("DSW1"))
- MCFG_TMS1025_READ_PORT_CB(PORT3, IOPORT("JOYS"))
- MCFG_TMS1025_READ_PORT_CB(PORT5, IOPORT("BUTTONS"))
- MCFG_TMS1025_READ_PORT_CB(PORT7, IOPORT("SYSTEM"))
-
- MCFG_DEVICE_ADD("inp2", TMS1025, 0)
- MCFG_TMS1025_READ_PORT_CB(PORT1, IOPORT("DSW2")) MCFG_DEVCB_RSHIFT(4)
- MCFG_TMS1025_READ_PORT_CB(PORT2, IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_TMS1025_READ_PORT_CB(PORT3, IOPORT("JOYS")) MCFG_DEVCB_RSHIFT(4)
- MCFG_TMS1025_READ_PORT_CB(PORT5, IOPORT("BUTTONS")) MCFG_DEVCB_RSHIFT(4)
- MCFG_TMS1025_READ_PORT_CB(PORT7, IOPORT("SYSTEM")) MCFG_DEVCB_RSHIFT(4)
+ TMS1025(config, m_inp[0]);
+ m_inp[0]->read_port1_callback().set_ioport("DSW2");
+ m_inp[0]->read_port2_callback().set_ioport("DSW1");
+ m_inp[0]->read_port3_callback().set_ioport("JOYS");
+ m_inp[0]->read_port5_callback().set_ioport("BUTTONS");
+ m_inp[0]->read_port7_callback().set_ioport("SYSTEM");
+
+ TMS1025(config, m_inp[1]);
+ m_inp[1]->read_port1_callback().set_ioport("DSW2").rshift(4);
+ m_inp[1]->read_port2_callback().set_ioport("DSW1").rshift(4);
+ m_inp[1]->read_port3_callback().set_ioport("JOYS").rshift(4);
+ m_inp[1]->read_port5_callback().set_ioport("BUTTONS").rshift(4);
+ m_inp[1]->read_port7_callback().set_ioport("SYSTEM").rshift(4);
MCFG_WATCHDOG_ADD("watchdog")
@@ -686,11 +686,9 @@ MACHINE_CONFIG_START(docastle_state::idsoccer)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(idsoccer_map)
- MCFG_DEVICE_MODIFY("inp1")
- MCFG_TMS1025_READ_PORT_CB(PORT4, IOPORT("JOYS_RIGHT"))
+ m_inp[0]->read_port4_callback().set_ioport("JOYS_RIGHT");
- MCFG_DEVICE_MODIFY("inp2")
- MCFG_TMS1025_READ_PORT_CB(PORT4, IOPORT("JOYS_RIGHT")) MCFG_DEVCB_RSHIFT(4)
+ m_inp[1]->read_port4_callback().set_ioport("JOYS_RIGHT").rshift(4);
/* video hardware */
MCFG_VIDEO_START_OVERRIDE(docastle_state,dorunrun)
diff --git a/src/mame/drivers/dragon.cpp b/src/mame/drivers/dragon.cpp
index aa3e95dc5be..3f49a441e61 100644
--- a/src/mame/drivers/dragon.cpp
+++ b/src/mame/drivers/dragon.cpp
@@ -252,10 +252,10 @@ MACHINE_CONFIG_START(dragon_state::dragon32)
MCFG_RAM_EXTRA_OPTIONS("64K")
// cartridge
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, dragon_cart, "dragon_fdc")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
+ cococart_slot_device &cartslot(COCOCART_SLOT(config, CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), dragon_cart, "dragon_fdc"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(dragon64_state::dragon64)
@@ -265,10 +265,10 @@ MACHINE_CONFIG_START(dragon64_state::dragon64)
MCFG_RAM_DEFAULT_SIZE("64K")
// cartridge
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, dragon_cart, "dragon_fdc")
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
+ cococart_slot_device &cartslot(COCOCART_SLOT(config, CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), dragon_cart, "dragon_fdc"));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
// acia
MCFG_DEVICE_ADD("acia", MOS6551, 0)
@@ -320,10 +320,10 @@ MACHINE_CONFIG_START(dragon_alpha_state::dgnalpha)
MCFG_RAM_DEFAULT_SIZE("64K")
// cartridge
- MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, dragon_cart, nullptr)
- MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(*this, coco_state, cart_w))
- MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI))
- MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT))
+ cococart_slot_device &cartslot(COCOCART_SLOT(config, CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), dragon_cart, nullptr));
+ cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
+ cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
// acia
MCFG_DEVICE_ADD("acia", MOS6551, 0)
diff --git a/src/mame/drivers/dragrace.cpp b/src/mame/drivers/dragrace.cpp
index 2c4c246707e..add002df6fc 100644
--- a/src/mame/drivers/dragrace.cpp
+++ b/src/mame/drivers/dragrace.cpp
@@ -303,28 +303,28 @@ MACHINE_CONFIG_START(dragrace_state::dragrace)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD("latch_f5", F9334, 0) // F5
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, dragrace_state, speed1_w)) MCFG_DEVCB_MASK(0x1f) // set 3SPEED1-7SPEED1
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_EXPLODE1_EN>)) // Explosion1 enable
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_SCREECH1_EN>)) // Screech1 enable
-
- MCFG_DEVICE_ADD("latch_a5", F9334, 0) // A5
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_KLEXPL1_EN>)) // KLEXPL1 enable
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_MOTOR1_EN>)) // Motor1 enable
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_ATTRACT_EN>)) // Attract enable
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_LOTONE_EN>)) // LoTone enable
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led0")) // Player 1 Start Lamp
-
- MCFG_DEVICE_ADD("latch_h5", F9334, 0) // H5
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, dragrace_state, speed2_w)) MCFG_DEVCB_MASK(0x1f) // set 3SPEED2-7SPEED2
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_EXPLODE2_EN>)) // Explosion2 enable
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_SCREECH2_EN>)) // Screech2 enable
-
- MCFG_DEVICE_ADD("latch_e5", F9334, 0) // E5
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_KLEXPL2_EN>)) // KLEXPL2 enable
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_MOTOR2_EN>)) // Motor2 enable
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line<DRAGRACE_HITONE_EN>)) // HiTone enable
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led1")) // Player 2 Start Lamp
+ f9334_device &latch_f5(F9334(config, "latch_f5")); // F5
+ latch_f5.parallel_out_cb().set(FUNC(dragrace_state::speed1_w)).mask(0x1f); // set 3SPEED1-7SPEED1
+ latch_f5.q_out_cb<5>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_EXPLODE1_EN>)); // Explosion1 enable
+ latch_f5.q_out_cb<6>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_SCREECH1_EN>)); // Screech1 enable
+
+ f9334_device &latch_a5(F9334(config, "latch_a5")); // A5
+ latch_a5.q_out_cb<1>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_KLEXPL1_EN>)); // KLEXPL1 enable
+ latch_a5.q_out_cb<3>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_MOTOR1_EN>)); // Motor1 enable
+ latch_a5.q_out_cb<4>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_ATTRACT_EN>)); // Attract enable
+ latch_a5.q_out_cb<5>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_LOTONE_EN>)); // LoTone enable
+ latch_a5.q_out_cb<7>().set_output("led0"); // Player 1 Start Lamp
+
+ f9334_device &latch_h5(F9334(config, "latch_h5")); // H5
+ latch_h5.parallel_out_cb().set(FUNC(dragrace_state::speed2_w)).mask(0x1f); // set 3SPEED2-7SPEED2
+ latch_h5.q_out_cb<5>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_EXPLODE2_EN>)); // Explosion2 enable
+ latch_h5.q_out_cb<6>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_SCREECH2_EN>)); // Screech2 enable
+
+ f9334_device &latch_e5(F9334(config, "latch_e5")); // E5
+ latch_e5.q_out_cb<1>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_KLEXPL2_EN>)); // KLEXPL2 enable
+ latch_e5.q_out_cb<3>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_MOTOR2_EN>)); // Motor2 enable
+ latch_e5.q_out_cb<5>().set(m_discrete, FUNC(discrete_device::write_line<DRAGRACE_HITONE_EN>)); // HiTone enable
+ latch_e5.q_out_cb<7>().set_output("led1"); // Player 2 Start Lamp
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp
index 1d5898dd323..58ad56e82c8 100644
--- a/src/mame/drivers/dreambal.cpp
+++ b/src/mame/drivers/dreambal.cpp
@@ -35,8 +35,8 @@ lamps?
class dreambal_state : public driver_device
{
public:
- dreambal_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ dreambal_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_deco104(*this, "ioprot104"),
m_deco_tilegen1(*this, "tilegen1"),
@@ -333,10 +333,10 @@ MACHINE_CONFIG_START(dreambal_state::dreambal)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT) // 93lc46b
- MCFG_DECO104_ADD("ioprot104")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
- MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
+ DECO104PROT(config, m_deco104, 0);
+ m_deco104->port_a_cb().set_ioport("INPUTS");
+ m_deco104->port_b_cb().set_ioport("SYSTEM");
+ m_deco104->port_c_cb().set_ioport("DSW");
MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0)
MCFG_DECO16IC_SPLIT(0)
diff --git a/src/mame/drivers/dsb46.cpp b/src/mame/drivers/dsb46.cpp
index 9c1bdfb8b05..b837f49e93e 100644
--- a/src/mame/drivers/dsb46.cpp
+++ b/src/mame/drivers/dsb46.cpp
@@ -118,9 +118,9 @@ MACHINE_CONFIG_START(dsb46_state::dsb46)
MCFG_MACHINE_RESET_OVERRIDE(dsb46_state, dsb46)
/* video hardware */
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, XTAL(1'843'200))
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc1", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc1", z80ctc_device, trg2))
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 1.8432_MHz_XTAL));
+ ctc_clock.signal_handler().set("ctc1", FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append("ctc1", FUNC(z80ctc_device::trg2));
/* Devices */
MCFG_DEVICE_ADD("sio", Z80SIO, XTAL(24'000'000) / 6)
@@ -133,12 +133,12 @@ MACHINE_CONFIG_START(dsb46_state::dsb46)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio", z80sio_device, rxa_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio", z80sio_device, ctsa_w))
- MCFG_DEVICE_ADD("ctc1", Z80CTC, XTAL(24'000'000) / 6)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, txca_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("sio", z80sio_device, rxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, txcb_w))
+ z80ctc_device &ctc1(Z80CTC(config, "ctc1", 24_MHz_XTAL / 6));
+ ctc1.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ ctc1.zc_callback<0>().set("sio", FUNC(z80sio_device::rxca_w));
+ ctc1.zc_callback<0>().append("sio", FUNC(z80sio_device::txca_w));
+ ctc1.zc_callback<2>().set("sio", FUNC(z80sio_device::rxcb_w));
+ ctc1.zc_callback<2>().append("sio", FUNC(z80sio_device::txcb_w));
MACHINE_CONFIG_END
ROM_START( dsb46 )
diff --git a/src/mame/drivers/duet16.cpp b/src/mame/drivers/duet16.cpp
index ea63a71948c..24936f8b167 100644
--- a/src/mame/drivers/duet16.cpp
+++ b/src/mame/drivers/duet16.cpp
@@ -371,22 +371,22 @@ MACHINE_CONFIG_START(duet16_state::duet16)
MCFG_AM9517A_OUT_IOW_0_CB(WRITE8("fdc", upd765a_device, mdma_w))
MCFG_AM9517A_OUT_EOP_CB(WRITELINE("fdc", upd765a_device, tc_line_w))
- MCFG_DEVICE_ADD("bgpit", PIT8253, 0)
- MCFG_PIT8253_CLK0(8_MHz_XTAL / 13)
- MCFG_PIT8253_CLK1(8_MHz_XTAL / 13)
- MCFG_PIT8253_CLK2(8_MHz_XTAL / 13)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("sio", upd7201_new_device, txca_w)) // TODO: selected through LS153
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", upd7201_new_device, rxca_w))
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("sio", upd7201_new_device, txcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", upd7201_new_device, rxcb_w))
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE("kbusart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("kbusart", i8251_device, write_rxc))
-
- MCFG_DEVICE_ADD("itm", PTM6840, 0)
- MCFG_PTM6840_EXTERNAL_CLOCKS(0.0, 0.0, (8_MHz_XTAL / 8).dvalue()) // C3 = 1MHz
- MCFG_PTM6840_O3_CB(WRITELINE("itm", ptm6840_device, set_c1)) // C1 = C2 = O3
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("itm", ptm6840_device, set_c2))
- MCFG_PTM6840_IRQ_CB(WRITELINE("tmint", input_merger_device, in_w<0>))
+ pit8253_device &bgpit(PIT8253(config, "bgpit", 0));
+ bgpit.set_clk<0>(8_MHz_XTAL / 13);
+ bgpit.set_clk<1>(8_MHz_XTAL / 13);
+ bgpit.set_clk<2>(8_MHz_XTAL / 13);
+ bgpit.out_handler<0>().set("sio", FUNC(upd7201_new_device::txca_w)); // TODO: selected through LS153
+ bgpit.out_handler<0>().append("sio", FUNC(upd7201_new_device::rxca_w));
+ bgpit.out_handler<1>().set("sio", FUNC(upd7201_new_device::txcb_w));
+ bgpit.out_handler<1>().append("sio", FUNC(upd7201_new_device::rxcb_w));
+ bgpit.out_handler<2>().set("kbusart", FUNC(i8251_device::write_txc));
+ bgpit.out_handler<2>().append("kbusart", FUNC(i8251_device::write_rxc));
+
+ ptm6840_device &itm(PTM6840(config, "itm", 0));
+ itm.set_external_clocks(0.0, 0.0, (8_MHz_XTAL / 8).dvalue()); // C3 = 1MHz
+ itm.o3_callback().set("itm", FUNC(ptm6840_device::set_c1)); // C1 = C2 = O3
+ itm.o3_callback().append("itm", FUNC(ptm6840_device::set_c2));
+ itm.irq_callback().set(m_tmint, FUNC(input_merger_device::in_w<0>));
MCFG_DEVICE_ADD("sio", UPD7201_NEW, 8_MHz_XTAL / 2)
MCFG_Z80SIO_OUT_INT_CB(WRITELINE("pic", pic8259_device, ir1_w)) // INT5
diff --git a/src/mame/drivers/dynamoah.cpp b/src/mame/drivers/dynamoah.cpp
index 95fcd2a3cba..a3046fba105 100644
--- a/src/mame/drivers/dynamoah.cpp
+++ b/src/mame/drivers/dynamoah.cpp
@@ -73,21 +73,22 @@ void dynamoah_state::i8031_ext_mem(address_map &map)
map(0x0000, 0xffff).rw(FUNC(dynamoah_state::ext_r), FUNC(dynamoah_state::ext_w));
}
-MACHINE_CONFIG_START(dynamoah_state::dynamoah)
- MCFG_DEVICE_ADD("maincpu", I80C31, 6'144'000) // SC80C31BCCN40
+void dynamoah_state::dynamoah(machine_config &config)
+{
+ i80c31_device &maincpu(I80C31(config, "maincpu", 6'144'000)); // SC80C31BCCN40
// clock needs verification, being the XTAL value from a different board
- MCFG_DEVICE_PROGRAM_MAP(i8031_mem)
- MCFG_DEVICE_IO_MAP(i8031_ext_mem)
- MCFG_MCS51_PORT_P1_IN_CB(READLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(7)
- MCFG_DEVCB_CHAIN_INPUT(CONSTANT(0x7f))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(7)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(6)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITE8(*this, dynamoah_state, p1_w)) MCFG_DEVCB_MASK(0x1f)
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, dynamoah_state, p3_w))
-
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
-MACHINE_CONFIG_END
+ maincpu.set_addrmap(AS_PROGRAM, &dynamoah_state::i8031_mem);
+ maincpu.set_addrmap(AS_IO, &dynamoah_state::i8031_ext_mem);
+ maincpu.port_in_cb<1>().set("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)).lshift(7);
+ maincpu.port_in_cb<1>().append_constant(0x7f).mask(0x7f);
+ maincpu.port_out_cb<1>().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(7);
+ maincpu.port_out_cb<1>().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(6);
+ maincpu.port_out_cb<1>().append("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(5);
+ maincpu.port_out_cb<1>().append(FUNC(dynamoah_state::p1_w)).mask(0x1f);
+ maincpu.port_out_cb<3>().set(FUNC(dynamoah_state::p3_w));
+
+ EEPROM_SERIAL_93C46_16BIT(config, "eeprom");
+}
static INPUT_PORTS_START(dynamoah)
INPUT_PORTS_END
diff --git a/src/mame/drivers/dynax.cpp b/src/mame/drivers/dynax.cpp
index 9fadb6e3b8d..4b202833365 100644
--- a/src/mame/drivers/dynax.cpp
+++ b/src/mame/drivers/dynax.cpp
@@ -4262,15 +4262,15 @@ MACHINE_CONFIG_START(dynax_state::hanamai)
MCFG_DEVICE_ADD("mainirq", RST_POS_BUFFER, 0)
MCFG_RST_BUFFER_INT_CALLBACK(INPUTLINE("maincpu", 0))
- MCFG_DEVICE_ADD("mainlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("msm", msm5205_device, reset_w)) MCFG_DEVCB_INVERT // MSM5205 reset
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, dynax_state, adpcm_reset_kludge_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, dynax_state, flipscreen_w)) // Flip Screen
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, dynax_state, coincounter_0_w)) // Coin Counters
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, dynax_state, coincounter_1_w)) //
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, dynax_state, blitter_ack_w)) // Blitter IRQ Ack
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, dynax_state, blit_palbank_w)) // Layers Palettes (High Bit)
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, dynax_state, layer_half_w)) // half of the interleaved layer to write to
+ LS259(config, m_mainlatch);
+ m_mainlatch->q_out_cb<0>().set(m_msm, FUNC(msm5205_device::reset_w)).invert(); // MSM5205 reset
+ m_mainlatch->q_out_cb<0>().append(FUNC(dynax_state::adpcm_reset_kludge_w));
+ m_mainlatch->q_out_cb<1>().set(FUNC(dynax_state::flipscreen_w)); // Flip Screen
+ m_mainlatch->q_out_cb<2>().set(FUNC(dynax_state::coincounter_0_w)); // Coin Counters
+ m_mainlatch->q_out_cb<3>().set(FUNC(dynax_state::coincounter_1_w)); //
+ m_mainlatch->q_out_cb<4>().set(FUNC(dynax_state::blitter_ack_w)); // Blitter IRQ Ack
+ m_mainlatch->q_out_cb<6>().set(FUNC(dynax_state::blit_palbank_w)); // Layers Palettes (High Bit)
+ m_mainlatch->q_out_cb<7>().set(FUNC(dynax_state::layer_half_w)); // half of the interleaved layer to write to
/* video hardware */
MCFG_SCREEN_ADD(m_screen, RASTER)
@@ -4815,12 +4815,10 @@ MACHINE_CONFIG_START(dynax_state::mjelctrn)
MCFG_DEVICE_REMOVE("mainirq")
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) MCFG_DEVCB_INVERT
+ m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert();
- MCFG_DEVICE_MODIFY("blitter")
- MCFG_DYNAX_BLITTER_REV2_READY_CB(WRITELINE("maincpu", tmpz84c015_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("maincpu", tmpz84c015_device, trg2))
+ m_blitter->ready_cb().set(m_maincpu, FUNC(tmpz84c015_device::trg1));
+ m_blitter->ready_cb().append(m_maincpu, FUNC(tmpz84c015_device::trg2));
MCFG_VIDEO_START_OVERRIDE(dynax_state,mjelctrn)
MACHINE_CONFIG_END
@@ -4901,13 +4899,13 @@ MACHINE_CONFIG_START(dynax_state::tenkai)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 10C on Ougon no Hai
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, dynax_state, flipscreen_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, dynax_state, layer_half_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, dynax_state, layer_half2_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, dynax_state, tenkai_6c_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, dynax_state, tenkai_70_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, dynax_state, tenkai_blitter_ack_w))
+ LS259(config, m_mainlatch); // 10C on Ougon no Hai
+ m_mainlatch->q_out_cb<0>().set(FUNC(dynax_state::flipscreen_w)).invert();
+ m_mainlatch->q_out_cb<1>().set(FUNC(dynax_state::layer_half_w));
+ m_mainlatch->q_out_cb<2>().set(FUNC(dynax_state::layer_half2_w));
+ m_mainlatch->q_out_cb<3>().set(FUNC(dynax_state::tenkai_6c_w));
+ m_mainlatch->q_out_cb<4>().set(FUNC(dynax_state::tenkai_70_w));
+ m_mainlatch->q_out_cb<7>().set(FUNC(dynax_state::tenkai_blitter_ack_w));
/* video hardware */
MCFG_SCREEN_ADD(m_screen, RASTER)
diff --git a/src/mame/drivers/dynduke.cpp b/src/mame/drivers/dynduke.cpp
index 343f1165d81..f6bb951a762 100644
--- a/src/mame/drivers/dynduke.cpp
+++ b/src/mame/drivers/dynduke.cpp
@@ -333,17 +333,17 @@ MACHINE_CONFIG_START(dynduke_state::dynduke)
MCFG_QUANTUM_TIME(attotime::from_hz(3600))
// video hardware
- MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16)
-
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(dynduke_state, screen_update)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram16_device, vblank_copy_rising))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, dynduke_state, vblank_irq))
- MCFG_SCREEN_PALETTE("palette")
+ BUFFERED_SPRITERAM16(config, m_spriteram);
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(dynduke_state::screen_update));
+ screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram16_device::vblank_copy_rising));
+ screen.screen_vblank().append(FUNC(dynduke_state::vblank_irq));
+ screen.set_palette(m_palette);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dynduke)
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp
index 8c002b3b8d9..e7d3b4072a2 100644
--- a/src/mame/drivers/einstein.cpp
+++ b/src/mame/drivers/einstein.cpp
@@ -602,10 +602,10 @@ MACHINE_CONFIG_START(einstein_state::einstein)
MCFG_Z80CTC_ZC1_CB(WRITELINE(IC_I060, i8251_device, write_rxc))
MCFG_Z80CTC_ZC2_CB(WRITELINE(IC_I058, z80ctc_device, trg3))
- MCFG_CLOCK_ADD("ctc_trigger", XTAL_X002 / 4)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(IC_I058, z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(IC_I058, z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(IC_I058, z80ctc_device, trg2))
+ clock_device &ctc_trigger(CLOCK(config, "ctc_trigger", XTAL_X002 / 4));
+ ctc_trigger.signal_handler().set(IC_I058, FUNC(z80ctc_device::trg0));
+ ctc_trigger.signal_handler().append(IC_I058, FUNC(z80ctc_device::trg1));
+ ctc_trigger.signal_handler().append(IC_I058, FUNC(z80ctc_device::trg2));
/* Einstein daisy chain support for non-Z80 devices */
MCFG_Z80DAISY_GENERIC_ADD("keyboard_daisy", 0xf7)
diff --git a/src/mame/drivers/eti660.cpp b/src/mame/drivers/eti660.cpp
index e298606cb5a..dd82f324952 100644
--- a/src/mame/drivers/eti660.cpp
+++ b/src/mame/drivers/eti660.cpp
@@ -311,7 +311,7 @@ MACHINE_CONFIG_START(eti660_state::eti660)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, XTAL(8'867'238)/5)
MCFG_DEVICE_PROGRAM_MAP(mem_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, eti660_state, clear_r))
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, eti660_state, ef2_r))
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, eti660_state, ef4_r))
@@ -324,16 +324,16 @@ MACHINE_CONFIG_START(eti660_state::eti660)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_CDP1864_ADD(CDP1864_TAG, SCREEN_TAG, XTAL(8'867'238)/5, GND, INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_INT), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_DMAOUT), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_EF1), NOOP, READLINE(*this, eti660_state, rdata_r), READLINE(*this, eti660_state, bdata_r), READLINE(*this, eti660_state, gdata_r))
+ MCFG_CDP1864_ADD(CDP1864_TAG, SCREEN_TAG, XTAL(8'867'238)/5, CONSTANT(0), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_INT), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_DMAOUT), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_EF1), NOOP, READLINE(*this, eti660_state, rdata_r), READLINE(*this, eti660_state, bdata_r), READLINE(*this, eti660_state, gdata_r))
MCFG_CDP1864_CHROMINANCE(RES_K(2.2), RES_K(1), RES_K(4.7), RES_K(4.7)) // R7, R5, R6, R4
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* devices */
- MCFG_DEVICE_ADD(MC6821_TAG, PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(*this, eti660_state, pia_pa_r))
- MCFG_PIA_WRITEPA_HANDLER(WRITE8(*this, eti660_state, pia_pa_w))
- MCFG_PIA_IRQA_HANDLER(INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_INT)) MCFG_DEVCB_INVERT
- MCFG_PIA_IRQB_HANDLER(INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_INT)) MCFG_DEVCB_INVERT
+ PIA6821(config, m_pia, 0);
+ m_pia->readpa_handler().set(FUNC(eti660_state::pia_pa_r));
+ m_pia->writepa_handler().set(FUNC(eti660_state::pia_pa_w));
+ m_pia->irqa_handler().set_inputline(m_maincpu, COSMAC_INPUT_LINE_INT).invert(); // FIXME: use an input merger for these lines
+ m_pia->irqb_handler().set_inputline(m_maincpu, COSMAC_INPUT_LINE_INT).invert();
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED)
diff --git a/src/mame/drivers/exterm.cpp b/src/mame/drivers/exterm.cpp
index 587a1504c37..8adb0b29721 100644
--- a/src/mame/drivers/exterm.cpp
+++ b/src/mame/drivers/exterm.cpp
@@ -391,17 +391,11 @@ MACHINE_CONFIG_START(exterm_state::exterm)
MCFG_TMS340X0_TO_SHIFTREG_CB(exterm_state, to_shiftreg_slave)
MCFG_TMS340X0_FROM_SHIFTREG_CB(exterm_state, from_shiftreg_slave)
- MCFG_DEVICE_ADD(m_audiocpu, M6502, 2000000)
- MCFG_DEVICE_PROGRAM_MAP(sound_master_map)
+ M6502(config, m_audiocpu, 2000000).set_addrmap(AS_PROGRAM, &exterm_state::sound_master_map);
+ M6502(config, m_audioslave, 2000000).set_addrmap(AS_PROGRAM, &exterm_state::sound_slave_map);
- MCFG_DEVICE_ADD(m_audioslave, M6502, 2000000)
- MCFG_DEVICE_PROGRAM_MAP(sound_slave_map)
-
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch[0])
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_audiocpu, M6502_IRQ_LINE))
-
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch[1])
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_audioslave, M6502_IRQ_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch[0]).data_pending_callback().set_inputline(m_audiocpu, M6502_IRQ_LINE);
+ GENERIC_LATCH_8(config, m_soundlatch[1]).data_pending_callback().set_inputline(m_audioslave, M6502_IRQ_LINE);
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
diff --git a/src/mame/drivers/f1gp.cpp b/src/mame/drivers/f1gp.cpp
index 9634e1f98f7..5ca58d73376 100644
--- a/src/mame/drivers/f1gp.cpp
+++ b/src/mame/drivers/f1gp.cpp
@@ -437,9 +437,9 @@ MACHINE_CONFIG_START(f1gp_state::f1gp)
MCFG_ACIA6850_IRQ_HANDLER(INPUTLINE("sub", M68K_IRQ_3))
MCFG_ACIA6850_TXD_HANDLER(WRITELINE("acia", acia6850_device, write_rxd)) // loopback for now
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 1000000) // guessed
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 1000000)); // guessed
+ acia_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -511,9 +511,9 @@ MACHINE_CONFIG_START(f1gp_state::f1gpb)
MCFG_ACIA6850_IRQ_HANDLER(INPUTLINE("sub", M68K_IRQ_3))
MCFG_ACIA6850_TXD_HANDLER(WRITELINE("acia", acia6850_device, write_rxd)) // loopback for now
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 1000000) // guessed
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 1000000)); // guessed
+ acia_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/fanucspmg.cpp b/src/mame/drivers/fanucspmg.cpp
index 2d8e59ba8d7..77a503c283b 100644
--- a/src/mame/drivers/fanucspmg.cpp
+++ b/src/mame/drivers/fanucspmg.cpp
@@ -1008,12 +1008,12 @@ MACHINE_CONFIG_START(fanucspmg_state::fanucspmg)
MCFG_DEVICE_ADD(PIC0_TAG, PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, fanucspmg_state, get_slave_ack))
MCFG_DEVICE_ADD(PIC1_TAG, PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(PIC0_TAG, pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_UPD765A_ADD(FDC_TAG, true, true)
MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(PIC0_TAG, pic8259_device, ir3_w))
diff --git a/src/mame/drivers/fc100.cpp b/src/mame/drivers/fc100.cpp
index 9fe28d2645d..44690eb1a6c 100644
--- a/src/mame/drivers/fc100.cpp
+++ b/src/mame/drivers/fc100.cpp
@@ -547,11 +547,11 @@ MACHINE_CONFIG_START(fc100_state::fc100)
MCFG_CASSETTE_FORMATS(fc100_cassette_formats)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
- MCFG_DEVICE_ADD("uart", I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE(*this, fc100_state, txdata_callback))
- MCFG_DEVICE_ADD("uart_clock", CLOCK, XTAL(4'915'200)/16/16) // gives 19200
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ I8251(config, m_uart, 0);
+ m_uart->txd_handler().set(FUNC(fc100_state::txdata_callback));
+ clock_device &uart_clock(CLOCK(config, "uart_clock", XTAL(4'915'200)/16/16)); // gives 19200
+ uart_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc));
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_c", fc100_state, timer_c, attotime::from_hz(4800)) // cass write
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_p", fc100_state, timer_p, attotime::from_hz(40000)) // cass read
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index ed6e52dedcd..e67036614bb 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -664,25 +664,25 @@ MACHINE_CONFIG_START(firefox_state::firefox)
MCFG_ADC0808_IN0_CB(IOPORT("PITCH"))
MCFG_ADC0808_IN1_CB(IOPORT("YAW"))
- MCFG_DEVICE_ADD("latch0", LS259, 0) // 7F
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("nvram_1c", x2212_device, recall)) // NVRECALL
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("nvram_1d", x2212_device, recall))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, firefox_state, sound_reset_w)) // RSTSOUND
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("nvram_1c", x2212_device, store)) // NVRSTORE
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("nvram_1d", x2212_device, store))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, firefox_state, firefox_disc_lock_w)) // LOCK
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, firefox_state, audio_enable_right_w)) // SWDSKR
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, firefox_state, audio_enable_left_w)) // SWDSKL
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, firefox_state, firefox_disc_reset_w)) // RSTDSK
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, firefox_state, firefox_disc_write_w)) // WRDSK
-
- MCFG_DEVICE_ADD("latch1", LS259, 0) // 1F
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, firefox_state, coin_counter_right_w)) // COIN COUNTERR
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, firefox_state, coin_counter_left_w)) // COIN COUNTERL
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led2")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led3")) MCFG_DEVCB_INVERT
+ ls259_device &latch0(LS259(config, "latch0")); // 7F
+ latch0.q_out_cb<0>().set(m_nvram_1c, FUNC(x2212_device::recall)); // NVRECALL
+ latch0.q_out_cb<0>().append(m_nvram_1d, FUNC(x2212_device::recall));
+ latch0.q_out_cb<1>().set(FUNC(firefox_state::sound_reset_w)); // RSTSOUND
+ latch0.q_out_cb<2>().set(m_nvram_1c, FUNC(x2212_device::store)); // NVRSTORE
+ latch0.q_out_cb<2>().append(m_nvram_1d, FUNC(x2212_device::store));
+ latch0.q_out_cb<3>().set(FUNC(firefox_state::firefox_disc_lock_w)); // LOCK
+ latch0.q_out_cb<4>().set(FUNC(firefox_state::audio_enable_right_w)); // SWDSKR
+ latch0.q_out_cb<5>().set(FUNC(firefox_state::audio_enable_left_w)); // SWDSKL
+ latch0.q_out_cb<6>().set(FUNC(firefox_state::firefox_disc_reset_w)); // RSTDSK
+ latch0.q_out_cb<7>().set(FUNC(firefox_state::firefox_disc_write_w)); // WRDSK
+
+ ls259_device &latch1(LS259(config, "latch1")); // 1F
+ latch1.q_out_cb<0>().set(FUNC(firefox_state::coin_counter_right_w)); // COIN COUNTERR
+ latch1.q_out_cb<1>().set(FUNC(firefox_state::coin_counter_left_w)); // COIN COUNTERL
+ latch1.q_out_cb<4>().set_output("led0").invert();
+ latch1.q_out_cb<5>().set_output("led1").invert();
+ latch1.q_out_cb<6>().set_output("led2").invert();
+ latch1.q_out_cb<7>().set_output("led3").invert();
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_hz(MASTER_XTAL/8/16/16/16/16))
diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp
index 20de8512052..be2cc9706c4 100644
--- a/src/mame/drivers/fmtowns.cpp
+++ b/src/mame/drivers/fmtowns.cpp
@@ -2812,12 +2812,12 @@ MACHINE_CONFIG_START(towns_state::towns_base)
MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, towns_state, get_slave_ack))
MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_master", pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("fdc", MB8877, 8'000'000 / 4) // clock unknown
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, towns_state,mb8877a_irq_w))
diff --git a/src/mame/drivers/ft68m.cpp b/src/mame/drivers/ft68m.cpp
index 35e414d4829..dfeb86ae78e 100644
--- a/src/mame/drivers/ft68m.cpp
+++ b/src/mame/drivers/ft68m.cpp
@@ -96,13 +96,13 @@ MACHINE_CONFIG_START(ft68m_state::ft68m)
MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs232b", rs232_port_device, write_txd))
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", M68K_IRQ_5))
- MCFG_DEVICE_ADD("stc", AM9513A, XTAL(19'660'800) / 8)
- MCFG_AM9513_OUT2_CALLBACK(INPUTLINE("maincpu", M68K_IRQ_6))
- MCFG_AM9513_OUT3_CALLBACK(INPUTLINE("maincpu", M68K_IRQ_7))
- MCFG_AM9513_OUT4_CALLBACK(WRITELINE("mpsc", upd7201_new_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mpsc", upd7201_new_device, txca_w))
- MCFG_AM9513_OUT5_CALLBACK(WRITELINE("mpsc", upd7201_new_device, rxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mpsc", upd7201_new_device, txcb_w))
+ am9513_device &stc(AM9513A(config, "stc", XTAL(19'660'800) / 8));
+ stc.out2_cb().set_inputline(m_maincpu, M68K_IRQ_6);
+ stc.out3_cb().set_inputline(m_maincpu, M68K_IRQ_7);
+ stc.out4_cb().set("mpsc", FUNC(upd7201_new_device::rxca_w));
+ stc.out4_cb().append("mpsc", FUNC(upd7201_new_device::txca_w));
+ stc.out5_cb().set("mpsc", FUNC(upd7201_new_device::rxcb_w));
+ stc.out5_cb().append("mpsc", FUNC(upd7201_new_device::txcb_w));
MCFG_DEVICE_ADD("rs232a", RS232_PORT, default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(WRITELINE("mpsc", upd7201_new_device, rxa_w))
diff --git a/src/mame/drivers/gaelco.cpp b/src/mame/drivers/gaelco.cpp
index 705e8170f73..e84e7e250a5 100644
--- a/src/mame/drivers/gaelco.cpp
+++ b/src/mame/drivers/gaelco.cpp
@@ -637,11 +637,11 @@ MACHINE_CONFIG_START(gaelco_state::bigkarnk)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("outlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco_state, coin1_lockout_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco_state, coin2_lockout_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gaelco_state, coin1_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gaelco_state, coin2_counter_w))
+ LS259(config, m_outlatch);
+ m_outlatch->q_out_cb<0>().set(FUNC(gaelco_state::coin1_lockout_w)).invert();
+ m_outlatch->q_out_cb<1>().set(FUNC(gaelco_state::coin2_lockout_w)).invert();
+ m_outlatch->q_out_cb<2>().set(FUNC(gaelco_state::coin1_counter_w));
+ m_outlatch->q_out_cb<3>().set(FUNC(gaelco_state::coin2_counter_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -710,12 +710,12 @@ MACHINE_CONFIG_START(gaelco_state::squash)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("outlatch", LS259, 0) // B8
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco_state, coin1_lockout_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco_state, coin2_lockout_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gaelco_state, coin1_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gaelco_state, coin2_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // used
+ LS259(config, m_outlatch); // B8
+ m_outlatch->q_out_cb<0>().set(FUNC(gaelco_state::coin1_lockout_w)).invert();
+ m_outlatch->q_out_cb<1>().set(FUNC(gaelco_state::coin2_lockout_w)).invert();
+ m_outlatch->q_out_cb<2>().set(FUNC(gaelco_state::coin1_counter_w));
+ m_outlatch->q_out_cb<3>().set(FUNC(gaelco_state::coin2_counter_w));
+ m_outlatch->q_out_cb<4>().set_nop(); // used
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -749,12 +749,12 @@ MACHINE_CONFIG_START(gaelco_state::thoop)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("outlatch", LS259, 0) // B8
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco_state, coin1_lockout_w)) // not inverted
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco_state, coin2_lockout_w)) // not inverted
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gaelco_state, coin1_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gaelco_state, coin2_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // used
+ LS259(config, m_outlatch); // B8
+ m_outlatch->q_out_cb<0>().set(FUNC(gaelco_state::coin1_lockout_w)); // not inverted
+ m_outlatch->q_out_cb<1>().set(FUNC(gaelco_state::coin2_lockout_w)); // not inverted
+ m_outlatch->q_out_cb<2>().set(FUNC(gaelco_state::coin1_counter_w));
+ m_outlatch->q_out_cb<3>().set(FUNC(gaelco_state::coin2_counter_w));
+ m_outlatch->q_out_cb<4>().set_nop(); // used
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp
index acb102b858b..22d147800ef 100644
--- a/src/mame/drivers/gaelco3d.cpp
+++ b/src/mame/drivers/gaelco3d.cpp
@@ -967,8 +967,7 @@ MACHINE_CONFIG_START(gaelco3d_state::gaelco3d)
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, gaelco3d_state, analog_port_latch_w))
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, unknown_w))
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_adsp, ADSP2115_IRQ2))
+ GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_adsp, ADSP2115_IRQ2);
/* video hardware */
MCFG_SCREEN_ADD(m_screen, RASTER)
diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp
index 065dfc3cd93..abf369bb1ba 100644
--- a/src/mame/drivers/gaiden.cpp
+++ b/src/mame/drivers/gaiden.cpp
@@ -1053,15 +1053,15 @@ MACHINE_CONFIG_START(gaiden_state::mastninj)
MCFG_DEVICE_ADD("adpcm_select2", LS157, 0)
MCFG_74157_OUT_CB(WRITE8("msm2", msm5205_device, data_w))
- MCFG_DEVICE_ADD("msm1", MSM5205, 384000)
- MCFG_MSM5205_VCK_CALLBACK(WRITELINE("msm2", msm5205_device, vclk_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, gaiden_state, vck_flipflop_w))
- MCFG_MSM5205_PRESCALER_SELECTOR(S96_4B)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
-
- MCFG_DEVICE_ADD("msm2", MSM5205, 384000)
- MCFG_MSM5205_PRESCALER_SELECTOR(SEX_4B)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MSM5205(config, m_msm[0], 384000);
+ m_msm[0]->vck_callback().set(m_msm[1], FUNC(msm5205_device::vclk_w));
+ m_msm[0]->vck_callback().append(FUNC(gaiden_state::vck_flipflop_w));
+ m_msm[0]->set_prescaler_selector(msm5205_device::S96_4B);
+ m_msm[0]->add_route(ALL_OUTPUTS, "mono", 0.20);
+
+ MSM5205(config, m_msm[1], 384000);
+ m_msm[1]->set_prescaler_selector(msm5205_device::SEX_4B);
+ m_msm[1]->add_route(ALL_OUTPUTS, "mono", 0.20);
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp
index 5820019be79..20814ae6c7c 100644
--- a/src/mame/drivers/galaga.cpp
+++ b/src/mame/drivers/galaga.cpp
@@ -1597,12 +1597,12 @@ MACHINE_CONFIG_START(bosco_state::bosco)
MCFG_DEVICE_ADD("sub2", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(bosco_map)
- MCFG_DEVICE_ADD("misclatch", LS259, 0) // 3C on CPU board
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, galaga_state, irq1_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, galaga_state, irq2_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, galaga_state, nmion_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sub2", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &misclatch(LS259(config, "misclatch")); // 3C on CPU board
+ misclatch.q_out_cb<0>().set(FUNC(galaga_state::irq1_clear_w));
+ misclatch.q_out_cb<1>().set(FUNC(galaga_state::irq2_clear_w));
+ misclatch.q_out_cb<2>().set(FUNC(galaga_state::nmion_w));
+ misclatch.q_out_cb<3>().set_inputline("sub", INPUT_LINE_RESET).invert();
+ misclatch.q_out_cb<3>().append_inputline("sub2", INPUT_LINE_RESET).invert();
MCFG_NAMCO_50XX_ADD("50xx_1", MASTER_CLOCK/6/2) /* 1.536 MHz */
MCFG_NAMCO_50XX_ADD("50xx_2", MASTER_CLOCK/6/2) /* 1.536 MHz */
@@ -1643,11 +1643,11 @@ MACHINE_CONFIG_START(bosco_state::bosco)
MCFG_NAMCO_06XX_WRITE_0_CB(WRITE8("50xx_2", namco_50xx_device, write))
MCFG_NAMCO_06XX_WRITE_1_CB(WRITE8("52xx", namco_52xx_device, write))
- MCFG_DEVICE_ADD("videolatch", LS259, 0) // 1B on video board
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, galaga_state, flip_screen_w)) MCFG_DEVCB_INVERT
+ LS259(config, m_videolatch); // 1B on video board
+ m_videolatch->q_out_cb<0>().set(FUNC(galaga_state::flip_screen_w)).invert();
// Q4-Q5 to 05XX for starfield blink
- //MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(DEVWRITE("50xx_2", namco_50xx_device, reset_w))
- //MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITE("52xx", namco_52xx_device, reset_w))
+ //m_videolatch->q_out_cb<7>().set("50xx_2", FUNC(namco_50xx_device::reset_w));
+ //m_videolatch->q_out_cb<7>().append("52xx", FUNC(namco_52xx_device, reset_w));
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
@@ -1655,12 +1655,12 @@ MACHINE_CONFIG_START(bosco_state::bosco)
/* synchronization of the CPUs */
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 288, 264, 16, 224+16)
- MCFG_SCREEN_UPDATE_DRIVER(bosco_state, screen_update_bosco)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, bosco_state, screen_vblank_bosco))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, galaga_state, vblank_irq))
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(MASTER_CLOCK/3, 384, 0, 288, 264, 16, 224+16);
+ m_screen->set_screen_update(FUNC(bosco_state::screen_update_bosco));
+ m_screen->screen_vblank().set(FUNC(bosco_state::screen_vblank_bosco));
+ m_screen->screen_vblank().append(FUNC(galaga_state::vblank_irq));
+ m_screen->set_palette("palette");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bosco)
MCFG_PALETTE_ADD("palette", 64*4+64*4+4+64)
@@ -1692,12 +1692,12 @@ MACHINE_CONFIG_START(galaga_state::galaga)
MCFG_DEVICE_ADD("sub2", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(galaga_map)
- MCFG_DEVICE_ADD("misclatch", LS259, 0) // 3C on CPU board
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, galaga_state, irq1_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, galaga_state, irq2_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, galaga_state, nmion_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sub2", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &misclatch(LS259(config, "misclatch")); // 3C on CPU board
+ misclatch.q_out_cb<0>().set(FUNC(galaga_state::irq1_clear_w));
+ misclatch.q_out_cb<1>().set(FUNC(galaga_state::irq2_clear_w));
+ misclatch.q_out_cb<2>().set(FUNC(galaga_state::nmion_w));
+ misclatch.q_out_cb<3>().set_inputline("sub", INPUT_LINE_RESET).invert();
+ misclatch.q_out_cb<3>().append_inputline("sub2", INPUT_LINE_RESET).invert();
MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/6/2) /* 1.536 MHz */
MCFG_NAMCO_51XX_SCREEN("screen")
@@ -1718,9 +1718,9 @@ MACHINE_CONFIG_START(galaga_state::galaga)
MCFG_NAMCO_06XX_WRITE_0_CB(WRITE8("51xx", namco_51xx_device, write))
MCFG_NAMCO_06XX_WRITE_3_CB(WRITE8("54xx", namco_54xx_device, write))
- MCFG_DEVICE_ADD("videolatch", LS259, 0) // 5K on video board
+ LS259(config, m_videolatch); // 5K on video board
// Q0-Q5 to 05XX for starfield control
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, galaga_state, flip_screen_w))
+ m_videolatch->q_out_cb<7>().set(FUNC(galaga_state::flip_screen_w));
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
@@ -1728,12 +1728,12 @@ MACHINE_CONFIG_START(galaga_state::galaga)
/* synchronization of the CPUs */
/* video hardware */
- MCFG_SCREEN_ADD(m_screen, RASTER)
- MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 288, 264, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(galaga_state, screen_update_galaga)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, galaga_state, screen_vblank_galaga))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, galaga_state, vblank_irq))
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(MASTER_CLOCK/3, 384, 0, 288, 264, 0, 224);
+ m_screen->set_screen_update(FUNC(galaga_state::screen_update_galaga));
+ m_screen->screen_vblank().set(FUNC(galaga_state::screen_vblank_galaga));
+ m_screen->screen_vblank().append(FUNC(galaga_state::vblank_irq));
+ m_screen->set_palette("palette");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_galaga)
MCFG_PALETTE_ADD("palette", 64*4+64*4+64)
@@ -1795,12 +1795,12 @@ MACHINE_CONFIG_START(xevious_state::xevious)
MCFG_DEVICE_ADD("sub2", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(xevious_map)
- MCFG_DEVICE_ADD("misclatch", LS259, 0) // 5K
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, galaga_state, irq1_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, galaga_state, irq2_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, galaga_state, nmion_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sub2", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &misclatch(LS259(config, "misclatch")); // 5K
+ misclatch.q_out_cb<0>().set(FUNC(galaga_state::irq1_clear_w));
+ misclatch.q_out_cb<1>().set(FUNC(galaga_state::irq2_clear_w));
+ misclatch.q_out_cb<2>().set(FUNC(galaga_state::nmion_w));
+ misclatch.q_out_cb<3>().set_inputline("sub", INPUT_LINE_RESET).invert();
+ misclatch.q_out_cb<3>().append_inputline("sub2", INPUT_LINE_RESET).invert();
MCFG_NAMCO_50XX_ADD("50xx", MASTER_CLOCK/6/2) /* 1.536 MHz */
@@ -1873,9 +1873,7 @@ MACHINE_CONFIG_START(battles_state::battles)
MCFG_DEVICE_ADD("sub3", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(battles_mem4)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, galaga_state, vblank_irq))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, battles_state, interrupt_4))
+ m_screen->screen_vblank().append(FUNC(battles_state::interrupt_4));
MCFG_TIMER_DRIVER_ADD("nmi", battles_state, nmi_generate)
@@ -1900,12 +1898,12 @@ MACHINE_CONFIG_START(digdug_state::digdug)
MCFG_DEVICE_ADD("sub2", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(digdug_map)
- MCFG_DEVICE_ADD("misclatch", LS259, 0) // 8R
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, galaga_state, irq1_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, galaga_state, irq2_clear_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, galaga_state, nmion_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sub2", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &misclatch(LS259(config, "misclatch")); // 8R
+ misclatch.q_out_cb<0>().set(FUNC(galaga_state::irq1_clear_w));
+ misclatch.q_out_cb<1>().set(FUNC(galaga_state::irq2_clear_w));
+ misclatch.q_out_cb<2>().set(FUNC(galaga_state::nmion_w));
+ misclatch.q_out_cb<3>().set_inputline("sub", INPUT_LINE_RESET).invert();
+ misclatch.q_out_cb<3>().append_inputline("sub2", INPUT_LINE_RESET).invert();
// Q5-Q7 also used (see below)
MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/6/2) /* 1.536 MHz */
@@ -1917,15 +1915,15 @@ MACHINE_CONFIG_START(digdug_state::digdug)
MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(*this, galaga_state,out_0))
MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(*this, galaga_state,out_1))
- MCFG_NAMCO_53XX_ADD("53xx", MASTER_CLOCK/6/2) /* 1.536 MHz */
- MCFG_NAMCO_53XX_K_CB(READLINE("misclatch", ls259_device, q7_r)) MCFG_DEVCB_BIT(3) // MOD 2 = K3
- MCFG_DEVCB_CHAIN_INPUT(READLINE("misclatch", ls259_device, q6_r)) MCFG_DEVCB_BIT(2) // MOD 1 = K2
- MCFG_DEVCB_CHAIN_INPUT(READLINE("misclatch", ls259_device, q5_r)) MCFG_DEVCB_BIT(1) // MOD 0 = K1
+ namco_53xx_device &n53xx(NAMCO_53XX(config, "53xx", MASTER_CLOCK/6/2)); /* 1.536 MHz */
+ n53xx.k_port_callback().set("misclatch", FUNC(ls259_device::q7_r)).lshift(3); // MOD 2 = K3
+ n53xx.k_port_callback().append("misclatch", FUNC(ls259_device::q6_r)).lshift(2); // MOD 1 = K2
+ n53xx.k_port_callback().append("misclatch", FUNC(ls259_device::q5_r)).lshift(1); // MOD 0 = K1
// K0 is left unconnected
- MCFG_NAMCO_53XX_INPUT_0_CB(IOPORT("DSWA")) MCFG_DEVCB_MASK(0x0f)
- MCFG_NAMCO_53XX_INPUT_1_CB(IOPORT("DSWA")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO_53XX_INPUT_2_CB(IOPORT("DSWB")) MCFG_DEVCB_MASK(0x0f)
- MCFG_NAMCO_53XX_INPUT_3_CB(IOPORT("DSWB")) MCFG_DEVCB_RSHIFT(4)
+ n53xx.input_callback<0>().set_ioport("DSWA").mask(0x0f);
+ n53xx.input_callback<1>().set_ioport("DSWA").rshift(4);
+ n53xx.input_callback<2>().set_ioport("DSWB").mask(0x0f);
+ n53xx.input_callback<3>().set_ioport("DSWB").rshift(4);
MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/6/64)
MCFG_NAMCO_06XX_MAINCPU("maincpu")
@@ -1934,11 +1932,11 @@ MACHINE_CONFIG_START(digdug_state::digdug)
MCFG_NAMCO_06XX_READ_1_CB(READ8("53xx", namco_53xx_device, read))
MCFG_NAMCO_06XX_READ_REQUEST_1_CB(WRITELINE("53xx", namco_53xx_device, read_request))
- MCFG_DEVICE_ADD("videolatch", LS259, 0) // 5R
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, digdug_state, bg_select_w)) MCFG_DEVCB_MASK(0x33)
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, digdug_state, tx_color_mode_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, digdug_state, bg_disable_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, digdug_state, flip_screen_w))
+ LS259(config, m_videolatch); // 5R
+ m_videolatch->parallel_out_cb().set(FUNC(digdug_state::bg_select_w)).mask(0x33);
+ m_videolatch->q_out_cb<2>().set(FUNC(digdug_state::tx_color_mode_w));
+ m_videolatch->q_out_cb<3>().set(FUNC(digdug_state::bg_disable_w));
+ m_videolatch->q_out_cb<7>().set(FUNC(digdug_state::flip_screen_w));
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
diff --git a/src/mame/drivers/galastrm.cpp b/src/mame/drivers/galastrm.cpp
index 1f66067c340..ee01322e53f 100644
--- a/src/mame/drivers/galastrm.cpp
+++ b/src/mame/drivers/galastrm.cpp
@@ -213,14 +213,14 @@ MACHINE_CONFIG_START(galastrm_state::galastrm)
MCFG_ADC0808_IN0_CB(IOPORT("STICKX"))
MCFG_ADC0808_IN1_CB(IOPORT("STICKY"))
- MCFG_DEVICE_ADD("tc0510nio", TC0510NIO, 0)
- MCFG_TC0510NIO_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0510NIO_READ_3_CB(IOPORT("IN1"))
- MCFG_TC0510NIO_WRITE_3_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(6)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(4)
- MCFG_TC0510NIO_WRITE_4_CB(WRITE8(*this, galastrm_state, coin_word_w))
- MCFG_TC0510NIO_READ_7_CB(IOPORT("IN2"))
+ tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
+ tc0510nio.read_2_callback().set_ioport("IN0");
+ tc0510nio.read_3_callback().set_ioport("IN1");
+ tc0510nio.write_3_callback().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(5);
+ tc0510nio.write_3_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(6);
+ tc0510nio.write_3_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
+ tc0510nio.write_4_callback().set(FUNC(galastrm_state::coin_word_w));
+ tc0510nio.read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp
index ad0d27851fd..79fed8a495a 100644
--- a/src/mame/drivers/galaxold.cpp
+++ b/src/mame/drivers/galaxold.cpp
@@ -745,7 +745,7 @@ void galaxold_state::drivfrcg_io(address_map &map)
}
-void galaxold_state::racknrol(address_map &map)
+void galaxold_state::racknrol_map(address_map &map)
{
map(0x0000, 0x0fff).rom();
map(0x1400, 0x143f).mirror(0x6000).ram().w(FUNC(galaxold_state::galaxold_attributesram_w)).share("attributesram");
@@ -2575,11 +2575,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxold_state::racknrol)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", S2650, PIXEL_CLOCK/2)
- MCFG_DEVICE_PROGRAM_MAP(racknrol)
- MCFG_DEVICE_IO_MAP(racknrol_io)
+ s2650_device &maincpu(S2650(config, m_maincpu, PIXEL_CLOCK/2));
+ maincpu.set_addrmap(AS_PROGRAM, &galaxold_state::racknrol_map);
+ maincpu.set_addrmap(AS_IO, &galaxold_state::racknrol_io);
+ maincpu.sense_handler().set(m_screen, FUNC(screen_device::vblank)).invert(); // ???
+ device = &maincpu; // FIXME: kill the following line - convert to a screen vblank callback
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", galaxold_state, hunchbks_vh_interrupt)
- MCFG_S2650_SENSE_INPUT(READLINE("screen", screen_device, vblank)) MCFG_DEVCB_INVERT // ???
/* video hardware */
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_galaxian)
@@ -2603,11 +2604,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxold_state::hexpoola)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", S2650, PIXEL_CLOCK/2)
- MCFG_DEVICE_PROGRAM_MAP(racknrol)
- MCFG_DEVICE_IO_MAP(hexpoola_io)
- MCFG_DEVICE_DATA_MAP(hexpoola_data)
- MCFG_S2650_SENSE_INPUT(READLINE("screen", screen_device, vblank)) MCFG_DEVCB_INVERT // ???
+ s2650_device &maincpu(S2650(config, m_maincpu, PIXEL_CLOCK/2));
+ maincpu.set_addrmap(AS_PROGRAM, &galaxold_state::racknrol_map);
+ maincpu.set_addrmap(AS_IO, &galaxold_state::hexpoola_io);
+ maincpu.set_addrmap(AS_DATA, &galaxold_state::hexpoola_data);
+ maincpu.sense_handler().set(m_screen, FUNC(screen_device::vblank)).invert(); // ???
+ device = &maincpu; // FIXME: kill the following line - convert to a screen vblank callback
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", galaxold_state, hunchbks_vh_interrupt)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_galaxian)
diff --git a/src/mame/drivers/gaplus.cpp b/src/mame/drivers/gaplus.cpp
index b003000e91d..af559f86c70 100644
--- a/src/mame/drivers/gaplus.cpp
+++ b/src/mame/drivers/gaplus.cpp
@@ -538,15 +538,15 @@ MACHINE_CONFIG_START(gaplus_base_state::gaplus_base)
//MCFG_NAMCO_62XX_OUTPUT_1_CB(WRITE8(*this, gaplus_base_state,out_1))
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60.606060)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(36 * 8, 28 * 8)
- MCFG_SCREEN_VISIBLE_AREA(0 * 8, 36 * 8 - 1, 0 * 8, 28 * 8 - 1)
- MCFG_SCREEN_UPDATE_DRIVER(gaplus_base_state, screen_update)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, gaplus_base_state, screen_vblank))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, gaplus_base_state, vblank_irq))
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60.606060);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(36 * 8, 28 * 8);
+ m_screen->set_visarea(0 * 8, 36 * 8 - 1, 0 * 8, 28 * 8 - 1);
+ m_screen->set_screen_update(FUNC(gaplus_base_state::screen_update));
+ m_screen->screen_vblank().set(FUNC(gaplus_base_state::screen_vblank));
+ m_screen->screen_vblank().append(FUNC(gaplus_base_state::vblank_irq));
+ m_screen->set_palette(m_palette);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_gaplus)
MCFG_PALETTE_ADD("palette", 64 * 4 + 64 * 8)
@@ -604,9 +604,8 @@ MACHINE_CONFIG_START(gapluso_state::gapluso)
gaplus_base(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, gaplus_base_state, screen_vblank))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, gapluso_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(gaplus_base_state::screen_vblank));
+ m_screen->screen_vblank().append(FUNC(gapluso_state::vblank_irq));
MCFG_DEVICE_ADD("namcoio_1", NAMCO_56XX, 0)
MCFG_NAMCO56XX_IN_0_CB(IOPORT("COINS"))
diff --git a/src/mame/drivers/gimix.cpp b/src/mame/drivers/gimix.cpp
index 9cb7cf0f043..3f5a33108b6 100644
--- a/src/mame/drivers/gimix.cpp
+++ b/src/mame/drivers/gimix.cpp
@@ -611,11 +611,11 @@ MACHINE_CONFIG_START(gimix_state::gimix)
MCFG_RS232_RXD_HANDLER(WRITELINE("acia4",acia6850_device,write_rxd))
MCFG_RS232_CTS_HANDLER(WRITELINE("acia4",acia6850_device,write_cts))
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia1", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia2", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia2", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 153600));
+ acia_clock.signal_handler().set(m_acia1, FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia1, FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append(m_acia2, FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia2, FUNC(acia6850_device::write_rxc));
/* banking */
MCFG_ADDRESS_BANK("bank1")
diff --git a/src/mame/drivers/gladiatr.cpp b/src/mame/drivers/gladiatr.cpp
index 19c968f1889..54a46c9b2c2 100644
--- a/src/mame/drivers/gladiatr.cpp
+++ b/src/mame/drivers/gladiatr.cpp
@@ -1028,18 +1028,18 @@ MACHINE_CONFIG_START(gladiatr_state::gladiatr)
MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) // shadowed by aforementioned hack
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, gladiatr_state, flipscreen_w))
- MCFG_DEVICE_ADD("cctl", I8741, 12_MHz_XTAL/2) /* verified on pcb */
- MCFG_MCS48_PORT_T0_IN_CB(IOPORT("COINS")) MCFG_DEVCB_RSHIFT(3)
- MCFG_MCS48_PORT_T1_IN_CB(IOPORT("COINS")) MCFG_DEVCB_RSHIFT(2)
- MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, gladiatr_state, cctl_p1_r))
- MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, gladiatr_state, cctl_p2_r))
-
- MCFG_DEVICE_ADD("ccpu", I8741, 12_MHz_XTAL/2) /* verified on pcb */
- MCFG_MCS48_PORT_P1_IN_CB(IOPORT("IN0"))
- MCFG_MCS48_PORT_P2_IN_CB(IOPORT("IN1"))
- MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, gladiatr_state, ccpu_p2_w))
- MCFG_MCS48_PORT_T0_IN_CB(IOPORT("COINS")) MCFG_DEVCB_RSHIFT(1)
- MCFG_MCS48_PORT_T1_IN_CB(IOPORT("COINS")) MCFG_DEVCB_RSHIFT(0)
+ I8741(config, m_cctl, 12_MHz_XTAL/2); /* verified on pcb */
+ m_cctl->t0_in_cb().set_ioport("COINS").bit(3);
+ m_cctl->t1_in_cb().set_ioport("COINS").bit(2);
+ m_cctl->p1_in_cb().set(FUNC(gladiatr_state::cctl_p1_r));
+ m_cctl->p2_in_cb().set(FUNC(gladiatr_state::cctl_p2_r));
+
+ I8741(config, m_ccpu, 12_MHz_XTAL/2); /* verified on pcb */
+ m_ccpu->p1_in_cb().set_ioport("IN0");
+ m_ccpu->p2_in_cb().set_ioport("IN1");
+ m_ccpu->p2_out_cb().set(FUNC(gladiatr_state::ccpu_p2_w));
+ m_ccpu->t0_in_cb().set_ioport("COINS").bit(1);
+ m_ccpu->t1_in_cb().set_ioport("COINS").bit(0);
MCFG_DEVICE_ADD("ucpu", I8741, 12_MHz_XTAL/2) /* verified on pcb */
MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, gladiatr_state, ucpu_p1_r))
diff --git a/src/mame/drivers/gng.cpp b/src/mame/drivers/gng.cpp
index 2ed772784d0..690d88dca4f 100644
--- a/src/mame/drivers/gng.cpp
+++ b/src/mame/drivers/gng.cpp
@@ -41,16 +41,6 @@ WRITE8_MEMBER(gng_state::gng_bankswitch_w)
membank("bank1")->set_entry((data & 0x03));
}
-WRITE_LINE_MEMBER(gng_state::coin_counter_1_w)
-{
- machine().bookkeeping().coin_counter_w(0, state);
-}
-
-WRITE_LINE_MEMBER(gng_state::coin_counter_2_w)
-{
- machine().bookkeeping().coin_counter_w(1, state);
-}
-
WRITE_LINE_MEMBER(gng_state::ym_reset_w)
{
if (!state)
@@ -399,12 +389,12 @@ MACHINE_CONFIG_START(gng_state::gng)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(gng_state, irq0_line_hold, 4*60)
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 9B on A board
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gng_state, flipscreen_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(INPUTLINE("audiocpu", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, gng_state, ym_reset_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gng_state, coin_counter_1_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gng_state, coin_counter_2_w))
+ ls259_device &mainlatch(LS259(config, "mainlatch")); // 9B on A board
+ mainlatch.q_out_cb<0>().set(FUNC(gng_state::flipscreen_w));
+ mainlatch.q_out_cb<1>().set_inputline("audiocpu", INPUT_LINE_RESET).invert();
+ mainlatch.q_out_cb<1>().append(FUNC(gng_state::ym_reset_w));
+ mainlatch.q_out_cb<2>().set([this] (int state) { machine().bookkeeping().coin_counter_w(0, state); });
+ mainlatch.q_out_cb<3>().set([this] (int state) { machine().bookkeeping().coin_counter_w(1, state); });
/* video hardware */
MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8)
diff --git a/src/mame/drivers/gotcha.cpp b/src/mame/drivers/gotcha.cpp
index fe2d838609b..6a946514a9a 100644
--- a/src/mame/drivers/gotcha.cpp
+++ b/src/mame/drivers/gotcha.cpp
@@ -270,21 +270,20 @@ MACHINE_CONFIG_START(gotcha_state::gotcha)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(55)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(40*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(gotcha_state, screen_update_gotcha)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(HOLDLINE("maincpu", M68K_IRQ_6))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("audiocpu", INPUT_LINE_NMI)) // ?
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(55);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(40*8, 32*8);
+ screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
+ screen.set_screen_update(FUNC(gotcha_state::screen_update_gotcha));
+ screen.set_palette("palette");
+ screen.screen_vblank().set_inputline(m_maincpu, M68K_IRQ_6, HOLD_LINE);
+ screen.screen_vblank().append_inputline(m_audiocpu, INPUT_LINE_NMI); // ?
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_gotcha)
MCFG_PALETTE_ADD("palette", 768)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
-
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
MCFG_DECO_SPRITE_GFX_REGION(1)
MCFG_DECO_SPRITE_ISBOOTLEG(true)
diff --git a/src/mame/drivers/groundfx.cpp b/src/mame/drivers/groundfx.cpp
index a9d95e2a663..a27d9d81e4d 100644
--- a/src/mame/drivers/groundfx.cpp
+++ b/src/mame/drivers/groundfx.cpp
@@ -251,15 +251,15 @@ MACHINE_CONFIG_START(groundfx_state::groundfx)
MCFG_ADC0808_IN2_CB(IOPORT("WHEEL"))
MCFG_ADC0808_IN3_CB(IOPORT("ACCEL"))
- MCFG_DEVICE_ADD("tc0510nio", TC0510NIO, 0)
- MCFG_TC0510NIO_READ_2_CB(IOPORT("BUTTONS"))
- MCFG_TC0510NIO_READ_3_CB(READLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(7)
- MCFG_DEVCB_CHAIN_INPUT(READLINE(*this, groundfx_state, frame_counter_r)) MCFG_DEVCB_BIT(0)
- MCFG_TC0510NIO_WRITE_3_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(6)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(4)
- MCFG_TC0510NIO_WRITE_4_CB(WRITE8(*this, groundfx_state, coin_word_w))
- MCFG_TC0510NIO_READ_7_CB(IOPORT("SYSTEM"))
+ tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
+ tc0510nio.read_2_callback().set_ioport("BUTTONS");
+ tc0510nio.read_3_callback().set("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)).lshift(7);
+ tc0510nio.read_3_callback().append(FUNC(groundfx_state::frame_counter_r)).lshift(0);
+ tc0510nio.write_3_callback().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(5);
+ tc0510nio.write_3_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(6);
+ tc0510nio.write_3_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
+ tc0510nio.write_4_callback().set(FUNC(groundfx_state::coin_word_w));
+ tc0510nio.read_7_callback().set_ioport("SYSTEM");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/gstriker.cpp b/src/mame/drivers/gstriker.cpp
index 86af212e71f..38874c6ea3d 100644
--- a/src/mame/drivers/gstriker.cpp
+++ b/src/mame/drivers/gstriker.cpp
@@ -502,14 +502,14 @@ MACHINE_CONFIG_START(gstriker_state::gstriker)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
MCFG_DEVICE_IO_MAP(sound_io_map)
- MCFG_DEVICE_ADD("io", VS9209, 0)
- MCFG_VS9209_IN_PORTA_CB(IOPORT("P1"))
- MCFG_VS9209_IN_PORTB_CB(IOPORT("P2"))
- MCFG_VS9209_IN_PORTC_CB(IOPORT("SYSTEM"))
- MCFG_VS9209_IN_PORTD_CB(IOPORT("DSW1"))
- MCFG_VS9209_IN_PORTE_CB(IOPORT("DSW2"))
- MCFG_VS9209_IN_PORTH_CB(READLINE("soundlatch", generic_latch_8_device, pending_r)) MCFG_DEVCB_BIT(0)
- MCFG_VS9209_OUT_PORTH_CB(WRITELINE("watchdog", mb3773_device, write_line_ck)) MCFG_DEVCB_BIT(3)
+ vs9209_device &io(VS9209(config, "io", 0));
+ io.porta_input_cb().set_ioport("P1");
+ io.portb_input_cb().set_ioport("P2");
+ io.portc_input_cb().set_ioport("SYSTEM");
+ io.portd_input_cb().set_ioport("DSW1");
+ io.porte_input_cb().set_ioport("DSW2");
+ io.porth_input_cb().set(m_soundlatch, FUNC(generic_latch_8_device::pending_r)).lshift(0);
+ io.porth_output_cb().set("watchdog", FUNC(mb3773_device::write_line_ck)).bit(3);
MCFG_DEVICE_ADD("watchdog", MB3773, 0)
@@ -569,9 +569,7 @@ MACHINE_CONFIG_START(gstriker_state::twc94)
MCFG_DEVICE_PROGRAM_MAP(twcup94_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gstriker_state, irq1_line_hold)
- MCFG_DEVICE_MODIFY("io")
- MCFG_VS9209_OUT_PORTH_CB(WRITE8(*this, gstriker_state, twcup94_prot_reg_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("watchdog", mb3773_device, write_line_ck)) MCFG_DEVCB_BIT(3)
+ subdevice<vs9209_device>("io")->porth_output_cb().append(FUNC(gstriker_state::twcup94_prot_reg_w));
MCFG_DEVICE_REMOVE("acia")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gsword.cpp b/src/mame/drivers/gsword.cpp
index 934529b46cd..02c4d71f35a 100644
--- a/src/mame/drivers/gsword.cpp
+++ b/src/mame/drivers/gsword.cpp
@@ -859,14 +859,14 @@ MACHINE_CONFIG_START(josvolly_state::josvolly)
MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, josvolly_state, mcu1_p2_r))
MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, josvolly_state, mcu1_p2_w))
- MCFG_DEVICE_ADD("mcu2", I8741, 12000000/2) /* ? */
- MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, josvolly_state, mcu2_p1_r))
- MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, josvolly_state, mcu2_p1_w))
- MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, josvolly_state, mcu2_p2_r))
- MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, josvolly_state, mcu2_p2_w))
+ i8741_device &mcu2(I8741(config, "mcu2", 12000000/2)); /* ? */
+ mcu2.p1_in_cb().set(FUNC(josvolly_state::mcu2_p1_r));
+ mcu2.p1_out_cb().set(FUNC(josvolly_state::mcu2_p1_w));
+ mcu2.p2_in_cb().set(FUNC(josvolly_state::mcu2_p2_r));
+ mcu2.p2_out_cb().set(FUNC(josvolly_state::mcu2_p2_w));
// TEST0 and TEST1 are driven by P20 and P21 on the other MCU
- MCFG_MCS48_PORT_T0_IN_CB(READ8("mcu1", i8741_device, p2_r)) MCFG_DEVCB_RSHIFT(0)
- MCFG_MCS48_PORT_T1_IN_CB(READ8("mcu1", i8741_device, p2_r)) MCFG_DEVCB_RSHIFT(1)
+ 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
diff --git a/src/mame/drivers/guab.cpp b/src/mame/drivers/guab.cpp
index e3fc569a2cd..fbb2a924614 100644
--- a/src/mame/drivers/guab.cpp
+++ b/src/mame/drivers/guab.cpp
@@ -539,9 +539,9 @@ MACHINE_CONFIG_START(guab_state::guab)
MCFG_RS232_CTS_HANDLER(WRITELINE("acia6850_1", acia6850_device, write_cts))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("keyboard", acia_1_rs232_defaults)
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600) // source? the ptm doesn't seem to output any common baud values
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia6850_1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_1", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 153600)); // source? the ptm doesn't seem to output any common baud values
+ acia_clock.signal_handler().set("acia6850_1", FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append("acia6850_1", FUNC(acia6850_device::write_rxc));
MCFG_DEVICE_ADD("acia6850_2", ACIA6850, 0)
diff --git a/src/mame/drivers/gunbustr.cpp b/src/mame/drivers/gunbustr.cpp
index 212752a03a6..9db657775f0 100644
--- a/src/mame/drivers/gunbustr.cpp
+++ b/src/mame/drivers/gunbustr.cpp
@@ -237,15 +237,15 @@ MACHINE_CONFIG_START(gunbustr_state::gunbustr)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("tc0510nio", TC0510NIO, 0)
- MCFG_TC0510NIO_READ_0_CB(IOPORT("EXTRA"))
- MCFG_TC0510NIO_READ_2_CB(IOPORT("INPUTS"))
- MCFG_TC0510NIO_READ_3_CB(IOPORT("SPECIAL"))
- MCFG_TC0510NIO_WRITE_3_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(6)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(4)
- MCFG_TC0510NIO_WRITE_4_CB(WRITE8(*this, gunbustr_state, coin_word_w))
- MCFG_TC0510NIO_READ_7_CB(IOPORT("SYSTEM"))
+ tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
+ tc0510nio.read_0_callback().set_ioport("EXTRA");
+ tc0510nio.read_2_callback().set_ioport("INPUTS");
+ tc0510nio.read_3_callback().set_ioport("SPECIAL");
+ tc0510nio.write_3_callback().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(5);
+ tc0510nio.write_3_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(6);
+ tc0510nio.write_3_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
+ tc0510nio.write_4_callback().set(FUNC(gunbustr_state::coin_word_w));
+ tc0510nio.read_7_callback().set_ioport("SYSTEM");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/h8.cpp b/src/mame/drivers/h8.cpp
index f6300ed07c2..ea1d710a28a 100644
--- a/src/mame/drivers/h8.cpp
+++ b/src/mame/drivers/h8.cpp
@@ -329,12 +329,12 @@ MACHINE_CONFIG_START(h8_state::h8)
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25);
/* Devices */
- MCFG_DEVICE_ADD("uart", I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE(*this, h8_state, txdata_callback))
+ I8251(config, m_uart, 0);
+ m_uart->txd_handler().set(FUNC(h8_state::txdata_callback));
- MCFG_DEVICE_ADD("cassette_clock", CLOCK, 4800)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ clock_device &cassette_clock(CLOCK(config, "cassette_clock", 4800));
+ cassette_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc));
+ cassette_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc));
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
diff --git a/src/mame/drivers/harriet.cpp b/src/mame/drivers/harriet.cpp
index feae77ae14c..c5da86323e3 100644
--- a/src/mame/drivers/harriet.cpp
+++ b/src/mame/drivers/harriet.cpp
@@ -104,9 +104,9 @@ MACHINE_CONFIG_START(harriet_state::harriet)
MCFG_DEVICE_ADD("timekpr", M48T02, 0)
MCFG_NVRAM_ADD_0FILL("zpram") // MK48Z02
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("mfp", mc68901_device, write_rx))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mfp", mc68901_device, tbi_w))
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
+ rs232.rxd_handler().set("mfp", FUNC(mc68901_device::write_rx));
+ rs232.rxd_handler().append("mfp", FUNC(mc68901_device::tbi_w));
//MCFG_DEVICE_ADD("wdca", WD33C93, 40_MHz_XTAL / 4)
//MCFG_DEVICE_ADD("wdcb", WD33C93, 40_MHz_XTAL / 4)
diff --git a/src/mame/drivers/hazelgr.cpp b/src/mame/drivers/hazelgr.cpp
index 7ffe08d743b..9fa626940b0 100644
--- a/src/mame/drivers/hazelgr.cpp
+++ b/src/mame/drivers/hazelgr.cpp
@@ -79,14 +79,14 @@ MACHINE_CONFIG_START(haze_state::haze)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_Z80_DAISY_CHAIN(daisy_chain)
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 1'000'000)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc1", z80ctc_device, trg3))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc2", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc2", z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc2", z80ctc_device, trg2))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc2", z80ctc_device, trg3))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc3", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc3", z80ctc_device, trg1))
+ clock_device &ctc_clock(CLOCK(config, "ctc_clock", 1'000'000));
+ ctc_clock.signal_handler().set("ctc1", FUNC(z80ctc_device::trg3));
+ ctc_clock.signal_handler().append("ctc2", FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append("ctc2", FUNC(z80ctc_device::trg1));
+ ctc_clock.signal_handler().append("ctc2", FUNC(z80ctc_device::trg2));
+ ctc_clock.signal_handler().append("ctc2", FUNC(z80ctc_device::trg3));
+ ctc_clock.signal_handler().append("ctc3", FUNC(z80ctc_device::trg0));
+ ctc_clock.signal_handler().append("ctc3", FUNC(z80ctc_device::trg1));
MCFG_DEVICE_ADD("ctc1", Z80CTC, 1'000'000 )
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/hazeltin.cpp b/src/mame/drivers/hazeltin.cpp
index 2c2d726baab..3a9c9ba1495 100644
--- a/src/mame/drivers/hazeltin.cpp
+++ b/src/mame/drivers/hazeltin.cpp
@@ -716,9 +716,9 @@ MACHINE_CONFIG_START(hazl1500_state::hazl1500)
MCFG_PALETTE_ADD_MONOCHROME("palette")
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_hazl1500)
- MCFG_DEVICE_ADD(BAUDGEN_TAG, COM8116, XTAL(5'068'800))
- MCFG_COM8116_FR_HANDLER(WRITELINE("uart", ay51013_device, write_tcp))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", ay51013_device, write_rcp))
+ com8116_device &baudgen(COM8116(config, BAUDGEN_TAG, XTAL(5'068'800)));
+ baudgen.fr_handler().set(m_uart, FUNC(ay51013_device::write_tcp));
+ baudgen.fr_handler().append(m_uart, FUNC(ay51013_device::write_rcp));
MCFG_DEVICE_ADD(UART_TAG, AY51013, 0)
MCFG_AY51013_WRITE_DAV_CB(WRITELINE("mainint", input_merger_device, in_w<0>))
diff --git a/src/mame/drivers/hnayayoi.cpp b/src/mame/drivers/hnayayoi.cpp
index 5dbccbd5a13..629de9fc02d 100644
--- a/src/mame/drivers/hnayayoi.cpp
+++ b/src/mame/drivers/hnayayoi.cpp
@@ -555,11 +555,11 @@ MACHINE_CONFIG_START(hnayayoi_state::hnayayoi)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("mainlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, hnayayoi_state, coin_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("msm", msm5205_device, reset_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("msm", msm5205_device, vclk_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, hnayayoi_state, nmi_enable_w)) MCFG_DEVCB_INVERT
+ ls259_device &mainlatch(LS259(config, "mainlatch"));
+ mainlatch.q_out_cb<0>().set(FUNC(hnayayoi_state::coin_counter_w));
+ mainlatch.q_out_cb<2>().set(m_msm, FUNC(msm5205_device::reset_w)).invert();
+ mainlatch.q_out_cb<3>().set(m_msm, FUNC(msm5205_device::vclk_w));
+ mainlatch.q_out_cb<4>().set(FUNC(hnayayoi_state::nmi_enable_w)).invert();
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -608,11 +608,11 @@ MACHINE_CONFIG_START(hnayayoi_state::untoucha)
MCFG_DEVICE_PROGRAM_MAP(untoucha_map)
MCFG_DEVICE_IO_MAP(untoucha_io_map)
- MCFG_DEVICE_MODIFY("mainlatch")
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("msm", msm5205_device, vclk_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, hnayayoi_state, nmi_enable_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("msm", msm5205_device, reset_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // ?
+ ls259_device &mainlatch(*subdevice<ls259_device>("mainlatch"));
+ mainlatch.q_out_cb<1>().set(m_msm, FUNC(msm5205_device::vclk_w));
+ mainlatch.q_out_cb<2>().set(FUNC(hnayayoi_state::nmi_enable_w));
+ mainlatch.q_out_cb<3>().set(m_msm, FUNC(msm5205_device::reset_w)).invert();
+ mainlatch.q_out_cb<4>().set_nop(); // ?
MCFG_DEVICE_MODIFY("crtc")
MCFG_MC6845_UPDATE_ROW_CB(hnayayoi_state, untoucha_update_row)
diff --git a/src/mame/drivers/holeland.cpp b/src/mame/drivers/holeland.cpp
index 87bb3d32e64..66d190f5f5a 100644
--- a/src/mame/drivers/holeland.cpp
+++ b/src/mame/drivers/holeland.cpp
@@ -282,11 +282,11 @@ MACHINE_CONFIG_START(holeland_state::holeland)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", holeland_state, irq0_line_hold)
- MCFG_DEVICE_ADD("latch", LS259, 0) // 3J
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, holeland_state, pal_offs_w)) MCFG_DEVCB_MASK(0x03)
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, holeland_state, coin_counter_w))
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, holeland_state, flipscreen_x_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, holeland_state, flipscreen_y_w))
+ LS259(config, m_latch); // 3J
+ m_latch->parallel_out_cb().set(FUNC(holeland_state::pal_offs_w)).mask(0x03);
+ m_latch->q_out_cb<5>().set(FUNC(holeland_state::coin_counter_w));
+ m_latch->q_out_cb<6>().set(FUNC(holeland_state::flipscreen_x_w));
+ m_latch->q_out_cb<7>().set(FUNC(holeland_state::flipscreen_y_w));
MCFG_WATCHDOG_ADD("watchdog")
@@ -365,9 +365,9 @@ MACHINE_CONFIG_START(holeland_state::crzrally)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_DEVICE_ADD("latch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, holeland_state, pal_offs_w)) MCFG_DEVCB_MASK(0x03)
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, holeland_state, coin_counter_w))
+ LS259(config, m_latch);
+ m_latch->parallel_out_cb().set(FUNC(holeland_state::pal_offs_w)).mask(0x03);
+ m_latch->q_out_cb<5>().set(FUNC(holeland_state::coin_counter_w));
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/hp16500.cpp b/src/mame/drivers/hp16500.cpp
index b025eb3c835..a8a05fb2873 100644
--- a/src/mame/drivers/hp16500.cpp
+++ b/src/mame/drivers/hp16500.cpp
@@ -476,21 +476,20 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(hp16500_state::hp16500)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68EC030, 25000000)
- MCFG_DEVICE_PROGRAM_MAP(hp16500_map)
-
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_UPDATE_DRIVER(hp16500_state, screen_update_hp16500)
- MCFG_SCREEN_SIZE(576,384)
- MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 0, 384-1)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, hp16500_state, vsync_changed))
- // FIXME: Where is the AP line connected to? The MLC documentation recommends
- // connecting it to VBLANK
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mlc", hp_hil_mlc_device, ap_w))
-
- MCFG_DEVICE_ADD("mlc", HP_HIL_MLC, XTAL(15'920'000)/2)
- MCFG_HP_HIL_INT_CALLBACK(WRITELINE(*this, hp16500_state, irq_2))
+ M68EC030(config, m_maincpu, 25'000'000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &hp16500_state::hp16500_map);
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_screen_update(FUNC(hp16500_state::screen_update_hp16500));
+ screen.set_size(576,384);
+ screen.set_visarea(0, 576-1, 0, 384-1);
+ screen.set_refresh_hz(60);
+ screen.screen_vblank().set(FUNC(hp16500_state::vsync_changed));
+ // FIXME: Where is the AP line connected to? The MLC documentation recommends connecting it to VBLANK
+ screen.screen_vblank().append(m_mlc, FUNC(hp_hil_mlc_device::ap_w));
+
+ HP_HIL_MLC(config, m_mlc, XTAL(15'920'000)/2);
+ m_mlc->int_callback().set(FUNC(hp16500_state::irq_2));
// TODO: for now hook up the ipc hil keyboard - this might be replaced
// later with a 16500b specific keyboard implementation
diff --git a/src/mame/drivers/i7000.cpp b/src/mame/drivers/i7000.cpp
index 49983802f63..99eecfad917 100644
--- a/src/mame/drivers/i7000.cpp
+++ b/src/mame/drivers/i7000.cpp
@@ -383,8 +383,8 @@ MACHINE_CONFIG_START(i7000_state::i7000)
MCFG_DEVICE_ADD("i8279", I8279, 4000000) /* guessed value. TODO: verify on PCB */
MCFG_I8279_OUT_SL_CB(WRITE8(*this, i7000_state, i7000_scanlines_w)) // scan SL lines
MCFG_I8279_IN_RL_CB(READ8(*this, i7000_state, i7000_kbd_r)) // kbd RL lines
- MCFG_I8279_IN_SHIFT_CB(VCC) // TODO: Shift key
- MCFG_I8279_IN_CTRL_CB(VCC) // TODO: Ctrl key
+ MCFG_I8279_IN_SHIFT_CB(CONSTANT(1)) // TODO: Shift key
+ MCFG_I8279_IN_CTRL_CB(CONSTANT(1)) // TODO: Ctrl key
/* Cartridge slot */
MCFG_GENERIC_CARTSLOT_ADD("cardslot", generic_romram_plain_slot, "i7000_card")
diff --git a/src/mame/drivers/ibm6580.cpp b/src/mame/drivers/ibm6580.cpp
index 1a171c959ca..02f34f0a597 100644
--- a/src/mame/drivers/ibm6580.cpp
+++ b/src/mame/drivers/ibm6580.cpp
@@ -914,11 +914,11 @@ MACHINE_CONFIG_START(ibm6580_state::ibm6580)
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
- MCFG_DEVICE_ADD("kbd", DW_KEYBOARD, 0)
- MCFG_DW_KEYBOARD_OUT_DATA_HANDLER(WRITELINE(*this, ibm6580_state, kb_data_w))
- MCFG_DW_KEYBOARD_OUT_CLOCK_HANDLER(WRITELINE(*this, ibm6580_state, kb_clock_w))
- MCFG_DW_KEYBOARD_OUT_STROBE_HANDLER(WRITELINE(*this, ibm6580_state, kb_strobe_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ppi8255", i8255_device, pc4_w))
+ DW_KEYBOARD(config, m_kbd, 0);
+ m_kbd->out_data_handler().set(FUNC(ibm6580_state::kb_data_w));
+ m_kbd->out_clock_handler().set(FUNC(ibm6580_state::kb_clock_w));
+ m_kbd->out_strobe_handler().set(FUNC(ibm6580_state::kb_strobe_w));
+ m_kbd->out_strobe_handler().append(m_ppi8255, FUNC(i8255_device::pc4_w));
MCFG_DEVICE_ADD("dma8257", I8257, XTAL(14'745'600)/3)
MCFG_I8257_OUT_HRQ_CB(WRITELINE(*this, ibm6580_state, hrq_w))
diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp
index ad25462b36b..c7a45dc6489 100644
--- a/src/mame/drivers/igs017.cpp
+++ b/src/mame/drivers/igs017.cpp
@@ -163,22 +163,22 @@ void igs_bitswap_device::set_val_xor(uint16_t val_xor)
}
#define MCFG_IGS_BITSWAP_IN_PORTA_CB(_devcb) \
- devcb = &downcast<igs_bitswap_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<igs_bitswap_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_IGS_BITSWAP_IN_PORTB_CB(_devcb) \
- devcb = &downcast<igs_bitswap_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<igs_bitswap_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_IGS_BITSWAP_IN_PORTC_CB(_devcb) \
- devcb = &downcast<igs_bitswap_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
+ downcast<igs_bitswap_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
#define MCFG_IGS_BITSWAP_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<igs_bitswap_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<igs_bitswap_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_IGS_BITSWAP_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<igs_bitswap_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<igs_bitswap_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#define MCFG_IGS_BITSWAP_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<igs_bitswap_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
+ downcast<igs_bitswap_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
// note: b3 seems fixed to ~15, it may go away in the future
#define MCFG_IGS_BITSWAP_M3_0_BITS(_b0, _b1, _b2, _b3) \
diff --git a/src/mame/drivers/imds2.cpp b/src/mame/drivers/imds2.cpp
index 40076ec6ffe..4d4663b398f 100644
--- a/src/mame/drivers/imds2.cpp
+++ b/src/mame/drivers/imds2.cpp
@@ -767,11 +767,11 @@ MACHINE_CONFIG_START(imds2_state::imds2)
MCFG_DEVICE_ADD("ipcsyspic", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, imds2_state, imds2_ipc_intr))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_DEVICE_ADD("ipclocpic", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("ipcsyspic", pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(VCC) // ???
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1)) // ???
MCFG_DEVICE_ADD("ipctimer" , PIT8253 , 0)
MCFG_PIT8253_CLK0(IPC_XTAL_Y1 / 16)
diff --git a/src/mame/drivers/imolagp.cpp b/src/mame/drivers/imolagp.cpp
index c7c9a629b80..00782c004ad 100644
--- a/src/mame/drivers/imolagp.cpp
+++ b/src/mame/drivers/imolagp.cpp
@@ -94,8 +94,8 @@ www.andys-arcade.com
class imolagp_state : public driver_device
{
public:
- imolagp_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ imolagp_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_slavecpu(*this, "slave"),
m_steer_pot_timer(*this, "pot"),
@@ -524,12 +524,12 @@ MACHINE_CONFIG_START(imolagp_state::imolagp)
MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
+ i8255_device &ppi(I8255A(config, "ppi8255", 0));
// mode $91 - ports A & C-lower as input, ports B & C-upper as output
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(LOGGER("PPI8255 - unmapped read port B"))
- MCFG_I8255_OUT_PORTB_CB(LOGGER("PPI8255 - unmapped write port B"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN1"))
+ ppi.in_pa_callback().set_ioport("IN0");
+ ppi.in_pb_callback().set_log("PPI8255 - unmapped read port B");
+ ppi.out_pb_callback().set_log("PPI8255 - unmapped write port B");
+ ppi.in_pc_callback().set_ioport("IN1");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/imsai.cpp b/src/mame/drivers/imsai.cpp
index 8ab9ee5266f..c9b545b112f 100644
--- a/src/mame/drivers/imsai.cpp
+++ b/src/mame/drivers/imsai.cpp
@@ -120,12 +120,12 @@ MACHINE_CONFIG_START(imsai_state::imsai)
/* Devices */
MCFG_DEVICE_ADD("uart", I8251, 0)
- MCFG_DEVICE_ADD("pit", PIT8253, 0)
- MCFG_PIT8253_CLK0(XTAL(6'000'000) / 3) /* Timer 0: baud rate gen for 8251 */
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
- MCFG_PIT8253_CLK1(XTAL(6'000'000) / 3) /* Timer 1: user */
- MCFG_PIT8253_CLK2(XTAL(6'000'000) / 3) /* Timer 2: user */
+ PIT8253(config, m_pit, 0);
+ m_pit->set_clk<0>(6_MHz_XTAL / 3); // Timer 0: baud rate gen for 8251
+ m_pit->out_handler<0>().set("uart", FUNC(i8251_device::write_txc));
+ m_pit->out_handler<0>().append("uart", FUNC(i8251_device::write_rxc));
+ m_pit->set_clk<1>(6_MHz_XTAL / 3); // Timer 1: user
+ m_pit->set_clk<2>(6_MHz_XTAL / 3); // Timer 2: user
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/inder.cpp b/src/mame/drivers/inder.cpp
index d5d154e8364..20650f2ab10 100644
--- a/src/mame/drivers/inder.cpp
+++ b/src/mame/drivers/inder.cpp
@@ -1434,12 +1434,11 @@ MACHINE_CONFIG_START(inder_state::inder)
/* Sound */
genpin_audio(config);
SPEAKER(config, "msmvol").front_center();
- MCFG_DEVICE_ADD("msm", MSM5205, XTAL(384'000))
- MCFG_MSM5205_VCK_CALLBACK(WRITELINE("9a", ttl7474_device, clock_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("9b", ttl7474_device, clock_w)) // order of writes is sensitive
-
- MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 4KHz 4-bit */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msmvol", 1.0)
+ MSM5205(config, m_msm, 384_kHz_XTAL);
+ m_msm->vck_callback().set(m_9a, FUNC(ttl7474_device::clock_w));
+ m_msm->vck_callback().append(m_9b, FUNC(ttl7474_device::clock_w)); // order of writes is sensitive
+ m_msm->set_prescaler_selector(msm5205_device::S48_4B); // 4KHz 4-bit
+ m_msm->add_route(ALL_OUTPUTS, "msmvol", 1.0);
/* Devices */
MCFG_DEVICE_ADD("ppi60", I8255A, 0 )
diff --git a/src/mame/drivers/interpro.cpp b/src/mame/drivers/interpro.cpp
index fdc8d961d88..2e4f69e5d23 100644
--- a/src/mame/drivers/interpro.cpp
+++ b/src/mame/drivers/interpro.cpp
@@ -790,12 +790,12 @@ void interpro_state::interpro_cdrom(device_t *device)
}
MACHINE_CONFIG_START(interpro_state::ioga)
- MCFG_DEVICE_MODIFY(INTERPRO_IOGA_TAG)
- MCFG_INTERPRO_IOGA_NMI_CB(INPUTLINE(m_maincpu, INPUT_LINE_NMI))
- MCFG_INTERPRO_IOGA_IRQ_CB(INPUTLINE(m_maincpu, INPUT_LINE_IRQ0))
- MCFG_INTERPRO_IOGA_IVEC_CB(WRITE8(m_maincpu, clipper_device, set_ivec))
+ m_ioga->out_nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ m_ioga->out_irq_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_ioga->out_irq_vector_callback().set(m_maincpu, FUNC(clipper_device::set_ivec));
// ioga dma and serial dma channels
+ MCFG_DEVICE_MODIFY(INTERPRO_IOGA_TAG);
//MCFG_INTERPRO_IOGA_DMA_CB(0, unknown) // plotter
MCFG_INTERPRO_IOGA_DMA_CB(1, READ8(INTERPRO_SCSI_DEVICE_TAG, ncr53c90a_device, mdma_r), WRITE8(INTERPRO_SCSI_DEVICE_TAG, ncr53c90a_device, mdma_w))
MCFG_INTERPRO_IOGA_DMA_CB(2, READ8(m_fdc, upd765_family_device, mdma_r), WRITE8(m_fdc, upd765_family_device, mdma_w))
diff --git a/src/mame/drivers/ipc.cpp b/src/mame/drivers/ipc.cpp
index 846aab5ac7e..339ce3e5a92 100644
--- a/src/mame/drivers/ipc.cpp
+++ b/src/mame/drivers/ipc.cpp
@@ -94,41 +94,42 @@ void ipc_state::machine_reset()
}
-MACHINE_CONFIG_START(ipc_state::ipc)
+void ipc_state::ipc(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",I8085A, XTAL(19'660'800) / 4)
- MCFG_DEVICE_PROGRAM_MAP(ipc_mem)
- MCFG_DEVICE_IO_MAP(ipc_io)
-
- MCFG_DEVICE_ADD("pit", PIT8253, 0)
- MCFG_PIT8253_CLK0(XTAL(19'660'800) / 16)
- MCFG_PIT8253_CLK1(XTAL(19'660'800) / 16)
- MCFG_PIT8253_CLK2(XTAL(19'660'800) / 16)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("uart1", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart1", i8251_device, write_rxc))
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("uart2", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart2", i8251_device, write_rxc))
-
- MCFG_DEVICE_ADD("uart1", I8251, 0) // 8 data bits, no parity, 1 stop bit, 9600 baud
- MCFG_I8251_TXD_HANDLER(WRITELINE("rs232a", rs232_port_device, write_txd))
- MCFG_I8251_DTR_HANDLER(WRITELINE("rs232a", rs232_port_device, write_dtr))
- MCFG_I8251_RTS_HANDLER(WRITELINE("rs232a", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232a", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart1", i8251_device, write_rxd))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart1", i8251_device, write_dsr))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart1", i8251_device, write_cts))
-
- MCFG_DEVICE_ADD("uart2", I8251, 0) // 8 data bits, no parity, 2 stop bits, 2400 baud
- MCFG_I8251_TXD_HANDLER(WRITELINE("rs232b", rs232_port_device, write_txd))
- MCFG_I8251_DTR_HANDLER(WRITELINE("rs232b", rs232_port_device, write_dtr))
- MCFG_I8251_RTS_HANDLER(WRITELINE("rs232b", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232b", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart2", i8251_device, write_rxd))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart2", i8251_device, write_dsr))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart2", i8251_device, write_cts))
-MACHINE_CONFIG_END
+ I8085A(config, m_maincpu, XTAL(19'660'800) / 4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ipc_state::ipc_mem);
+ m_maincpu->set_addrmap(AS_IO, &ipc_state::ipc_io);
+
+ pit8253_device &pit(PIT8253(config, "pit", 0));
+ pit.set_clk<0>(XTAL(19'660'800) / 16);
+ pit.set_clk<1>(XTAL(19'660'800) / 16);
+ pit.set_clk<2>(XTAL(19'660'800) / 16);
+ pit.out_handler<0>().set("uart1", FUNC(i8251_device::write_txc));
+ pit.out_handler<0>().append("uart1", FUNC(i8251_device::write_rxc));
+ pit.out_handler<1>().set("uart2", FUNC(i8251_device::write_txc));
+ pit.out_handler<1>().append("uart2", FUNC(i8251_device::write_rxc));
+
+ i8251_device &uart1(I8251(config, "uart1", 0)); // 8 data bits, no parity, 1 stop bit, 9600 baud
+ uart1.txd_handler().set("rs232a", FUNC(rs232_port_device::write_txd));
+ uart1.dtr_handler().set("rs232a", FUNC(rs232_port_device::write_dtr));
+ uart1.rts_handler().set("rs232a", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, "terminal"));
+ rs232a.rxd_handler().set("uart1", FUNC(i8251_device::write_rxd));
+ rs232a.dsr_handler().set("uart1", FUNC(i8251_device::write_dsr));
+ rs232a.cts_handler().set("uart1", FUNC(i8251_device::write_cts));
+
+ i8251_device &uart2(I8251(config, "uart2", 0)); // 8 data bits, no parity, 2 stop bits, 2400 baud
+ uart2.txd_handler().set("rs232b", FUNC(rs232_port_device::write_txd));
+ uart2.dtr_handler().set("rs232b", FUNC(rs232_port_device::write_dtr));
+ uart2.rts_handler().set("rs232b", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr));
+ rs232b.rxd_handler().set("uart2", FUNC(i8251_device::write_rxd));
+ rs232b.dsr_handler().set("uart2", FUNC(i8251_device::write_dsr));
+ rs232b.cts_handler().set("uart2", FUNC(i8251_device::write_cts));
+}
/* ROM definition */
ROM_START( ipb )
diff --git a/src/mame/drivers/irisha.cpp b/src/mame/drivers/irisha.cpp
index 71f54b853bd..725b16c2d5c 100644
--- a/src/mame/drivers/irisha.cpp
+++ b/src/mame/drivers/irisha.cpp
@@ -391,14 +391,14 @@ MACHINE_CONFIG_START(irisha_state::irisha)
/* Devices */
MCFG_DEVICE_ADD("uart", I8251, 0)
- MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
- MCFG_PIT8253_CLK0(XTAL(16'000'000) / 9)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("pic8259", pic8259_device, ir0_w))
- MCFG_PIT8253_CLK1(XTAL(16'000'000) / 9 / 8 / 8)
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
- MCFG_PIT8253_CLK2(XTAL(16'000'000) / 9)
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, irisha_state, speaker_w))
+ PIT8253(config, m_pit, 0);
+ m_pit->set_clk<0>(16_MHz_XTAL / 9);
+ m_pit->out_handler<0>().set("pic8259", FUNC(pic8259_device::ir0_w));
+ m_pit->set_clk<1>(16_MHz_XTAL / 9 / 8 / 8);
+ m_pit->out_handler<1>().set("uart", FUNC(i8251_device::write_txc));
+ m_pit->out_handler<1>().append("uart", FUNC(i8251_device::write_rxc));
+ 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))
diff --git a/src/mame/drivers/isbc.cpp b/src/mame/drivers/isbc.cpp
index 46d8354e137..b187183d0a2 100644
--- a/src/mame/drivers/isbc.cpp
+++ b/src/mame/drivers/isbc.cpp
@@ -48,7 +48,6 @@ public:
, m_statuslatch(*this, "statuslatch")
, m_bios(*this, "user1")
, m_biosram(*this, "biosram")
- , m_leds(*this, "led%u", 0U)
{ }
void isbc2861(machine_config &config);
@@ -73,12 +72,8 @@ private:
DECLARE_WRITE8_MEMBER(edge_intr_clear_w);
DECLARE_WRITE8_MEMBER(status_register_w);
DECLARE_WRITE_LINE_MEMBER(nmi_mask_w);
- DECLARE_WRITE_LINE_MEMBER(override_w);
DECLARE_WRITE_LINE_MEMBER(bus_intr_out1_w);
DECLARE_WRITE_LINE_MEMBER(bus_intr_out2_w);
- DECLARE_WRITE_LINE_MEMBER(led_ds1_w);
- DECLARE_WRITE_LINE_MEMBER(led_ds3_w);
- DECLARE_WRITE_LINE_MEMBER(megabyte_select_w);
void isbc2861_mem(address_map &map);
void isbc286_io(address_map &map);
void isbc286_mem(address_map &map);
@@ -89,7 +84,6 @@ private:
void rpc86_io(address_map &map);
void rpc86_mem(address_map &map);
- virtual void machine_start() override { m_leds.resolve(); }
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
@@ -103,7 +97,6 @@ private:
optional_device<ls259_device> m_statuslatch;
optional_memory_region m_bios;
optional_shared_ptr<u16> m_biosram;
- output_finder<2> m_leds;
bool m_upperen;
offs_t m_megabyte_page;
@@ -323,12 +316,6 @@ WRITE_LINE_MEMBER(isbc_state::nmi_mask_w)
m_nmi_enable = state;
}
-WRITE_LINE_MEMBER(isbc_state::override_w)
-{
- // 1 = access onboard dual-port RAM
- m_override = state;
-}
-
WRITE_LINE_MEMBER(isbc_state::bus_intr_out1_w)
{
// Multibus interrupt request (active high)
@@ -339,21 +326,6 @@ WRITE_LINE_MEMBER(isbc_state::bus_intr_out2_w)
// Multibus interrupt request (active high)
}
-WRITE_LINE_MEMBER(isbc_state::led_ds1_w)
-{
- m_leds[0] = state ? 0 : 1;
-}
-
-WRITE_LINE_MEMBER(isbc_state::led_ds3_w)
-{
- m_leds[1] = state ? 0 : 1;
-}
-
-WRITE_LINE_MEMBER(isbc_state::megabyte_select_w)
-{
- m_megabyte_enable = !state;
-}
-
MACHINE_CONFIG_START(isbc_state::isbc86)
/* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", I8086, XTAL(5'000'000))
@@ -445,16 +417,16 @@ MACHINE_CONFIG_START(isbc_state::isbc8630)
MCFG_DEVICE_ADD("isbc_215g", ISBC_215G, 0x100, "maincpu")
MCFG_ISBC_215_IRQ(WRITELINE("pic_0", pic8259_device, ir5_w))
- MCFG_DEVICE_ADD("statuslatch", LS259, 0) // U14
-// MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("pit", pit8253_device, write_gate0))
-// MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("pit", pit8253_device, write_gate1))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, isbc_state, nmi_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, isbc_state, override_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, isbc_state, bus_intr_out1_w))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, isbc_state, bus_intr_out2_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, isbc_state, led_ds1_w))
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, isbc_state, led_ds3_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, isbc_state, megabyte_select_w))
+ LS259(config, m_statuslatch); // U14
+// m_statuslatch->q_out_cb<0>().set("pit", FUNC(pit8253_device::write_gate0));
+// m_statuslatch->q_out_cb<1>().set("pit", FUNC(pit8253_device::write_gate1));
+ m_statuslatch->q_out_cb<2>().set(FUNC(isbc_state::nmi_mask_w));
+ m_statuslatch->q_out_cb<3>().set([this] (int state) { m_override = state; }); // 1 = access onboard dual-port RAM
+ m_statuslatch->q_out_cb<4>().set(FUNC(isbc_state::bus_intr_out1_w));
+ m_statuslatch->q_out_cb<5>().set(FUNC(isbc_state::bus_intr_out2_w));
+ m_statuslatch->q_out_cb<5>().append_output("led0").invert(); // ds1
+ m_statuslatch->q_out_cb<6>().set_output("led1").invert(); // ds3
+ m_statuslatch->q_out_cb<7>().set([this] (int state) { m_megabyte_enable = !state; });
MACHINE_CONFIG_END
MACHINE_CONFIG_START(isbc_state::isbc286)
@@ -466,12 +438,12 @@ MACHINE_CONFIG_START(isbc_state::isbc286)
MCFG_DEVICE_ADD("pic_0", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, isbc_state, get_slave_ack))
MCFG_DEVICE_ADD("pic_1", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic_0", pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("pit", PIT8254, 0)
MCFG_PIT8253_CLK0(XTAL(22'118'400)/18)
diff --git a/src/mame/drivers/isbc8030.cpp b/src/mame/drivers/isbc8030.cpp
index 0cb5c28371f..4f7cc6d2ed6 100644
--- a/src/mame/drivers/isbc8030.cpp
+++ b/src/mame/drivers/isbc8030.cpp
@@ -37,12 +37,6 @@ X Examine and modify CPU registers
#include "machine/i8251.h"
#include "bus/rs232/rs232.h"
-#define I8259A_TAG "pic8259"
-#define I8253_TAG "pit8253"
-#define I8255A_TAG "ppi8255"
-#define I8251A_TAG "usart"
-#define I8251A_BAUD_TAG "usart_baud"
-#define RS232_TAG "rs232"
class isbc8030_state : public driver_device
{
@@ -50,11 +44,11 @@ public:
isbc8030_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
- , m_usart(*this, I8251A_TAG)
- , m_ppi(*this, I8255A_TAG)
- , m_pic(*this, I8259A_TAG)
- , m_pit(*this, I8253_TAG)
- , m_rs232(*this, RS232_TAG)
+ , m_usart(*this, "usart")
+ , m_ppi(*this, "ppi8255")
+ , m_pic(*this, "pic8259")
+ , m_pit(*this, "pit8253")
+ , m_rs232(*this, "rs232")
{ }
void isbc8030(machine_config &config);
@@ -92,35 +86,35 @@ void isbc8030_state::isbc8030_io(address_map &map)
static INPUT_PORTS_START( isbc8030 )
INPUT_PORTS_END
-MACHINE_CONFIG_START(isbc8030_state::isbc8030)
- /* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8085A, XTAL(22'118'400) / 4)
- MCFG_DEVICE_PROGRAM_MAP(isbc8030_mem)
- MCFG_DEVICE_IO_MAP(isbc8030_io)
-
- MCFG_DEVICE_ADD(I8259A_TAG, PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
-
- MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0)
- MCFG_PIT8253_CLK0(XTAL(22'118'400) / 18)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE(I8259A_TAG, pic8259_device, ir0_w))
- MCFG_PIT8253_CLK1(XTAL(22'118'400) / 18)
- MCFG_PIT8253_CLK2(XTAL(22'118'400) / 18)
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE(I8251A_TAG, i8251_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(I8251A_TAG, i8251_device, write_txc))
-
- MCFG_DEVICE_ADD(I8251A_TAG, I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_txd))
- MCFG_I8251_DTR_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_dtr))
- MCFG_I8251_RTS_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
-
- MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE(I8251A_TAG, i8251_device, write_rxd))
- MCFG_RS232_DSR_HANDLER(WRITELINE(I8251A_TAG, i8251_device, write_dsr))
- MCFG_RS232_CTS_HANDLER(WRITELINE(I8251A_TAG, i8251_device, write_cts))
-MACHINE_CONFIG_END
+void isbc8030_state::isbc8030(machine_config &config)
+{
+ I8085A(config, m_maincpu, XTAL(22'118'400) / 4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &isbc8030_state::isbc8030_mem);
+ m_maincpu->set_addrmap(AS_IO, &isbc8030_state::isbc8030_io);
+
+ PIC8259(config, m_pic, 0);
+ m_pic->out_int_callback().set_inputline(m_maincpu, 0);
+
+ PIT8253(config, m_pit, 0);
+ m_pit->set_clk<0>(XTAL(22'118'400) / 18);
+ m_pit->out_handler<0>().set(m_pic, FUNC(pic8259_device::ir0_w));
+ m_pit->set_clk<1>(XTAL(22'118'400) / 18);
+ m_pit->set_clk<2>(XTAL(22'118'400) / 18);
+ m_pit->out_handler<2>().set(m_usart, FUNC(i8251_device::write_rxc));
+ m_pit->out_handler<2>().append(m_usart, FUNC(i8251_device::write_txc));
+
+ I8251(config, m_usart, 0);
+ m_usart->txd_handler().set(m_rs232, FUNC(rs232_port_device::write_txd));
+ m_usart->dtr_handler().set(m_rs232, FUNC(rs232_port_device::write_dtr));
+ m_usart->rts_handler().set(m_rs232, FUNC(rs232_port_device::write_rts));
+
+ I8255A(config, m_ppi, 0);
+
+ RS232_PORT(config, m_rs232, default_rs232_devices, "terminal");
+ m_rs232->rxd_handler().set(m_usart, FUNC(i8251_device::write_rxd));
+ m_rs232->dsr_handler().set(m_usart, FUNC(i8251_device::write_dsr));
+ m_rs232->cts_handler().set(m_usart, FUNC(i8251_device::write_cts));
+}
/* ROM definition */
ROM_START( isbc8030 )
diff --git a/src/mame/drivers/iteagle.cpp b/src/mame/drivers/iteagle.cpp
index 663fc550d03..343e3c43426 100644
--- a/src/mame/drivers/iteagle.cpp
+++ b/src/mame/drivers/iteagle.cpp
@@ -173,15 +173,13 @@ MACHINE_CONFIG_START(iteagle_state::iteagle)
MCFG_DEVICE_ADD(PCI_ID_NILE, VRC4373, 0, m_maincpu)
MCFG_VRC4373_SET_RAM(0x00800000)
MCFG_VRC4373_SET_SIMM0(0x02000000)
- MCFG_DEVICE_ADD( PCI_ID_PERIPH, ITEAGLE_PERIPH, 0)
- MCFG_DEVICE_ADD( PCI_ID_IDE, IDE_PCI, 0, 0x1080C693, 0x00, 0x0)
- MCFG_IDE_PCI_IRQ_HANDLER( INPUTLINE(m_maincpu, MIPS3_IRQ2))
-
- MCFG_DEVICE_ADD( PCI_ID_FPGA, ITEAGLE_FPGA, 0, "screen", m_maincpu, MIPS3_IRQ1, MIPS3_IRQ4)
- MCFG_DEVICE_ADD( PCI_ID_SOUND, ES1373, 0)
- MCFG_SOUND_ROUTE(0, PCI_ID_SOUND":lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, PCI_ID_SOUND":rspeaker", 1.0)
- MCFG_ES1373_IRQ_HANDLER( INPUTLINE(m_maincpu, MIPS3_IRQ3))
+ ITEAGLE_PERIPH(config, PCI_ID_PERIPH, 0);
+ IDE_PCI(config, PCI_ID_IDE, 0, 0x1080C693, 0x00, 0x0).irq_handler().set_inputline(m_maincpu, MIPS3_IRQ2);
+
+ ITEAGLE_FPGA(config, PCI_ID_FPGA, 0, "screen", m_maincpu, MIPS3_IRQ1, MIPS3_IRQ4);
+ es1373_device &pci_sound(ES1373(config, PCI_ID_SOUND, 0));
+ pci_sound.add_route(0, PCI_ID_SOUND":lspeaker", 1.0).add_route(1, PCI_ID_SOUND":rspeaker", 1.0);
+ pci_sound.irq_handler().set_inputline(m_maincpu, MIPS3_IRQ3);
MCFG_DEVICE_ADD(PCI_ID_VIDEO, VOODOO_3_PCI, 0, m_maincpu, "screen")
MCFG_VOODOO_PCI_FBMEM(16)
diff --git a/src/mame/drivers/jade.cpp b/src/mame/drivers/jade.cpp
index 12f99d56acd..41e619fb7a6 100644
--- a/src/mame/drivers/jade.cpp
+++ b/src/mame/drivers/jade.cpp
@@ -70,14 +70,13 @@ MACHINE_CONFIG_START(jade_state::jade)
MCFG_DEVICE_PROGRAM_MAP(mem_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_DEVICE_ADD("ctc1", Z80CTC, XTAL(4'000'000))
+ Z80CTC(config, "ctc1", 4_MHz_XTAL);
- MCFG_DEVICE_ADD("ctc2", Z80CTC, XTAL(4'000'000))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, txca_w))
+ z80ctc_device &ctc2(Z80CTC(config, "ctc2", 4_MHz_XTAL));
+ ctc2.zc_callback<0>().set("sio", FUNC(z80sio_device::rxca_w));
+ ctc2.zc_callback<0>().append("sio", FUNC(z80sio_device::txca_w));
- MCFG_DEVICE_ADD("trg0", CLOCK, XTAL(4'000'000) / 2)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc2", z80ctc_device, trg0))
+ CLOCK(config, "trg0", 4_MHz_XTAL / 2).signal_handler().set("ctc2", FUNC(z80ctc_device::trg0));
/* Devices */
MCFG_DEVICE_ADD("sio", Z80SIO, XTAL(4'000'000))
diff --git a/src/mame/drivers/jp.cpp b/src/mame/drivers/jp.cpp
index 41faf918895..be2e3fe5400 100644
--- a/src/mame/drivers/jp.cpp
+++ b/src/mame/drivers/jp.cpp
@@ -340,33 +340,33 @@ MACHINE_CONFIG_START(jp_state::jp)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("latch0", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, disp_data_w)) MCFG_DEVCB_INVERT
+ LS259(config, m_latch[0]);
+ m_latch[0]->q_out_cb<1>().set(FUNC(jp_state::disp_data_w)).invert();
- MCFG_DEVICE_ADD("latch1", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, disp_clock_w)) MCFG_DEVCB_INVERT
+ LS259(config, m_latch[1]);
+ m_latch[1]->q_out_cb<1>().set(FUNC(jp_state::disp_clock_w)).invert();
- MCFG_DEVICE_ADD("latch2", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, disp_strobe_w)) MCFG_DEVCB_INVERT
+ LS259(config, m_latch[2]);
+ m_latch[2]->q_out_cb<1>().set(FUNC(jp_state::disp_strobe_w)).invert();
- MCFG_DEVICE_ADD("latch3", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, row_w))
+ LS259(config, m_latch[3]);
+ m_latch[3]->q_out_cb<1>().set(FUNC(jp_state::row_w));
- MCFG_DEVICE_ADD("latch4", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, row_w))
+ LS259(config, m_latch[4]);
+ m_latch[4]->q_out_cb<1>().set(FUNC(jp_state::row_w));
- MCFG_DEVICE_ADD("latch5", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, row_w))
+ LS259(config, m_latch[5]);
+ m_latch[5]->q_out_cb<1>().set(FUNC(jp_state::row_w));
- MCFG_DEVICE_ADD("latch6", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, row_w))
+ LS259(config, m_latch[6]);
+ m_latch[6]->q_out_cb<1>().set(FUNC(jp_state::row_w));
- MCFG_DEVICE_ADD("latch7", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jp_state, row_w))
+ LS259(config, m_latch[7]);
+ m_latch[7]->q_out_cb<1>().set(FUNC(jp_state::row_w));
- MCFG_DEVICE_ADD("latch8", LS259, 0)
+ LS259(config, m_latch[8]);
- MCFG_DEVICE_ADD("latch9", LS259, 0)
+ LS259(config, m_latch[9]);
/* Video */
MCFG_DEFAULT_LAYOUT(layout_jp)
diff --git a/src/mame/drivers/jpmsys5.cpp b/src/mame/drivers/jpmsys5.cpp
index 9d93ed80713..c59942041d5 100644
--- a/src/mame/drivers/jpmsys5.cpp
+++ b/src/mame/drivers/jpmsys5.cpp
@@ -35,6 +35,7 @@
#include "includes/jpmsys5.h"
#include "machine/clock.h"
+#include "machine/input_merger.h"
#include "sound/saa1099.h"
#include "screen.h"
#include "speaker.h"
@@ -537,11 +538,6 @@ WRITE_LINE_MEMBER(jpmsys5_state::u26_o1_callback)
*
*************************************/
-WRITE_LINE_MEMBER(jpmsys5_state::acia_irq)
-{
- m_maincpu->set_input_line(INT_6850ACIA, state ? ASSERT_LINE : CLEAR_LINE);
-}
-
WRITE_LINE_MEMBER(jpmsys5_state::a0_tx_w)
{
m_a0_data_out = state;
@@ -588,28 +584,30 @@ void jpmsys5v_state::machine_reset()
*************************************/
MACHINE_CONFIG_START(jpmsys5v_state::jpmsys5v)
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(8'000'000))
- MCFG_DEVICE_PROGRAM_MAP(m68000_map)
+ M68000(config, m_maincpu, 8_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &jpmsys5v_state::m68000_map);
+
+ INPUT_MERGER_ANY_HIGH(config, "acia_irq").output_handler().set_inputline(m_maincpu, INT_6850ACIA);
- MCFG_DEVICE_ADD("acia6850_0", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5v_state, a0_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5v_state, acia_irq))
+ ACIA6850(config, m_acia6850[0], 0);
+ m_acia6850[0]->txd_handler().set(FUNC(jpmsys5v_state::a0_tx_w));
+ m_acia6850[0]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<0>));
- MCFG_DEVICE_ADD("acia6850_1", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5v_state, a1_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5v_state, acia_irq))
+ ACIA6850(config, m_acia6850[1], 0);
+ m_acia6850[1]->txd_handler().set(FUNC(jpmsys5v_state::a1_tx_w));
+ m_acia6850[1]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<1>));
- MCFG_DEVICE_ADD("acia6850_2", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5v_state, a2_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5v_state, acia_irq))
+ ACIA6850(config, m_acia6850[2], 0);
+ m_acia6850[2]->txd_handler().set(FUNC(jpmsys5v_state::a2_tx_w));
+ m_acia6850[2]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<2>));
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 10000) // What are the correct ACIA clocks ?
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia6850_0", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_0", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_1", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_2", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_2", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 10000)); // What are the correct ACIA clocks ?
+ acia_clock.signal_handler().set(m_acia6850[0], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[0], FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append(m_acia6850[1], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[1], FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append(m_acia6850[2], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[2], FUNC(acia6850_device::write_rxc));
MCFG_NVRAM_ADD_0FILL("nvram")
@@ -807,29 +805,30 @@ void jpmsys5_state::machine_reset()
// later (incompatible with earlier revision) motherboards used a YM2413
MACHINE_CONFIG_START(jpmsys5_state::jpmsys5_ym)
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(8'000'000))
+ M68000(config, m_maincpu, 8_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &jpmsys5_state::m68000_awp_map);
- MCFG_DEVICE_PROGRAM_MAP(m68000_awp_map)
+ INPUT_MERGER_ANY_HIGH(config, "acia_irq").output_handler().set_inputline(m_maincpu, INT_6850ACIA);
- MCFG_DEVICE_ADD("acia6850_0", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5_state, a0_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5_state, acia_irq))
+ ACIA6850(config, m_acia6850[0], 0);
+ m_acia6850[0]->txd_handler().set(FUNC(jpmsys5_state::a0_tx_w));
+ m_acia6850[0]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<0>));
- MCFG_DEVICE_ADD("acia6850_1", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5_state, a1_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5_state, acia_irq))
+ ACIA6850(config, m_acia6850[1], 0);
+ m_acia6850[1]->txd_handler().set(FUNC(jpmsys5_state::a1_tx_w));
+ m_acia6850[1]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<1>));
- MCFG_DEVICE_ADD("acia6850_2", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5_state, a2_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5_state, acia_irq))
+ ACIA6850(config, m_acia6850[2], 0);
+ m_acia6850[2]->txd_handler().set(FUNC(jpmsys5_state::a2_tx_w));
+ m_acia6850[2]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<2>));
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 10000) // What are the correct ACIA clocks ?
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia6850_0", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_0", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_1", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_2", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_2", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 10000)); // What are the correct ACIA clocks ?
+ acia_clock.signal_handler().set(m_acia6850[0], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[0], FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append(m_acia6850[1], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[1], FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append(m_acia6850[2], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[2], FUNC(acia6850_device::write_rxc));
MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_S16LF01_ADD("vfd",0)
@@ -864,28 +863,30 @@ MACHINE_CONFIG_END
// the first rev PCB used an SAA1099
MACHINE_CONFIG_START(jpmsys5_state::jpmsys5)
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(8'000'000))
- MCFG_DEVICE_PROGRAM_MAP(m68000_awp_map_saa)
-
- MCFG_DEVICE_ADD("acia6850_0", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5_state, a0_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5_state, acia_irq))
-
- MCFG_DEVICE_ADD("acia6850_1", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5_state, a1_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5_state, acia_irq))
-
- MCFG_DEVICE_ADD("acia6850_2", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(*this, jpmsys5_state, a2_tx_w))
- MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(*this, jpmsys5_state, acia_irq))
-
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 10000) // What are the correct ACIA clocks ?
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia6850_0", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_0", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_1", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_2", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia6850_2", acia6850_device, write_rxc))
+ M68000(config, m_maincpu, 8_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &jpmsys5_state::m68000_awp_map_saa);
+
+ INPUT_MERGER_ANY_HIGH(config, "acia_irq").output_handler().set_inputline(m_maincpu, INT_6850ACIA);
+
+ ACIA6850(config, m_acia6850[0], 0);
+ m_acia6850[0]->txd_handler().set(FUNC(jpmsys5_state::a0_tx_w));
+ m_acia6850[0]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<0>));
+
+ ACIA6850(config, m_acia6850[1], 0);
+ m_acia6850[1]->txd_handler().set(FUNC(jpmsys5_state::a1_tx_w));
+ m_acia6850[1]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<1>));
+
+ ACIA6850(config, m_acia6850[2], 0);
+ m_acia6850[2]->txd_handler().set(FUNC(jpmsys5_state::a2_tx_w));
+ m_acia6850[2]->irq_handler().set("acia_irq", FUNC(input_merger_device::in_w<2>));
+
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 10000)); // What are the correct ACIA clocks ?
+ acia_clock.signal_handler().set(m_acia6850[0], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[0], FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append(m_acia6850[1], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[1], FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append(m_acia6850[2], FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append(m_acia6850[2], FUNC(acia6850_device::write_rxc));
MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_S16LF01_ADD("vfd",0)
diff --git a/src/mame/drivers/kaypro.cpp b/src/mame/drivers/kaypro.cpp
index 9bf3fb191ce..24ec3ce48bf 100644
--- a/src/mame/drivers/kaypro.cpp
+++ b/src/mame/drivers/kaypro.cpp
@@ -226,25 +226,25 @@ MACHINE_CONFIG_START(kaypro_state::kayproii)
/* devices */
MCFG_QUICKLOAD_ADD("quickload", kaypro_state, kaypro, "com,cpm", 3)
- MCFG_DEVICE_ADD("kbd", KAYPRO_10_KEYBOARD, 0)
- MCFG_KAYPRO10KBD_RXD_CB(WRITELINE("sio", z80sio_device, rxb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, syncb_w))
+ kaypro_10_keyboard_device &kbd(KAYPRO_10_KEYBOARD(config, "kbd"));
+ kbd.rxd_cb().set("sio", FUNC(z80sio_device::rxb_w));
+ kbd.rxd_cb().append("sio", FUNC(z80sio_device::syncb_w));
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, kaypro_state, write_centronics_busy))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
- MCFG_DEVICE_ADD("serial", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("sio", z80sio_device, rxa_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, synca_w)) // TODO: confirm this is connected
- MCFG_RS232_CTS_HANDLER(WRITELINE("sio", z80sio_device, ctsa_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("sio", z80sio_device, dcda_w))
+ rs232_port_device &serial(RS232_PORT(config, "serial", default_rs232_devices, nullptr));
+ serial.rxd_handler().set("sio", FUNC(z80sio_device::rxa_w));
+ serial.rxd_handler().append("sio", FUNC(z80sio_device::synca_w)); // TODO: confirm this is connected
+ serial.cts_handler().set("sio", FUNC(z80sio_device::ctsa_w));
+ serial.dcd_handler().set("sio", FUNC(z80sio_device::dcda_w));
- MCFG_DEVICE_ADD("brg", COM8116, XTAL(5'068'800)) // WD1943, SMC8116
- MCFG_COM8116_FT_HANDLER(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, txca_w))
- MCFG_COM8116_FR_HANDLER(WRITELINE("sio", z80sio_device, rxtxcb_w))
+ com8116_device &brg(COM8116(config, "brg", XTAL(5'068'800))); // WD1943, SMC8116
+ brg.ft_handler().set("sio", FUNC(z80sio_device::rxca_w));
+ brg.ft_handler().append("sio", FUNC(z80sio_device::txca_w));
+ brg.fr_handler().set("sio", FUNC(z80sio_device::rxtxcb_w));
MCFG_DEVICE_ADD("z80pio_g", Z80PIO, 20_MHz_XTAL / 8)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
@@ -322,28 +322,27 @@ MACHINE_CONFIG_START(kaypro_state::kaypro484)
MCFG_QUICKLOAD_ADD("quickload", kaypro_state, kaypro, "com,cpm", 3)
- MCFG_DEVICE_ADD("kbd", KAYPRO_10_KEYBOARD, 0)
- MCFG_KAYPRO10KBD_RXD_CB(WRITELINE("sio_1", z80sio_device, rxb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio_1", z80sio_device, syncb_w))
+ kaypro_10_keyboard_device &kbd(KAYPRO_10_KEYBOARD(config, "kbd"));
+ kbd.rxd_cb().set("sio_1", FUNC(z80sio_device::rxb_w));
+ kbd.rxd_cb().append("sio_1", FUNC(z80sio_device::syncb_w));
- MCFG_CLOCK_ADD("kbdtxrxc", 4800)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("sio_1", z80sio_device, rxtxcb_w))
+ CLOCK(config, "kbdtxrxc", 4800).signal_handler().set("sio_1", FUNC(z80sio_device::rxtxcb_w));
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, kaypro_state, write_centronics_busy))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
- MCFG_DEVICE_ADD("modem", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("sio_1", z80sio_device, rxa_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio_1", z80sio_device, synca_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("sio_1", z80sio_device, ctsa_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("sio_1", z80sio_device, dcda_w))
+ rs232_port_device &modem(RS232_PORT(config, "modem", default_rs232_devices, nullptr));
+ modem.rxd_handler().set("sio_1", FUNC(z80sio_device::rxa_w));
+ modem.rxd_handler().append("sio_1", FUNC(z80sio_device::synca_w));
+ modem.cts_handler().set("sio_1", FUNC(z80sio_device::ctsa_w));
+ modem.dcd_handler().set("sio_1", FUNC(z80sio_device::dcda_w));
- MCFG_DEVICE_ADD("serprn", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("sio_2", z80sio_device, rxa_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio_2", z80sio_device, synca_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("sio_2", z80sio_device, ctsa_w))
+ rs232_port_device &serprn(RS232_PORT(config, "serprn", default_rs232_devices, nullptr));
+ serprn.rxd_handler().set("sio_2", FUNC(z80sio_device::rxa_w));
+ serprn.rxd_handler().append("sio_2", FUNC(z80sio_device::synca_w));
+ serprn.cts_handler().set("sio_2", FUNC(z80sio_device::ctsa_w));
MCFG_DEVICE_ADD("sio_1", Z80SIO, 16_MHz_XTAL / 4)
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) // FIXME: use a combiner
@@ -356,11 +355,11 @@ MACHINE_CONFIG_START(kaypro_state::kaypro484)
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) // FIXME: use a combiner
MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("serprn", rs232_port_device, write_txd))
- MCFG_DEVICE_ADD("brg", COM8116, XTAL(5'068'800)) // WD1943, SMC8116
- MCFG_COM8116_FR_HANDLER(WRITELINE("sio_1", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio_1", z80sio_device, txca_w))
- MCFG_COM8116_FT_HANDLER(WRITELINE("sio_2", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio_2", z80sio_device, txca_w))
+ com8116_device &brg(COM8116(config, "brg", XTAL(5'068'800))); // WD1943, SMC8116
+ brg.fr_handler().set("sio_1", FUNC(z80sio_device::rxca_w));
+ brg.fr_handler().append("sio_1", FUNC(z80sio_device::txca_w));
+ brg.ft_handler().set("sio_2", FUNC(z80sio_device::rxca_w));
+ brg.ft_handler().append("sio_2", FUNC(z80sio_device::txca_w));
MCFG_DEVICE_ADD("fdc", FD1793, 16_MHz_XTAL / 16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, kaypro_state, fdc_intrq_w))
diff --git a/src/mame/drivers/kdt6.cpp b/src/mame/drivers/kdt6.cpp
index 8aeb0c48814..9be939079ad 100644
--- a/src/mame/drivers/kdt6.cpp
+++ b/src/mame/drivers/kdt6.cpp
@@ -654,41 +654,41 @@ MACHINE_CONFIG_START(kdt6_state::psi98)
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, kdt6_state, io_w))
// jumper J3 allows selection of 16MHz / 8 instead
- MCFG_CLOCK_ADD("uart_clk", XTAL(9'830'400) / 8)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc1", z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc1", z80ctc_device, trg2))
-
- MCFG_DEVICE_ADD("ctc1", Z80CTC, XTAL(16'000'000) / 4)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio", z80sio_device, rxtxcb_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, txca_w))
-
- MCFG_DEVICE_ADD("ctc2", Z80CTC, XTAL(16'000'000) / 4)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("speaker", speaker_sound_device, level_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("ctc2", z80ctc_device, trg3))
-
- MCFG_DEVICE_ADD("sio", Z80SIO, XTAL(16'000'000) / 4)
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs232a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs232a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs232a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE(*this, kdt6_state, siob_tx_w))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs232b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs232b", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232a", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("sio", z80sio_device, rxa_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("sio", z80sio_device, dcda_w))
- MCFG_RS232_DSR_HANDLER(WRITELINE("sio", z80sio_device, synca_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("sio", z80sio_device, ctsa_w)) MCFG_DEVCB_XOR(1)
-
- MCFG_DEVICE_ADD("rs232b", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE(*this, kdt6_state, rs232b_rx_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("sio", z80sio_device, dcdb_w))
- MCFG_RS232_DSR_HANDLER(WRITELINE("sio", z80sio_device, syncb_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("sio", z80sio_device, ctsb_w)) MCFG_DEVCB_XOR(1)
+ clock_device &uart_clk(CLOCK(config, "uart_clk", XTAL(9'830'400) / 8));
+ uart_clk.signal_handler().set("ctc1", FUNC(z80ctc_device::trg1));
+ uart_clk.signal_handler().append("ctc1", FUNC(z80ctc_device::trg2));
+
+ z80ctc_device &ctc1(Z80CTC(config, "ctc1", XTAL(16'000'000) / 4));
+ ctc1.intr_callback().set_inputline(m_cpu, INPUT_LINE_IRQ0);
+ ctc1.zc_callback<1>().set(m_sio, FUNC(z80sio_device::rxtxcb_w));
+ ctc1.zc_callback<2>().set(m_sio, FUNC(z80sio_device::rxca_w));
+ ctc1.zc_callback<2>().append(m_sio, FUNC(z80sio_device::txca_w));
+
+ z80ctc_device &ctc2(Z80CTC(config, "ctc2", XTAL(16'000'000) / 4));
+ ctc2.intr_callback().set_inputline(m_cpu, INPUT_LINE_IRQ0);
+ ctc2.zc_callback<0>().set("speaker", FUNC(speaker_sound_device::level_w));
+ ctc2.zc_callback<2>().set("ctc2", FUNC(z80ctc_device::trg3));
+
+ Z80SIO(config, m_sio, XTAL(16'000'000) / 4);
+ m_sio->out_int_callback().set_inputline(m_cpu, INPUT_LINE_IRQ0);
+ m_sio->out_txda_callback().set("rs232a", FUNC(rs232_port_device::write_txd));
+ m_sio->out_dtra_callback().set("rs232a", FUNC(rs232_port_device::write_dtr));
+ m_sio->out_rtsa_callback().set("rs232a", FUNC(rs232_port_device::write_rts));
+ m_sio->out_txdb_callback().set(FUNC(kdt6_state::siob_tx_w));
+ m_sio->out_dtrb_callback().set(m_rs232b, FUNC(rs232_port_device::write_dtr));
+ m_sio->out_rtsb_callback().set(m_rs232b, FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, nullptr));
+ rs232a.rxd_handler().set(m_sio, FUNC(z80sio_device::rxa_w));
+ rs232a.dcd_handler().set(m_sio, FUNC(z80sio_device::dcda_w));
+ rs232a.dsr_handler().set(m_sio, FUNC(z80sio_device::synca_w));
+ rs232a.cts_handler().set(m_sio, FUNC(z80sio_device::ctsa_w)).invert();
+
+ RS232_PORT(config, m_rs232b, default_rs232_devices, nullptr);
+ m_rs232b->rxd_handler().set(FUNC(kdt6_state::rs232b_rx_w));
+ m_rs232b->dcd_handler().set(m_sio, FUNC(z80sio_device::dcdb_w));
+ m_rs232b->dsr_handler().set(m_sio, FUNC(z80sio_device::syncb_w));
+ m_rs232b->cts_handler().set(m_sio, FUNC(z80sio_device::ctsb_w)).invert();
MCFG_DEVICE_ADD("pio", Z80PIO, XTAL(16'000'000) / 4)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/kingobox.cpp b/src/mame/drivers/kingobox.cpp
index 5f7ff56bf8c..7244289575e 100644
--- a/src/mame/drivers/kingobox.cpp
+++ b/src/mame/drivers/kingobox.cpp
@@ -465,28 +465,27 @@ void kingofb_state::machine_reset()
MACHINE_CONFIG_START(kingofb_state::kingofb)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(kingobox_map)
+ Z80(config, m_maincpu, 4000000); // 4.0 MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &kingofb_state::kingobox_map);
- MCFG_DEVICE_ADD("video", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(kingobox_video_map)
+ Z80(config, m_video_cpu, 4000000); // 4.0 MHz
+ m_video_cpu->set_addrmap(AS_PROGRAM, &kingofb_state::kingobox_video_map);
- MCFG_DEVICE_ADD("sprite", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(kingobox_sprite_map)
+ Z80(config, m_sprite_cpu, 4000000); // 4.0 MHz
+ m_sprite_cpu->set_addrmap(AS_PROGRAM, &kingofb_state::kingobox_sprite_map);
- MCFG_INPUT_MERGER_ALL_HIGH("nmigate")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("video", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sprite", INPUT_LINE_NMI))
+ INPUT_MERGER_ALL_HIGH(config, m_nmigate);
+ m_nmigate->output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ m_nmigate->output_handler().append_inputline(m_video_cpu, INPUT_LINE_NMI);
+ m_nmigate->output_handler().append_inputline(m_sprite_cpu, INPUT_LINE_NMI);
- MCFG_DEVICE_ADD("audiocpu", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(kingobox_sound_map)
- MCFG_DEVICE_IO_MAP(kingobox_sound_io_map)
+ Z80(config, m_audiocpu, 4000000); // 4.0 MHz
+ m_audiocpu->set_addrmap(AS_PROGRAM, &kingofb_state::kingobox_sound_map);
+ m_audiocpu->set_addrmap(AS_IO, &kingofb_state::kingobox_sound_io_map);
- MCFG_DEVICE_ADD("soundnmi", CLOCK, 6000) /* Hz */
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ CLOCK(config, "soundnmi", 6000).signal_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* We really need heavy synching among the processors */
+ MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // We really need heavy synching among the processors
/* video hardware */
@@ -524,28 +523,27 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(kingofb_state::ringking)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(ringking_map)
+ Z80(config, m_maincpu, 4000000); // 4.0 MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &kingofb_state::ringking_map);
- MCFG_DEVICE_ADD("video", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(ringking_video_map)
+ Z80(config, m_video_cpu, 4000000); // 4.0 MHz
+ m_video_cpu->set_addrmap(AS_PROGRAM, &kingofb_state::ringking_video_map);
- MCFG_DEVICE_ADD("sprite", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(ringking_sprite_map)
+ Z80(config, m_sprite_cpu, 4000000); // 4.0 MHz
+ m_sprite_cpu->set_addrmap(AS_PROGRAM, &kingofb_state::ringking_sprite_map);
- MCFG_INPUT_MERGER_ALL_HIGH("nmigate")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("video", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sprite", INPUT_LINE_NMI))
+ INPUT_MERGER_ALL_HIGH(config, m_nmigate);
+ m_nmigate->output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ m_nmigate->output_handler().append_inputline(m_video_cpu, INPUT_LINE_NMI);
+ m_nmigate->output_handler().append_inputline(m_sprite_cpu, INPUT_LINE_NMI);
- MCFG_DEVICE_ADD("audiocpu", Z80, 4000000) /* 4.0 MHz */
- MCFG_DEVICE_PROGRAM_MAP(kingobox_sound_map)
- MCFG_DEVICE_IO_MAP(ringking_sound_io_map)
+ Z80(config, m_audiocpu, 4000000); // 4.0 MHz
+ m_audiocpu->set_addrmap(AS_PROGRAM, &kingofb_state::kingobox_sound_map);
+ m_audiocpu->set_addrmap(AS_IO, &kingofb_state::ringking_sound_io_map);
- MCFG_DEVICE_ADD("soundnmi", CLOCK, 6000) /* Hz */
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ CLOCK(config, "soundnmi", 6000).signal_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* We really need heavy synching among the processors */
+ MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // We really need heavy synching among the processors
/* video hardware */
diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp
index 2115fc25dd7..8a40c968940 100644
--- a/src/mame/drivers/kinst.cpp
+++ b/src/mame/drivers/kinst.cpp
@@ -727,9 +727,8 @@ MACHINE_CONFIG_START(kinst_state::kinst)
MCFG_DEVICE_PROGRAM_MAP(main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", kinst_state, irq0_start)
-
MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true)
- MCFG_ATA_INTERFACE_IRQ_HANDLER(INPUTLINE(m_maincpu, 1))
+ MCFG_ATA_INTERFACE_IRQ_HANDLER(INPUTLINE("maincpu", 1))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/konin.cpp b/src/mame/drivers/konin.cpp
index 82e0a43ec90..07671e183ce 100644
--- a/src/mame/drivers/konin.cpp
+++ b/src/mame/drivers/konin.cpp
@@ -141,24 +141,24 @@ MACHINE_CONFIG_START(konin_state::konin)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("intlatch", i8212_device, inta_cb)
MCFG_DEVICE_ADD("intlatch", I8212, 0)
- MCFG_I8212_MD_CALLBACK(GND)
+ MCFG_I8212_MD_CALLBACK(CONSTANT(0))
MCFG_I8212_DI_CALLBACK(READ8("picu", i8214_device, vector_r))
MCFG_I8212_INT_CALLBACK(INPUTLINE("maincpu", I8085_INTR_LINE))
MCFG_DEVICE_ADD("picu", I8214, XTAL(4'000'000))
MCFG_I8214_INT_CALLBACK(WRITELINE("intlatch", i8212_device, stb_w))
- MCFG_DEVICE_ADD("mainpit", PIT8253, 0)
+ pit8253_device &mainpit(PIT8253(config, "mainpit", 0));
// wild guess at UART clock and source
- MCFG_PIT8253_CLK0(1536000)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ mainpit.set_clk<0>(1536000);
+ mainpit.out_handler<0>().set("uart", FUNC(i8251_device::write_txc));
+ mainpit.out_handler<0>().append("uart", FUNC(i8251_device::write_rxc));
- MCFG_DEVICE_ADD("mainppi", I8255, 0)
+ I8255(config, "mainppi", 0);
- MCFG_DEVICE_ADD("iopit", PIT8253, 0)
+ PIT8253(config, m_iopit, 0);
- MCFG_DEVICE_ADD("ioppi", I8255, 0)
+ I8255(config, m_ioppi, 0);
MCFG_DEVICE_ADD("uart", I8251, 0)
MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/kopunch.cpp b/src/mame/drivers/kopunch.cpp
index 8fbacc46d01..249bcd57a5a 100644
--- a/src/mame/drivers/kopunch.cpp
+++ b/src/mame/drivers/kopunch.cpp
@@ -247,24 +247,24 @@ MACHINE_CONFIG_START(kopunch_state::kopunch)
MCFG_I8255_IN_PORTB_CB(READ8(*this, kopunch_state, sensors1_r))
MCFG_I8255_IN_PORTC_CB(READ8(*this, kopunch_state, sensors2_r))
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
+ i8255_device &ppi1(I8255A(config, "ppi8255_1", 0));
// $34 - always $80 (PPI mode 0, ports A & B & C as output)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, kopunch_state, coin_w))
- MCFG_I8255_OUT_PORTB_CB(LOGGER("PPI8255 - unmapped write port B"))
- MCFG_I8255_OUT_PORTC_CB(LOGGER("PPI8255 - unmapped write port C"))
+ 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");
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
+ i8255_device &ppi2(I8255A(config, "ppi8255_2", 0));
// $38 - always $89 (PPI mode 0, ports A & B as output, port C as input)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, kopunch_state, lamp_w))
- MCFG_I8255_OUT_PORTB_CB(LOGGER("PPI8255 - unmapped write port B"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("DSW"))
+ 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");
- MCFG_DEVICE_ADD("ppi8255_3", I8255A, 0)
+ i8255_device &ppi3(I8255A(config, "ppi8255_3", 0));
// $3c - always $88 (PPI mode 0, ports A & B & lower C as output, upper C as input)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, kopunch_state, scroll_x_w))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, kopunch_state, scroll_y_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("P2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, kopunch_state, gfxbank_w))
+ ppi3.out_pa_callback().set(FUNC(kopunch_state::scroll_x_w));
+ ppi3.out_pb_callback().set(FUNC(kopunch_state::scroll_y_w));
+ ppi3.in_pc_callback().set_ioport("P2");
+ ppi3.out_pc_callback().set(FUNC(kopunch_state::gfxbank_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/kyugo.cpp b/src/mame/drivers/kyugo.cpp
index c4174157658..49f42ac102e 100644
--- a/src/mame/drivers/kyugo.cpp
+++ b/src/mame/drivers/kyugo.cpp
@@ -534,10 +534,10 @@ MACHINE_CONFIG_START(kyugo_state::kyugo_base)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("mainlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, kyugo_state, nmi_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, kyugo_state, flipscreen_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &mainlatch(LS259(config, "mainlatch"));
+ mainlatch.q_out_cb<0>().set(FUNC(kyugo_state::nmi_mask_w));
+ mainlatch.q_out_cb<1>().set(FUNC(kyugo_state::flipscreen_w));
+ mainlatch.q_out_cb<2>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert();
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/liberatr.cpp b/src/mame/drivers/liberatr.cpp
index 9cff2742c9e..9ed5915adc9 100644
--- a/src/mame/drivers/liberatr.cpp
+++ b/src/mame/drivers/liberatr.cpp
@@ -429,15 +429,15 @@ MACHINE_CONFIG_START(liberatr_state::liberatr)
MCFG_DEVICE_ADD("earom", ER2055, 0)
- MCFG_DEVICE_ADD("outlatch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // START LED1
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // START LED2
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // TBSWP
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // SPARE
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, liberatr_state, trackball_reset_w)) // CTRLD
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, liberatr_state, coin_counter_right_w))
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, liberatr_state, coin_counter_left_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, liberatr_state, planet_select_w))
+ LS259(config, m_outlatch);
+ m_outlatch->q_out_cb<0>().set_output("led0").invert(); // START LED1
+ m_outlatch->q_out_cb<1>().set_output("led1").invert(); // START LED2
+ m_outlatch->q_out_cb<2>().set_nop(); // TBSWP
+ m_outlatch->q_out_cb<3>().set_nop(); // SPARE
+ m_outlatch->q_out_cb<4>().set(FUNC(liberatr_state::trackball_reset_w)); // CTRLD
+ m_outlatch->q_out_cb<5>().set(FUNC(liberatr_state::coin_counter_right_w));
+ m_outlatch->q_out_cb<6>().set(FUNC(liberatr_state::coin_counter_left_w));
+ m_outlatch->q_out_cb<7>().set([this] (int state) { m_planet_select = state; });
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/m24.cpp b/src/mame/drivers/m24.cpp
index 0b494adce18..4dc916ddf52 100644
--- a/src/mame/drivers/m24.cpp
+++ b/src/mame/drivers/m24.cpp
@@ -297,7 +297,7 @@ MACHINE_CONFIG_START(m24_state::olivetti)
MCFG_DEVICE_MODIFY("mb:dma8237")
MCFG_I8237_OUT_HREQ_CB(WRITELINE(*this, m24_state, dma_hrq_w))
MCFG_DEVICE_MODIFY("mb:pic8259")
- devcb = &downcast<pic8259_device &>(*device).set_out_int_callback(DEVCB_WRITELINE(*this, m24_state, int_w));
+ downcast<pic8259_device &>(*device).set_out_int_callback(DEVCB_WRITELINE(*this, m24_state, int_w));
/* software lists */
MCFG_SOFTWARE_LIST_ADD("disk_list","ibm5150")
diff --git a/src/mame/drivers/m79152pc.cpp b/src/mame/drivers/m79152pc.cpp
index a4287e8e44a..d39720ed3b3 100644
--- a/src/mame/drivers/m79152pc.cpp
+++ b/src/mame/drivers/m79152pc.cpp
@@ -144,9 +144,9 @@ MACHINE_CONFIG_START(m79152pc_state::m79152pc)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_m79152pc)
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", z80sio_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", z80sio_device, rxca_w))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
+ uart_clock.signal_handler().set(m_uart, FUNC(z80sio_device::txca_w));
+ uart_clock.signal_handler().append(m_uart, FUNC(z80sio_device::rxca_w));
MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(4'000'000))
//MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/magmax.cpp b/src/mame/drivers/magmax.cpp
index 65cb698f624..726d2219e8b 100644
--- a/src/mame/drivers/magmax.cpp
+++ b/src/mame/drivers/magmax.cpp
@@ -366,9 +366,9 @@ MACHINE_CONFIG_START(magmax_state::magmax)
MCFG_DEVICE_ADD(m_ay[2], AY8910, XTAL(20'000'000)/16) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_audiocpu, 0))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
+ m_soundlatch->set_separate_acknowledge(true);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mappy.cpp b/src/mame/drivers/mappy.cpp
index 58cf22ed556..6c948e7a9b3 100644
--- a/src/mame/drivers/mappy.cpp
+++ b/src/mame/drivers/mappy.cpp
@@ -1333,22 +1333,21 @@ MACHINE_CONFIG_START(mappy_state::superpac_common)
MCFG_DEVICE_ADD("sub", MC6809E, PIXEL_CLOCK/4) /* 1.536 MHz */
MCFG_DEVICE_PROGRAM_MAP(superpac_cpu2_map)
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 2M on CPU board
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mappy_state, int_on_2_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mappy_state, int_on_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("namco", namco_15xx_device, sound_enable_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("namcoio_1", namcoio_device, set_reset_line)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("namcoio_2", namcoio_device, set_reset_line)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &mainlatch(LS259(config, "mainlatch")); // 2M on CPU board
+ mainlatch.q_out_cb<0>().set(FUNC(mappy_state::int_on_2_w));
+ mainlatch.q_out_cb<1>().set(FUNC(mappy_state::int_on_w));
+ mainlatch.q_out_cb<3>().set(m_namco_15xx, FUNC(namco_15xx_device::sound_enable_w));
+ mainlatch.q_out_cb<4>().set(m_namcoio[0], FUNC(namcoio_device::set_reset_line)).invert();
+ mainlatch.q_out_cb<4>().append(m_namcoio[1], FUNC(namcoio_device::set_reset_line)).invert();
+ mainlatch.q_out_cb<5>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert();
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
- MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
- /* synchronization of the CPUs */
+ 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("dipmux", LS157, 0)
- MCFG_74157_A_IN_CB(IOPORT("DSW2"))
- MCFG_74157_B_IN_CB(IOPORT("DSW2")) MCFG_DEVCB_RSHIFT(4)
+ ls157_device &dipmux(LS157(config, "dipmux"));
+ dipmux.a_in_callback().set_ioport("DSW2");
+ dipmux.b_in_callback().set_ioport("DSW2").rshift(4);
/* video hardware */
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_superpac)
@@ -1373,60 +1372,60 @@ MACHINE_CONFIG_START(mappy_state::superpac_common)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(mappy_state::superpac)
-
+void mappy_state::superpac(machine_config &config)
+{
superpac_common(config);
- MCFG_DEVICE_ADD("namcoio_1", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(IOPORT("COINS"))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("P1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2"))
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
-
- MCFG_DEVICE_ADD("namcoio_2", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(READ8("dipmux", ls157_device, output_r))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("DSW1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("DSW0"))
- MCFG_NAMCO56XX_OUT_0_CB(WRITELINE("dipmux", ls157_device, select_w)) MCFG_DEVCB_BIT(0)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(mappy_state::pacnpal)
+ NAMCO_56XX(config, m_namcoio[0], 0);
+ m_namcoio[0]->in_callback<0>().set_ioport("COINS");
+ m_namcoio[0]->in_callback<1>().set_ioport("P1");
+ m_namcoio[0]->in_callback<2>().set_ioport("P2");
+ m_namcoio[0]->in_callback<3>().set_ioport("BUTTONS");
+
+ NAMCO_56XX(config, m_namcoio[1], 0);
+ m_namcoio[1]->in_callback<0>().set("dipmux", FUNC(ls157_device::output_r));
+ m_namcoio[1]->in_callback<1>().set_ioport("DSW1");
+ m_namcoio[1]->in_callback<2>().set_ioport("DSW1").rshift(4);
+ m_namcoio[1]->in_callback<3>().set_ioport("DSW0");
+ m_namcoio[1]->out_callback<0>().set("dipmux", FUNC(ls157_device::select_w)).bit(0);
+}
+void mappy_state::pacnpal(machine_config &config)
+{
superpac_common(config);
- MCFG_DEVICE_ADD("namcoio_1", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(IOPORT("COINS"))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("P1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2"))
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
- MCFG_NAMCO56XX_OUT_0_CB(WRITE8(*this, mappy_state, out_lamps))
-
- MCFG_DEVICE_ADD("namcoio_2", NAMCO_59XX, 0)
- MCFG_NAMCO59XX_IN_0_CB(READ8("dipmux", ls157_device, output_r))
- MCFG_NAMCO59XX_IN_1_CB(IOPORT("DSW1"))
- MCFG_NAMCO59XX_IN_2_CB(IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO59XX_IN_3_CB(IOPORT("DSW0"))
- MCFG_NAMCO59XX_OUT_0_CB(WRITELINE("dipmux", ls157_device, select_w)) MCFG_DEVCB_BIT(0)
-MACHINE_CONFIG_END
+ NAMCO_56XX(config, m_namcoio[0], 0);
+ m_namcoio[0]->in_callback<0>().set_ioport("COINS");
+ m_namcoio[0]->in_callback<1>().set_ioport("P1");
+ m_namcoio[0]->in_callback<2>().set_ioport("P2");
+ m_namcoio[0]->in_callback<3>().set_ioport("BUTTONS");
+ m_namcoio[0]->out_callback<0>().set(FUNC(mappy_state::out_lamps));
+
+ NAMCO_59XX(config, m_namcoio[1], 0);
+ m_namcoio[1]->in_callback<0>().set("dipmux", FUNC(ls157_device::output_r));
+ m_namcoio[1]->in_callback<1>().set_ioport("DSW1");
+ m_namcoio[1]->in_callback<2>().set_ioport("DSW1").rshift(4);
+ m_namcoio[1]->in_callback<3>().set_ioport("DSW0");
+ m_namcoio[1]->out_callback<0>().set("dipmux", FUNC(ls157_device::select_w)).bit(0);
+}
MACHINE_CONFIG_START(mappy_state::grobda)
superpac_common(config);
- MCFG_DEVICE_ADD("namcoio_1", NAMCO_58XX, 0)
- MCFG_NAMCO58XX_IN_0_CB(IOPORT("COINS"))
- MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
- MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
- MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
+ NAMCO_58XX(config, m_namcoio[0], 0);
+ m_namcoio[0]->in_callback<0>().set_ioport("COINS");
+ m_namcoio[0]->in_callback<1>().set_ioport("P1");
+ m_namcoio[0]->in_callback<2>().set_ioport("P2");
+ m_namcoio[0]->in_callback<3>().set_ioport("BUTTONS");
- MCFG_DEVICE_ADD("namcoio_2", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(READ8("dipmux", ls157_device, output_r))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("DSW1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("DSW0"))
- MCFG_NAMCO56XX_OUT_0_CB(WRITELINE("dipmux", ls157_device, select_w)) MCFG_DEVCB_BIT(0)
+ NAMCO_56XX(config, m_namcoio[1], 0);
+ m_namcoio[1]->in_callback<0>().set("dipmux", FUNC(ls157_device::output_r));
+ m_namcoio[1]->in_callback<1>().set_ioport("DSW1");
+ m_namcoio[1]->in_callback<2>().set_ioport("DSW1").rshift(4);
+ m_namcoio[1]->in_callback<3>().set_ioport("DSW0");
+ m_namcoio[1]->out_callback<0>().set("dipmux", FUNC(ls157_device::select_w)).bit(0);
/* sound hardware */
MCFG_DEVICE_ADD("dac", DAC_4BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.275) // alternate route to 15XX-related DAC?
@@ -1447,36 +1446,36 @@ MACHINE_CONFIG_START(mappy_state::phozon)
MCFG_DEVICE_ADD("sub2", MC6809E, PIXEL_CLOCK/4) /* SUB CPU */
MCFG_DEVICE_PROGRAM_MAP(phozon_cpu3_map)
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 5C
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mappy_state, int_on_2_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mappy_state, int_on_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mappy_state, int_on_3_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("namco", namco_15xx_device, sound_enable_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("namcoio_1", namco58xx_device, set_reset_line)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("namcoio_2", namco56xx_device, set_reset_line)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(INPUTLINE("sub2", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &mainlatch(LS259(config, "mainlatch")); // 5C
+ mainlatch.q_out_cb<0>().set(FUNC(mappy_state::int_on_2_w));
+ mainlatch.q_out_cb<1>().set(FUNC(mappy_state::int_on_w));
+ mainlatch.q_out_cb<2>().set(FUNC(mappy_state::int_on_3_w));
+ mainlatch.q_out_cb<3>().set(m_namco_15xx, FUNC(namco_15xx_device::sound_enable_w));
+ mainlatch.q_out_cb<4>().set(m_namcoio[0], FUNC(namcoio_device::set_reset_line)).invert();
+ mainlatch.q_out_cb<4>().append(m_namcoio[1], FUNC(namcoio_device::set_reset_line)).invert();
+ mainlatch.q_out_cb<5>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert();
+ mainlatch.q_out_cb<6>().set_inputline(m_subcpu2, INPUT_LINE_RESET).invert();
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
- 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("namcoio_1", NAMCO_58XX, 0)
- MCFG_NAMCO58XX_IN_0_CB(IOPORT("COINS"))
- MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
- MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
- MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
-
- MCFG_DEVICE_ADD("namcoio_2", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(READ8("dipmux", ls157_device, output_r))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("DSW1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("DSW0"))
- MCFG_NAMCO56XX_OUT_0_CB(WRITELINE("dipmux", ls157_device, select_w)) MCFG_DEVCB_BIT(0)
-
- MCFG_DEVICE_ADD("dipmux", LS157, 0)
- MCFG_74157_A_IN_CB(IOPORT("DSW2"))
- MCFG_74157_B_IN_CB(IOPORT("DSW2")) MCFG_DEVCB_RSHIFT(4)
+ MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // 100 CPU slices per frame - an high value to ensure proper synchronization of the CPUs
+
+ NAMCO_58XX(config, m_namcoio[0], 0);
+ m_namcoio[0]->in_callback<0>().set_ioport("COINS");
+ m_namcoio[0]->in_callback<1>().set_ioport("P1");
+ m_namcoio[0]->in_callback<2>().set_ioport("P2");
+ m_namcoio[0]->in_callback<3>().set_ioport("BUTTONS");
+
+ NAMCO_56XX(config, m_namcoio[1], 0);
+ m_namcoio[1]->in_callback<0>().set("dipmux", FUNC(ls157_device::output_r));
+ m_namcoio[1]->in_callback<1>().set_ioport("DSW1");
+ m_namcoio[1]->in_callback<2>().set_ioport("DSW1").rshift(4);
+ m_namcoio[1]->in_callback<3>().set_ioport("DSW0");
+ m_namcoio[1]->out_callback<0>().set("dipmux", FUNC(ls157_device::select_w)).bit(0);
+
+ ls157_device &dipmux(LS157(config, "dipmux"));
+ dipmux.a_in_callback().set_ioport("DSW2");
+ dipmux.b_in_callback().set_ioport("DSW2").rshift(4);
/* video hardware */
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_phozon)
@@ -1510,23 +1509,22 @@ MACHINE_CONFIG_START(mappy_state::mappy_common)
MCFG_DEVICE_ADD("sub", MC6809E, PIXEL_CLOCK/4) /* 1.536 MHz */
MCFG_DEVICE_PROGRAM_MAP(mappy_cpu2_map)
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 2M on CPU board
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mappy_state, int_on_2_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mappy_state, int_on_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mappy_state, mappy_flip_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("namco", namco_15xx_device, sound_enable_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("namcoio_1", namcoio_device, set_reset_line)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("namcoio_2", namcoio_device, set_reset_line)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &mainlatch(LS259(config, "mainlatch")); // 2M on CPU board
+ mainlatch.q_out_cb<0>().set(FUNC(mappy_state::int_on_2_w));
+ mainlatch.q_out_cb<1>().set(FUNC(mappy_state::int_on_w));
+ mainlatch.q_out_cb<2>().set(FUNC(mappy_state::mappy_flip_w));
+ mainlatch.q_out_cb<3>().set(m_namco_15xx, FUNC(namco_15xx_device::sound_enable_w));
+ mainlatch.q_out_cb<4>().set(m_namcoio[0], FUNC(namcoio_device::set_reset_line)).invert();
+ mainlatch.q_out_cb<4>().append(m_namcoio[1], FUNC(namcoio_device::set_reset_line)).invert();
+ mainlatch.q_out_cb<5>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert();
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
- MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
- /* synchronization of the CPUs */
+ 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("dipmux", LS157, 0)
- MCFG_74157_A_IN_CB(IOPORT("DSW2"))
- MCFG_74157_B_IN_CB(IOPORT("DSW2")) MCFG_DEVCB_RSHIFT(4)
+ ls157_device &dipmux(LS157(config, "dipmux"));
+ dipmux.a_in_callback().set_ioport("DSW2");
+ dipmux.b_in_callback().set_ioport("DSW2").rshift(4);
/* video hardware */
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_mappy)
@@ -1550,23 +1548,23 @@ MACHINE_CONFIG_START(mappy_state::mappy_common)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(mappy_state::mappy)
-
+void mappy_state::mappy(machine_config &config)
+{
mappy_common(config);
- MCFG_DEVICE_ADD("namcoio_1", NAMCO_58XX, 0)
- MCFG_NAMCO58XX_IN_0_CB(IOPORT("COINS"))
- MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
- MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
- MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
-
- MCFG_DEVICE_ADD("namcoio_2", NAMCO_58XX, 0)
- MCFG_NAMCO58XX_IN_0_CB(READ8("dipmux", ls157_device, output_r))
- MCFG_NAMCO58XX_IN_1_CB(IOPORT("DSW1"))
- MCFG_NAMCO58XX_IN_2_CB(IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO58XX_IN_3_CB(IOPORT("DSW0"))
- MCFG_NAMCO58XX_OUT_0_CB(WRITELINE("dipmux", ls157_device, select_w)) MCFG_DEVCB_BIT(0)
-MACHINE_CONFIG_END
+ NAMCO_58XX(config, m_namcoio[0], 0);
+ m_namcoio[0]->in_callback<0>().set_ioport("COINS");
+ m_namcoio[0]->in_callback<1>().set_ioport("P1");
+ m_namcoio[0]->in_callback<2>().set_ioport("P2");
+ m_namcoio[0]->in_callback<3>().set_ioport("BUTTONS");
+
+ NAMCO_58XX(config, m_namcoio[1], 0);
+ m_namcoio[1]->in_callback<0>().set("dipmux", FUNC(ls157_device::output_r));
+ m_namcoio[1]->in_callback<1>().set_ioport("DSW1");
+ m_namcoio[1]->in_callback<2>().set_ioport("DSW1").rshift(4);
+ m_namcoio[1]->in_callback<3>().set_ioport("DSW0");
+ m_namcoio[1]->out_callback<0>().set("dipmux", FUNC(ls157_device::select_w)).bit(0);
+}
MACHINE_CONFIG_START(mappy_state::digdug2)
@@ -1575,18 +1573,18 @@ MACHINE_CONFIG_START(mappy_state::digdug2)
MCFG_WATCHDOG_MODIFY("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 0)
- MCFG_DEVICE_ADD("namcoio_1", NAMCO_58XX, 0)
- MCFG_NAMCO58XX_IN_0_CB(IOPORT("COINS"))
- MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
- MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
- MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
-
- MCFG_DEVICE_ADD("namcoio_2", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(READ8("dipmux", ls157_device, output_r))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("DSW1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("DSW0"))
- MCFG_NAMCO56XX_OUT_0_CB(WRITELINE("dipmux", ls157_device, select_w)) MCFG_DEVCB_BIT(0)
+ NAMCO_58XX(config, m_namcoio[0], 0);
+ m_namcoio[0]->in_callback<0>().set_ioport("COINS");
+ m_namcoio[0]->in_callback<1>().set_ioport("P1");
+ m_namcoio[0]->in_callback<2>().set_ioport("P2");
+ m_namcoio[0]->in_callback<3>().set_ioport("BUTTONS");
+
+ NAMCO_56XX(config, m_namcoio[1], 0);
+ m_namcoio[1]->in_callback<0>().set("dipmux", FUNC(ls157_device::output_r));
+ m_namcoio[1]->in_callback<1>().set_ioport("DSW1");
+ m_namcoio[1]->in_callback<2>().set_ioport("DSW1").rshift(4);
+ m_namcoio[1]->in_callback<3>().set_ioport("DSW0");
+ m_namcoio[1]->out_callback<0>().set("dipmux", FUNC(ls157_device::select_w)).bit(0);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(mappy_state::todruaga)
@@ -1598,24 +1596,24 @@ MACHINE_CONFIG_START(mappy_state::todruaga)
MCFG_PALETTE_ENTRIES(64*4+64*16)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(mappy_state::motos)
-
+void mappy_state::motos(machine_config &config)
+{
mappy_common(config);
- MCFG_DEVICE_ADD("namcoio_1", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(IOPORT("COINS"))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("P1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2"))
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
- MCFG_NAMCO56XX_OUT_0_CB(WRITE8(*this, mappy_state, out_lamps))
-
- MCFG_DEVICE_ADD("namcoio_2", NAMCO_56XX, 0)
- MCFG_NAMCO56XX_IN_0_CB(READ8("dipmux", ls157_device, output_r))
- MCFG_NAMCO56XX_IN_1_CB(IOPORT("DSW1"))
- MCFG_NAMCO56XX_IN_2_CB(IOPORT("DSW1")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO56XX_IN_3_CB(IOPORT("DSW0"))
- MCFG_NAMCO56XX_OUT_0_CB(WRITELINE("dipmux", ls157_device, select_w)) MCFG_DEVCB_BIT(0)
-MACHINE_CONFIG_END
+ NAMCO_56XX(config, m_namcoio[0], 0);
+ m_namcoio[0]->in_callback<0>().set_ioport("COINS");
+ m_namcoio[0]->in_callback<1>().set_ioport("P1");
+ m_namcoio[0]->in_callback<2>().set_ioport("P2");
+ m_namcoio[0]->in_callback<3>().set_ioport("BUTTONS");
+ m_namcoio[0]->out_callback<0>().set(FUNC(mappy_state::out_lamps));
+
+ NAMCO_56XX(config, m_namcoio[1], 0);
+ m_namcoio[1]->in_callback<0>().set("dipmux", FUNC(ls157_device::output_r));
+ m_namcoio[1]->in_callback<1>().set_ioport("DSW1");
+ m_namcoio[1]->in_callback<2>().set_ioport("DSW1").rshift(4);
+ m_namcoio[1]->in_callback<3>().set_ioport("DSW0");
+ m_namcoio[1]->out_callback<0>().set("dipmux", FUNC(ls157_device::select_w)).bit(0);
+}
diff --git a/src/mame/drivers/marineb.cpp b/src/mame/drivers/marineb.cpp
index 2daba71e7d0..1e2bd737e4b 100644
--- a/src/mame/drivers/marineb.cpp
+++ b/src/mame/drivers/marineb.cpp
@@ -584,18 +584,18 @@ MACHINE_CONFIG_START(marineb_state::changes)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(marineb_state::springer)
+void marineb_state::springer(machine_config &config)
+{
marineb(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("outlatch")
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, marineb_state, flipscreen_y_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, marineb_state, flipscreen_x_w)) MCFG_DEVCB_INVERT
+ ls259_device &outlatch(*subdevice<ls259_device>("outlatch"));
+ outlatch.q_out_cb<1>().set(FUNC(marineb_state::flipscreen_y_w)).invert();
+ outlatch.q_out_cb<2>().set(FUNC(marineb_state::flipscreen_x_w)).invert();
/* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(marineb_state, screen_update_springer)
-MACHINE_CONFIG_END
+ subdevice<screen_device>("screen")->set_screen_update(FUNC(marineb_state::screen_update_springer));
+}
MACHINE_CONFIG_START(marineb_state::hoccer)
@@ -647,14 +647,15 @@ MACHINE_CONFIG_START(marineb_state::hopprobo)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(marineb_state::bcruzm12)
+void marineb_state::bcruzm12(machine_config &config)
+{
wanted(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("outlatch")
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, marineb_state, flipscreen_y_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, marineb_state, flipscreen_x_w)) MCFG_DEVCB_INVERT
-MACHINE_CONFIG_END
+ ls259_device &outlatch(*subdevice<ls259_device>("outlatch"));
+ outlatch.q_out_cb<1>().set(FUNC(marineb_state::flipscreen_y_w)).invert();
+ outlatch.q_out_cb<2>().set(FUNC(marineb_state::flipscreen_x_w)).invert();
+}
/***************************************************************************
diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp
index 9156369fe11..6324fe929b7 100644
--- a/src/mame/drivers/mbee.cpp
+++ b/src/mame/drivers/mbee.cpp
@@ -786,13 +786,13 @@ MACHINE_CONFIG_START(mbee_state::mbee56)
MCFG_DEVICE_IO_MAP(mbee56_io)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee56)
- MCFG_DEVICE_ADD("fdc", WD2793, 4_MHz_XTAL / 2)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, mbee_state, fdc_intrq_w))
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, mbee_state, fdc_drq_w))
- MCFG_WD_FDC_ENMF_CALLBACK(GND)
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
+ WD2793(config, m_fdc, 4_MHz_XTAL / 2);
+ m_fdc->intrq_wr_callback().set(FUNC(mbee_state::fdc_intrq_w));
+ m_fdc->drq_wr_callback().set(FUNC(mbee_state::fdc_drq_w));
+ m_fdc->enmf_rd_callback().set_constant(0);
+ MCFG_FLOPPY_DRIVE_ADD(m_floppy0, mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(m_floppy1, mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
@@ -814,13 +814,13 @@ MACHINE_CONFIG_START(mbee_state::mbee128p)
MCFG_DEVICE_IO_MAP(mbee128_io)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee128)
- MCFG_DEVICE_ADD("fdc", WD2793, 4_MHz_XTAL / 2)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, mbee_state, fdc_intrq_w))
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, mbee_state, fdc_drq_w))
- MCFG_WD_FDC_ENMF_CALLBACK(GND)
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
+ WD2793(config, m_fdc, 4_MHz_XTAL / 2);
+ m_fdc->intrq_wr_callback().set(FUNC(mbee_state::fdc_intrq_w));
+ m_fdc->drq_wr_callback().set(FUNC(mbee_state::fdc_drq_w));
+ m_fdc->enmf_rd_callback().set_constant(0);
+ MCFG_FLOPPY_DRIVE_ADD(m_floppy0, mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(m_floppy1, mbee_floppies, "525qd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
@@ -833,9 +833,9 @@ MACHINE_CONFIG_START(mbee_state::mbee256)
MCFG_DEVICE_REMOVE("fdc:0")
MCFG_DEVICE_REMOVE("fdc:1")
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "35dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(m_floppy0, mbee_floppies, "35dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "35dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(m_floppy1, mbee_floppies, "35dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mc8020.cpp b/src/mame/drivers/mc8020.cpp
index 22848299345..ac848e7c1f9 100644
--- a/src/mame/drivers/mc8020.cpp
+++ b/src/mame/drivers/mc8020.cpp
@@ -324,10 +324,10 @@ MACHINE_CONFIG_START(mc8020_state::mc8020)
MCFG_DEVICE_ADD("ctc_clock", CLOCK, XTAL(2'457'600) / 64) // guess
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg2))
- MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(2'457'600))
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("ctc", z80ctc_device, trg1))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg0))
+ z80ctc_device &ctc(Z80CTC(config, "ctc", XTAL(2'457'600)));
+ ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ ctc.zc_callback<2>().set("ctc", FUNC(z80ctc_device::trg1));
+ ctc.zc_callback<2>().append("ctc", FUNC(z80ctc_device::trg0));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mc8030.cpp b/src/mame/drivers/mc8030.cpp
index 4244d12378e..6a12da64087 100644
--- a/src/mame/drivers/mc8030.cpp
+++ b/src/mame/drivers/mc8030.cpp
@@ -227,9 +227,9 @@ MACHINE_CONFIG_START(mc8030_state::mc8030)
// ZC1: to SIO CLK CH B
// ZC2: KMBG (??)
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("asp_sio", z80sio_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("asp_sio", z80sio_device, rxca_w))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
+ uart_clock.signal_handler().set("asp_sio", FUNC(z80sio_device::txca_w));
+ uart_clock.signal_handler().append("asp_sio", FUNC(z80sio_device::rxca_w));
MCFG_DEVICE_ADD("asp_sio", Z80SIO, 4800)
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/mccpm.cpp b/src/mame/drivers/mccpm.cpp
index 49fb1a5e083..218a0f34a1d 100644
--- a/src/mame/drivers/mccpm.cpp
+++ b/src/mame/drivers/mccpm.cpp
@@ -87,9 +87,9 @@ MACHINE_CONFIG_START(mccpm_state::mccpm)
MCFG_DEVICE_IO_MAP(mccpm_io)
/* Devices */
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("sio", z80sio_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, rxca_w))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
+ uart_clock.signal_handler().set("sio", FUNC(z80sio_device::txca_w));
+ uart_clock.signal_handler().append("sio", FUNC(z80sio_device::rxca_w));
MCFG_DEVICE_ADD("sio", Z80SIO, XTAL(4'000'000))
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/meritm.cpp b/src/mame/drivers/meritm.cpp
index 05a6222e8da..7364dca26d3 100644
--- a/src/mame/drivers/meritm.cpp
+++ b/src/mame/drivers/meritm.cpp
@@ -1110,19 +1110,19 @@ MACHINE_CONFIG_START(meritm_state::crt250)
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))
- MCFG_DEVICE_ADD(m_z80pio[0], Z80PIO, SYSTEM_CLK/6)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(m_maincpu, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(*this, meritm_state, audio_pio_port_a_r))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, meritm_state, audio_pio_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(READ8(*this, meritm_state, audio_pio_port_b_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, meritm_state, audio_pio_port_b_w))
-
- MCFG_DEVICE_ADD(m_z80pio[1], Z80PIO, SYSTEM_CLK/6)
- MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(m_maincpu, INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(IOPORT("PIO1_PORTA"))
- MCFG_Z80PIO_OUT_PA_CB(WRITE8(*this, meritm_state, io_pio_port_a_w))
- MCFG_Z80PIO_IN_PB_CB(IOPORT("PIO1_PORTB"))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, meritm_state, io_pio_port_b_w))
+ Z80PIO(config, m_z80pio[0], SYSTEM_CLK/6);
+ m_z80pio[0]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_z80pio[0]->in_pa_callback().set(FUNC(meritm_state::audio_pio_port_a_r));
+ m_z80pio[0]->out_pa_callback().set(FUNC(meritm_state::audio_pio_port_a_w));
+ m_z80pio[0]->in_pb_callback().set(FUNC(meritm_state::audio_pio_port_b_r));
+ m_z80pio[0]->out_pb_callback().set(FUNC(meritm_state::audio_pio_port_b_w));
+
+ Z80PIO(config, m_z80pio[1], SYSTEM_CLK/6);
+ m_z80pio[1]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_z80pio[1]->in_pa_callback().set_ioport("PIO1_PORTA");
+ m_z80pio[1]->out_pa_callback().set(FUNC(meritm_state::io_pio_port_a_w));
+ m_z80pio[1]->in_pb_callback().set_ioport("PIO1_PORTB");
+ m_z80pio[1]->out_pb_callback().set(FUNC(meritm_state::io_pio_port_b_w));
MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank_start", meritm_state, vblank_start_tick, "screen", 259, 262)
MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank_end", meritm_state, vblank_end_tick, "screen", 262, 262)
diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp
index 0a443478dcb..a5fb2376707 100644
--- a/src/mame/drivers/metro.cpp
+++ b/src/mame/drivers/metro.cpp
@@ -1146,7 +1146,7 @@ void metro_state::mouja_okimap(address_map &map)
MCFG_DEVICE_ADD(_tag, PUZZLET_IO, 0)
#define MCFG_PUZZLET_IO_DATA_CALLBACK(_devcb) \
- devcb = &puzzlet_io_device::set_data_cb(*device, DEVCB_##_devcb);
+ puzzlet_io_device::set_data_cb(*device, DEVCB_##_devcb);
class puzzlet_io_device : public device_t {
public:
diff --git a/src/mame/drivers/mfabfz.cpp b/src/mame/drivers/mfabfz.cpp
index f7f8120f55b..199af8b58ca 100644
--- a/src/mame/drivers/mfabfz.cpp
+++ b/src/mame/drivers/mfabfz.cpp
@@ -104,14 +104,14 @@ void mfabfz_state::machine_reset()
MACHINE_CONFIG_START(mfabfz_state::mfabfz)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",I8085A, XTAL(4'000'000) / 2)
- MCFG_DEVICE_PROGRAM_MAP(mfabfz_mem)
- MCFG_DEVICE_IO_MAP(mfabfz_io)
+ I8085A(config, m_maincpu, 4_MHz_XTAL / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &mfabfz_state::mfabfz_mem);
+ m_maincpu->set_addrmap(AS_IO, &mfabfz_state::mfabfz_io);
// uart1 - terminal - clock hardware unknown
- MCFG_DEVICE_ADD("uart1_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart1", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart1", i8251_device, write_rxc))
+ clock_device &uart1_clock(CLOCK(config, "uart1_clock", 153600));
+ uart1_clock.signal_handler().set("uart1", FUNC(i8251_device::write_txc));
+ uart1_clock.signal_handler().append("uart1", FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD("uart1", I8251, 0)
MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
@@ -124,7 +124,7 @@ MACHINE_CONFIG_START(mfabfz_state::mfabfz)
MCFG_RS232_CTS_HANDLER(WRITELINE("uart1", i8251_device, write_cts))
// uart2 - cassette - clock comes from 2MHz through a divider consisting of 4 chips and some jumpers.
- MCFG_DEVICE_ADD("uart2", I8251, 0)
+ I8251(config, "uart2", 0);
MACHINE_CONFIG_END
static DEVICE_INPUT_DEFAULTS_START( terminal )
@@ -136,17 +136,20 @@ static DEVICE_INPUT_DEFAULTS_START( terminal )
DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 )
DEVICE_INPUT_DEFAULTS_END
-MACHINE_CONFIG_START(mfabfz_state::mfabfz85)
+void mfabfz_state::mfabfz85(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",I8085A, XTAL(4'000'000) / 2)
- MCFG_DEVICE_PROGRAM_MAP(mfabfz_mem)
- MCFG_DEVICE_IO_MAP(mfabfz85_io)
- MCFG_I8085A_SID(READLINE("rs232", rs232_port_device, rxd_r))
- MCFG_I8085A_SOD(WRITELINE("rs232", rs232_port_device, write_txd)) MCFG_DEVCB_INVERT
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", terminal)
- MCFG_DEVICE_ADD("uart2", I8251, 0)
-MACHINE_CONFIG_END
+ i8085a_cpu_device &maincpu(I8085A(config, m_maincpu, 4_MHz_XTAL / 2));
+ maincpu.set_addrmap(AS_PROGRAM, &mfabfz_state::mfabfz_mem);
+ maincpu.set_addrmap(AS_IO, &mfabfz_state::mfabfz85_io);
+ maincpu.in_sid_func().set("rs232", FUNC(rs232_port_device::rxd_r));
+ maincpu.out_sod_func().set("rs232", FUNC(rs232_port_device::write_txd)).invert();
+
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
+ rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));
+
+ I8251(config, "uart2", 0);
+}
/* ROM definition */
diff --git a/src/mame/drivers/mice.cpp b/src/mame/drivers/mice.cpp
index 8d21d5c1fbd..b8ef71e8a19 100644
--- a/src/mame/drivers/mice.cpp
+++ b/src/mame/drivers/mice.cpp
@@ -181,12 +181,12 @@ MACHINE_CONFIG_START(mice_state::mice)
MCFG_RS232_CTS_HANDLER(WRITELINE("uart", i8251_device, write_cts))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", mice_terminal)
- MCFG_DEVICE_ADD("rpt", I8155, 6.144_MHz_XTAL / 2)
- MCFG_I8155_IN_PORTC_CB(IOPORT("BAUD"))
- MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ i8155_device &rpt(I8155(config, "rpt", 6.144_MHz_XTAL / 2));
+ rpt.in_pa_callback().set_ioport("BAUD");
+ rpt.out_to_callback().set("uart", FUNC(i8251_device::write_txc));
+ rpt.out_to_callback().append("uart", FUNC(i8251_device::write_rxc));
- MCFG_DEVICE_ADD("ppi", I8255, 0)
+ I8255(config, "ppi", 0);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(mice_state::mice2)
diff --git a/src/mame/drivers/micro3d.cpp b/src/mame/drivers/micro3d.cpp
index bf0c61999c2..08768fc7b5c 100644
--- a/src/mame/drivers/micro3d.cpp
+++ b/src/mame/drivers/micro3d.cpp
@@ -322,9 +322,9 @@ MACHINE_CONFIG_START(micro3d_state::micro3d)
MCFG_DEVICE_ADD("scc", SCC8530N, 32_MHz_XTAL / 2 / 2)
MCFG_Z80SCC_OUT_TXDB_CB(WRITELINE("monitor_drmath", rs232_port_device, write_txd))
- MCFG_DEVICE_ADD("monitor_drmath", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("scc", z80scc_device, rxb_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("scc", z80scc_device, dcdb_w)) MCFG_DEVCB_XOR(1)
+ rs232_port_device &monitor_drmath(RS232_PORT(config, "monitor_drmath", default_rs232_devices, nullptr));
+ monitor_drmath.rxd_handler().set("scc", FUNC(z80scc_device::rxb_w));
+ monitor_drmath.dcd_handler().set("scc", FUNC(z80scc_device::dcdb_w)).exor(1);
MCFG_DEVICE_ADD("audiocpu", I8051, 11.0592_MHz_XTAL)
MCFG_DEVICE_PROGRAM_MAP(soundmem_prg)
diff --git a/src/mame/drivers/microdec.cpp b/src/mame/drivers/microdec.cpp
index 65e0d88e879..4093dd1aae6 100644
--- a/src/mame/drivers/microdec.cpp
+++ b/src/mame/drivers/microdec.cpp
@@ -190,49 +190,48 @@ void microdec_state::init_microdec()
membank("bankw0")->configure_entry(0, &main[0x1000]);
}
-MACHINE_CONFIG_START(microdec_state::microdec)
+void microdec_state::microdec(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(16'000'000) / 4)
- MCFG_DEVICE_PROGRAM_MAP(microdec_mem)
- MCFG_DEVICE_IO_MAP(microdec_io)
+ Z80(config, m_maincpu, 16_MHz_XTAL / 4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &microdec_state::microdec_mem);
+ m_maincpu->set_addrmap(AS_IO, &microdec_state::microdec_io);
/* video hardware */
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart1", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart1", i8251_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart2", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart2", i8251_device, write_rxc))
-
- MCFG_DEVICE_ADD("uart1", I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE("rs232a", rs232_port_device, write_txd))
- MCFG_I8251_DTR_HANDLER(WRITELINE("rs232a", rs232_port_device, write_dtr))
- MCFG_I8251_RTS_HANDLER(WRITELINE("rs232a", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232a", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart1", i8251_device, write_rxd))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart1", i8251_device, write_dsr))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart1", i8251_device, write_cts))
-
- MCFG_DEVICE_ADD("uart2", I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE("rs232b", rs232_port_device, write_txd))
- MCFG_I8251_DTR_HANDLER(WRITELINE("rs232b", rs232_port_device, write_dtr))
- MCFG_I8251_RTS_HANDLER(WRITELINE("rs232b", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232b", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart2", i8251_device, write_rxd))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart2", i8251_device, write_dsr))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart2", i8251_device, write_cts))
-
- MCFG_UPD765A_ADD("fdc", true, true)
- MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", microdec_floppies, "525hd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- //MCFG_FLOPPY_DRIVE_ADD("fdc:1", microdec_floppies, "525hd", floppy_image_device::default_floppy_formats)
- //MCFG_FLOPPY_DRIVE_SOUND(true)
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
+ uart_clock.signal_handler().set("uart1", FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append("uart1", FUNC(i8251_device::write_rxc));
+ uart_clock.signal_handler().append("uart2", FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append("uart2", FUNC(i8251_device::write_rxc));
+
+ i8251_device &uart1(I8251(config, "uart1", 0));
+ uart1.txd_handler().set("rs232a", FUNC(rs232_port_device::write_txd));
+ uart1.dtr_handler().set("rs232a", FUNC(rs232_port_device::write_dtr));
+ uart1.rts_handler().set("rs232a", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, "terminal"));
+ rs232a.rxd_handler().set("uart1", FUNC(i8251_device::write_rxd));
+ rs232a.dsr_handler().set("uart1", FUNC(i8251_device::write_dsr));
+ rs232a.cts_handler().set("uart1", FUNC(i8251_device::write_cts));
+
+ i8251_device &uart2(I8251(config, "uart2", 0));
+ uart2.txd_handler().set("rs232b", FUNC(rs232_port_device::write_txd));
+ uart2.dtr_handler().set("rs232b", FUNC(rs232_port_device::write_dtr));
+ uart2.rts_handler().set("rs232b", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr));
+ rs232b.rxd_handler().set("uart2", FUNC(i8251_device::write_rxd));
+ rs232b.dsr_handler().set("uart2", FUNC(i8251_device::write_dsr));
+ rs232b.cts_handler().set("uart2", FUNC(i8251_device::write_cts));
+
+ UPD765A(config, m_fdc, true, true);
+ m_fdc->intrq_wr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ FLOPPY_CONNECTOR(config, "fdc:0", microdec_floppies, "525hd", floppy_image_device::default_floppy_formats).enable_sound(true);
+ //FLOPPY_CONNECTOR(config, "fdc:1", microdec_floppies, "525hd", floppy_image_device::default_floppy_formats).enable_sound(true);
// software lists
- MCFG_SOFTWARE_LIST_ADD("flop_list", "md2_flop")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "flop_list").set_original("md2_flop");
+}
/* ROM definition */
ROM_START( md2 )
diff --git a/src/mame/drivers/microkit.cpp b/src/mame/drivers/microkit.cpp
index 312337dfcb7..a9ce30f7c92 100644
--- a/src/mame/drivers/microkit.cpp
+++ b/src/mame/drivers/microkit.cpp
@@ -125,7 +125,7 @@ MACHINE_CONFIG_START(microkit_state::microkit)
MCFG_DEVICE_ADD("maincpu", CDP1802, 1750000)
MCFG_DEVICE_PROGRAM_MAP(microkit_mem)
MCFG_DEVICE_IO_MAP(microkit_io)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, microkit_state, clear_r))
/* video hardware */
diff --git a/src/mame/drivers/microterm.cpp b/src/mame/drivers/microterm.cpp
index 8c12b71b689..d8e00c718d5 100644
--- a/src/mame/drivers/microterm.cpp
+++ b/src/mame/drivers/microterm.cpp
@@ -99,16 +99,15 @@ MACHINE_CONFIG_START(microterm_state::mt420)
MCFG_DEVICE_PROGRAM_MAP(mt420_mem_map)
MCFG_DEVICE_IO_MAP(mt420_io_map)
- MCFG_DEVICE_ADD("duart", SCN2681, XTAL(3'686'400)) // MC2681
- MCFG_MC68681_IRQ_CALLBACK(INPUTLINE("maincpu", 0))
- MCFG_MC68681_OUTPORT_CALLBACK(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(4)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(3)
+ scn2681_device &duart(SCN2681(config, "duart", XTAL(3'686'400))); // MC2681
+ duart.irq_cb().set_inputline(m_maincpu, 0);
+ duart.outport_cb().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(5);
+ duart.outport_cb().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
+ duart.outport_cb().append("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(3);
- MCFG_DEVICE_ADD("aci", MC2661, XTAL(3'686'400)) // SCN2641
+ MC2661(config, "aci", XTAL(3'686'400)); // SCN2641
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_EEPROM_SERIAL_DO_CALLBACK(WRITELINE("duart", scn2681_device, ip6_w))
+ EEPROM_SERIAL_93C46_16BIT(config, "eeprom").do_callback().set("duart", FUNC(scn2681_device::ip6_w));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL(9'877'680), 612, 0, 480, 269, 0, 250)
@@ -128,20 +127,18 @@ MACHINE_CONFIG_START(microterm_state::mt5510)
MCFG_DEVICE_PROGRAM_MAP(mt5510_mem_map)
MCFG_DEVICE_IO_MAP(mt5510_io_map)
- MCFG_DEVICE_ADD("duart", SCN2681, XTAL(3'686'400))
- MCFG_MC68681_IRQ_CALLBACK(INPUTLINE("maincpu", 0))
- MCFG_MC68681_OUTPORT_CALLBACK(WRITELINE("eeprom1", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(6)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom2", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom1", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(4)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom2", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(4)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom1", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(3)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom2", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(3)
+ scn2681_device &duart(SCN2681(config, "duart", XTAL(3'686'400)));
+ duart.irq_cb().set_inputline(m_maincpu, 0);
+ duart.outport_cb().set("eeprom1", FUNC(eeprom_serial_93cxx_device::di_write)).bit(6);
+ duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::di_write)).bit(5);
+ duart.outport_cb().append("eeprom1", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
+ duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
+ duart.outport_cb().append("eeprom1", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(3);
+ duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(3);
- MCFG_DEVICE_ADD("eeprom1", EEPROM_SERIAL_93C46_16BIT)
- MCFG_EEPROM_SERIAL_DO_CALLBACK(WRITELINE("duart", scn2681_device, ip6_w))
+ EEPROM_SERIAL_93C46_16BIT(config, "eeprom1").do_callback().set("duart", FUNC(scn2681_device::ip6_w));
- MCFG_DEVICE_ADD("eeprom2", EEPROM_SERIAL_93C46_16BIT)
- MCFG_EEPROM_SERIAL_DO_CALLBACK(WRITELINE("duart", scn2681_device, ip5_w))
+ EEPROM_SERIAL_93C46_16BIT(config, "eeprom2").do_callback().set("duart", FUNC(scn2681_device::ip5_w));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL(45'830'400) / 2, 1120, 0, 960, 341, 0, 300) // wild guess at resolution
diff --git a/src/mame/drivers/milwaukee.cpp b/src/mame/drivers/milwaukee.cpp
index 774c6afc3f3..a0017b97413 100644
--- a/src/mame/drivers/milwaukee.cpp
+++ b/src/mame/drivers/milwaukee.cpp
@@ -52,33 +52,34 @@ void milwaukee_state::mem_map(address_map &map)
static INPUT_PORTS_START( milwaukee )
INPUT_PORTS_END
-MACHINE_CONFIG_START(milwaukee_state::milwaukee)
- MCFG_DEVICE_ADD("maincpu", M6502, XTAL(16'000'000) / 16)
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
-
- MCFG_DEVICE_ADD("pit", PIT8253, 0)
- MCFG_PIT8253_CLK0(XTAL(16'000'000) / 16 / 4) // 250 kHz
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("pit", pit8253_device, write_gate0)) MCFG_DEVCB_INVERT
- MCFG_PIT8253_CLK1(XTAL(16'000'000) / 2 / 13 / 2048 / 5) // 60.09 Hz?
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("pit", pit8253_device, write_clk2)) MCFG_DEVCB_INVERT
-
- MCFG_DEVICE_ADD("pia1", PIA6821, 0)
- MCFG_DEVICE_ADD("pia2", PIA6821, 0)
- MCFG_DEVICE_ADD("acia2", ACIA6850, 0)
- MCFG_DEVICE_ADD("ssda", MC6852, 0)
-
- MCFG_DEVICE_ADD("acia_clock", CLOCK, XTAL(16'000'000) / 2 / 13 / 4)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia1", acia6850_device, write_rxc))
-
- MCFG_DEVICE_ADD("acia1", ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
- MCFG_ACIA6850_RTS_HANDLER(WRITELINE("rs232", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("acia1", acia6850_device, write_rxd))
- MCFG_RS232_CTS_HANDLER(WRITELINE("acia1", acia6850_device, write_cts))
-MACHINE_CONFIG_END
+void milwaukee_state::milwaukee(machine_config &config)
+{
+ M6502(config, m_maincpu, 16_MHz_XTAL / 16);
+ m_maincpu->set_addrmap(AS_PROGRAM, &milwaukee_state::mem_map);
+
+ pit8253_device &pit(PIT8253(config, "pit", 0));
+ pit.set_clk<0>(16_MHz_XTAL / 16 / 4); // 250 kHz
+ pit.out_handler<0>().set("pit", FUNC(pit8253_device::write_gate0)).invert();
+ pit.set_clk<1>(16_MHz_XTAL / 2 / 13 / 2048 / 5); // 60.09 Hz?
+ pit.out_handler<1>().set("pit", FUNC(pit8253_device::write_clk2)).invert();
+
+ PIA6821(config, "pia1", 0);
+ PIA6821(config, "pia2", 0);
+ ACIA6850(config, "acia2", 0);
+ MC6852(config, "ssda", 0);
+
+ clock_device &acia_clock(CLOCK(config, "acia_clock", 16_MHz_XTAL / 2 / 13 / 4));
+ acia_clock.signal_handler().set("acia1", FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append("acia1", FUNC(acia6850_device::write_rxc));
+
+ acia6850_device &acia1(ACIA6850(config, "acia1", 0));
+ acia1.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
+ acia1.rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
+ rs232.rxd_handler().set("acia1", FUNC(acia6850_device::write_rxd));
+ rs232.cts_handler().set("acia1", FUNC(acia6850_device::write_cts));
+}
ROM_START( mc1200 )
ROM_REGION( 0x0c00, "roms", 0 )
diff --git a/src/mame/drivers/miniframe.cpp b/src/mame/drivers/miniframe.cpp
index e1bc117ca9b..879a80b5d4d 100644
--- a/src/mame/drivers/miniframe.cpp
+++ b/src/mame/drivers/miniframe.cpp
@@ -248,24 +248,24 @@ MACHINE_CONFIG_START(miniframe_state::miniframe)
MCFG_FLOPPY_DRIVE_ADD("wd2797:0", miniframe_floppies, "525dd", floppy_image_device::default_floppy_formats)
// 8263s
- MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
- MCFG_PIT8253_CLK0(76800)
- MCFG_PIT8253_CLK1(76800)
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("pic8259", pic8259_device, ir4_w))
+ pit8253_device &pit8253(PIT8253(config, "pit8253", 0));
+ pit8253.set_clk<0>(76800);
+ pit8253.set_clk<1>(76800);
+ pit8253.out_handler<0>().set("pic8259", FUNC(pic8259_device::ir4_w)); // FIXME: fighting for IR4 - error, or needs input merger?
// chain clock 1 output into clock 2
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("pit8253", pit8253_device, write_clk2))
+ pit8253.out_handler<1>().set("pit8253", FUNC(pit8253_device::write_clk2));
// and ir4 on the PIC
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("pic8259", pic8259_device, ir4_w))
+ pit8253.out_handler<1>().append("pic8259", FUNC(pic8259_device::ir4_w));
- MCFG_DEVICE_ADD("baudgen", PIT8253, 0)
- MCFG_PIT8253_CLK0(1228800)
- MCFG_PIT8253_CLK1(1228800)
- MCFG_PIT8253_CLK2(1228800)
+ pit8253_device &baudgen(PIT8253(config, "baudgen", 0));
+ baudgen.set_clk<0>(1228800);
+ baudgen.set_clk<1>(1228800);
+ baudgen.set_clk<2>(1228800);
// PIC8259s
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", M68K_IRQ_4))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mits680b.cpp b/src/mame/drivers/mits680b.cpp
index 7c5e084ba8d..a32c09a1d32 100644
--- a/src/mame/drivers/mits680b.cpp
+++ b/src/mame/drivers/mits680b.cpp
@@ -70,9 +70,9 @@ MACHINE_CONFIG_START(mits680b_state::mits680b)
MCFG_DEVICE_ADD("maincpu", M6800, XTAL(1'000'000) / 2)
MCFG_DEVICE_PROGRAM_MAP(mem_map)
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
+ uart_clock.signal_handler().set("acia", FUNC(acia6850_device::write_txc));
+ uart_clock.signal_handler().append("acia", FUNC(acia6850_device::write_rxc));
MCFG_DEVICE_ADD("acia", ACIA6850, 0)
MCFG_ACIA6850_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/mk14.cpp b/src/mame/drivers/mk14.cpp
index 0e0fc4f22ba..37bf50993fa 100644
--- a/src/mame/drivers/mk14.cpp
+++ b/src/mame/drivers/mk14.cpp
@@ -205,7 +205,7 @@ MACHINE_CONFIG_START(mk14_state::mk14)
/* basic machine hardware */
// IC1 1SP-8A/600 (8060) SC/MP Microprocessor
MCFG_DEVICE_ADD("maincpu", INS8060, XTAL(4'433'619))
- MCFG_SCMP_CONFIG(WRITELINE(*this, mk14_state, cass_w), NOOP, READLINE(*this, mk14_state, cass_r), NOOP, READLINE(*this, mk14_state, cass_r), NOOP)
+ MCFG_SCMP_CONFIG(WRITELINE(*this, mk14_state, cass_w), NOOP, READLINE(*this, mk14_state, cass_r), CONSTANT(0), READLINE(*this, mk14_state, cass_r), NOOP)
MCFG_DEVICE_PROGRAM_MAP(mem_map)
/* video hardware */
diff --git a/src/mame/drivers/mmd1.cpp b/src/mame/drivers/mmd1.cpp
index 0b019468de9..9455b4c2820 100644
--- a/src/mame/drivers/mmd1.cpp
+++ b/src/mame/drivers/mmd1.cpp
@@ -523,8 +523,8 @@ MACHINE_CONFIG_START(mmd1_state::mmd2)
MCFG_I8279_OUT_SL_CB(WRITE8(*this, mmd1_state, mmd2_scanlines_w)) // scan SL lines
MCFG_I8279_OUT_DISP_CB(WRITE8(*this, mmd1_state, mmd2_digit_w)) // display A&B
MCFG_I8279_IN_RL_CB(READ8(*this, mmd1_state, mmd2_kbd_r)) // kbd RL lines
- MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key
- MCFG_I8279_IN_CTRL_CB(VCC)
+ MCFG_I8279_IN_SHIFT_CB(CONSTANT(1)) // Shift key
+ MCFG_I8279_IN_CTRL_CB(CONSTANT(1))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp
index 1761909668d..257946d3c71 100644
--- a/src/mame/drivers/model1.cpp
+++ b/src/mame/drivers/model1.cpp
@@ -1710,15 +1710,15 @@ MACHINE_CONFIG_START(model1_state::model1)
MCFG_VIDEO_START_OVERRIDE(model1_state,model1)
- MCFG_SEGAM1AUDIO_ADD(M1AUDIO_TAG)
- MCFG_SEGAM1AUDIO_RXD_HANDLER(WRITELINE("m1uart", i8251_device, write_rxd))
+ SEGAM1AUDIO(config, m_m1audio, 0);
+ m_m1audio->rxd_handler().set(m_m1uart, FUNC(i8251_device::write_rxd));
- MCFG_DEVICE_ADD("m1uart", I8251, 8000000) // uPD71051C, clock unknown
- MCFG_I8251_TXD_HANDLER(WRITELINE(M1AUDIO_TAG, segam1audio_device, write_txd))
+ I8251(config, m_m1uart, 8000000); // uPD71051C, clock unknown
+ m_m1uart->txd_handler().set(m_m1audio, FUNC(segam1audio_device::write_txd));
- MCFG_CLOCK_ADD("m1uart_clock", 500000) // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("m1uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("m1uart", i8251_device, write_rxc))
+ clock_device &m1uart_clock(CLOCK(config, "m1uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
+ m1uart_clock.signal_handler().set(m_m1uart, FUNC(i8251_device::write_txc));
+ m1uart_clock.signal_handler().append(m_m1uart, FUNC(i8251_device::write_rxc));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(model1_state::model1_hle)
@@ -1781,9 +1781,7 @@ MACHINE_CONFIG_START(model1_state::swa)
MCFG_SOUND_ROUTE(1, "dright", 1.0)
// Apparently m1audio has to filter out commands the DSB shouldn't see
- MCFG_DEVICE_MODIFY(M1AUDIO_TAG)
- MCFG_SEGAM1AUDIO_RXD_HANDLER(WRITELINE("m1uart", i8251_device, write_rxd))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(DSBZ80_TAG, dsbz80_device, write_txd))
+ m_m1audio->rxd_handler().append(m_dsbz80, FUNC(dsbz80_device::write_txd));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(model1_state::wingwar)
diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp
index 704e05808c4..5972bda7232 100644
--- a/src/mame/drivers/model2.cpp
+++ b/src/mame/drivers/model2.cpp
@@ -2445,13 +2445,13 @@ MACHINE_CONFIG_START(model2_state::model2_scsp)
MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
- MCFG_DEVICE_ADD("uart", I8251, 8000000) // uPD71051C, clock unknown
-// MCFG_I8251_RXRDY_HANDLER(WRITELINE(*this, model2_state, sound_ready_w))
-// MCFG_I8251_TXRDY_HANDLER(WRITELINE(*this, model2_state, sound_ready_w))
+ I8251(config, m_uart, 8000000); // uPD71051C, clock unknown
+// m_uart->rxrdy_handler().set(FUNC(model2_state::sound_ready_w));
+// m_uart->txrdy_handler().set(FUNC(model2_state::sound_ready_w));
- MCFG_CLOCK_ADD("uart_clock", 500000) // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
+ uart_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc));
MACHINE_CONFIG_END
/* original Model 2 */
@@ -2494,15 +2494,15 @@ MACHINE_CONFIG_START(model2o_state::model2o)
model2_timers(config);
model2_screen(config);
- MCFG_SEGAM1AUDIO_ADD(M1AUDIO_TAG)
- MCFG_SEGAM1AUDIO_RXD_HANDLER(WRITELINE("uart", i8251_device, write_rxd))
+ SEGAM1AUDIO(config, m_m1audio, 0);
+ m_m1audio->rxd_handler().set(m_uart, FUNC(i8251_device::write_rxd));
- MCFG_DEVICE_ADD("uart", I8251, 8000000) // uPD71051C, clock unknown
- MCFG_I8251_TXD_HANDLER(WRITELINE(M1AUDIO_TAG, segam1audio_device, write_txd))
+ I8251(config, m_uart, 8000000); // uPD71051C, clock unknown
+ m_uart->txd_handler().set(m_m1audio, FUNC(segam1audio_device::write_txd));
- MCFG_CLOCK_ADD("uart_clock", 500000) // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
+ uart_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc));
MCFG_M2COMM_ADD("m2comm")
MACHINE_CONFIG_END
@@ -2544,14 +2544,14 @@ MACHINE_CONFIG_START(model2_state::sj25_0207_01)
MCFG_DEVICE_IO_MAP(drive_io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", model2_state, irq0_line_hold)
- MCFG_DEVICE_ADD("driveio1", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, model2_state, driveio_port_w))
- MCFG_315_5296_IN_PORTG_CB(READ8(*this, model2_state, driveio_portg_r))
- MCFG_315_5296_IN_PORTH_CB(READ8(*this, model2_state, driveio_porth_r))
+ sega_315_5296_device &driveio1(SEGA_315_5296(config, "driveio1", 0)); // unknown clock
+ driveio1.out_pd_callback().set(FUNC(model2_state::driveio_port_w));
+ driveio1.in_pg_callback().set(FUNC(model2_state::driveio_portg_r));
+ driveio1.in_ph_callback().set(FUNC(model2_state::driveio_porth_r));
- MCFG_DEVICE_ADD("driveio2", SEGA_315_5296, 0) // unknown clock
+ SEGA_315_5296(config, "driveio2", 0); // unknown clock
- MCFG_DEVICE_ADD("driveadc", MSM6253, 0)
+ MSM6253(config, "driveadc", 0);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(model2o_state::daytona)
@@ -2665,11 +2665,11 @@ MACHINE_CONFIG_END
// Includes a Model 1 Sound board for additional sounds - Deluxe version only
MACHINE_CONFIG_START(model2a_state::manxttdx)
manxtt(config);
- MCFG_SEGAM1AUDIO_ADD(M1AUDIO_TAG)
- MCFG_SEGAM1AUDIO_RXD_HANDLER(WRITELINE("uart", i8251_device, write_rxd))
- MCFG_DEVICE_MODIFY("uart")
- MCFG_I8251_TXD_HANDLER(WRITELINE(M1AUDIO_TAG, segam1audio_device, write_txd))
+ SEGAM1AUDIO(config, m_m1audio, 0);
+ m_m1audio->rxd_handler().set(m_uart, FUNC(i8251_device::write_rxd));
+
+ m_uart->txd_handler().set(m_m1audio, FUNC(segam1audio_device::write_txd));
MACHINE_CONFIG_END
MACHINE_CONFIG_START( model2a_state::srallyc )
@@ -2901,8 +2901,7 @@ MACHINE_CONFIG_START( model2c_state::stcc )
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_MODIFY("uart")
- MCFG_I8251_TXD_HANDLER(WRITELINE(DSBZ80_TAG, dsbz80_device, write_txd))
+ m_uart->txd_handler().set(m_dsbz80, FUNC(dsbz80_device::write_txd));
MACHINE_CONFIG_END
MACHINE_CONFIG_START( model2c_state::waverunr )
diff --git a/src/mame/drivers/model3.cpp b/src/mame/drivers/model3.cpp
index 8f5500a0778..a127a29b146 100644
--- a/src/mame/drivers/model3.cpp
+++ b/src/mame/drivers/model3.cpp
@@ -5849,12 +5849,12 @@ MACHINE_CONFIG_START(model3_state::scud)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD("uart", I8251, 8000000) // uPD71051
- MCFG_I8251_TXD_HANDLER(WRITELINE(DSBZ80_TAG, dsbz80_device, write_txd))
+ I8251(config, m_uart, 8000000); // uPD71051
+ m_uart->txd_handler().set(m_dsbz80, FUNC(dsbz80_device::write_txd));
- MCFG_CLOCK_ADD("uart_clock", 500000) // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate)
+ uart_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(model3_state::model3_20)
diff --git a/src/mame/drivers/mrflea.cpp b/src/mame/drivers/mrflea.cpp
index 1b25d88777c..5678a2bc898 100644
--- a/src/mame/drivers/mrflea.cpp
+++ b/src/mame/drivers/mrflea.cpp
@@ -270,16 +270,16 @@ MACHINE_CONFIG_START(mrflea_state::mrflea)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("mainppi", I8255, 0)
- MCFG_I8255_IN_PORTB_CB(READ8("subppi", i8255_device, pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITELINE("subppi", i8255_device, pc4_w)) MCFG_DEVCB_BIT(7) // OBFA -> STBA
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("subppi", i8255_device, pc2_w)) MCFG_DEVCB_BIT(1) // IBFB -> ACKB
-
- MCFG_DEVICE_ADD("subppi", I8255, 0)
- MCFG_I8255_IN_PORTA_CB(READ8("mainppi", i8255_device, pa_r))
- MCFG_I8255_OUT_PORTC_CB(WRITELINE("mainppi", i8255_device, pc6_w)) MCFG_DEVCB_BIT(5) // IBFA -> ACKA
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("pic", pic8259_device, ir0_w)) MCFG_DEVCB_BIT(3) // INTRA
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mainppi", i8255_device, pc2_w)) MCFG_DEVCB_BIT(1) // OBFB -> STBB
+ i8255_device &mainppi(I8255(config, "mainppi", 0));
+ mainppi.in_pb_callback().set("subppi", FUNC(i8255_device::pb_r));
+ mainppi.out_pc_callback().set("subppi", FUNC(i8255_device::pc4_w)).bit(7); // OBFA -> STBA
+ mainppi.out_pc_callback().append("subppi", FUNC(i8255_device::pc2_w)).bit(1); // IBFB -> ACKB
+
+ i8255_device &subppi(I8255(config, "subppi", 0));
+ subppi.in_pa_callback().set("mainppi", FUNC(i8255_device::pa_r));
+ subppi.out_pc_callback().set("mainppi", FUNC(i8255_device::pc6_w)).bit(5); // IBFA -> ACKA
+ subppi.out_pc_callback().append("pic", FUNC(pic8259_device::ir0_w)).bit(3); // INTRA
+ subppi.out_pc_callback().append("mainppi", FUNC(i8255_device::pc2_w)).bit(1); // OBFB -> STBB
MCFG_DEVICE_ADD("pic", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("subcpu", 0))
diff --git a/src/mame/drivers/multi8.cpp b/src/mame/drivers/multi8.cpp
index 05706b52420..93d34916724 100644
--- a/src/mame/drivers/multi8.cpp
+++ b/src/mame/drivers/multi8.cpp
@@ -605,9 +605,9 @@ MACHINE_CONFIG_START(multi8_state::multi8)
MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, multi8_state, portb_w))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, multi8_state, portc_w))
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153600));
+ uart_clock.signal_handler().set("uart", FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append("uart", FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD("uart", I8251, 0) // for cassette
MCFG_DEVICE_ADD("pit", PIT8253, 0)
diff --git a/src/mame/drivers/munchmo.cpp b/src/mame/drivers/munchmo.cpp
index f36713eac6b..3e7b92aded3 100644
--- a/src/mame/drivers/munchmo.cpp
+++ b/src/mame/drivers/munchmo.cpp
@@ -352,8 +352,7 @@ MACHINE_CONFIG_START(munchmo_state::mnchmobl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(ASSERTLINE(m_audiocpu, 0))
+ GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_audiocpu, 0, ASSERT_LINE);
/* AY clock speeds confirmed to match known recording */
MCFG_DEVICE_ADD(m_ay8910[0], AY8910, XTAL(15'000'000)/8)
diff --git a/src/mame/drivers/mx2178.cpp b/src/mame/drivers/mx2178.cpp
index d96d5f8b813..d6ade3f1ba2 100644
--- a/src/mame/drivers/mx2178.cpp
+++ b/src/mame/drivers/mx2178.cpp
@@ -154,11 +154,11 @@ MACHINE_CONFIG_START(mx2178_state::mx2178)
MCFG_MC6845_UPDATE_ROW_CB(mx2178_state, crtc_update_row)
MCFG_MC6845_OUT_VSYNC_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVICE_ADD("acia_clock", CLOCK, XTAL(18'869'600) / 30)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia1", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia2", acia6850_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia2", acia6850_device, write_rxc))
+ clock_device &acia_clock(CLOCK(config, "acia_clock", XTAL(18'869'600) / 30));
+ acia_clock.signal_handler().set("acia1", FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append("acia1", FUNC(acia6850_device::write_rxc));
+ acia_clock.signal_handler().append("acia2", FUNC(acia6850_device::write_txc));
+ acia_clock.signal_handler().append("acia2", FUNC(acia6850_device::write_rxc));
MCFG_DEVICE_ADD("acia1", ACIA6850, 0)
MCFG_ACIA6850_TXD_HANDLER(WRITELINE("rs232a", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/namcos12.cpp b/src/mame/drivers/namcos12.cpp
index 6105611f2c2..fedcd9504e3 100644
--- a/src/mame/drivers/namcos12.cpp
+++ b/src/mame/drivers/namcos12.cpp
@@ -1727,19 +1727,20 @@ void namcos12_state::init_golgo13()
MACHINE_CONFIG_START(namcos12_state::namcos12_mobo)
/* basic machine hardware */
- MCFG_DEVICE_ADD("sub", H83002, 16934400) // frequency based on research (superctr)
+ MCFG_DEVICE_ADD(m_sub, H83002, 16934400) // frequency based on research (superctr)
MCFG_DEVICE_PROGRAM_MAP(s12h8rwmap)
MCFG_DEVICE_IO_MAP(s12h8iomap)
MCFG_NAMCO_SETTINGS_ADD("namco_settings")
- MCFG_RTC4543_ADD("rtc", XTAL(32'768))
+ MCFG_RTC4543_ADD(m_rtc, XTAL(32'768))
MCFG_RTC4543_DATA_CALLBACK(WRITELINE("sub:sci1", h8_sci_device, rx_w))
- MCFG_DEVICE_MODIFY("sub:sci1")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("namco_settings", namco_settings_device, data_w))
- MCFG_H8_SCI_CLK_CALLBACK(WRITELINE("rtc", rtc4543_device, clk_w)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("namco_settings", namco_settings_device, clk_w))
+ // FIXME: need better syntax for configuring H8 onboard devices
+ h8_sci_device &sub_sci1(*m_sub->subdevice<h8_sci_device>("sci1"));
+ sub_sci1.tx_handler().set(m_settings, FUNC(namco_settings_device::data_w));
+ sub_sci1.clk_handler().set(m_rtc, FUNC(rtc4543_device::clk_w)).invert();
+ sub_sci1.clk_handler().append(m_settings, FUNC(namco_settings_device::clk_w));
MCFG_DEVICE_ADD("at28c16", AT28C16, 0)
diff --git a/src/mame/drivers/namcos23.cpp b/src/mame/drivers/namcos23.cpp
index 56f63206b6f..1d30616c4f9 100644
--- a/src/mame/drivers/namcos23.cpp
+++ b/src/mame/drivers/namcos23.cpp
@@ -3576,13 +3576,13 @@ GFXDECODE_END
MACHINE_CONFIG_START(namcos23_state::gorgon)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", R4650BE, BUSCLOCK*4)
+ MCFG_DEVICE_ADD(m_maincpu, R4650BE, BUSCLOCK*4)
MCFG_MIPS3_ICACHE_SIZE(8192) // VERIFIED
MCFG_MIPS3_DCACHE_SIZE(8192) // VERIFIED
MCFG_DEVICE_PROGRAM_MAP(gorgon_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", namcos23_state, interrupt)
- MCFG_DEVICE_ADD("subcpu", H83002, H8CLOCK )
+ MCFG_DEVICE_ADD(m_subcpu, H83002, H8CLOCK)
MCFG_DEVICE_PROGRAM_MAP( s23h8rwmap )
MCFG_DEVICE_IO_MAP( s23h8iomap )
@@ -3590,7 +3590,7 @@ MACHINE_CONFIG_START(namcos23_state::gorgon)
MCFG_DEVICE_MODIFY("subcpu:sci0")
MCFG_H8_SCI_SET_EXTERNAL_CLOCK_PERIOD(attotime::from_hz(JVSCLOCK/8))
- MCFG_DEVICE_ADD("iocpu", H83334, JVSCLOCK )
+ MCFG_DEVICE_ADD(m_iocpu, H83334, JVSCLOCK )
MCFG_DEVICE_PROGRAM_MAP( s23iobrdmap )
MCFG_DEVICE_IO_MAP( s23iobrdiomap )
@@ -3603,13 +3603,14 @@ MACHINE_CONFIG_START(namcos23_state::gorgon)
MCFG_NAMCO_SETTINGS_ADD("namco_settings")
- MCFG_RTC4543_ADD("rtc", XTAL(32'768))
+ MCFG_RTC4543_ADD(m_rtc, XTAL(32'768))
MCFG_RTC4543_DATA_CALLBACK(WRITELINE("subcpu:sci1", h8_sci_device, rx_w))
- MCFG_DEVICE_MODIFY("subcpu:sci1")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("namco_settings", namco_settings_device, data_w))
- MCFG_H8_SCI_CLK_CALLBACK(WRITELINE("rtc", rtc4543_device, clk_w)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("namco_settings", namco_settings_device, clk_w))
+ // FIXME: need better syntax for configuring H8 onboard devices
+ h8_sci_device &subcpu_sci1(*m_subcpu->subdevice<h8_sci_device>("sci1"));
+ subcpu_sci1.tx_handler().set(m_settings, FUNC(namco_settings_device::data_w));
+ subcpu_sci1.clk_handler().set(m_rtc, FUNC(rtc4543_device::clk_w)).invert();
+ subcpu_sci1.clk_handler().append(m_settings, FUNC(namco_settings_device::clk_w));
MCFG_NVRAM_ADD_0FILL("nvram")
@@ -3643,13 +3644,13 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(namcos23_state::s23)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", R4650BE, BUSCLOCK*4)
+ MCFG_DEVICE_ADD(m_maincpu, R4650BE, BUSCLOCK*4)
MCFG_MIPS3_ICACHE_SIZE(8192) // VERIFIED
MCFG_MIPS3_DCACHE_SIZE(8192) // VERIFIED
MCFG_DEVICE_PROGRAM_MAP(s23_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", namcos23_state, interrupt)
- MCFG_DEVICE_ADD("subcpu", H83002, H8CLOCK )
+ MCFG_DEVICE_ADD(m_subcpu, H83002, H8CLOCK)
MCFG_DEVICE_PROGRAM_MAP( s23h8rwmap )
MCFG_DEVICE_IO_MAP( s23h8iomap )
@@ -3657,7 +3658,7 @@ MACHINE_CONFIG_START(namcos23_state::s23)
MCFG_DEVICE_MODIFY("subcpu:sci0")
MCFG_H8_SCI_SET_EXTERNAL_CLOCK_PERIOD(attotime::from_hz(JVSCLOCK/8))
- MCFG_DEVICE_ADD("iocpu", H83334, JVSCLOCK )
+ MCFG_DEVICE_ADD(m_iocpu, H83334, JVSCLOCK )
MCFG_DEVICE_PROGRAM_MAP( s23iobrdmap )
MCFG_DEVICE_IO_MAP( s23iobrdiomap )
@@ -3670,13 +3671,14 @@ MACHINE_CONFIG_START(namcos23_state::s23)
MCFG_NAMCO_SETTINGS_ADD("namco_settings")
- MCFG_RTC4543_ADD("rtc", XTAL(32'768))
+ MCFG_RTC4543_ADD(m_rtc, XTAL(32'768))
MCFG_RTC4543_DATA_CALLBACK(WRITELINE("subcpu:sci1", h8_sci_device, rx_w))
- MCFG_DEVICE_MODIFY("subcpu:sci1")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("namco_settings", namco_settings_device, data_w))
- MCFG_H8_SCI_CLK_CALLBACK(WRITELINE("rtc", rtc4543_device, clk_w)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("namco_settings", namco_settings_device, clk_w))
+ // FIXME: need better syntax for configuring H8 onboard devices
+ h8_sci_device &subcpu_sci1(*m_subcpu->subdevice<h8_sci_device>("sci1"));
+ subcpu_sci1.tx_handler().set(m_settings, FUNC(namco_settings_device::data_w));
+ subcpu_sci1.clk_handler().set(m_rtc, FUNC(rtc4543_device::clk_w)).invert();
+ subcpu_sci1.clk_handler().append(m_settings, FUNC(namco_settings_device::clk_w));
MCFG_NVRAM_ADD_0FILL("nvram")
@@ -3732,13 +3734,13 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(namcos23_state::ss23)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", R4650BE, BUSCLOCK*5)
+ MCFG_DEVICE_ADD(m_maincpu, R4650BE, BUSCLOCK*5)
MCFG_MIPS3_ICACHE_SIZE(8192) // VERIFIED
MCFG_MIPS3_DCACHE_SIZE(8192) // VERIFIED
MCFG_DEVICE_PROGRAM_MAP(s23_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", namcos23_state, interrupt)
- MCFG_DEVICE_ADD("subcpu", H83002, H8CLOCK )
+ MCFG_DEVICE_ADD(m_subcpu, H83002, H8CLOCK)
MCFG_DEVICE_PROGRAM_MAP( s23h8rwmap )
MCFG_DEVICE_IO_MAP( s23h8iomap )
@@ -3750,13 +3752,14 @@ MACHINE_CONFIG_START(namcos23_state::ss23)
MCFG_NAMCO_SETTINGS_ADD("namco_settings")
- MCFG_RTC4543_ADD("rtc", XTAL(32'768))
+ MCFG_RTC4543_ADD(m_rtc, XTAL(32'768))
MCFG_RTC4543_DATA_CALLBACK(WRITELINE("subcpu:sci1", h8_sci_device, rx_w))
- MCFG_DEVICE_MODIFY("subcpu:sci1")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("namco_settings", namco_settings_device, data_w))
- MCFG_H8_SCI_CLK_CALLBACK(WRITELINE("rtc", rtc4543_device, clk_w)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("namco_settings", namco_settings_device, clk_w))
+ // FIXME: need better syntax for configuring H8 onboard devices
+ h8_sci_device &subcpu_sci1(*m_subcpu->subdevice<h8_sci_device>("sci1"));
+ subcpu_sci1.tx_handler().set(m_settings, FUNC(namco_settings_device::data_w));
+ subcpu_sci1.clk_handler().set(m_rtc, FUNC(rtc4543_device::clk_w)).invert();
+ subcpu_sci1.clk_handler().append(m_settings, FUNC(namco_settings_device::clk_w));
MCFG_NVRAM_ADD_0FILL("nvram")
diff --git a/src/mame/drivers/nbmj9195.cpp b/src/mame/drivers/nbmj9195.cpp
index 2767038d9cb..4738f676d50 100644
--- a/src/mame/drivers/nbmj9195.cpp
+++ b/src/mame/drivers/nbmj9195.cpp
@@ -2527,16 +2527,16 @@ MACHINE_CONFIG_START(nbmj9195_state::NBMJDRV1_base)
MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(*this, nbmj9195_state, soundcpu_porte_w))
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_SIZE(1024, 512) /* no way this is correct */
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1)
- MCFG_SCREEN_UPDATE_DRIVER(nbmj9195_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c011_device, trg1)) MCFG_DEVCB_INVERT
-
- MCFG_PALETTE_ADD("palette", 256)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_size(1024, 512); /* no way this is correct */
+ m_screen->set_visarea(0, 640-1, 0, 240-1);
+ m_screen->set_screen_update(FUNC(nbmj9195_state::screen_update));
+ m_screen->set_palette(m_palette);
+ m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c011_device::trg1)).invert();
+
+ MCFG_PALETTE_ADD(m_palette, 256)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp
index c3d9c9a7de5..2ce71783485 100644
--- a/src/mame/drivers/nemesis.cpp
+++ b/src/mame/drivers/nemesis.cpp
@@ -1468,17 +1468,17 @@ MACHINE_CONFIG_START(nemesis_state::nemesis)
MCFG_DEVICE_ADD("audiocpu", Z80,14318180/4) /* From schematics, should be accurate */
MCFG_DEVICE_PROGRAM_MAP(sound_map) /* fixed */
- MCFG_DEVICE_ADD("outlatch", LS259, 0) // 13J
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, coin1_lockout_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, nemesis_state, coin2_lockout_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, sound_irq_w))
+ ls259_device &outlatch(LS259(config, "outlatch")); // 13J
+ outlatch.q_out_cb<0>().set(FUNC(nemesis_state::coin1_lockout_w));
+ outlatch.q_out_cb<0>().append(FUNC(nemesis_state::coin2_lockout_w));
+ outlatch.q_out_cb<2>().set(FUNC(nemesis_state::sound_irq_w));
- MCFG_DEVICE_ADD("intlatch", LS259, 0) // 11K
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, irq_enable_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipx_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipy_w))
+ ls259_device &intlatch(LS259(config, "intlatch")); // 11K
+ intlatch.q_out_cb<0>().set(FUNC(nemesis_state::irq_enable_w));
+ intlatch.q_out_cb<2>().set(FUNC(nemesis_state::gfx_flipx_w));
+ intlatch.q_out_cb<3>().set(FUNC(nemesis_state::gfx_flipy_w));
- MCFG_WATCHDOG_ADD("watchdog")
+ WATCHDOG_TIMER(config, "watchdog", 0);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp
index 49067ee0c27..fcbad852f34 100644
--- a/src/mame/drivers/neogeo.cpp
+++ b/src/mame/drivers/neogeo.cpp
@@ -1921,17 +1921,17 @@ MACHINE_CONFIG_START(neogeo_base_state::neogeo_base)
MCFG_DEVICE_ADD(m_sprgen, NEOGEO_SPRITE_OPTIMZIED, 0)
/* audio hardware */
- MCFG_INPUT_MERGER_ALL_HIGH(m_audionmi)
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE(m_audiocpu, INPUT_LINE_NMI));
+ INPUT_MERGER_ALL_HIGH(config, m_audionmi);
+ m_audionmi->output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(false)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE(m_audionmi, input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->set_separate_acknowledge(false);
+ m_soundlatch->data_pending_callback().set(m_audionmi, FUNC(input_merger_device::in_w<0>));
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch2)
+ GENERIC_LATCH_8(config, m_soundlatch2);
- MCFG_DEVICE_ADD(m_ym, YM2610, NEOGEO_YM2610_CLOCK)
- MCFG_YM2610_IRQ_HANDLER(INPUTLINE(m_audiocpu, 0))
+ YM2610(config, m_ym, NEOGEO_YM2610_CLOCK);
+ m_ym->irq_handler().set_inputline(m_audiocpu, 0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/neogeocd.cpp b/src/mame/drivers/neogeocd.cpp
index fc807da9b08..08b1f225101 100644
--- a/src/mame/drivers/neogeocd.cpp
+++ b/src/mame/drivers/neogeocd.cpp
@@ -1041,8 +1041,7 @@ MACHINE_CONFIG_START(ngcd_state::neocd)
MCFG_DEVICE_PROGRAM_MAP(neocd_audio_map)
MCFG_DEVICE_IO_MAP(neocd_audio_io_map)
- MCFG_DEVICE_MODIFY("systemlatch")
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(LOGGER("NeoCD: write to regular vector change address?")) // what IS going on with "neocdz doubledr" and why do games write here if it's hooked up to nothing?
+ subdevice<hc259_device>("systemlatch")->q_out_cb<1>().set_log("NeoCD: write to regular vector change address?"); // what IS going on with "neocdz doubledr" and why do games write here if it's hooked up to nothing?
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(ngcd_state, screen_update_neocd)
diff --git a/src/mame/drivers/ngen.cpp b/src/mame/drivers/ngen.cpp
index 02535aad214..f2b0b044568 100644
--- a/src/mame/drivers/ngen.cpp
+++ b/src/mame/drivers/ngen.cpp
@@ -1039,11 +1039,11 @@ MACHINE_CONFIG_START(ngen_state::ngen)
MCFG_WD2010_OUT_INTRQ_CB(WRITELINE("pic",pic8259_device,ir2_w))
MCFG_WD2010_IN_BCS_CB(READ8(*this, ngen_state,hd_buffer_r))
MCFG_WD2010_OUT_BCS_CB(WRITE8(*this, ngen_state,hd_buffer_w))
- MCFG_WD2010_IN_DRDY_CB(VCC)
- MCFG_WD2010_IN_INDEX_CB(VCC)
- MCFG_WD2010_IN_WF_CB(VCC)
- MCFG_WD2010_IN_TK000_CB(VCC)
- MCFG_WD2010_IN_SC_CB(VCC)
+ MCFG_WD2010_IN_DRDY_CB(CONSTANT(1))
+ MCFG_WD2010_IN_INDEX_CB(CONSTANT(1))
+ MCFG_WD2010_IN_WF_CB(CONSTANT(1))
+ MCFG_WD2010_IN_TK000_CB(CONSTANT(1))
+ MCFG_WD2010_IN_SC_CB(CONSTANT(1))
MCFG_DEVICE_ADD("hdc_timer", PIT8253, 0)
MCFG_PIT8253_CLK2(20_MHz_XTAL / 10) // 2MHz
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ngen_floppies, "525qd", floppy_image_device::default_floppy_formats)
@@ -1150,11 +1150,11 @@ MACHINE_CONFIG_START(ngen386_state::ngen386)
MCFG_WD2010_OUT_INTRQ_CB(WRITELINE("pic",pic8259_device,ir2_w))
MCFG_WD2010_IN_BCS_CB(READ8(*this, ngen_state,hd_buffer_r))
MCFG_WD2010_OUT_BCS_CB(WRITE8(*this, ngen_state,hd_buffer_w))
- MCFG_WD2010_IN_DRDY_CB(VCC)
- MCFG_WD2010_IN_INDEX_CB(VCC)
- MCFG_WD2010_IN_WF_CB(VCC)
- MCFG_WD2010_IN_TK000_CB(VCC)
- MCFG_WD2010_IN_SC_CB(VCC)
+ MCFG_WD2010_IN_DRDY_CB(CONSTANT(1))
+ MCFG_WD2010_IN_INDEX_CB(CONSTANT(1))
+ MCFG_WD2010_IN_WF_CB(CONSTANT(1))
+ MCFG_WD2010_IN_TK000_CB(CONSTANT(1))
+ MCFG_WD2010_IN_SC_CB(CONSTANT(1))
MCFG_DEVICE_ADD("hdc_timer", PIT8253, 0)
MCFG_PIT8253_CLK2(20_MHz_XTAL / 10) // 2MHz
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ngen_floppies, "525qd", floppy_image_device::default_floppy_formats)
diff --git a/src/mame/drivers/ninjaw.cpp b/src/mame/drivers/ninjaw.cpp
index ae1853c5685..b6cd27bcf4d 100644
--- a/src/mame/drivers/ninjaw.cpp
+++ b/src/mame/drivers/ninjaw.cpp
@@ -753,13 +753,13 @@ MACHINE_CONFIG_START(ninjaw_state::ninjaw)
MCFG_QUANTUM_TIME(attotime::from_hz(16000000/1024)) /* CPU slices */
//MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_DEVICE_ADD("tc0040ioc", TC0040IOC, 0)
- MCFG_TC0040IOC_READ_0_CB(IOPORT("DSWA"))
- MCFG_TC0040IOC_READ_1_CB(IOPORT("DSWB"))
- MCFG_TC0040IOC_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0040IOC_READ_3_CB(IOPORT("IN1"))
- MCFG_TC0040IOC_WRITE_4_CB(WRITE8(*this, ninjaw_state, coin_control_w))
- MCFG_TC0040IOC_READ_7_CB(IOPORT("IN2"))
+ tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0));
+ tc0040ioc.read_0_callback().set_ioport("DSWA");
+ tc0040ioc.read_1_callback().set_ioport("DSWB");
+ tc0040ioc.read_2_callback().set_ioport("IN0");
+ tc0040ioc.read_3_callback().set_ioport("IN1");
+ tc0040ioc.write_4_callback().set(FUNC(ninjaw_state::coin_control_w));
+ tc0040ioc.read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ninjaw)
@@ -869,13 +869,13 @@ MACHINE_CONFIG_START(ninjaw_state::darius2)
MCFG_QUANTUM_TIME(attotime::from_hz(16000000/1024)) /* CPU slices */
//MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_DEVICE_ADD("tc0040ioc", TC0040IOC, 0)
- MCFG_TC0040IOC_READ_0_CB(IOPORT("DSWA"))
- MCFG_TC0040IOC_READ_1_CB(IOPORT("DSWB"))
- MCFG_TC0040IOC_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0040IOC_READ_3_CB(IOPORT("IN1"))
- MCFG_TC0040IOC_WRITE_4_CB(WRITE8(*this, ninjaw_state, coin_control_w))
- MCFG_TC0040IOC_READ_7_CB(IOPORT("IN2"))
+ tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0));
+ tc0040ioc.read_0_callback().set_ioport("DSWA");
+ tc0040ioc.read_1_callback().set_ioport("DSWB");
+ tc0040ioc.read_2_callback().set_ioport("IN0");
+ tc0040ioc.read_3_callback().set_ioport("IN1");
+ tc0040ioc.write_4_callback().set(FUNC(ninjaw_state::coin_control_w));
+ tc0040ioc.read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ninjaw)
diff --git a/src/mame/drivers/norautp.cpp b/src/mame/drivers/norautp.cpp
index c28bb800202..90a29ff2c4c 100644
--- a/src/mame/drivers/norautp.cpp
+++ b/src/mame/drivers/norautp.cpp
@@ -1249,23 +1249,23 @@ MACHINE_CONFIG_START(norautp_state::noraut_base)
MCFG_NVRAM_ADD_0FILL("nvram") /* doesn't work if placed at derivative drivers */
- MCFG_DEVICE_ADD("ppi8255_0", I8255, 0)
+ I8255(config, m_ppi8255[0], 0);
/* (60-63) Mode 0 - Port A set as input */
- MCFG_I8255_IN_PORTA_CB(IOPORT("DSW1"))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, norautp_state, mainlamps_w))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, norautp_state, counterlamps_w))
+ m_ppi8255[0]->in_pa_callback().set_ioport("DSW1");
+ m_ppi8255[0]->out_pb_callback().set(FUNC(norautp_state::mainlamps_w));
+ m_ppi8255[0]->out_pc_callback().set(FUNC(norautp_state::counterlamps_w));
- MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
+ I8255(config, m_ppi8255[1], 0);
/* (a0-a3) Mode 0 - Ports A & B set as input */
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, norautp_state, soundlamps_w))
+ m_ppi8255[1]->in_pa_callback().set_ioport("IN0");
+ m_ppi8255[1]->in_pb_callback().set_ioport("IN1");
+ m_ppi8255[1]->out_pc_callback().set(FUNC(norautp_state::soundlamps_w));
- MCFG_DEVICE_ADD("ppi8255_2", I8255, 0)
+ I8255(config, m_ppi8255[2], 0);
/* (c0-c3) Group A Mode 2 (5-lines handshacked bidirectional port)
Group B Mode 0, output; (see below for lines PC0-PC2) */
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITELINE(*this, norautp_state, ppi2_obf_w)) MCFG_DEVCB_BIT(7)
+ m_ppi8255[2]->in_pc_callback().set_ioport("IN2");
+ m_ppi8255[2]->out_pc_callback().set(FUNC(norautp_state::ppi2_obf_w)).bit(7);
/* PPI-2 is configured as mixed mode2 and mode0 output.
It means that port A should be bidirectional and port B just as output.
Port C as hshk regs, and P0-P2 as input (norautp, norautjp) or output (other sets). */
diff --git a/src/mame/drivers/nss.cpp b/src/mame/drivers/nss.cpp
index b8907a845aa..9618457ed66 100644
--- a/src/mame/drivers/nss.cpp
+++ b/src/mame/drivers/nss.cpp
@@ -871,9 +871,9 @@ MACHINE_CONFIG_START(nss_state::nss)
MCFG_SCREEN_UPDATE_DRIVER( snes_state, screen_update )
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, nss_state, nss_vblank_irq))
- MCFG_DEVICE_ADD("ppu", SNES_PPU, 0)
- MCFG_SNES_PPU_OPENBUS_CB(READ8(*this, nss_state, snes_open_bus_r))
- MCFG_VIDEO_SET_SCREEN("screen")
+ SNES_PPU(config, m_ppu, 0);
+ m_ppu->open_bus_callback().set([this] { return snes_open_bus_r(); }); // lambda because overloaded function name
+ m_ppu->set_screen("screen");
// NSS
MCFG_SCREEN_ADD("osd", RASTER)
diff --git a/src/mame/drivers/ob68k1a.cpp b/src/mame/drivers/ob68k1a.cpp
index 9fe0ba9e2e9..dba4d185167 100644
--- a/src/mame/drivers/ob68k1a.cpp
+++ b/src/mame/drivers/ob68k1a.cpp
@@ -182,46 +182,46 @@ void ob68k1a_state::machine_reset()
// MACHINE_CONFIG( ob68k1a )
//-------------------------------------------------
-MACHINE_CONFIG_START(ob68k1a_state::ob68k1a)
+void ob68k1a_state::ob68k1a(machine_config &config)
+{
// basic machine hardware
- MCFG_DEVICE_ADD(MC68000L10_TAG, M68000, XTAL(10'000'000))
- MCFG_DEVICE_PROGRAM_MAP(ob68k1a_mem)
+ M68000(config, m_maincpu, 10_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ob68k1a_state::ob68k1a_mem);
// devices
- MCFG_DEVICE_ADD(MC6821_0_TAG, PIA6821, 0)
- MCFG_DEVICE_ADD(MC6821_1_TAG, PIA6821, 0)
- MCFG_DEVICE_ADD(MC6840_TAG, PTM6840, XTAL(10'000'000)/10)
- MCFG_PTM6840_EXTERNAL_CLOCKS(0, 0, 0)
-
- MCFG_DEVICE_ADD(MC6850_0_TAG, ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(RS232_A_TAG, rs232_port_device, write_txd))
- MCFG_ACIA6850_RTS_HANDLER(WRITELINE(RS232_A_TAG, rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD(RS232_A_TAG, RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE(MC6850_0_TAG, acia6850_device, write_rxd))
- MCFG_RS232_DCD_HANDLER(WRITELINE(MC6850_0_TAG, acia6850_device, write_dcd))
- MCFG_RS232_CTS_HANDLER(WRITELINE(MC6850_0_TAG, acia6850_device, write_cts))
-
- MCFG_DEVICE_ADD(MC6850_1_TAG, ACIA6850, 0)
- MCFG_ACIA6850_TXD_HANDLER(WRITELINE(RS232_B_TAG, rs232_port_device, write_txd))
- MCFG_ACIA6850_RTS_HANDLER(WRITELINE(RS232_B_TAG, rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD(RS232_B_TAG, RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_rxd))
- MCFG_RS232_DCD_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_dcd))
- MCFG_RS232_CTS_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_cts))
-
- MCFG_DEVICE_ADD(COM8116_TAG, COM8116, XTAL(5'068'800))
- MCFG_COM8116_FR_HANDLER(WRITELINE(MC6850_0_TAG, acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(MC6850_0_TAG, acia6850_device, write_rxc))
- MCFG_COM8116_FT_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(MC6850_1_TAG, acia6850_device, write_rxc))
+ PIA6821(config, m_pia0, 0);
+ PIA6821(config, m_pia1, 0);
+ PTM6840(config, MC6840_TAG, 10_MHz_XTAL/10).set_external_clocks(0, 0, 0);
+
+ ACIA6850(config, m_acia0, 0);
+ m_acia0->txd_handler().set(m_rs232a, FUNC(rs232_port_device::write_txd));
+ m_acia0->rts_handler().set(m_rs232a, FUNC(rs232_port_device::write_rts));
+
+ RS232_PORT(config, m_rs232a, default_rs232_devices, "terminal");
+ m_rs232a->rxd_handler().set(m_acia0, FUNC(acia6850_device::write_rxd));
+ m_rs232a->dcd_handler().set(m_acia0, FUNC(acia6850_device::write_dcd));
+ m_rs232a->cts_handler().set(m_acia0, FUNC(acia6850_device::write_cts));
+
+ ACIA6850(config, m_acia1, 0);
+ m_acia1->txd_handler().set(m_rs232b, FUNC(rs232_port_device::write_txd));
+ m_acia1->rts_handler().set(m_rs232b, FUNC(rs232_port_device::write_rts));
+
+ RS232_PORT(config, m_rs232b, default_rs232_devices, nullptr);
+ m_rs232b->rxd_handler().set(m_acia1, FUNC(acia6850_device::write_rxd));
+ m_rs232b->dcd_handler().set(m_acia1, FUNC(acia6850_device::write_dcd));
+ m_rs232b->cts_handler().set(m_acia1, FUNC(acia6850_device::write_cts));
+
+ COM8116(config, m_dbrg, 5.0688_MHz_XTAL);
+ m_dbrg->fr_handler().set(m_acia0, FUNC(acia6850_device::write_txc));
+ m_dbrg->fr_handler().append(m_acia0, FUNC(acia6850_device::write_rxc));
+ m_dbrg->ft_handler().set(m_acia1, FUNC(acia6850_device::write_txc));
+ m_dbrg->ft_handler().append(m_acia1, FUNC(acia6850_device::write_rxc));
// internal ram
- MCFG_RAM_ADD(RAM_TAG)
- MCFG_RAM_DEFAULT_SIZE("32K")
- MCFG_RAM_EXTRA_OPTIONS("128K")
-MACHINE_CONFIG_END
+ RAM(config, m_ram, 0);
+ m_ram->set_default_size("32K");
+ m_ram->set_extra_options("128K");
+}
diff --git a/src/mame/drivers/octopus.cpp b/src/mame/drivers/octopus.cpp
index 195baa448bd..4f08d346331 100644
--- a/src/mame/drivers/octopus.cpp
+++ b/src/mame/drivers/octopus.cpp
@@ -926,12 +926,12 @@ MACHINE_CONFIG_START(octopus_state::octopus)
MCFG_DEVICE_ADD("pic_master", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, octopus_state, get_slave_ack))
MCFG_DEVICE_ADD("pic_slave", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic_master", pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
// RTC (MC146818 via i8255 PPI)
MCFG_DEVICE_ADD("ppi", I8255, 0)
@@ -983,14 +983,14 @@ MACHINE_CONFIG_START(octopus_state::octopus)
MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("serial_a",rs232_port_device, write_rts))
MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("serial_b",rs232_port_device, write_rts))
- MCFG_DEVICE_ADD("serial_a", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("serial",z80sio_device, rxa_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("serial",z80sio_device, ctsa_w)) MCFG_DEVCB_INVERT
- //MCFG_RS232_RI_HANDLER(WRITELINE("serial",z80sio_device, ria_w)) MCFG_DEVCB_INVERT
- MCFG_DEVICE_ADD("serial_b", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("serial",z80sio_device, rxb_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("serial",z80sio_device, ctsb_w)) MCFG_DEVCB_INVERT
- //MCFG_RS232_RI_HANDLER(WRITELINE("serial",z80sio_device, rib_w)) MCFG_DEVCB_INVERT
+ rs232_port_device &serial_a(RS232_PORT(config, "serial_a", default_rs232_devices, nullptr));
+ serial_a.rxd_handler().set(m_serial, FUNC(z80sio_device::rxa_w));
+ serial_a.cts_handler().set(m_serial, FUNC(z80sio_device::ctsa_w)).invert();
+ //serial_a.ri_handler().set(m_serial, FUNC(z80sio_device::ria_w)).invert();
+ rs232_port_device &serial_b(RS232_PORT(config, "serial_b", default_rs232_devices, nullptr));
+ serial_b.rxd_handler().set(m_serial, FUNC(z80sio_device::rxb_w));
+ serial_b.cts_handler().set(m_serial, FUNC(z80sio_device::ctsb_w)).invert();
+ //serial_b.ri_handler().set(m_serial, FUNC(z80sio_device::rib_w)).invert();
MCFG_DEVICE_ADD(m_parallel, CENTRONICS, octopus_centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, octopus_state, parallel_busy_w))
diff --git a/src/mame/drivers/okean240.cpp b/src/mame/drivers/okean240.cpp
index c97618dc5b8..d21bdbbd038 100644
--- a/src/mame/drivers/okean240.cpp
+++ b/src/mame/drivers/okean240.cpp
@@ -533,10 +533,10 @@ MACHINE_CONFIG_START(okean240_state::okean240t)
MCFG_DEVICE_ADD("ppie", I8255, 0)
- MCFG_DEVICE_ADD("pit", PIT8253, 0)
- MCFG_PIT8253_CLK1(3072000) // artificial rate
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ pit8253_device &pit(PIT8253(config, "pit", 0));
+ pit.set_clk<1>(3072000); // artificial rate
+ pit.out_handler<1>().set("uart", FUNC(i8251_device::write_txc));
+ pit.out_handler<1>().append("uart", FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD("pic", PIC8259, 0)
diff --git a/src/mame/drivers/olyboss.cpp b/src/mame/drivers/olyboss.cpp
index 34f41399498..ac42030082a 100644
--- a/src/mame/drivers/olyboss.cpp
+++ b/src/mame/drivers/olyboss.cpp
@@ -448,11 +448,11 @@ MACHINE_CONFIG_START( olyboss_state::olybossd )
MCFG_DEVICE_ADD("uic", AM9519, 0)
MCFG_AM9519_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_UPD765A_ADD("fdc", true, true)
- MCFG_UPD765_INTRQ_CALLBACK(WRITELINE("uic", am9519_device, ireq2_w)) MCFG_DEVCB_INVERT
- MCFG_UPD765_DRQ_CALLBACK(WRITELINE(I8257_TAG, i8257_device, dreq0_w))
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", bosscd_floppies, "525qd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
+ UPD765A(config, m_fdc, true, true);
+ m_fdc->intrq_wr_callback().set(m_uic, FUNC(am9519_device::ireq2_w)).invert();
+ m_fdc->drq_wr_callback().set(m_dma, FUNC(i8257_device::dreq0_w));
+ FLOPPY_CONNECTOR(config, m_fdd0, bosscd_floppies, "525qd", floppy_image_device::default_floppy_formats);
+ m_fdd0->enable_sound(true);
MCFG_DEVICE_ADD(I8257_TAG, I8257, XTAL(4'000'000))
MCFG_I8257_OUT_HRQ_CB(WRITELINE(*this, olyboss_state, hrq_w))
@@ -463,12 +463,12 @@ MACHINE_CONFIG_START( olyboss_state::olybossd )
MCFG_I8257_OUT_IOW_2_CB(WRITE8(*this, olyboss_state, crtcdma_w))
MCFG_I8257_OUT_TC_CB(WRITELINE(*this, olyboss_state, tc_w))
- MCFG_DEVICE_ADD(UPD3301_TAG, UPD3301, XTAL(14'318'181))
- MCFG_UPD3301_CHARACTER_WIDTH(8)
- MCFG_UPD3301_DRAW_CHARACTER_CALLBACK_OWNER(olyboss_state, olyboss_display_pixels)
- MCFG_UPD3301_DRQ_CALLBACK(WRITELINE(I8257_TAG, i8257_device, dreq2_w))
- MCFG_UPD3301_INT_CALLBACK(WRITELINE("uic", am9519_device, ireq0_w)) MCFG_DEVCB_INVERT
- MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
+ UPD3301(config, m_crtc, XTAL(14'318'181));
+ m_crtc->set_character_width(8);
+ m_crtc->set_display_callback(FUNC(olyboss_state::olyboss_display_pixels), this);
+ m_crtc->drq_wr_callback().set(m_dma, FUNC(i8257_device::dreq2_w));
+ 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))
diff --git a/src/mame/drivers/onyx.cpp b/src/mame/drivers/onyx.cpp
index b5e77bbfe10..6be6a56b0e3 100644
--- a/src/mame/drivers/onyx.cpp
+++ b/src/mame/drivers/onyx.cpp
@@ -145,9 +145,9 @@ MACHINE_CONFIG_START(onyx_state::c8002)
MCFG_DEVICE_IO_MAP(subio)
MCFG_MACHINE_RESET_OVERRIDE(onyx_state, c8002)
- MCFG_DEVICE_ADD("sio1_clock", CLOCK, 307200)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("sio1", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1" ,z80sio_device, txca_w))
+ clock_device &sio1_clock(CLOCK(config, "sio1_clock", 307200));
+ sio1_clock.signal_handler().set(m_sio1, FUNC(z80sio_device::rxca_w));
+ sio1_clock.signal_handler().append(m_sio1, FUNC(z80sio_device::txca_w));
/* peripheral hardware */
MCFG_DEVICE_ADD("pio1", Z80PIO, XTAL(16'000'000)/4)
@@ -174,9 +174,9 @@ MACHINE_CONFIG_START(onyx_state::c8002)
MCFG_DEVICE_ADD("pio1s", Z80PIO, XTAL(16'000'000)/4)
//MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("subcpu", INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD("sio1s_clock", CLOCK, 614400)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("sio1s", z80sio_device, rxtxcb_w))
- //MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1s" ,z80sio_device, txca_w))
+ clock_device &sio1s_clock(CLOCK(config, "sio1s_clock", 614400));
+ sio1s_clock.signal_handler().set("sio1s", FUNC(z80sio_device::rxtxcb_w));
+ //sio1s_clock.signal_handler().append("sio1s", FUNC(z80sio_device::txca_w));
MCFG_DEVICE_ADD("sio1s", Z80SIO, XTAL(16'000'000) /4)
MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs232s", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/osbexec.cpp b/src/mame/drivers/osbexec.cpp
index c6ccbddf714..6cd100a9f19 100644
--- a/src/mame/drivers/osbexec.cpp
+++ b/src/mame/drivers/osbexec.cpp
@@ -599,17 +599,16 @@ MACHINE_CONFIG_START(osbexec_state::osbexec)
MCFG_PIA_IRQA_HANDLER(WRITELINE("mainirq", input_merger_device, in_w<2>))
MCFG_PIA_IRQB_HANDLER(WRITELINE("mainirq", input_merger_device, in_w<3>))
- MCFG_INPUT_MERGER_ANY_HIGH("mainirq")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE(m_maincpu, 0))
-
- MCFG_DEVICE_ADD(m_sio, Z80SIO, MAIN_CLOCK/6)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE(MODEM_PORT_TAG, rs232_port_device, write_txd)) MCFG_DEVCB_INVERT
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE(MODEM_PORT_TAG, rs232_port_device, write_dtr)) MCFG_DEVCB_INVERT
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE(MODEM_PORT_TAG, rs232_port_device, write_rts)) MCFG_DEVCB_INVERT
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE(PRINTER_PORT_TAG, rs232_port_device, write_txd)) MCFG_DEVCB_INVERT
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE(PRINTER_PORT_TAG, rs232_port_device, write_dtr)) MCFG_DEVCB_INVERT
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE(PRINTER_PORT_TAG, rs232_port_device, write_rts)) MCFG_DEVCB_INVERT
- MCFG_Z80SIO_OUT_INT_CB(WRITELINE("mainirq", input_merger_device, in_w<4>))
+ INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, 0);
+
+ Z80SIO(config, m_sio, MAIN_CLOCK/6);
+ m_sio->out_txda_callback().set(MODEM_PORT_TAG, FUNC(rs232_port_device::write_txd)).invert();
+ m_sio->out_dtra_callback().set(MODEM_PORT_TAG, FUNC(rs232_port_device::write_dtr)).invert();
+ m_sio->out_rtsa_callback().set(MODEM_PORT_TAG, FUNC(rs232_port_device::write_rts)).invert();
+ m_sio->out_txdb_callback().set(PRINTER_PORT_TAG, FUNC(rs232_port_device::write_txd)).invert();
+ m_sio->out_dtrb_callback().set(PRINTER_PORT_TAG, FUNC(rs232_port_device::write_dtr)).invert();
+ m_sio->out_rtsb_callback().set(PRINTER_PORT_TAG, FUNC(rs232_port_device::write_rts)).invert();
+ m_sio->out_int_callback().set("mainirq", FUNC(input_merger_device::in_w<4>));
MCFG_DEVICE_ADD("ctc", PIT8253, 0)
MCFG_PIT8253_CLK0(MAIN_CLOCK / 13) // divided by 74S161 @ UC25
@@ -619,17 +618,17 @@ MACHINE_CONFIG_START(osbexec_state::osbexec)
MCFG_PIT8253_OUT1_HANDLER(WRITELINE(m_sio, z80sio_device, rxtxcb_w))
//MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, osbexec_state, spindle_clk_w))
- MCFG_DEVICE_ADD(MODEM_PORT_TAG, RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE(m_sio, z80sio_device, rxa_w)) MCFG_DEVCB_INVERT
- MCFG_RS232_DCD_HANDLER(WRITELINE(m_sio, z80sio_device, dcda_w)) MCFG_DEVCB_INVERT
- MCFG_RS232_DSR_HANDLER(WRITELINE(*this, osbexec_state, modem_dsr_w))
- MCFG_RS232_RI_HANDLER(WRITELINE(*this, osbexec_state, modem_ri_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE(m_sio, z80sio_device, ctsa_w)) MCFG_DEVCB_INVERT
-
- MCFG_DEVICE_ADD(PRINTER_PORT_TAG, RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE(m_sio, z80sio_device, rxb_w)) MCFG_DEVCB_INVERT
- MCFG_RS232_DCD_HANDLER(WRITELINE(m_sio, z80sio_device, dcdb_w)) MCFG_DEVCB_INVERT
- MCFG_RS232_CTS_HANDLER(WRITELINE(m_sio, z80sio_device, ctsb_w)) MCFG_DEVCB_INVERT
+ rs232_port_device &modem_port(RS232_PORT(config, MODEM_PORT_TAG, default_rs232_devices, nullptr));
+ modem_port.rxd_handler().set(m_sio, FUNC(z80sio_device::rxa_w)).invert();
+ modem_port.dcd_handler().set(m_sio, FUNC(z80sio_device::dcda_w)).invert();
+ modem_port.dsr_handler().set(FUNC(osbexec_state::modem_dsr_w));
+ modem_port.ri_handler().set(FUNC(osbexec_state::modem_ri_w));
+ modem_port.cts_handler().set(m_sio, FUNC(z80sio_device::ctsa_w)).invert();
+
+ rs232_port_device &printer_port(RS232_PORT(config, PRINTER_PORT_TAG, default_rs232_devices, nullptr));
+ printer_port.rxd_handler().set(m_sio, FUNC(z80sio_device::rxb_w)).invert();
+ printer_port.dcd_handler().set(m_sio, FUNC(z80sio_device::dcdb_w)).invert();
+ printer_port.cts_handler().set(m_sio, FUNC(z80sio_device::ctsb_w)).invert();
MCFG_DEVICE_ADD("mb8877", MB8877, MAIN_CLOCK/24)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(m_pia_1, pia6821_device, cb1_w))
diff --git a/src/mame/drivers/othello.cpp b/src/mame/drivers/othello.cpp
index 5514da5af93..b0790562582 100644
--- a/src/mame/drivers/othello.cpp
+++ b/src/mame/drivers/othello.cpp
@@ -411,7 +411,7 @@ MACHINE_CONFIG_START(othello_state::othello)
MCFG_DEVICE_IO_MAP(audio_portmap)
MCFG_DEVICE_ADD(m_n7751, N7751, XTAL(6'000'000))
- MCFG_MCS48_PORT_T1_IN_CB(GND) // labelled as "TEST", connected to ground
+ MCFG_MCS48_PORT_T1_IN_CB(CONSTANT(0)) // labelled as "TEST", connected to ground
MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, othello_state, n7751_command_r))
MCFG_MCS48_PORT_BUS_IN_CB(READ8(*this, othello_state, n7751_rom_r))
MCFG_MCS48_PORT_P1_OUT_CB(WRITE8("dac", dac_byte_interface, data_w))
diff --git a/src/mame/drivers/othunder.cpp b/src/mame/drivers/othunder.cpp
index 9168c1af617..c58d7da7125 100644
--- a/src/mame/drivers/othunder.cpp
+++ b/src/mame/drivers/othunder.cpp
@@ -622,14 +622,14 @@ MACHINE_CONFIG_START(othunder_state::othunder)
MCFG_ADC0808_IN2_CB(IOPORT("P2X"))
MCFG_ADC0808_IN3_CB(IOPORT("P2Y"))
- MCFG_DEVICE_ADD("tc0220ioc", TC0220IOC, 0)
- MCFG_TC0220IOC_READ_0_CB(IOPORT("DSWA"))
- MCFG_TC0220IOC_READ_1_CB(IOPORT("DSWB"))
- MCFG_TC0220IOC_READ_2_CB(IOPORT("IN0"))
- MCFG_TC0220IOC_READ_3_CB(READLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(7)
- MCFG_TC0220IOC_WRITE_3_CB(WRITE8(*this, othunder_state, eeprom_w))
- MCFG_TC0220IOC_WRITE_4_CB(WRITE8(*this, othunder_state, coins_w))
- MCFG_TC0220IOC_READ_7_CB(IOPORT("IN2"))
+ TC0220IOC(config, m_tc0220ioc, 0);
+ m_tc0220ioc->read_0_callback().set_ioport("DSWA");
+ m_tc0220ioc->read_1_callback().set_ioport("DSWB");
+ m_tc0220ioc->read_2_callback().set_ioport("IN0");
+ m_tc0220ioc->read_3_callback().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::do_read)).lshift(7);
+ m_tc0220ioc->write_3_callback().set(FUNC(othunder_state::eeprom_w));
+ m_tc0220ioc->write_4_callback().set(FUNC(othunder_state::coins_w));
+ m_tc0220ioc->read_7_callback().set_ioport("IN2");
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/p8k.cpp b/src/mame/drivers/p8k.cpp
index 8429206dffd..cadcf6628f9 100644
--- a/src/mame/drivers/p8k.cpp
+++ b/src/mame/drivers/p8k.cpp
@@ -432,9 +432,9 @@ MACHINE_CONFIG_START(p8k_state::p8k)
MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, p8k_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, p8k_state, io_write_byte))
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 307200)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("sio", z80sio_device, txcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, rxcb_w))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 307200));
+ uart_clock.signal_handler().set("sio", FUNC(z80sio_device::txcb_w));
+ uart_clock.signal_handler().append("sio", FUNC(z80sio_device::rxcb_w));
MCFG_DEVICE_ADD("ctc0", Z80CTC, 1229000) /* 1.22MHz clock */
// to implement: callbacks!
@@ -494,9 +494,9 @@ MACHINE_CONFIG_START(p8k_state::p8k_16)
MCFG_DEVICE_ADD("p8k_16_daisy", P8K_16_DAISY, 0)
MCFG_Z80_DAISY_CHAIN(p8k_16_daisy_chain)
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 307200)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("sio", z80sio_device, txcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, rxcb_w))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 307200));
+ uart_clock.signal_handler().set("sio", FUNC(z80sio_device::txcb_w));
+ uart_clock.signal_handler().append("sio", FUNC(z80sio_device::rxcb_w));
/* peripheral hardware */
MCFG_DEVICE_ADD("ctc0", Z80CTC, XTAL(4'000'000))
diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp
index 207868f8383..cf7f985c557 100644
--- a/src/mame/drivers/pacman.cpp
+++ b/src/mame/drivers/pacman.cpp
@@ -3781,10 +3781,10 @@ MACHINE_CONFIG_START(pacman_state::s2650games)
pacman(config);
/* basic machine hardware */
- MCFG_DEVICE_REPLACE("maincpu", S2650, MASTER_CLOCK/6/2) /* 2H */
- MCFG_DEVICE_PROGRAM_MAP(s2650games_map)
- MCFG_DEVICE_DATA_MAP(s2650games_dataport)
- MCFG_S2650_SENSE_INPUT(READLINE("screen", screen_device, vblank)) MCFG_DEVCB_INVERT
+ s2650_device &maincpu(S2650(config.replace(), m_maincpu, MASTER_CLOCK/6/2)); /* 2H */
+ maincpu.set_addrmap(AS_PROGRAM, &pacman_state::s2650games_map);
+ maincpu.set_addrmap(AS_DATA, &pacman_state::s2650games_dataport);
+ maincpu.sense_handler().set("screen", FUNC(screen_device::vblank)).invert();
MCFG_DEVICE_MODIFY("mainlatch")
MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP)
diff --git a/src/mame/drivers/pandoras.cpp b/src/mame/drivers/pandoras.cpp
index 0a1d1884792..dff8388cdc9 100644
--- a/src/mame/drivers/pandoras.cpp
+++ b/src/mame/drivers/pandoras.cpp
@@ -326,14 +326,14 @@ MACHINE_CONFIG_START(pandoras_state::pandoras)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - needed for correct synchronization of the sound CPUs */
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // C3
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, pandoras_state, cpua_irq_enable_w)) // ENA
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // OFSET - unknown
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, pandoras_state, coin_counter_1_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, pandoras_state, coin_counter_2_w))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, pandoras_state, flipscreen_w)) // FLIP
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, pandoras_state, cpub_irq_enable_w)) // ENB
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT // RESETB
+ ls259_device &mainlatch(LS259(config, "mainlatch")); // C3
+ mainlatch.q_out_cb<0>().set(FUNC(pandoras_state::cpua_irq_enable_w)); // ENA
+ mainlatch.q_out_cb<1>().set_nop(); // OFSET - unknown
+ mainlatch.q_out_cb<2>().set(FUNC(pandoras_state::coin_counter_1_w));
+ mainlatch.q_out_cb<3>().set(FUNC(pandoras_state::coin_counter_2_w));
+ mainlatch.q_out_cb<5>().set(FUNC(pandoras_state::flipscreen_w)); // FLIP
+ mainlatch.q_out_cb<6>().set(FUNC(pandoras_state::cpub_irq_enable_w)); // ENB
+ mainlatch.q_out_cb<7>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert(); // RESETB
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/pc100.cpp b/src/mame/drivers/pc100.cpp
index 773576d06d9..8d802d3322c 100644
--- a/src/mame/drivers/pc100.cpp
+++ b/src/mame/drivers/pc100.cpp
@@ -660,7 +660,7 @@ MACHINE_CONFIG_START(pc100_state::pc100)
MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(GND) // ???
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0)) // ???
MCFG_DEVICE_ADD("uart8251", I8251, 0)
//MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/pc88va.cpp b/src/mame/drivers/pc88va.cpp
index eb5bfaf8244..ddf04b74783 100644
--- a/src/mame/drivers/pc88va.cpp
+++ b/src/mame/drivers/pc88va.cpp
@@ -1633,12 +1633,12 @@ MACHINE_CONFIG_START(pc88va_state::pc88va)
MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, pc88va_state, get_slave_ack))
MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_master", pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("dmac", AM9517A, 8000000) /* ch2 is FDC, ch0/3 are "user". ch1 is unused */
MCFG_AM9517A_OUT_HREQ_CB(WRITELINE(*this, pc88va_state, pc88va_hlda_w))
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index baa2cb7063d..fc849cd28fa 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -2306,13 +2306,13 @@ MACHINE_CONFIG_START(pc9801_state::pc9801_ide)
MACHINE_CONFIG_END
MACHINE_CONFIG_START(pc9801_state::pc9801_common)
- MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
- MCFG_PIT8253_CLK0(MAIN_CLOCK_X1) /* heartbeat IRQ */
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("pic8259_master", pic8259_device, ir0_w))
- MCFG_PIT8253_CLK1(MAIN_CLOCK_X1) /* Memory Refresh */
- MCFG_PIT8253_CLK2(MAIN_CLOCK_X1) /* RS-232c */
- MCFG_PIT8253_OUT2_HANDLER(WRITELINE(UPD8251_TAG, i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(UPD8251_TAG, i8251_device, write_rxc))
+ PIT8253(config, m_pit8253, 0);
+ m_pit8253->set_clk<0>(MAIN_CLOCK_X1); // heartbeat IRQ
+ m_pit8253->out_handler<0>().set(m_pic1, FUNC(pic8259_device::ir0_w));
+ m_pit8253->set_clk<1>(MAIN_CLOCK_X1); // Memory Refresh
+ m_pit8253->set_clk<2>(MAIN_CLOCK_X1); // RS-232C
+ m_pit8253->out_handler<2>().set(m_sio, FUNC(i8251_device::write_txc));
+ m_pit8253->out_handler<2>().append(m_sio, FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD("i8237", AM9517A, 5000000) // unknown clock, TODO: check channels 0 - 1
MCFG_I8237_OUT_HREQ_CB(WRITELINE(*this, pc9801_state, dma_hrq_changed))
@@ -2328,12 +2328,12 @@ MACHINE_CONFIG_START(pc9801_state::pc9801_common)
MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, pc9801_state, get_slave_ack))
MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_master", pic8259_device, ir7_w)) // TODO: Check ir7_w
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("ppi8255_sys", I8255, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
@@ -2351,11 +2351,11 @@ MACHINE_CONFIG_START(pc9801_state::pc9801_common)
MCFG_DEVICE_ADD(UPD8251_TAG, I8251, 0)
- MCFG_UPD765A_ADD("upd765_2hd", true, true)
- MCFG_UPD765_INTRQ_CALLBACK(WRITELINE("pic8259_slave", pic8259_device, ir3_w))
- MCFG_UPD765_DRQ_CALLBACK(WRITELINE("i8237", am9517a_device, dreq2_w)) MCFG_DEVCB_INVERT
- MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
+ UPD765A(config, m_fdc_2hd, true, true);
+ m_fdc_2hd->intrq_wr_callback().set(m_pic2, FUNC(pic8259_device::ir3_w));
+ m_fdc_2hd->drq_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq2_w)).invert();
+ 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))
@@ -2403,11 +2403,11 @@ MACHINE_CONFIG_START(pc9801_state::pc9801)
MCFG_RAM_DEFAULT_SIZE("640K")
MCFG_RAM_EXTRA_OPTIONS("128K,256K,384K,512K")
- MCFG_UPD765A_ADD("upd765_2dd", false, true)
- MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(*this, pc9801_state, fdc_2dd_irq))
- MCFG_UPD765_DRQ_CALLBACK(WRITELINE("i8237", am9517a_device, dreq3_w)) MCFG_DEVCB_INVERT
- MCFG_FLOPPY_DRIVE_ADD("upd765_2dd:0", pc9801_floppies, "525dd", pc9801_state::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("upd765_2dd:1", pc9801_floppies, "525dd", pc9801_state::floppy_formats)
+ UPD765A(config, m_fdc_2dd, false, true);
+ m_fdc_2dd->intrq_wr_callback().set(FUNC(pc9801_state::fdc_2dd_irq));
+ m_fdc_2dd->drq_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq3_w)).invert();
+ FLOPPY_CONNECTOR(config, "upd765_2dd:0", pc9801_floppies, "525dd", pc9801_state::floppy_formats);
+ FLOPPY_CONNECTOR(config, "upd765_2dd:1", pc9801_floppies, "525dd", pc9801_state::floppy_formats);
pc9801_sasi(config);
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, NOOP)
diff --git a/src/mame/drivers/pcd.cpp b/src/mame/drivers/pcd.cpp
index f32bdfc5de2..0587c223a16 100644
--- a/src/mame/drivers/pcd.cpp
+++ b/src/mame/drivers/pcd.cpp
@@ -524,7 +524,7 @@ MACHINE_CONFIG_START(pcd_state::pcd)
MCFG_DEVICE_ADD("fdc", WD2793, 16_MHz_XTAL / 8)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE("pic1", pic8259_device, ir6_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE("maincpu", i80186_cpu_device, drq1_w))
- MCFG_WD_FDC_ENMF_CALLBACK(GND)
+ MCFG_WD_FDC_ENMF_CALLBACK(CONSTANT(0))
// floppy drives
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pcd_floppies, "55f", pcd_state::floppy_formats)
diff --git a/src/mame/drivers/pcm.cpp b/src/mame/drivers/pcm.cpp
index 881cbc481ee..58c9b3449ac 100644
--- a/src/mame/drivers/pcm.cpp
+++ b/src/mame/drivers/pcm.cpp
@@ -295,15 +295,15 @@ MACHINE_CONFIG_START(pcm_state::pcm)
MCFG_DEVICE_ADD("sio", Z80SIO, XTAL(10'000'000) /4)
- MCFG_DEVICE_ADD("ctc_u", Z80CTC, XTAL(10'000'000) /4)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
-
- MCFG_DEVICE_ADD("ctc_s", Z80CTC, XTAL(10'000'000) /4)
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio", z80sio_device, rxca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio", z80sio_device, rxtxcb_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE(*this, pcm_state, pcm_82_w)) // speaker
+ Z80CTC(config, m_ctc_u, 10_MHz_XTAL / 4);
+ m_ctc_u->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+
+ Z80CTC(config, m_ctc_s, 10_MHz_XTAL / 4);
+ m_ctc_s->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_ctc_s->zc_callback<0>().set("sio", FUNC(z80sio_device::rxca_w));
+ m_ctc_s->zc_callback<0>().append("sio", FUNC(z80sio_device::txca_w));
+ m_ctc_s->zc_callback<1>().set("sio", FUNC(z80sio_device::rxtxcb_w));
+ m_ctc_s->zc_callback<2>().set(FUNC(pcm_state::pcm_82_w)); // speaker
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/pecom.cpp b/src/mame/drivers/pecom.cpp
index 2e60b208dbf..ac5d4b2228d 100644
--- a/src/mame/drivers/pecom.cpp
+++ b/src/mame/drivers/pecom.cpp
@@ -175,7 +175,7 @@ MACHINE_CONFIG_START(pecom_state::pecom64)
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, cdp1869_device::DOT_CLK_PAL/3)
MCFG_DEVICE_PROGRAM_MAP(pecom64_mem)
MCFG_DEVICE_IO_MAP(pecom64_io)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, pecom_state, clear_r))
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, pecom_state, ef2_r))
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, pecom_state, q_w))
diff --git a/src/mame/drivers/peoplepc.cpp b/src/mame/drivers/peoplepc.cpp
index 073f2c4205e..06cc28e0a5b 100644
--- a/src/mame/drivers/peoplepc.cpp
+++ b/src/mame/drivers/peoplepc.cpp
@@ -261,12 +261,12 @@ MACHINE_CONFIG_START(peoplepc_state::olypeopl)
MCFG_DEVICE_ADD("pic8259_0", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, peoplepc_state, get_slave_ack))
MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_0", pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
diff --git a/src/mame/drivers/peyper.cpp b/src/mame/drivers/peyper.cpp
index 26c326205dd..bcf4ad25e22 100644
--- a/src/mame/drivers/peyper.cpp
+++ b/src/mame/drivers/peyper.cpp
@@ -630,8 +630,8 @@ MACHINE_CONFIG_START(peyper_state::peyper)
MCFG_I8279_OUT_SL_CB(WRITE8(*this, peyper_state, col_w)) // scan SL lines
MCFG_I8279_OUT_DISP_CB(WRITE8(*this, peyper_state, disp_w)) // display A&B
MCFG_I8279_IN_RL_CB(READ8(*this, peyper_state, sw_r)) // kbd RL lines
- MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key
- MCFG_I8279_IN_CTRL_CB(VCC)
+ MCFG_I8279_IN_SHIFT_CB(CONSTANT(1)) // Shift key
+ MCFG_I8279_IN_CTRL_CB(CONSTANT(1))
MACHINE_CONFIG_END
// Not allowed to set up an array all at once, so we have this mess
diff --git a/src/mame/drivers/pg685.cpp b/src/mame/drivers/pg685.cpp
index 320d384025a..1ea1fd48e77 100644
--- a/src/mame/drivers/pg685.cpp
+++ b/src/mame/drivers/pg685.cpp
@@ -432,7 +432,7 @@ MACHINE_CONFIG_START(pg685_state::pg675)
MCFG_DEVICE_ADD("mainpic", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
// i/o cpu
@@ -481,7 +481,7 @@ MACHINE_CONFIG_START(pg685_state::pg685)
MCFG_DEVICE_ADD("mainpic", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
// i/o cpu
@@ -532,7 +532,7 @@ MACHINE_CONFIG_START(pg685_state::pg685oua12)
MCFG_DEVICE_ADD("mainpic", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
// i/o cpu
diff --git a/src/mame/drivers/pimps.cpp b/src/mame/drivers/pimps.cpp
index 31335ecb2ed..b93bacbd965 100644
--- a/src/mame/drivers/pimps.cpp
+++ b/src/mame/drivers/pimps.cpp
@@ -129,39 +129,39 @@ static DEVICE_INPUT_DEFAULTS_START( terminal ) // set up terminal to default to
DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 )
DEVICE_INPUT_DEFAULTS_END
-MACHINE_CONFIG_START(pimps_state::pimps)
- /* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",I8085A, XTAL(2'000'000))
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
- MCFG_DEVICE_IO_MAP(io_map)
-
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart1", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart1", i8251_device, write_rxc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart2", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart2", i8251_device, write_rxc))
-
- MCFG_DEVICE_ADD("uart1", I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE("rs232a", rs232_port_device, write_txd))
- MCFG_I8251_DTR_HANDLER(WRITELINE("rs232a", rs232_port_device, write_dtr))
- MCFG_I8251_RTS_HANDLER(WRITELINE("rs232a", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232a", RS232_PORT, default_rs232_devices, "terminal")
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart1", i8251_device, write_rxd))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart1", i8251_device, write_dsr))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart1", i8251_device, write_cts))
- MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", terminal) // must be exactly here
-
- MCFG_DEVICE_ADD("uart2", I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE("rs232b", rs232_port_device, write_txd))
- MCFG_I8251_DTR_HANDLER(WRITELINE("rs232b", rs232_port_device, write_dtr))
- MCFG_I8251_RTS_HANDLER(WRITELINE("rs232b", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232b", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart2", i8251_device, write_rxd))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart2", i8251_device, write_dsr))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart2", i8251_device, write_cts))
-MACHINE_CONFIG_END
+void pimps_state::pimps(machine_config &config)
+{
+ I8085A(config, m_maincpu, 2_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &pimps_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &pimps_state::io_map);
+
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 153'600));
+ uart_clock.signal_handler().set("uart1", FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append("uart1", FUNC(i8251_device::write_rxc));
+ uart_clock.signal_handler().append("uart2", FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append("uart2", FUNC(i8251_device::write_rxc));
+
+ i8251_device &uart1(I8251(config, "uart1", 0));
+ uart1.txd_handler().set("rs232a", FUNC(rs232_port_device::write_txd));
+ uart1.dtr_handler().set("rs232a", FUNC(rs232_port_device::write_dtr));
+ uart1.rts_handler().set("rs232a", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, "terminal"));
+ rs232a.rxd_handler().set("uart1", FUNC(i8251_device::write_rxd));
+ rs232a.dsr_handler().set("uart1", FUNC(i8251_device::write_dsr));
+ rs232a.cts_handler().set("uart1", FUNC(i8251_device::write_cts));
+ rs232a.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be exactly here
+
+ i8251_device &uart2(I8251(config, "uart2", 0));
+ uart2.txd_handler().set("rs232b", FUNC(rs232_port_device::write_txd));
+ uart2.dtr_handler().set("rs232b", FUNC(rs232_port_device::write_dtr));
+ uart2.rts_handler().set("rs232b", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr));
+ rs232b.rxd_handler().set("uart2", FUNC(i8251_device::write_rxd));
+ rs232b.dsr_handler().set("uart2", FUNC(i8251_device::write_dsr));
+ rs232b.cts_handler().set("uart2", FUNC(i8251_device::write_cts));
+}
/* ROM definition */
ROM_START( pimps )
diff --git a/src/mame/drivers/pktgaldx.cpp b/src/mame/drivers/pktgaldx.cpp
index 1e061c2e6cb..164fdece3ab 100644
--- a/src/mame/drivers/pktgaldx.cpp
+++ b/src/mame/drivers/pktgaldx.cpp
@@ -378,11 +378,11 @@ MACHINE_CONFIG_START(pktgaldx_state::pktgaldx)
MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
- MCFG_DECO104_ADD("ioprot104")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
- MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE(8,9, 4,5,6,7 ,1,0,3,2) // hopefully this is correct, nothing else uses this arrangement!
+ DECO104PROT(config, m_deco104, 0);
+ m_deco104->port_a_cb().set_ioport("INPUTS");
+ m_deco104->port_b_cb().set_ioport("SYSTEM");
+ m_deco104->port_c_cb().set_ioport("DSW");
+ m_deco104->set_interface_scramble(8,9, 4,5,6,7, 1,0,3,2); // hopefully this is correct, nothing else uses this arrangement!
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/play_2.cpp b/src/mame/drivers/play_2.cpp
index 6d4ac1a001f..12865da25cd 100644
--- a/src/mame/drivers/play_2.cpp
+++ b/src/mame/drivers/play_2.cpp
@@ -370,7 +370,7 @@ MACHINE_CONFIG_START(play_2_state::play_2)
MCFG_DEVICE_ADD("maincpu", CDP1802, XTAL(2'950'000))
MCFG_DEVICE_PROGRAM_MAP(play_2_map)
MCFG_DEVICE_IO_MAP(play_2_io)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, play_2_state, clear_r))
MCFG_COSMAC_EF1_CALLBACK(READLINE(*this, play_2_state, ef1_r))
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, play_2_state, ef4_r))
@@ -388,13 +388,13 @@ MACHINE_CONFIG_START(play_2_state::play_2)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, play_2_state, clock2_w))
// This is actually a 4013 chip (has 2 RS flipflops)
- MCFG_DEVICE_ADD("4013a", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE("4013a", ttl7474_device, d_w))
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, play_2_state, q4013a_w))
+ TTL7474(config, m_4013a, 0);
+ m_4013a->comp_output_cb().set(m_4013a, FUNC(ttl7474_device::d_w));
+ m_4013a->output_cb().set(FUNC(play_2_state::q4013a_w));
- MCFG_DEVICE_ADD("4013b", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE("maincpu", cosmac_device, ef2_w))
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE("maincpu", cosmac_device, int_w)) MCFG_DEVCB_INVERT // int is reversed in mame
+ TTL7474(config, m_4013b, 0);
+ m_4013b->output_cb().set(m_maincpu, FUNC(cosmac_device::ef2_w));
+ m_4013b->comp_output_cb().set(m_maincpu, FUNC(cosmac_device::int_w)).invert(); // int is reversed in mame
/* Sound */
genpin_audio(config);
diff --git a/src/mame/drivers/play_3.cpp b/src/mame/drivers/play_3.cpp
index aaf00424e82..5c56395a9f2 100644
--- a/src/mame/drivers/play_3.cpp
+++ b/src/mame/drivers/play_3.cpp
@@ -480,7 +480,7 @@ MACHINE_CONFIG_START(play_3_state::play_3)
MCFG_DEVICE_ADD("maincpu", CDP1802, XTAL(3'579'545))
MCFG_DEVICE_PROGRAM_MAP(play_3_map)
MCFG_DEVICE_IO_MAP(play_3_io)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, play_3_state, clear_r))
MCFG_COSMAC_EF1_CALLBACK(READLINE(*this, play_3_state, ef1_r))
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, play_3_state, ef4_r))
@@ -499,13 +499,13 @@ MACHINE_CONFIG_START(play_3_state::play_3)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, play_3_state, clock2_w))
// This is actually a 4013 chip (has 2 RS flipflops)
- MCFG_DEVICE_ADD("4013a", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, play_3_state, q4013a_w))
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE("4013a", ttl7474_device, d_w))
+ TTL7474(config, m_4013a, 0);
+ m_4013a->output_cb().set(FUNC(play_3_state::q4013a_w));
+ m_4013a->comp_output_cb().set(m_4013a, FUNC(ttl7474_device::d_w));
- MCFG_DEVICE_ADD("4013b", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE("maincpu", cosmac_device, ef2_w)) MCFG_DEVCB_INVERT // inverted
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE("maincpu", cosmac_device, int_w)) MCFG_DEVCB_INVERT // inverted
+ TTL7474(config, m_4013b, 0);
+ m_4013b->output_cb().set(m_maincpu, FUNC(cosmac_device::ef2_w)).invert(); // inverted
+ m_4013b->comp_output_cb().set(m_maincpu, FUNC(cosmac_device::int_w)).invert(); // inverted
/* Sound */
genpin_audio(config);
@@ -513,7 +513,7 @@ MACHINE_CONFIG_START(play_3_state::play_3)
MCFG_DEVICE_ADD("audiocpu", CDP1802, XTAL(3'579'545))
MCFG_DEVICE_PROGRAM_MAP(play_3_audio_map)
MCFG_DEVICE_IO_MAP(play_3_audio_io)
- MCFG_COSMAC_WAIT_CALLBACK(VCC)
+ MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, play_3_state, clear_a_r))
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/playch10.cpp b/src/mame/drivers/playch10.cpp
index e4766016db5..5c1106e2b8d 100644
--- a/src/mame/drivers/playch10.cpp
+++ b/src/mame/drivers/playch10.cpp
@@ -646,27 +646,27 @@ WRITE_LINE_MEMBER(playch10_state::vblank_irq)
MACHINE_CONFIG_START(playch10_state::playch10)
// basic machine hardware
- MCFG_DEVICE_ADD("maincpu", Z80, 8000000/2) // 4 MHz
- MCFG_DEVICE_PROGRAM_MAP(bios_map)
- MCFG_DEVICE_IO_MAP(bios_io_map)
-
- MCFG_DEVICE_ADD("cart", N2A03, NTSC_APU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(cart_map)
-
- MCFG_DEVICE_ADD("outlatch1", LS259, 0) // 7D
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, playch10_state, sdcs_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, playch10_state, cntrl_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, playch10_state, disp_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, playch10_state, sound_mask_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("cart", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT // GAMERES
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("cart", INPUT_LINE_HALT)) MCFG_DEVCB_INVERT // GAMESTOP
-
- MCFG_DEVICE_ADD("outlatch2", LS259, 0) // 7E
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, playch10_state, nmi_enable_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, playch10_state, dog_di_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, playch10_state, ppu_reset_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, playch10_state, up8w_w))
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, playch10_state, cart_sel_w)) MCFG_DEVCB_MASK(0x78) MCFG_DEVCB_RSHIFT(-3)
+ Z80(config, m_maincpu, 8000000/2); // 4 MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &playch10_state::bios_map);
+ m_maincpu->set_addrmap(AS_IO, &playch10_state::bios_io_map);
+
+ N2A03(config, m_cartcpu, NTSC_APU_CLOCK);
+ m_cartcpu->set_addrmap(AS_PROGRAM, &playch10_state::cart_map);
+
+ ls259_device &outlatch1(LS259(config, "outlatch1")); // 7D
+ outlatch1.q_out_cb<0>().set(FUNC(playch10_state::sdcs_w));
+ outlatch1.q_out_cb<1>().set(FUNC(playch10_state::cntrl_mask_w));
+ outlatch1.q_out_cb<2>().set(FUNC(playch10_state::disp_mask_w));
+ outlatch1.q_out_cb<3>().set(FUNC(playch10_state::sound_mask_w));
+ outlatch1.q_out_cb<4>().set_inputline(m_cartcpu, INPUT_LINE_RESET).invert(); // GAMERES
+ outlatch1.q_out_cb<5>().set_inputline(m_cartcpu, INPUT_LINE_HALT).invert(); // GAMESTOP
+
+ ls259_device &outlatch2(LS259(config, "outlatch2")); // 7E
+ outlatch2.q_out_cb<0>().set(FUNC(playch10_state::nmi_enable_w));
+ outlatch2.q_out_cb<1>().set(FUNC(playch10_state::dog_di_w));
+ outlatch2.q_out_cb<2>().set(FUNC(playch10_state::ppu_reset_w));
+ outlatch2.q_out_cb<7>().set(FUNC(playch10_state::up8w_w));
+ outlatch2.parallel_out_cb().set(FUNC(playch10_state::cart_sel_w)).rshift(3).mask(0x0f);
// video hardware
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_playch10)
@@ -687,11 +687,11 @@ MACHINE_CONFIG_START(playch10_state::playch10)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(playch10_state, screen_update_playch10_bottom)
- MCFG_PPU2C03B_ADD("ppu")
- MCFG_PPU2C0X_SET_SCREEN("bottom")
- MCFG_PPU2C0X_CPU("cart")
- MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("cart", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, playch10_state, int_detect_w))
+ PPU_2C03B(config, m_ppu, 0);
+ m_ppu->set_screen("bottom");
+ m_ppu->set_cpu_tag("cart");
+ m_ppu->int_callback().set_inputline(m_cartcpu, INPUT_LINE_NMI);
+ m_ppu->int_callback().append(FUNC(playch10_state::int_detect_w));
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/plus4.cpp b/src/mame/drivers/plus4.cpp
index c9b5cb87af6..a2cb4c6e626 100644
--- a/src/mame/drivers/plus4.cpp
+++ b/src/mame/drivers/plus4.cpp
@@ -919,27 +919,27 @@ MACHINE_CONFIG_START(plus4_state::plus4)
// devices
MCFG_PLS100_ADD(PLA_TAG)
- MCFG_DEVICE_ADD(m_user, PET_USER_PORT, plus4_user_port_cards, nullptr)
- MCFG_PET_USER_PORT_4_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p2)) // cassette sense
- MCFG_PET_USER_PORT_5_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p3))
- MCFG_PET_USER_PORT_6_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p4))
- MCFG_PET_USER_PORT_7_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p5))
- MCFG_PET_USER_PORT_8_HANDLER(WRITELINE(m_acia, mos6551_device, write_rxc))
- MCFG_PET_USER_PORT_B_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p0))
- MCFG_PET_USER_PORT_C_HANDLER(WRITELINE(m_acia, mos6551_device, write_rxd))
- MCFG_PET_USER_PORT_F_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p7))
- MCFG_PET_USER_PORT_H_HANDLER(WRITELINE(m_acia, mos6551_device, write_dcd)) MCFG_DEVCB_XOR(1) // TODO: add missing pull up before inverter
- MCFG_PET_USER_PORT_J_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p6))
- MCFG_PET_USER_PORT_K_HANDLER(WRITELINE(m_spi_user, mos6529_device, write_p1))
- MCFG_PET_USER_PORT_L_HANDLER(WRITELINE(m_acia, mos6551_device, write_dsr)) MCFG_DEVCB_XOR(1) // TODO: add missing pull up before inverter
-
- MCFG_DEVICE_ADD(m_acia, MOS6551, 0)
- MCFG_MOS6551_XTAL(XTAL(1'843'200))
- MCFG_MOS6551_RXC_HANDLER(WRITELINE(m_user, pet_user_port_device, write_8))
- MCFG_MOS6551_RTS_HANDLER(WRITELINE(m_user, pet_user_port_device, write_d)) MCFG_DEVCB_XOR(1)
- MCFG_MOS6551_DTR_HANDLER(WRITELINE(m_user, pet_user_port_device, write_e)) MCFG_DEVCB_XOR(1)
- MCFG_MOS6551_TXD_HANDLER(WRITELINE(m_user, pet_user_port_device, write_m))
- MCFG_MOS6551_IRQ_HANDLER(WRITELINE(*this, plus4_state, acia_irq_w))
+ PET_USER_PORT(config, m_user, plus4_user_port_cards, nullptr);
+ m_user->p4_handler().set(m_spi_user, FUNC(mos6529_device::write_p2)); // cassette sense
+ m_user->p5_handler().set(m_spi_user, FUNC(mos6529_device::write_p3));
+ m_user->p6_handler().set(m_spi_user, FUNC(mos6529_device::write_p4));
+ m_user->p7_handler().set(m_spi_user, FUNC(mos6529_device::write_p5));
+ m_user->p8_handler().set(m_acia, FUNC(mos6551_device::write_rxc));
+ m_user->pb_handler().set(m_spi_user, FUNC(mos6529_device::write_p0));
+ m_user->pc_handler().set(m_acia, FUNC(mos6551_device::write_rxd));
+ m_user->pf_handler().set(m_spi_user, FUNC(mos6529_device::write_p7));
+ m_user->ph_handler().set(m_acia, FUNC(mos6551_device::write_dcd)).invert(); // TODO: add missing pull up before inverter
+ m_user->pj_handler().set(m_spi_user, FUNC(mos6529_device::write_p6));
+ m_user->pk_handler().set(m_spi_user, FUNC(mos6529_device::write_p1));
+ m_user->pl_handler().set(m_acia, FUNC(mos6551_device::write_dsr)).invert(); // TODO: add missing pull up before inverter
+
+ MOS6551(config, m_acia, 0);
+ m_acia->set_xtal(1.8432_MHz_XTAL);
+ m_acia->rxc_handler().set(m_user, FUNC(pet_user_port_device::write_8));
+ m_acia->rts_handler().set(m_user, FUNC(pet_user_port_device::write_d)).invert();
+ m_acia->dtr_handler().set(m_user, FUNC(pet_user_port_device::write_e)).invert();
+ m_acia->txd_handler().set(m_user, FUNC(pet_user_port_device::write_m));
+ m_acia->irq_handler().set(FUNC(plus4_state::acia_irq_w));
MCFG_DEVICE_ADD(m_spi_user, MOS6529, 0)
MCFG_MOS6529_P0_HANDLER(WRITELINE(m_user, pet_user_port_device, write_b))
diff --git a/src/mame/drivers/pm68k.cpp b/src/mame/drivers/pm68k.cpp
index 142b5829328..c8020e6c8d9 100644
--- a/src/mame/drivers/pm68k.cpp
+++ b/src/mame/drivers/pm68k.cpp
@@ -71,11 +71,11 @@ MACHINE_CONFIG_START(pm68k_state::pm68k)
MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs232b", rs232_port_device, write_dtr))
MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs232b", rs232_port_device, write_rts))
- MCFG_DEVICE_ADD("stc", AM9513, 4000000)
- MCFG_AM9513_OUT4_CALLBACK(WRITELINE("mpsc", i8274_new_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mpsc", i8274_new_device, txca_w))
- MCFG_AM9513_OUT5_CALLBACK(WRITELINE("mpsc", i8274_new_device, rxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mpsc", i8274_new_device, txcb_w))
+ am9513_device &stc(AM9513(config, "stc", 4000000));
+ stc.out4_cb().set("mpsc", FUNC(i8274_new_device::rxca_w));
+ stc.out4_cb().append("mpsc", FUNC(i8274_new_device::txca_w));
+ stc.out5_cb().set("mpsc", FUNC(i8274_new_device::rxcb_w));
+ stc.out5_cb().append("mpsc", FUNC(i8274_new_device::txcb_w));
MCFG_DEVICE_ADD("rs232a", RS232_PORT, default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(WRITELINE("mpsc", i8274_new_device, rxa_w))
diff --git a/src/mame/drivers/pntnpuzl.cpp b/src/mame/drivers/pntnpuzl.cpp
index 36528e8994f..104a265b2b1 100644
--- a/src/mame/drivers/pntnpuzl.cpp
+++ b/src/mame/drivers/pntnpuzl.cpp
@@ -359,12 +359,12 @@ MACHINE_CONFIG_START(pntnpuzl_state::pntnpuzl)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("via", VIA6522, XTAL(12'000'000) / 10)
- MCFG_VIA6522_READPA_HANDLER(IOPORT("IN2"))
- MCFG_VIA6522_READPB_HANDLER(IOPORT("IN1"))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(4)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(6)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(5)
+ VIA6522(config, m_via, 12_MHz_XTAL / 10);
+ m_via->readpa_handler().set_ioport("IN2");
+ m_via->readpb_handler().set_ioport("IN1");
+ m_via->writepb_handler().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(4);
+ m_via->writepb_handler().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(6);
+ m_via->writepb_handler().append("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(5);
// CB2 used for serial communication with 8798
MCFG_DEVICE_ADD("mcu", P8098, XTAL(12'000'000))
diff --git a/src/mame/drivers/pokechmp.cpp b/src/mame/drivers/pokechmp.cpp
index a2784703321..48f2eec067f 100644
--- a/src/mame/drivers/pokechmp.cpp
+++ b/src/mame/drivers/pokechmp.cpp
@@ -229,22 +229,22 @@ WRITE_LINE_MEMBER(pokechmp_state::sound_irq)
MACHINE_CONFIG_START(pokechmp_state::pokechmp)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502, XTAL(4'000'000)/4)
- MCFG_DEVICE_PROGRAM_MAP(pokechmp_map)
+ M6502(config, m_maincpu, 4_MHz_XTAL/4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &pokechmp_state::pokechmp_map);
- MCFG_DEVICE_ADD("audiocpu", M6502, XTAL(4'000'000)/4)
- MCFG_DEVICE_PROGRAM_MAP(pokechmp_sound_map)
+ M6502(config, m_audiocpu, 4_MHz_XTAL/4);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &pokechmp_state::pokechmp_sound_map);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(pokechmp_state, screen_update_pokechmp)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, pokechmp_state, sound_irq))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(pokechmp_state::screen_update_pokechmp));
+ screen.set_palette("palette");
+ screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ screen.screen_vblank().append(FUNC(pokechmp_state::sound_irq));
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pokechmp)
MCFG_PALETTE_ADD("palette", 0x400)
diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp
index 636ae61685f..f3489d4df0f 100644
--- a/src/mame/drivers/polepos.cpp
+++ b/src/mame/drivers/polepos.cpp
@@ -862,14 +862,14 @@ MACHINE_CONFIG_START(polepos_state::polepos)
MCFG_DEVICE_ADD(m_subcpu2, Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z8002_map_2)
- MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2) /* 1.536 MHz */
- MCFG_NAMCO_51XX_SCREEN("screen")
- MCFG_NAMCO_51XX_INPUT_0_CB(IOPORT("IN0")) MCFG_DEVCB_MASK(0x0f)
- MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO_51XX_INPUT_2_CB(IOPORT("DSWB")) MCFG_DEVCB_MASK(0x0f)
- MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("DSWB")) MCFG_DEVCB_RSHIFT(4)
- MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(*this, polepos_state,out_0))
- MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(*this, polepos_state,out_1))
+ namco_51xx_device &n51xx(NAMCO_51XX(config, "51xx", MASTER_CLOCK/8/2)); /* 1.536 MHz */
+ n51xx.set_screen_tag(m_screen);
+ n51xx.input_callback<0>().set_ioport("IN0").mask(0x0f);
+ n51xx.input_callback<1>().set_ioport("IN0").rshift(4);
+ n51xx.input_callback<2>().set_ioport("DSWB").mask(0x0f);
+ n51xx.input_callback<3>().set_ioport("DSWB").rshift(4);
+ n51xx.output_callback<0>().set(FUNC(polepos_state::out_0));
+ n51xx.output_callback<1>().set(FUNC(polepos_state::out_1));
MCFG_NAMCO_52XX_ADD("52xx", MASTER_CLOCK/8/2) /* 1.536 MHz */
MCFG_NAMCO_52XX_DISCRETE("discrete")
@@ -877,12 +877,12 @@ MACHINE_CONFIG_START(polepos_state::polepos)
MCFG_NAMCO_52XX_ROMREAD_CB(READ8(*this, polepos_state,namco_52xx_rom_r))
MCFG_NAMCO_52XX_SI_CB(READ8(*this, polepos_state,namco_52xx_si_r))
- MCFG_NAMCO_53XX_ADD("53xx", MASTER_CLOCK/8/2) /* 1.536 MHz */
- MCFG_NAMCO_53XX_K_CB(READ8(*this, polepos_state,namco_53xx_k_r))
- MCFG_NAMCO_53XX_INPUT_0_CB(READ8(*this, polepos_state,steering_changed_r))
- MCFG_NAMCO_53XX_INPUT_1_CB(READ8(*this, polepos_state,steering_delta_r))
- MCFG_NAMCO_53XX_INPUT_2_CB(IOPORT("DSWA")) MCFG_DEVCB_MASK(0x0f)
- MCFG_NAMCO_53XX_INPUT_3_CB(IOPORT("DSWA")) MCFG_DEVCB_RSHIFT(4)
+ namco_53xx_device &n53xx(NAMCO_53XX(config, "53xx", MASTER_CLOCK/8/2)); /* 1.536 MHz */
+ n53xx.k_port_callback().set(FUNC(polepos_state::namco_53xx_k_r));
+ n53xx.input_callback<0>().set(FUNC(polepos_state::steering_changed_r));
+ n53xx.input_callback<1>().set(FUNC(polepos_state::steering_delta_r));
+ n53xx.input_callback<2>().set_ioport("DSWA").mask(0x0f);
+ n53xx.input_callback<3>().set_ioport("DSWA").rshift(4);
MCFG_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/8/2) /* 1.536 MHz */
MCFG_NAMCO_54XX_DISCRETE("discrete")
@@ -906,16 +906,16 @@ MACHINE_CONFIG_START(polepos_state::polepos)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, scanline, "screen", 0, 1)
- MCFG_DEVICE_ADD(m_latch, LS259, 0) // at 8E on polepos
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(CLEARLINE(m_maincpu, 0)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, polepos_state, iosel_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_namco_sound, namco_device, sound_enable_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("polepos", polepos_sound_device, clson_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, polepos_state, gasel_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE(m_subcpu, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE(m_subcpu2, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, polepos_state, sb0_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, polepos_state, chacl_w))
+ LS259(config, m_latch); // at 8E on polepos
+ m_latch->q_out_cb<0>().set_inputline(m_maincpu, 0, CLEAR_LINE).invert();
+ m_latch->q_out_cb<1>().set(FUNC(polepos_state::iosel_w));
+ m_latch->q_out_cb<2>().set(m_namco_sound, FUNC(namco_device::sound_enable_w));
+ m_latch->q_out_cb<2>().set("polepos", FUNC(polepos_sound_device::clson_w));
+ m_latch->q_out_cb<3>().set(FUNC(polepos_state::gasel_w));
+ m_latch->q_out_cb<4>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert();
+ m_latch->q_out_cb<5>().set_inputline(m_subcpu2, INPUT_LINE_RESET).invert();
+ m_latch->q_out_cb<6>().set(FUNC(polepos_state::sb0_w));
+ m_latch->q_out_cb<7>().set(FUNC(polepos_state::chacl_w));
/* video hardware */
MCFG_SCREEN_ADD(m_screen, RASTER)
@@ -996,12 +996,11 @@ MACHINE_CONFIG_START(polepos_state::topracern)
MCFG_DEVICE_ADD(m_subcpu2, Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z8002_map_2)
- /* TODO, remove these devices too, this bootleg doesn't have them, but the emulation doesn't boot without them.. */
- /* doesn't exist on the bootleg, but required for now or the game only boots in test mode!
- they probably simulate some of the logic */
- MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2) /* 1.536 MHz */
- MCFG_NAMCO_51XX_SCREEN("screen")
- MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0")) MCFG_DEVCB_RSHIFT(4)
+ // TODO, remove these devices too, this bootleg doesn't have them, but the emulation doesn't boot without them.
+ // doesn't exist on the bootleg, but required for now or the game only boots in test mode! they probably simulate some of the logic
+ namco_51xx_device &n51xx(NAMCO_51XX(config, "51xx", MASTER_CLOCK/8/2)); /* 1.536 MHz */
+ n51xx.set_screen_tag(m_screen);
+ n51xx.input_callback<1>().set_ioport("IN0").rshift(4);
MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/8/64)
MCFG_NAMCO_06XX_MAINCPU("maincpu")
@@ -1017,16 +1016,16 @@ MACHINE_CONFIG_START(polepos_state::topracern)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, scanline, "screen", 0, 1)
- MCFG_DEVICE_ADD(m_latch, LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(CLEARLINE(m_maincpu, 0)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, polepos_state, iosel_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_namco_sound, namco_device, sound_enable_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("polepos", polepos_sound_device, clson_w))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, polepos_state, gasel_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE(m_subcpu, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE(m_subcpu2, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, polepos_state, sb0_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, polepos_state, chacl_w))
+ LS259(config, m_latch);
+ m_latch->q_out_cb<0>().set_inputline(m_maincpu, 0, CLEAR_LINE).invert();
+ m_latch->q_out_cb<1>().set(FUNC(polepos_state::iosel_w));
+ m_latch->q_out_cb<2>().set(m_namco_sound, FUNC(namco_device::sound_enable_w));
+ m_latch->q_out_cb<2>().set("polepos", FUNC(polepos_sound_device::clson_w));
+ m_latch->q_out_cb<3>().set(FUNC(polepos_state::gasel_w));
+ m_latch->q_out_cb<4>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert();
+ m_latch->q_out_cb<5>().set_inputline(m_subcpu2, INPUT_LINE_RESET).invert();
+ m_latch->q_out_cb<6>().set(FUNC(polepos_state::sb0_w));
+ m_latch->q_out_cb<7>().set(FUNC(polepos_state::chacl_w));
/* video hardware */
MCFG_SCREEN_ADD(m_screen, RASTER)
@@ -1063,21 +1062,22 @@ MACHINE_CONFIG_START(polepos_state::topracern)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(polepos_state::polepos2bi)
+void polepos_state::polepos2bi(machine_config &config)
+{
topracern(config);
- MCFG_DEVICE_ADD(m_sound_z80, Z80, MASTER_CLOCK/8) /*? MHz */
- MCFG_DEVICE_PROGRAM_MAP(sound_z80_bootleg_map)
- MCFG_DEVICE_IO_MAP(sound_z80_bootleg_iomap)
+ Z80(config, m_sound_z80, MASTER_CLOCK/8); /*? MHz */
+ m_sound_z80->set_addrmap(AS_PROGRAM, &polepos_state::sound_z80_bootleg_map);
+ m_sound_z80->set_addrmap(AS_IO, &polepos_state::sound_z80_bootleg_iomap);
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_sound_z80, INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_sound_z80, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
- MCFG_DEVICE_ADD("tms", TMS5220, 600000) /* ? Mhz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
-MACHINE_CONFIG_END
+ TMS5220(config, "tms", 600000) /* ? Mhz */
+ .add_route(ALL_OUTPUTS, "lspeaker", 0.80)
+ .add_route(ALL_OUTPUTS, "rspeaker", 0.80);
+}
diff --git a/src/mame/drivers/polgar.cpp b/src/mame/drivers/polgar.cpp
index c0686570977..a935b2a50a8 100644
--- a/src/mame/drivers/polgar.cpp
+++ b/src/mame/drivers/polgar.cpp
@@ -515,14 +515,14 @@ MACHINE_CONFIG_START(mephisto_risc_state::mrisc)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("outlatch", HC259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led100"))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led101"))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led102"))
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led103"))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led104"))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led105"))
- MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(MEMBANK("rombank")) MCFG_DEVCB_MASK(0xc0) MCFG_DEVCB_XOR(0x40) MCFG_DEVCB_RSHIFT(-6)
+ hc259_device &outlatch(HC259(config, "outlatch"));
+ outlatch.q_out_cb<0>().set_output("led100");
+ outlatch.q_out_cb<1>().set_output("led101");
+ outlatch.q_out_cb<2>().set_output("led102");
+ outlatch.q_out_cb<3>().set_output("led103");
+ outlatch.q_out_cb<4>().set_output("led104");
+ outlatch.q_out_cb<5>().set_output("led105");
+ outlatch.parallel_out_cb().set_membank("rombank").rshift(6).mask(0x03).exor(0x01);
MCFG_RAM_ADD("ram")
MCFG_RAM_DEFAULT_SIZE("1M")
@@ -548,9 +548,9 @@ MACHINE_CONFIG_START(mephisto_academy_state::academy)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(academy_mem)
- MCFG_DEVICE_REPLACE("outlatch", HC259, 0)
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mephisto_academy_state, academy_nmi_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("display:beeper", beep_device, set_state)) MCFG_DEVCB_INVERT
+ hc259_device &outlatch(HC259(config.replace(), "outlatch"));
+ outlatch.q_out_cb<1>().set(FUNC(mephisto_academy_state::academy_nmi_w));
+ outlatch.q_out_cb<2>().set("display:beeper", FUNC(beep_device::set_state)).invert();
MCFG_DEFAULT_LAYOUT(layout_mephisto_academy)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/policetr.cpp b/src/mame/drivers/policetr.cpp
index e8520cb5b89..5d97a50ed9e 100644
--- a/src/mame/drivers/policetr.cpp
+++ b/src/mame/drivers/policetr.cpp
@@ -404,13 +404,13 @@ MACHINE_CONFIG_START(policetr_state::policetr)
EEPROM_SERIAL_93C66_16BIT(config, m_eeprom);
/* video hardware */
- device = &SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
m_screen->set_refresh_hz(60);
m_screen->set_size(400, 262); /* needs to be verified */
m_screen->set_visarea(0, 393, 0, 239);
m_screen->set_palette(m_palette);
- MCFG_SCREEN_UPDATE_DRIVER(policetr_state, screen_update_policetr);
+ m_screen->set_screen_update(FUNC(policetr_state::screen_update_policetr));
PALETTE(config, m_palette, 256);
@@ -424,10 +424,11 @@ MACHINE_CONFIG_START(policetr_state::policetr)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(policetr_state::sshooter)
+void policetr_state::sshooter(machine_config &config)
+{
policetr(config);
m_maincpu->set_addrmap(AS_PROGRAM, &policetr_state::sshooter_map);
-MACHINE_CONFIG_END
+}
diff --git a/src/mame/drivers/poly.cpp b/src/mame/drivers/poly.cpp
index 0154f503671..0ab407676f1 100644
--- a/src/mame/drivers/poly.cpp
+++ b/src/mame/drivers/poly.cpp
@@ -344,13 +344,12 @@ MACHINE_CONFIG_START(poly_state::poly)
//MCFG_ACIA6850_RTS_HANDLER(WRITELINE("rs232", rs232_port_device, write_rts))
MCFG_ACIA6850_IRQ_HANDLER(WRITELINE("irqs", input_merger_device, in_w<6>))
- MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia", acia6850_device, write_rxc))
+ CLOCK(config, m_acia_clock, 153600);
+ m_acia_clock->signal_handler().set(m_acia, FUNC(acia6850_device::write_txc));
+ m_acia_clock->signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc));
/* software lists */
- MCFG_SOFTWARE_LIST_ADD("flop_list", "poly_flop")
- MCFG_SOFTWARE_LIST_FILTER("flop_list", "POLY1")
+ SOFTWARE_LIST(config, "flop_list").set_original("poly_flop").set_filter("POLY1");
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/prof80.cpp b/src/mame/drivers/prof80.cpp
index 4ff164c48b3..2ecc7001fbc 100644
--- a/src/mame/drivers/prof80.cpp
+++ b/src/mame/drivers/prof80.cpp
@@ -470,25 +470,25 @@ MACHINE_CONFIG_START(prof80_state::prof80)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":3", prof80_floppies, nullptr, floppy_image_device::default_floppy_formats)
// DEMUX latches
- MCFG_DEVICE_ADD(m_flra, LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, data_in_w)) // TDI
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(UPD1990A_TAG, upd1990a_device, c0_w)) // C0
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, c1_w)) // C1
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, c2_w)) // C2
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, prof80_state, ready_w)) // READY
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, clk_w)) // TCK
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, prof80_state, inuse_w)) // IN USE
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, prof80_state, motor_w)) // _MOTOR
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, prof80_state, select_w)) // SELECT
- MCFG_DEVICE_ADD(m_flrb, LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, prof80_state, resf_w)) // RESF
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, prof80_state, mini_w)) // MINI
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_rs232a, rs232_port_device, write_rts)) // _RTS
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(m_rs232a, rs232_port_device, write_txd)) // TX
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, prof80_state, mstop_w)) // _MSTOP
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(m_rs232b, rs232_port_device, write_txd)) // TXP
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, stb_w)) // TSTB
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(m_mmu, prof80_mmu_device, mme_w)) // MME
+ LS259(config, m_flra);
+ m_flra->q_out_cb<0>().set(UPD1990A_TAG, FUNC(upd1990a_device::data_in_w)); // TDI
+ m_flra->q_out_cb<0>().append(UPD1990A_TAG, FUNC(upd1990a_device::c0_w)); // C0
+ m_flra->q_out_cb<1>().set(UPD1990A_TAG, FUNC(upd1990a_device::c1_w)); // C1
+ m_flra->q_out_cb<2>().set(UPD1990A_TAG, FUNC(upd1990a_device::c2_w)); // C2
+ m_flra->q_out_cb<3>().set(FUNC(prof80_state::ready_w)); // READY
+ m_flra->q_out_cb<4>().set(UPD1990A_TAG, FUNC(upd1990a_device::clk_w)); // TCK
+ m_flra->q_out_cb<5>().set(FUNC(prof80_state::inuse_w)); // IN USE
+ m_flra->q_out_cb<6>().set(FUNC(prof80_state::motor_w)); // _MOTOR
+ m_flra->q_out_cb<7>().set(FUNC(prof80_state::select_w)); // SELECT
+ LS259(config, m_flrb);
+ m_flrb->q_out_cb<0>().set(FUNC(prof80_state::resf_w)); // RESF
+ m_flrb->q_out_cb<1>().set(FUNC(prof80_state::mini_w)); // MINI
+ m_flrb->q_out_cb<2>().set(m_rs232a, FUNC(rs232_port_device::write_rts)); // _RTS
+ m_flrb->q_out_cb<3>().set(m_rs232a, FUNC(rs232_port_device::write_txd)); // TX
+ m_flrb->q_out_cb<4>().set(FUNC(prof80_state::mstop_w)); // _MSTOP
+ m_flrb->q_out_cb<5>().set(m_rs232b, FUNC(rs232_port_device::write_txd)); // TXP
+ m_flrb->q_out_cb<6>().set(UPD1990A_TAG, FUNC(upd1990a_device::stb_w)); // TSTB
+ m_flrb->q_out_cb<7>().set(m_mmu, FUNC(prof80_mmu_device::mme_w)); // MME
// ECB bus
MCFG_ECBBUS_ADD()
@@ -499,8 +499,8 @@ MACHINE_CONFIG_START(prof80_state::prof80)
MCFG_ECBBUS_SLOT_ADD(5, "ecb_5", ecbbus_cards, nullptr)
// V24
- MCFG_DEVICE_ADD(m_rs232a, RS232_PORT, default_rs232_devices, nullptr)
- MCFG_DEVICE_ADD(m_rs232b, RS232_PORT, default_rs232_devices, nullptr)
+ RS232_PORT(config, m_rs232a, default_rs232_devices, nullptr);
+ RS232_PORT(config, m_rs232b, default_rs232_devices, nullptr);
// internal ram
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mame/drivers/proteus.cpp b/src/mame/drivers/proteus.cpp
index a40f94a5cb5..766e41ff829 100644
--- a/src/mame/drivers/proteus.cpp
+++ b/src/mame/drivers/proteus.cpp
@@ -329,9 +329,9 @@ MACHINE_CONFIG_START(proteus_state::proteus)
MCFG_DEVICE_PROGRAM_MAP(proteus_z80_mem)
MCFG_DEVICE_IO_MAP(proteus_z80_io)
- MCFG_INPUT_MERGER_ANY_HIGH("irqs")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("z80", INPUT_LINE_IRQ0))
+ INPUT_MERGER_ANY_HIGH(config, m_irqs);
+ m_irqs->output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE);
+ m_irqs->output_handler().append_inputline(m_z80, INPUT_LINE_IRQ0);
/* fdc */
MCFG_DEVICE_ADD("fdc", FD1771, 4_MHz_XTAL / 2)
@@ -380,9 +380,9 @@ MACHINE_CONFIG_START(proteus_state::proteus)
MCFG_RS232_RXD_HANDLER(WRITELINE("acia0", acia6850_device, write_rxd))
MCFG_RS232_CTS_HANDLER(WRITELINE("acia0", acia6850_device, write_cts))
- MCFG_DEVICE_ADD("acia0_clock", CLOCK, 4_MHz_XTAL / 2 / 13) // TODO: this is set using jumpers
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia0", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia0", acia6850_device, write_rxc))
+ clock_device &acia0_clock(CLOCK(config, "acia0_clock", 4_MHz_XTAL / 2 / 13)); // TODO: this is set using jumpers
+ acia0_clock.signal_handler().set(m_acia[0], FUNC(acia6850_device::write_txc));
+ acia0_clock.signal_handler().append(m_acia[0], FUNC(acia6850_device::write_rxc));
/* printer port */
MCFG_DEVICE_ADD("acia1", ACIA6850, 0)
@@ -394,9 +394,9 @@ MACHINE_CONFIG_START(proteus_state::proteus)
MCFG_RS232_RXD_HANDLER(WRITELINE("acia1", acia6850_device, write_rxd))
MCFG_RS232_CTS_HANDLER(WRITELINE("acia1", acia6850_device, write_cts))
- MCFG_DEVICE_ADD("acia1_clock", CLOCK, 4_MHz_XTAL / 2 / 13) // TODO: this is set using jumpers J2
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia1", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia1", acia6850_device, write_rxc))
+ clock_device &acia1_clock(CLOCK(config, "acia1_clock", 4_MHz_XTAL / 2 / 13)); // TODO: this is set using jumpers J2
+ acia1_clock.signal_handler().set(m_acia[1], FUNC(acia6850_device::write_txc));
+ acia1_clock.signal_handler().append(m_acia[1], FUNC(acia6850_device::write_rxc));
/* modem port */
MCFG_DEVICE_ADD("acia2", ACIA6850, 0)
@@ -408,9 +408,9 @@ MACHINE_CONFIG_START(proteus_state::proteus)
MCFG_RS232_RXD_HANDLER(WRITELINE("acia2", acia6850_device, write_rxd))
MCFG_RS232_CTS_HANDLER(WRITELINE("acia2", acia6850_device, write_cts))
- MCFG_DEVICE_ADD("acia2_clock", CLOCK, 4_MHz_XTAL / 2 / 13) // TODO: this is set using jumpers J1
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia2", acia6850_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("acia2", acia6850_device, write_rxc))
+ clock_device &acia2_clock(CLOCK(config, "acia2_clock", 4_MHz_XTAL / 2 / 13)); // TODO: this is set using jumpers J1
+ acia2_clock.signal_handler().set(m_acia[2], FUNC(acia6850_device::write_txc));
+ acia2_clock.signal_handler().append(m_acia[2], FUNC(acia6850_device::write_rxc));
/* software lists */
MCFG_SOFTWARE_LIST_ADD("flop_list", "poly_flop")
diff --git a/src/mame/drivers/pulsar.cpp b/src/mame/drivers/pulsar.cpp
index 844858f4ddd..0f0f425da38 100644
--- a/src/mame/drivers/pulsar.cpp
+++ b/src/mame/drivers/pulsar.cpp
@@ -234,12 +234,12 @@ MACHINE_CONFIG_START(pulsar_state::pulsar)
MCFG_RS232_CTS_HANDLER(WRITELINE("dart", z80dart_device, ctsa_w))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", terminal)
- MCFG_DEVICE_ADD("brg", COM8116, 5.0688_MHz_XTAL)
+ com8116_device &brg(COM8116(config, "brg", 5.0688_MHz_XTAL));
// Schematic has the labels for FT and FR the wrong way around, but the pin numbers are correct.
- MCFG_COM8116_FR_HANDLER(WRITELINE("dart", z80dart_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart", z80dart_device, rxca_w))
- MCFG_COM8116_FT_HANDLER(WRITELINE("dart", z80dart_device, txcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("dart", z80dart_device, rxcb_w))
+ brg.fr_handler().set("dart", FUNC(z80dart_device::txca_w));
+ brg.fr_handler().append("dart", FUNC(z80dart_device::rxca_w));
+ brg.ft_handler().set("dart", FUNC(z80dart_device::txcb_w));
+ brg.ft_handler().append("dart", FUNC(z80dart_device::rxcb_w));
MCFG_DEVICE_ADD("fdc", FD1797, 4_MHz_XTAL / 2)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pulsar_floppies, "525hd", floppy_image_device::default_floppy_formats)
diff --git a/src/mame/drivers/punchout.cpp b/src/mame/drivers/punchout.cpp
index 9fd885c9c83..4242cd10c15 100644
--- a/src/mame/drivers/punchout.cpp
+++ b/src/mame/drivers/punchout.cpp
@@ -649,15 +649,15 @@ MACHINE_CONFIG_START(punchout_state::punchout)
MCFG_PALETTE_ADD("palette", 0x200)
MCFG_DEFAULT_LAYOUT(layout_dualhovu)
- MCFG_SCREEN_ADD("top", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(punchout_state, screen_update_punchout_top)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, punchout_state, vblank_irq))
- MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ screen_device &top(SCREEN(config, "top", SCREEN_TYPE_RASTER));
+ top.set_refresh_hz(60);
+ top.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ top.set_size(32*8, 32*8);
+ top.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ top.set_screen_update(FUNC(punchout_state::screen_update_punchout_top));
+ top.set_palette(m_palette);
+ top.screen_vblank().set(FUNC(punchout_state::vblank_irq));
+ top.screen_vblank().append_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_SCREEN_ADD("bottom", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/pve500.cpp b/src/mame/drivers/pve500.cpp
index 3376205f388..2342cf415d1 100644
--- a/src/mame/drivers/pve500.cpp
+++ b/src/mame/drivers/pve500.cpp
@@ -362,14 +362,14 @@ WRITE8_MEMBER(pve500_state::io_sel_w)
MACHINE_CONFIG_START(pve500_state::pve500)
/* Main CPU */
- MCFG_DEVICE_ADD("maincpu", TMPZ84C015, 12_MHz_XTAL / 2) /* TMPZ84C015BF-6 */
- MCFG_DEVICE_PROGRAM_MAP(maincpu_prg)
- MCFG_DEVICE_IO_MAP(maincpu_io)
- MCFG_Z80_DAISY_CHAIN(maincpu_daisy_chain)
- MCFG_TMPZ84C015_OUT_DTRA_CB(WRITELINE(*this, pve500_state, GPI_w))
- MCFG_TMPZ84C015_OUT_DTRB_CB(WRITELINE("buzzer", beep_device, set_state)) MCFG_DEVCB_INVERT
- MCFG_TMPZ84C015_OUT_TXDA_CB(WRITELINE("recorder", rs232_port_device, write_txd))
- MCFG_TMPZ84C015_OUT_TXDB_CB(WRITELINE("player1", rs232_port_device, write_txd))
+ TMPZ84C015(config, m_maincpu, 12_MHz_XTAL / 2); // TMPZ84C015BF-6
+ m_maincpu->set_addrmap(AS_PROGRAM, &pve500_state::maincpu_prg);
+ m_maincpu->set_addrmap(AS_IO, &pve500_state::maincpu_io);
+ m_maincpu->set_daisy_config(maincpu_daisy_chain);
+ m_maincpu->out_dtra_callback().set(FUNC(pve500_state::GPI_w));
+ m_maincpu->out_dtrb_callback().set(m_buzzer, FUNC(beep_device::set_state)).invert();
+ m_maincpu->out_txda_callback().set("recorder", FUNC(rs232_port_device::write_txd));
+ m_maincpu->out_txdb_callback().set("player1", FUNC(rs232_port_device::write_txd));
MCFG_DEVICE_ADD("external_ctc", Z80CTC, 12_MHz_XTAL / 2)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
@@ -429,15 +429,15 @@ MACHINE_CONFIG_START(pve500_state::pve500)
MCFG_DEVICE_ADD("serial_mixer", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("subcpu", tmpz84c015_device, rxb_w))
- MCFG_DEVICE_ADD("clk1", CLOCK, 12_MHz_XTAL / 20)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("maincpu", tmpz84c015_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("maincpu", tmpz84c015_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("maincpu", tmpz84c015_device, rxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("maincpu", tmpz84c015_device, txcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("subcpu", tmpz84c015_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("subcpu", tmpz84c015_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("subcpu", tmpz84c015_device, rxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("subcpu", tmpz84c015_device, txcb_w))
+ clock_device &clk1(CLOCK(config, "clk1", 12_MHz_XTAL / 20));
+ clk1.signal_handler().set(m_maincpu, FUNC(tmpz84c015_device::rxca_w));
+ clk1.signal_handler().append(m_maincpu, FUNC(tmpz84c015_device::txca_w));
+ clk1.signal_handler().append(m_maincpu, FUNC(tmpz84c015_device::rxcb_w));
+ clk1.signal_handler().append(m_maincpu, FUNC(tmpz84c015_device::txcb_w));
+ clk1.signal_handler().append(m_subcpu, FUNC(tmpz84c015_device::rxca_w));
+ clk1.signal_handler().append(m_subcpu, FUNC(tmpz84c015_device::txca_w));
+ clk1.signal_handler().append(m_subcpu, FUNC(tmpz84c015_device::rxcb_w));
+ clk1.signal_handler().append(m_subcpu, FUNC(tmpz84c015_device::txcb_w));
/* ICF5: 2kbytes of RAM shared between the two CPUs (dual-port RAM)*/
MCFG_DEVICE_ADD("mb8421", MB8421, 0)
diff --git a/src/mame/drivers/qtsbc.cpp b/src/mame/drivers/qtsbc.cpp
index 75109e511b2..4a937b3bebb 100644
--- a/src/mame/drivers/qtsbc.cpp
+++ b/src/mame/drivers/qtsbc.cpp
@@ -486,12 +486,12 @@ MACHINE_CONFIG_START(qtsbc_state::qtsbc)
MCFG_DEVICE_IO_MAP(io_map)
/* video hardware */
- MCFG_DEVICE_ADD("pit", PIT8253, 0) // U9
- MCFG_PIT8253_CLK0(4_MHz_XTAL / 2) /* Timer 0: baud rate gen for 8251 */
- MCFG_PIT8253_OUT0_HANDLER(WRITELINE("usart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("usart", i8251_device, write_rxc))
- MCFG_PIT8253_CLK1(4_MHz_XTAL / 2)
- MCFG_PIT8253_OUT1_HANDLER(WRITELINE("pit", pit8253_device, write_clk2))
+ PIT8253(config, m_pit, 0); // U9
+ m_pit->set_clk<0>(4_MHz_XTAL / 2); /* Timer 0: baud rate gen for 8251 */
+ m_pit->out_handler<0>().set(m_usart, FUNC(i8251_device::write_txc));
+ m_pit->out_handler<0>().append(m_usart, FUNC(i8251_device::write_rxc));
+ m_pit->set_clk<1>(4_MHz_XTAL / 2);
+ m_pit->out_handler<1>().set(m_pit, FUNC(pit8253_device::write_clk2));
MCFG_DEVICE_ADD("usart", I8251, 0) // U8
MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/qvt6800.cpp b/src/mame/drivers/qvt6800.cpp
index d78330beb51..3c44d039870 100644
--- a/src/mame/drivers/qvt6800.cpp
+++ b/src/mame/drivers/qvt6800.cpp
@@ -83,9 +83,9 @@ MACHINE_CONFIG_START(qvt6800_state::qvt102)
MCFG_Z80CTC_ZC0_CB(WRITELINE("acia", acia6850_device, write_txc))
MCFG_Z80CTC_ZC1_CB(WRITELINE("acia", acia6850_device, write_rxc))
- MCFG_DEVICE_ADD("ctcclk", CLOCK, XTAL(16'669'800) / 18) // OR of CRTC CLK and ϕ1
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc", z80ctc_device, trg0))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc", z80ctc_device, trg1))
+ clock_device &ctcclk(CLOCK(config, "ctcclk", 16.6698_MHz_XTAL / 18)); // OR of CRTC CLK and ϕ1
+ ctcclk.signal_handler().set("ctc", FUNC(z80ctc_device::trg0));
+ ctcclk.signal_handler().append("ctc", FUNC(z80ctc_device::trg1));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL(16'669'800), 882, 0, 720, 315, 0, 300)
diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp
index 29fd95593bb..5e4513a552b 100644
--- a/src/mame/drivers/qx10.cpp
+++ b/src/mame/drivers/qx10.cpp
@@ -769,12 +769,12 @@ MACHINE_CONFIG_START(qx10_state::qx10)
MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, qx10_state, get_slave_ack))
MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_master", pic8259_device, ir7_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("upd7201", UPD7201, MAIN_CLK/4) // channel b clock set by pit2 channel 2
// Channel A: Keyboard
@@ -809,9 +809,9 @@ MACHINE_CONFIG_START(qx10_state::qx10)
MCFG_DEVICE_ADD("rtc", MC146818, 32.768_kHz_XTAL)
MCFG_MC146818_IRQ_HANDLER(WRITELINE("pic8259_slave", pic8259_device, ir2_w))
- MCFG_UPD765A_ADD("upd765", true, true)
- MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(*this, qx10_state, qx10_upd765_interrupt))
- MCFG_UPD765_DRQ_CALLBACK(WRITELINE("8237dma_1", am9517a_device, dreq0_w)) MCFG_DEVCB_INVERT
+ UPD765A(config, m_fdc, true, true);
+ m_fdc->intrq_wr_callback().set(FUNC(qx10_state::qx10_upd765_interrupt));
+ m_fdc->drq_wr_callback().set(m_dma_1, FUNC(am9517a_device::dreq0_w)).invert();
MCFG_FLOPPY_DRIVE_ADD("upd765:0", qx10_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", qx10_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mame/drivers/raiden.cpp b/src/mame/drivers/raiden.cpp
index a421a5b928b..11b317ddbc2 100644
--- a/src/mame/drivers/raiden.cpp
+++ b/src/mame/drivers/raiden.cpp
@@ -350,17 +350,17 @@ MACHINE_CONFIG_START(raiden_state::raiden)
MCFG_QUANTUM_TIME(attotime::from_hz(12000))
/* video hardware */
- MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16)
-
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(59.60) /* verified on pcb */
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(raiden_state, screen_update_raiden)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram16_device, vblank_copy_rising))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(*this, raiden_state, vblank_irq))
- MCFG_SCREEN_PALETTE("palette")
+ BUFFERED_SPRITERAM16(config, m_spriteram);
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(59.60); // verified on pcb */
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(raiden_state::screen_update_raiden));
+ screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram16_device::vblank_copy_rising));
+ screen.screen_vblank().append(FUNC(raiden_state::vblank_irq));
+ screen.set_palette(m_palette);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_raiden)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp
index 369e453094d..c3c87549a8f 100644
--- a/src/mame/drivers/rainbow.cpp
+++ b/src/mame/drivers/rainbow.cpp
@@ -3286,10 +3286,10 @@ MACHINE_CONFIG_START(rainbow_state::rainbow)
MCFG_WD2010_IN_WF_CB(READLINE(*this, rainbow_state, hdc_write_fault)) // WRITE FAULT (set to GND if not serviced)
MCFG_WD2010_IN_DRDY_CB(READLINE(*this, rainbow_state, hdc_drive_ready)) // DRIVE_READY (set to VCC if not serviced)
- MCFG_WD2010_IN_SC_CB(VCC) // SEEK COMPLETE (set to VCC if not serviced)
+ MCFG_WD2010_IN_SC_CB(CONSTANT(1)) // SEEK COMPLETE (set to VCC if not serviced)
- MCFG_WD2010_IN_TK000_CB(VCC) // CURRENTLY NOT EVALUATED WITHIN 'WD2010'
- MCFG_WD2010_IN_INDEX_CB(VCC) // "
+ MCFG_WD2010_IN_TK000_CB(CONSTANT(1)) // CURRENTLY NOT EVALUATED WITHIN 'WD2010'
+ MCFG_WD2010_IN_INDEX_CB(CONSTANT(1)) // "
MCFG_HARDDISK_ADD("decharddisk1")
/// ******************************** / HARD DISK CONTROLLER ****************************************
diff --git a/src/mame/drivers/rc702.cpp b/src/mame/drivers/rc702.cpp
index 1c4b2143bb0..83aab9020f4 100644
--- a/src/mame/drivers/rc702.cpp
+++ b/src/mame/drivers/rc702.cpp
@@ -340,14 +340,13 @@ MACHINE_CONFIG_START(rc702_state::rc702)
MCFG_MACHINE_RESET_OVERRIDE(rc702_state, rc702)
- MCFG_DEVICE_ADD("ctc_clock", CLOCK, 614000)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, rc702_state, clock_w))
+ CLOCK(config, "ctc_clock", 614000).signal_handler().set(FUNC(rc702_state::clock_w));
- MCFG_DEVICE_ADD("ctc1", Z80CTC, XTAL(8'000'000) / 2)
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio1", z80dart_device, txca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1", z80dart_device, rxca_w))
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio1", z80dart_device, rxtxcb_w))
- MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ Z80CTC(config, m_ctc1, 8_MHz_XTAL / 2);
+ m_ctc1->zc_callback<0>().set("sio1", FUNC(z80dart_device::txca_w));
+ m_ctc1->zc_callback<0>().append("sio1", FUNC(z80dart_device::rxca_w));
+ m_ctc1->zc_callback<1>().set("sio1", FUNC(z80dart_device::rxtxcb_w));
+ m_ctc1->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD("sio1", Z80DART, XTAL(8'000'000) / 2)
MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
@@ -388,12 +387,12 @@ MACHINE_CONFIG_START(rc702_state::rc702)
MCFG_SCREEN_VISIBLE_AREA(0, 272*2-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", i8275_device, screen_update)
- MCFG_DEVICE_ADD("crtc", I8275, 11640000/7)
- MCFG_I8275_CHARACTER_WIDTH(7)
- MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(rc702_state, display_pixels)
- MCFG_I8275_IRQ_CALLBACK(WRITELINE("7474", ttl7474_device, clear_w)) MCFG_DEVCB_INVERT
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc1", z80ctc_device, trg2))
- MCFG_I8275_DRQ_CALLBACK(WRITELINE(*this, rc702_state, crtc_drq_w))
+ i8275_device &crtc(I8275(config, "crtc", 11640000/7));
+ crtc.set_character_width(7);
+ crtc.set_display_callback(FUNC(rc702_state::display_pixels), this);
+ crtc.irq_wr_callback().set(m_7474, FUNC(ttl7474_device::clear_w)).invert();
+ crtc.irq_wr_callback().append(m_ctc1, FUNC(z80ctc_device::trg2));
+ crtc.drq_wr_callback().set(FUNC(rc702_state::crtc_drq_w));
MCFG_PALETTE_ADD("palette", 2)
/* sound hardware */
diff --git a/src/mame/drivers/retofinv.cpp b/src/mame/drivers/retofinv.cpp
index 0259a6940b6..3ff3ca9652b 100644
--- a/src/mame/drivers/retofinv.cpp
+++ b/src/mame/drivers/retofinv.cpp
@@ -432,13 +432,13 @@ MACHINE_CONFIG_START(retofinv_state::retofinv)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - enough for the sound CPU to read all commands */
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC72 - probably shared between CPUs
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, retofinv_state, irq0_ack_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, retofinv_state, coinlockout_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(INPUTLINE("audiocpu", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("68705", taito68705_mcu_device, reset_w)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, retofinv_state, irq1_ack_w))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ ls259_device &mainlatch(LS259(config, "mainlatch")); // IC72 - probably shared between CPUs
+ mainlatch.q_out_cb<0>().set(FUNC(retofinv_state::irq0_ack_w));
+ mainlatch.q_out_cb<1>().set(FUNC(retofinv_state::coinlockout_w));
+ mainlatch.q_out_cb<2>().set_inputline(m_audiocpu, INPUT_LINE_RESET).invert();
+ mainlatch.q_out_cb<3>().set(m_68705, FUNC(taito68705_mcu_device::reset_w)).invert();
+ mainlatch.q_out_cb<4>().set(FUNC(retofinv_state::irq1_ack_w));
+ mainlatch.q_out_cb<5>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert();
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/rmnimbus.cpp b/src/mame/drivers/rmnimbus.cpp
index e745ae96a5c..262f3799d3c 100644
--- a/src/mame/drivers/rmnimbus.cpp
+++ b/src/mame/drivers/rmnimbus.cpp
@@ -188,8 +188,8 @@ MACHINE_CONFIG_START(rmnimbus_state::nimbus)
MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_centronics, centronics_device, write_strobe))
MCFG_VIA6522_IRQ_HANDLER(WRITELINE(m_maincpu, i80186_cpu_device, int3_w))
- MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
- MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(VIA_TAG, via6522_device, write_ca1)) MCFG_DEVCB_INVERT
+ CENTRONICS(config, m_centronics, centronics_devices, "printer");
+ m_centronics->ack_handler().set(m_via, FUNC(via6522_device::write_ca1)).invert();
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp
index 87704621b15..4a99049c2f1 100644
--- a/src/mame/drivers/rohga.cpp
+++ b/src/mame/drivers/rohga.cpp
@@ -938,11 +938,11 @@ MACHINE_CONFIG_START(rohga_state::rohga)
MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
- MCFG_DECO104_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
- MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0))
+ DECO104PROT(config, m_ioprot, 0);
+ m_ioprot->port_a_cb().set_ioport("INPUTS");
+ m_ioprot->port_b_cb().set_ioport("SYSTEM");
+ m_ioprot->port_c_cb().set_ioport("DSW");
+ m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
@@ -1030,12 +1030,12 @@ MACHINE_CONFIG_START(rohga_state::wizdfire)
MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
- MCFG_DECO104_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
- MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0))
- MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
+ DECO104PROT(config, m_ioprot, 0);
+ m_ioprot->port_a_cb().set_ioport("INPUTS");
+ m_ioprot->port_b_cb().set_ioport("SYSTEM");
+ m_ioprot->port_c_cb().set_ioport("DSW");
+ m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0);
+ m_ioprot->set_interface_scramble_reverse();
MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
@@ -1219,11 +1219,11 @@ MACHINE_CONFIG_START(rohga_state::schmeisr)
MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
- MCFG_DECO104_ADD("ioprot")
- MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
- MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
- MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
- MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0))
+ DECO104PROT(config, m_ioprot, 0);
+ m_ioprot->port_a_cb().set_ioport("INPUTS");
+ m_ioprot->port_b_cb().set_ioport("SYSTEM");
+ m_ioprot->port_c_cb().set_ioport("DSW");
+ m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp
index bfdd6aa8d60..839f16fef12 100644
--- a/src/mame/drivers/royalmah.cpp
+++ b/src/mame/drivers/royalmah.cpp
@@ -3662,13 +3662,12 @@ MACHINE_CONFIG_START(royalmah_state::janptr96)
MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, royalmah_state, janptr96_dswsel_w))
// internal CTC channels 0 & 1 have falling edge triggers
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) MCFG_DEVCB_INVERT
+ screen_device &screen(*subdevice<screen_device>("screen"));
+ screen.set_visarea(0, 255, 8, 255-8);
+ screen.screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert();
/* devices */
- MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768))
- MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, trg1)) MCFG_DEVCB_INVERT
+ MSM6242(config, m_rtc, 32.768_kHz_XTAL).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)).invert();
MACHINE_CONFIG_END
@@ -3722,8 +3721,7 @@ MACHINE_CONFIG_START(royalmah_state::mjtensin)
MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
/* devices */
- MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768))
- MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_IRQ1))
+ MSM6242(config, m_rtc, 32.768_kHz_XTAL).out_int_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ1);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(royalmah_state::cafetime)
@@ -3738,8 +3736,7 @@ MACHINE_CONFIG_START(royalmah_state::cafetime)
MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
/* devices */
- MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768))
- MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_IRQ1))
+ MSM6242(config, m_rtc, 32.768_kHz_XTAL).out_int_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ1);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(royalmah_state::mjvegasa)
@@ -3755,8 +3752,7 @@ MACHINE_CONFIG_START(royalmah_state::mjvegasa)
MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
/* devices */
- MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768))
- MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_IRQ1))
+ MSM6242(config, m_rtc, 32.768_kHz_XTAL).out_int_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ1);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/runaway.cpp b/src/mame/drivers/runaway.cpp
index 023d33fcb6d..90f42152651 100644
--- a/src/mame/drivers/runaway.cpp
+++ b/src/mame/drivers/runaway.cpp
@@ -351,14 +351,14 @@ MACHINE_CONFIG_START(runaway_state::runaway)
MCFG_DEVICE_ADD("maincpu", M6502, 12096000 / 8) /* ? */
MCFG_DEVICE_PROGRAM_MAP(runaway_map)
- MCFG_DEVICE_ADD("mainlatch", LS259)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // coin counter?
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // coin counter?
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, runaway_state, tile_bank_w))
-
- MCFG_DEVICE_ADD("earom", ER2055)
+ ls259_device &mainlatch(LS259(config, "mainlatch"));
+ mainlatch.q_out_cb<0>().set_nop(); // coin counter?
+ mainlatch.q_out_cb<1>().set_nop(); // coin counter?
+ mainlatch.q_out_cb<3>().set_output("led0").invert();
+ mainlatch.q_out_cb<4>().set_output("led1").invert();
+ mainlatch.q_out_cb<5>().set(FUNC(runaway_state::tile_bank_w));
+
+ ER2055(config, m_earom);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/s7.cpp b/src/mame/drivers/s7.cpp
index c9b50fb2603..d88b3f32cc3 100644
--- a/src/mame/drivers/s7.cpp
+++ b/src/mame/drivers/s7.cpp
@@ -505,15 +505,15 @@ MACHINE_CONFIG_START(s7_state::s7)
MCFG_DEVICE_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 1.00)
- MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPB_HANDLER(READ8(*this, s7_state, sound_r))
- MCFG_PIA_WRITEPA_HANDLER(WRITE8("dac", dac_byte_interface, data_w))
- MCFG_PIA_WRITEPB_HANDLER(NOOP)
- MCFG_PIA_READCA1_HANDLER(VCC)
- MCFG_PIA_CA2_HANDLER(WRITELINE("hc55516", hc55516_device, digit_w))
- MCFG_PIA_CB2_HANDLER(WRITELINE("hc55516", hc55516_device, clock_w))
- MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
- MCFG_PIA_IRQB_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
+ PIA6821(config, m_pias, 0);
+ m_pias->readpb_handler().set(FUNC(s7_state::sound_r));
+ m_pias->writepa_handler().set("dac", FUNC(dac_byte_interface::data_w));
+ m_pias->writepb_handler().set_nop();
+ m_pias->readca1_handler().set_constant(1);
+ m_pias->ca2_handler().set(m_hc55516, FUNC(hc55516_device::digit_w));
+ m_pias->cb2_handler().set(m_hc55516, FUNC(hc55516_device::clock_w));
+ m_pias->irqa_handler().set_inputline(m_audiocpu, M6808_IRQ_LINE); // FIXME: needs an input merger
+ m_pias->irqb_handler().set_inputline(m_audiocpu, M6808_IRQ_LINE);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/sbrain.cpp b/src/mame/drivers/sbrain.cpp
index 986fa8f2207..f7b6abc302b 100644
--- a/src/mame/drivers/sbrain.cpp
+++ b/src/mame/drivers/sbrain.cpp
@@ -573,15 +573,15 @@ MACHINE_CONFIG_START(sbrain_state::sbrain)
MCFG_I8255_IN_PORTC_CB(READ8(*this, sbrain_state, ppi_pc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, sbrain_state, ppi_pc_w))
- MCFG_DEVICE_ADD("uart0", I8251, 0)
+ I8251(config, m_u0, 0);
- MCFG_DEVICE_ADD("uart1", I8251, 0)
+ I8251(config, m_u1, 0);
- MCFG_DEVICE_ADD("brg", COM8116, 5.0688_MHz_XTAL) // BR1941L
- MCFG_COM8116_FR_HANDLER(WRITELINE("uart0", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart0", i8251_device, write_rxc))
- MCFG_COM8116_FT_HANDLER(WRITELINE("uart1", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart1", i8251_device, write_rxc))
+ com8116_device &brg(COM8116(config, "brg", 5.0688_MHz_XTAL)); // BR1941L
+ brg.fr_handler().set(m_u0, FUNC(i8251_device::write_txc));
+ brg.fr_handler().append(m_u0, FUNC(i8251_device::write_rxc));
+ brg.ft_handler().set(m_u1, FUNC(i8251_device::write_txc));
+ brg.ft_handler().append(m_u1, FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD("fdc", FD1791, 16_MHz_XTAL / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", sbrain_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mame/drivers/sbrkout.cpp b/src/mame/drivers/sbrkout.cpp
index 19fd78c9e7c..a4f68428d88 100644
--- a/src/mame/drivers/sbrkout.cpp
+++ b/src/mame/drivers/sbrkout.cpp
@@ -559,16 +559,16 @@ GFXDECODE_END
MACHINE_CONFIG_START(sbrkout_state::sbrkout)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502,MAIN_CLOCK/16) /* 375 KHz? Should be 750KHz? */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
-
- MCFG_DEVICE_ADD("outlatch", F9334, 0) // H8
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // SERV LED (active low)
- MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("lamp0")) // LAMP1
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("lamp1")) // LAMP2
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, sbrkout_state, pot_mask1_w))
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, sbrkout_state, pot_mask2_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, sbrkout_state, coincount_w))
+ M6502(config, m_maincpu, MAIN_CLOCK/16); // 375 KHz? Should be 750KHz?
+ m_maincpu->set_addrmap(AS_PROGRAM, &sbrkout_state::main_map);
+
+ F9334(config, m_outlatch); // H8
+ m_outlatch->q_out_cb<1>().set_output("led0").invert(); // SERV LED (active low)
+ m_outlatch->q_out_cb<3>().set_output("lamp0"); // LAMP1
+ m_outlatch->q_out_cb<4>().set_output("lamp1"); // LAMP2
+ m_outlatch->q_out_cb<5>().set(FUNC(sbrkout_state::pot_mask1_w));
+ m_outlatch->q_out_cb<6>().set(FUNC(sbrkout_state::pot_mask2_w));
+ m_outlatch->q_out_cb<7>().set(FUNC(sbrkout_state::coincount_w));
// Note that connecting pin 15 to a pullup, as shown on the schematics, may result in spurious
// coin counter activity as stated in Atari bulletin B-0054 (which recommends tying it to the
// CPU reset line instead).
@@ -594,12 +594,12 @@ MACHINE_CONFIG_START(sbrkout_state::sbrkout)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(sbrkoutct_state::sbrkoutct)
+void sbrkoutct_state::sbrkoutct(machine_config &config)
+{
sbrkout(config);
- MCFG_DEVICE_MODIFY("outlatch")
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // 2nd serve LED
-MACHINE_CONFIG_END
+ subdevice<f9334_device>("outlatch")->q_out_cb<2>().set_output("led1").invert(); // 2nd serve LED
+}
/*************************************
*
diff --git a/src/mame/drivers/scopus.cpp b/src/mame/drivers/scopus.cpp
index 7d30e10fa9c..762ad4368e7 100644
--- a/src/mame/drivers/scopus.cpp
+++ b/src/mame/drivers/scopus.cpp
@@ -197,9 +197,9 @@ MACHINE_CONFIG_START(sagitta180_state::sagitta180)
MCFG_RS232_CTS_HANDLER(WRITELINE("uart", i8251_device, write_cts))
MCFG_RS232_DSR_HANDLER(WRITELINE("uart", i8251_device, write_dsr))
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 19218) // 19218 / 19222 ? guesses...
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
+ clock_device &uart_clock(CLOCK(config, "uart_clock", 19218)); // 19218 / 19222 ? guesses...
+ uart_clock.signal_handler().set("uart", FUNC(i8251_device::write_txc));
+ uart_clock.signal_handler().append("uart", FUNC(i8251_device::write_rxc));
// MCFG_DEVICE_ADD("intlatch", I8212, 0)
// MCFG_I8212_MD_CALLBACK(GND) // guessed !
diff --git a/src/mame/drivers/sdk85.cpp b/src/mame/drivers/sdk85.cpp
index 346b8c5ee74..43ef2643343 100644
--- a/src/mame/drivers/sdk85.cpp
+++ b/src/mame/drivers/sdk85.cpp
@@ -167,13 +167,13 @@ MACHINE_CONFIG_START(sdk85_state::sdk85)
MCFG_DEFAULT_LAYOUT(layout_sdk85)
/* Devices */
- MCFG_DEVICE_ADD("kdc", I8279, 6.144_MHz_XTAL / 2) // Keyboard/Display Controller (A13)
+ MCFG_DEVICE_ADD("kdc", I8279, 6.144_MHz_XTAL / 2) // Keyboard/Display Controller (A13)
MCFG_I8279_OUT_IRQ_CB(INPUTLINE("maincpu", I8085_RST55_LINE)) // irq
- MCFG_I8279_OUT_SL_CB(WRITE8(*this, sdk85_state, scanlines_w)) // scan SL lines
- MCFG_I8279_OUT_DISP_CB(WRITE8(*this, sdk85_state, digit_w)) // display A&B
- MCFG_I8279_IN_RL_CB(READ8(*this, sdk85_state, kbd_r)) // kbd RL lines
- MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key
- MCFG_I8279_IN_CTRL_CB(VCC)
+ MCFG_I8279_OUT_SL_CB(WRITE8(*this, sdk85_state, scanlines_w)) // scan SL lines
+ MCFG_I8279_OUT_DISP_CB(WRITE8(*this, sdk85_state, digit_w)) // display A&B
+ MCFG_I8279_IN_RL_CB(READ8(*this, sdk85_state, kbd_r)) // kbd RL lines
+ MCFG_I8279_IN_SHIFT_CB(CONSTANT(1)) // Shift key
+ MCFG_I8279_IN_CTRL_CB(CONSTANT(1))
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/sdk86.cpp b/src/mame/drivers/sdk86.cpp
index f43f0932ad5..fba2a060f41 100644
--- a/src/mame/drivers/sdk86.cpp
+++ b/src/mame/drivers/sdk86.cpp
@@ -166,16 +166,16 @@ MACHINE_CONFIG_START(sdk86_state::sdk86)
MCFG_RS232_DSR_HANDLER(WRITELINE(I8251_TAG, i8251_device, write_dsr))
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", terminal)
- MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL(14'745'600)/3/16)
- MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(I8251_TAG, i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(I8251_TAG, i8251_device, write_rxc))
+ clock_device &usart_clock(CLOCK(config, "usart_clock", XTAL(14'745'600)/3/16));
+ usart_clock.signal_handler().set(I8251_TAG, FUNC(i8251_device::write_txc));
+ usart_clock.signal_handler().append(I8251_TAG, FUNC(i8251_device::write_rxc));
MCFG_DEVICE_ADD("i8279", I8279, 2500000) // based on divider
MCFG_I8279_OUT_SL_CB(WRITE8(*this, sdk86_state, scanlines_w)) // scan SL lines
MCFG_I8279_OUT_DISP_CB(WRITE8(*this, sdk86_state, digit_w)) // display A&B
MCFG_I8279_IN_RL_CB(READ8(*this, sdk86_state, kbd_r)) // kbd RL lines
- MCFG_I8279_IN_SHIFT_CB(GND) // Shift key
- MCFG_I8279_IN_CTRL_CB(GND)
+ MCFG_I8279_IN_SHIFT_CB(CONSTANT(0)) // Shift key
+ MCFG_I8279_IN_CTRL_CB(CONSTANT(0))
MCFG_DEVICE_ADD("port1", I8255A, 0)
MCFG_DEVICE_ADD("port2", I8255A, 0)
diff --git a/src/mame/drivers/seattle.cpp b/src/mame/drivers/seattle.cpp
index 37abdb7a0e4..27ac8f4f7be 100644
--- a/src/mame/drivers/seattle.cpp
+++ b/src/mame/drivers/seattle.cpp
@@ -1905,9 +1905,9 @@ MACHINE_CONFIG_START(seattle_state::seattle_common)
MCFG_GT64XXX_SET_CS(3, seattle_state::seattle_cs3_map)
MCFG_GT64XX_SET_SIMM0(0x00800000)
- MCFG_DEVICE_ADD(PCI_ID_IDE, IDE_PCI, 0, 0x100b0002, 0x01, 0x0)
- MCFG_IDE_PCI_IRQ_HANDLER(INPUTLINE(m_maincpu, IDE_IRQ_NUM))
- MCFG_IDE_PCI_SET_LEGACY_TOP(0x0a0)
+ ide_pci_device &ide(IDE_PCI(config, PCI_ID_IDE, 0, 0x100b0002, 0x01, 0x0));
+ ide.irq_handler().set_inputline(m_maincpu, IDE_IRQ_NUM);
+ ide.set_legacy_top(0x0a0);
MCFG_DEVICE_ADD(PCI_ID_VIDEO, VOODOO_1_PCI, 0, m_maincpu, m_screen)
MCFG_VOODOO_PCI_FBMEM(2)
diff --git a/src/mame/drivers/seattlecmp.cpp b/src/mame/drivers/seattlecmp.cpp
index 4cd8cc944fa..dc68997df5b 100644
--- a/src/mame/drivers/seattlecmp.cpp
+++ b/src/mame/drivers/seattlecmp.cpp
@@ -111,20 +111,20 @@ MACHINE_CONFIG_START(seattle_comp_state::seattle)
MCFG_DEVICE_IO_MAP(io_map)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("pic1", pic8259_device, inta_cb)
- MCFG_DEVICE_ADD("pic1", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_INT0))
- MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, seattle_comp_state, pic_slave_ack))
-
- MCFG_DEVICE_ADD("pic2", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic1", pic8259_device, ir1_w))
-
- MCFG_DEVICE_ADD("stc", AM9513, XTAL(4'000'000)) // dedicated XTAL
- MCFG_AM9513_OUT2_CALLBACK(WRITELINE("pic2", pic8259_device, ir0_w))
- MCFG_AM9513_OUT3_CALLBACK(WRITELINE("pic2", pic8259_device, ir4_w))
- MCFG_AM9513_OUT4_CALLBACK(WRITELINE("pic2", pic8259_device, ir7_w))
- MCFG_AM9513_OUT5_CALLBACK(WRITELINE("uart", i8251_device, write_txc))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("uart", i8251_device, write_rxc))
- MCFG_AM9513_FOUT_CALLBACK(WRITELINE("stc", am9513_device, source1_w))
+ PIC8259(config, m_pic[0], 0);
+ m_pic[0]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_INT0);
+ m_pic[0]->read_slave_ack_callback().set(FUNC(seattle_comp_state::pic_slave_ack));
+
+ PIC8259(config, m_pic[1], 0);
+ m_pic[1]->out_int_callback().set(m_pic[0], FUNC(pic8259_device::ir1_w));
+
+ am9513_device &stc(AM9513(config, "stc", 4_MHz_XTAL)); // dedicated XTAL
+ stc.out2_cb().set(m_pic[1], FUNC(pic8259_device::ir0_w));
+ stc.out3_cb().set(m_pic[1], FUNC(pic8259_device::ir4_w));
+ stc.out4_cb().set(m_pic[1], FUNC(pic8259_device::ir7_w));
+ stc.out5_cb().set("uart", FUNC(i8251_device::write_txc));
+ stc.out5_cb().append("uart", FUNC(i8251_device::write_rxc));
+ stc.fout_cb().set("stc", FUNC(am9513_device::source1_w));
// FOUT not shown on schematics, which inexplicably have Source 1 tied to Gate 5
MCFG_DEVICE_ADD("uart", I8251, XTAL(24'000'000) / 12) // CLOCK on line 49
diff --git a/src/mame/drivers/segac2.cpp b/src/mame/drivers/segac2.cpp
index 4f1298afce1..8bbea1998d8 100644
--- a/src/mame/drivers/segac2.cpp
+++ b/src/mame/drivers/segac2.cpp
@@ -1553,15 +1553,15 @@ MACHINE_CONFIG_START(segac2_state::segac)
MCFG_MACHINE_RESET_OVERRIDE(segac2_state,segac2)
MCFG_NVRAM_ADD_1FILL("nvram") // borencha requires 0xff fill or there is no sound (it lacks some of the init code of the borench set)
- MCFG_DEVICE_ADD("io", SEGA_315_5296, XL2_CLOCK/6) // clock divider guessed
- MCFG_315_5296_IN_PORTA_CB(IOPORT("P1"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("P2"))
- MCFG_315_5296_IN_PORTC_CB(READ8(*this, segac2_state, io_portc_r))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segac2_state, io_portd_w))
- MCFG_315_5296_IN_PORTE_CB(IOPORT("SERVICE"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("COINAGE"))
- MCFG_315_5296_IN_PORTG_CB(IOPORT("DSW"))
- MCFG_315_5296_OUT_PORTH_CB(WRITE8(*this, segac2_state, io_porth_w))
+ sega_315_5296_device &io(SEGA_315_5296(config, "io", XL2_CLOCK/6)); // clock divider guessed
+ io.in_pa_callback().set_ioport("P1");
+ io.in_pb_callback().set_ioport("P2");
+ io.in_pc_callback().set(FUNC(segac2_state::io_portc_r));
+ io.out_pd_callback().set(FUNC(segac2_state::io_portd_w));
+ io.in_pe_callback().set_ioport("SERVICE");
+ io.in_pf_callback().set_ioport("COINAGE");
+ io.in_pg_callback().set_ioport("DSW");
+ io.out_ph_callback().set(FUNC(segac2_state::io_porth_w));
/* video hardware */
MCFG_DEVICE_ADD("gen_vdp", SEGA315_5313, XL2_CLOCK, "maincpu")
@@ -1596,17 +1596,16 @@ MACHINE_CONFIG_START(segac2_state::segac)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(segac2_state::segac2)
+void segac2_state::segac2(machine_config &config)
+{
segac(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("io")
- MCFG_315_5296_OUT_CNT1_CB(WRITELINE("upd", upd7759_device, reset_w))
+ subdevice<sega_315_5296_device>("io")->out_cnt1_callback().set(m_upd7759, FUNC(upd7759_device::reset_w));
/* sound hardware */
- MCFG_DEVICE_ADD("upd", UPD7759, XL1_CLOCK)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
+ UPD7759(config, m_upd7759, XL1_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.50);
+}
diff --git a/src/mame/drivers/segae.cpp b/src/mame/drivers/segae.cpp
index e596a7a71bb..e589974dd6d 100644
--- a/src/mame/drivers/segae.cpp
+++ b/src/mame/drivers/segae.cpp
@@ -932,13 +932,13 @@ MACHINE_CONFIG_START(systeme_state::ridleofp)
MCFG_UPD4701_PORTX("PAD1")
MCFG_UPD4701_PORTY("PAD2")
- MCFG_DEVICE_MODIFY("ppi")
- MCFG_I8255_IN_PORTA_CB(READ8("upd4701", upd4701_device, d_r))
- MCFG_I8255_OUT_PORTC_CB(WRITELINE("upd4701", upd4701_device, cs_w)) MCFG_DEVCB_BIT(4)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("upd4701", upd4701_device, xy_w)) MCFG_DEVCB_BIT(3)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("upd4701", upd4701_device, ul_w)) MCFG_DEVCB_BIT(2)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("upd4701", upd4701_device, resetx_w)) MCFG_DEVCB_BIT(1) // or possibly bit 0
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("upd4701", upd4701_device, resety_w)) MCFG_DEVCB_BIT(0) // or possibly bit 1
+ i8255_device &ppi(*subdevice<i8255_device>("ppi"));
+ ppi.in_pa_callback().set("upd4701", FUNC(upd4701_device::d_r));
+ ppi.out_pc_callback().set("upd4701", FUNC(upd4701_device::cs_w)).bit(4);
+ ppi.out_pc_callback().append("upd4701", FUNC(upd4701_device::xy_w)).bit(3);
+ ppi.out_pc_callback().append("upd4701", FUNC(upd4701_device::ul_w)).bit(2);
+ ppi.out_pc_callback().append("upd4701", FUNC(upd4701_device::resetx_w)).bit(1); // or possibly bit 0
+ ppi.out_pc_callback().append("upd4701", FUNC(upd4701_device::resety_w)).bit(0); // or possibly bit 1
MACHINE_CONFIG_END
MACHINE_CONFIG_START(systeme_state::systemex)
diff --git a/src/mame/drivers/segajw.cpp b/src/mame/drivers/segajw.cpp
index 93d49389d33..75910127bf2 100644
--- a/src/mame/drivers/segajw.cpp
+++ b/src/mame/drivers/segajw.cpp
@@ -384,19 +384,19 @@ MACHINE_CONFIG_START(segajw_state::segajw)
MCFG_NVRAM_ADD_NO_FILL("nvram")
- MCFG_DEVICE_ADD("io1a", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_OUT_PORTA_CB(WRITE8(*this, segajw_state, coin_counter_w))
- MCFG_315_5296_OUT_PORTB_CB(WRITE8(*this, segajw_state, lamps1_w))
- MCFG_315_5296_OUT_PORTC_CB(WRITE8(*this, segajw_state, lamps2_w))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segajw_state, hopper_w))
- MCFG_315_5296_IN_PORTF_CB(READ8(*this, segajw_state, coin_counter_r))
-
- MCFG_DEVICE_ADD("io1c", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_315_5296_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_315_5296_IN_PORTD_CB(IOPORT("IN3"))
- MCFG_315_5296_OUT_PORTG_CB(WRITE8(*this, segajw_state, coinlockout_w))
+ sega_315_5296_device &io1a(SEGA_315_5296(config, "io1a", 0)); // unknown clock
+ io1a.out_pa_callback().set(FUNC(segajw_state::coin_counter_w));
+ io1a.out_pb_callback().set(FUNC(segajw_state::lamps1_w));
+ io1a.out_pc_callback().set(FUNC(segajw_state::lamps2_w));
+ io1a.out_pd_callback().set(FUNC(segajw_state::hopper_w));
+ io1a.in_pf_callback().set(FUNC(segajw_state::coin_counter_r));
+
+ sega_315_5296_device &io1c(SEGA_315_5296(config, "io1c", 0)); // unknown clock
+ io1c.in_pa_callback().set_ioport("IN0");
+ io1c.in_pb_callback().set_ioport("IN1");
+ io1c.in_pc_callback().set_ioport("IN2");
+ io1c.in_pd_callback().set_ioport("IN3");
+ io1c.out_pg_callback().set(FUNC(segajw_state::coinlockout_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/segam1.cpp b/src/mame/drivers/segam1.cpp
index 958f6e4a4f3..0d8faf3d455 100644
--- a/src/mame/drivers/segam1.cpp
+++ b/src/mame/drivers/segam1.cpp
@@ -362,16 +362,16 @@ MACHINE_CONFIG_START(segam1_state::segam1)
MCFG_DEVICE_ADD("m1comm", Z80, 4000000) // unknown clock
MCFG_DEVICE_PROGRAM_MAP(segam1_comms_map)
- MCFG_DEVICE_ADD("io1", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_IN_PORTA_CB(IOPORT("INA"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("INB"))
- MCFG_315_5296_IN_PORTC_CB(IOPORT("INC"))
- MCFG_315_5296_IN_PORTD_CB(IOPORT("IND"))
- MCFG_315_5296_IN_PORTE_CB(IOPORT("INE"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("INF"))
-
- MCFG_DEVICE_ADD("io2", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_IN_PORTG_CB(IOPORT("ING"))
+ sega_315_5296_device &io1(SEGA_315_5296(config, "io1", 0)); // unknown clock
+ io1.in_pa_callback().set_ioport("INA");
+ io1.in_pb_callback().set_ioport("INB");
+ io1.in_pc_callback().set_ioport("INC");
+ io1.in_pd_callback().set_ioport("IND");
+ io1.in_pe_callback().set_ioport("INE");
+ io1.in_pf_callback().set_ioport("INF");
+
+ sega_315_5296_device &io2(SEGA_315_5296(config, "io2", 0)); // unknown clock
+ io2.in_pg_callback().set_ioport("ING");
MCFG_DEVICE_ADD("uart", I8251, 4000000) // unknown clock
diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp
index 0bd7a81e63d..495e4db3d62 100644
--- a/src/mame/drivers/segas16a.cpp
+++ b/src/mame/drivers/segas16a.cpp
@@ -1975,7 +1975,7 @@ MACHINE_CONFIG_START(segas16a_state::system16a)
MCFG_DEVICE_ADD("n7751", N7751, 6000000)
MCFG_MCS48_PORT_BUS_IN_CB(READ8(*this, segas16a_state, n7751_rom_r))
- MCFG_MCS48_PORT_T1_IN_CB(GND) // labelled as "TEST", connected to ground
+ MCFG_MCS48_PORT_T1_IN_CB(CONSTANT(0)) // labelled as "TEST", connected to ground
MCFG_MCS48_PORT_P1_OUT_CB(WRITE8("dac", dac_byte_interface, data_w))
MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, segas16a_state, n7751_p2_r))
MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, segas16a_state, n7751_p2_w))
diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp
index 4a6087927ff..3fc4f25d355 100644
--- a/src/mame/drivers/segas16b.cpp
+++ b/src/mame/drivers/segas16b.cpp
@@ -3813,11 +3813,12 @@ MACHINE_CONFIG_END
// same as the above, but with custom Sega ICs
-MACHINE_CONFIG_START(segas16b_state::rom_5797_fragment)
- MCFG_SEGA_315_5248_MULTIPLIER_ADD("multiplier")
- MCFG_SEGA_315_5250_COMPARE_TIMER_ADD("cmptimer_1")
- MCFG_SEGA_315_5250_COMPARE_TIMER_ADD("cmptimer_2")
-MACHINE_CONFIG_END
+void segas16b_state::rom_5797_fragment(machine_config &config)
+{
+ SEGA_315_5248_MULTIPLIER(config, m_multiplier, 0);
+ SEGA_315_5250_COMPARE_TIMER(config, m_cmptimer_1, 0);
+ SEGA_315_5250_COMPARE_TIMER(config, m_cmptimer_2, 0);
+}
MACHINE_CONFIG_START(segas16b_state::system16b_5797)
system16b(config);
diff --git a/src/mame/drivers/segas18.cpp b/src/mame/drivers/segas18.cpp
index c775aad6cc6..e87bba96026 100644
--- a/src/mame/drivers/segas18.cpp
+++ b/src/mame/drivers/segas18.cpp
@@ -1325,17 +1325,17 @@ MACHINE_CONFIG_START(segas18_state::system18)
MCFG_SEGA_315_5195_MAPPER_HANDLER(segas18_state, memory_mapper)
MCFG_SEGA_315_5195_PBF_CALLBACK(INPUTLINE("soundcpu", INPUT_LINE_NMI))
- MCFG_DEVICE_ADD("io", SEGA_315_5296, 16000000)
- MCFG_315_5296_IN_PORTA_CB(IOPORT("P1"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("P2"))
- MCFG_315_5296_IN_PORTC_CB(IOPORT("P3"))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segas18_state, misc_outputs_w))
- MCFG_315_5296_IN_PORTE_CB(IOPORT("SERVICE"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("COINAGE"))
- MCFG_315_5296_IN_PORTG_CB(IOPORT("DSW"))
- MCFG_315_5296_OUT_PORTH_CB(WRITE8(*this, segas18_state, rom_5874_bank_w))
- MCFG_315_5296_OUT_CNT1_CB(WRITELINE("segaic16vid", segaic16_video_device, set_display_enable))
- MCFG_315_5296_OUT_CNT2_CB(WRITELINE(*this, segas18_state, set_vdp_enable))
+ SEGA_315_5296(config, m_io, 16000000);
+ m_io->in_pa_callback().set_ioport("P1");
+ m_io->in_pb_callback().set_ioport("P2");
+ m_io->in_pc_callback().set_ioport("P3");
+ m_io->out_pd_callback().set(FUNC(segas18_state::misc_outputs_w));
+ m_io->in_pe_callback().set_ioport("SERVICE");
+ m_io->in_pf_callback().set_ioport("COINAGE");
+ m_io->in_pg_callback().set_ioport("DSW");
+ m_io->out_ph_callback().set(FUNC(segas18_state::rom_5874_bank_w));
+ m_io->out_cnt1_callback().set(m_segaic16vid, FUNC(segaic16_video_device::set_display_enable));
+ m_io->out_cnt2_callback().set(FUNC(segas18_state::set_vdp_enable));
MCFG_DEVICE_ADD("gen_vdp", SEGA315_5313, 15000000, "maincpu") // ??? Frequency is a complete guess
MCFG_SEGA315_5313_IS_PAL(false)
@@ -1389,21 +1389,21 @@ MACHINE_CONFIG_START(segas18_state::system18_fd1094)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas18_state, irq4_line_hold)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(segas18_state::lghost_fd1094)
+void segas18_state::lghost_fd1094(machine_config &config)
+{
system18_fd1094(config);
// basic machine hardware
- MCFG_DEVICE_MODIFY("io")
- MCFG_315_5296_OUT_PORTC_CB(WRITE8(*this, segas18_state, lghost_gun_recoil_w))
-MACHINE_CONFIG_END
+ m_io->out_pc_callback().set(FUNC(segas18_state::lghost_gun_recoil_w));
+}
-MACHINE_CONFIG_START(segas18_state::lghost)
+void segas18_state::lghost(machine_config &config)
+{
system18(config);
// basic machine hardware
- MCFG_DEVICE_MODIFY("io")
- MCFG_315_5296_OUT_PORTC_CB(WRITE8(*this, segas18_state, lghost_gun_recoil_w))
-MACHINE_CONFIG_END
+ m_io->out_pc_callback().set(FUNC(segas18_state::lghost_gun_recoil_w));
+}
MACHINE_CONFIG_START(segas18_state::wwally_fd1094)
system18_fd1094(config);
diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp
index 43c5e6e99e4..29a998b7728 100644
--- a/src/mame/drivers/segas24.cpp
+++ b/src/mame/drivers/segas24.cpp
@@ -1873,17 +1873,17 @@ MACHINE_CONFIG_START(segas24_state::system24)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("io", SEGA_315_5296, VIDEO_CLOCK/2)
- MCFG_315_5296_IN_PORTA_CB(IOPORT("P1"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("P2"))
- MCFG_315_5296_IN_PORTC_CB(IOPORT("P3"))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segas24_state, hotrod_lamps_w))
- MCFG_315_5296_IN_PORTE_CB(IOPORT("SERVICE"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("COINAGE"))
- MCFG_315_5296_IN_PORTG_CB(IOPORT("DSW"))
- MCFG_315_5296_OUT_PORTH_CB(WRITE8("dac", dac_byte_interface, data_w))
- MCFG_315_5296_OUT_CNT1_CB(WRITELINE(*this, segas24_state, cnt1))
- MCFG_315_5296_OUT_CNT2_CB(WRITELINE("ymsnd", ym2151_device, reset_w))
+ sega_315_5296_device &io(SEGA_315_5296(config, "io", VIDEO_CLOCK/2));
+ io.in_pa_callback().set_ioport("P1");
+ io.in_pb_callback().set_ioport("P2");
+ io.in_pc_callback().set_ioport("P3");
+ io.out_pd_callback().set(FUNC(segas24_state::hotrod_lamps_w));
+ io.in_pe_callback().set_ioport("SERVICE");
+ io.in_pf_callback().set_ioport("COINAGE");
+ io.in_pg_callback().set_ioport("DSW");
+ io.out_ph_callback().set("dac", FUNC(dac_byte_interface::data_w));
+ io.out_cnt1_callback().set(FUNC(segas24_state::cnt1));
+ io.out_cnt2_callback().set("ymsnd", FUNC(ym2151_device::reset_w));
MCFG_TIMER_DRIVER_ADD("irq_timer", segas24_state, irq_timer_cb)
MCFG_TIMER_DRIVER_ADD("irq_timer_clear", segas24_state, irq_timer_clear_cb)
@@ -1916,13 +1916,14 @@ MACHINE_CONFIG_START(segas24_state::system24)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(segas24_state::mahmajn)
+void segas24_state::mahmajn(machine_config &config)
+{
system24(config);
- MCFG_DEVICE_MODIFY("io")
- MCFG_315_5296_IN_PORTA_CB(READ8(*this, segas24_state, mahmajn_input_line_r))
- MCFG_315_5296_IN_PORTC_CB(READ8(*this, segas24_state, mahmajn_inputs_r))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segas24_state, mahmajn_mux_w))
-MACHINE_CONFIG_END
+ sega_315_5296_device &io(*subdevice<sega_315_5296_device>("io"));
+ io.in_pa_callback().set(FUNC(segas24_state::mahmajn_input_line_r));
+ io.in_pc_callback().set(FUNC(segas24_state::mahmajn_inputs_r));
+ io.out_pd_callback().set(FUNC(segas24_state::mahmajn_mux_w));
+}
MACHINE_CONFIG_START(segas24_state::system24_floppy)
system24(config);
@@ -1972,19 +1973,21 @@ MACHINE_CONFIG_START(segas24_state::system24_floppy_fd_upd)
MCFG_UPD4701_PORTY("DIAL2")
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(segas24_state::dcclub)
+void segas24_state::dcclub(machine_config &config)
+{
system24(config);
- MCFG_DEVICE_MODIFY("io")
- MCFG_315_5296_IN_PORTA_CB(READ8(*this, segas24_state, dcclub_p1_r))
- MCFG_315_5296_IN_PORTC_CB(READ8(*this, segas24_state, dcclub_p3_r))
-MACHINE_CONFIG_END
+ sega_315_5296_device &io(*subdevice<sega_315_5296_device>("io"));
+ io.in_pa_callback().set(FUNC(segas24_state::dcclub_p1_r));
+ io.in_pc_callback().set(FUNC(segas24_state::dcclub_p3_r));
+}
-MACHINE_CONFIG_START(segas24_state::system24_floppy_dcclub)
+void segas24_state::system24_floppy_dcclub(machine_config &config)
+{
system24_floppy_fd1094(config);
- MCFG_DEVICE_MODIFY("io")
- MCFG_315_5296_IN_PORTA_CB(READ8(*this, segas24_state, dcclub_p1_r))
- MCFG_315_5296_IN_PORTC_CB(READ8(*this, segas24_state, dcclub_p3_r))
-MACHINE_CONFIG_END
+ sega_315_5296_device &io(*subdevice<sega_315_5296_device>("io"));
+ io.in_pa_callback().set(FUNC(segas24_state::dcclub_p1_r));
+ io.in_pc_callback().set(FUNC(segas24_state::dcclub_p3_r));
+}
/*************************************
diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp
index 1ad0169693c..33f91ab8279 100644
--- a/src/mame/drivers/segas32.cpp
+++ b/src/mame/drivers/segas32.cpp
@@ -2207,26 +2207,26 @@ MACHINE_CONFIG_START(segas32_state::device_add_mconfig)
MCFG_DEVICE_PROGRAM_MAP(system32_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas32_state, start_of_vblank_int)
- MCFG_DEVICE_ADD("soundcpu", Z80, MASTER_CLOCK/4)
- MCFG_DEVICE_PROGRAM_MAP(system32_sound_map)
- MCFG_DEVICE_IO_MAP(system32_sound_portmap)
-
- MCFG_DEVICE_ADD("io_chip", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_IN_PORTA_CB(IOPORT("P1_A"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("P2_A"))
- MCFG_315_5296_IN_PORTC_CB(IOPORT("PORTC_A"))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segas32_state, misc_output_0_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(7)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(6)
- MCFG_315_5296_IN_PORTE_CB(IOPORT("SERVICE12_A"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("SERVICE34_A"))
- MCFG_315_5296_OUT_PORTG_CB(WRITE8(*this, segas32_state, sw2_output_0_w))
- MCFG_315_5296_OUT_PORTH_CB(WRITE8(*this, segas32_state, tilebank_external_w))
- MCFG_315_5296_OUT_CNT1_CB(WRITELINE(*this, segas32_state, display_enable_0_w))
- MCFG_315_5296_OUT_CNT2_CB(INPUTLINE("soundcpu", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
-
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
+ Z80(config, m_soundcpu, MASTER_CLOCK/4);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &segas32_state::system32_sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &segas32_state::system32_sound_portmap);
+
+ sega_315_5296_device &io_chip(SEGA_315_5296(config, "io_chip", 0)); // unknown clock
+ io_chip.in_pa_callback().set_ioport("P1_A");
+ io_chip.in_pb_callback().set_ioport("P2_A");
+ io_chip.in_pc_callback().set_ioport("PORTC_A");
+ io_chip.out_pd_callback().set(FUNC(segas32_state::misc_output_0_w));
+ io_chip.out_pd_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(7);
+ io_chip.out_pd_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(5);
+ io_chip.out_pd_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(6);
+ io_chip.in_pe_callback().set_ioport("SERVICE12_A");
+ io_chip.in_pf_callback().set_ioport("SERVICE34_A");
+ io_chip.out_pg_callback().set(FUNC(segas32_state::sw2_output_0_w));
+ io_chip.out_ph_callback().set(FUNC(segas32_state::tilebank_external_w));
+ io_chip.out_cnt1_callback().set(FUNC(segas32_state::display_enable_0_w));
+ io_chip.out_cnt2_callback().set_inputline(m_soundcpu, INPUT_LINE_RESET).invert();
+
+ EEPROM_SERIAL_93C46_16BIT(config, "eeprom");
MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback)
MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback)
@@ -2524,32 +2524,32 @@ MACHINE_CONFIG_START(sega_multi32_state::device_add_mconfig)
MCFG_DEVICE_PROGRAM_MAP(multi32_sound_map)
MCFG_DEVICE_IO_MAP(multi32_sound_portmap)
- MCFG_DEVICE_ADD("io_chip_0", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_IN_PORTA_CB(IOPORT("P1_A"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("P2_A"))
- MCFG_315_5296_IN_PORTC_CB(IOPORT("PORTC_A"))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segas32_state, misc_output_0_w))
- MCFG_315_5296_IN_PORTE_CB(IOPORT("SERVICE12_A"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("SERVICE34_A"))
- MCFG_315_5296_OUT_PORTG_CB(WRITE8(*this, segas32_state, sw2_output_0_w))
- MCFG_315_5296_OUT_PORTH_CB(WRITE8(*this, segas32_state, tilebank_external_w))
- MCFG_315_5296_OUT_CNT1_CB(WRITELINE(*this, segas32_state, display_enable_0_w))
- MCFG_315_5296_OUT_CNT2_CB(INPUTLINE("soundcpu", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
-
- MCFG_DEVICE_ADD("io_chip_1", SEGA_315_5296, 0) // unknown clock
- MCFG_315_5296_IN_PORTA_CB(IOPORT("P1_B"))
- MCFG_315_5296_IN_PORTB_CB(IOPORT("P2_B"))
- MCFG_315_5296_IN_PORTC_CB(IOPORT("PORTC_B"))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, segas32_state, misc_output_1_w))
- MCFG_315_5296_IN_PORTE_CB(IOPORT("SERVICE12_B"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("SERVICE34_B"))
- MCFG_315_5296_OUT_PORTG_CB(WRITE8(*this, segas32_state, sw2_output_1_w))
- MCFG_315_5296_OUT_PORTH_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(7)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(5)
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(6)
- MCFG_315_5296_OUT_CNT1_CB(WRITELINE(*this, segas32_state, display_enable_1_w))
-
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
+ sega_315_5296_device &io_chip_0(SEGA_315_5296(config, "io_chip_0", 0)); // unknown clock
+ io_chip_0.in_pa_callback().set_ioport("P1_A");
+ io_chip_0.in_pb_callback().set_ioport("P2_A");
+ io_chip_0.in_pc_callback().set_ioport("PORTC_A");
+ io_chip_0.out_pd_callback().set(FUNC(segas32_state::misc_output_0_w));
+ io_chip_0.in_pe_callback().set_ioport("SERVICE12_A");
+ io_chip_0.in_pf_callback().set_ioport("SERVICE34_A");
+ io_chip_0.out_pg_callback().set(FUNC(segas32_state::sw2_output_0_w));
+ io_chip_0.out_ph_callback().set(FUNC(segas32_state::tilebank_external_w));
+ io_chip_0.out_cnt1_callback().set(FUNC(segas32_state::display_enable_0_w));
+ io_chip_0.out_cnt2_callback().set_inputline(m_soundcpu, INPUT_LINE_RESET).invert();
+
+ sega_315_5296_device &io_chip_1(SEGA_315_5296(config, "io_chip_1", 0)); // unknown clock
+ io_chip_1.in_pa_callback().set_ioport("P1_B");
+ io_chip_1.in_pb_callback().set_ioport("P2_B");
+ io_chip_1.in_pc_callback().set_ioport("PORTC_B");
+ io_chip_1.out_pd_callback().set(FUNC(segas32_state::misc_output_1_w));
+ io_chip_1.in_pe_callback().set_ioport("SERVICE12_B");
+ io_chip_1.in_pf_callback().set_ioport("SERVICE34_B");
+ io_chip_1.out_pg_callback().set(FUNC(segas32_state::sw2_output_1_w));
+ io_chip_1.out_ph_callback().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(7);
+ io_chip_1.out_ph_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(5);
+ io_chip_1.out_ph_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(6);
+ io_chip_1.out_cnt1_callback().set(FUNC(segas32_state::display_enable_1_w));
+
+ EEPROM_SERIAL_93C46_16BIT(config, "eeprom");
MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback)
MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback)
diff --git a/src/mame/drivers/segaufo.cpp b/src/mame/drivers/segaufo.cpp
index 71107b00e43..5b3a66a9085 100644
--- a/src/mame/drivers/segaufo.cpp
+++ b/src/mame/drivers/segaufo.cpp
@@ -780,31 +780,31 @@ void ufo_state::machine_start()
MACHINE_CONFIG_START(ufo_state::newufo)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(16'000'000)/2)
- MCFG_DEVICE_PROGRAM_MAP(ufo_map)
- MCFG_DEVICE_IO_MAP(ufo_portmap)
+ Z80(config, m_maincpu, XTAL(16'000'000)/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ufo_state::ufo_map);
+ m_maincpu->set_addrmap(AS_IO, &ufo_state::ufo_portmap);
MCFG_TIMER_DRIVER_ADD_PERIODIC("motor_timer", ufo_state, simulate_xyz, attotime::from_hz(MOTOR_SPEED))
MCFG_TIMER_DRIVER_ADD_PERIODIC("update_timer", ufo_state, update_info, attotime::from_hz(60))
- MCFG_DEVICE_ADD("io1", SEGA_315_5296, XTAL(16'000'000))
+ SEGA_315_5296(config, m_io1, XTAL(16'000'000));
// all ports set to input
- MCFG_315_5296_IN_PORTA_CB(READ8(*this, ufo_state, crane_limits_r))
- MCFG_315_5296_IN_PORTB_CB(READ8(*this, ufo_state, crane_limits_r))
- MCFG_315_5296_IN_PORTE_CB(IOPORT("IN1"))
- MCFG_315_5296_IN_PORTF_CB(IOPORT("DSW1"))
- MCFG_315_5296_IN_PORTG_CB(IOPORT("DSW2"))
- MCFG_315_5296_IN_PORTH_CB(IOPORT("IN2"))
-
- MCFG_DEVICE_ADD("io2", SEGA_315_5296, XTAL(16'000'000))
+ m_io1->in_pa_callback().set(FUNC(ufo_state::crane_limits_r));
+ m_io1->in_pb_callback().set(FUNC(ufo_state::crane_limits_r));
+ m_io1->in_pe_callback().set_ioport("IN1");
+ m_io1->in_pf_callback().set_ioport("DSW1");
+ m_io1->in_pg_callback().set_ioport("DSW2");
+ m_io1->in_ph_callback().set_ioport("IN2");
+
+ SEGA_315_5296(config, m_io2, XTAL(16'000'000));
// all ports set to output
- MCFG_315_5296_OUT_PORTA_CB(WRITE8(*this, ufo_state, stepper_w))
- MCFG_315_5296_OUT_PORTB_CB(WRITE8(*this, ufo_state, cp_lamps_w))
- MCFG_315_5296_OUT_PORTC_CB(WRITE8(*this, ufo_state, cp_digits_w))
- MCFG_315_5296_OUT_PORTD_CB(WRITE8(*this, ufo_state, cp_digits_w))
- MCFG_315_5296_OUT_PORTE_CB(WRITE8(*this, ufo_state, crane_xyz_w))
- MCFG_315_5296_OUT_PORTF_CB(WRITE8(*this, ufo_state, crane_xyz_w))
- MCFG_315_5296_OUT_PORTG_CB(WRITE8(*this, ufo_state, ufo_lamps_w))
+ m_io2->out_pa_callback().set(FUNC(ufo_state::stepper_w));
+ m_io2->out_pb_callback().set(FUNC(ufo_state::cp_lamps_w));
+ m_io2->out_pc_callback().set(FUNC(ufo_state::cp_digits_w));
+ m_io2->out_pd_callback().set(FUNC(ufo_state::cp_digits_w));
+ m_io2->out_pe_callback().set(FUNC(ufo_state::crane_xyz_w));
+ m_io2->out_pf_callback().set(FUNC(ufo_state::crane_xyz_w));
+ m_io2->out_pg_callback().set(FUNC(ufo_state::ufo_lamps_w));
MCFG_DEVICE_ADD("pit", PIT8254, XTAL(16'000'000)/2) // uPD71054C, configuration is unknown
MCFG_PIT8253_CLK0(XTAL(16'000'000)/2/256)
@@ -825,69 +825,65 @@ MACHINE_CONFIG_START(ufo_state::newufo)
MCFG_SOUND_ROUTE(1, "mono", 0.40)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(ufo_state::ufomini)
+void ufo_state::ufomini(machine_config &config)
+{
newufo(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("io1")
- MCFG_315_5296_IN_PORTC_CB(IOPORT("IN1"))
- MCFG_315_5296_IN_PORTE_CB(NOOP)
- MCFG_315_5296_IN_PORTH_CB(NOOP)
-MACHINE_CONFIG_END
+ m_io1->in_pc_callback().set_ioport("IN1");
+ m_io1->in_pe_callback().set_constant(0);
+ m_io1->in_ph_callback().set_constant(0);
+}
-MACHINE_CONFIG_START(ufo_state::ufo21)
+void ufo_state::ufo21(machine_config &config)
+{
newufo(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_IO_MAP(ex_ufo21_portmap)
-
- MCFG_DEVICE_MODIFY("io1")
- MCFG_315_5296_IN_PORTA_CB(READ8(*this, ufo_state, ex_crane_limits_r))
- MCFG_315_5296_IN_PORTB_CB(READ8(*this, ufo_state, ex_crane_limits_r))
- MCFG_315_5296_IN_PORTC_CB(READ8(*this, ufo_state, ex_crane_open_r))
-
- MCFG_DEVICE_MODIFY("io2")
- MCFG_315_5296_OUT_PORTA_CB(WRITE8(*this, ufo_state, ex_stepper_w))
- MCFG_315_5296_OUT_PORTB_CB(WRITE8(*this, ufo_state, ex_cp_lamps_w))
- MCFG_315_5296_OUT_PORTE_CB(WRITE8(*this, ufo_state, ex_crane_xyz_w))
- MCFG_315_5296_OUT_PORTF_CB(WRITE8(*this, ufo_state, ex_crane_xyz_w))
- MCFG_315_5296_OUT_PORTG_CB(NOOP)
-
- MCFG_DEVICE_ADD("io3", SEGA_315_5338A, 0)
- MCFG_315_5338A_OUT_PA_CB(WRITE8(*this, ufo_state, ex_upd_start_w))
- MCFG_315_5338A_IN_PB_CB(READ8(*this, ufo_state, ex_upd_busy_r))
- MCFG_315_5338A_OUT_PE_CB(WRITE8(*this, ufo_state, ex_ufo21_lamps1_w))
- MCFG_315_5338A_OUT_PF_CB(WRITE8(*this, ufo_state, ex_ufo21_lamps2_w))
+ m_maincpu->set_addrmap(AS_IO, &ufo_state::ex_ufo21_portmap);
+
+ m_io1->in_pa_callback().set(FUNC(ufo_state::ex_crane_limits_r));
+ m_io1->in_pb_callback().set(FUNC(ufo_state::ex_crane_limits_r));
+ m_io1->in_pc_callback().set(FUNC(ufo_state::ex_crane_open_r));
+