summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-25 13:39:59 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-25 13:39:59 +0000
commit6c40f0f2920a208ff456d8f34f3684367ef3fd8a (patch) (github)
tree8f6a39a908e561191d898f9dafbcb9a74967d784
parentb29b84dd779070e753d8e5eff6f2f548e616ef6a (diff)
downloadmame-6c40f0f2920a208ff456d8f34f3684367ef3fd8a.tar.bz2
mame-6c40f0f2920a208ff456d8f34f3684367ef3fd8a.zip
TIMER_CALLBACK_DEVICE_MEMBER modernization part 1 (no whatsnew)
-rw-r--r--src/mame/audio/8080bw.c17
-rw-r--r--src/mame/audio/n8080.c24
-rw-r--r--src/mame/drivers/1942.c8
-rw-r--r--src/mame/drivers/8080bw.c9
-rw-r--r--src/mame/drivers/airbustr.c8
-rw-r--r--src/mame/drivers/argus.c18
-rw-r--r--src/mame/drivers/astrof.c7
-rw-r--r--src/mame/drivers/atarisy1.c17
-rw-r--r--src/mame/drivers/balsente.c8
-rw-r--r--src/mame/drivers/battlera.c2
-rw-r--r--src/mame/drivers/beathead.c15
-rw-r--r--src/mame/drivers/beezer.c2
-rw-r--r--src/mame/drivers/bionicc.c8
-rw-r--r--src/mame/drivers/bishi.c11
-rw-r--r--src/mame/drivers/bladestl.c11
-rw-r--r--src/mame/drivers/blockout.c9
-rw-r--r--src/mame/drivers/bsktball.c2
-rw-r--r--src/mame/drivers/btime.c9
-rw-r--r--src/mame/drivers/cave.c43
-rw-r--r--src/mame/drivers/centiped.c8
-rw-r--r--src/mame/drivers/changela.c8
-rw-r--r--src/mame/drivers/chqflag.c13
-rw-r--r--src/mame/drivers/circus.c6
-rw-r--r--src/mame/drivers/cischeat.c26
-rw-r--r--src/mame/drivers/cninja.c18
-rw-r--r--src/mame/drivers/coolpool.c19
-rw-r--r--src/mame/drivers/cosmic.c8
-rw-r--r--src/mame/drivers/dambustr.c2
-rw-r--r--src/mame/drivers/darkmist.c8
-rw-r--r--src/mame/drivers/dbz.c11
-rw-r--r--src/mame/drivers/ddragon.c17
-rw-r--r--src/mame/drivers/ddragon3.c13
-rw-r--r--src/mame/drivers/deadang.c16
-rw-r--r--src/mame/drivers/deco32.c23
-rw-r--r--src/mame/drivers/deco_mlc.c9
-rw-r--r--src/mame/drivers/decocass.c2
-rw-r--r--src/mame/drivers/djboy.c8
-rw-r--r--src/mame/drivers/dooyong.c12
-rw-r--r--src/mame/drivers/dragrace.c19
-rw-r--r--src/mame/drivers/dynax.c31
-rw-r--r--src/mame/drivers/equites.c16
-rw-r--r--src/mame/drivers/espial.c11
-rw-r--r--src/mame/drivers/exedexes.c8
-rw-r--r--src/mame/drivers/exterm.c9
-rw-r--r--src/mame/drivers/fastlane.c15
-rw-r--r--src/mame/drivers/finalizr.c13
-rw-r--r--src/mame/drivers/foodf.c8
-rw-r--r--src/mame/drivers/gaelco2.c2
-rw-r--r--src/mame/drivers/gaelco3d.c25
-rw-r--r--src/mame/drivers/galaxian.c8
-rw-r--r--src/mame/drivers/galaxold.c2
-rw-r--r--src/mame/drivers/galpani2.c24
-rw-r--r--src/mame/drivers/galpanic.c22
-rw-r--r--src/mame/drivers/gberet.c21
-rw-r--r--src/mame/drivers/gradius3.c13
-rw-r--r--src/mame/drivers/gundealr.c39
-rw-r--r--src/mame/drivers/hexion.c9
-rw-r--r--src/mame/drivers/higemaru.c8
-rw-r--r--src/mame/drivers/hng64.c13
-rw-r--r--src/mame/drivers/hyprduel.c19
-rw-r--r--src/mame/drivers/ikki.c9
-rw-r--r--src/mame/drivers/iqblock.c9
-rw-r--r--src/mame/drivers/irobot.c4
-rw-r--r--src/mame/drivers/ironhors.c26
-rw-r--r--src/mame/drivers/itech8.c2
-rw-r--r--src/mame/drivers/jpmimpct.c15
-rw-r--r--src/mame/drivers/kaneko16.c30
-rw-r--r--src/mame/drivers/konamigx.c13
-rw-r--r--src/mame/drivers/lastduel.c16
-rw-r--r--src/mame/drivers/lazercmd.c24
-rw-r--r--src/mame/drivers/m107.c19
-rw-r--r--src/mame/drivers/m92.c17
-rw-r--r--src/mame/drivers/mcr.c18
-rw-r--r--src/mame/drivers/mcr3.c2
-rw-r--r--src/mame/drivers/megasys1.c26
-rw-r--r--src/mame/drivers/mhavoc.c2
-rw-r--r--src/mame/drivers/mitchell.c15
-rw-r--r--src/mame/drivers/model1.c15
-rw-r--r--src/mame/drivers/model2.c91
-rw-r--r--src/mame/drivers/model3.c15
-rw-r--r--src/mame/drivers/mrflea.c9
-rw-r--r--src/mame/drivers/ms32.c10
-rw-r--r--src/mame/drivers/mw8080bw.c9
-rw-r--r--src/mame/drivers/mystwarr.c37
-rw-r--r--src/mame/drivers/n8080.c26
-rw-r--r--src/mame/drivers/namcofl.c24
-rw-r--r--src/mame/drivers/namcona1.c26
-rw-r--r--src/mame/drivers/namconb1.c12
-rw-r--r--src/mame/drivers/namcos22.c41
-rw-r--r--src/mame/drivers/nemesis.c36
-rw-r--r--src/mame/drivers/nitedrvr.c2
-rw-r--r--src/mame/drivers/nmk16.c52
-rw-r--r--src/mame/drivers/orbit.c9
-rw-r--r--src/mame/drivers/overdriv.c10
-rw-r--r--src/mame/drivers/pgm.c9
-rw-r--r--src/mame/drivers/pingpong.c18
-rw-r--r--src/mame/drivers/polepos.c17
-rw-r--r--src/mame/drivers/polyplay.c8
-rw-r--r--src/mame/drivers/psychic5.c10
-rw-r--r--src/mame/drivers/qdrmfgp.c13
-rw-r--r--src/mame/drivers/renegade.c9
-rw-r--r--src/mame/drivers/scobra.c4
-rw-r--r--src/mame/drivers/scramble.c4
-rw-r--r--src/mame/drivers/segahang.c2
-rw-r--r--src/mame/drivers/segas24.c87
-rw-r--r--src/mame/drivers/segas32.c12
-rw-r--r--src/mame/drivers/seta.c124
-rw-r--r--src/mame/drivers/seta2.c9
-rw-r--r--src/mame/drivers/shadfrce.c33
-rw-r--r--src/mame/drivers/shaolins.c9
-rw-r--r--src/mame/drivers/snk6502.c8
-rw-r--r--src/mame/drivers/snowbros.c32
-rw-r--r--src/mame/drivers/spdodgeb.c2
-rw-r--r--src/mame/drivers/sprcros2.c13
-rw-r--r--src/mame/drivers/sprint8.c17
-rw-r--r--src/mame/drivers/srumbler.c9
-rw-r--r--src/mame/drivers/ssv.c28
-rw-r--r--src/mame/drivers/st0016.c11
-rw-r--r--src/mame/drivers/strnskil.c9
-rw-r--r--src/mame/drivers/suna16.c11
-rw-r--r--src/mame/drivers/suna8.c20
-rw-r--r--src/mame/drivers/suprnova.c19
-rw-r--r--src/mame/drivers/system1.c12
-rw-r--r--src/mame/drivers/taito_l.c33
-rw-r--r--src/mame/drivers/taito_o.c9
-rw-r--r--src/mame/drivers/targeth.c11
-rw-r--r--src/mame/drivers/thedeep.c33
-rw-r--r--src/mame/drivers/vball.c15
-rw-r--r--src/mame/drivers/wecleman.c16
-rw-r--r--src/mame/drivers/williams.c8
-rw-r--r--src/mame/drivers/wwfsstar.c17
-rw-r--r--src/mame/drivers/wwfwfest.c12
-rw-r--r--src/mame/drivers/xain.c17
-rw-r--r--src/mame/drivers/xexex.c25
-rw-r--r--src/mame/drivers/xmen.c13
-rw-r--r--src/mame/drivers/zodiack.c11
-rw-r--r--src/mame/includes/1942.h1
-rw-r--r--src/mame/includes/8080bw.h4
-rw-r--r--src/mame/includes/airbustr.h1
-rw-r--r--src/mame/includes/argus.h2
-rw-r--r--src/mame/includes/astrof.h1
-rw-r--r--src/mame/includes/atarisy1.h11
-rw-r--r--src/mame/includes/balsente.h11
-rw-r--r--src/mame/includes/battlera.h4
-rw-r--r--src/mame/includes/beathead.h1
-rw-r--r--src/mame/includes/beezer.h4
-rw-r--r--src/mame/includes/bionicc.h1
-rw-r--r--src/mame/includes/bishi.h1
-rw-r--r--src/mame/includes/bladestl.h1
-rw-r--r--src/mame/includes/blockout.h1
-rw-r--r--src/mame/includes/bsktball.h5
-rw-r--r--src/mame/includes/btime.h1
-rw-r--r--src/mame/includes/cave.h1
-rw-r--r--src/mame/includes/centiped.h1
-rw-r--r--src/mame/includes/changela.h1
-rw-r--r--src/mame/includes/chqflag.h1
-rw-r--r--src/mame/includes/circus.h1
-rw-r--r--src/mame/includes/cischeat.h3
-rw-r--r--src/mame/includes/cninja.h1
-rw-r--r--src/mame/includes/coolpool.h2
-rw-r--r--src/mame/includes/cosmic.h1
-rw-r--r--src/mame/includes/darkmist.h1
-rw-r--r--src/mame/includes/dbz.h1
-rw-r--r--src/mame/includes/ddragon.h1
-rw-r--r--src/mame/includes/ddragon3.h1
-rw-r--r--src/mame/includes/deadang.h2
-rw-r--r--src/mame/includes/deco32.h2
-rw-r--r--src/mame/includes/deco_mlc.h1
-rw-r--r--src/mame/includes/decocass.h2
-rw-r--r--src/mame/includes/djboy.h1
-rw-r--r--src/mame/includes/dooyong.h1
-rw-r--r--src/mame/includes/dragrace.h1
-rw-r--r--src/mame/includes/dynax.h3
-rw-r--r--src/mame/includes/equites.h2
-rw-r--r--src/mame/includes/espial.h1
-rw-r--r--src/mame/includes/exedexes.h1
-rw-r--r--src/mame/includes/exterm.h1
-rw-r--r--src/mame/includes/fastlane.h1
-rw-r--r--src/mame/includes/finalizr.h1
-rw-r--r--src/mame/includes/foodf.h1
-rw-r--r--src/mame/includes/gaelco2.h2
-rw-r--r--src/mame/includes/gaelco3d.h1
-rw-r--r--src/mame/includes/galaxian.h3
-rw-r--r--src/mame/includes/galaxold.h3
-rw-r--r--src/mame/includes/galpani2.h2
-rw-r--r--src/mame/includes/galpanic.h2
-rw-r--r--src/mame/includes/gberet.h1
-rw-r--r--src/mame/includes/gradius3.h1
-rw-r--r--src/mame/includes/gundealr.h2
-rw-r--r--src/mame/includes/hexion.h1
-rw-r--r--src/mame/includes/higemaru.h1
-rw-r--r--src/mame/includes/hng64.h1
-rw-r--r--src/mame/includes/hyprduel.h1
-rw-r--r--src/mame/includes/ikki.h1
-rw-r--r--src/mame/includes/iqblock.h1
-rw-r--r--src/mame/includes/irobot.h6
-rw-r--r--src/mame/includes/ironhors.h2
-rw-r--r--src/mame/includes/itech8.h3
-rw-r--r--src/mame/includes/jpmimpct.h1
-rw-r--r--src/mame/includes/kaneko16.h2
-rw-r--r--src/mame/includes/konamigx.h1
-rw-r--r--src/mame/includes/lastduel.h2
-rw-r--r--src/mame/includes/lazercmd.h2
-rw-r--r--src/mame/includes/m107.h5
-rw-r--r--src/mame/includes/m92.h1
-rw-r--r--src/mame/includes/mcr.h7
-rw-r--r--src/mame/includes/megasys1.h2
-rw-r--r--src/mame/includes/mhavoc.h3
-rw-r--r--src/mame/includes/mitchell.h1
-rw-r--r--src/mame/includes/model1.h1
-rw-r--r--src/mame/includes/model2.h3
-rw-r--r--src/mame/includes/model3.h1
-rw-r--r--src/mame/includes/mrflea.h1
-rw-r--r--src/mame/includes/ms32.h1
-rw-r--r--src/mame/includes/mw8080bw.h1
-rw-r--r--src/mame/includes/mystwarr.h3
-rw-r--r--src/mame/includes/n8080.h4
-rw-r--r--src/mame/includes/namcofl.h3
-rw-r--r--src/mame/includes/namcona1.h2
-rw-r--r--src/mame/includes/namconb1.h1
-rw-r--r--src/mame/includes/namcos22.h3
-rw-r--r--src/mame/includes/nemesis.h2
-rw-r--r--src/mame/includes/nitedrvr.h4
-rw-r--r--src/mame/includes/nmk16.h4
-rw-r--r--src/mame/includes/orbit.h1
-rw-r--r--src/mame/includes/overdriv.h1
-rw-r--r--src/mame/includes/pgm.h3
-rw-r--r--src/mame/includes/pingpong.h2
-rw-r--r--src/mame/includes/polepos.h1
-rw-r--r--src/mame/includes/polyplay.h1
-rw-r--r--src/mame/includes/psychic5.h1
-rw-r--r--src/mame/includes/qdrmfgp.h1
-rw-r--r--src/mame/includes/renegade.h1
-rw-r--r--src/mame/includes/segahang.h1
-rw-r--r--src/mame/includes/segas24.h4
-rw-r--r--src/mame/includes/segas32.h1
-rw-r--r--src/mame/includes/seta.h8
-rw-r--r--src/mame/includes/seta2.h1
-rw-r--r--src/mame/includes/shadfrce.h1
-rw-r--r--src/mame/includes/shaolins.h1
-rw-r--r--src/mame/includes/snk6502.h1
-rw-r--r--src/mame/includes/snowbros.h2
-rw-r--r--src/mame/includes/spdodgeb.h2
-rw-r--r--src/mame/includes/sprcros2.h1
-rw-r--r--src/mame/includes/sprint8.h1
-rw-r--r--src/mame/includes/srumbler.h1
-rw-r--r--src/mame/includes/ssv.h2
-rw-r--r--src/mame/includes/st0016.h1
-rw-r--r--src/mame/includes/strnskil.h1
-rw-r--r--src/mame/includes/suna16.h1
-rw-r--r--src/mame/includes/suna8.h2
-rw-r--r--src/mame/includes/suprnova.h2
-rw-r--r--src/mame/includes/system1.h2
-rw-r--r--src/mame/includes/taito_l.h1
-rw-r--r--src/mame/includes/taito_o.h1
-rw-r--r--src/mame/includes/targeth.h1
-rw-r--r--src/mame/includes/thedeep.h1
-rw-r--r--src/mame/includes/vball.h1
-rw-r--r--src/mame/includes/wecleman.h2
-rw-r--r--src/mame/includes/williams.h10
-rw-r--r--src/mame/includes/wwfsstar.h1
-rw-r--r--src/mame/includes/wwfwfest.h1
-rw-r--r--src/mame/includes/xain.h1
-rw-r--r--src/mame/includes/xexex.h1
-rw-r--r--src/mame/includes/xmen.h1
-rw-r--r--src/mame/includes/zodiack.h1
-rw-r--r--src/mame/machine/balsente.c48
-rw-r--r--src/mame/machine/bsktball.c9
-rw-r--r--src/mame/machine/decocass.c7
-rw-r--r--src/mame/machine/gaelco2.c11
-rw-r--r--src/mame/machine/galaxold.c6
-rw-r--r--src/mame/machine/irobot.c12
-rw-r--r--src/mame/machine/mcr.c10
-rw-r--r--src/mame/machine/mhavoc.c19
-rw-r--r--src/mame/machine/nitedrvr.c26
-rw-r--r--src/mame/machine/williams.c32
-rw-r--r--src/mame/video/atarisy1.c20
-rw-r--r--src/mame/video/battlera.c25
-rw-r--r--src/mame/video/beezer.c9
-rw-r--r--src/mame/video/galaxian.c5
-rw-r--r--src/mame/video/itech8.c11
-rw-r--r--src/mame/video/spdodgeb.c11
-rw-r--r--src/mess/drivers/a7800.c2
-rw-r--r--src/mess/drivers/ace.c12
-rw-r--r--src/mess/drivers/adam.c10
-rw-r--r--src/mess/drivers/amstr_pc.c4
-rw-r--r--src/mess/drivers/apple2.c2
-rw-r--r--src/mess/drivers/apple2gs.c2
-rw-r--r--src/mess/drivers/atom.c12
-rw-r--r--src/mess/drivers/avigo.c20
-rw-r--r--src/mess/drivers/bullet.c20
-rw-r--r--src/mess/drivers/busicom.c13
-rw-r--r--src/mess/drivers/bw12.c8
-rw-r--r--src/mess/drivers/coleco.c18
-rw-r--r--src/mess/drivers/cosmicos.c18
-rw-r--r--src/mess/drivers/einstein.c28
-rw-r--r--src/mess/drivers/fidelz80.c6
-rw-r--r--src/mess/drivers/huebler.c8
-rw-r--r--src/mess/drivers/kc.c4
-rw-r--r--src/mess/drivers/kyocera.c10
-rw-r--r--src/mess/drivers/mc1000.c12
-rw-r--r--src/mess/drivers/mc80.c8
-rw-r--r--src/mess/drivers/mikromik.c8
-rw-r--r--src/mess/drivers/mpf1.c14
-rw-r--r--src/mess/drivers/msx.c2
-rw-r--r--src/mess/drivers/mtx.c23
-rw-r--r--src/mess/drivers/mz700.c14
-rw-r--r--src/mess/drivers/mz80.c7
-rw-r--r--src/mess/drivers/nc.c21
-rw-r--r--src/mess/drivers/newbrain.c22
-rw-r--r--src/mess/drivers/pc.c2
-rw-r--r--src/mess/drivers/pc8401a.c10
-rw-r--r--src/mess/drivers/pcw.c13
-rw-r--r--src/mess/drivers/pcw16.c71
-rw-r--r--src/mess/drivers/portfoli.c24
-rw-r--r--src/mess/drivers/psion.c10
-rw-r--r--src/mess/drivers/super6.c10
-rw-r--r--src/mess/drivers/svision.c7
-rw-r--r--src/mess/drivers/tek405x.c8
-rw-r--r--src/mess/drivers/ti89.c36
-rw-r--r--src/mess/drivers/tiki100.c14
-rw-r--r--src/mess/drivers/trs80m2.c30
-rw-r--r--src/mess/drivers/v1050.c44
-rw-r--r--src/mess/drivers/vcs80.c16
-rw-r--r--src/mess/drivers/vixen.c12
-rw-r--r--src/mess/drivers/x07.c8
-rw-r--r--src/mess/drivers/x1.c61
-rw-r--r--src/mess/drivers/x1twin.c4
-rw-r--r--src/mess/drivers/xerox820.c21
-rw-r--r--src/mess/includes/a7800.h6
-rw-r--r--src/mess/includes/ace.h2
-rw-r--r--src/mess/includes/adam.h1
-rw-r--r--src/mess/includes/apple2.h3
-rw-r--r--src/mess/includes/atom.h1
-rw-r--r--src/mess/includes/avigo.h2
-rw-r--r--src/mess/includes/bullet.h1
-rw-r--r--src/mess/includes/busicom.h1
-rw-r--r--src/mess/includes/bw12.h1
-rw-r--r--src/mess/includes/cgc7900.h1
-rw-r--r--src/mess/includes/coleco.h1
-rw-r--r--src/mess/includes/cosmicos.h2
-rw-r--r--src/mess/includes/einstein.h2
-rw-r--r--src/mess/includes/fidelz80.h1
-rw-r--r--src/mess/includes/huebler.h1
-rw-r--r--src/mess/includes/kc.h2
-rw-r--r--src/mess/includes/kyocera.h2
-rw-r--r--src/mess/includes/mc1000.h1
-rw-r--r--src/mess/includes/mc80.h1
-rw-r--r--src/mess/includes/mikromik.h1
-rw-r--r--src/mess/includes/mpf1.h1
-rw-r--r--src/mess/includes/msx.h2
-rw-r--r--src/mess/includes/mtx.h2
-rw-r--r--src/mess/includes/mz700.h2
-rw-r--r--src/mess/includes/mz80.h1
-rw-r--r--src/mess/includes/nc.h1
-rw-r--r--src/mess/includes/newbrain.h3
-rw-r--r--src/mess/includes/pc.h9
-rw-r--r--src/mess/includes/pc8401a.h1
-rw-r--r--src/mess/includes/pcw.h1
-rw-r--r--src/mess/includes/pcw16.h3
-rw-r--r--src/mess/includes/portfoli.h3
-rw-r--r--src/mess/includes/psion.h1
-rw-r--r--src/mess/includes/super6.h1
-rw-r--r--src/mess/includes/svision.h1
-rw-r--r--src/mess/includes/tek405x.h1
-rw-r--r--src/mess/includes/ti89.h1
-rw-r--r--src/mess/includes/tiki100.h1
-rw-r--r--src/mess/includes/tmc600.h1
-rw-r--r--src/mess/includes/trs80m2.h2
-rw-r--r--src/mess/includes/v1050.h5
-rw-r--r--src/mess/includes/vcs80.h1
-rw-r--r--src/mess/includes/vixen.h1
-rw-r--r--src/mess/includes/x07.h1
-rw-r--r--src/mess/includes/x1.h8
-rw-r--r--src/mess/includes/xerox820.h2
-rw-r--r--src/mess/machine/apple2.c4
-rw-r--r--src/mess/machine/kc.c19
-rw-r--r--src/mess/machine/msx.c9
-rw-r--r--src/mess/machine/pc.c6
-rw-r--r--src/mess/video/a7800.c73
-rw-r--r--src/mess/video/cgc7900.c8
-rw-r--r--src/mess/video/tmc600.c8
382 files changed, 1816 insertions, 1883 deletions
diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c
index 5f36c5518d5..5c09f5d2f9c 100644
--- a/src/mame/audio/8080bw.c
+++ b/src/mame/audio/8080bw.c
@@ -869,18 +869,17 @@ WRITE8_MEMBER(_8080bw_state::schaser_sh_port_2_w)
}
-TIMER_DEVICE_CALLBACK( schaser_effect_555_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(_8080bw_state::schaser_effect_555_cb)
{
- _8080bw_state *state = timer.machine().driver_data<_8080bw_state>();
int effect = param;
attotime new_time;
/* Toggle 555 output */
- state->m_schaser_effect_555_is_low = !state->m_schaser_effect_555_is_low;
- state->m_schaser_effect_555_time_remain = attotime::zero;
- state->m_schaser_effect_555_time_remain_savable = state->m_schaser_effect_555_time_remain.as_double();
+ m_schaser_effect_555_is_low = !m_schaser_effect_555_is_low;
+ m_schaser_effect_555_time_remain = attotime::zero;
+ m_schaser_effect_555_time_remain_savable = m_schaser_effect_555_time_remain.as_double();
- if (state->m_schaser_effect_555_is_low)
+ if (m_schaser_effect_555_is_low)
new_time = PERIOD_OF_555_ASTABLE(0, RES_K(20), CAP_U(1)) / 2;
else
{
@@ -889,9 +888,9 @@ TIMER_DEVICE_CALLBACK( schaser_effect_555_cb )
else
new_time = attotime::never;
}
- state->m_schaser_effect_555_timer->adjust(new_time, effect);
- sn76477_enable_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion));
- sn76477_one_shot_cap_voltage_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
+ m_schaser_effect_555_timer->adjust(new_time, effect);
+ sn76477_enable_w(m_sn, !(m_schaser_effect_555_is_low || m_schaser_explosion));
+ sn76477_one_shot_cap_voltage_w(m_sn, !(m_schaser_effect_555_is_low || m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
}
diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c
index a0ab2c0b156..6819514c113 100644
--- a/src/mame/audio/n8080.c
+++ b/src/mame/audio/n8080.c
@@ -426,33 +426,31 @@ WRITE8_MEMBER(n8080_state::helifire_sound_ctrl_w)
}
-static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::spacefev_vco_voltage_timer)
{
- device_t *sn = timer.machine().device("snsnd");
- n8080_state *state = timer.machine().driver_data<n8080_state>();
+ device_t *sn = machine().device("snsnd");
double voltage = 0;
- if (state->m_mono_flop[2])
+ if (m_mono_flop[2])
{
- voltage = 5 * (1 - exp(- state->m_sound_timer[2]->elapsed().as_double() / 0.22));
+ voltage = 5 * (1 - exp(- m_sound_timer[2]->elapsed().as_double() / 0.22));
}
sn76477_vco_voltage_w(sn, voltage);
}
-static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::helifire_dac_volume_timer)
{
- n8080_state *state = timer.machine().driver_data<n8080_state>();
- double t = state->m_helifire_dac_timing - timer.machine().time().as_double();
+ double t = m_helifire_dac_timing - machine().time().as_double();
- if (state->m_helifire_dac_phase)
+ if (m_helifire_dac_phase)
{
- state->m_helifire_dac_volume = 1 - exp(t / ATTACK_RATE);
+ m_helifire_dac_volume = 1 - exp(t / ATTACK_RATE);
}
else
{
- state->m_helifire_dac_volume = exp(t / DECAY_RATE);
+ m_helifire_dac_volume = exp(t / DECAY_RATE);
}
}
@@ -577,7 +575,7 @@ MACHINE_CONFIG_FRAGMENT( spacefev_sound )
MCFG_CPU_PROGRAM_MAP(n8080_sound_cpu_map)
MCFG_CPU_IO_MAP(n8080_sound_io_map)
- MCFG_TIMER_ADD_PERIODIC("vco_timer", spacefev_vco_voltage_timer, attotime::from_hz(1000))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("vco_timer", n8080_state, spacefev_vco_voltage_timer, attotime::from_hz(1000))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -617,7 +615,7 @@ MACHINE_CONFIG_FRAGMENT( helifire_sound )
MCFG_CPU_PROGRAM_MAP(n8080_sound_cpu_map)
MCFG_CPU_IO_MAP(helifire_sound_io_map)
- MCFG_TIMER_ADD_PERIODIC("helifire_dac", helifire_dac_volume_timer, attotime::from_hz(1000) )
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("helifire_dac", n8080_state, helifire_dac_volume_timer, attotime::from_hz(1000))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c
index 7fb2ad805d6..897096443f4 100644
--- a/src/mame/drivers/1942.c
+++ b/src/mame/drivers/1942.c
@@ -74,15 +74,15 @@ WRITE8_MEMBER(_1942_state::c1942_bankswitch_w)
membank("bank1")->set_entry(data & 0x03);
}
-static TIMER_DEVICE_CALLBACK( c1942_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(_1942_state::c1942_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
if(scanline == 0) // unknown irq event, presumably vblank-in or a periodic one (writes to the soundlatch and drives freeze dip-switch)
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
}
@@ -258,7 +258,7 @@ static MACHINE_CONFIG_START( 1942, _1942_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MAIN_CPU_CLOCK) /* 4 MHz ??? */
MCFG_CPU_PROGRAM_MAP(c1942_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", c1942_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", _1942_state, c1942_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, SOUND_CPU_CLOCK) /* 3 MHz ??? */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index e0ef61157f4..33f542c220a 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -1067,7 +1067,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( schaser, mw8080bw_root, _8080bw_state )
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,schaser)
MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state,schaser)
- MCFG_TIMER_ADD("schaser_sh_555", schaser_effect_555_cb)
+ MCFG_TIMER_DRIVER_ADD("schaser_sh_555", _8080bw_state, schaser_effect_555_cb)
/* add shifter */
MCFG_MB14241_ADD("mb14241")
@@ -2341,12 +2341,11 @@ Claybuster is on the same hardware, PCB labels CS 235A and CS 238A as well
*/
-TIMER_DEVICE_CALLBACK( claybust_gun_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(_8080bw_state::claybust_gun_callback)
{
- _8080bw_state *state = timer.machine().driver_data<_8080bw_state>();
// reset gun latch
- state->m_claybust_gun_pos = 0;
+ m_claybust_gun_pos = 0;
}
CUSTOM_INPUT_MEMBER(_8080bw_state::claybust_gun_on_r)
@@ -2460,7 +2459,7 @@ MACHINE_CONFIG_DERIVED_CLASS( claybust, invaders, _8080bw_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(claybust_io_map)
- MCFG_TIMER_ADD("claybust_gun", claybust_gun_callback)
+ MCFG_TIMER_DRIVER_ADD("claybust_gun", _8080bw_state, claybust_gun_callback)
MCFG_MACHINE_START_OVERRIDE(_8080bw_state, claybust)
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index eb18935dee2..9a888b49e5c 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -548,16 +548,16 @@ static const ym2203_interface ym2203_config =
/* Interrupt Generators */
/* Main Z80 uses IM2 */
-static TIMER_DEVICE_CALLBACK( airbustr_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(airbustr_state::airbustr_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
+ machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
/* Pandora "sprite end dma" irq? TODO: timing is likely off */
if(scanline == 64)
- timer.machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
+ machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
}
/* Sub Z80 uses IM2 too, but 0xff irq routine just contains an irq ack in it */
@@ -625,7 +625,7 @@ static MACHINE_CONFIG_START( airbustr, airbustr_state )
MCFG_CPU_ADD("master", Z80, 6000000) // ???
MCFG_CPU_PROGRAM_MAP(master_map)
MCFG_CPU_IO_MAP(master_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", airbustr_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", airbustr_state, airbustr_scanline, "screen", 0, 1)
MCFG_CPU_ADD("slave", Z80, 6000000) // ???
MCFG_CPU_PROGRAM_MAP(slave_map)
diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c
index 0d9d2b4e8fb..b843ab448d8 100644
--- a/src/mame/drivers/argus.c
+++ b/src/mame/drivers/argus.c
@@ -129,26 +129,26 @@ Known issues :
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( argus_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(argus_state::argus_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
if(scanline == 16) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
}
-static TIMER_DEVICE_CALLBACK( butasan_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(argus_state::butasan_scanline)
{
int scanline = param;
if(scanline == 248) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
if(scanline == 8) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
}
/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
@@ -545,7 +545,7 @@ static MACHINE_CONFIG_START( argus, argus_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 5000000) /* 4 MHz */
MCFG_CPU_PROGRAM_MAP(argus_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", argus_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, argus_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 5000000)
MCFG_CPU_PROGRAM_MAP(sound_map_a)
@@ -589,7 +589,7 @@ static MACHINE_CONFIG_START( valtric, argus_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 5000000) /* 5 MHz */
MCFG_CPU_PROGRAM_MAP(valtric_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", argus_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, argus_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 5000000)
MCFG_CPU_PROGRAM_MAP(sound_map_a)
@@ -633,7 +633,7 @@ static MACHINE_CONFIG_START( butasan, argus_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 5000000) /* 5 MHz */
MCFG_CPU_PROGRAM_MAP(butasan_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", butasan_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, butasan_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 5000000)
MCFG_CPU_PROGRAM_MAP(sound_map_b)
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index 52d713499d3..88d89c0d60f 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -87,10 +87,9 @@ READ8_MEMBER(astrof_state::irq_clear_r)
}
-static TIMER_DEVICE_CALLBACK( irq_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(astrof_state::irq_callback)
{
- astrof_state *state = timer.machine().driver_data<astrof_state>();
- state->m_maincpu->set_input_line(0, ASSERT_LINE);
+ m_maincpu->set_input_line(0, ASSERT_LINE);
}
@@ -943,7 +942,7 @@ static MACHINE_CONFIG_START( base, astrof_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, MAIN_CPU_CLOCK)
- MCFG_TIMER_ADD_SCANLINE("vblank", irq_callback, "screen", VBSTART, 0)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank", astrof_state, irq_callback, "screen", VBSTART, 0)
/* video hardware */
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index ada267edfc7..a79a072d5a8 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -250,12 +250,11 @@ MACHINE_RESET_MEMBER(atarisy1_state,atarisy1)
*
*************************************/
-static TIMER_DEVICE_CALLBACK( delayed_joystick_int )
+TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::delayed_joystick_int)
{
- atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
- state->m_joystick_value = param;
- state->m_joystick_int = 1;
- atarigen_update_interrupts(timer.machine());
+ m_joystick_value = param;
+ m_joystick_int = 1;
+ atarigen_update_interrupts(machine());
}
@@ -771,10 +770,10 @@ static MACHINE_CONFIG_START( atarisy1, atarisy1_state )
MCFG_MACHINE_RESET_OVERRIDE(atarisy1_state,atarisy1)
MCFG_NVRAM_ADD_1FILL("eeprom")
- MCFG_TIMER_ADD("joystick_timer", delayed_joystick_int)
- MCFG_TIMER_ADD("scan_timer", atarisy1_int3_callback)
- MCFG_TIMER_ADD("int3off_timer", atarisy1_int3off_callback)
- MCFG_TIMER_ADD("yreset_timer", atarisy1_reset_yscroll_callback)
+ MCFG_TIMER_DRIVER_ADD("joystick_timer", atarisy1_state, delayed_joystick_int)
+ MCFG_TIMER_DRIVER_ADD("scan_timer", atarisy1_state, atarisy1_int3_callback)
+ MCFG_TIMER_DRIVER_ADD("int3off_timer", atarisy1_state, atarisy1_int3off_callback)
+ MCFG_TIMER_DRIVER_ADD("yreset_timer", atarisy1_state, atarisy1_reset_yscroll_callback)
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c
index f94b4f5a413..e19cf233b41 100644
--- a/src/mame/drivers/balsente.c
+++ b/src/mame/drivers/balsente.c
@@ -1212,10 +1212,10 @@ static MACHINE_CONFIG_START( balsente, balsente_state )
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_ADD("scan_timer", balsente_interrupt_timer)
- MCFG_TIMER_ADD("8253_0_timer", balsente_clock_counter_0_ff)
- MCFG_TIMER_ADD("8253_1_timer", balsente_counter_callback)
- MCFG_TIMER_ADD("8253_2_timer", balsente_counter_callback)
+ MCFG_TIMER_DRIVER_ADD("scan_timer", balsente_state, balsente_interrupt_timer)
+ MCFG_TIMER_DRIVER_ADD("8253_0_timer", balsente_state, balsente_clock_counter_0_ff)
+ MCFG_TIMER_DRIVER_ADD("8253_1_timer", balsente_state, balsente_counter_callback)
+ MCFG_TIMER_DRIVER_ADD("8253_2_timer", balsente_state, balsente_counter_callback)
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index 7e5fee8ab1f..f855b644064 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -234,7 +234,7 @@ static MACHINE_CONFIG_START( battlera, battlera_state )
MCFG_CPU_ADD("maincpu", H6280,21477200/3)
MCFG_CPU_PROGRAM_MAP(battlera_map)
MCFG_CPU_IO_MAP(battlera_portmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", battlera_irq, "screen", 0, 1) /* 8 prelines, 232 lines, 16 vblank? */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", battlera_state, battlera_irq, "screen", 0, 1) /* 8 prelines, 232 lines, 16 vblank? */
MCFG_CPU_ADD("audiocpu", H6280,21477200/3)
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index 276d358add3..f3f732e633a 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -144,17 +144,16 @@
*
*************************************/
-static TIMER_DEVICE_CALLBACK( scanline_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(beathead_state::scanline_callback)
{
- beathead_state *state = timer.machine().driver_data<beathead_state>();
int scanline = param;
/* update the video */
- timer.machine().primary_screen->update_now();
+ machine().primary_screen->update_now();
/* on scanline zero, clear any halt condition */
if (scanline == 0)
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
/* wrap around at 262 */
scanline++;
@@ -162,11 +161,11 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
scanline = 0;
/* set the scanline IRQ */
- state->m_irq_state[2] = 1;
- state->update_interrupts();
+ m_irq_state[2] = 1;
+ update_interrupts();
/* set the timer for the next one */
- timer.adjust(timer.machine().primary_screen->time_until_pos(scanline) - state->m_hblank_offset, scanline);
+ timer.adjust(machine().primary_screen->time_until_pos(scanline) - m_hblank_offset, scanline);
}
@@ -436,7 +435,7 @@ static MACHINE_CONFIG_START( beathead, beathead_state )
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_ADD("scan_timer", scanline_callback)
+ MCFG_TIMER_DRIVER_ADD("scan_timer", beathead_state, scanline_callback)
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/beezer.c b/src/mame/drivers/beezer.c
index 2d226162015..ca49c0be7e2 100644
--- a/src/mame/drivers/beezer.c
+++ b/src/mame/drivers/beezer.c
@@ -88,7 +88,7 @@ static MACHINE_CONFIG_START( beezer, beezer_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, 1000000) /* 1 MHz */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", beezer_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", beezer_state, beezer_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M6809, 1000000) /* 1 MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index 1891a77c455..e4e069d3160 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -123,15 +123,15 @@ READ16_MEMBER(bionicc_state::hacked_soundcommand_r)
********************************************************************/
-static TIMER_DEVICE_CALLBACK( bionicc_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(bionicc_state::bionicc_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
if(scanline == 0) // vblank-in or i8751 related irq
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
}
@@ -354,7 +354,7 @@ static MACHINE_CONFIG_START( bionicc, bionicc_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK / 2) /* 12 MHz - verified in schematics */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bionicc_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bionicc_state, bionicc_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, EXO3_F0_CLK / 4) /* EXO3 C,B=GND, A=5V ==> Divisor 2^2 */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c
index a09fad44e49..aec2de9a446 100644
--- a/src/mame/drivers/bishi.c
+++ b/src/mame/drivers/bishi.c
@@ -106,18 +106,17 @@ WRITE16_MEMBER(bishi_state::control2_w)
COMBINE_DATA(&m_cur_control2);
}
-static TIMER_DEVICE_CALLBACK( bishi_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(bishi_state::bishi_scanline)
{
- bishi_state *state = timer.machine().driver_data<bishi_state>();
int scanline = param;
- if (state->m_cur_control & 0x800)
+ if (m_cur_control & 0x800)
{
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_3, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(M68K_IRQ_3, HOLD_LINE);
if(scanline == 0) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE);
}
}
@@ -411,7 +410,7 @@ static MACHINE_CONFIG_START( bishi, bishi_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK) /* 12MHz (24MHz OSC / 2 ) */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bishi_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bishi_state, bishi_scanline, "screen", 0, 1)
/* video hardware */
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index dcca2ed97d5..88ab5fd5ee6 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -36,16 +36,15 @@
#include "includes/bladestl.h"
-static TIMER_DEVICE_CALLBACK( bladestl_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(bladestl_state::bladestl_scanline)
{
- bladestl_state *state = timer.machine().driver_data<bladestl_state>();
int scanline = param;
- if(scanline == 240 && k007342_is_int_enabled(state->m_k007342)) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(HD6309_FIRQ_LINE, HOLD_LINE);
+ if(scanline == 240 && k007342_is_int_enabled(m_k007342)) // vblank-out irq
+ machine().device("maincpu")->execute().set_input_line(HD6309_FIRQ_LINE, HOLD_LINE);
if(scanline == 0) // vblank-in or timer irq
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
/*************************************
@@ -333,7 +332,7 @@ static MACHINE_CONFIG_START( bladestl, bladestl_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", HD6309, 24000000/2) /* 24MHz/2 (?) */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bladestl_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bladestl_state, bladestl_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M6809, 2000000)
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c
index e42aca18a58..a63ac23a15d 100644
--- a/src/mame/drivers/blockout.c
+++ b/src/mame/drivers/blockout.c
@@ -293,16 +293,15 @@ void blockout_state::machine_reset()
m_color = 0;
}
-static TIMER_DEVICE_CALLBACK( blockout_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(blockout_state::blockout_scanline)
{
- blockout_state *state = timer.machine().driver_data<blockout_state>();
int scanline = param;
if(scanline == 248) // vblank-out irq
- state->m_maincpu->set_input_line(6, ASSERT_LINE);
+ m_maincpu->set_input_line(6, ASSERT_LINE);
if(scanline == 0) // vblank-in irq or directly tied to coin inputs (TODO: check)
- state->m_maincpu->set_input_line(5, ASSERT_LINE);
+ m_maincpu->set_input_line(5, ASSERT_LINE);
}
static MACHINE_CONFIG_START( blockout, blockout_state )
@@ -310,7 +309,7 @@ static MACHINE_CONFIG_START( blockout, blockout_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, MAIN_CLOCK) /* MRH - 8.76 makes gfx/adpcm samples sync better -- but 10 is correct speed*/
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", blockout_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", blockout_state, blockout_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, AUDIO_CLOCK) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(audio_map)
diff --git a/src/mame/drivers/bsktball.c b/src/mame/drivers/bsktball.c
index b40fecf1ea6..4d8b843fecb 100644
--- a/src/mame/drivers/bsktball.c
+++ b/src/mame/drivers/bsktball.c
@@ -249,7 +249,7 @@ static MACHINE_CONFIG_START( bsktball, bsktball_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502,750000)
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bsktball_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bsktball_state, bsktball_scanline, "screen", 0, 1)
/* video hardware */
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index ec69a3ef534..6665c471b1a 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -183,12 +183,11 @@ WRITE8_MEMBER(btime_state::ay_audio_nmi_enable_w)
}
}
-static TIMER_DEVICE_CALLBACK( audio_nmi_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(btime_state::audio_nmi_gen)
{
- btime_state *state = timer.machine().driver_data<btime_state>();
int scanline = param;
- state->m_audio_nmi_state = scanline & 8;
- state->m_audiocpu->set_input_line(INPUT_LINE_NMI, (state->m_audio_nmi_enabled && state->m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
+ m_audio_nmi_state = scanline & 8;
+ m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1463,7 +1462,7 @@ static MACHINE_CONFIG_START( btime, btime_state )
MCFG_CPU_ADD("audiocpu", M6502, HCLK1/3/2)
MCFG_CPU_PROGRAM_MAP(audio_map)
- MCFG_TIMER_ADD_SCANLINE("audionmi", audio_nmi_gen, "screen", 0, 8)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("audionmi", btime_state, audio_nmi_gen, "screen", 0, 8)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 06ef507ccf0..97601724922 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -123,14 +123,13 @@ TIMER_CALLBACK_MEMBER(cave_state::cave_vblank_end)
m_agallet_vblank_irq = 0;
}
-static TIMER_DEVICE_CALLBACK( cave_vblank_start )
+TIMER_DEVICE_CALLBACK_MEMBER(cave_state::cave_vblank_start)
{
- cave_state *state = timer.machine().driver_data<cave_state>();
- state->m_vblank_irq = 1;
- update_irq_state(timer.machine());
- cave_get_sprite_info(timer.machine());
- state->m_agallet_vblank_irq = 1;
- timer.machine().scheduler().timer_set(attotime::from_usec(2000), timer_expired_delegate(FUNC(cave_state::cave_vblank_end),state));
+ m_vblank_irq = 1;
+ update_irq_state(machine());
+ cave_get_sprite_info(machine());
+ m_agallet_vblank_irq = 1;
+ machine().scheduler().timer_set(attotime::from_usec(2000), timer_expired_delegate(FUNC(cave_state::cave_vblank_end),this));
}
/* Called once/frame to generate the VBLANK interrupt */
@@ -1858,7 +1857,7 @@ static MACHINE_CONFIG_START( dfeveron, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1900,7 +1899,7 @@ static MACHINE_CONFIG_START( ddonpach, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1946,7 +1945,7 @@ static MACHINE_CONFIG_START( donpachi, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1992,7 +1991,7 @@ static MACHINE_CONFIG_START( esprade, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2032,7 +2031,7 @@ static MACHINE_CONFIG_START( gaia, cave_state )
MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2073,7 +2072,7 @@ static MACHINE_CONFIG_START( guwange, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2117,7 +2116,7 @@ static MACHINE_CONFIG_START( hotdogst, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2169,7 +2168,7 @@ static MACHINE_CONFIG_START( korokoro, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_8BIT_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2223,7 +2222,7 @@ static MACHINE_CONFIG_START( mazinger, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2281,7 +2280,7 @@ static MACHINE_CONFIG_START( metmqstr, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) /* start with the watchdog armed */
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2336,7 +2335,7 @@ static MACHINE_CONFIG_START( pacslot, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_pacslot)
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2392,7 +2391,7 @@ static MACHINE_CONFIG_START( pwrinst2, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2455,7 +2454,7 @@ static MACHINE_CONFIG_START( sailormn, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2509,7 +2508,7 @@ static MACHINE_CONFIG_START( tjumpman, cave_state )
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2550,7 +2549,7 @@ static MACHINE_CONFIG_START( uopoko, cave_state )
MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", cave_vblank_start)
+ MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 53434ae257e..17c46063bb7 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -441,16 +441,16 @@ each direction to assign the boundries.
*
*************************************/
-static TIMER_DEVICE_CALLBACK( generate_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(centiped_state::generate_interrupt)
{
int scanline = param;
/* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */
if (scanline & 16)
- timer.machine().device("maincpu")->execute().set_input_line(0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
/* do a partial update now to handle sprite multiplexing (Maze Invaders) */
- timer.machine().primary_screen->update_partial(scanline);
+ machine().primary_screen->update_partial(scanline);
}
@@ -1759,7 +1759,7 @@ static MACHINE_CONFIG_START( centiped_base, centiped_state )
MCFG_ATARIVGEAROM_ADD("earom")
/* timer */
- MCFG_TIMER_ADD_SCANLINE("32v", generate_interrupt, "screen", 0, 16)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", centiped_state, generate_interrupt, "screen", 0, 16)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/changela.c b/src/mame/drivers/changela.c
index 07256919471..aea3cf2643f 100644
--- a/src/mame/drivers/changela.c
+++ b/src/mame/drivers/changela.c
@@ -402,14 +402,14 @@ static const ay8910_interface ay8910_interface_2 =
};
-TIMER_DEVICE_CALLBACK( changela_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(changela_state::changela_scanline)
{
int scanline = param;
if(scanline == 256) // vblank irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xdf);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xdf);
else if(((scanline % 64) == 0)) // timer irq, 3 times per given vblank field
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf);
}
INTERRUPT_GEN_MEMBER(changela_state::chl_mcu_irq)
@@ -503,7 +503,7 @@ static MACHINE_CONFIG_START( changela, changela_state )
MCFG_CPU_ADD("maincpu", Z80,5000000)
MCFG_CPU_PROGRAM_MAP(changela_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", changela_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", changela_state, changela_scanline, "screen", 0, 1)
MCFG_CPU_ADD("mcu", M68705,2500000)
MCFG_CPU_PROGRAM_MAP(mcu_map)
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index c55a9b0ad94..f23cd08e085 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -26,15 +26,14 @@
-static TIMER_DEVICE_CALLBACK( chqflag_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(chqflag_state::chqflag_scanline)
{
- chqflag_state *state = timer.machine().driver_data<chqflag_state>();
int scanline = param;
- if(scanline == 240 && k051960_is_irq_enabled(state->m_k051960)) // vblank irq
- timer.machine().device("maincpu")->execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
- else if(((scanline % 32) == 0) && (k051960_is_nmi_enabled(state->m_k051960))) // timer irq
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if(scanline == 240 && k051960_is_irq_enabled(m_k051960)) // vblank irq
+ machine().device("maincpu")->execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
+ else if(((scanline % 32) == 0) && (k051960_is_nmi_enabled(m_k051960))) // timer irq
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
WRITE8_MEMBER(chqflag_state::chqflag_bankswitch_w)
@@ -356,7 +355,7 @@ static MACHINE_CONFIG_START( chqflag, chqflag_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", KONAMI,XTAL_24MHz/8) /* 052001 (verified on pcb) */
MCFG_CPU_PROGRAM_MAP(chqflag_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", chqflag_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", chqflag_state, chqflag_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(chqflag_sound_map)
diff --git a/src/mame/drivers/circus.c b/src/mame/drivers/circus.c
index 59d4421813a..f48ae100ba2 100644
--- a/src/mame/drivers/circus.c
+++ b/src/mame/drivers/circus.c
@@ -347,12 +347,12 @@ static MACHINE_CONFIG_START( robotbwl, circus_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
-static TIMER_DEVICE_CALLBACK( crash_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(circus_state::crash_scanline)
{
int scanline = param;
if(scanline == 256 || scanline == 0) // vblank-out / in irq
- timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
}
static MACHINE_CONFIG_START( crash, circus_state )
@@ -360,7 +360,7 @@ static MACHINE_CONFIG_START( crash, circus_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, XTAL_11_289MHz / 16) /* 705.562kHz */
MCFG_CPU_PROGRAM_MAP(circus_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", crash_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", circus_state, crash_scanline, "screen", 0, 1)
/* video hardware */
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 1aaacc4deb1..88e6f17df09 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -1533,18 +1533,18 @@ GFXDECODE_END
**************************************************************************/
/* TODO: this is hackish */
-static TIMER_DEVICE_CALLBACK( bigrun_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::bigrun_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("cpu1")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("cpu1")->execute().set_input_line(4, HOLD_LINE);
if(scanline == 154)
- timer.machine().device("cpu1")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("cpu1")->execute().set_input_line(2, HOLD_LINE);
if(scanline == 69)
- timer.machine().device("cpu1")->execute().set_input_line(1, HOLD_LINE);
+ machine().device("cpu1")->execute().set_input_line(1, HOLD_LINE);
}
@@ -1560,7 +1560,7 @@ static MACHINE_CONFIG_START( bigrun, cischeat_state )
/* basic machine hardware */
MCFG_CPU_ADD("cpu1", M68000, 10000000)
MCFG_CPU_PROGRAM_MAP(bigrun_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bigrun_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cischeat_state, bigrun_scanline, "screen", 0, 1)
MCFG_CPU_ADD("cpu2", M68000, 10000000)
MCFG_CPU_PROGRAM_MAP(bigrun_map2)
@@ -1691,15 +1691,15 @@ MACHINE_CONFIG_END
4] == 3
*/
-static TIMER_DEVICE_CALLBACK( scudhamm_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::scudhamm_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
if(scanline == 120) // timer irq (clears a flag, presumably sprite DMA end)
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
}
static MACHINE_CONFIG_START( scudhamm, cischeat_state )
@@ -1707,7 +1707,7 @@ static MACHINE_CONFIG_START( scudhamm, cischeat_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(scudhamm_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", scudhamm_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cischeat_state, scudhamm_scanline, "screen", 0, 1)
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_HAS_SHADOWS)
@@ -1741,15 +1741,15 @@ MACHINE_CONFIG_END
Arm Champs II
**************************************************************************/
-static TIMER_DEVICE_CALLBACK( armchamp2_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::armchamp2_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
if(scanline == 120) // timer irq (TODO: timing)
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
}
static MACHINE_CONFIG_DERIVED( armchmp2, scudhamm )
@@ -1758,7 +1758,7 @@ static MACHINE_CONFIG_DERIVED( armchmp2, scudhamm )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(armchmp2_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(armchamp2_scanline)
+ MCFG_TIMER_DRIVER_CALLBACK(cischeat_state, armchamp2_scanline)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 703c032106d..c14c2594c4a 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -68,12 +68,10 @@ WRITE16_MEMBER(cninja_state::stoneage_sound_w)
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
-static TIMER_DEVICE_CALLBACK( interrupt_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(cninja_state::interrupt_gen)
{
- cninja_state *state = timer.machine().driver_data<cninja_state>();
-
- state->m_maincpu->set_input_line((state->m_irq_mask & 0x10) ? 3 : 4, ASSERT_LINE);
- state->m_raster_irq_timer->reset();
+ m_maincpu->set_input_line((m_irq_mask & 0x10) ? 3 : 4, ASSERT_LINE);
+ m_raster_irq_timer->reset();
}
READ16_MEMBER(cninja_state::cninja_irq_r)
@@ -912,7 +910,7 @@ static MACHINE_CONFIG_START( cninja, cninja_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
- MCFG_TIMER_ADD("raster_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -964,7 +962,7 @@ static MACHINE_CONFIG_START( stoneage, cninja_state )
MCFG_CPU_PROGRAM_MAP(stoneage_s_map)
- MCFG_TIMER_ADD("raster_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1016,7 +1014,7 @@ static MACHINE_CONFIG_START( cninjabl, cninja_state )
MCFG_CPU_PROGRAM_MAP(stoneage_s_map)
- MCFG_TIMER_ADD("raster_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1059,7 +1057,7 @@ static MACHINE_CONFIG_START( edrandy, cninja_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
- MCFG_TIMER_ADD("raster_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1111,7 +1109,7 @@ static MACHINE_CONFIG_START( robocop2, cninja_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
- MCFG_TIMER_ADD("raster_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 0115e6516b1..5487b9e945a 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -155,10 +155,9 @@ MACHINE_RESET_MEMBER(coolpool_state,coolpool)
*
*************************************/
-static TIMER_DEVICE_CALLBACK( nvram_write_timeout )
+TIMER_DEVICE_CALLBACK_MEMBER(coolpool_state::nvram_write_timeout)
{
- coolpool_state *state = timer.machine().driver_data<coolpool_state>();
- state->m_nvram_write_enable = 0;
+ m_nvram_write_enable = 0;
}
@@ -205,12 +204,10 @@ WRITE16_MEMBER(coolpool_state::nvram_thrash_data_w)
*
*************************************/
-static TIMER_DEVICE_CALLBACK( amerdart_audio_int_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(coolpool_state::amerdart_audio_int_gen)
{
- coolpool_state *state = timer.machine().driver_data<coolpool_state>();
-
- state->m_dsp->execute().set_input_line(0, ASSERT_LINE);
- state->m_dsp->execute().set_input_line(0, CLEAR_LINE);
+ m_dsp->execute().set_input_line(0, ASSERT_LINE);
+ m_dsp->execute().set_input_line(0, CLEAR_LINE);
}
@@ -858,12 +855,12 @@ static MACHINE_CONFIG_START( amerdart, coolpool_state )
MCFG_CPU_PROGRAM_MAP(amerdart_dsp_pgm_map)
/* Data Map is internal to the CPU */
MCFG_CPU_IO_MAP(amerdart_dsp_io_map)
- MCFG_TIMER_ADD_SCANLINE("audioint", amerdart_audio_int_gen, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("audioint", coolpool_state, amerdart_audio_int_gen, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(coolpool_state,amerdart)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_ADD("nvram_timer", nvram_write_timeout)
+ MCFG_TIMER_DRIVER_ADD("nvram_timer", coolpool_state, nvram_write_timeout)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -892,7 +889,7 @@ static MACHINE_CONFIG_START( coolpool, coolpool_state )
MCFG_MACHINE_RESET_OVERRIDE(coolpool_state,coolpool)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_ADD("nvram_timer", nvram_write_timeout)
+ MCFG_TIMER_DRIVER_ADD("nvram_timer", coolpool_state, nvram_write_timeout)
/* video hardware */
MCFG_TLC34076_ADD("tlc34076", tlc34076_6_bit_intf)
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 291e6a1a2bd..5c9a78f833d 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -1000,15 +1000,15 @@ static MACHINE_CONFIG_START( cosmic, cosmic_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
MACHINE_CONFIG_END
-static TIMER_DEVICE_CALLBACK( panic_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(cosmic_state::panic_scanline)
{
int scanline = param;
if(scanline == 224) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
if(scanline == 0) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
}
@@ -1017,7 +1017,7 @@ static MACHINE_CONFIG_DERIVED( panic, cosmic )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(panic_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", panic_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cosmic_state, panic_scanline, "screen", 0, 1)
/* video hardware */
MCFG_GFXDECODE(panic)
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index 74c8f683742..0aef6a5acfd 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -254,7 +254,7 @@ static MACHINE_CONFIG_START( dambustr, dambustr_state )
MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
- MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
+ MCFG_TIMER_DRIVER_ADD("int_timer", dambustr_state, galaxold_interrupt_timer)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/darkmist.c b/src/mame/drivers/darkmist.c
index bfe87d968bb..cb89fbe90a0 100644
--- a/src/mame/drivers/darkmist.c
+++ b/src/mame/drivers/darkmist.c
@@ -213,15 +213,15 @@ static GFXDECODE_START( darkmist )
GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 0, 16*4 )
GFXDECODE_END
-static TIMER_DEVICE_CALLBACK( darkmist_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(darkmist_state::darkmist_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */
if(scanline == 0) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */
}
@@ -230,7 +230,7 @@ static MACHINE_CONFIG_START( darkmist, darkmist_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,4000000) /* ? MHz */
MCFG_CPU_PROGRAM_MAP(memmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", darkmist_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkmist_state, darkmist_scanline, "screen", 0, 1)
MCFG_CPU_ADD(CPUTAG_T5182,Z80,14318180/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(t5182_map)
diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c
index ddd17c846f1..627a8a9cff1 100644
--- a/src/mame/drivers/dbz.c
+++ b/src/mame/drivers/dbz.c
@@ -61,16 +61,15 @@ Notes:
-static TIMER_DEVICE_CALLBACK( dbz_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(dbz_state::dbz_scanline)
{
- dbz_state *state = timer.machine().driver_data<dbz_state>();
int scanline = param;
if(scanline == 256) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_2, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(M68K_IRQ_2, ASSERT_LINE);
- if(scanline == 0 && k053246_is_irq_enabled(state->m_k053246)) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE); //auto-acks apparently
+ if(scanline == 0 && k053246_is_irq_enabled(m_k053246)) // vblank-in irq
+ machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE); //auto-acks apparently
}
#if 0
@@ -383,7 +382,7 @@ static MACHINE_CONFIG_START( dbz, dbz_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(dbz_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", dbz_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dbz_state, dbz_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(dbz_sound_map)
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index a84af8c65af..edb85a1cfbc 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -116,25 +116,24 @@ INLINE int scanline_to_vcount( int scanline )
return (vcount - 0x18) | 0x100;
}
-static TIMER_DEVICE_CALLBACK( ddragon_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(ddragon_state::ddragon_scanline)
{
- ddragon_state *state = timer.machine().driver_data<ddragon_state>();
int scanline = param;
- int screen_height = timer.machine().primary_screen->height();
+ int screen_height = machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* update to the current point */
if (scanline > 0)
- timer.machine().primary_screen->update_partial(scanline - 1);
+ machine().primary_screen->update_partial(scanline - 1);
/* on the rising edge of VBLK (vcount == F8), signal an NMI */
if (vcount == 0xf8)
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
/* set 1ms signal on rising edge of vcount & 8 */
if (!(vcount_old & 8) && (vcount & 8))
- state->m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
+ m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
}
@@ -966,7 +965,7 @@ static MACHINE_CONFIG_START( ddragon, ddragon_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", HD6309, MAIN_CLOCK) /* 12 MHz / 4 internally */
MCFG_CPU_PROGRAM_MAP(ddragon_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, ddragon_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", HD63701, MAIN_CLOCK / 2) /* 6 MHz / 4 internally */
MCFG_CPU_PROGRAM_MAP(sub_map)
@@ -1029,7 +1028,7 @@ static MACHINE_CONFIG_START( ddragon6809, ddragon_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8) /* 1.5 MHz */
MCFG_CPU_PROGRAM_MAP(ddragon_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, ddragon_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8) /* 1.5 Mhz */
MCFG_CPU_PROGRAM_MAP(sub_map)
@@ -1075,7 +1074,7 @@ static MACHINE_CONFIG_START( ddragon2, ddragon_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", HD6309, MAIN_CLOCK) /* 12 MHz / 4 internally */
MCFG_CPU_PROGRAM_MAP(dd2_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, ddragon_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", Z80, MAIN_CLOCK / 3) /* 4 MHz */
MCFG_CPU_PROGRAM_MAP(dd2_sub_map)
diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c
index d95e036498c..5142e59d683 100644
--- a/src/mame/drivers/ddragon3.c
+++ b/src/mame/drivers/ddragon3.c
@@ -531,24 +531,23 @@ static const ym2151_interface ym2151_config =
*
*************************************/
-static TIMER_DEVICE_CALLBACK( ddragon3_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(ddragon3_state::ddragon3_scanline)
{
- ddragon3_state *state = timer.machine().driver_data<ddragon3_state>();
int scanline = param;
/* An interrupt is generated every 16 scanlines */
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine().primary_screen->update_partial(scanline - 1);
- state->m_maincpu->set_input_line(5, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ m_maincpu->set_input_line(5, ASSERT_LINE);
}
/* Vblank is raised on scanline 248 */
if (scanline == 248)
{
- timer.machine().primary_screen->update_partial(scanline - 1);
- state->m_maincpu->set_input_line(6, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ m_maincpu->set_input_line(6, ASSERT_LINE);
}
}
@@ -593,7 +592,7 @@ static MACHINE_CONFIG_START( ddragon3, ddragon3_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz / 2)
MCFG_CPU_PROGRAM_MAP(ddragon3_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon3_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon3_state, ddragon3_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/deadang.c b/src/mame/drivers/deadang.c
index 1c24934bf27..42c1e07b1b1 100644
--- a/src/mame/drivers/deadang.c
+++ b/src/mame/drivers/deadang.c
@@ -206,26 +206,26 @@ GFXDECODE_END
/* Interrupt Generators */
-static TIMER_DEVICE_CALLBACK( deadang_main_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::deadang_main_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
if(scanline == 0) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
}
-static TIMER_DEVICE_CALLBACK( deadang_sub_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::deadang_sub_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
+ machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
if(scanline == 0) // vblank-in irq
- timer.machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
+ machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
}
/* Machine Drivers */
@@ -235,11 +235,11 @@ static MACHINE_CONFIG_START( deadang, deadang_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", V30,XTAL_16MHz/2) /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer1", deadang_main_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer1", deadang_state, deadang_main_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", V30,XTAL_16MHz/2) /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */
MCFG_CPU_PROGRAM_MAP(sub_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer2", deadang_sub_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer2", deadang_state, deadang_sub_scanline, "screen", 0, 1)
SEIBU3A_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4)
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 08c6b1b9e65..3762a4dd394 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -277,9 +277,9 @@ static const deco16ic_interface fghthist_deco16ic_tilegen2_intf =
-static TIMER_DEVICE_CALLBACK( interrupt_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(deco32_state::interrupt_gen)
{
- timer.machine().device("maincpu")->execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
}
READ32_MEMBER(deco32_state::deco32_irq_controller_r)
@@ -1742,7 +1742,7 @@ static MACHINE_CONFIG_START( captaven, deco32_state )
MCFG_MACHINE_RESET_OVERRIDE(deco32_state,deco32)
- MCFG_TIMER_ADD("int_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("int_timer", deco32_state, interrupt_gen)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1951,7 +1951,7 @@ static MACHINE_CONFIG_START( dragngun, dragngun_state )
MCFG_MACHINE_RESET_OVERRIDE(deco32_state,deco32)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("int_timer", deco32_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1992,21 +1992,20 @@ static MACHINE_CONFIG_START( dragngun, dragngun_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
-static TIMER_DEVICE_CALLBACK( lockload_vbl_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(deco32_state::lockload_vbl_irq)
{
- deco32_state *state = timer.machine().driver_data<deco32_state>();
int scanline = param;
if(scanline == 31*8)
{
- state->m_irq_source = 0;
- state->m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
+ m_irq_source = 0;
+ m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
}
if(scanline == 0)
{
- state->m_irq_source = 1;
- state->m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
+ m_irq_source = 1;
+ m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
}
}
@@ -2016,7 +2015,7 @@ static MACHINE_CONFIG_START( lockload, dragngun_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", ARM, 28000000/4)
MCFG_CPU_PROGRAM_MAP(lockload_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", lockload_vbl_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", deco32_state, lockload_vbl_irq, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 32220000/8)
MCFG_CPU_PROGRAM_MAP(nslasher_sound)
@@ -2027,7 +2026,7 @@ static MACHINE_CONFIG_START( lockload, dragngun_state )
MCFG_MACHINE_RESET_OVERRIDE(deco32_state,deco32)
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("int_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("int_timer", deco32_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index 038c31d3e86..90f80b508f3 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -167,11 +167,10 @@ READ32_MEMBER(deco_mlc_state::mlc_scanline_r)
return machine().primary_screen->vpos();
}
-static TIMER_DEVICE_CALLBACK( interrupt_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(deco_mlc_state::interrupt_gen)
{
- deco_mlc_state *state = timer.machine().driver_data<deco_mlc_state>();
// logerror("hit scanline IRQ %d (%08x)\n", machine.primary_screen->vpos(), info.i);
- timer.machine().device("maincpu")->execute().set_input_line(state->m_mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(m_mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
}
WRITE32_MEMBER(deco_mlc_state::mlc_irq_w)
@@ -384,7 +383,7 @@ static MACHINE_CONFIG_START( avengrgs, deco_mlc_state )
MCFG_MACHINE_RESET_OVERRIDE(deco_mlc_state,mlc)
MCFG_EEPROM_93C46_ADD("eeprom") /* Actually 93c45 */
- MCFG_TIMER_ADD("int_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("int_timer", deco_mlc_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -416,7 +415,7 @@ static MACHINE_CONFIG_START( mlc, deco_mlc_state )
MCFG_MACHINE_RESET_OVERRIDE(deco_mlc_state,mlc)
MCFG_EEPROM_93C46_ADD("eeprom") /* Actually 93c45 */
- MCFG_TIMER_ADD("int_timer", interrupt_gen)
+ MCFG_TIMER_DRIVER_ADD("int_timer", deco_mlc_state, interrupt_gen)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index a09e0fb7819..72d06e42466 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -760,7 +760,7 @@ static MACHINE_CONFIG_START( decocass, decocass_state )
MCFG_CPU_ADD("audiocpu", M6502, HCLK1/3/2)
MCFG_CPU_PROGRAM_MAP(decocass_sound_map)
- MCFG_TIMER_ADD_SCANLINE("audionmi", decocass_audio_nmi_gen, "screen", 0, 8)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("audionmi", decocass_state, decocass_audio_nmi_gen, "screen", 0, 8)
MCFG_CPU_ADD("mcu", I8041, HCLK)
MCFG_CPU_IO_MAP(decocass_mcu_portmap)
diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c
index ede34e453b7..22157ffea57 100644
--- a/src/mame/drivers/djboy.c
+++ b/src/mame/drivers/djboy.c
@@ -499,16 +499,16 @@ GFXDECODE_END
/******************************************************************************/
/* Main Z80 uses IM2 */
-static TIMER_DEVICE_CALLBACK( djboy_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(djboy_state::djboy_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
/* Pandora "sprite end dma" irq? TODO: timing is clearly off, attract mode relies on this */
if(scanline == 64)
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
}
static const kaneko_pandora_interface djboy_pandora_config =
@@ -572,7 +572,7 @@ static MACHINE_CONFIG_START( djboy, djboy_state )
MCFG_CPU_ADD("maincpu", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(cpu0_am)
MCFG_CPU_IO_MAP(cpu0_port_am)
- MCFG_TIMER_ADD_SCANLINE("scantimer", djboy_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", djboy_state, djboy_scanline, "screen", 0, 1)
MCFG_CPU_ADD("cpu1", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(cpu1_am)
diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c
index 2a522ad2345..3bf2e2522bb 100644
--- a/src/mame/drivers/dooyong.c
+++ b/src/mame/drivers/dooyong.c
@@ -1062,15 +1062,15 @@ static MACHINE_CONFIG_START( primella, dooyong_state )
MCFG_FRAGMENT_ADD( sound_2151 )
MACHINE_CONFIG_END
-static TIMER_DEVICE_CALLBACK( rshark_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(dooyong_state::rshark_scanline)
{
int scanline = param;
if(scanline == 248) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
if(scanline == 120) // timer irq?
- timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
}
@@ -1079,7 +1079,7 @@ static MACHINE_CONFIG_START( rshark, dooyong_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 8000000) /* measured on super-x */
MCFG_CPU_PROGRAM_MAP(rshark_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", rshark_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* measured on super-x */
MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
@@ -1109,7 +1109,7 @@ static MACHINE_CONFIG_START( superx, dooyong_state ) // dif mem map
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 8000000) /* measured on super-x */
MCFG_CPU_PROGRAM_MAP(superx_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", rshark_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* measured on super-x */
MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
@@ -1139,7 +1139,7 @@ static MACHINE_CONFIG_START( popbingo, dooyong_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 10000000)
MCFG_CPU_PROGRAM_MAP(popbingo_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", rshark_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* measured on super-x */
MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c
index a6c06e21aa9..3944d186971 100644
--- a/src/mame/drivers/dragrace.c
+++ b/src/mame/drivers/dragrace.c
@@ -10,26 +10,25 @@ Atari Drag Race Driver
#include "sound/discrete.h"
-static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(dragrace_state::dragrace_frame_callback)
{
- dragrace_state *state = timer.machine().driver_data<dragrace_state>();
int i;
static const char *const portnames[] = { "P1", "P2" };
for (i = 0; i < 2; i++)
{
- switch (timer.machine().root_device().ioport(portnames[i])->read())
+ switch (machine().root_device().ioport(portnames[i])->read())
{
- case 0x01: state->m_gear[i] = 1; break;
- case 0x02: state->m_gear[i] = 2; break;
- case 0x04: state->m_gear[i] = 3; break;
- case 0x08: state->m_gear[i] = 4; break;
- case 0x10: state->m_gear[i] = 0; break;
+ case 0x01: m_gear[i] = 1; break;
+ case 0x02: m_gear[i] = 2; break;
+ case 0x04: m_gear[i] = 3; break;
+ case 0x08: m_gear[i] = 4; break;
+ case 0x10: m_gear[i] = 0; break;
}
}
/* watchdog is disabled during service mode */
- timer.machine().watchdog_enable(timer.machine().root_device().ioport("IN0")->read() & 0x20);
+ machine().watchdog_enable(machine().root_device().ioport("IN0")->read() & 0x20);
}
@@ -336,7 +335,7 @@ static MACHINE_CONFIG_START( dragrace, dragrace_state )
MCFG_WATCHDOG_VBLANK_INIT(8)
- MCFG_TIMER_ADD_PERIODIC("frame_timer", dragrace_frame_callback, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("frame_timer", dragrace_state, dragrace_frame_callback, attotime::from_hz(60))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index c4831c7c8b0..0181bf3d93a 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -4745,24 +4745,23 @@ void neruton_update_irq( running_machine &machine )
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x42);
}
-static TIMER_DEVICE_CALLBACK( neruton_irq_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::neruton_irq_scanline)
{
- dynax_state *state = timer.machine().driver_data<dynax_state>();
int scanline = param;
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
- if (state->m_blitter_irq) return;
+ if (m_blitter_irq) return;
if(scanline == 256)
- state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
else if((scanline % 32) == 0)
- state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x46);
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x46);
}
static MACHINE_CONFIG_DERIVED( neruton, mjelctrn )
MCFG_CPU_MODIFY("maincpu")
- MCFG_TIMER_ADD_SCANLINE("scantimer", neruton_irq_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, neruton_irq_scanline, "screen", 0, 1)
MCFG_VIDEO_START_OVERRIDE(dynax_state,neruton)
MACHINE_CONFIG_END
@@ -4775,24 +4774,23 @@ MACHINE_CONFIG_END
0x42 and 0x44 are very similar, they should be triggered by the blitter
0x40 is vblank */
-static TIMER_DEVICE_CALLBACK( majxtal7_vblank_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::majxtal7_vblank_interrupt)
{
- dynax_state *state = timer.machine().driver_data<dynax_state>();
int scanline = param;
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
- if (state->m_blitter_irq) return;
+ if (m_blitter_irq) return;
if(scanline == 256)
- state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
else if((scanline % 32) == 0)
- state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x44); // temp kludge
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x44); // temp kludge
}
static MACHINE_CONFIG_DERIVED( majxtal7, neruton )
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(majxtal7_vblank_interrupt)
+ MCFG_TIMER_DRIVER_CALLBACK(dynax_state, majxtal7_vblank_interrupt)
MACHINE_CONFIG_END
@@ -4861,16 +4859,15 @@ MACHINE_CONFIG_END
Mahjong Tenkaigen
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( tenkai_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::tenkai_interrupt)
{
- dynax_state *state = timer.machine().driver_data<dynax_state>();
int scanline = param;
if(scanline == 256)
- state->m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
if(scanline == 0)
- state->m_maincpu->set_input_line(INPUT_LINE_IRQ1, HOLD_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_IRQ1, HOLD_LINE);
}
static const ay8910_interface tenkai_ay8910_interface =
@@ -4905,7 +4902,7 @@ static MACHINE_CONFIG_START( tenkai, dynax_state )
MCFG_CPU_ADD("maincpu",TMP91640, 21472700 / 2)
MCFG_CPU_PROGRAM_MAP(tenkai_map)
MCFG_CPU_IO_MAP(tenkai_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", tenkai_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, tenkai_interrupt, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(dynax_state,tenkai)
MCFG_MACHINE_RESET_OVERRIDE(dynax_state,dynax)
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index f3af45b2091..30aef09349c 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -575,26 +575,26 @@ static WRITE_LINE_DEVICE_HANDLER( equites_msm5232_gate )
// Interrupt Handlers
// Equites Hardware
-static TIMER_DEVICE_CALLBACK( equites_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(equites_state::equites_scanline)
{
int scanline = param;
if(scanline == 232) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
if(scanline == 24) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( splndrbt_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(equites_state::splndrbt_scanline)
{
int scanline = param;
if(scanline == 224) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
if(scanline == 32) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
}
WRITE8_MEMBER(equites_state::equites_8155_w)
@@ -1249,7 +1249,7 @@ static MACHINE_CONFIG_START( equites, equites_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz/4) /* 68000P8 running at 3mhz! verified on pcb */
MCFG_CPU_PROGRAM_MAP(equites_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", equites_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", equites_state, equites_scanline, "screen", 0, 1)
MCFG_FRAGMENT_ADD(common_sound)
@@ -1286,7 +1286,7 @@ static MACHINE_CONFIG_START( splndrbt, equites_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/4) /* 68000P8 running at 6mhz, verified on pcb */
MCFG_CPU_PROGRAM_MAP(splndrbt_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", splndrbt_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", equites_state, splndrbt_scanline, "screen", 0, 1)
MCFG_FRAGMENT_ADD(common_sound)
diff --git a/src/mame/drivers/espial.c b/src/mame/drivers/espial.c
index c94922951ce..e99547384d5 100644
--- a/src/mame/drivers/espial.c
+++ b/src/mame/drivers/espial.c
@@ -75,16 +75,15 @@ WRITE8_MEMBER(espial_state::espial_sound_nmi_mask_w)
m_sound_nmi_enabled = data & 1;
}
-static TIMER_DEVICE_CALLBACK( espial_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(espial_state::espial_scanline)
{
- espial_state *state = timer.machine().driver_data<espial_state>();
int scanline = param;
- if(scanline == 240 && state->m_main_nmi_enabled) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if(scanline == 240 && m_main_nmi_enabled) // vblank-out irq
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
if(scanline == 16) // timer irq, checks soundlatch port then updates some sound related work RAM buffers
- timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
}
@@ -322,7 +321,7 @@ static MACHINE_CONFIG_START( espial, espial_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 3072000) /* 3.072 MHz */
MCFG_CPU_PROGRAM_MAP(espial_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", espial_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", espial_state, espial_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3072000) /* 2 MHz?????? */
MCFG_CPU_PROGRAM_MAP(espial_sound_map)
diff --git a/src/mame/drivers/exedexes.c b/src/mame/drivers/exedexes.c
index 57f552c78cf..3282821a8e9 100644
--- a/src/mame/drivers/exedexes.c
+++ b/src/mame/drivers/exedexes.c
@@ -16,15 +16,15 @@
#include "includes/exedexes.h"
-static TIMER_DEVICE_CALLBACK( exedexes_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(exedexes_state::exedexes_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
if(scanline == 0) // unknown irq event
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
}
@@ -228,7 +228,7 @@ static MACHINE_CONFIG_START( exedexes, exedexes_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz (?) */
MCFG_CPU_PROGRAM_MAP(exedexes_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", exedexes_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exedexes_state, exedexes_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3000000) /* 3 MHz ??? */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index 1de05e0c314..5ea1627c284 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -193,12 +193,11 @@ WRITE16_MEMBER(exterm_state::sound_latch_w)
*
*************************************/
-static TIMER_DEVICE_CALLBACK( master_sound_nmi_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(exterm_state::master_sound_nmi_callback)
{
- exterm_state *state = timer.machine().driver_data<exterm_state>();
/* bit 0 of the sound control determines if the NMI is actually delivered */
- if (state->m_sound_control & 0x01)
- timer.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_sound_control & 0x01)
+ machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -457,7 +456,7 @@ static MACHINE_CONFIG_START( exterm, exterm_state )
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_ADD("snd_nmi_timer", master_sound_nmi_callback)
+ MCFG_TIMER_DRIVER_ADD("snd_nmi_timer", exterm_state, master_sound_nmi_callback)
/* video hardware */
MCFG_PALETTE_LENGTH(2048+32768)
diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c
index c8745136123..fa0ecdc2fa9 100644
--- a/src/mame/drivers/fastlane.c
+++ b/src/mame/drivers/fastlane.c
@@ -16,16 +16,15 @@
#include "includes/konamipt.h"
#include "includes/fastlane.h"
-static TIMER_DEVICE_CALLBACK( fastlane_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(fastlane_state::fastlane_scanline)
{
- fastlane_state *state = timer.machine().driver_data<fastlane_state>();
int scanline = param;
- address_space &space = state->generic_space();
- if(scanline == 240 && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x02) // vblank irq
- state->m_maincpu->set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
- else if(((scanline % 32) == 0) && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x01) // timer irq
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ address_space &space = generic_space();
+ if(scanline == 240 && k007121_ctrlram_r(m_k007121, space, 7) & 0x02) // vblank irq
+ m_maincpu->set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
+ else if(((scanline % 32) == 0) && k007121_ctrlram_r(m_k007121, space, 7) & 0x01) // timer irq
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -219,7 +218,7 @@ static MACHINE_CONFIG_START( fastlane, fastlane_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", HD6309, 3000000*4) /* 24MHz/8? */
MCFG_CPU_PROGRAM_MAP(fastlane_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", fastlane_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", fastlane_state, fastlane_scanline, "screen", 0, 1)
/* video hardware */
diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c
index edb1c4f7693..b01e00ff0fa 100644
--- a/src/mame/drivers/finalizr.c
+++ b/src/mame/drivers/finalizr.c
@@ -22,15 +22,14 @@
-static TIMER_DEVICE_CALLBACK( finalizr_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(finalizr_state::finalizr_scanline)
{
- finalizr_state *state = timer.machine().driver_data<finalizr_state>();
int scanline = param;
- if(scanline == 240 && state->m_irq_enable) // vblank irq
- timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE);
- else if(((scanline % 32) == 0) && state->m_nmi_enable) // timer irq
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if(scanline == 240 && m_irq_enable) // vblank irq
+ machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE);
+ else if(((scanline % 32) == 0) && m_nmi_enable) // timer irq
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -279,7 +278,7 @@ static MACHINE_CONFIG_START( finalizr, finalizr_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809,XTAL_18_432MHz/6) /* ??? */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", finalizr_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", finalizr_state, finalizr_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", I8039,XTAL_18_432MHz/2) /* 9.216MHz clkin ?? */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index eb4fbc6fa6d..a654a6536f8 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -113,7 +113,7 @@ static void update_interrupts(running_machine &machine)
}
-static TIMER_DEVICE_CALLBACK( scanline_update )
+TIMER_DEVICE_CALLBACK_MEMBER(foodf_state::scanline_update)
{
int scanline = param;
@@ -123,7 +123,7 @@ static TIMER_DEVICE_CALLBACK( scanline_update )
mystery yet */
/* INT 1 is on 32V */
- atarigen_scanline_int_gen(timer.machine().device("maincpu"));
+ atarigen_scanline_int_gen(machine().device("maincpu"));
/* advance to the next interrupt */
scanline += 64;
@@ -131,7 +131,7 @@ static TIMER_DEVICE_CALLBACK( scanline_update )
scanline = 0;
/* set a timer for it */
- timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(machine().primary_screen->time_until_pos(scanline), scanline);
}
@@ -363,7 +363,7 @@ static MACHINE_CONFIG_START( foodf, foodf_state )
MCFG_WATCHDOG_VBLANK_INIT(8)
- MCFG_TIMER_ADD("scan_timer", scanline_update)
+ MCFG_TIMER_DRIVER_ADD("scan_timer", foodf_state, scanline_update)
/* video hardware */
MCFG_GFXDECODE(foodf)
diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c
index b5f86013da6..60b968de9b4 100644
--- a/src/mame/drivers/gaelco2.c
+++ b/src/mame/drivers/gaelco2.c
@@ -288,7 +288,7 @@ static MACHINE_CONFIG_START( bang, gaelco2_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 30000000/2) /* 15 MHz */
MCFG_CPU_PROGRAM_MAP(bang_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bang_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gaelco2_state, bang_irq, "screen", 0, 1)
MCFG_EEPROM_ADD("eeprom", gaelco2_eeprom_interface)
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index 5a9cc681c10..a31b7a0e239 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -623,34 +623,33 @@ WRITE16_MEMBER(gaelco3d_state::adsp_rombank_w)
*
*************************************/
-static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(gaelco3d_state::adsp_autobuffer_irq)
{
- gaelco3d_state *state = timer.machine().driver_data<gaelco3d_state>();
- cpu_device *adsp = timer.machine().device<cpu_device>("adsp");
+ cpu_device *adsp = machine().device<cpu_device>("adsp");
/* get the index register */
- int reg = adsp->state_int(ADSP2100_I0 + state->m_adsp_ireg);
+ int reg = adsp->state_int(ADSP2100_I0 + m_adsp_ireg);
/* copy the current data into the buffer */
-// logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", state->m_adsp_ireg, reg, state->m_adsp_incs, state->m_adsp_size);
- if (state->m_adsp_incs)
- dmadac_transfer(&state->m_dmadac[0], SOUND_CHANNELS, state->m_adsp_incs, SOUND_CHANNELS * state->m_adsp_incs, state->m_adsp_size / (SOUND_CHANNELS * state->m_adsp_incs), (INT16 *)&state->m_adsp_fastram_base[reg - 0x3800]);
+// logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", m_adsp_ireg, reg, m_adsp_incs, m_adsp_size);
+ if (m_adsp_incs)
+ dmadac_transfer(&m_dmadac[0], SOUND_CHANNELS, m_adsp_incs, SOUND_CHANNELS * m_adsp_incs, m_adsp_size / (SOUND_CHANNELS * m_adsp_incs), (INT16 *)&m_adsp_fastram_base[reg - 0x3800]);
/* increment it */
- reg += state->m_adsp_size;
+ reg += m_adsp_size;
/* check for wrapping */
- if (reg >= state->m_adsp_ireg_base + state->m_adsp_size)
+ if (reg >= m_adsp_ireg_base + m_adsp_size)
{
/* reset the base pointer */
- reg = state->m_adsp_ireg_base;
+ reg = m_adsp_ireg_base;
/* generate the (internal, thats why the pulse) irq */
- generic_pulse_irq_line(adsp, ADSP2105_IRQ1, 1);
+ generic_pulse_irq_line(*adsp, ADSP2105_IRQ1, 1);
}
/* store it */
- adsp->set_state_int(ADSP2100_I0 + state->m_adsp_ireg, reg);
+ adsp->set_state_int(ADSP2100_I0 + m_adsp_ireg, reg);
}
@@ -1009,7 +1008,7 @@ static MACHINE_CONFIG_START( gaelco3d, gaelco3d_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_TIMER_ADD("adsp_timer", adsp_autobuffer_irq)
+ MCFG_TIMER_DRIVER_ADD("adsp_timer", gaelco3d_state, adsp_autobuffer_irq)
MCFG_GAELCO_SERIAL_ADD("serial", 0, serial_interface)
/* video hardware */
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index 11d7897e3e5..16e97a77cd5 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -1261,9 +1261,9 @@ WRITE8_MEMBER(galaxian_state::checkman_sound_command_w)
}
-static TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(galaxian_state::checkmaj_irq0_gen)
{
- timer.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
}
@@ -2096,7 +2096,7 @@ static MACHINE_CONFIG_START( galaxian_base, galaxian_state )
/* blinking frequency is determined by 555 counter with Ra=100k, Rb=10k, C=10uF */
- MCFG_TIMER_ADD_PERIODIC("stars", galaxian_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("stars", galaxian_state, galaxian_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -2276,7 +2276,7 @@ static MACHINE_CONFIG_DERIVED( checkmaj, galaxian_base )
MCFG_CPU_ADD("audiocpu", Z80, 1620000)
MCFG_CPU_PROGRAM_MAP(checkmaj_sound_map)
- MCFG_TIMER_ADD_SCANLINE("irq0", checkmaj_irq0_gen, "screen", 0, 8)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("irq0", galaxian_state, checkmaj_irq0_gen, "screen", 0, 8)
/* sound hardware */
MCFG_SOUND_ADD("aysnd", AY8910, 1620000)
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index 7de29557917..a69142764b3 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -2179,7 +2179,7 @@ static MACHINE_CONFIG_START( galaxold_base, galaxold_state )
MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
- MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
+ MCFG_TIMER_DRIVER_ADD("int_timer", galaxold_state, galaxold_interrupt_timer)
/* video hardware */
MCFG_GFXDECODE(galaxian)
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 46c3069cd24..405b60924b4 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -542,39 +542,37 @@ GFXDECODE_END
/* CPU#1 Interrups , lev 3,4 & 5 are tested on power up. The rest is rte, but lev 6 */
-static TIMER_DEVICE_CALLBACK( galpani2_interrupt1 )
+TIMER_DEVICE_CALLBACK_MEMBER(galpani2_state::galpani2_interrupt1)
{
- galpani2_state *state = timer.machine().driver_data<galpani2_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(5, HOLD_LINE);
+ m_maincpu->set_input_line(5, HOLD_LINE);
/* MCU related? */
if(scanline == 128)
{
- state->m_maincpu->set_input_line(3, HOLD_LINE);
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(3, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
}
if(scanline == 0)
- state->m_maincpu->set_input_line(6, HOLD_LINE); // hblank?
+ m_maincpu->set_input_line(6, HOLD_LINE); // hblank?
}
/* CPU#2 interrupts, lev 3,4 & 5 are tested on power up. The rest is rte, but lev 7 */
-static TIMER_DEVICE_CALLBACK( galpani2_interrupt2 )
+TIMER_DEVICE_CALLBACK_MEMBER(galpani2_state::galpani2_interrupt2)
{
- galpani2_state *state = timer.machine().driver_data<galpani2_state>();
int scanline = param;
if(scanline == 240)
- state->m_subcpu->set_input_line(5, HOLD_LINE);
+ m_subcpu->set_input_line(5, HOLD_LINE);
if(scanline == 128)
- state->m_subcpu->set_input_line(4, HOLD_LINE);
+ m_subcpu->set_input_line(4, HOLD_LINE);
if(scanline == 0)
- state->m_subcpu->set_input_line(3, HOLD_LINE);
+ m_subcpu->set_input_line(3, HOLD_LINE);
}
static MACHINE_CONFIG_START( galpani2, galpani2_state )
@@ -582,12 +580,12 @@ static MACHINE_CONFIG_START( galpani2, galpani2_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_27MHz/2) /* Confirmed on galpani2i PCB */
MCFG_CPU_PROGRAM_MAP(galpani2_mem1)
- MCFG_TIMER_ADD_SCANLINE("m_scantimer", galpani2_interrupt1, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("m_scantimer", galpani2_state, galpani2_interrupt1, "screen", 0, 1)
//MCFG_QUANTUM_PERFECT_CPU("maincpu")
MCFG_CPU_ADD("sub", M68000, XTAL_27MHz/2) /* Confirmed on galpani2i PCB */
MCFG_CPU_PROGRAM_MAP(galpani2_mem2)
- MCFG_TIMER_ADD_SCANLINE("s_scantimer", galpani2_interrupt2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", galpani2_state, galpani2_interrupt2, "screen", 0, 1)
MCFG_EEPROM_93C46_ADD("eeprom")
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index 0e746c9f9b1..227404fb4fb 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -134,32 +134,32 @@ void galpanic_state::screen_eof_galpanic(screen_device &screen, bool state)
}
}
-static TIMER_DEVICE_CALLBACK( galpanic_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(galpanic_state::galpanic_scanline)
{
int scanline = param;
if(scanline == 224) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
/* Pandora "sprite end dma" irq? */
if(scanline == 32)
- timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( galhustl_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(galpanic_state::galhustl_scanline)
{
int scanline = param;
if(scanline == 224) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
/* Pandora "sprite end dma" irq? */
if(scanline == 32)
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
if(scanline == 0) // timer irq?
- timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
}
@@ -559,7 +559,7 @@ static MACHINE_CONFIG_START( galpanic, galpanic_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(galpanic_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", galpanic_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", galpanic_state, galpanic_scanline, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -621,7 +621,7 @@ static MACHINE_CONFIG_DERIVED( supmodel, comad )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(12000000) /* ? */
MCFG_CPU_PROGRAM_MAP(supmodel_map)
-// MCFG_TIMER_ADD_SCANLINE("scantimer", galpanic_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", galpanic_state, galpanic_scanline, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
@@ -654,7 +654,7 @@ static MACHINE_CONFIG_DERIVED( galhustl, comad )
MCFG_CPU_CLOCK(12000000) /* ? */
MCFG_CPU_PROGRAM_MAP(galhustl_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(galhustl_scanline)
+ MCFG_TIMER_DRIVER_CALLBACK(galpanic_state, galhustl_scanline)
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
@@ -673,7 +673,7 @@ static MACHINE_CONFIG_DERIVED( zipzap, comad )
MCFG_CPU_CLOCK(12000000) /* ? */
MCFG_CPU_PROGRAM_MAP(zipzap_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(galhustl_scanline)
+ MCFG_TIMER_DRIVER_CALLBACK(galpanic_state, galhustl_scanline)
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
diff --git a/src/mame/drivers/gberet.c b/src/mame/drivers/gberet.c
index 4639539a344..fb7c6b76d44 100644
--- a/src/mame/drivers/gberet.c
+++ b/src/mame/drivers/gberet.c
@@ -82,23 +82,22 @@
*
*************************************/
-static TIMER_DEVICE_CALLBACK( gberet_interrupt_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(gberet_state::gberet_interrupt_tick)
{
- gberet_state *state = timer.machine().driver_data<gberet_state>();
- UINT8 ticks_mask = ~state->m_interrupt_ticks & (state->m_interrupt_ticks + 1); // 0->1
- state->m_interrupt_ticks++;
+ UINT8 ticks_mask = ~m_interrupt_ticks & (m_interrupt_ticks + 1); // 0->1
+ m_interrupt_ticks++;
// NMI on d0
- if (ticks_mask & state->m_interrupt_mask & 1)
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ if (ticks_mask & m_interrupt_mask & 1)
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
// IRQ on d3 (used by mrgoemon)
- if (ticks_mask & state->m_interrupt_mask<<2 & 8)
- timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ if (ticks_mask & m_interrupt_mask<<2 & 8)
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
// IRQ on d4 (used by gberet)
- if (ticks_mask & state->m_interrupt_mask<<2 & 16)
- timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ if (ticks_mask & m_interrupt_mask<<2 & 16)
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
}
@@ -423,7 +422,7 @@ static MACHINE_CONFIG_START( gberet, gberet_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) // X1S (generated by a custom IC)
MCFG_CPU_PROGRAM_MAP(gberet_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", gberet_interrupt_tick, "screen", 0, 16) // ?
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gberet_state, gberet_interrupt_tick, "screen", 0, 16)
MCFG_MACHINE_START_OVERRIDE(gberet_state,gberet)
MCFG_MACHINE_RESET_OVERRIDE(gberet_state,gberet)
diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c
index 32e62d7e34d..fbd3e240029 100644
--- a/src/mame/drivers/gradius3.c
+++ b/src/mame/drivers/gradius3.c
@@ -106,16 +106,15 @@ INTERRUPT_GEN_MEMBER(gradius3_state::cpuA_interrupt)
}
-static TIMER_DEVICE_CALLBACK( gradius3_sub_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(gradius3_state::gradius3_sub_scanline)
{
- gradius3_state *state = timer.machine().driver_data<gradius3_state>();
int scanline = param;
- if(scanline == 240 && state->m_irqBmask & 1) // vblank-out irq
- timer.machine().device("sub")->execute().set_input_line(1, HOLD_LINE);
+ if(scanline == 240 && m_irqBmask & 1) // vblank-out irq
+ machine().device("sub")->execute().set_input_line(1, HOLD_LINE);
- if(scanline == 16 && state->m_irqBmask & 2) // sprite end DMA irq
- timer.machine().device("sub")->execute().set_input_line(2, HOLD_LINE);
+ if(scanline == 16 && m_irqBmask & 2) // sprite end DMA irq
+ machine().device("sub")->execute().set_input_line(2, HOLD_LINE);
}
WRITE16_MEMBER(gradius3_state::cpuB_irqtrigger_w)
@@ -320,7 +319,7 @@ static MACHINE_CONFIG_START( gradius3, gradius3_state )
MCFG_CPU_ADD("sub", M68000, 10000000) /* 10 MHz */
MCFG_CPU_PROGRAM_MAP(gradius3_map2)
- MCFG_TIMER_ADD_SCANLINE("scantimer", gradius3_sub_scanline, "screen", 0, 1) /* has three interrupt vectors, 1 2 and 4 */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gradius3_state, gradius3_sub_scanline, "screen", 0, 1)
/* 4 is triggered by cpu A, the others are unknown but */
/* required for the game to run. */
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index b5042efbf00..90a1adad645 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -381,14 +381,14 @@ void gundealr_state::machine_reset()
m_scroll[3] = 0;
}
-static TIMER_DEVICE_CALLBACK( gundealr_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(gundealr_state::gundealr_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
else if((scanline == 0) || (scanline == 120) ) //timer irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 10h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 10h */
}
static const ym2203_interface ym2203_config =
@@ -410,7 +410,7 @@ static MACHINE_CONFIG_START( gundealr, gundealr_state )
MCFG_CPU_ADD("maincpu", Z80, 8000000) /* 8 MHz ??? */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_IO_MAP(main_portmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", gundealr_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gundealr_state, gundealr_scanline, "screen", 0, 1)
/* video hardware */
@@ -433,20 +433,19 @@ static MACHINE_CONFIG_START( gundealr, gundealr_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
-static TIMER_DEVICE_CALLBACK( yamyam_mcu_sim )
+TIMER_DEVICE_CALLBACK_MEMBER(gundealr_state::yamyam_mcu_sim)
{
- gundealr_state *state = timer.machine().driver_data<gundealr_state>();
static const UINT8 snipped_cmd03[8] = { 0x3a, 0x00, 0xc0, 0x47, 0x3a, 0x01, 0xc0, 0xc9 };
static const UINT8 snipped_cmd05_1[5] = { 0xcd, 0x20, 0xe0, 0x7e, 0xc9 };
static const UINT8 snipped_cmd05_2[8] = { 0xc5, 0x01, 0x00, 0x00, 0x4f, 0x09, 0xc1, 0xc9 };
int i;
- //logerror("e000 = %02x\n", state->m_rambase[0x000]);
- switch(state->m_rambase[0x000])
+ //logerror("e000 = %02x\n", m_rambase[0x000]);
+ switch(m_rambase[0x000])
{
case 0x03:
- state->m_rambase[0x001] = 0x03;
+ m_rambase[0x001] = 0x03;
/*
read dip switches
3a 00 c0 ld a,($c000)
@@ -455,14 +454,14 @@ static TIMER_DEVICE_CALLBACK( yamyam_mcu_sim )
c9 ret
*/
for(i=0;i<8;i++)
- state->m_rambase[0x010+i] = snipped_cmd03[i];
+ m_rambase[0x010+i] = snipped_cmd03[i];
break;
case 0x04:
- state->m_rambase[0x001] = 0x04;
+ m_rambase[0x001] = 0x04;
break;
case 0x05:
- state->m_rambase[0x001] = 0x05;
+ m_rambase[0x001] = 0x05;
/*
add a to hl
c5 push bc
@@ -473,7 +472,7 @@ static TIMER_DEVICE_CALLBACK( yamyam_mcu_sim )
c9 ret
*/
for(i=0;i<8;i++)
- state->m_rambase[0x020+i] = snipped_cmd05_2[i];
+ m_rambase[0x020+i] = snipped_cmd05_2[i];
/*
lookup data in table
@@ -482,25 +481,25 @@ static TIMER_DEVICE_CALLBACK( yamyam_mcu_sim )
c9 ret
*/
for(i=0;i<5;i++)
- state->m_rambase[0x010+i] = snipped_cmd05_1[i];
+ m_rambase[0x010+i] = snipped_cmd05_1[i];
break;
case 0x0a:
- state->m_rambase[0x001] = 0x08;
+ m_rambase[0x001] = 0x08;
break;
case 0x0d:
- state->m_rambase[0x001] = 0x07;
+ m_rambase[0x001] = 0x07;
break;
}
- state->m_rambase[0x004] = timer.machine().root_device().ioport("IN2")->read();
- state->m_rambase[0x005] = timer.machine().root_device().ioport("IN1")->read();
- state->m_rambase[0x006] = timer.machine().root_device().ioport("IN0")->read();
+ m_rambase[0x004] = machine().root_device().ioport("IN2")->read();
+ m_rambase[0x005] = machine().root_device().ioport("IN1")->read();
+ m_rambase[0x006] = machine().root_device().ioport("IN0")->read();
}
static MACHINE_CONFIG_DERIVED( yamyam, gundealr )
- MCFG_TIMER_ADD_PERIODIC("mcusim", yamyam_mcu_sim, attotime::from_hz(8000000/60)) // not real, but for simulating the MCU
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("mcusim", gundealr_state, yamyam_mcu_sim, attotime::from_hz(8000000/60))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c
index 0d267f614b4..cd124e05d69 100644
--- a/src/mame/drivers/hexion.c
+++ b/src/mame/drivers/hexion.c
@@ -199,15 +199,14 @@ static GFXDECODE_START( hexion )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 )
GFXDECODE_END
-static TIMER_DEVICE_CALLBACK( hexion_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(hexion_state::hexion_scanline)
{
- //hexion_state *state = timer.machine().driver_data<hexion_state>();
int scanline = param;
if(scanline == 256)
- timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
else if ((scanline == 85) || (scanline == 170)) //TODO
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
static const k053252_interface hexion_k053252_intf =
@@ -225,7 +224,7 @@ static MACHINE_CONFIG_START( hexion, hexion_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,24000000/4) /* Z80B 6 MHz */
MCFG_CPU_PROGRAM_MAP(hexion_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", hexion_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hexion_state, hexion_scanline, "screen", 0, 1)
MCFG_K053252_ADD("k053252", 24000000/2, hexion_k053252_intf)
diff --git a/src/mame/drivers/higemaru.c b/src/mame/drivers/higemaru.c
index ac45f1412eb..070a211faf9 100644
--- a/src/mame/drivers/higemaru.c
+++ b/src/mame/drivers/higemaru.c
@@ -16,15 +16,15 @@ Use Player 1 joystick and button, then press START1 to go to next screen.
#include "includes/higemaru.h"
-static TIMER_DEVICE_CALLBACK( higemaru_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(higemaru_state::higemaru_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h - vblank */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h - vblank */
if(scanline == 0) // unknown irq event, does various stuff like copying the spriteram
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h */
}
@@ -162,7 +162,7 @@ static MACHINE_CONFIG_START( higemaru, higemaru_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/4) /* 3 MHz Sharp LH0080A Z80A-CPU-D */
MCFG_CPU_PROGRAM_MAP(higemaru_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", higemaru_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", higemaru_state, higemaru_scanline, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 168661ffafc..445da95c64c 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -1757,17 +1757,16 @@ void hng64_state::m_set_irq(UINT32 irq_vector)
m_maincpu->set_input_line(0, CLEAR_LINE);
}
-static TIMER_DEVICE_CALLBACK( hng64_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(hng64_state::hng64_irq)
{
- hng64_state *state = timer.machine().driver_data<hng64_state>();
int scanline = param;
switch(scanline)
{
- case 224*2: state->m_set_irq(0x0001); break; // lv 0 vblank irq
- //case 0*2: state->m_set_irq(0x0002); break; // lv 1
- //case 64*2: state->m_set_irq(0x0004); break; // lv 2
- case 128*2: state->m_set_irq(0x0800); break; // lv 11 network irq?
+ case 224*2: m_set_irq(0x0001); break; // lv 0 vblank irq
+ //case 0*2: m_set_irq(0x0002); break; // lv 1
+ //case 64*2: m_set_irq(0x0004); break; // lv 2
+ case 128*2: m_set_irq(0x0800); break; // lv 11 network irq?
}
}
@@ -1832,7 +1831,7 @@ static MACHINE_CONFIG_START( hng64, hng64_state )
MCFG_CPU_ADD("maincpu", VR4300BE, MASTER_CLOCK) // actually R4300
MCFG_CPU_CONFIG(vr4300_config)
MCFG_CPU_PROGRAM_MAP(hng_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", hng64_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hng64_state, hng64_irq, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", V33, 8000000) // v53, 16? mhz!
MCFG_CPU_PROGRAM_MAP(hng_sound_map)
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index 307b99dbc17..112aa501f70 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -58,23 +58,22 @@ TIMER_CALLBACK_MEMBER(hyprduel_state::vblank_end_callback)
m_requested_int &= ~param;
}
-static TIMER_DEVICE_CALLBACK( hyprduel_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(hyprduel_state::hyprduel_interrupt)
{
- hyprduel_state *state = timer.machine().driver_data<hyprduel_state>();
int line = param;
if (line == 0) /* TODO: fix this! */
{
- state->m_requested_int |= 0x01; /* vblank */
- state->m_requested_int |= 0x20;
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_requested_int |= 0x01; /* vblank */
+ m_requested_int |= 0x20;
+ m_maincpu->set_input_line(2, HOLD_LINE);
/* the duration is a guess */
- timer.machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(hyprduel_state::vblank_end_callback),state), 0x20);
+ machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(hyprduel_state::vblank_end_callback),this), 0x20);
}
else
- state->m_requested_int |= 0x12; /* hsync */
+ m_requested_int |= 0x12; /* hsync */
- update_irq_state(timer.machine());
+ update_irq_state(machine());
}
READ16_MEMBER(hyprduel_state::hyprduel_irq_cause_r)
@@ -669,7 +668,7 @@ static MACHINE_CONFIG_START( hyprduel, hyprduel_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,20000000/2) /* 10MHz */
MCFG_CPU_PROGRAM_MAP(hyprduel_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", hyprduel_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hyprduel_state, hyprduel_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("sub", M68000,20000000/2) /* 10MHz */
MCFG_CPU_PROGRAM_MAP(hyprduel_map2)
@@ -710,7 +709,7 @@ static MACHINE_CONFIG_START( magerror, hyprduel_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,20000000/2) /* 10MHz */
MCFG_CPU_PROGRAM_MAP(magerror_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", hyprduel_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hyprduel_state, hyprduel_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("sub", M68000,20000000/2) /* 10MHz */
MCFG_CPU_PROGRAM_MAP(magerror_map2)
diff --git a/src/mame/drivers/ikki.c b/src/mame/drivers/ikki.c
index 1673f493b9b..d3872bddefb 100644
--- a/src/mame/drivers/ikki.c
+++ b/src/mame/drivers/ikki.c
@@ -239,16 +239,15 @@ void ikki_state::machine_reset()
m_flipscreen = 0;
}
-static TIMER_DEVICE_CALLBACK( ikki_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(ikki_state::ikki_irq)
{
- ikki_state *state = timer.machine().driver_data<ikki_state>();
int scanline = param;
if(scanline == 240 || scanline == 120) // TODO: where non-timer IRQ happens?
{
- state->m_maincpu->set_input_line(0,HOLD_LINE);
+ m_maincpu->set_input_line(0,HOLD_LINE);
- state->m_irq_source = (scanline != 240);
+ m_irq_source = (scanline != 240);
}
}
@@ -260,7 +259,7 @@ static MACHINE_CONFIG_START( ikki, ikki_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,8000000/2) /* 4.000MHz */
MCFG_CPU_PROGRAM_MAP(ikki_cpu1)
- MCFG_TIMER_ADD_SCANLINE("scantimer", ikki_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ikki_state, ikki_irq, "screen", 0, 1)
MCFG_CPU_ADD("sub", Z80,8000000/2) /* 4.000MHz */
MCFG_CPU_PROGRAM_MAP(ikki_cpu2)
diff --git a/src/mame/drivers/iqblock.c b/src/mame/drivers/iqblock.c
index 470adf7a58c..84965deda63 100644
--- a/src/mame/drivers/iqblock.c
+++ b/src/mame/drivers/iqblock.c
@@ -73,18 +73,17 @@ WRITE8_MEMBER(iqblock_state::grndtour_prot_w)
}
-static TIMER_DEVICE_CALLBACK( iqblock_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(iqblock_state::iqblock_irq)
{
- iqblock_state *state = timer.machine().driver_data<iqblock_state>();
int scanline = param;
if((scanline % 16) != 0)
return;
if((scanline % 32) == 16)
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_maincpu->set_input_line(0, HOLD_LINE);
else if ((scanline % 32) == 0)
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -275,7 +274,7 @@ static MACHINE_CONFIG_START( iqblock, iqblock_state )
MCFG_CPU_ADD("maincpu", Z80,12000000/2) /* 6 MHz */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_IO_MAP(main_portmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", iqblock_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", iqblock_state, iqblock_irq, "screen", 0, 1)
MCFG_I8255A_ADD( "ppi8255", ppi8255_intf )
diff --git a/src/mame/drivers/irobot.c b/src/mame/drivers/irobot.c
index b0ce5c58038..3b7139294ab 100644
--- a/src/mame/drivers/irobot.c
+++ b/src/mame/drivers/irobot.c
@@ -308,8 +308,8 @@ static MACHINE_CONFIG_START( irobot, irobot_state )
MCFG_PALETTE_LENGTH(64 + 32) /* 64 for polygons, 32 for text */
- MCFG_TIMER_ADD("irvg_timer", irobot_irvg_done_callback)
- MCFG_TIMER_ADD("irmb_timer", irobot_irmb_done_callback)
+ MCFG_TIMER_DRIVER_ADD("irvg_timer", irobot_state, irobot_irvg_done_callback)
+ MCFG_TIMER_DRIVER_ADD("irmb_timer", irobot_state, irobot_irmb_done_callback)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/ironhors.c b/src/mame/drivers/ironhors.c
index 55904d62c0d..6be1e2aa755 100644
--- a/src/mame/drivers/ironhors.c
+++ b/src/mame/drivers/ironhors.c
@@ -20,20 +20,19 @@
*
*************************************/
-static TIMER_DEVICE_CALLBACK( ironhors_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::ironhors_irq)
{
- ironhors_state *state = timer.machine().driver_data<ironhors_state>();
int scanline = param;
if (scanline == 240)
{
- if (*state->m_interrupt_enable & 4)
- state->m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
+ if (*m_interrupt_enable & 4)
+ m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
else if (((scanline+16) % 64) == 0)
{
- if (*state->m_interrupt_enable & 1)
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (*m_interrupt_enable & 1)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -380,7 +379,7 @@ static MACHINE_CONFIG_START( ironhors, ironhors_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809,18432000/6) /* 3.072 MHz??? mod by Shingo Suzuki 1999/10/15 */
MCFG_CPU_PROGRAM_MAP(master_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", ironhors_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ironhors_state, ironhors_irq, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu",Z80,18432000/6) /* 3.072 MHz */
MCFG_CPU_PROGRAM_MAP(slave_map)
@@ -416,20 +415,19 @@ static MACHINE_CONFIG_START( ironhors, ironhors_state )
MACHINE_CONFIG_END
-static TIMER_DEVICE_CALLBACK( farwest_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::farwest_irq)
{
- ironhors_state *state = timer.machine().driver_data<ironhors_state>();
int scanline = param;
if ((scanline % 2) == 1)
{
- if (*state->m_interrupt_enable & 4)
- state->m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
+ if (*m_interrupt_enable & 4)
+ m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
else if ((scanline % 2) == 0)
{
- if (*state->m_interrupt_enable & 1)
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (*m_interrupt_enable & 1)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -459,7 +457,7 @@ static MACHINE_CONFIG_DERIVED( farwest, ironhors )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(farwest_master_map)
MCFG_DEVICE_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(farwest_irq)
+ MCFG_TIMER_DRIVER_CALLBACK(ironhors_state, farwest_irq)
MCFG_CPU_MODIFY("soundcpu")
MCFG_CPU_PROGRAM_MAP(farwest_slave_map)
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index f388856d91f..047bdad2f48 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -1806,7 +1806,7 @@ static MACHINE_CONFIG_DERIVED( grmatch, itech8_core_hi )
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_grmatch)
/* palette updater */
- MCFG_TIMER_ADD_SCANLINE("palette", grmatch_palette_update, "screen", 0, 0)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("palette", itech8_state, grmatch_palette_update, "screen", 0, 0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index a4950888911..ea75016260d 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -196,14 +196,13 @@ READ16_MEMBER(jpmimpct_state::m68k_tms_r)
* TxDB/TxDB: Data retrieval unit
*/
-static TIMER_DEVICE_CALLBACK( duart_1_timer_event )
+TIMER_DEVICE_CALLBACK_MEMBER(jpmimpct_state::duart_1_timer_event)
{
- jpmimpct_state *state = timer.machine().driver_data<jpmimpct_state>();
- state->m_duart_1.tc = 0;
- state->m_duart_1.ISR |= 0x08;
+ m_duart_1.tc = 0;
+ m_duart_1.ISR |= 0x08;
- state->m_duart_1_irq = 1;
- update_irqs(timer.machine());
+ m_duart_1_irq = 1;
+ update_irqs(machine());
}
READ16_MEMBER(jpmimpct_state::duart_1_r)
@@ -827,7 +826,7 @@ static MACHINE_CONFIG_START( jpmimpct, jpmimpct_state )
MCFG_MACHINE_RESET_OVERRIDE(jpmimpct_state,jpmimpct)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_ADD( "duart_1_timer", duart_1_timer_event)
+ MCFG_TIMER_DRIVER_ADD("duart_1_timer", jpmimpct_state, duart_1_timer_event)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(40000000/4, 156*4, 0, 100*4, 328, 0, 300)
@@ -1379,7 +1378,7 @@ static MACHINE_CONFIG_START( impctawp, jpmimpct_state )
MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_I8255_ADD( "ppi8255", ppi8255_intf )
- MCFG_TIMER_ADD( "duart_1_timer", duart_1_timer_event)
+ MCFG_TIMER_DRIVER_ADD("duart_1_timer", jpmimpct_state, duart_1_timer_event)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK)
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index 5e3b00b0e44..8b5917c6cb5 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -1578,22 +1578,21 @@ GFXDECODE_END
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( kaneko16_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_state::kaneko16_interrupt)
{
- kaneko16_state *state = timer.machine().driver_data<kaneko16_state>();
int scanline = param;
// main vblank interrupt
if(scanline == 224)
- state->m_maincpu->set_input_line(5, HOLD_LINE);
+ m_maincpu->set_input_line(5, HOLD_LINE);
// each of these 2 int are responsible of translating a part of sprite buffer
// from work ram to sprite ram. How these are scheduled is unknown.
if(scanline == 64)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
if(scanline == 144)
- state->m_maincpu->set_input_line(3, HOLD_LINE);
+ m_maincpu->set_input_line(3, HOLD_LINE);
}
static const ay8910_interface ay8910_intf_dsw =
@@ -1644,7 +1643,7 @@ static MACHINE_CONFIG_START( berlwall, kaneko16_berlwall_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 12000000) /* MC68000P12 */
MCFG_CPU_PROGRAM_MAP(berlwall)
- MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) // mangled sprites otherwise
@@ -1695,7 +1694,7 @@ static MACHINE_CONFIG_START( bakubrkr, kaneko16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(bakubrkr)
- MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_state,gtmr)
MCFG_EEPROM_93C46_ADD("eeprom")
@@ -1763,7 +1762,7 @@ static MACHINE_CONFIG_START( blazeon, kaneko16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,12000000) /* TMP68HC000-12 */
MCFG_CPU_PROGRAM_MAP(blazeon)
- MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,4000000) /* D780C-2 */
MCFG_CPU_PROGRAM_MAP(blazeon_soundmem)
@@ -1823,7 +1822,7 @@ static MACHINE_CONFIG_START( gtmr, kaneko16_gtmr_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(gtmr_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_gtmr_state,gtmr)
@@ -1942,7 +1941,7 @@ static MACHINE_CONFIG_START( mgcrystl, kaneko16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mgcrystl)
- MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_state,mgcrystl)
MCFG_EEPROM_93C46_ADD("eeprom")
@@ -2009,22 +2008,21 @@ MACHINE_CONFIG_END
other: busy loop
*/
-static TIMER_DEVICE_CALLBACK( shogwarr_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_state::shogwarr_interrupt)
{
- kaneko16_shogwarr_state *state = timer.machine().driver_data<kaneko16_shogwarr_state>();
int scanline = param;
if(scanline == 224)
{
// the code for this interrupt is provided by the MCU..
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
}
if(scanline == 64)
- state->m_maincpu->set_input_line(3, HOLD_LINE);
+ m_maincpu->set_input_line(3, HOLD_LINE);
if(scanline == 144)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
/*
@@ -2066,7 +2064,7 @@ static MACHINE_CONFIG_START( shogwarr, kaneko16_shogwarr_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz)
MCFG_CPU_PROGRAM_MAP(shogwarr)
- MCFG_TIMER_ADD_SCANLINE("scantimer", shogwarr_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, shogwarr_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_shogwarr_state,mgcrystl)
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index 5e206d6f26c..2d8ec40c185 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -653,15 +653,14 @@ INTERRUPT_GEN_MEMBER(konamigx_state::konamigx_vbinterrupt)
dmastart_callback(0);
}
-static TIMER_DEVICE_CALLBACK(konamigx_hbinterrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_hbinterrupt)
{
- konamigx_state *state = timer.machine().driver_data<konamigx_state>();
int scanline = param;
if (scanline == 240)
{
// lift idle suspension
- if (resume_trigger && suspension_active) { suspension_active = 0; timer.machine().scheduler().trigger(resume_trigger); }
+ if (resume_trigger && suspension_active) { suspension_active = 0; machine().scheduler().trigger(resume_trigger); }
// IRQ 1 is the main 60hz vblank interrupt
// the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board
@@ -677,7 +676,7 @@ static TIMER_DEVICE_CALLBACK(konamigx_hbinterrupt)
if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1))
{
gx_syncen &= ~1;
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ m_maincpu->set_input_line(1, HOLD_LINE);
}
}
@@ -694,7 +693,7 @@ static TIMER_DEVICE_CALLBACK(konamigx_hbinterrupt)
if ((konamigx_wrport1_1 & 0x82) == 0x82 || (gx_syncen & 2))
{
gx_syncen &= ~2;
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
}
}
@@ -1859,7 +1858,7 @@ static MACHINE_CONFIG_DERIVED( gxtype3, konamigx )
MCFG_CPU_ADD("maincpu", M68EC020, 24000000)
MCFG_CPU_PROGRAM_MAP(gx_type3_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", konamigx_hbinterrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_hbinterrupt, "screen", 0, 1)
MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
@@ -1886,7 +1885,7 @@ static MACHINE_CONFIG_DERIVED( gxtype4, konamigx )
MCFG_CPU_ADD("maincpu", M68EC020, 24000000)
MCFG_CPU_PROGRAM_MAP(gx_type4_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", konamigx_hbinterrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_hbinterrupt, "screen", 0, 1)
MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c
index 7a4ad367a6b..4f86ef93764 100644
--- a/src/mame/drivers/lastduel.c
+++ b/src/mame/drivers/lastduel.c
@@ -455,18 +455,14 @@ static const ym2203_interface ym2203_config =
DEVCB_LINE(irqhandler)
};
-static TIMER_DEVICE_CALLBACK( lastduel_timer_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(lastduel_state::lastduel_timer_cb)
{
- lastduel_state *state = timer.machine().driver_data<lastduel_state>();
-
- state->m_maincpu->set_input_line(4, HOLD_LINE); /* Controls */
+ m_maincpu->set_input_line(4, HOLD_LINE); /* Controls */
}
-static TIMER_DEVICE_CALLBACK( madgear_timer_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(lastduel_state::madgear_timer_cb)
{
- lastduel_state *state = timer.machine().driver_data<lastduel_state>();
-
- state->m_maincpu->set_input_line(6, HOLD_LINE); /* Controls */
+ m_maincpu->set_input_line(6, HOLD_LINE); /* Controls */
}
MACHINE_START_MEMBER(lastduel_state,lastduel)
@@ -501,7 +497,7 @@ static MACHINE_CONFIG_START( lastduel, lastduel_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* Could be 8 MHz */
MCFG_CPU_PROGRAM_MAP(lastduel_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", lastduel_state, irq2_line_hold)
- MCFG_TIMER_ADD_PERIODIC("timer_irq", lastduel_timer_cb, attotime::from_hz(120)) /* control reads?? */
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", lastduel_state, lastduel_timer_cb, attotime::from_hz(120))
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* Accurate */
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -544,7 +540,7 @@ static MACHINE_CONFIG_START( madgear, lastduel_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* Accurate */
MCFG_CPU_PROGRAM_MAP(madgear_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", lastduel_state, irq5_line_hold)
- MCFG_TIMER_ADD_PERIODIC("timer_irq", madgear_timer_cb, attotime::from_hz(120)) /* control reads?? */
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", lastduel_state, madgear_timer_cb, attotime::from_hz(120))
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(madgear_sound_map)
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index edd3f7a9a8e..f2dadf5ac95 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -236,32 +236,30 @@
* The rate should be at about 1 Hz
*************************************************************/
-static TIMER_DEVICE_CALLBACK( lazercmd_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_state::lazercmd_timer)
{
- lazercmd_state *state = timer.machine().driver_data<lazercmd_state>();
int scanline = param;
if((scanline % 2) == 1)
return;
- if (++state->m_timer_count >= 64 * 128)
+ if (++m_timer_count >= 64 * 128)
{
- state->m_timer_count = 0;
- state->m_sense_state ^= 1;
- state->m_maincpu->set_input_line(1, (state->m_sense_state) ? ASSERT_LINE : CLEAR_LINE);
+ m_timer_count = 0;
+ m_sense_state ^= 1;
+ m_maincpu->set_input_line(1, (m_sense_state) ? ASSERT_LINE : CLEAR_LINE);
}
}
-static TIMER_DEVICE_CALLBACK( bbonk_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_state::bbonk_timer)
{
- lazercmd_state *state = timer.machine().driver_data<lazercmd_state>();
int scanline = param;
if((scanline % 2) == 1)
return;
- if (++state->m_timer_count >= 64 * 128)
- state->m_timer_count = 0;
+ if (++m_timer_count >= 64 * 128)
+ m_timer_count = 0;
}
/*************************************************************
@@ -635,7 +633,7 @@ static MACHINE_CONFIG_START( lazercmd, lazercmd_state )
thus requiring an extra loading of approx 3-5 */
MCFG_CPU_PROGRAM_MAP(lazercmd_map)
MCFG_CPU_IO_MAP(lazercmd_portmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", lazercmd_timer, "screen", 0, 1) /* 7680 Hz */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lazercmd_state, lazercmd_timer, "screen", 0, 1)
/* video hardware */
@@ -669,7 +667,7 @@ static MACHINE_CONFIG_START( medlanes, lazercmd_state )
thus requiring an extra loading of approx 3-5 */
MCFG_CPU_PROGRAM_MAP(medlanes_map)
MCFG_CPU_IO_MAP(lazercmd_portmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", lazercmd_timer, "screen", 0, 1) /* 7680 Hz */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lazercmd_state, lazercmd_timer, "screen", 0, 1)
/* video hardware */
@@ -703,7 +701,7 @@ static MACHINE_CONFIG_START( bbonk, lazercmd_state )
thus requiring an extra loading of approx 3-5 */
MCFG_CPU_PROGRAM_MAP(bbonk_map)
MCFG_CPU_IO_MAP(lazercmd_portmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bbonk_timer, "screen", 0, 1) /* 7680 Hz */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lazercmd_state, bbonk_timer, "screen", 0, 1)
/* video hardware */
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index fe9cc4f5091..40ae43f3230 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -47,24 +47,23 @@ void m107_state::machine_start()
/*****************************************************************************/
-static TIMER_DEVICE_CALLBACK( m107_scanline_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(m107_state::m107_scanline_interrupt)
{
- running_machine &machine = timer.machine();
- m107_state *state = machine.driver_data<m107_state>();
int scanline = param;
+ m107_state *state = machine().driver_data<m107_state>();
/* raster interrupt */
- if (scanline == state->m_raster_irq_position)
+ if (scanline == m_raster_irq_position)
{
- machine.primary_screen->update_partial(scanline);
- machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_2);
+ machine().primary_screen->update_partial(scanline);
+ state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_2);
}
/* VBLANK interrupt */
- else if (scanline == machine.primary_screen->visible_area().max_y + 1)
+ else if (scanline == machine().primary_screen->visible_area().max_y + 1)
{
- machine.primary_screen->update_partial(scanline);
- machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_0);
+ machine().primary_screen->update_partial(scanline);
+ state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_0);
}
}
@@ -780,7 +779,7 @@ static MACHINE_CONFIG_START( firebarr, m107_state )
MCFG_CPU_CONFIG(firebarr_config)
- MCFG_TIMER_ADD_SCANLINE("scantimer", m107_scanline_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m107_state, m107_scanline_interrupt, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index c242fd7880c..5a99b4b4fc0 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -225,23 +225,22 @@ MACHINE_RESET_MEMBER(m92_state,m92)
/*****************************************************************************/
-static TIMER_DEVICE_CALLBACK( m92_scanline_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(m92_state::m92_scanline_interrupt)
{
- running_machine &machine = timer.machine();
- m92_state *state = machine.driver_data<m92_state>();
+ m92_state *state = machine().driver_data<m92_state>();
int scanline = param;
/* raster interrupt */
- if (scanline == state->m_raster_irq_position)
+ if (scanline == m_raster_irq_position)
{
- machine.primary_screen->update_partial(scanline);
+ machine().primary_screen->update_partial(scanline);
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M92_IRQ_2);
}
/* VBLANK interrupt */
- else if (scanline == machine.primary_screen->visible_area().max_y + 1)
+ else if (scanline == machine().primary_screen->visible_area().max_y + 1)
{
- machine.primary_screen->update_partial(scanline);
+ machine().primary_screen->update_partial(scanline);
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M92_IRQ_0);
}
}
@@ -944,7 +943,7 @@ static MACHINE_CONFIG_START( m92, m92_state )
MCFG_MACHINE_START_OVERRIDE(m92_state,m92)
MCFG_MACHINE_RESET_OVERRIDE(m92_state,m92)
- MCFG_TIMER_ADD_SCANLINE("scantimer", m92_scanline_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m92_state, m92_scanline_interrupt, "screen", 0, 1)
/* video hardware */
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
@@ -1030,7 +1029,7 @@ static MACHINE_CONFIG_START( ppan, m92_state )
MCFG_MACHINE_START_OVERRIDE(m92_state,m92)
MCFG_MACHINE_RESET_OVERRIDE(m92_state,m92)
- MCFG_TIMER_ADD_SCANLINE("scantimer", m92_scanline_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m92_state, m92_scanline_interrupt, "screen", 0, 1)
/* video hardware */
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") // not really...
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index ab5d2dd8076..818bcb643dd 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -377,25 +377,23 @@ READ8_MEMBER(mcr_state::kick_ip1_r)
*
*************************************/
-TIMER_DEVICE_CALLBACK( dpoker_hopper_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::dpoker_hopper_callback)
{
- mcr_state *state = timer.machine().driver_data<mcr_state>();
-
if (dpoker_output & 0x40)
{
// hopper timing is a guesstimate
dpoker_coin_status ^= 8;
- state->m_dpoker_hopper_timer->adjust(attotime::from_msec((dpoker_coin_status & 8) ? 100 : 250));
+ m_dpoker_hopper_timer->adjust(attotime::from_msec((dpoker_coin_status & 8) ? 100 : 250));
}
else
{
dpoker_coin_status &= ~8;
}
- coin_counter_w(timer.machine(), 3, dpoker_coin_status & 8);
+ coin_counter_w(machine(), 3, dpoker_coin_status & 8);
}
-TIMER_DEVICE_CALLBACK( dpoker_coin_in_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::dpoker_coin_in_callback)
{
dpoker_coin_status &= ~2;
}
@@ -1827,7 +1825,7 @@ static MACHINE_CONFIG_START( mcr_90009, mcr_state )
MCFG_CPU_CONFIG(mcr_daisy_chain)
MCFG_CPU_PROGRAM_MAP(cpu_90009_map)
MCFG_CPU_IO_MAP(cpu_90009_portmap)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mcr_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mcr_state, mcr_interrupt, "screen", 0, 1)
MCFG_Z80CTC_ADD("ctc", MAIN_OSC_MCR_I/8 /* same as "maincpu" */, mcr_ctc_intf)
@@ -1863,8 +1861,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mcr_90009_dp, mcr_90009 )
/* basic machine hardware */
- MCFG_TIMER_ADD("dp_coinin", dpoker_coin_in_callback)
- MCFG_TIMER_ADD("dp_hopper", dpoker_hopper_callback)
+ MCFG_TIMER_DRIVER_ADD("dp_coinin", mcr_state, dpoker_coin_in_callback)
+ MCFG_TIMER_DRIVER_ADD("dp_hopper", mcr_state, dpoker_hopper_callback)
MACHINE_CONFIG_END
@@ -1939,7 +1937,7 @@ static MACHINE_CONFIG_DERIVED( mcr_91490_ipu, mcr_91490_snt )
MCFG_CPU_PROGRAM_MAP(ipu_91695_map)
MCFG_CPU_IO_MAP(ipu_91695_portmap)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(mcr_ipu_interrupt)
+ MCFG_TIMER_DRIVER_CALLBACK(mcr_state, mcr_ipu_interrupt)
MCFG_Z80CTC_ADD("ipu_ctc", 7372800/2 /* same as "ipu" */, nflfoot_ctc_intf)
MCFG_Z80PIO_ADD("ipu_pio0", 7372800/2, nflfoot_pio_intf)
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index 36a61416e9a..feb197e151b 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -1081,7 +1081,7 @@ static MACHINE_CONFIG_START( mcrmono, mcr3_state )
MCFG_CPU_PROGRAM_MAP(mcrmono_map)
MCFG_CPU_IO_MAP(mcrmono_portmap)
MCFG_CPU_CONFIG(mcr_daisy_chain)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mcr_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mcr3_state, mcr_interrupt, "screen", 0, 1)
MCFG_Z80CTC_ADD("ctc", MASTER_CLOCK/4 /* same as "maincpu" */, mcr_ctc_intf)
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index 315ee97b42f..d1b7c179373 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -155,18 +155,18 @@ MACHINE_RESET_MEMBER(megasys1_state,megasys1_hachoo)
[ Main CPU - System A / Z ]
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( megasys1A_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(megasys1_state::megasys1A_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
if(scanline == 0)
- timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
if(scanline == 128)
- timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
}
static ADDRESS_MAP_START( megasys1A_map, AS_PROGRAM, 16, megasys1_state )
@@ -191,18 +191,18 @@ ADDRESS_MAP_END
[ Main CPU - System B ]
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( megasys1B_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(megasys1_state::megasys1B_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
if(scanline == 0)
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
if(scanline == 128)
- timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
}
@@ -1466,7 +1466,7 @@ static MACHINE_CONFIG_START( system_A, megasys1_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, SYS_A_CPU_CLOCK) /* 6MHz verified */
MCFG_CPU_PROGRAM_MAP(megasys1A_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", megasys1A_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", megasys1_state, megasys1A_scanline, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", M68000, SOUND_CPU_CLOCK) /* 7MHz verified */
MCFG_CPU_PROGRAM_MAP(megasys1A_sound_map)
@@ -1519,7 +1519,7 @@ static MACHINE_CONFIG_DERIVED( system_B, system_A )
MCFG_CPU_CLOCK(SYS_B_CPU_CLOCK) /* 8MHz */
MCFG_CPU_PROGRAM_MAP(megasys1B_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(megasys1B_scanline)
+ MCFG_TIMER_DRIVER_CALLBACK(megasys1_state, megasys1B_scanline)
MCFG_CPU_MODIFY("soundcpu")
MCFG_CPU_PROGRAM_MAP(megasys1B_sound_map)
@@ -1531,7 +1531,7 @@ static MACHINE_CONFIG_START( system_Bbl, megasys1_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, SYS_B_CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(megasys1B_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", megasys1B_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", megasys1_state, megasys1B_scanline, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(megasys1_state,megasys1)
@@ -1580,7 +1580,7 @@ static MACHINE_CONFIG_DERIVED( system_C, system_A )
MCFG_CPU_CLOCK(SYS_C_CPU_CLOCK) /* 12MHz */
MCFG_CPU_PROGRAM_MAP(megasys1C_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(megasys1B_scanline)
+ MCFG_TIMER_DRIVER_CALLBACK(megasys1_state, megasys1B_scanline)
MCFG_CPU_MODIFY("soundcpu")
MCFG_CPU_PROGRAM_MAP(megasys1B_sound_map)
@@ -1664,7 +1664,7 @@ static MACHINE_CONFIG_START( system_Z, megasys1_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, SYS_A_CPU_CLOCK) /* 6MHz (12MHz / 2) */
MCFG_CPU_PROGRAM_MAP(megasys1A_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", megasys1A_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", megasys1_state, megasys1A_scanline, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", Z80, 3000000) /* OSC 12MHz divided by 4 ??? */
MCFG_CPU_PROGRAM_MAP(z80_sound_map)
diff --git a/src/mame/drivers/mhavoc.c b/src/mame/drivers/mhavoc.c
index d9e009ba798..5f4d6ce29fd 100644
--- a/src/mame/drivers/mhavoc.c
+++ b/src/mame/drivers/mhavoc.c
@@ -483,7 +483,7 @@ static MACHINE_CONFIG_START( mhavoc, mhavoc_state )
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_ADD_PERIODIC("5k_timer", mhavoc_cpu_irq_clock, attotime::from_hz(MHAVOC_CLOCK_5K))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("5k_timer", mhavoc_state, mhavoc_cpu_irq_clock, attotime::from_hz(MHAVOC_CLOCK_5K))
/* video hardware */
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index fec81aadd50..bac1cc35667 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -1078,16 +1078,15 @@ MACHINE_RESET_MEMBER(mitchell_state,mitchell)
m_keymatrix = 0;
}
-static TIMER_DEVICE_CALLBACK( mitchell_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(mitchell_state::mitchell_irq)
{
- mitchell_state *state = timer.machine().driver_data<mitchell_state>();
int scanline = param;
if (scanline == 240 || scanline == 0)
{
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_maincpu->set_input_line(0, HOLD_LINE);
- state->m_irq_source = (scanline == 240);
+ m_irq_source = (scanline == 240);
}
}
@@ -1097,7 +1096,7 @@ static MACHINE_CONFIG_START( mgakuen, mitchell_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* probably same clock as the other mitchell hardware games */
MCFG_CPU_PROGRAM_MAP(mgakuen_map)
MCFG_CPU_IO_MAP(mitchell_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1) /* ??? one extra irq seems to be needed for music (see input5_r) */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(mitchell_state,mitchell)
MCFG_MACHINE_RESET_OVERRIDE(mitchell_state,mitchell)
@@ -1134,7 +1133,7 @@ static MACHINE_CONFIG_START( pang, mitchell_state )
MCFG_CPU_ADD("maincpu",Z80, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mitchell_map)
MCFG_CPU_IO_MAP(mitchell_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1) /* ??? one extra irq seems to be needed for music (see input5_r) */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(mitchell_state,mitchell)
MCFG_MACHINE_RESET_OVERRIDE(mitchell_state,mitchell)
@@ -1273,7 +1272,7 @@ static MACHINE_CONFIG_START( marukin, mitchell_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mitchell_map)
MCFG_CPU_IO_MAP(mitchell_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1) /* ??? one extra irq seems to be needed for music (see input5_r) */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
MCFG_EEPROM_ADD("eeprom", eeprom_intf)
@@ -1324,7 +1323,7 @@ static MACHINE_CONFIG_START( pkladiesbl, mitchell_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mitchell_map)
MCFG_CPU_IO_MAP(mitchell_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1) /* ??? one extra irq seems to be needed for music (see input5_r) */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
MCFG_EEPROM_ADD("eeprom", eeprom_intf)
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index 3181e0ff12c..4330c6ddf1e 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -725,23 +725,22 @@ static void irq_init(running_machine &machine)
machine.device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
}
-static TIMER_DEVICE_CALLBACK( model1_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(model1_state::model1_interrupt)
{
- model1_state *state = timer.machine().driver_data<model1_state>();
int scanline = param;
if (scanline == 384)
{
- irq_raise(timer.machine(), 1);
+ irq_raise(machine(), 1);
}
else if(scanline == 384/2)
{
- irq_raise(timer.machine(), state->m_sound_irq);
+ irq_raise(machine(), m_sound_irq);
// if the FIFO has something in it, signal the 68k too
- if (state->m_fifo_rptr != state->m_fifo_wptr)
+ if (m_fifo_rptr != m_fifo_wptr)
{
- timer.machine().device("audiocpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("audiocpu")->execute().set_input_line(2, HOLD_LINE);
}
}
}
@@ -1520,7 +1519,7 @@ static MACHINE_CONFIG_START( model1, model1_state )
MCFG_CPU_ADD("maincpu", V60, 16000000)
MCFG_CPU_PROGRAM_MAP(model1_mem)
MCFG_CPU_IO_MAP(model1_io)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model1_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model1_state, model1_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 10000000) // verified on real h/w
MCFG_CPU_PROGRAM_MAP(model1_snd)
@@ -1565,7 +1564,7 @@ static MACHINE_CONFIG_START( model1_vr, model1_state )
MCFG_CPU_ADD("maincpu", V60, 16000000)
MCFG_CPU_PROGRAM_MAP(model1_vr_mem)
MCFG_CPU_IO_MAP(model1_vr_io)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model1_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model1_state, model1_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 10000000) // verified on real h/w
MCFG_CPU_PROGRAM_MAP(model1_snd)
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 0aff8b6021e..54163ffea74 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -288,22 +288,21 @@ WRITE32_MEMBER(model2_state::timers_w)
m_timerrun[offset] = 1;
}
-static TIMER_DEVICE_CALLBACK( model2_timer_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_timer_cb)
{
- model2_state *state = timer.machine().driver_data<model2_state>();
int tnum = (int)(FPTR)ptr;
int bit = tnum + 2;
- state->m_timers[tnum]->reset();
+ m_timers[tnum]->reset();
- state->m_intreq |= (1<<bit);
- if (state->m_intena & (1<<bit))
+ m_intreq |= (1<<bit);
+ if (m_intena & (1<<bit))
{
- timer.machine().device("maincpu")->execute().set_input_line(I960_IRQ2, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(I960_IRQ2, ASSERT_LINE);
}
- state->m_timervals[tnum] = 0;
- state->m_timerrun[tnum] = 0;
+ m_timervals[tnum] = 0;
+ m_timerrun[tnum] = 0;
}
MACHINE_START_MEMBER(model2_state,model2)
@@ -1746,50 +1745,48 @@ static INPUT_PORTS_START( rchase2 )
PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1)
INPUT_PORTS_END
-static TIMER_DEVICE_CALLBACK(model2_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_interrupt)
{
- model2_state *state = timer.machine().driver_data<model2_state>();
int scanline = param;
if(scanline == 0) // 384
{
- state->m_intreq |= (1<<10);
- if (state->m_intena & (1<<10))
- state->m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
+ m_intreq |= (1<<10);
+ if (m_intena & (1<<10))
+ m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
}
if(scanline == 384/2)
{
- state->m_intreq |= (1<<0);
- if (state->m_intena & (1<<0))
- state->m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
+ m_intreq |= (1<<0);
+ if (m_intena & (1<<0))
+ m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
}
}
-static TIMER_DEVICE_CALLBACK(model2c_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2c_interrupt)
{
- model2_state *state = timer.machine().driver_data<model2_state>();
int scanline = param;
if(scanline == 0) // 384
{
- state->m_intreq |= (1<<10);
- if (state->m_intena & (1<<10))
- state->m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
+ m_intreq |= (1<<10);
+ if (m_intena & (1<<10))
+ m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
}
if(scanline == 256)
{
- state->m_intreq |= (1<<2);
- if (state->m_intena & (1<<2))
- state->m_maincpu->set_input_line(I960_IRQ2, ASSERT_LINE);
+ m_intreq |= (1<<2);
+ if (m_intena & (1<<2))
+ m_maincpu->set_input_line(I960_IRQ2, ASSERT_LINE);
}
if(scanline == 128)
{
- state->m_intreq |= (1<<0);
- if (state->m_intena & (1<<0))
- state->m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
+ m_intreq |= (1<<0);
+ if (m_intena & (1<<0))
+ m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
}
}
@@ -1967,7 +1964,7 @@ static const mb86233_cpu_core tgp_config =
static MACHINE_CONFIG_START( model2o, model2_state )
MCFG_CPU_ADD("maincpu", I960, 25000000)
MCFG_CPU_PROGRAM_MAP(model2o_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 10000000)
MCFG_CPU_PROGRAM_MAP(model1_snd)
@@ -1983,13 +1980,13 @@ static MACHINE_CONFIG_START( model2o, model2_state )
MCFG_NVRAM_ADD_1FILL("backup1")
MCFG_NVRAM_ADD_1FILL("backup2")
- MCFG_TIMER_ADD("timer0", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)0)
- MCFG_TIMER_ADD("timer1", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)1)
- MCFG_TIMER_ADD("timer2", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)2)
- MCFG_TIMER_ADD("timer3", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)3)
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
@@ -2026,7 +2023,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( model2a, model2_state )
MCFG_CPU_ADD("maincpu", I960, 25000000)
MCFG_CPU_PROGRAM_MAP(model2a_crx_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model2_snd)
@@ -2041,13 +2038,13 @@ static MACHINE_CONFIG_START( model2a, model2_state )
MCFG_EEPROM_93C46_ADD("eeprom")
MCFG_NVRAM_ADD_1FILL("backup1")
- MCFG_TIMER_ADD("timer0", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)0)
- MCFG_TIMER_ADD("timer1", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)1)
- MCFG_TIMER_ADD("timer2", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)2)
- MCFG_TIMER_ADD("timer3", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)3)
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
@@ -2123,7 +2120,7 @@ static const sharc_config sharc_cfg =
static MACHINE_CONFIG_START( model2b, model2_state )
MCFG_CPU_ADD("maincpu", I960, 25000000)
MCFG_CPU_PROGRAM_MAP(model2b_crx_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model2_snd)
@@ -2144,13 +2141,13 @@ static MACHINE_CONFIG_START( model2b, model2_state )
MCFG_EEPROM_93C46_ADD("eeprom")
MCFG_NVRAM_ADD_1FILL("backup1")
- MCFG_TIMER_ADD("timer0", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)0)
- MCFG_TIMER_ADD("timer1", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)1)
- MCFG_TIMER_ADD("timer2", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)2)
- MCFG_TIMER_ADD("timer3", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)3)
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
@@ -2180,7 +2177,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( model2c, model2_state )
MCFG_CPU_ADD("maincpu", I960, 25000000)
MCFG_CPU_PROGRAM_MAP(model2c_crx_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model2c_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2c_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model2_snd)
@@ -2191,13 +2188,13 @@ static MACHINE_CONFIG_START( model2c, model2_state )
MCFG_EEPROM_93C46_ADD("eeprom")
MCFG_NVRAM_ADD_1FILL("backup1")
- MCFG_TIMER_ADD("timer0", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)0)
- MCFG_TIMER_ADD("timer1", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)1)
- MCFG_TIMER_ADD("timer2", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)2)
- MCFG_TIMER_ADD("timer3", model2_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
MCFG_TIMER_PTR((FPTR)3)
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index ed285435740..9af28750b1a 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -5251,15 +5251,14 @@ static const scsp_interface scsp2_interface =
0x02: Video (VBLANK start?)
0x01: Video (unused?)
*/
-static TIMER_DEVICE_CALLBACK(model3_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(model3_state::model3_interrupt)
{
-// model3_state *state = timer.machine().driver_data<model3_state>();
int scanline = param;
if (scanline == 384)
- model3_set_irq_line(timer.machine(), 0x02, ASSERT_LINE);
+ model3_set_irq_line(machine(), 0x02, ASSERT_LINE);
else if(scanline == 0)
- model3_set_irq_line(timer.machine(), 0x0d, ASSERT_LINE);
+ model3_set_irq_line(machine(), 0x0d, ASSERT_LINE);
}
static const powerpc_config model3_10 =
@@ -5290,7 +5289,7 @@ static MACHINE_CONFIG_START( model3_10, model3_state )
MCFG_CPU_ADD("maincpu", PPC603E, 66000000)
MCFG_CPU_CONFIG(model3_10)
MCFG_CPU_PROGRAM_MAP(model3_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model3_snd)
@@ -5333,7 +5332,7 @@ static MACHINE_CONFIG_START( model3_15, model3_state )
MCFG_CPU_ADD("maincpu", PPC603E, 100000000)
MCFG_CPU_CONFIG(model3_15)
MCFG_CPU_PROGRAM_MAP(model3_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model3_snd)
@@ -5374,7 +5373,7 @@ static MACHINE_CONFIG_START( model3_20, model3_state )
MCFG_CPU_ADD("maincpu", PPC603R, 166000000)
MCFG_CPU_CONFIG(model3_2x)
MCFG_CPU_PROGRAM_MAP(model3_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model3_snd)
@@ -5412,7 +5411,7 @@ static MACHINE_CONFIG_START( model3_21, model3_state )
MCFG_CPU_ADD("maincpu", PPC603R, 166000000)
MCFG_CPU_CONFIG(model3_2x)
MCFG_CPU_PROGRAM_MAP(model3_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model3_snd)
diff --git a/src/mame/drivers/mrflea.c b/src/mame/drivers/mrflea.c
index ba38051e300..22993b3a97f 100644
--- a/src/mame/drivers/mrflea.c
+++ b/src/mame/drivers/mrflea.c
@@ -116,13 +116,12 @@ READ8_MEMBER(mrflea_state::mrflea_io_status_r)
return m_status ^ 0x01;
}
-static TIMER_DEVICE_CALLBACK( mrflea_slave_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(mrflea_state::mrflea_slave_interrupt)
{
- mrflea_state *state = timer.machine().driver_data<mrflea_state>();
int scanline = param;
- if ((scanline == 248) || (scanline == 248/2 && (state->m_status & 0x08)))
- state->m_subcpu->set_input_line(0, HOLD_LINE);
+ if ((scanline == 248) || (scanline == 248/2 && (m_status & 0x08)))
+ m_subcpu->set_input_line(0, HOLD_LINE);
}
READ8_MEMBER(mrflea_state::mrflea_interrupt_type_r)
@@ -362,7 +361,7 @@ static MACHINE_CONFIG_START( mrflea, mrflea_state )
MCFG_CPU_ADD("sub", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(mrflea_slave_map)
MCFG_CPU_IO_MAP(mrflea_slave_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mrflea_slave_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mrflea_state, mrflea_slave_interrupt, "screen", 0, 1)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c
index e9a02730acb..551ad29c5cc 100644
--- a/src/mame/drivers/ms32.c
+++ b/src/mame/drivers/ms32.c
@@ -1304,11 +1304,11 @@ static void irq_raise(running_machine &machine, int level)
}
/* TODO: fix this arrangement (derived from old deprecat lib) */
-static TIMER_DEVICE_CALLBACK(ms32_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt)
{
int scanline = param;
- if( scanline == 0) irq_raise(timer.machine(), 10);
- if( scanline == 8) irq_raise(timer.machine(), 9);
+ if( scanline == 0) irq_raise(machine(), 10);
+ if( scanline == 8) irq_raise(machine(), 9);
/* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
kirarast needs it too, at least 8 per frame, but waits for a variable amount
47pi2 needs ?? per frame (otherwise it hangs when you lose)
@@ -1317,7 +1317,7 @@ static TIMER_DEVICE_CALLBACK(ms32_interrupt)
desertwr
p47aces
*/
- if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(timer.machine(), 0);
+ if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(machine(), 0);
}
@@ -1394,7 +1394,7 @@ static MACHINE_CONFIG_START( ms32, ms32_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", V70, 20000000) // 20MHz
MCFG_CPU_PROGRAM_MAP(ms32_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", ms32_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ms32_state, ms32_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(ms32_sound_map)
diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c
index 03653ba8c78..db5a0c8dd6d 100644
--- a/src/mame/drivers/mw8080bw.c
+++ b/src/mame/drivers/mw8080bw.c
@@ -2116,10 +2116,9 @@ MACHINE_CONFIG_END
#define SPCENCTR_STROBE_DUTY_CYCLE (95) /* % */
-static TIMER_DEVICE_CALLBACK( spcenctr_strobe_timer_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(mw8080bw_state::spcenctr_strobe_timer_callback)
{
- mw8080bw_state *state = timer.machine().driver_data<mw8080bw_state>();
- output_set_value("STROBE", param && state->m_spcenctr_strobe_state);
+ output_set_value("STROBE", param && m_spcenctr_strobe_state);
}
@@ -2259,10 +2258,10 @@ static MACHINE_CONFIG_DERIVED( spcenctr, mw8080bw_root )
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* timers */
- MCFG_TIMER_ADD_PERIODIC("strobeon", spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("strobeon", mw8080bw_state, spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
MCFG_TIMER_PARAM(TRUE) /* indicates strobe ON */
- MCFG_TIMER_ADD_PERIODIC("strobeoff", spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("strobeoff", mw8080bw_state, spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
MCFG_TIMER_START_DELAY(attotime::from_hz(SPCENCTR_STROBE_FREQ * 100 / SPCENCTR_STROBE_DUTY_CYCLE))
MCFG_TIMER_PARAM(FALSE) /* indicates strobe OFF */
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index 0f66fa82492..41b21306888 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -104,52 +104,49 @@ WRITE16_MEMBER(mystwarr_state::mmeeprom_w)
/**********************************************************************************/
/* IRQ controllers */
-static TIMER_DEVICE_CALLBACK(mystwarr_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mystwarr_interrupt)
{
- mystwarr_state *state = timer.machine().driver_data<mystwarr_state>();
int scanline = param;
- if (!(state->m_mw_irq_control & 0x01)) return;
+ if (!(m_mw_irq_control & 0x01)) return;
if(scanline == 240)
- state->m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
+ m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
if(scanline == 0)
- state->m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
+ m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
/* writes to LSB of 0x410000 port and clears a work RAM flag, almost likely not really necessary. */
-// state->m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
+// m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK(metamrph_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::metamrph_interrupt)
{
- mystwarr_state *state = timer.machine().driver_data<mystwarr_state>();
int scanline = param;
/* irq 4 has an irq routine in metamrph, but it's not really called */
-// state->m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
+// m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
if(scanline == 24)
- state->m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
+ m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
if(scanline == 248)
- if (K053246_is_IRQ_enabled()) state->m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
+ if (K053246_is_IRQ_enabled()) m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK(mchamp_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mchamp_interrupt)
{
- mystwarr_state *state = timer.machine().driver_data<mystwarr_state>();
int scanline = param;
- if (!(state->m_mw_irq_control & 0x02)) return;
+ if (!(m_mw_irq_control & 0x02)) return;
if(scanline == 247)
{
- if (K053246_is_IRQ_enabled()) state->m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
+ if (K053246_is_IRQ_enabled()) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
}
if(scanline == 23)
- state->m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
+ m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
}
INTERRUPT_GEN_MEMBER(mystwarr_state::ddd_interrupt)
@@ -986,7 +983,7 @@ static MACHINE_CONFIG_START( mystwarr, mystwarr_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz (confirmed) */
MCFG_CPU_PROGRAM_MAP(mystwarr_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", mystwarr_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mystwarr_state, mystwarr_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", Z80, 8000000)
MCFG_CPU_PROGRAM_MAP(mystwarr_sound_map)
@@ -1038,7 +1035,7 @@ static MACHINE_CONFIG_DERIVED( viostorm, mystwarr )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(viostorm_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(metamrph_interrupt)
+ MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt)
/* video hardware */
MCFG_VIDEO_START_OVERRIDE(mystwarr_state,viostorm)
@@ -1059,7 +1056,7 @@ static MACHINE_CONFIG_DERIVED( metamrph, mystwarr )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(metamrph_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(metamrph_interrupt)
+ MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt)
MCFG_DEVICE_REMOVE("k053252")
MCFG_K053252_ADD("k053252", 6000000, metamrph_k053252_intf) // 6 MHz?
@@ -1140,7 +1137,7 @@ static MACHINE_CONFIG_DERIVED( martchmp, mystwarr )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(martchmp_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(mchamp_interrupt)
+ MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, mchamp_interrupt)
MCFG_DEVICE_REMOVE("k053252")
MCFG_K053252_ADD("k053252", 16000000/2, martchmp_k053252_intf)
diff --git a/src/mame/drivers/n8080.c b/src/mame/drivers/n8080.c
index 340bf43130a..40a9446afb9 100644
--- a/src/mame/drivers/n8080.c
+++ b/src/mame/drivers/n8080.c
@@ -428,22 +428,20 @@ INPUT_PORTS_END
/* Interrupts */
-static TIMER_DEVICE_CALLBACK( rst1_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::rst1_tick)
{
- n8080_state *n8080 = timer.machine().driver_data<n8080_state>();
- int state = n8080->m_inte ? ASSERT_LINE : CLEAR_LINE;
+ int state = m_inte ? ASSERT_LINE : CLEAR_LINE;
/* V7 = 1, V6 = 0 */
- n8080->m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xcf);
+ m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xcf);
}
-static TIMER_DEVICE_CALLBACK( rst2_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::rst2_tick)
{
- n8080_state *n8080 = timer.machine().driver_data<n8080_state>();
- int state = n8080->m_inte ? ASSERT_LINE : CLEAR_LINE;
+ int state = m_inte ? ASSERT_LINE : CLEAR_LINE;
/* vblank */
- n8080->m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xd7);
+ m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xd7);
}
WRITE_LINE_MEMBER(n8080_state::n8080_inte_callback)
@@ -560,8 +558,8 @@ static MACHINE_CONFIG_START( spacefev, n8080_state )
MCFG_PALETTE_INIT_OVERRIDE(n8080_state,n8080)
MCFG_VIDEO_START_OVERRIDE(n8080_state,spacefev)
- MCFG_TIMER_ADD_SCANLINE("rst1", rst1_tick, "screen", 128, 256)
- MCFG_TIMER_ADD_SCANLINE("rst2", rst2_tick, "screen", 240, 256)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256)
/* sound hardware */
MCFG_FRAGMENT_ADD( spacefev_sound )
@@ -590,8 +588,8 @@ static MACHINE_CONFIG_START( sheriff, n8080_state )
MCFG_PALETTE_INIT_OVERRIDE(n8080_state,n8080)
MCFG_VIDEO_START_OVERRIDE(n8080_state,sheriff)
- MCFG_TIMER_ADD_SCANLINE("rst1", rst1_tick, "screen", 128, 256)
- MCFG_TIMER_ADD_SCANLINE("rst2", rst2_tick, "screen", 240, 256)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256)
/* sound hardware */
MCFG_FRAGMENT_ADD( sheriff_sound )
@@ -632,8 +630,8 @@ static MACHINE_CONFIG_START( helifire, n8080_state )
MCFG_PALETTE_INIT_OVERRIDE(n8080_state,helifire)
MCFG_VIDEO_START_OVERRIDE(n8080_state,helifire)
- MCFG_TIMER_ADD_SCANLINE("rst1", rst1_tick, "screen", 128, 256)
- MCFG_TIMER_ADD_SCANLINE("rst2", rst2_tick, "screen", 240, 256)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256)
/* sound hardware */
MCFG_FRAGMENT_ADD( helifire_sound )
diff --git a/src/mame/drivers/namcofl.c b/src/mame/drivers/namcofl.c
index b168fbec9a1..e5b2542f021 100644
--- a/src/mame/drivers/namcofl.c
+++ b/src/mame/drivers/namcofl.c
@@ -543,25 +543,19 @@ TIMER_CALLBACK_MEMBER(namcofl_state::raster_interrupt_callback)
m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period());
}
-static TIMER_DEVICE_CALLBACK( mcu_irq0_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(namcofl_state::mcu_irq0_cb)
{
- namcofl_state *state = timer.machine().driver_data<namcofl_state>();
-
- state->m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( mcu_irq2_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(namcofl_state::mcu_irq2_cb)
{
- namcofl_state *state = timer.machine().driver_data<namcofl_state>();
-
- state->m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( mcu_adc_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(namcofl_state::mcu_adc_cb)
{
- namcofl_state *state = timer.machine().driver_data<namcofl_state>();
-
- state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
}
@@ -591,9 +585,9 @@ static MACHINE_CONFIG_START( namcofl, namcofl_state )
MCFG_CPU_PROGRAM_MAP(namcoc75_am)
MCFG_CPU_IO_MAP(namcoc75_io)
/* TODO: irq generation for these */
- MCFG_TIMER_ADD_PERIODIC("mcu_irq0", mcu_irq0_cb, attotime::from_hz(60))
- MCFG_TIMER_ADD_PERIODIC("mcu_irq2", mcu_irq2_cb, attotime::from_hz(60))
- MCFG_TIMER_ADD_PERIODIC("mcu_adc", mcu_adc_cb, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq0", namcofl_state, mcu_irq0_cb, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq2", namcofl_state, mcu_irq2_cb, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_adc", namcofl_state, mcu_adc_cb, attotime::from_hz(60))
MCFG_MACHINE_START_OVERRIDE(namcofl_state,namcofl)
MCFG_MACHINE_RESET_OVERRIDE(namcofl_state,namcofl)
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index 13e0210be99..4943c8254fd 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -955,28 +955,27 @@ static ADDRESS_MAP_START( namcona1_mcu_io_map, AS_IO, 8, namcona1_state )
ADDRESS_MAP_END
-static TIMER_DEVICE_CALLBACK( namcona1_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::namcona1_interrupt)
{
- namcona1_state *state = timer.machine().driver_data<namcona1_state>();
int scanline = param;
- int enabled = state->m_mEnableInterrupts ? ~state->m_vreg[0x1a/2] : 0;
+ int enabled = m_mEnableInterrupts ? ~m_vreg[0x1a/2] : 0;
// vblank
if (scanline == 224)
{
- simulate_mcu( timer.machine() );
+ simulate_mcu( machine() );
if (enabled & 8)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
}
// posirq, used with dolphin in Emeraldia's "how to play" attract mode
- int posirq_scanline = state->m_vreg[0x8a/2] & 0xff;
+ int posirq_scanline = m_vreg[0x8a/2] & 0xff;
if (scanline == posirq_scanline && enabled & 4)
{
if (posirq_scanline)
- timer.machine().primary_screen->update_partial(posirq_scanline);
+ machine().primary_screen->update_partial(posirq_scanline);
- state->m_maincpu->set_input_line(3, HOLD_LINE);
+ m_maincpu->set_input_line(3, HOLD_LINE);
}
}
@@ -984,18 +983,17 @@ static TIMER_DEVICE_CALLBACK( namcona1_interrupt )
// IRQ 1 =>
// IRQ 2 =>
-static TIMER_DEVICE_CALLBACK( mcu_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::mcu_interrupt)
{
- namcona1_state *state = timer.machine().driver_data<namcona1_state>();
int scanline = param;
// vblank
if (scanline == 224)
- state->m_mcu->set_input_line(M37710_LINE_IRQ1, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_IRQ1, HOLD_LINE);
// adc (timing guessed, when does this trigger?)
if (scanline == 0)
- state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
}
static const c140_interface C140_interface_typeA =
@@ -1008,12 +1006,12 @@ static MACHINE_CONFIG_START( namcona1, namcona1_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 50113000/4)
MCFG_CPU_PROGRAM_MAP(namcona1_main_map)
- MCFG_TIMER_ADD_SCANLINE("scan_main", namcona1_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_main", namcona1_state, namcona1_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("mcu", M37702, 50113000/4)
MCFG_CPU_PROGRAM_MAP(namcona1_mcu_map)
MCFG_CPU_IO_MAP( namcona1_mcu_io_map)
- MCFG_TIMER_ADD_SCANLINE("scan_mcu", mcu_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_mcu", namcona1_state, mcu_interrupt, "screen", 0, 1)
MCFG_NVRAM_HANDLER(namcosna1)
MCFG_QUANTUM_TIME(attotime::from_hz(2400))
diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c
index f6d6b719e40..415fd0a1ba5 100644
--- a/src/mame/drivers/namconb1.c
+++ b/src/mame/drivers/namconb1.c
@@ -282,17 +282,17 @@ GFX: Custom 145 ( 80 pin PQFP)
/****************************************************************************/
-static TIMER_DEVICE_CALLBACK( mcu_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(namconb1_state::mcu_interrupt)
{
int scanline = param;
/* TODO: real sources of these */
if (scanline == 224)
- timer.machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
+ machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
else if (scanline == 0)
- timer.machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
+ machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
else if (scanline == 128)
- timer.machine().device("mcu")->execute().set_input_line(M37710_LINE_ADC, HOLD_LINE);
+ machine().device("mcu")->execute().set_input_line(M37710_LINE_ADC, HOLD_LINE);
}
@@ -1010,7 +1010,7 @@ static MACHINE_CONFIG_START( namconb1, namconb1_state )
MCFG_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3)
MCFG_CPU_PROGRAM_MAP(namcoc75_am)
MCFG_CPU_IO_MAP(namcoc75_io)
- MCFG_TIMER_ADD_SCANLINE("mcu_st", mcu_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("mcu_st", namconb1_state, mcu_interrupt, "screen", 0, 1)
MCFG_NVRAM_HANDLER(namconb1)
MCFG_MACHINE_START_OVERRIDE(namconb1_state,namconb)
@@ -1042,7 +1042,7 @@ static MACHINE_CONFIG_START( namconb2, namconb1_state )
MCFG_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3)
MCFG_CPU_PROGRAM_MAP(namcoc75_am)
MCFG_CPU_IO_MAP(namcoc75_io)
- MCFG_TIMER_ADD_SCANLINE("mcu_st", mcu_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("mcu_st", namconb1_state, mcu_interrupt, "screen", 0, 1)
MCFG_NVRAM_HANDLER(namconb1)
MCFG_MACHINE_START_OVERRIDE(namconb1_state,namconb)
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index 01fbd5c3d99..369accf271f 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -1683,36 +1683,34 @@ READ16_MEMBER(namcos22_state::master_serial_io_r)
return m_mSerialDataSlaveToMasterCurrent;
}
-static TIMER_DEVICE_CALLBACK( dsp_master_serial_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::dsp_master_serial_irq)
{
- namcos22_state *state = timer.machine().driver_data<namcos22_state>();
int scanline = param;
- if( state->m_mbEnableDspIrqs )
+ if( m_mbEnableDspIrqs )
{
- state->m_mSerialDataSlaveToMasterCurrent = state->m_mSerialDataSlaveToMasterNext;
+ m_mSerialDataSlaveToMasterCurrent = m_mSerialDataSlaveToMasterNext;
if(scanline == 480)
- state->m_master->set_input_line(TMS32025_INT0, HOLD_LINE);
+ m_master->set_input_line(TMS32025_INT0, HOLD_LINE);
else if((scanline % 2) == 0)
{
- state->m_master->set_input_line(TMS32025_RINT, HOLD_LINE);
- state->m_master->set_input_line(TMS32025_XINT, HOLD_LINE);
+ m_master->set_input_line(TMS32025_RINT, HOLD_LINE);
+ m_master->set_input_line(TMS32025_XINT, HOLD_LINE);
}
}
}
-static TIMER_DEVICE_CALLBACK( dsp_slave_serial_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::dsp_slave_serial_irq)
{
- namcos22_state *state = timer.machine().driver_data<namcos22_state>();
int scanline = param;
- if( state->m_mbEnableDspIrqs )
+ if( m_mbEnableDspIrqs )
{
if((scanline % 2) == 0)
{
- state->m_slave->set_input_line(TMS32025_RINT, HOLD_LINE);
- state->m_slave->set_input_line(TMS32025_XINT, HOLD_LINE);
+ m_slave->set_input_line(TMS32025_RINT, HOLD_LINE);
+ m_slave->set_input_line(TMS32025_XINT, HOLD_LINE);
}
}
}
@@ -2920,18 +2918,17 @@ static ADDRESS_MAP_START( mcu_s22_io, AS_IO, 8, namcos22_state )
AM_RANGE(M37710_PORT4, M37710_PORT4) AM_READ(mcu_port4_s22_r )
ADDRESS_MAP_END
-static TIMER_DEVICE_CALLBACK( mcu_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::mcu_irq)
{
- namcos22_state *state = timer.machine().driver_data<namcos22_state>();
int scanline = param;
/* TODO: real sources of these */
if(scanline == 480)
- state->m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
else if(scanline == 500)
- state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
else if(scanline == 0)
- state->m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
+ m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
}
void namcos22_state::machine_reset()
@@ -2948,18 +2945,18 @@ static MACHINE_CONFIG_START( namcos22s, namcos22_state )
MCFG_CPU_PROGRAM_MAP(master_dsp_program)
MCFG_CPU_DATA_MAP(master_dsp_data)
MCFG_CPU_IO_MAP(master_dsp_io)
- MCFG_TIMER_ADD_SCANLINE("master_st", dsp_master_serial_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("master_st", namcos22_state, dsp_master_serial_irq, "screen", 0, 1)
MCFG_CPU_ADD("slave", TMS32025,SS22_MASTER_CLOCK)
MCFG_CPU_PROGRAM_MAP(slave_dsp_program)
MCFG_CPU_DATA_MAP(slave_dsp_data)
MCFG_CPU_IO_MAP(slave_dsp_io)
- MCFG_TIMER_ADD_SCANLINE("slave_st", dsp_slave_serial_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_st", namcos22_state, dsp_slave_serial_irq, "screen", 0, 1)
MCFG_CPU_ADD("mcu", M37710, SS22_MASTER_CLOCK/3)
MCFG_CPU_PROGRAM_MAP(mcu_program)
MCFG_CPU_IO_MAP( mcu_io)
- MCFG_TIMER_ADD_SCANLINE("mcu_st", mcu_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("mcu_st", namcos22_state, mcu_irq, "screen", 0, 1)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
// MCFG_QUANTUM_PERFECT_CPU("maincpu")
@@ -3199,13 +3196,13 @@ static MACHINE_CONFIG_START( namcos22, namcos22_state )
MCFG_CPU_PROGRAM_MAP(master_dsp_program)
MCFG_CPU_DATA_MAP(master_dsp_data)
MCFG_CPU_IO_MAP(master_dsp_io)
- MCFG_TIMER_ADD_SCANLINE("master_st", dsp_master_serial_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("master_st", namcos22_state, dsp_master_serial_irq, "screen", 0, 1)
MCFG_CPU_ADD("slave", TMS32025,SS22_MASTER_CLOCK) /* ? */
MCFG_CPU_PROGRAM_MAP(slave_dsp_program)
MCFG_CPU_DATA_MAP(slave_dsp_data)
MCFG_CPU_IO_MAP(slave_dsp_io)
- MCFG_TIMER_ADD_SCANLINE("slave_st", dsp_slave_serial_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_st", namcos22_state, dsp_slave_serial_irq, "screen", 0, 1)
MCFG_CPU_ADD("mcu", M37702, SS22_MASTER_CLOCK/3) // C74 on the CPU board has no periodic interrupts, it runs entirely off Timer A0
MCFG_CPU_PROGRAM_MAP( mcu_s22_program)
diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c
index fab632bcd8c..a9fcaf9738d 100644
--- a/src/mame/drivers/nemesis.c
+++ b/src/mame/drivers/nemesis.c
@@ -70,31 +70,29 @@ INTERRUPT_GEN_MEMBER(nemesis_state::blkpnthr_interrupt)
device.execute().set_input_line(2, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( konamigt_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(nemesis_state::konamigt_interrupt)
{
- nemesis_state *state = timer.machine().driver_data<nemesis_state>();
int scanline = param;
- if (scanline == 240 && state->m_irq_on && (timer.machine().primary_screen->frame_number() & 1) == 0)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ if (scanline == 240 && m_irq_on && (machine().primary_screen->frame_number() & 1) == 0)
+ m_maincpu->set_input_line(1, HOLD_LINE);
- if (scanline == 0 && state->m_irq2_on)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ if (scanline == 0 && m_irq2_on)
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( gx400_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(nemesis_state::gx400_interrupt)
{
- nemesis_state *state = timer.machine().driver_data<nemesis_state>();
int scanline = param;
- if (scanline == 240 && state->m_irq1_on && (timer.machine().primary_screen->frame_number() & 1) == 0)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ if (scanline == 240 && m_irq1_on && (machine().primary_screen->frame_number() & 1) == 0)
+ m_maincpu->set_input_line(1, HOLD_LINE);
- if (scanline == 0 && state->m_irq2_on)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ if (scanline == 0 && m_irq2_on)
+ m_maincpu->set_input_line(2, HOLD_LINE);
- if (scanline == 120 && state->m_irq4_on)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ if (scanline == 120 && m_irq4_on)
+ m_maincpu->set_input_line(4, HOLD_LINE);
}
@@ -1598,7 +1596,7 @@ static MACHINE_CONFIG_START( gx400, nemesis_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216MHz */
MCFG_CPU_PROGRAM_MAP(gx400_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", gx400_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, gx400_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(gx400_sound_map)
@@ -1641,7 +1639,7 @@ static MACHINE_CONFIG_START( konamigt, nemesis_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216 MHz? */
MCFG_CPU_PROGRAM_MAP(konamigt_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", konamigt_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, konamigt_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -1680,7 +1678,7 @@ static MACHINE_CONFIG_START( rf2_gx400, nemesis_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216MHz */
MCFG_CPU_PROGRAM_MAP(rf2_gx400_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", gx400_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, gx400_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(gx400_sound_map)
@@ -1903,7 +1901,7 @@ static MACHINE_CONFIG_START( hcrash, nemesis_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,18432000/3) /* 6.144MHz */
MCFG_CPU_PROGRAM_MAP(hcrash_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", konamigt_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, konamigt_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(sal_sound_map)
@@ -2648,7 +2646,7 @@ static MACHINE_CONFIG_START( bubsys, nemesis_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216MHz */
MCFG_CPU_PROGRAM_MAP(gx400_map)
-// MCFG_TIMER_ADD_SCANLINE("scantimer", gx400_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, gx400_interrupt, "screen", 0, 1)
MCFG_DEVICE_DISABLE()
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */
diff --git a/src/mame/drivers/nitedrvr.c b/src/mame/drivers/nitedrvr.c
index a13cfd5f03d..2b424d76d40 100644
--- a/src/mame/drivers/nitedrvr.c
+++ b/src/mame/drivers/nitedrvr.c
@@ -143,7 +143,7 @@ static MACHINE_CONFIG_START( nitedrvr, nitedrvr_state )
MCFG_WATCHDOG_VBLANK_INIT(3)
- MCFG_TIMER_ADD_PERIODIC("crash_timer", nitedrvr_crash_toggle_callback, PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("crash_timer", nitedrvr_state, nitedrvr_crash_toggle_callback, PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index 62ffb49071d..7c28078bd4f 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -867,14 +867,14 @@ static void mcu_run(running_machine &machine, UINT8 dsw_setting)
}
}
-static TIMER_DEVICE_CALLBACK( tdragon_mcu_sim )
+TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::tdragon_mcu_sim)
{
- mcu_run(timer.machine(),1);
+ mcu_run(machine(),1);
}
-static TIMER_DEVICE_CALLBACK( hachamf_mcu_sim )
+TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::hachamf_mcu_sim)
{
- mcu_run(timer.machine(),0);
+ mcu_run(machine(),0);
}
static ADDRESS_MAP_START( tdragon_map, AS_PROGRAM, 16, nmk16_state )
@@ -3512,30 +3512,30 @@ static const ym2203_interface ym2203_config =
DEVCB_LINE(ym2203_irqhandler)
};
-static TIMER_DEVICE_CALLBACK( nmk16_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
/* This is either vblank-in or sprite dma irq complete, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous
cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */
if(scanline == 0)
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
}
/* bee-oh board, almost certainly it has different timings */
-static TIMER_DEVICE_CALLBACK( manybloc_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::manybloc_scanline)
{
int scanline = param;
if(scanline == 248) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
/* This is either vblank-in or sprite dma irq complete */
if(scanline == 0)
- timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
}
@@ -3550,7 +3550,7 @@ static MACHINE_CONFIG_START( tharrier, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */
MCFG_CPU_PROGRAM_MAP(tharrier_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3000000)
MCFG_CPU_PROGRAM_MAP(tharrier_sound_map)
@@ -3595,7 +3595,7 @@ static MACHINE_CONFIG_START( manybloc, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10? MHz - check */
MCFG_CPU_PROGRAM_MAP(manybloc_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 56)/* this needs to equal the framerate on this, rather than being double it .. */
- MCFG_TIMER_ADD_SCANLINE("scantimer", manybloc_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, manybloc_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3000000)
MCFG_CPU_PROGRAM_MAP(tharrier_sound_map)
@@ -3638,7 +3638,7 @@ static MACHINE_CONFIG_START( mustang, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */
MCFG_CPU_PROGRAM_MAP(mustang_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
@@ -3679,7 +3679,7 @@ static MACHINE_CONFIG_START( mustangb, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */
MCFG_CPU_PROGRAM_MAP(mustangb_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
SEIBU_SOUND_SYSTEM_CPU(14318180/4)
@@ -3713,7 +3713,7 @@ static MACHINE_CONFIG_START( bioship, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, BIOSHIP_CRYSTAL1 ) /* 10.0 MHz (verified) */
MCFG_CPU_PROGRAM_MAP(bioship_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 100)/* 112 breaks the title screen */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
@@ -3754,7 +3754,7 @@ static MACHINE_CONFIG_START( vandyke, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_10MHz) /* 68000p12 running at 10Mhz, verified on pcb */
MCFG_CPU_PROGRAM_MAP(vandyke_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
@@ -3795,7 +3795,7 @@ static MACHINE_CONFIG_START( vandykeb, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */
MCFG_CPU_PROGRAM_MAP(vandykeb_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_CPU_ADD("mcu", PIC16C57, 12000000) /* 3MHz */
MCFG_DEVICE_DISABLE()
@@ -3829,7 +3829,7 @@ static MACHINE_CONFIG_START( acrobatm, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz (verified on pcb) */
MCFG_CPU_PROGRAM_MAP(acrobatm_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
@@ -3872,7 +3872,7 @@ static MACHINE_CONFIG_START( tdragonb, nmk16_state ) /* bootleg using Raiden sou
MCFG_CPU_PROGRAM_MAP(tdragonb_map)
//MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
SEIBU_SOUND_SYSTEM_CPU(14318180/4)
@@ -3903,7 +3903,7 @@ static MACHINE_CONFIG_START( tdragon, nmk16_state )
MCFG_CPU_PROGRAM_MAP(tdragon_map)
//MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
@@ -3920,7 +3920,7 @@ static MACHINE_CONFIG_START( tdragon, nmk16_state )
MCFG_PALETTE_LENGTH(1024)
MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross)
- MCFG_TIMER_ADD_PERIODIC("coinsim", tdragon_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, tdragon_mcu_sim, attotime::from_hz(10000))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -3978,7 +3978,7 @@ static MACHINE_CONFIG_START( strahl, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000, 12000000) /* 12 MHz ? */
MCFG_CPU_PROGRAM_MAP(strahl_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
@@ -4036,7 +4036,7 @@ static MACHINE_CONFIG_START( hachamf, nmk16_state )
MCFG_PALETTE_LENGTH(1024)
MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross)
- MCFG_TIMER_ADD_PERIODIC("coinsim", hachamf_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, hachamf_mcu_sim, attotime::from_hz(10000))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -4815,7 +4815,7 @@ static MACHINE_CONFIG_START( stagger1, nmk16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,XTAL_12MHz) /* 68000p10 running at 12mhz, verified on pcb */
MCFG_CPU_PROGRAM_MAP(afega)
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_4MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(afega_sound_cpu)
@@ -4900,7 +4900,7 @@ static MACHINE_CONFIG_START( firehawk, nmk16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,12000000)
MCFG_CPU_PROGRAM_MAP(afega)
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,4000000)
MCFG_CPU_PROGRAM_MAP(firehawk_sound_cpu)
@@ -4935,7 +4935,7 @@ static MACHINE_CONFIG_START( twinactn, nmk16_state )
MCFG_CPU_ADD("maincpu", M68000,12000000)
MCFG_CPU_PROGRAM_MAP(twinactn_map)
MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
- MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(twinactn_sound_cpu)
diff --git a/src/mame/drivers/orbit.c b/src/mame/drivers/orbit.c
index 7cf3e8e7af6..cc1b52d1a42 100644
--- a/src/mame/drivers/orbit.c
+++ b/src/mame/drivers/orbit.c
@@ -31,12 +31,11 @@ Atari Orbit Driver
*
*************************************/
-static TIMER_DEVICE_CALLBACK( nmi_32v )
+TIMER_DEVICE_CALLBACK_MEMBER(orbit_state::nmi_32v)
{
- orbit_state *state = timer.machine().driver_data<orbit_state>();
int scanline = param;
- int nmistate = (scanline & 32) && (state->m_misc_flags & 4);
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, nmistate ? ASSERT_LINE : CLEAR_LINE);
+ int nmistate = (scanline & 32) && (m_misc_flags & 4);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, nmistate ? ASSERT_LINE : CLEAR_LINE);
}
@@ -300,7 +299,7 @@ static MACHINE_CONFIG_START( orbit, orbit_state )
MCFG_CPU_PROGRAM_MAP(orbit_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", orbit_state, orbit_interrupt)
- MCFG_TIMER_ADD_SCANLINE("32v", nmi_32v, "screen", 0, 32)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", orbit_state, nmi_32v, "screen", 0, 32)
/* video hardware */
diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c
index 2024664a4da..1e0c1ebe31b 100644
--- a/src/mame/drivers/overdriv.c
+++ b/src/mame/drivers/overdriv.c
@@ -74,16 +74,16 @@ WRITE16_MEMBER(overdriv_state::eeprom_w)
}
}
-static TIMER_DEVICE_CALLBACK( overdriv_cpuA_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(overdriv_state::overdriv_cpuA_scanline)
{
int scanline = param;
/* TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?) */
/* this is a temporary solution to get rid of deprecat lib and the crashes, but also makes the game timer to be too slow */
- if(scanline == 256 && timer.machine().primary_screen->frame_number() & 1) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ if(scanline == 256 && machine().primary_screen->frame_number() & 1) // vblank-out irq
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
else if((scanline % 128) == 0) // timer irq
- timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
}
INTERRUPT_GEN_MEMBER(overdriv_state::cpuB_interrupt)
@@ -328,7 +328,7 @@ static MACHINE_CONFIG_START( overdriv, overdriv_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,24000000/2) /* 12 MHz */
MCFG_CPU_PROGRAM_MAP(overdriv_master_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", overdriv_cpuA_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", overdriv_state, overdriv_cpuA_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M68000,24000000/2) /* 12 MHz */
MCFG_CPU_PROGRAM_MAP(overdriv_slave_map)
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index 536601e7fef..e3460049aa7 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -488,16 +488,15 @@ GFXDECODE_END
/* most games require IRQ4 for inputs to work, Puzzli 2 is explicit about not wanting it tho
what is the source? */
-TIMER_DEVICE_CALLBACK( pgm_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(pgm_state::pgm_interrupt)
{
- pgm_state *state = timer.machine().driver_data<pgm_state>();
int scanline = param;
if(scanline == 224)
- state->m_maincpu->set_input_line(6, HOLD_LINE);
+ m_maincpu->set_input_line(6, HOLD_LINE);
if(scanline == 0)
- if (!state->m_irq4_disabled) state->m_maincpu->set_input_line(4, HOLD_LINE);
+ if (!m_irq4_disabled) m_maincpu->set_input_line(4, HOLD_LINE);
}
MACHINE_START_MEMBER(pgm_state,pgm)
@@ -521,7 +520,7 @@ MACHINE_CONFIG_FRAGMENT( pgmbase )
MCFG_CPU_ADD("maincpu", M68000, 20000000) /* 20 mhz! verified on real board */
MCFG_CPU_PROGRAM_MAP(pgm_basic_mem)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pgm_state, irq6_line_hold)
- MCFG_TIMER_ADD_SCANLINE("scantimer", pgm_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pgm_state, pgm_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", Z80, 33868800/4)
MCFG_CPU_PROGRAM_MAP(pgm_z80_mem)
diff --git a/src/mame/drivers/pingpong.c b/src/mame/drivers/pingpong.c
index f02a2e1f425..a25bcae31e9 100644
--- a/src/mame/drivers/pingpong.c
+++ b/src/mame/drivers/pingpong.c
@@ -55,33 +55,31 @@ WRITE8_MEMBER(pingpong_state::coin_w)
/* other bits unknown */
}
-static TIMER_DEVICE_CALLBACK( pingpong_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(pingpong_state::pingpong_interrupt)
{
- pingpong_state *state = timer.machine().driver_data<pingpong_state>();
int scanline = param;
if (scanline == 240)
{
- if (state->m_intenable & 0x04) state->m_maincpu->set_input_line(0, HOLD_LINE);
+ if (m_intenable & 0x04) m_maincpu->set_input_line(0, HOLD_LINE);
}
else if ((scanline % 32) == 0)
{
- if (state->m_intenable & 0x08) state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_intenable & 0x08) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
-static TIMER_DEVICE_CALLBACK( merlinmm_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(pingpong_state::merlinmm_interrupt)
{
- pingpong_state *state = timer.machine().driver_data<pingpong_state>();
int scanline = param;
if (scanline == 240)
{
- if (state->m_intenable & 0x04) state->m_maincpu->set_input_line(0, HOLD_LINE);
+ if (m_intenable & 0x04) m_maincpu->set_input_line(0, HOLD_LINE);
}
else if (scanline == 0)
{
- if (state->m_intenable & 0x08) state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_intenable & 0x08) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -464,7 +462,7 @@ static MACHINE_CONFIG_START( pingpong, pingpong_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80,18432000/6) /* 3.072 MHz (probably) */
MCFG_CPU_PROGRAM_MAP(pingpong_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", pingpong_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pingpong_state, pingpong_interrupt, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -491,7 +489,7 @@ static MACHINE_CONFIG_DERIVED( merlinmm, pingpong )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(merlinmm_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(merlinmm_interrupt)
+ MCFG_TIMER_DRIVER_CALLBACK(pingpong_state, merlinmm_interrupt)
MCFG_NVRAM_ADD_0FILL("nvram")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index 6e6ca257a04..b3c9c107cc5 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -445,18 +445,17 @@ static const namco_53xx_interface namco_53xx_intf =
};
-static TIMER_DEVICE_CALLBACK( polepos_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(polepos_state::polepos_scanline)
{
- polepos_state *state = timer.machine().driver_data<polepos_state>();
int scanline = param;
- if (((scanline == 64) || (scanline == 192)) && state->m_main_irq_mask) // 64V
- timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ if (((scanline == 64) || (scanline == 192)) && m_main_irq_mask) // 64V
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
- if (scanline == 240 && state->m_sub_irq_mask) // VBLANK
+ if (scanline == 240 && m_sub_irq_mask) // VBLANK
{
- timer.machine().device("sub")->execute().set_input_line(0, ASSERT_LINE);
- timer.machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("sub")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE);
}
}
@@ -903,7 +902,7 @@ static MACHINE_CONFIG_START( polepos, polepos_state )
MCFG_MACHINE_RESET_OVERRIDE(polepos_state,polepos)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_ADD_SCANLINE("scantimer", polepos_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, polepos_scanline, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -982,7 +981,7 @@ static MACHINE_CONFIG_START( topracern, polepos_state )
MCFG_MACHINE_RESET_OVERRIDE(polepos_state,polepos)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_ADD_SCANLINE("scantimer", polepos_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, polepos_scanline, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/polyplay.c b/src/mame/drivers/polyplay.c
index d71d2093d15..3e43954daf7 100644
--- a/src/mame/drivers/polyplay.c
+++ b/src/mame/drivers/polyplay.c
@@ -88,7 +88,7 @@ emulated now. ;)
/* timer handling */
-static TIMER_DEVICE_CALLBACK( polyplay_timer_callback );
+
@@ -276,7 +276,7 @@ static MACHINE_CONFIG_START( polyplay, polyplay_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", polyplay_state, coin_interrupt)
- MCFG_TIMER_ADD("timer", polyplay_timer_callback)
+ MCFG_TIMER_DRIVER_ADD("timer", polyplay_state, polyplay_timer_callback)
/* video hardware */
@@ -342,9 +342,9 @@ ROM_START( polyplay )
ROM_END
-static TIMER_DEVICE_CALLBACK( polyplay_timer_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(polyplay_state::polyplay_timer_callback)
{
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c);
}
/* game driver */
diff --git a/src/mame/drivers/psychic5.c b/src/mame/drivers/psychic5.c
index ca2fbef83ab..f65b554470c 100644
--- a/src/mame/drivers/psychic5.c
+++ b/src/mame/drivers/psychic5.c
@@ -327,15 +327,15 @@ void psychic5_state::machine_reset()
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( psychic5_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(psychic5_state::psychic5_scanline)
{
int scanline = param;
if(scanline == 240) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
if(scanline == 0) // sprite buffer irq
- timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
}
@@ -663,7 +663,7 @@ static MACHINE_CONFIG_START( psychic5, psychic5_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)
MCFG_CPU_PROGRAM_MAP(psychic5_main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", psychic5_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", psychic5_state, psychic5_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/2)
MCFG_CPU_PROGRAM_MAP(psychic5_sound_map)
@@ -708,7 +708,7 @@ static MACHINE_CONFIG_START( bombsa, psychic5_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2 ) /* 6 MHz */
MCFG_CPU_PROGRAM_MAP(bombsa_main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", psychic5_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", psychic5_state, psychic5_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_5MHz )
MCFG_CPU_PROGRAM_MAP(bombsa_sound_map)
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index efede622aff..e69b700b4a0 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -264,19 +264,18 @@ READ16_MEMBER(qdrmfgp_state::gp2_ide_std_r)
*
*************************************/
-static TIMER_DEVICE_CALLBACK(qdrmfgp_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(qdrmfgp_state::qdrmfgp_interrupt)
{
- qdrmfgp_state *state = timer.machine().driver_data<qdrmfgp_state>();
int scanline = param;
if(scanline == 0)
- if (state->m_control & 0x0001)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ if (m_control & 0x0001)
+ m_maincpu->set_input_line(1, HOLD_LINE);
/* trigger V-blank interrupt */
if(scanline == 240)
- if (state->m_control & 0x0004)
- state->m_maincpu->set_input_line(3, HOLD_LINE);
+ if (m_control & 0x0004)
+ m_maincpu->set_input_line(3, HOLD_LINE);
}
static void ide_interrupt(device_t *device, int state)
@@ -675,7 +674,7 @@ static MACHINE_CONFIG_START( qdrmfgp, qdrmfgp_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 32000000/2) /* 16.000 MHz */
MCFG_CPU_PROGRAM_MAP(qdrmfgp_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", qdrmfgp_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", qdrmfgp_state, qdrmfgp_interrupt, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(qdrmfgp_state,qdrmfgp)
MCFG_NVRAM_ADD_1FILL("nvram")
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 34db80530e4..db939900671 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -664,15 +664,14 @@ WRITE8_MEMBER(renegade_state::bankswitch_w)
}
}
-static TIMER_DEVICE_CALLBACK( renegade_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(renegade_state::renegade_interrupt)
{
- renegade_state *state = timer.machine().driver_data<renegade_state>();
int scanline = param;
if (scanline == 112) // ???
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
else if(scanline == 240)
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_maincpu->set_input_line(0, HOLD_LINE);
}
WRITE8_MEMBER(renegade_state::renegade_coin_counter_w)
@@ -935,7 +934,7 @@ static MACHINE_CONFIG_START( renegade, renegade_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, 12000000/8) /* 1.5 MHz (measured) */
MCFG_CPU_PROGRAM_MAP(renegade_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", renegade_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", renegade_state, renegade_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M6809, 12000000/8)
MCFG_CPU_PROGRAM_MAP(renegade_sound_map) /* IRQs are caused by the main CPU */
diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c
index a1a774e77e1..c25b82a2a69 100644
--- a/src/mame/drivers/scobra.c
+++ b/src/mame/drivers/scobra.c
@@ -673,7 +673,7 @@ static MACHINE_CONFIG_START( type1, scobra_state )
MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
- MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
+ MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -792,7 +792,7 @@ static MACHINE_CONFIG_START( hustler, scobra_state )
MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
- MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
+ MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
/* device config overrides */
MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf )
diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c
index 1f3a92fcbb6..16d5cc6a4d6 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -1331,7 +1331,7 @@ static MACHINE_CONFIG_START( scramble, scramble_state )
MCFG_7474_ADD("konami_7474", "konami_7474", NULL, scramble_sh_7474_q_callback)
- MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
+ MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
MCFG_MACHINE_RESET_OVERRIDE(scramble_state,scramble)
@@ -1562,7 +1562,7 @@ static MACHINE_CONFIG_START( ad2083, scramble_state )
MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
- MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
+ MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
MCFG_MACHINE_RESET_OVERRIDE(scramble_state,galaxold)
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index b42e6ba0776..617786eebd8 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -338,7 +338,7 @@ WRITE16_MEMBER( segahang_state::sharrier_io_w )
#if 0
-static TIMER_DEVICE_CALLBACK( hangon_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(segahang_state::hangon_irq)
{
int scanline = param;
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index 1926bd41072..34a3a210afb 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -861,46 +861,42 @@ void segas24_state::irq_timer_start(int old_tmode)
}
}
-static TIMER_DEVICE_CALLBACK( irq_timer_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_timer_cb)
{
- segas24_state *state = timer.machine().driver_data<segas24_state>();
- state->irq_timer_sync();
+ irq_timer_sync();
- if(state->irq_tval != 0x1000)
- fprintf(stderr, "Error: timer desync %x != 1000\n", state->irq_tval);
+ if(irq_tval != 0x1000)
+ fprintf(stderr, "Error: timer desync %x != 1000\n", irq_tval);
- state->irq_tval = state->irq_tdata;
- state->irq_timer_start(state->irq_tmode);
+ irq_tval = irq_tdata;
+ irq_timer_start(irq_tmode);
- state->irq_timer_pend0 = state->irq_timer_pend1 = 1;
- if(state->irq_allow0 & (1 << IRQ_TIMER))
- timer.machine().device("maincpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
- if(state->irq_allow1 & (1 << IRQ_TIMER))
- timer.machine().device("subcpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
+ irq_timer_pend0 = irq_timer_pend1 = 1;
+ if(irq_allow0 & (1 << IRQ_TIMER))
+ machine().device("maincpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
+ if(irq_allow1 & (1 << IRQ_TIMER))
+ machine().device("subcpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
- if(state->irq_tmode == 1 || state->irq_tmode == 2)
- timer.machine().primary_screen->update_now();
+ if(irq_tmode == 1 || irq_tmode == 2)
+ machine().primary_screen->update_now();
}
-static TIMER_DEVICE_CALLBACK( irq_timer_clear_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_timer_clear_cb)
{
- segas24_state *state = timer.machine().driver_data<segas24_state>();
- state->irq_sprite = state->irq_vblank = 0;
- timer.machine().device("maincpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
- timer.machine().device("maincpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
- timer.machine().device("subcpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
- timer.machine().device("subcpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
+ irq_sprite = irq_vblank = 0;
+ machine().device("maincpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
+ machine().device("subcpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
+ machine().device("subcpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
}
-static TIMER_DEVICE_CALLBACK( irq_frc_cb )
+TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_frc_cb)
{
- segas24_state *state = timer.machine().driver_data<segas24_state>();
-
- if(state->irq_allow0 & (1 << IRQ_FRC) && state->frc_mode == 1)
- timer.machine().device("maincpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
+ if(irq_allow0 & (1 << IRQ_FRC) && frc_mode == 1)
+ machine().device("maincpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
- if(state->irq_allow1 & (1 << IRQ_FRC) && state->frc_mode == 1)
- timer.machine().device("subcpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
+ if(irq_allow1 & (1 << IRQ_FRC) && frc_mode == 1)
+ machine().device("subcpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
}
void segas24_state::irq_init()
@@ -985,39 +981,38 @@ READ16_MEMBER(segas24_state::irq_r)
return irq_tval & 0xfff;
}
-static TIMER_DEVICE_CALLBACK(irq_vbl)
+TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_vbl)
{
- segas24_state *state = timer.machine().driver_data<segas24_state>();
int irq, mask;
int scanline = param;
/* TODO: perhaps vblank irq happens at 400, sprite IRQ certainly don't at 0! */
- if(scanline == 0) { irq = IRQ_SPRITE; state->irq_sprite = 1; }
- else if(scanline == 384) { irq = IRQ_VBLANK; state->irq_vblank = 1; }
+ if(scanline == 0) { irq = IRQ_SPRITE; irq_sprite = 1; }
+ else if(scanline == 384) { irq = IRQ_VBLANK; irq_vblank = 1; }
else
return;
- state->irq_timer_clear->adjust(attotime::from_hz(HSYNC_CLOCK));
+ irq_timer_clear->adjust(attotime::from_hz(HSYNC_CLOCK));
mask = 1 << irq;
- if(state->irq_allow0 & mask)
- timer.machine().device("maincpu")->execute().set_input_line(1+irq, ASSERT_LINE);
+ if(irq_allow0 & mask)
+ machine().device("maincpu")->execute().set_input_line(1+irq, ASSERT_LINE);
- if(state->irq_allow1 & mask)
- timer.machine().device("subcpu")->execute().set_input_line(1+irq, ASSERT_LINE);
+ if(irq_allow1 & mask)
+ machine().device("subcpu")->execute().set_input_line(1+irq, ASSERT_LINE);
if(scanline == 384) {
// Ensure one index pulse every 20 frames
// The is some code in bnzabros at 0x852 that makes it crash
// if the pulse train is too fast
- state->fdc_index_count++;
- if(state->fdc_index_count >= 20)
- state->fdc_index_count = 0;
+ fdc_index_count++;
+ if(fdc_index_count >= 20)
+ fdc_index_count = 0;
}
- state->irq_timer_sync();
- state->irq_vsynctime = timer.machine().time();
+ irq_timer_sync();
+ irq_vsynctime = machine().time();
}
static void irq_ym(device_t *device, int irq)
@@ -1946,7 +1941,7 @@ static MACHINE_CONFIG_START( system24, segas24_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(system24_cpu1_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", irq_vbl, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", segas24_state, irq_vbl, "screen", 0, 1)
MCFG_CPU_ADD("subcpu", M68000, MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(system24_cpu2_map)
@@ -1954,10 +1949,10 @@ static MACHINE_CONFIG_START( system24, segas24_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_TIMER_ADD("irq_timer", irq_timer_cb)
- MCFG_TIMER_ADD("irq_timer_clear", irq_timer_clear_cb)
+ MCFG_TIMER_DRIVER_ADD("irq_timer", segas24_state, irq_timer_cb)
+ MCFG_TIMER_DRIVER_ADD("irq_timer_clear", segas24_state, irq_timer_clear_cb)
MCFG_TIMER_ADD_NONE("frc_timer")
- MCFG_TIMER_ADD_PERIODIC("irq_frc", irq_frc_cb, attotime::from_hz(FRC_CLOCK_MODE1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_frc", segas24_state, irq_frc_cb, attotime::from_hz(FRC_CLOCK_MODE1))
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index edfc7b90bf7..cb203038b5d 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -440,9 +440,9 @@ static void signal_v60_irq(running_machine &machine, int which)
}
-static TIMER_DEVICE_CALLBACK( signal_v60_irq_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(segas32_state::signal_v60_irq_callback)
{
- signal_v60_irq(timer.machine(), param);
+ signal_v60_irq(machine(), param);
}
@@ -2202,8 +2202,8 @@ static MACHINE_CONFIG_START( system32, segas32_state )
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("v60_irq0", signal_v60_irq_callback)
- MCFG_TIMER_ADD("v60_irq1", signal_v60_irq_callback)
+ MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback)
+ MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback)
/* video hardware */
MCFG_GFXDECODE(segas32)
@@ -2261,8 +2261,8 @@ static MACHINE_CONFIG_START( multi32, segas32_state )
MCFG_EEPROM_93C46_ADD("eeprom")
- MCFG_TIMER_ADD("v60_irq0", signal_v60_irq_callback)
- MCFG_TIMER_ADD("v60_irq1", signal_v60_irq_callback)
+ MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback)
+ MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback)
/* video hardware */
MCFG_GFXDECODE(segas32)
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index 857cec0aae3..7e6357bb924 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -7410,41 +7410,38 @@ GFXDECODE_END
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( seta_interrupt_1_and_2 )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::seta_interrupt_1_and_2)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 112)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( seta_interrupt_2_and_4 )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::seta_interrupt_2_and_4)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
if(scanline == 112)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( seta_sub_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::seta_sub_interrupt)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
if(scanline == 240)
- state->m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
if(scanline == 112)
- state->m_subcpu->set_input_line(0, HOLD_LINE);
+ m_subcpu->set_input_line(0, HOLD_LINE);
}
@@ -7466,16 +7463,15 @@ static const ym2203_interface tndrcade_ym2203_interface =
};
-static TIMER_DEVICE_CALLBACK( tndrcade_sub_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::tndrcade_sub_interrupt)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
if(scanline == 240)
- state->m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
if((scanline % 16) == 0)
- state->m_subcpu->set_input_line(0, HOLD_LINE);
+ m_subcpu->set_input_line(0, HOLD_LINE);
}
static MACHINE_CONFIG_START( tndrcade, seta_state )
@@ -7487,7 +7483,7 @@ static MACHINE_CONFIG_START( tndrcade, seta_state )
MCFG_CPU_ADD("sub", M65C02, 16000000/8) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(tndrcade_sub_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", tndrcade_sub_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, tndrcade_sub_interrupt, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7537,7 +7533,7 @@ static MACHINE_CONFIG_START( twineagl, seta_state )
MCFG_CPU_ADD("sub", M65C02, 16000000/8) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(twineagl_sub_map)
- MCFG_TIMER_ADD_SCANLINE("s_scantimer", seta_sub_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7575,11 +7571,11 @@ static MACHINE_CONFIG_START( downtown, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(downtown_map)
- MCFG_TIMER_ADD_SCANLINE("m_scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("m_scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_CPU_ADD("sub", M65C02, XTAL_16MHz/8) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(downtown_sub_map)
- MCFG_TIMER_ADD_SCANLINE("s_scantimer", seta_sub_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7614,16 +7610,15 @@ MACHINE_CONFIG_END
5 ints per frame
*/
-static TIMER_DEVICE_CALLBACK( calibr50_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::calibr50_interrupt)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
if((scanline % 64) == 0)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
if(scanline == 248)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
@@ -7632,7 +7627,7 @@ static MACHINE_CONFIG_START( usclssic, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */
MCFG_CPU_PROGRAM_MAP(usclssic_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", calibr50_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, calibr50_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("sub", M65C02, 16000000/8) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
@@ -7680,7 +7675,7 @@ static MACHINE_CONFIG_START( calibr50, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(calibr50_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", calibr50_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, calibr50_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("sub", M65C02, XTAL_16MHz/8) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
@@ -7727,7 +7722,7 @@ static MACHINE_CONFIG_START( metafox, seta_state )
MCFG_CPU_ADD("sub", M65C02, 16000000/8) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(metafox_sub_map)
- MCFG_TIMER_ADD_SCANLINE("s_scantimer", seta_sub_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7763,7 +7758,7 @@ static MACHINE_CONFIG_START( atehate, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(atehate_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7805,7 +7800,7 @@ static MACHINE_CONFIG_START( blandia, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(blandia_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7838,7 +7833,7 @@ static MACHINE_CONFIG_START( blandiap, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(blandiap_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7912,7 +7907,7 @@ static MACHINE_CONFIG_START( daioh, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(daioh_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7953,7 +7948,7 @@ static MACHINE_CONFIG_START( drgnunit, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */
MCFG_CPU_PROGRAM_MAP(drgnunit_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -7988,7 +7983,7 @@ static MACHINE_CONFIG_START( qzkklgy2, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(drgnunit_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8019,16 +8014,15 @@ MACHINE_CONFIG_END
Seta Roulette
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( setaroul_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::setaroul_interrupt)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
if(scanline == 248)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
if(scanline == 112)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
@@ -8037,7 +8031,7 @@ static MACHINE_CONFIG_START( setaroul, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */
MCFG_CPU_PROGRAM_MAP(setaroul_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", setaroul_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, setaroul_interrupt, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8077,7 +8071,7 @@ static MACHINE_CONFIG_START( eightfrc, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(wrofaero_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8118,7 +8112,7 @@ static MACHINE_CONFIG_START( extdwnhl, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(extdwnhl_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8172,9 +8166,9 @@ static MACHINE_CONFIG_START( gundhara, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(wrofaero_map)
#if __uPD71054_TIMER
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
#else
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
#endif // __uPD71054_TIMER
#if __uPD71054_TIMER
@@ -8220,7 +8214,7 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(wrofaero_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8252,7 +8246,7 @@ static MACHINE_CONFIG_START( jjsquawb, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(jjsquawb_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8330,7 +8324,7 @@ static MACHINE_CONFIG_START( orbs, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 14318180/2) /* 7.143 MHz */
MCFG_CPU_PROGRAM_MAP(orbs_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8366,7 +8360,7 @@ static MACHINE_CONFIG_START( keroppi, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 14318180/2) /* 7.143 MHz */
MCFG_CPU_PROGRAM_MAP(keroppi_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(seta_state,keroppi)
@@ -8404,7 +8398,7 @@ static MACHINE_CONFIG_START( krzybowl, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(krzybowl_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8528,7 +8522,7 @@ static MACHINE_CONFIG_START( msgundam, seta_state )
#if __uPD71054_TIMER
MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state, wrofaero_interrupt)
#else
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
#endif // __uPD71054_TIMER
#if __uPD71054_TIMER
@@ -8571,7 +8565,7 @@ static MACHINE_CONFIG_START( oisipuzl, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(oisipuzl_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8682,7 +8676,7 @@ static MACHINE_CONFIG_START( rezon, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(wrofaero_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -8898,7 +8892,7 @@ static MACHINE_CONFIG_START( utoukond, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(utoukond_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 16000000/4) /* 4 MHz */
MCFG_CPU_PROGRAM_MAP(utoukond_sound_map)
@@ -8946,7 +8940,7 @@ static MACHINE_CONFIG_START( wrofaero, seta_state )
#if __uPD71054_TIMER
MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state, wrofaero_interrupt)
#else
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
#endif // __uPD71054_TIMER
#if __uPD71054_TIMER
@@ -9029,7 +9023,7 @@ static MACHINE_CONFIG_DERIVED( zingzipbl, zingzip )
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(zingzipbl_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1) // irq3 isn't valid on the bootleg
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_REMOVE("x1snd")
@@ -9047,7 +9041,7 @@ static MACHINE_CONFIG_START( pairlove, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */
MCFG_CPU_PROGRAM_MAP(pairlove_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -9078,16 +9072,15 @@ MACHINE_CONFIG_END
Crazy Fight
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( crazyfgt_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::crazyfgt_interrupt)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
if((scanline % 48) == 0)
- state->m_maincpu->set_input_line(2, HOLD_LINE); // should this be triggered by the 3812?
+ m_maincpu->set_input_line(2, HOLD_LINE); // should this be triggered by the 3812?
if(scanline == 240)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ m_maincpu->set_input_line(1, HOLD_LINE);
}
static MACHINE_CONFIG_START( crazyfgt, seta_state )
@@ -9095,7 +9088,7 @@ static MACHINE_CONFIG_START( crazyfgt, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(crazyfgt_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", crazyfgt_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, crazyfgt_interrupt, "screen", 0, 1)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@@ -9128,23 +9121,22 @@ MACHINE_CONFIG_END
***************************************************************************/
// Test mode shows a 16ms and 2ms counters, then there's vblank and presumably ACIA irqs ...
-static TIMER_DEVICE_CALLBACK( inttoote_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(seta_state::inttoote_interrupt)
{
- seta_state *state = timer.machine().driver_data<seta_state>();
int scanline = param;
/* ACIA irq */
if(scanline == 15)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
if(scanline == 38)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 61)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
if(scanline >= 85 && (scanline % 23) == 0)
- state->m_maincpu->set_input_line(6, HOLD_LINE);
+ m_maincpu->set_input_line(6, HOLD_LINE);
}
static const pia6821_interface inttoote_pia0_intf =
@@ -9189,7 +9181,7 @@ static MACHINE_CONFIG_START( inttoote, seta_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(inttoote_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", inttoote_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, inttoote_interrupt, "screen", 0, 1)
MCFG_PIA6821_ADD("pia0", inttoote_pia0_intf)
MCFG_PIA6821_ADD("pia1", inttoote_pia1_intf)
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index 21c9b2e946a..971ac9b1e20 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -2162,16 +2162,15 @@ MACHINE_CONFIG_END
Funcube series
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( funcube_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(seta2_state::funcube_interrupt)
{
- seta2_state *state = timer.machine().driver_data<seta2_state>();
int scanline = param;
if(scanline == 368)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 0)
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
INTERRUPT_GEN_MEMBER(seta2_state::funcube_sub_timer_irq)
@@ -2213,7 +2212,7 @@ static MACHINE_CONFIG_START( funcube, seta2_state )
MCFG_CPU_ADD("maincpu", MCF5206E, XTAL_25_447MHz)
MCFG_CPU_PROGRAM_MAP(funcube_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", funcube_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta2_state, funcube_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("sub", H83007, FUNCUBE_SUB_CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(funcube_sub_map)
diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c
index 8249c20ed89..72ae5d5967d 100644
--- a/src/mame/drivers/shadfrce.c
+++ b/src/mame/drivers/shadfrce.c
@@ -307,52 +307,51 @@ WRITE16_MEMBER(shadfrce_state::shadfrce_scanline_w)
m_raster_scanline = data; /* guess, 0 is always written */
}
-static TIMER_DEVICE_CALLBACK( shadfrce_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(shadfrce_state::shadfrce_scanline)
{
- shadfrce_state *state = timer.machine().driver_data<shadfrce_state>();
int scanline = param;
/* Vblank is lowered on scanline 0 */
if (scanline == 0)
{
- state->m_vblank = 0;
+ m_vblank = 0;
}
/* Hack */
else if (scanline == (248-1)) /* -1 is an hack needed to avoid deadlocks */
{
- state->m_vblank = 4;
+ m_vblank = 4;
}
/* Raster interrupt - Perform raster effect on given scanline */
- if (state->m_raster_irq_enable)
+ if (m_raster_irq_enable)
{
- if (scanline == state->m_raster_scanline)
+ if (scanline == m_raster_scanline)
{
- state->m_raster_scanline = (state->m_raster_scanline + 1) % 240;
- if (state->m_raster_scanline > 0)
- timer.machine().primary_screen->update_partial(state->m_raster_scanline - 1);
- timer.machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
+ m_raster_scanline = (m_raster_scanline + 1) % 240;
+ if (m_raster_scanline > 0)
+ machine().primary_screen->update_partial(m_raster_scanline - 1);
+ machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
}
}
/* An interrupt is generated every 16 scanlines */
- if (state->m_irqs_enable)
+ if (m_irqs_enable)
{
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine().primary_screen->update_partial(scanline - 1);
- timer.machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
}
}
/* Vblank is raised on scanline 248 */
- if (state->m_irqs_enable)
+ if (m_irqs_enable)
{
if (scanline == 248)
{
- timer.machine().primary_screen->update_partial(scanline - 1);
- timer.machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
}
}
}
@@ -558,7 +557,7 @@ static MACHINE_CONFIG_START( shadfrce, shadfrce_state )
MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(shadfrce_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", shadfrce_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", shadfrce_state, shadfrce_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(shadfrce_sound_map)
diff --git a/src/mame/drivers/shaolins.c b/src/mame/drivers/shaolins.c
index b54fa3e3c6f..be26f8db7c1 100644
--- a/src/mame/drivers/shaolins.c
+++ b/src/mame/drivers/shaolins.c
@@ -13,15 +13,14 @@ driver by Allard Van Der Bas
#define MASTER_CLOCK XTAL_18_432MHz
-static TIMER_DEVICE_CALLBACK( shaolins_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(shaolins_state::shaolins_interrupt)
{
- shaolins_state *state = timer.machine().driver_data<shaolins_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_maincpu->set_input_line(0, HOLD_LINE);
else if((scanline % 32) == 0)
- if (state->m_nmi_enable & 0x02) state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_nmi_enable & 0x02) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -207,7 +206,7 @@ static MACHINE_CONFIG_START( shaolins, shaolins_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/12) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(shaolins_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", shaolins_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", shaolins_state, shaolins_interrupt, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/snk6502.c b/src/mame/drivers/snk6502.c
index fbaa838f3c5..0760a6916ca 100644
--- a/src/mame/drivers/snk6502.c
+++ b/src/mame/drivers/snk6502.c
@@ -298,11 +298,9 @@ Stephh's notes (based on the games M6502 code and some tests) :
/* binary counter (1.4MHz update) */
-static TIMER_DEVICE_CALLBACK( sasuke_update_counter )
+TIMER_DEVICE_CALLBACK_MEMBER(snk6502_state::sasuke_update_counter)
{
- snk6502_state *state = timer.machine().driver_data<snk6502_state>();
-
- state->m_sasuke_counter += 0x10;
+ m_sasuke_counter += 0x10;
}
static void sasuke_start_counter(running_machine &machine)
@@ -844,7 +842,7 @@ static MACHINE_CONFIG_START( sasuke, snk6502_state )
MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf)
- MCFG_TIMER_ADD_PERIODIC("sasuke_timer", sasuke_update_counter, attotime::from_hz(MASTER_CLOCK / 8)) // 1.4 MHz
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("sasuke_timer", snk6502_state, sasuke_update_counter, attotime::from_hz(MASTER_CLOCK / 8))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index 171169d564f..e32c6e9862a 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -120,42 +120,40 @@ WRITE16_MEMBER(snowbros_state::snowbros_irq2_ack_w)
machine().device("maincpu")->execute().set_input_line(2, CLEAR_LINE);
}
-static TIMER_DEVICE_CALLBACK( snowbros_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros_irq)
{
- snowbros_state *state = timer.machine().driver_data<snowbros_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(2, ASSERT_LINE);
+ m_maincpu->set_input_line(2, ASSERT_LINE);
if(scanline == 128)
- state->m_maincpu->set_input_line(3, ASSERT_LINE);
+ m_maincpu->set_input_line(3, ASSERT_LINE);
if(scanline == 32)
- state->m_maincpu->set_input_line(4, ASSERT_LINE);
+ m_maincpu->set_input_line(4, ASSERT_LINE);
}
-static TIMER_DEVICE_CALLBACK( snowbros3_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
{
- snowbros_state *state = timer.machine().driver_data<snowbros_state>();
- okim6295_device *adpcm = timer.machine().device<okim6295_device>("oki");
+ okim6295_device *adpcm = machine().device<okim6295_device>("oki");
int status = adpcm->read_status();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(2, ASSERT_LINE);
+ m_maincpu->set_input_line(2, ASSERT_LINE);
if(scanline == 128)
- state->m_maincpu->set_input_line(3, ASSERT_LINE);
+ m_maincpu->set_input_line(3, ASSERT_LINE);
if(scanline == 32)
- state->m_maincpu->set_input_line(4, ASSERT_LINE);
+ m_maincpu->set_input_line(4, ASSERT_LINE);
- if (state->m_sb3_music_is_playing)
+ if (m_sb3_music_is_playing)
{
if ((status&0x08)==0x00)
{
- adpcm->write_command(0x80|state->m_sb3_music);
+ adpcm->write_command(0x80|m_sb3_music);
adpcm->write_command(0x00|0x82);
}
@@ -1544,7 +1542,7 @@ static MACHINE_CONFIG_START( snowbros, snowbros_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 8000000) /* 8 Mhz - confirmed */
MCFG_CPU_PROGRAM_MAP(snowbros_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", Z80, 6000000) /* 6 MHz - confirmed */
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -1654,7 +1652,7 @@ static MACHINE_CONFIG_START( honeydol, snowbros_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(honeydol_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(honeydol_sound_map)
@@ -1690,7 +1688,7 @@ static MACHINE_CONFIG_START( twinadv, snowbros_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) // or 12
MCFG_CPU_PROGRAM_MAP(twinadv_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -1767,7 +1765,7 @@ static MACHINE_CONFIG_START( snowbro3, snowbros_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16mhz or 12mhz ? */
MCFG_CPU_PROGRAM_MAP(snowbros3_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros3_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros3_irq, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 08476c2d906..07531951524 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -413,7 +413,7 @@ static MACHINE_CONFIG_START( spdodgeb, spdodgeb_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502,12000000/6) /* 2MHz ? */
MCFG_CPU_PROGRAM_MAP(spdodgeb_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", spdodgeb_interrupt, "screen", 0, 1) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", spdodgeb_state, spdodgeb_interrupt, "screen", 0, 1) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */
MCFG_CPU_ADD("audiocpu", M6809,12000000/6) /* 2MHz ? */
MCFG_CPU_PROGRAM_MAP(spdodgeb_sound_map)
diff --git a/src/mame/drivers/sprcros2.c b/src/mame/drivers/sprcros2.c
index 236614d2037..e8af36f7516 100644
--- a/src/mame/drivers/sprcros2.c
+++ b/src/mame/drivers/sprcros2.c
@@ -245,20 +245,19 @@ static const sn76496_config psg_intf =
};
-static TIMER_DEVICE_CALLBACK( sprcros2_m_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::sprcros2_m_interrupt)
{
- sprcros2_state *state = timer.machine().driver_data<sprcros2_state>();
int scanline = param;
if (scanline == 240)
{
- if(state->m_port7&0x01)
- state->m_master->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if(m_port7&0x01)
+ m_master->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
else if(scanline == 0)
{
- if(state->m_port7&0x08)
- state->m_master->set_input_line(0, HOLD_LINE);
+ if(m_port7&0x08)
+ m_master->set_input_line(0, HOLD_LINE);
}
}
@@ -282,7 +281,7 @@ static MACHINE_CONFIG_START( sprcros2, sprcros2_state )
MCFG_CPU_ADD("master", Z80,10000000/2)
MCFG_CPU_PROGRAM_MAP(sprcros2_master_map)
MCFG_CPU_IO_MAP(sprcros2_master_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", sprcros2_m_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sprcros2_state, sprcros2_m_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("slave", Z80,10000000/2)
MCFG_CPU_PROGRAM_MAP(sprcros2_slave_map)
diff --git a/src/mame/drivers/sprint8.c b/src/mame/drivers/sprint8.c
index d26b8c84429..656574feea9 100644
--- a/src/mame/drivers/sprint8.c
+++ b/src/mame/drivers/sprint8.c
@@ -23,31 +23,30 @@ void sprint8_set_collision(running_machine &machine, int n)
}
-static TIMER_DEVICE_CALLBACK( input_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(sprint8_state::input_callback)
{
- sprint8_state *state = timer.machine().driver_data<sprint8_state>();
static const char *const dialnames[] = { "DIAL1", "DIAL2", "DIAL3", "DIAL4", "DIAL5", "DIAL6", "DIAL7", "DIAL8" };
int i;
for (i = 0; i < 8; i++)
{
- UINT8 val = timer.machine().root_device().ioport(dialnames[i])->read() >> 4;
+ UINT8 val = machine().root_device().ioport(dialnames[i])->read() >> 4;
- signed char delta = (val - state->m_dial[i]) & 15;
+ signed char delta = (val - m_dial[i]) & 15;
if (delta & 8)
delta |= 0xf0; /* extend sign to 8 bits */
- state->m_steer_flag[i] = (delta != 0);
+ m_steer_flag[i] = (delta != 0);
if (delta > 0)
- state->m_steer_dir[i] = 0;
+ m_steer_dir[i] = 0;
if (delta < 0)
- state->m_steer_dir[i] = 1;
+ m_steer_dir[i] = 1;
- state->m_dial[i] = val;
+ m_dial[i] = val;
}
}
@@ -456,7 +455,7 @@ static MACHINE_CONFIG_START( sprint8, sprint8_state )
MCFG_CPU_PROGRAM_MAP(sprint8_map)
- MCFG_TIMER_ADD_PERIODIC("input_timer", input_callback, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("input_timer", sprint8_state, input_callback, attotime::from_hz(60))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/srumbler.c b/src/mame/drivers/srumbler.c
index c327a2201fb..f467f63ba39 100644
--- a/src/mame/drivers/srumbler.c
+++ b/src/mame/drivers/srumbler.c
@@ -50,16 +50,15 @@ void srumbler_state::machine_start()
srumbler_bankswitch_w(space,0,0);
}
-static TIMER_DEVICE_CALLBACK( srumbler_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::srumbler_interrupt)
{
- srumbler_state *state = timer.machine().driver_data<srumbler_state>();
int scanline = param;
if (scanline == 248)
- state->m_maincpu->set_input_line(0,HOLD_LINE);
+ m_maincpu->set_input_line(0,HOLD_LINE);
if (scanline == 0)
- state->m_maincpu->set_input_line(M6809_FIRQ_LINE,HOLD_LINE);
+ m_maincpu->set_input_line(M6809_FIRQ_LINE,HOLD_LINE);
}
/*
@@ -239,7 +238,7 @@ static MACHINE_CONFIG_START( srumbler, srumbler_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, 1500000) /* 1.5 MHz (?) */
MCFG_CPU_PROGRAM_MAP(srumbler_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", srumbler_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", srumbler_state, srumbler_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3000000) /* 3 MHz ??? */
MCFG_CPU_PROGRAM_MAP(srumbler_sound_map)
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 210fbb4c4de..327ff80ed4c 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -232,40 +232,38 @@ WRITE16_MEMBER(ssv_state::ssv_irq_enable_w)
COMBINE_DATA(&m_irq_enable);
}
-static TIMER_DEVICE_CALLBACK( ssv_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::ssv_interrupt)
{
- ssv_state *state = timer.machine().driver_data<ssv_state>();
int scanline = param;
if (scanline == 0)
{
- if (state->m_interrupt_ultrax)
+ if (m_interrupt_ultrax)
{
- state->m_requested_int |= 1 << 1; // needed by ultrax to coin up, breaks cairblad
- update_irq_state(timer.machine());
+ m_requested_int |= 1 << 1; // needed by ultrax to coin up, breaks cairblad
+ update_irq_state(machine());
}
}
else if(scanline == 240)
{
- state->m_requested_int |= 1 << 3; // vblank
- update_irq_state(timer.machine());
+ m_requested_int |= 1 << 3; // vblank
+ update_irq_state(machine());
}
}
-static TIMER_DEVICE_CALLBACK( gdfs_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::gdfs_interrupt)
{
- ssv_state *state = timer.machine().driver_data<ssv_state>();
int scanline = param;
if ((scanline % 64) == 0)
{
- state->m_requested_int |= 1 << 6; // reads lightgun (4 times for 4 axis)
- update_irq_state(timer.machine());
+ m_requested_int |= 1 << 6; // reads lightgun (4 times for 4 axis)
+ update_irq_state(machine());
}
else if(scanline == 240)
{
- state->m_requested_int |= 1 << 3; // vblank
- update_irq_state(timer.machine());
+ m_requested_int |= 1 << 3; // vblank
+ update_irq_state(machine());
}
}
@@ -2602,7 +2600,7 @@ static MACHINE_CONFIG_START( ssv, ssv_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", V60, 16000000) /* Based on STA-0001 & STA-0001B System boards */
- MCFG_TIMER_ADD_SCANLINE("scantimer", ssv_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ssv_state, ssv_interrupt, "screen", 0, 1)
/* video hardware */
@@ -2651,7 +2649,7 @@ static MACHINE_CONFIG_DERIVED( gdfs, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(gdfs_map)
MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_CALLBACK(gdfs_interrupt)
+ MCFG_TIMER_DRIVER_CALLBACK(ssv_state, gdfs_interrupt)
MCFG_EEPROM_93C46_ADD("eeprom")
diff --git a/src/mame/drivers/st0016.c b/src/mame/drivers/st0016.c
index 74a86886b2d..edc19edacf9 100644
--- a/src/mame/drivers/st0016.c
+++ b/src/mame/drivers/st0016.c
@@ -417,16 +417,15 @@ static GFXDECODE_START( st0016 )
// GFXDECODE_ENTRY( NULL, 0, charlayout, 0, 16*4 )
GFXDECODE_END
-static TIMER_DEVICE_CALLBACK(st0016_int)
+TIMER_DEVICE_CALLBACK_MEMBER(st0016_state::st0016_int)
{
- st0016_state *state = timer.machine().driver_data<st0016_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(0,HOLD_LINE);
+ m_maincpu->set_input_line(0,HOLD_LINE);
else if((scanline % 64) == 0)
- if(state->m_maincpu->state_int(Z80_IFF1)) /* dirty hack ... */
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
+ if(m_maincpu->state_int(Z80_IFF1)) /* dirty hack ... */
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
}
static const st0016_interface st0016_config =
@@ -446,7 +445,7 @@ static MACHINE_CONFIG_START( st0016, st0016_state )
MCFG_CPU_ADD("maincpu",Z80,8000000) /* 8 MHz ? */
MCFG_CPU_PROGRAM_MAP(st0016_mem)
MCFG_CPU_IO_MAP(st0016_io)
- MCFG_TIMER_ADD_SCANLINE("scantimer", st0016_int, "screen", 0, 1) /* 4*nmi + int0 */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", st0016_state, st0016_int, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/strnskil.c b/src/mame/drivers/strnskil.c
index dc54d5de56c..c668ef12b6b 100644
--- a/src/mame/drivers/strnskil.c
+++ b/src/mame/drivers/strnskil.c
@@ -317,16 +317,15 @@ static GFXDECODE_START( strnskil )
GFXDECODE_END
-static TIMER_DEVICE_CALLBACK( strnskil_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(strnskil_state::strnskil_irq)
{
- strnskil_state *state = timer.machine().driver_data<strnskil_state>();
int scanline = param;
if(scanline == 240 || scanline == 96)
{
- state->m_maincpu->set_input_line(0,HOLD_LINE);
+ m_maincpu->set_input_line(0,HOLD_LINE);
- state->m_irq_source = (scanline != 240);
+ m_irq_source = (scanline != 240);
}
}
@@ -352,7 +351,7 @@ static MACHINE_CONFIG_START( strnskil, strnskil_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,8000000/2) /* 4.000MHz */
MCFG_CPU_PROGRAM_MAP(strnskil_map1)
- MCFG_TIMER_ADD_SCANLINE("scantimer", strnskil_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", strnskil_state, strnskil_irq, "screen", 0, 1)
MCFG_CPU_ADD("sub", Z80,8000000/2) /* 4.000MHz */
MCFG_CPU_PROGRAM_MAP(strnskil_map2)
diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c
index db64e6000b5..47566f8b84f 100644
--- a/src/mame/drivers/suna16.c
+++ b/src/mame/drivers/suna16.c
@@ -753,16 +753,15 @@ GFXDECODE_END
Back Street Soccer
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( bssoccer_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(suna16_state::bssoccer_interrupt)
{
- suna16_state *state = timer.machine().driver_data<suna16_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(1, HOLD_LINE);
+ m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 0)
- state->m_maincpu->set_input_line(2, HOLD_LINE); // does RAM to sprite buffer copy here
+ m_maincpu->set_input_line(2, HOLD_LINE); // does RAM to sprite buffer copy here
}
static MACHINE_CONFIG_START( bssoccer, suna16_state )
@@ -770,7 +769,7 @@ static MACHINE_CONFIG_START( bssoccer, suna16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 8000000) /* ? */
MCFG_CPU_PROGRAM_MAP(bssoccer_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bssoccer_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna16_state, bssoccer_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* Z80B */
MCFG_CPU_PROGRAM_MAP(bssoccer_sound_map)
@@ -944,7 +943,7 @@ static MACHINE_CONFIG_START( bestbest, suna16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 24000000/4)
MCFG_CPU_PROGRAM_MAP(bestbest_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", bssoccer_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna16_state, bssoccer_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 24000000/4)
MCFG_CPU_PROGRAM_MAP(bestbest_sound_map)
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 1a15280bd92..9b7afa43bcf 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -1737,15 +1737,14 @@ static const ym3812_interface brickzn_ym3812_interface =
soundirq /* IRQ Line */
};
-static TIMER_DEVICE_CALLBACK( brickzn_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(suna8_state::brickzn_interrupt)
{
- suna8_state *state = timer.machine().driver_data<suna8_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_maincpu->set_input_line(0, HOLD_LINE);
if(scanline == 112)
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
// TODO: NMI enable
}
@@ -1819,15 +1818,14 @@ MACHINE_CONFIG_END
/* 1 x 24 MHz crystal */
-static TIMER_DEVICE_CALLBACK( hardhea2_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(suna8_state::hardhea2_interrupt)
{
- suna8_state *state = timer.machine().driver_data<suna8_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_maincpu->set_input_line(0, HOLD_LINE);
if(scanline == 112)
- if (state->m_nmi_enable) state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_nmi_enable) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
MACHINE_RESET_MEMBER(suna8_state,hardhea2)
@@ -1841,7 +1839,7 @@ static MACHINE_CONFIG_DERIVED( hardhea2, brickzn )
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* SUNA T568009 */
MCFG_CPU_PROGRAM_MAP(hardhea2_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", hardhea2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(suna8_state,hardhea2)
MCFG_PALETTE_LENGTH(256)
@@ -1867,7 +1865,7 @@ static MACHINE_CONFIG_START( starfigh, suna8_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
MCFG_CPU_PROGRAM_MAP(starfigh_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", brickzn_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, brickzn_interrupt, "screen", 0, 1)
/* The sound section is identical to that of hardhead */
MCFG_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
@@ -1915,7 +1913,7 @@ static MACHINE_CONFIG_START( sparkman, suna8_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
MCFG_CPU_PROGRAM_MAP(sparkman_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", hardhea2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
MCFG_CPU_PROGRAM_MAP(hardhead_sound_map)
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index 7aaf19a1aa4..c22f53f5810 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -416,9 +416,9 @@ READ32_MEMBER(skns_state::skns_hit_r)
/* start old driver code */
-static TIMER_DEVICE_CALLBACK( interrupt_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(skns_state::interrupt_callback)
{
- timer.machine().device("maincpu")->execute().set_input_line(param, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(param, HOLD_LINE);
}
void skns_state::machine_reset()
@@ -434,15 +434,14 @@ void skns_state::machine_reset()
}
-static TIMER_DEVICE_CALLBACK(skns_irq)
+TIMER_DEVICE_CALLBACK_MEMBER(skns_state::skns_irq)
{
- skns_state *state = timer.machine().driver_data<skns_state>();
int scanline = param;
if(scanline == 240)
- state->m_maincpu->set_input_line(5,HOLD_LINE); //vblank
+ m_maincpu->set_input_line(5,HOLD_LINE); //vblank
else if(scanline == 0)
- state->m_maincpu->set_input_line(1,HOLD_LINE); // spc
+ m_maincpu->set_input_line(1,HOLD_LINE); // spc
}
/**********************************************************************************
@@ -757,17 +756,17 @@ static MSM6242_INTERFACE( rtc_intf )
static MACHINE_CONFIG_START( skns, skns_state )
MCFG_CPU_ADD("maincpu", SH2,28638000)
MCFG_CPU_PROGRAM_MAP(skns_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", skns_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", skns_state, skns_irq, "screen", 0, 1)
MCFG_MSM6242_ADD("rtc", rtc_intf)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_ADD_PERIODIC("int15_timer", interrupt_callback, attotime::from_msec(2))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("int15_timer", skns_state, interrupt_callback, attotime::from_msec(2))
MCFG_TIMER_PARAM(15)
- MCFG_TIMER_ADD_PERIODIC("int11_timer", interrupt_callback, attotime::from_msec(8))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("int11_timer", skns_state, interrupt_callback, attotime::from_msec(8))
MCFG_TIMER_PARAM(11)
- MCFG_TIMER_ADD_PERIODIC("int9_timer", interrupt_callback, attotime::from_hz(28638000/1824))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("int9_timer", skns_state, interrupt_callback, attotime::from_hz(28638000/1824))
MCFG_TIMER_PARAM(9)
MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index bbb44565196..ad7a6aae3f7 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -518,10 +518,10 @@ WRITE8_MEMBER(system1_state::soundport_w)
}
-static TIMER_DEVICE_CALLBACK( soundirq_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(system1_state::soundirq_gen)
{
/* sound IRQ is generated on 32V, 96V, ... and auto-acknowledged */
- timer.machine().device("soundcpu")->execute().set_input_line(0, HOLD_LINE);
+ machine().device("soundcpu")->execute().set_input_line(0, HOLD_LINE);
}
@@ -602,7 +602,7 @@ INTERRUPT_GEN_MEMBER(system1_state::mcu_irq_assert)
}
-static TIMER_DEVICE_CALLBACK( mcu_t0_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(system1_state::mcu_t0_callback)
{
/* The T0 line is clocked by something; if it is not clocked fast
enough, the MCU will fail; on shtngmst this happens after 3
@@ -610,7 +610,7 @@ static TIMER_DEVICE_CALLBACK( mcu_t0_callback )
choplift is even more picky about it, affecting scroll speed
*/
- device_t *mcu = timer.machine().device("mcu");
+ device_t *mcu = machine().device("mcu");
mcu->execute().set_input_line(MCS51_T0_LINE, ASSERT_LINE);
mcu->execute().set_input_line(MCS51_T0_LINE, CLEAR_LINE);
}
@@ -2151,7 +2151,7 @@ static MACHINE_CONFIG_START( sys1ppi, system1_state )
MCFG_CPU_ADD("soundcpu", Z80, SOUND_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(sound_map)
- MCFG_TIMER_ADD_SCANLINE("soundirq", soundirq_gen, "screen", 32, 64)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("soundirq", system1_state, soundirq_gen, "screen", 32, 64)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
@@ -2222,7 +2222,7 @@ static MACHINE_CONFIG_FRAGMENT( mcu )
MCFG_CPU_IO_MAP(mcu_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", system1_state, mcu_irq_assert)
- MCFG_TIMER_ADD_PERIODIC("mcu_t0", mcu_t0_callback, attotime::from_usec(2500)) /* ??? actual clock unknown */
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_t0", system1_state, mcu_t0_callback, attotime::from_usec(2500))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index 99624fab91f..8b034ec4535 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -297,32 +297,31 @@ static IRQ_CALLBACK( irq_callback )
return state->m_irq_adr_table[state->m_last_irq_level];
}
-static TIMER_DEVICE_CALLBACK( vbl_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(taitol_state::vbl_interrupt)
{
- taitol_state *state = timer.machine().driver_data<taitol_state>();
int scanline = param;
- state->m_maincpu->set_irq_acknowledge_callback(irq_callback);
+ m_maincpu->set_irq_acknowledge_callback(irq_callback);
/* kludge to make plgirls boot */
- if (state->m_maincpu->state_int(Z80_IM) != 2)
+ if (m_maincpu->state_int(Z80_IM) != 2)
return;
// What is really generating interrupts 0 and 1 is still to be found
- if (scanline == 120 && (state->m_irq_enable & 1))
+ if (scanline == 120 && (m_irq_enable & 1))
{
- state->m_last_irq_level = 0;
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_last_irq_level = 0;
+ m_maincpu->set_input_line(0, HOLD_LINE);
}
- else if (scanline == 0 && (state->m_irq_enable & 2))
+ else if (scanline == 0 && (m_irq_enable & 2))
{
- state->m_last_irq_level = 1;
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_last_irq_level = 1;
+ m_maincpu->set_input_line(0, HOLD_LINE);
}
- else if (scanline == 240 && (state->m_irq_enable & 4))
+ else if (scanline == 240 && (m_irq_enable & 4))
{
- state->m_last_irq_level = 2;
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ m_last_irq_level = 2;
+ m_maincpu->set_input_line(0, HOLD_LINE);
}
}
@@ -1844,7 +1843,7 @@ static MACHINE_CONFIG_START( fhawk, taitol_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2) /* verified freq on pin122 of TC0090LVC cpu */
MCFG_CPU_PROGRAM_MAP(fhawk_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/3) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(fhawk_3_map)
@@ -1939,7 +1938,7 @@ static MACHINE_CONFIG_START( kurikint, taitol_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2) /* verified freq on pin122 of TC0090LVC cpu */
MCFG_CPU_PROGRAM_MAP(kurikint_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/3) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(kurikint_2_map)
@@ -1991,7 +1990,7 @@ static MACHINE_CONFIG_START( plotting, taitol_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2) /* verified freq on pin122 of TC0090LVC cpu */
MCFG_CPU_PROGRAM_MAP(plotting_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(taitol_state,taito_l)
MCFG_MACHINE_RESET_OVERRIDE(taitol_state,plotting)
@@ -2077,7 +2076,7 @@ static MACHINE_CONFIG_START( evilston, taitol_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2) /* not verified */
MCFG_CPU_PROGRAM_MAP(evilston_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/3) /* not verified */
MCFG_CPU_PROGRAM_MAP(evilston_2_map)
diff --git a/src/mame/drivers/taito_o.c b/src/mame/drivers/taito_o.c
index 7f875f9421c..ffbae4fd514 100644
--- a/src/mame/drivers/taito_o.c
+++ b/src/mame/drivers/taito_o.c
@@ -212,16 +212,15 @@ static GFXDECODE_START( parentj )
GFXDECODE_END
/* unknown sources ... */
-static TIMER_DEVICE_CALLBACK( parentj_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(taitoo_state::parentj_interrupt)
{
- taitoo_state *state = timer.machine().driver_data<taitoo_state>();
int scanline = param;
if(scanline == 448)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
if(scanline == 0)
- state->m_maincpu->set_input_line(5, HOLD_LINE);
+ m_maincpu->set_input_line(5, HOLD_LINE);
}
static const ym2203_interface ym2203_config =
@@ -253,7 +252,7 @@ static MACHINE_CONFIG_START( parentj, taitoo_state )
MCFG_CPU_ADD("maincpu", M68000,12000000 ) /*?? MHz */
MCFG_CPU_PROGRAM_MAP(parentj_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", parentj_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitoo_state, parentj_interrupt, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/targeth.c b/src/mame/drivers/targeth.c
index 621e3c44443..902a4e78d20 100644
--- a/src/mame/drivers/targeth.c
+++ b/src/mame/drivers/targeth.c
@@ -29,23 +29,22 @@ static GFXDECODE_START( 0x080000 )
GFXDECODE_END
-static TIMER_DEVICE_CALLBACK(targeth_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(targeth_state::targeth_interrupt)
{
- targeth_state *state = timer.machine().driver_data<targeth_state>();
int scanline = param;
if(scanline == 240)
{
/* IRQ 2: drives the game */
- state->m_maincpu->set_input_line(2, HOLD_LINE);
+ m_maincpu->set_input_line(2, HOLD_LINE);
}
if(scanline == 0)
{
/* IRQ 4: Read 1P Gun */
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ m_maincpu->set_input_line(4, HOLD_LINE);
/* IRQ 6: Read 2P Gun */
- state->m_maincpu->set_input_line(6, HOLD_LINE);
+ m_maincpu->set_input_line(6, HOLD_LINE);
}
}
@@ -176,7 +175,7 @@ static MACHINE_CONFIG_START( targeth, targeth_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,24000000/2) /* 12 MHz */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", targeth_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", targeth_state, targeth_interrupt, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index f3bb642e14c..5073116f50c 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -406,33 +406,32 @@ static const ym2203_interface thedeep_ym2203_intf =
DEVCB_LINE(irqhandler)
};
-static TIMER_DEVICE_CALLBACK( thedeep_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::thedeep_interrupt)
{
- thedeep_state *state = timer.machine().driver_data<thedeep_state>();
int scanline = param;
if (scanline == 124) // TODO: clean this
{
- if (state->m_protection_command != 0x59)
+ if (m_protection_command != 0x59)
{
- int coins = timer.machine().root_device().ioport("MCU")->read();
- if (coins & 1) state->m_protection_data = 1;
- else if (coins & 2) state->m_protection_data = 2;
- else if (coins & 4) state->m_protection_data = 3;
- else state->m_protection_data = 0;
-
- if (state->m_protection_data)
- state->m_protection_irq = 1;
+ int coins = machine().root_device().ioport("MCU")->read();
+ if (coins & 1) m_protection_data = 1;
+ else if (coins & 2) m_protection_data = 2;
+ else if (coins & 4) m_protection_data = 3;
+ else m_protection_data = 0;
+
+ if (m_protection_data)
+ m_protection_irq = 1;
}
- if (state->m_protection_irq)
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ if (m_protection_irq)
+ m_maincpu->set_input_line(0, HOLD_LINE);
}
else if(scanline == 0)
{
- if (state->m_nmi_enable)
+ if (m_nmi_enable)
{
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
}
}
@@ -448,7 +447,7 @@ static MACHINE_CONFIG_START( thedeep, thedeep_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", thedeep_interrupt, "screen", 0, 1) /* IRQ by MCU, NMI by vblank (maskable) */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, thedeep_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M65C02, XTAL_12MHz/8) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(audio_map)
diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c
index 5bd206c8d13..532bd3a762e 100644
--- a/src/mame/drivers/vball.c
+++ b/src/mame/drivers/vball.c
@@ -103,36 +103,35 @@ INLINE int scanline_to_vcount(int scanline)
return (vcount - 0x18) | 0x100;
}
-static TIMER_DEVICE_CALLBACK( vball_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(vball_state::vball_scanline)
{
- vball_state *state = timer.machine().driver_data<vball_state>();
int scanline = param;
- int screen_height = timer.machine().primary_screen->height();
+ int screen_height = machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* Update to the current point */
if (scanline > 0)
{
- timer.machine().primary_screen->update_partial(scanline - 1);
+ machine().primary_screen->update_partial(scanline - 1);
}
/* IRQ fires every on every 8th scanline */
if (!(vcount_old & 8) && (vcount & 8))
{
- timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
}
/* NMI fires on scanline 248 (VBL) and is latched */
if (vcount == 0xf8)
{
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
/* Save the scroll x register value */
if (scanline < 256)
{
- state->m_vb_scrollx[255 - scanline] = (state->m_vb_scrollx_hi + state->m_vb_scrollx_lo + 4);
+ m_vb_scrollx[255 - scanline] = (m_vb_scrollx_hi + m_vb_scrollx_lo + 4);
}
}
@@ -410,7 +409,7 @@ static MACHINE_CONFIG_START( vball, vball_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, CPU_CLOCK) /* 2 MHz - measured by guru but it makes the game far far too slow ?! */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", vball_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", vball_state, vball_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c
index ca8099ae541..181e2a08c27 100644
--- a/src/mame/drivers/wecleman.c
+++ b/src/mame/drivers/wecleman.c
@@ -1024,24 +1024,24 @@ GFXDECODE_END
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( wecleman_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(wecleman_state::wecleman_scanline)
{
int scanline = param;
if(scanline == 232) // vblank irq
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
else if(((scanline % 64) == 0)) // timer irq TODO: timings
- timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
}
-static TIMER_DEVICE_CALLBACK( hotchase_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(wecleman_state::hotchase_scanline)
{
int scanline = param;
if(scanline == 224) // vblank irq
- timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
else if(((scanline % 64) == 0)) // timer irq TODO: timings
- timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
}
@@ -1055,7 +1055,7 @@ static MACHINE_CONFIG_START( wecleman, wecleman_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* Schems show 10MHz */
MCFG_CPU_PROGRAM_MAP(wecleman_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", wecleman_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wecleman_state, wecleman_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M68000, 10000000) /* Schems show 10MHz */
MCFG_CPU_PROGRAM_MAP(wecleman_sub_map)
@@ -1139,7 +1139,7 @@ static MACHINE_CONFIG_START( hotchase, wecleman_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz - PCB is drawn in one set's readme */
MCFG_CPU_PROGRAM_MAP(hotchase_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", hotchase_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wecleman_state, hotchase_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M68000, 10000000) /* 10 MHz - PCB is drawn in one set's readme */
MCFG_CPU_PROGRAM_MAP(hotchase_sub_map)
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index a6b2d85d4f8..7457930127d 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -1443,8 +1443,8 @@ static MACHINE_CONFIG_START( defender, williams_state )
MCFG_MACHINE_RESET_OVERRIDE(williams_state,defender)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_ADD("scan_timer", williams_va11_callback)
- MCFG_TIMER_ADD("240_timer", williams_count240_callback)
+ MCFG_TIMER_DRIVER_ADD("scan_timer", williams_state, williams_va11_callback)
+ MCFG_TIMER_DRIVER_ADD("240_timer", williams_state, williams_count240_callback)
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE)
@@ -1633,8 +1633,8 @@ static MACHINE_CONFIG_START( williams2, williams_state )
MCFG_MACHINE_RESET_OVERRIDE(williams_state,williams2)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_ADD("scan_timer", williams2_va11_callback)
- MCFG_TIMER_ADD("254_timer", williams2_endscreen_callback)
+ MCFG_TIMER_DRIVER_ADD("scan_timer", williams_state, williams2_va11_callback)
+ MCFG_TIMER_DRIVER_ADD("254_timer", williams_state, williams2_endscreen_callback)
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE)
diff --git a/src/mame/drivers/wwfsstar.c b/src/mame/drivers/wwfsstar.c
index 0f7c46f068c..dd4505e6752 100644
--- a/src/mame/drivers/wwfsstar.c
+++ b/src/mame/drivers/wwfsstar.c
@@ -239,35 +239,34 @@ WRITE16_MEMBER(wwfsstar_state::wwfsstar_irqack_w)
A hack is required: raise the vblank bit a scanline early.
*/
-static TIMER_DEVICE_CALLBACK( wwfsstar_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(wwfsstar_state::wwfsstar_scanline)
{
- wwfsstar_state *state = timer.machine().driver_data<wwfsstar_state>();
int scanline = param;
/* Vblank is lowered on scanline 0 */
if (scanline == 0)
{
- state->m_vblank = 0;
+ m_vblank = 0;
}
/* Hack */
else if (scanline == (240-1)) /* -1 is an hack needed to avoid deadlocks */
{
- state->m_vblank = 1;
+ m_vblank = 1;
}
/* An interrupt is generated every 16 scanlines */
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine().primary_screen->update_partial(scanline - 1);
- timer.machine().device("maincpu")->execute().set_input_line(5, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ machine().device("maincpu")->execute().set_input_line(5, ASSERT_LINE);
}
/* Vblank is raised on scanline 240 */
if (scanline == 240)
{
- timer.machine().primary_screen->update_partial(scanline - 1);
- timer.machine().device("maincpu")->execute().set_input_line(6, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ machine().device("maincpu")->execute().set_input_line(6, ASSERT_LINE);
}
}
@@ -426,7 +425,7 @@ static MACHINE_CONFIG_START( wwfsstar, wwfsstar_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", wwfsstar_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wwfsstar_state, wwfsstar_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c
index 52028d0315d..22c4bd52396 100644
--- a/src/mame/drivers/wwfwfest.c
+++ b/src/mame/drivers/wwfwfest.c
@@ -342,7 +342,7 @@ GFXDECODE_END
Interrupt Function
*******************************************************************************/
-static TIMER_DEVICE_CALLBACK( wwfwfest_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(wwfwfest_state::wwfwfest_scanline)
{
int scanline = param;
@@ -350,15 +350,15 @@ static TIMER_DEVICE_CALLBACK( wwfwfest_scanline )
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine().primary_screen->update_partial(scanline - 1);
- timer.machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
}
/* Vblank is raised on scanline 248 */
if (scanline == 248)
{
- timer.machine().primary_screen->update_partial(scanline - 1);
- timer.machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
+ machine().primary_screen->update_partial(scanline - 1);
+ machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
}
}
@@ -387,7 +387,7 @@ static MACHINE_CONFIG_START( wwfwfest, wwfwfest_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK) /* 24 crystal, 12 rated chip */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", wwfwfest_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wwfwfest_state, wwfwfest_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c
index c271e2f20d5..019d46c78e9 100644
--- a/src/mame/drivers/xain.c
+++ b/src/mame/drivers/xain.c
@@ -173,40 +173,39 @@ INLINE int scanline_to_vcount(int scanline)
return (vcount - 0x18) | 0x100;
}
-static TIMER_DEVICE_CALLBACK( xain_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(xain_state::xain_scanline)
{
- xain_state *state = timer.machine().driver_data<xain_state>();
int scanline = param;
- int screen_height = timer.machine().primary_screen->height();
+ int screen_height = machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* update to the current point */
if (scanline > 0)
{
- timer.machine().primary_screen->update_partial(scanline - 1);
+ machine().primary_screen->update_partial(scanline - 1);
}
/* FIRQ (IMS) fires every on every 8th scanline (except 0) */
if (!(vcount_old & 8) && (vcount & 8))
{
- timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
}
/* NMI fires on scanline 248 (VBL) and is latched */
if (vcount == 0xf8)
{
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
/* VBLANK input bit is held high from scanlines 248-255 */
if (vcount >= 248-1) // -1 is a hack - see notes above
{
- state->m_vblank = 1;
+ m_vblank = 1;
}
else
{
- state->m_vblank = 0;
+ m_vblank = 0;
}
}
@@ -579,7 +578,7 @@ static MACHINE_CONFIG_START( xsleena, xain_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", xain_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xain_state, xain_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M6809, CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(cpu_map_B)
diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c
index 02c86ed8b42..df1aa93c09f 100644
--- a/src/mame/drivers/xexex.c
+++ b/src/mame/drivers/xexex.c
@@ -273,40 +273,39 @@ TIMER_CALLBACK_MEMBER(xexex_state::dmaend_callback)
}
}
-static TIMER_DEVICE_CALLBACK( xexex_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(xexex_state::xexex_interrupt)
{
- xexex_state *state = timer.machine().driver_data<xexex_state>();
int scanline = param;
- if (state->m_suspension_active)
+ if (m_suspension_active)
{
- state->m_suspension_active = 0;
- timer.machine().scheduler().trigger(state->m_resume_trigger);
+ m_suspension_active = 0;
+ machine().scheduler().trigger(m_resume_trigger);
}
if(scanline == 0)
{
// IRQ 6 is for test mode only
- if (state->m_cur_control2 & 0x0020)
- state->m_maincpu->set_input_line(6, HOLD_LINE);
+ if (m_cur_control2 & 0x0020)
+ m_maincpu->set_input_line(6, HOLD_LINE);
}
/* TODO: vblank is at 256! (enable CCU then have fun in fixing offsetted layers) */
if(scanline == 128)
{
- if (k053246_is_irq_enabled(state->m_k053246))
+ if (k053246_is_irq_enabled(m_k053246))
{
// OBJDMA starts at the beginning of V-blank
- xexex_objdma(timer.machine(), 0);
+ xexex_objdma(machine(), 0);
// schedule DMA end interrupt
- state->m_dmadelay_timer->adjust(XE_DMADELAY);
+ m_dmadelay_timer->adjust(XE_DMADELAY);
}
// IRQ 4 is the V-blank interrupt. It controls color, sound and
// vital game logics that shouldn't be interfered by frame-drop.
- if (state->m_cur_control2 & 0x0800)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ if (m_cur_control2 & 0x0800)
+ m_maincpu->set_input_line(4, HOLD_LINE);
}
}
@@ -513,7 +512,7 @@ static MACHINE_CONFIG_START( xexex, xexex_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 32000000/2) // 16MHz (32MHz xtal)
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", xexex_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xexex_state, xexex_interrupt, "screen", 0, 1)
// 8MHz (PCB shows one 32MHz/18.432MHz xtal, reference: www.system16.com)
// more likely 32MHz since 18.432MHz yields 4.608MHz(too slow) or 9.216MHz(too fast) with integer divisors
diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c
index 4d0b0501252..0e0a460339c 100644
--- a/src/mame/drivers/xmen.c
+++ b/src/mame/drivers/xmen.c
@@ -349,16 +349,15 @@ static const k053247_interface xmen_k053246_intf =
xmen_sprite_callback
};
-static TIMER_DEVICE_CALLBACK( xmen_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(xmen_state::xmen_scanline)
{
- xmen_state *state = timer.machine().driver_data<xmen_state>();
int scanline = param;
- if(scanline == 240 && state->m_vblank_irq_mask) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
+ if(scanline == 240 && m_vblank_irq_mask) // vblank-out irq
+ machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
if(scanline == 0) // sprite DMA irq?
- timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
}
@@ -369,7 +368,7 @@ static MACHINE_CONFIG_START( xmen, xmen_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", xmen_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xmen_state, xmen_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -419,7 +418,7 @@ static MACHINE_CONFIG_START( xmen6p, xmen_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* ? */
MCFG_CPU_PROGRAM_MAP(6p_main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", xmen_scanline, "lscreen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xmen_state, xmen_scanline, "lscreen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,8000000) /* verified with M1, guessed but accurate */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/zodiack.c b/src/mame/drivers/zodiack.c
index c827e3ae1ee..04c6e455262 100644
--- a/src/mame/drivers/zodiack.c
+++ b/src/mame/drivers/zodiack.c
@@ -103,16 +103,15 @@ WRITE8_MEMBER( zodiack_state::sound_nmi_enable_w )
}
-static TIMER_DEVICE_CALLBACK( zodiack_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(zodiack_state::zodiack_scanline)
{
- zodiack_state *state = timer.machine().driver_data<zodiack_state>();
int scanline = param;
- if(scanline == 240 && state->m_nmi_enable) // vblank-out irq
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if(scanline == 240 && m_nmi_enable) // vblank-out irq
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
if(scanline == 0 ) // vblank-in irq
- timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
}
INTERRUPT_GEN_MEMBER(zodiack_state::zodiack_sound_nmi_gen)
@@ -559,7 +558,7 @@ static MACHINE_CONFIG_START( zodiack, zodiack_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4.00 MHz??? */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", zodiack_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", zodiack_state, zodiack_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 14318000/8) /* 1.78975 MHz??? */
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/includes/1942.h b/src/mame/includes/1942.h
index e47e89a9123..c120d56b8d6 100644
--- a/src/mame/includes/1942.h
+++ b/src/mame/includes/1942.h
@@ -40,4 +40,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(c1942_scanline);
};
diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h
index 89e4d0cd608..06aec4e7ea2 100644
--- a/src/mame/includes/8080bw.h
+++ b/src/mame/includes/8080bw.h
@@ -106,6 +106,8 @@ public:
UINT32 screen_update_shuttlei(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(polaris_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(claybust_gun_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(schaser_effect_555_cb);
};
@@ -122,4 +124,4 @@ DISCRETE_SOUND_EXTERN( polaris );
extern const sn76477_interface schaser_sn76477_interface;
DISCRETE_SOUND_EXTERN( schaser );
-TIMER_DEVICE_CALLBACK( schaser_effect_555_cb );
+
diff --git a/src/mame/includes/airbustr.h b/src/mame/includes/airbustr.h
index 3375a592590..5d62bda2677 100644
--- a/src/mame/includes/airbustr.h
+++ b/src/mame/includes/airbustr.h
@@ -69,4 +69,5 @@ public:
UINT32 screen_update_airbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_airbustr(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(slave_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(airbustr_scanline);
};
diff --git a/src/mame/includes/argus.h b/src/mame/includes/argus.h
index 49d1afd4c9d..bfcc4fccb3f 100644
--- a/src/mame/includes/argus.h
+++ b/src/mame/includes/argus.h
@@ -83,4 +83,6 @@ public:
UINT32 screen_update_argus(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_valtric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_butasan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(argus_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(butasan_scanline);
};
diff --git a/src/mame/includes/astrof.h b/src/mame/includes/astrof.h
index dfd441d5e74..859483c2807 100644
--- a/src/mame/includes/astrof.h
+++ b/src/mame/includes/astrof.h
@@ -70,6 +70,7 @@ public:
DECLARE_MACHINE_START(tomahawk);
UINT32 screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(irq_callback);
};
/*----------- defined in audio/astrof.c -----------*/
diff --git a/src/mame/includes/atarisy1.h b/src/mame/includes/atarisy1.h
index c93a67283d8..a6b978fb42c 100644
--- a/src/mame/includes/atarisy1.h
+++ b/src/mame/includes/atarisy1.h
@@ -65,15 +65,12 @@ public:
DECLARE_MACHINE_RESET(atarisy1);
DECLARE_VIDEO_START(atarisy1);
UINT32 screen_update_atarisy1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(delayed_joystick_int);
+ TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_reset_yscroll_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3off_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3_callback);
};
-
-/*----------- defined in video/atarisy1.c -----------*/
-
-TIMER_DEVICE_CALLBACK( atarisy1_int3_callback );
-TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback );
-TIMER_DEVICE_CALLBACK( atarisy1_reset_yscroll_callback );
-
DECLARE_READ16_HANDLER( atarisy1_int3state_r );
DECLARE_WRITE16_HANDLER( atarisy1_spriteram_w );
diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h
index bb47f48a0aa..3026cb2e254 100644
--- a/src/mame/includes/balsente.h
+++ b/src/mame/includes/balsente.h
@@ -198,16 +198,11 @@ public:
TIMER_CALLBACK_MEMBER(m6850_data_ready_callback);
TIMER_CALLBACK_MEMBER(m6850_w_callback);
TIMER_CALLBACK_MEMBER(adc_finished);
+ TIMER_DEVICE_CALLBACK_MEMBER(balsente_interrupt_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(balsente_counter_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(balsente_clock_counter_0_ff);
};
/*----------- defined in machine/balsente.c -----------*/
-
-TIMER_DEVICE_CALLBACK( balsente_interrupt_timer );
-
void balsente_noise_gen(device_t *device, int count, short *buffer);
-
-TIMER_DEVICE_CALLBACK( balsente_counter_callback );
-
-TIMER_DEVICE_CALLBACK( balsente_clock_counter_0_ff );
-
diff --git a/src/mame/includes/battlera.h b/src/mame/includes/battlera.h
index 466782a5c4a..e996506bcb2 100644
--- a/src/mame/includes/battlera.h
+++ b/src/mame/includes/battlera.h
@@ -41,7 +41,5 @@ public:
DECLARE_WRITE8_MEMBER(battlera_adpcm_reset_w);
virtual void video_start();
UINT32 screen_update_battlera(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(battlera_irq);
};
-
-/*----------- defined in video/battlera.c -----------*/
-TIMER_DEVICE_CALLBACK( battlera_irq );
diff --git a/src/mame/includes/beathead.h b/src/mame/includes/beathead.h
index 02527409b91..bbe275df32d 100644
--- a/src/mame/includes/beathead.h
+++ b/src/mame/includes/beathead.h
@@ -115,4 +115,5 @@ public:
DECLARE_READ32_MEMBER( hsync_ram_r );
DECLARE_WRITE32_MEMBER( hsync_ram_w );
DECLARE_DRIVER_INIT(beathead);
+ TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback);
};
diff --git a/src/mame/includes/beezer.h b/src/mame/includes/beezer.h
index 336fdbb139f..a1f7a8fa2d7 100644
--- a/src/mame/includes/beezer.h
+++ b/src/mame/includes/beezer.h
@@ -18,6 +18,7 @@ public:
DECLARE_DRIVER_INIT(beezer);
virtual void machine_start();
UINT32 screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(beezer_interrupt);
};
@@ -60,7 +61,4 @@ DECLARE_WRITE8_DEVICE_HANDLER( beezer_sfxctrl_w );
DECLARE_WRITE8_DEVICE_HANDLER( beezer_timer1_w );
DECLARE_READ8_DEVICE_HANDLER( beezer_noise_r );
-/*----------- defined in video/beezer.c -----------*/
-
-TIMER_DEVICE_CALLBACK( beezer_interrupt );
diff --git a/src/mame/includes/bionicc.h b/src/mame/includes/bionicc.h
index 63d97210345..dff456d1786 100644
--- a/src/mame/includes/bionicc.h
+++ b/src/mame/includes/bionicc.h
@@ -51,4 +51,5 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_bionicc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(bionicc_scanline);
};
diff --git a/src/mame/includes/bishi.h b/src/mame/includes/bishi.h
index 2bb40720772..624bfea2915 100644
--- a/src/mame/includes/bishi.h
+++ b/src/mame/includes/bishi.h
@@ -40,6 +40,7 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_bishi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(bishi_scanline);
};
/*----------- defined in video/bishi.c -----------*/
diff --git a/src/mame/includes/bladestl.h b/src/mame/includes/bladestl.h
index 440dde4f222..c2faf414876 100644
--- a/src/mame/includes/bladestl.h
+++ b/src/mame/includes/bladestl.h
@@ -35,6 +35,7 @@ public:
virtual void machine_reset();
virtual void palette_init();
UINT32 screen_update_bladestl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(bladestl_scanline);
};
/*----------- defined in video/bladestl.c -----------*/
diff --git a/src/mame/includes/blockout.h b/src/mame/includes/blockout.h
index 86ef860aa1e..c59125fe7e6 100644
--- a/src/mame/includes/blockout.h
+++ b/src/mame/includes/blockout.h
@@ -35,4 +35,5 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_blockout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(blockout_scanline);
};
diff --git a/src/mame/includes/bsktball.h b/src/mame/includes/bsktball.h
index 3206ba255d0..6ff0d8ef341 100644
--- a/src/mame/includes/bsktball.h
+++ b/src/mame/includes/bsktball.h
@@ -56,12 +56,9 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_bsktball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(bsktball_scanline);
};
-/*----------- defined in machine/bsktball.c -----------*/
-
-TIMER_DEVICE_CALLBACK( bsktball_scanline );
-
/*----------- defined in audio/bsktball.c -----------*/
DECLARE_WRITE8_DEVICE_HANDLER( bsktball_bounce_w );
diff --git a/src/mame/includes/btime.h b/src/mame/includes/btime.h
index 11a5f1a9981..dd6a794120a 100644
--- a/src/mame/includes/btime.h
+++ b/src/mame/includes/btime.h
@@ -114,4 +114,5 @@ public:
UINT32 screen_update_bnj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_zoar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_disco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(audio_nmi_gen);
};
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index dd5024b8aab..02c28acafcc 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -203,6 +203,7 @@ public:
UINT32 screen_update_cave(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(cave_interrupt);
TIMER_CALLBACK_MEMBER(cave_vblank_end);
+ TIMER_DEVICE_CALLBACK_MEMBER(cave_vblank_start);
};
/*----------- defined in video/cave.c -----------*/
diff --git a/src/mame/includes/centiped.h b/src/mame/includes/centiped.h
index aad6a87c6d8..706f98151b6 100644
--- a/src/mame/includes/centiped.h
+++ b/src/mame/includes/centiped.h
@@ -79,4 +79,5 @@ public:
UINT32 screen_update_bullsdrt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_milliped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_warlords(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(generate_interrupt);
};
diff --git a/src/mame/includes/changela.h b/src/mame/includes/changela.h
index 2c9698c2d33..56cd077949a 100644
--- a/src/mame/includes/changela.h
+++ b/src/mame/includes/changela.h
@@ -91,4 +91,5 @@ public:
UINT32 screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(chl_mcu_irq);
TIMER_CALLBACK_MEMBER(changela_scanline_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(changela_scanline);
};
diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h
index c92b7de2a3d..d205b7dade8 100644
--- a/src/mame/includes/chqflag.h
+++ b/src/mame/includes/chqflag.h
@@ -44,6 +44,7 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(chqflag_scanline);
};
/*----------- defined in video/chqflag.c -----------*/
diff --git a/src/mame/includes/circus.h b/src/mame/includes/circus.h
index 6af6847dc83..b264ae01348 100644
--- a/src/mame/includes/circus.h
+++ b/src/mame/includes/circus.h
@@ -40,6 +40,7 @@ public:
UINT32 screen_update_robotbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_crash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_ripcord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(crash_scanline);
};
/*----------- defined in audio/circus.c -----------*/
diff --git a/src/mame/includes/cischeat.h b/src/mame/includes/cischeat.h
index 92461149fdf..c7b145a9d23 100644
--- a/src/mame/includes/cischeat.h
+++ b/src/mame/includes/cischeat.h
@@ -84,4 +84,7 @@ public:
UINT32 screen_update_scudhamm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_cischeat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_f1gpstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(bigrun_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(scudhamm_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(armchamp2_scanline);
};
diff --git a/src/mame/includes/cninja.h b/src/mame/includes/cninja.h
index 1e325a27e51..f48d0109a42 100644
--- a/src/mame/includes/cninja.h
+++ b/src/mame/includes/cninja.h
@@ -70,4 +70,5 @@ public:
UINT32 screen_update_edrandy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_robocop2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mutantf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
};
diff --git a/src/mame/includes/coolpool.h b/src/mame/includes/coolpool.h
index 4d399dcb8d0..9d8a6aa0a14 100644
--- a/src/mame/includes/coolpool.h
+++ b/src/mame/includes/coolpool.h
@@ -59,4 +59,6 @@ public:
DECLARE_MACHINE_RESET(amerdart);
DECLARE_MACHINE_RESET(coolpool);
TIMER_CALLBACK_MEMBER(deferred_iop_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(nvram_write_timeout);
+ TIMER_DEVICE_CALLBACK_MEMBER(amerdart_audio_int_gen);
};
diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h
index b9c6ab1dee0..aee26035dd1 100644
--- a/src/mame/includes/cosmic.h
+++ b/src/mame/includes/cosmic.h
@@ -75,4 +75,5 @@ public:
UINT32 screen_update_magspot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_devzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_nomnlnd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(panic_scanline);
};
diff --git a/src/mame/includes/darkmist.h b/src/mame/includes/darkmist.h
index a5fe76d7a14..f0022fc3b2e 100644
--- a/src/mame/includes/darkmist.h
+++ b/src/mame/includes/darkmist.h
@@ -28,4 +28,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_darkmist(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(darkmist_scanline);
};
diff --git a/src/mame/includes/dbz.h b/src/mame/includes/dbz.h
index 7793022d047..fd243aaed10 100644
--- a/src/mame/includes/dbz.h
+++ b/src/mame/includes/dbz.h
@@ -51,6 +51,7 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(dbz_scanline);
};
/*----------- defined in video/dbz.c -----------*/
diff --git a/src/mame/includes/ddragon.h b/src/mame/includes/ddragon.h
index 5a9f797a32c..26194bef6f6 100644
--- a/src/mame/includes/ddragon.h
+++ b/src/mame/includes/ddragon.h
@@ -100,4 +100,5 @@ public:
DECLARE_MACHINE_RESET(ddragon);
DECLARE_VIDEO_START(ddragon);
UINT32 screen_update_ddragon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ddragon_scanline);
};
diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h
index c2a6ca604cc..2a6e9f90e61 100644
--- a/src/mame/includes/ddragon3.h
+++ b/src/mame/includes/ddragon3.h
@@ -49,4 +49,5 @@ public:
virtual void video_start();
UINT32 screen_update_ddragon3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_ctribe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ddragon3_scanline);
};
diff --git a/src/mame/includes/deadang.h b/src/mame/includes/deadang.h
index 839e7f2bed4..ed6c80ed723 100644
--- a/src/mame/includes/deadang.h
+++ b/src/mame/includes/deadang.h
@@ -33,4 +33,6 @@ public:
TILE_GET_INFO_MEMBER(get_text_tile_info);
virtual void video_start();
UINT32 screen_update_deadang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(deadang_main_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(deadang_sub_scanline);
};
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index e18a3eb585d..cf8ef87aa18 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -110,6 +110,8 @@ public:
UINT32 screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_captaven(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
+ TIMER_DEVICE_CALLBACK_MEMBER(lockload_vbl_irq);
};
class dragngun_state : public deco32_state
diff --git a/src/mame/includes/deco_mlc.h b/src/mame/includes/deco_mlc.h
index fdbbce095d3..ecbc1fa757b 100644
--- a/src/mame/includes/deco_mlc.h
+++ b/src/mame/includes/deco_mlc.h
@@ -38,4 +38,5 @@ public:
DECLARE_VIDEO_START(mlc);
UINT32 screen_update_mlc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_mlc(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
};
diff --git a/src/mame/includes/decocass.h b/src/mame/includes/decocass.h
index 8ad20f0d130..d6493e9c58d 100644
--- a/src/mame/includes/decocass.h
+++ b/src/mame/includes/decocass.h
@@ -223,6 +223,7 @@ public:
DECLARE_READ8_MEMBER(mirrorcolorram_r);
DECLARE_READ8_MEMBER(cdsteljn_input_r);
DECLARE_WRITE8_MEMBER(cdsteljn_mux_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(decocass_audio_nmi_gen);
private:
DECLARE_READ8_MEMBER(decocass_type1_latch_26_pass_3_inv_2_r);
DECLARE_READ8_MEMBER(decocass_type1_pass_136_r);
@@ -251,4 +252,3 @@ private:
UINT8 *missile_ram, int interleave);
};
-TIMER_DEVICE_CALLBACK(decocass_audio_nmi_gen);
diff --git a/src/mame/includes/djboy.h b/src/mame/includes/djboy.h
index 79901349473..4067c8c1fcb 100644
--- a/src/mame/includes/djboy.h
+++ b/src/mame/includes/djboy.h
@@ -73,4 +73,5 @@ public:
virtual void video_start();
UINT32 screen_update_djboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_djboy(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(djboy_scanline);
};
diff --git a/src/mame/includes/dooyong.h b/src/mame/includes/dooyong.h
index f53ffd4bd98..be19f057bad 100644
--- a/src/mame/includes/dooyong.h
+++ b/src/mame/includes/dooyong.h
@@ -87,4 +87,5 @@ public:
UINT32 screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(rshark_scanline);
};
diff --git a/src/mame/includes/dragrace.h b/src/mame/includes/dragrace.h
index 416d1848b3e..979c28579c3 100644
--- a/src/mame/includes/dragrace.h
+++ b/src/mame/includes/dragrace.h
@@ -54,6 +54,7 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_dragrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(dragrace_frame_callback);
};
/*----------- defined in audio/dragrace.c -----------*/
diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h
index 3d248092833..ddab33fe45f 100644
--- a/src/mame/includes/dynax.h
+++ b/src/mame/includes/dynax.h
@@ -483,6 +483,9 @@ public:
INTERRUPT_GEN_MEMBER(hginga_irq);
INTERRUPT_GEN_MEMBER(mjflove_irq);
INTERRUPT_GEN_MEMBER(hparadis_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(neruton_irq_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(majxtal7_vblank_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(tenkai_interrupt);
};
//----------- defined in drivers/dynax.c -----------
diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h
index aa56cdb1e2a..4f86824695d 100644
--- a/src/mame/includes/equites.h
+++ b/src/mame/includes/equites.h
@@ -108,4 +108,6 @@ public:
UINT32 screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(equites_nmi_callback);
TIMER_CALLBACK_MEMBER(equites_frq_adjuster_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(equites_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(splndrbt_scanline);
};
diff --git a/src/mame/includes/espial.h b/src/mame/includes/espial.h
index ed6cf060ba1..0bf07e60cdb 100644
--- a/src/mame/includes/espial.h
+++ b/src/mame/includes/espial.h
@@ -53,4 +53,5 @@ public:
DECLARE_VIDEO_START(netwars);
UINT32 screen_update_espial(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(espial_sound_nmi_gen);
+ TIMER_DEVICE_CALLBACK_MEMBER(espial_scanline);
};
diff --git a/src/mame/includes/exedexes.h b/src/mame/includes/exedexes.h
index 6ede7484f34..37c0b9e4538 100644
--- a/src/mame/includes/exedexes.h
+++ b/src/mame/includes/exedexes.h
@@ -49,4 +49,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_exedexes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(exedexes_scanline);
};
diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h
index bd808e9e63e..0f76585357b 100644
--- a/src/mame/includes/exterm.h
+++ b/src/mame/includes/exterm.h
@@ -36,6 +36,7 @@ public:
DECLARE_WRITE8_MEMBER(sound_slave_dac_w);
virtual void palette_init();
TIMER_CALLBACK_MEMBER(sound_delayed_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(master_sound_nmi_callback);
};
/*----------- defined in video/exterm.c -----------*/
diff --git a/src/mame/includes/fastlane.h b/src/mame/includes/fastlane.h
index 21835ba1809..68867af2e52 100644
--- a/src/mame/includes/fastlane.h
+++ b/src/mame/includes/fastlane.h
@@ -49,4 +49,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_fastlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(fastlane_scanline);
};
diff --git a/src/mame/includes/finalizr.h b/src/mame/includes/finalizr.h
index 33f062e789c..0f2d2335384 100644
--- a/src/mame/includes/finalizr.h
+++ b/src/mame/includes/finalizr.h
@@ -54,4 +54,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_finalizr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(finalizr_scanline);
};
diff --git a/src/mame/includes/foodf.h b/src/mame/includes/foodf.h
index 9d042eef9e3..d0b2e94d30e 100644
--- a/src/mame/includes/foodf.h
+++ b/src/mame/includes/foodf.h
@@ -36,4 +36,5 @@ public:
DECLARE_MACHINE_RESET(foodf);
DECLARE_VIDEO_START(foodf);
UINT32 screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
};
diff --git a/src/mame/includes/gaelco2.h b/src/mame/includes/gaelco2.h
index 18346850396..49ac33e9b81 100644
--- a/src/mame/includes/gaelco2.h
+++ b/src/mame/includes/gaelco2.h
@@ -52,12 +52,12 @@ public:
UINT32 screen_update_gaelco2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gaelco2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gaelco2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(bang_irq);
};
/*----------- defined in machine/gaelco2.c -----------*/
-TIMER_DEVICE_CALLBACK( bang_irq );
DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w );
DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w );
DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w );
diff --git a/src/mame/includes/gaelco3d.h b/src/mame/includes/gaelco3d.h
index a2f575b644c..33c91a0b5b3 100644
--- a/src/mame/includes/gaelco3d.h
+++ b/src/mame/includes/gaelco3d.h
@@ -118,6 +118,7 @@ public:
UINT32 screen_update_gaelco3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_gen);
TIMER_CALLBACK_MEMBER(delayed_sound_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(adsp_autobuffer_irq);
};
/*----------- defined in video/gaelco3d.c -----------*/
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index 9887103b2a9..1de18764d07 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -226,11 +226,12 @@ public:
UINT32 screen_update_galaxian(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(interrupt_gen);
INTERRUPT_GEN_MEMBER(fakechange_interrupt_gen);
+ TIMER_DEVICE_CALLBACK_MEMBER(checkmaj_irq0_gen);
+ TIMER_DEVICE_CALLBACK_MEMBER(galaxian_stars_blink_timer);
};
/*----------- defined in video/galaxian.c -----------*/
-TIMER_DEVICE_CALLBACK( galaxian_stars_blink_timer );
/* special purpose background rendering */
void galaxian_draw_background(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h
index a8a27bde689..1bf08d71476 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -182,6 +182,7 @@ public:
INTERRUPT_GEN_MEMBER(hunchbks_vh_interrupt);
TIMER_CALLBACK_MEMBER(stars_blink_callback);
TIMER_CALLBACK_MEMBER(stars_scroll_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(galaxold_interrupt_timer);
};
/*----------- defined in video/galaxold.c -----------*/
@@ -190,8 +191,6 @@ void galaxold_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, const r
/*----------- defined in machine/galaxold.c -----------*/
-TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer );
-
WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_2_q_callback );
WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_1_callback );
diff --git a/src/mame/includes/galpani2.h b/src/mame/includes/galpani2.h
index 4267d213f17..4457f58621f 100644
--- a/src/mame/includes/galpani2.h
+++ b/src/mame/includes/galpani2.h
@@ -51,6 +51,8 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_galpani2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(galpani2_interrupt1);
+ TIMER_DEVICE_CALLBACK_MEMBER(galpani2_interrupt2);
};
diff --git a/src/mame/includes/galpanic.h b/src/mame/includes/galpanic.h
index c5ccec3803b..20077e5ad91 100644
--- a/src/mame/includes/galpanic.h
+++ b/src/mame/includes/galpanic.h
@@ -27,6 +27,8 @@ public:
UINT32 screen_update_galpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_comad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_galpanic(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(galpanic_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(galhustl_scanline);
};
/*----------- defined in video/galpanic.c -----------*/
diff --git a/src/mame/includes/gberet.h b/src/mame/includes/gberet.h
index 58475bf7ee7..9146d84498d 100644
--- a/src/mame/includes/gberet.h
+++ b/src/mame/includes/gberet.h
@@ -57,4 +57,5 @@ public:
DECLARE_PALETTE_INIT(gberet);
UINT32 screen_update_gberet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gberetb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(gberet_interrupt_tick);
};
diff --git a/src/mame/includes/gradius3.h b/src/mame/includes/gradius3.h
index 705a95407bf..69a133e4e46 100644
--- a/src/mame/includes/gradius3.h
+++ b/src/mame/includes/gradius3.h
@@ -50,6 +50,7 @@ public:
virtual void video_start();
UINT32 screen_update_gradius3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(cpuA_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(gradius3_sub_scanline);
};
/*----------- defined in video/gradius3.c -----------*/
diff --git a/src/mame/includes/gundealr.h b/src/mame/includes/gundealr.h
index 7dc7ce51290..331544d4eca 100644
--- a/src/mame/includes/gundealr.h
+++ b/src/mame/includes/gundealr.h
@@ -42,4 +42,6 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_gundealr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(gundealr_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(yamyam_mcu_sim);
};
diff --git a/src/mame/includes/hexion.h b/src/mame/includes/hexion.h
index 3100a621b2d..63567eacd56 100644
--- a/src/mame/includes/hexion.h
+++ b/src/mame/includes/hexion.h
@@ -23,4 +23,5 @@ public:
TILE_GET_INFO_MEMBER(get_tile_info1);
virtual void video_start();
UINT32 screen_update_hexion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(hexion_scanline);
};
diff --git a/src/mame/includes/higemaru.h b/src/mame/includes/higemaru.h
index 618566f2e8a..fb23560b0cf 100644
--- a/src/mame/includes/higemaru.h
+++ b/src/mame/includes/higemaru.h
@@ -27,4 +27,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_higemaru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(higemaru_scanline);
};
diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h
index e32d8bcee42..28737279c99 100644
--- a/src/mame/includes/hng64.h
+++ b/src/mame/includes/hng64.h
@@ -188,6 +188,7 @@ public:
virtual void video_start();
UINT32 screen_update_hng64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_hng64(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(hng64_irq);
};
/*----------- defined in video/hng64.c -----------*/
diff --git a/src/mame/includes/hyprduel.h b/src/mame/includes/hyprduel.h
index c75da779b6c..3dfba1b6ac1 100644
--- a/src/mame/includes/hyprduel.h
+++ b/src/mame/includes/hyprduel.h
@@ -93,4 +93,5 @@ public:
TIMER_CALLBACK_MEMBER(vblank_end_callback);
TIMER_CALLBACK_MEMBER(magerror_irq_callback);
TIMER_CALLBACK_MEMBER(hyprduel_blit_done);
+ TIMER_DEVICE_CALLBACK_MEMBER(hyprduel_interrupt);
};
diff --git a/src/mame/includes/ikki.h b/src/mame/includes/ikki.h
index 8ec6205daf4..d2c3fe24968 100644
--- a/src/mame/includes/ikki.h
+++ b/src/mame/includes/ikki.h
@@ -36,4 +36,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_ikki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ikki_irq);
};
diff --git a/src/mame/includes/iqblock.h b/src/mame/includes/iqblock.h
index 611f17d6ea1..b5723c82ea3 100644
--- a/src/mame/includes/iqblock.h
+++ b/src/mame/includes/iqblock.h
@@ -30,4 +30,5 @@ public:
TILE_GET_INFO_MEMBER(get_fg_tile_info);
virtual void video_start();
UINT32 screen_update_iqblock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(iqblock_irq);
};
diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h
index 25aa63d6350..1640864a1de 100644
--- a/src/mame/includes/irobot.h
+++ b/src/mame/includes/irobot.h
@@ -79,12 +79,10 @@ public:
virtual void palette_init();
UINT32 screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(scanline_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback);
};
-/*----------- defined in machine/irobot.c -----------*/
-TIMER_DEVICE_CALLBACK( irobot_irvg_done_callback );
-TIMER_DEVICE_CALLBACK( irobot_irmb_done_callback );
-
/*----------- defined in video/irobot.c -----------*/
void irobot_poly_clear(running_machine &machine);
void irobot_run_video(running_machine &machine);
diff --git a/src/mame/includes/ironhors.h b/src/mame/includes/ironhors.h
index 1ffb53d0abe..f6c0a5f34ca 100644
--- a/src/mame/includes/ironhors.h
+++ b/src/mame/includes/ironhors.h
@@ -50,4 +50,6 @@ public:
DECLARE_VIDEO_START(farwest);
UINT32 screen_update_ironhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_farwest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ironhors_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(farwest_irq);
};
diff --git a/src/mame/includes/itech8.h b/src/mame/includes/itech8.h
index 1e70cd7166c..033036c268d 100644
--- a/src/mame/includes/itech8.h
+++ b/src/mame/includes/itech8.h
@@ -99,6 +99,7 @@ public:
TIMER_CALLBACK_MEMBER(behind_the_beam_update);
TIMER_CALLBACK_MEMBER(delayed_sound_data_w);
TIMER_CALLBACK_MEMBER(blitter_done);
+ TIMER_DEVICE_CALLBACK_MEMBER(grmatch_palette_update);
};
@@ -116,5 +117,3 @@ DECLARE_READ8_HANDLER( slikshot_z80_r );
DECLARE_READ8_HANDLER( slikshot_z80_control_r );
DECLARE_WRITE8_HANDLER( slikshot_z80_control_w );
-/*----------- defined in video/itech8.c -----------*/
-TIMER_DEVICE_CALLBACK( grmatch_palette_update );
diff --git a/src/mame/includes/jpmimpct.h b/src/mame/includes/jpmimpct.h
index 3cff11ca116..d6dc87d683e 100644
--- a/src/mame/includes/jpmimpct.h
+++ b/src/mame/includes/jpmimpct.h
@@ -108,6 +108,7 @@ public:
DECLARE_VIDEO_START(jpmimpct);
DECLARE_MACHINE_START(impctawp);
DECLARE_MACHINE_RESET(impctawp);
+ TIMER_DEVICE_CALLBACK_MEMBER(duart_1_timer_event);
};
diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h
index 8d678ba8451..62a16266aa3 100644
--- a/src/mame/includes/kaneko16.h
+++ b/src/mame/includes/kaneko16.h
@@ -65,6 +65,8 @@ public:
DECLARE_MACHINE_RESET(mgcrystl);
UINT32 screen_update_kaneko16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(shogwarr_interrupt);
};
class kaneko16_gtmr_state : public kaneko16_state
diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h
index 1601654d178..623b7a8ccd5 100644
--- a/src/mame/includes/konamigx.h
+++ b/src/mame/includes/konamigx.h
@@ -81,6 +81,7 @@ public:
INTERRUPT_GEN_MEMBER(konamigx_vbinterrupt);
INTERRUPT_GEN_MEMBER(tms_sync);
TIMER_CALLBACK_MEMBER(dmaend_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(konamigx_hbinterrupt);
};
diff --git a/src/mame/includes/lastduel.h b/src/mame/includes/lastduel.h
index 051d05a6ebc..48c6e5753d9 100644
--- a/src/mame/includes/lastduel.h
+++ b/src/mame/includes/lastduel.h
@@ -60,4 +60,6 @@ public:
DECLARE_VIDEO_START(madgear);
UINT32 screen_update_lastduel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_madgear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(lastduel_timer_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(madgear_timer_cb);
};
diff --git a/src/mame/includes/lazercmd.h b/src/mame/includes/lazercmd.h
index e49fc9ff079..8d6c3c1b023 100644
--- a/src/mame/includes/lazercmd.h
+++ b/src/mame/includes/lazercmd.h
@@ -57,4 +57,6 @@ public:
virtual void machine_reset();
virtual void palette_init();
UINT32 screen_update_lazercmd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(bbonk_timer);
};
diff --git a/src/mame/includes/m107.h b/src/mame/includes/m107.h
index 65be3310e99..c9a9b3b8c1d 100644
--- a/src/mame/includes/m107.h
+++ b/src/mame/includes/m107.h
@@ -18,10 +18,12 @@ public:
m107_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_spriteram(*this, "spriteram"),
- m_vram_data(*this, "vram_data") { }
+ m_vram_data(*this, "vram_data"),
+ m_maincpu(*this, "maincpu") { }
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_vram_data;
+ required_device<cpu_device> m_maincpu;
UINT8 m_irq_vectorbase;
int m_sound_status;
@@ -50,4 +52,5 @@ public:
virtual void machine_start();
virtual void video_start();
UINT32 screen_update_m107(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(m107_scanline_interrupt);
};
diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h
index cb33bd6796e..cd50fd465a5 100644
--- a/src/mame/includes/m92.h
+++ b/src/mame/includes/m92.h
@@ -78,6 +78,7 @@ public:
UINT32 screen_update_m92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_ppan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(spritebuffer_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(m92_scanline_interrupt);
};
/*----------- defined in drivers/m92.c -----------*/
diff --git a/src/mame/includes/mcr.h b/src/mame/includes/mcr.h
index ef4c8125b52..bacbf26689e 100644
--- a/src/mame/includes/mcr.h
+++ b/src/mame/includes/mcr.h
@@ -102,6 +102,10 @@ public:
DECLARE_MACHINE_START(nflfoot);
UINT32 screen_update_mcr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(ipu_watchdog_reset);
+ TIMER_DEVICE_CALLBACK_MEMBER(dpoker_hopper_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(dpoker_coin_in_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcr_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcr_ipu_interrupt);
};
@@ -126,9 +130,6 @@ extern const gfx_layout mcr_sprite_layout;
extern UINT32 mcr_cpu_board;
extern UINT32 mcr_sprite_board;
-TIMER_DEVICE_CALLBACK( mcr_interrupt );
-TIMER_DEVICE_CALLBACK( mcr_ipu_interrupt );
-
/*----------- defined in video/mcr.c -----------*/
extern INT8 mcr12_sprite_xoffs;
diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h
index 40a19aad10b..5e95947f453 100644
--- a/src/mame/includes/megasys1.h
+++ b/src/mame/includes/megasys1.h
@@ -113,4 +113,6 @@ public:
UINT32 screen_update_megasys1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_megasys1(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(megasys1D_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(megasys1A_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(megasys1B_scanline);
};
diff --git a/src/mame/includes/mhavoc.h b/src/mame/includes/mhavoc.h
index e5ef2e59f92..4da5de0b3ab 100644
--- a/src/mame/includes/mhavoc.h
+++ b/src/mame/includes/mhavoc.h
@@ -63,7 +63,6 @@ public:
virtual void machine_start();
virtual void machine_reset();
TIMER_CALLBACK_MEMBER(delayed_gamma_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(mhavoc_cpu_irq_clock);
};
-/*----------- defined in machine/mhavoc.c -----------*/
-TIMER_DEVICE_CALLBACK( mhavoc_cpu_irq_clock );
diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h
index 02e0f7236e6..20d982c7282 100644
--- a/src/mame/includes/mitchell.h
+++ b/src/mame/includes/mitchell.h
@@ -103,4 +103,5 @@ public:
DECLARE_MACHINE_RESET(mitchell);
DECLARE_VIDEO_START(pang);
UINT32 screen_update_pang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(mitchell_irq);
};
diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h
index 6e65e0469c2..af853e327d1 100644
--- a/src/mame/includes/model1.h
+++ b/src/mame/includes/model1.h
@@ -136,6 +136,7 @@ public:
DECLARE_MACHINE_RESET(model1_vr);
UINT32 screen_update_model1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_model1(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(model1_interrupt);
};
diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h
index 94b49784726..0bcb3ae50c7 100644
--- a/src/mame/includes/model2.h
+++ b/src/mame/includes/model2.h
@@ -163,6 +163,9 @@ public:
DECLARE_MACHINE_RESET(model2_common);
DECLARE_MACHINE_RESET(model2_scsp);
UINT32 screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(model2_timer_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(model2_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(model2c_interrupt);
};
/*----------- defined in video/model2.c -----------*/
diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h
index c6c534789b1..4d25d0b17d9 100644
--- a/src/mame/includes/model3.h
+++ b/src/mame/includes/model3.h
@@ -199,6 +199,7 @@ public:
DECLARE_MACHINE_RESET(model3_21);
UINT32 screen_update_model3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(model3_sound_timer_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(model3_interrupt);
};
diff --git a/src/mame/includes/mrflea.h b/src/mame/includes/mrflea.h
index ffe1de3bff6..bf758f48950 100644
--- a/src/mame/includes/mrflea.h
+++ b/src/mame/includes/mrflea.h
@@ -45,4 +45,5 @@ public:
virtual void machine_start();
virtual void machine_reset();
UINT32 screen_update_mrflea(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(mrflea_slave_interrupt);
};
diff --git a/src/mame/includes/ms32.h b/src/mame/includes/ms32.h
index 236d78c3633..a84ddce6834 100644
--- a/src/mame/includes/ms32.h
+++ b/src/mame/includes/ms32.h
@@ -88,4 +88,5 @@ public:
virtual void video_start();
DECLARE_VIDEO_START(f1superb);
UINT32 screen_update_ms32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ms32_interrupt);
};
diff --git a/src/mame/includes/mw8080bw.h b/src/mame/includes/mw8080bw.h
index 0262d84fa9e..1d675becdd0 100644
--- a/src/mame/includes/mw8080bw.h
+++ b/src/mame/includes/mw8080bw.h
@@ -146,6 +146,7 @@ public:
void screen_eof_phantom2(screen_device &screen, bool state);
TIMER_CALLBACK_MEMBER(maze_tone_timing_timer_callback);
TIMER_CALLBACK_MEMBER(mw8080bw_interrupt_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(spcenctr_strobe_timer_callback);
};
diff --git a/src/mame/includes/mystwarr.h b/src/mame/includes/mystwarr.h
index 234fd877fcc..2ac5e5b0cd2 100644
--- a/src/mame/includes/mystwarr.h
+++ b/src/mame/includes/mystwarr.h
@@ -72,4 +72,7 @@ public:
UINT32 screen_update_dadandrn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_martchmp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(ddd_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(metamrph_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(mchamp_interrupt);
};
diff --git a/src/mame/includes/n8080.h b/src/mame/includes/n8080.h
index 5176759f937..9af9b23edd8 100644
--- a/src/mame/includes/n8080.h
+++ b/src/mame/includes/n8080.h
@@ -82,6 +82,10 @@ public:
UINT32 screen_update_helifire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_helifire(screen_device &screen, bool state);
TIMER_CALLBACK_MEMBER(spacefev_stop_red_cannon);
+ TIMER_DEVICE_CALLBACK_MEMBER(rst1_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(rst2_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(spacefev_vco_voltage_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(helifire_dac_volume_timer);
};
/*----------- defined in video/n8080.c -----------*/
diff --git a/src/mame/includes/namcofl.h b/src/mame/includes/namcofl.h
index f59a6ffd1e9..382065ffbf7 100644
--- a/src/mame/includes/namcofl.h
+++ b/src/mame/includes/namcofl.h
@@ -61,4 +61,7 @@ public:
TIMER_CALLBACK_MEMBER(network_interrupt_callback);
TIMER_CALLBACK_MEMBER(vblank_interrupt_callback);
TIMER_CALLBACK_MEMBER(raster_interrupt_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq0_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq2_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcu_adc_cb);
};
diff --git a/src/mame/includes/namcona1.h b/src/mame/includes/namcona1.h
index ed87f09c9e3..442d7523581 100644
--- a/src/mame/includes/namcona1.h
+++ b/src/mame/includes/namcona1.h
@@ -111,4 +111,6 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_namcona1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(namcona1_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcu_interrupt);
};
diff --git a/src/mame/includes/namconb1.h b/src/mame/includes/namconb1.h
index d1c0410c9d8..cf50dc243c3 100644
--- a/src/mame/includes/namconb1.h
+++ b/src/mame/includes/namconb1.h
@@ -81,4 +81,5 @@ public:
INTERRUPT_GEN_MEMBER(namconb2_interrupt);
TIMER_CALLBACK_MEMBER(namconb1_TriggerPOSIRQ);
TIMER_CALLBACK_MEMBER(namconb2_TriggerPOSIRQ);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcu_interrupt);
};
diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h
index 3d66450dd0f..99adbc7eaae 100644
--- a/src/mame/includes/namcos22.h
+++ b/src/mame/includes/namcos22.h
@@ -259,6 +259,9 @@ public:
INTERRUPT_GEN_MEMBER(namcos22s_interrupt);
INTERRUPT_GEN_MEMBER(namcos22_interrupt);
TIMER_CALLBACK_MEMBER(alpine_steplock_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(dsp_master_serial_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(dsp_slave_serial_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq);
};
/*----------- defined in video/namcos22.c -----------*/
diff --git a/src/mame/includes/nemesis.h b/src/mame/includes/nemesis.h
index a26662f5f23..5a3008774a1 100644
--- a/src/mame/includes/nemesis.h
+++ b/src/mame/includes/nemesis.h
@@ -87,4 +87,6 @@ public:
UINT32 screen_update_nemesis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(nemesis_interrupt);
INTERRUPT_GEN_MEMBER(blkpnthr_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(konamigt_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(gx400_interrupt);
};
diff --git a/src/mame/includes/nitedrvr.h b/src/mame/includes/nitedrvr.h
index d8660931fcc..96923a5a168 100644
--- a/src/mame/includes/nitedrvr.h
+++ b/src/mame/includes/nitedrvr.h
@@ -57,10 +57,8 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_nitedrvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(nitedrvr_crash_toggle_callback);
};
-/*----------- defined in machine/nitedrvr.c -----------*/
-TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback );
-
/*----------- defined in audio/nitedrvr.c -----------*/
DISCRETE_SOUND_EXTERN( nitedrvr );
diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h
index 58a69f801f6..c06f5850e81 100644
--- a/src/mame/includes/nmk16.h
+++ b/src/mame/includes/nmk16.h
@@ -142,4 +142,8 @@ public:
UINT32 screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_nmk(screen_device &screen, bool state);
void screen_eof_strahl(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(tdragon_mcu_sim);
+ TIMER_DEVICE_CALLBACK_MEMBER(hachamf_mcu_sim);
+ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(manybloc_scanline);
};
diff --git a/src/mame/includes/orbit.h b/src/mame/includes/orbit.h
index da40fb9a28a..9932f52c6a5 100644
--- a/src/mame/includes/orbit.h
+++ b/src/mame/includes/orbit.h
@@ -46,6 +46,7 @@ public:
UINT32 screen_update_orbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(orbit_interrupt);
TIMER_CALLBACK_MEMBER(irq_off);
+ TIMER_DEVICE_CALLBACK_MEMBER(nmi_32v);
};
/*----------- defined in audio/orbit.c -----------*/
DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_w );
diff --git a/src/mame/includes/overdriv.h b/src/mame/includes/overdriv.h
index 067180e4a6b..e603bca5163 100644
--- a/src/mame/includes/overdriv.h
+++ b/src/mame/includes/overdriv.h
@@ -44,6 +44,7 @@ public:
virtual void machine_reset();
UINT32 screen_update_overdriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(cpuB_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(overdriv_cpuA_scanline);
};
/*----------- defined in video/overdriv.c -----------*/
diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h
index b5130630a16..f903b9d749b 100644
--- a/src/mame/includes/pgm.h
+++ b/src/mame/includes/pgm.h
@@ -116,6 +116,7 @@ public:
DECLARE_MACHINE_RESET(pgm);
UINT32 screen_update_pgm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_pgm(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(pgm_interrupt);
};
@@ -317,8 +318,6 @@ void pgm_basic_init( running_machine &machine, bool set_bank = true );
INPUT_PORTS_EXTERN( pgm );
-TIMER_DEVICE_CALLBACK( pgm_interrupt );
-
GFXDECODE_EXTERN( pgm );
MACHINE_CONFIG_EXTERN( pgm );
diff --git a/src/mame/includes/pingpong.h b/src/mame/includes/pingpong.h
index c6c9baf78cb..4bb8da1c399 100644
--- a/src/mame/includes/pingpong.h
+++ b/src/mame/includes/pingpong.h
@@ -27,5 +27,7 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_pingpong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(pingpong_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(merlinmm_interrupt);
};
diff --git a/src/mame/includes/polepos.h b/src/mame/includes/polepos.h
index a313fdcc2c4..6accbf1e3f6 100644
--- a/src/mame/includes/polepos.h
+++ b/src/mame/includes/polepos.h
@@ -80,6 +80,7 @@ public:
DECLARE_VIDEO_START(polepos);
DECLARE_PALETTE_INIT(polepos);
UINT32 screen_update_polepos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(polepos_scanline);
};
diff --git a/src/mame/includes/polyplay.h b/src/mame/includes/polyplay.h
index f0f613faf2c..166a50df8ef 100644
--- a/src/mame/includes/polyplay.h
+++ b/src/mame/includes/polyplay.h
@@ -35,6 +35,7 @@ public:
UINT32 screen_update_polyplay(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(periodic_interrupt);
INTERRUPT_GEN_MEMBER(coin_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(polyplay_timer_callback);
};
diff --git a/src/mame/includes/psychic5.h b/src/mame/includes/psychic5.h
index 4ef7b53f302..8cd8866b4c0 100644
--- a/src/mame/includes/psychic5.h
+++ b/src/mame/includes/psychic5.h
@@ -47,4 +47,5 @@ public:
DECLARE_VIDEO_RESET(bombsa);
UINT32 screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_bombsa(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(psychic5_scanline);
};
diff --git a/src/mame/includes/qdrmfgp.h b/src/mame/includes/qdrmfgp.h
index f1436714b71..3cee960dd9a 100644
--- a/src/mame/includes/qdrmfgp.h
+++ b/src/mame/includes/qdrmfgp.h
@@ -41,6 +41,7 @@ public:
UINT32 screen_update_qdrmfgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(qdrmfgp2_interrupt);
TIMER_CALLBACK_MEMBER(gp2_timer_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(qdrmfgp_interrupt);
};
/*----------- defined in video/qdrmfgp.c -----------*/
diff --git a/src/mame/includes/renegade.h b/src/mame/includes/renegade.h
index 11d7170f7b4..b06ebd4289b 100644
--- a/src/mame/includes/renegade.h
+++ b/src/mame/includes/renegade.h
@@ -73,4 +73,5 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_renegade(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(renegade_interrupt);
};
diff --git a/src/mame/includes/segahang.h b/src/mame/includes/segahang.h
index 703105700d5..98ee042290d 100644
--- a/src/mame/includes/segahang.h
+++ b/src/mame/includes/segahang.h
@@ -131,4 +131,5 @@ protected:
// internal state
UINT8 m_adc_select;
bool m_shadow;
+ TIMER_DEVICE_CALLBACK_MEMBER(hangon_irq);
};
diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h
index 6ce8e1bac59..95ce9193b4f 100644
--- a/src/mame/includes/segas24.h
+++ b/src/mame/includes/segas24.h
@@ -113,4 +113,8 @@ public:
virtual void machine_start();
virtual void machine_reset();
UINT32 screen_update_system24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(irq_timer_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(irq_timer_clear_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(irq_frc_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(irq_vbl);
};
diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h
index 66cfc4c3626..1904c152ac2 100644
--- a/src/mame/includes/segas32.h
+++ b/src/mame/includes/segas32.h
@@ -180,6 +180,7 @@ public:
INTERRUPT_GEN_MEMBER(start_of_vblank_int);
TIMER_CALLBACK_MEMBER(end_of_vblank_int);
TIMER_CALLBACK_MEMBER(update_sprites);
+ TIMER_DEVICE_CALLBACK_MEMBER(signal_v60_irq_callback);
};
/*----------- defined in machine/segas32.c -----------*/
diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h
index a11514674f2..8782f43dd28 100644
--- a/src/mame/includes/seta.h
+++ b/src/mame/includes/seta.h
@@ -201,6 +201,14 @@ public:
INTERRUPT_GEN_MEMBER(wrofaero_interrupt);
TIMER_CALLBACK_MEMBER(uPD71054_timer_callback);
TIMER_CALLBACK_MEMBER(keroppi_prize_hop_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(seta_interrupt_1_and_2);
+ TIMER_DEVICE_CALLBACK_MEMBER(seta_interrupt_2_and_4);
+ TIMER_DEVICE_CALLBACK_MEMBER(seta_sub_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(tndrcade_sub_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(calibr50_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(setaroul_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(crazyfgt_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(inttoote_interrupt);
};
/*----------- defined in video/seta.c -----------*/
diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h
index 629d0f1921c..5fad16543ef 100644
--- a/src/mame/includes/seta2.h
+++ b/src/mame/includes/seta2.h
@@ -74,4 +74,5 @@ public:
INTERRUPT_GEN_MEMBER(seta2_interrupt);
INTERRUPT_GEN_MEMBER(samshoot_interrupt);
INTERRUPT_GEN_MEMBER(funcube_sub_timer_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(funcube_interrupt);
};
diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h
index 3d2409cb137..f4bf11a63bf 100644
--- a/src/mame/includes/shadfrce.h
+++ b/src/mame/includes/shadfrce.h
@@ -44,4 +44,5 @@ public:
virtual void video_start();
UINT32 screen_update_shadfrce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_shadfrce(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(shadfrce_scanline);
};
diff --git a/src/mame/includes/shaolins.h b/src/mame/includes/shaolins.h
index 9d614584aa2..a7ac9daac58 100644
--- a/src/mame/includes/shaolins.h
+++ b/src/mame/includes/shaolins.h
@@ -26,4 +26,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_shaolins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(shaolins_interrupt);
};
diff --git a/src/mame/includes/snk6502.h b/src/mame/includes/snk6502.h
index f7563a1f284..9fd1bf40fbc 100644
--- a/src/mame/includes/snk6502.h
+++ b/src/mame/includes/snk6502.h
@@ -63,6 +63,7 @@ public:
UINT32 screen_update_snk6502(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(satansat_interrupt);
INTERRUPT_GEN_MEMBER(snk6502_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(sasuke_update_counter);
};
diff --git a/src/mame/includes/snowbros.h b/src/mame/includes/snowbros.h
index 8976ec3013b..6bd61e13659 100644
--- a/src/mame/includes/snowbros.h
+++ b/src/mame/includes/snowbros.h
@@ -49,4 +49,6 @@ public:
UINT32 screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_snowbros(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(snowbros_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_irq);
};
diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h
index 6dd053cbbb7..c27b97ec7b0 100644
--- a/src/mame/includes/spdodgeb.h
+++ b/src/mame/includes/spdodgeb.h
@@ -47,6 +47,6 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_spdodgeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_interrupt);
};
-TIMER_DEVICE_CALLBACK( spdodgeb_interrupt );
diff --git a/src/mame/includes/sprcros2.h b/src/mame/includes/sprcros2.h
index fdf2ea0b5d0..efcd88008cf 100644
--- a/src/mame/includes/sprcros2.h
+++ b/src/mame/includes/sprcros2.h
@@ -32,4 +32,5 @@ public:
virtual void palette_init();
UINT32 screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(sprcros2_s_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_m_interrupt);
};
diff --git a/src/mame/includes/sprint8.h b/src/mame/includes/sprint8.h
index 1ffd5f90ff5..0e3adc02be4 100644
--- a/src/mame/includes/sprint8.h
+++ b/src/mame/includes/sprint8.h
@@ -38,6 +38,7 @@ public:
UINT32 screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_sprint8(screen_device &screen, bool state);
TIMER_CALLBACK_MEMBER(sprint8_collision_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(input_callback);
};
/*----------- defined in drivers/sprint8.c -----------*/
diff --git a/src/mame/includes/srumbler.h b/src/mame/includes/srumbler.h
index 32800bca156..790eb0ae6fc 100644
--- a/src/mame/includes/srumbler.h
+++ b/src/mame/includes/srumbler.h
@@ -28,4 +28,5 @@ public:
virtual void machine_start();
virtual void video_start();
UINT32 screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(srumbler_interrupt);
};
diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h
index feff0e3d4b8..131ef52ecea 100644
--- a/src/mame/includes/ssv.h
+++ b/src/mame/includes/ssv.h
@@ -128,6 +128,8 @@ public:
UINT32 screen_update_ssv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ssv_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt);
};
/*----------- defined in video/ssv.c -----------*/
diff --git a/src/mame/includes/st0016.h b/src/mame/includes/st0016.h
index 065fdef3206..d2c448f0195 100644
--- a/src/mame/includes/st0016.h
+++ b/src/mame/includes/st0016.h
@@ -39,6 +39,7 @@ public:
DECLARE_VIDEO_START(st0016);
void st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(st0016_int);
};
#define ISMACS (st0016_game&0x80)
diff --git a/src/mame/includes/strnskil.h b/src/mame/includes/strnskil.h
index 7919a43fa52..21ddf3ff366 100644
--- a/src/mame/includes/strnskil.h
+++ b/src/mame/includes/strnskil.h
@@ -31,4 +31,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq);
};
diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h
index 8c17af767a8..3058cbdea9d 100644
--- a/src/mame/includes/suna16.h
+++ b/src/mame/includes/suna16.h
@@ -38,4 +38,5 @@ public:
DECLARE_MACHINE_RESET(uballoon);
UINT32 screen_update_suna16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_bestbest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(bssoccer_interrupt);
};
diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h
index e4924aeeb76..f6d995855d4 100644
--- a/src/mame/includes/suna8.h
+++ b/src/mame/includes/suna8.h
@@ -104,6 +104,8 @@ public:
DECLARE_VIDEO_START(suna8_textdim0);
DECLARE_MACHINE_RESET(hardhea2);
UINT32 screen_update_suna8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(brickzn_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(hardhea2_interrupt);
};
/*----------- defined in audio/suna8.c -----------*/
diff --git a/src/mame/includes/suprnova.h b/src/mame/includes/suprnova.h
index d07244af552..3a9ac1b74d5 100644
--- a/src/mame/includes/suprnova.h
+++ b/src/mame/includes/suprnova.h
@@ -136,6 +136,8 @@ public:
DECLARE_MACHINE_RESET(sknsk);
UINT32 screen_update_skns(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_skns(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(skns_irq);
};
/*----------- defined in video/suprnova.c -----------*/
diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h
index 58c1af73fed..402082b97fb 100644
--- a/src/mame/includes/system1.h
+++ b/src/mame/includes/system1.h
@@ -108,6 +108,8 @@ public:
UINT32 screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(mcu_irq_assert);
+ TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen);
+ TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback);
};
diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h
index 4e098ea5131..d248a9279b2 100644
--- a/src/mame/includes/taito_l.h
+++ b/src/mame/includes/taito_l.h
@@ -121,6 +121,7 @@ public:
DECLARE_MACHINE_RESET(cachat);
UINT32 screen_update_taitol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_taitol(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(vbl_interrupt);
};
/*----------- defined in video/taito_l.c -----------*/
diff --git a/src/mame/includes/taito_o.h b/src/mame/includes/taito_o.h
index 3623eb6b996..be7b5be7e53 100644
--- a/src/mame/includes/taito_o.h
+++ b/src/mame/includes/taito_o.h
@@ -20,4 +20,5 @@ public:
DECLARE_READ16_MEMBER(io_r);
virtual void machine_start();
UINT32 screen_update_parentj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(parentj_interrupt);
};
diff --git a/src/mame/includes/targeth.h b/src/mame/includes/targeth.h
index 597f5aab476..25792b1c4dc 100644
--- a/src/mame/includes/targeth.h
+++ b/src/mame/includes/targeth.h
@@ -21,4 +21,5 @@ public:
TILE_GET_INFO_MEMBER(get_tile_info_targeth_screen1);
virtual void video_start();
UINT32 screen_update_targeth(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(targeth_interrupt);
};
diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h
index 88fab684fe0..e8dbfb78388 100644
--- a/src/mame/includes/thedeep.h
+++ b/src/mame/includes/thedeep.h
@@ -51,4 +51,5 @@ public:
virtual void palette_init();
UINT32 screen_update_thedeep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(thedeep_mcu_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(thedeep_interrupt);
};
diff --git a/src/mame/includes/vball.h b/src/mame/includes/vball.h
index d75522c39ea..758fe8d5b3f 100644
--- a/src/mame/includes/vball.h
+++ b/src/mame/includes/vball.h
@@ -32,6 +32,7 @@ public:
TILE_GET_INFO_MEMBER(get_bg_tile_info);
virtual void video_start();
UINT32 screen_update_vb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(vball_scanline);
};
diff --git a/src/mame/includes/wecleman.h b/src/mame/includes/wecleman.h
index 619947323c7..fc98752c2d6 100644
--- a/src/mame/includes/wecleman.h
+++ b/src/mame/includes/wecleman.h
@@ -79,6 +79,8 @@ public:
UINT32 screen_update_wecleman(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_hotchase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(hotchase_sound_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(wecleman_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(hotchase_scanline);
};
/*----------- defined in video/wecleman.c -----------*/
diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h
index d5b0118e5d6..42a687fdf95 100644
--- a/src/mame/includes/williams.h
+++ b/src/mame/includes/williams.h
@@ -112,6 +112,10 @@ public:
TIMER_CALLBACK_MEMBER(williams_deferred_snd_cmd_w);
TIMER_CALLBACK_MEMBER(blaster_deferred_snd_cmd_w);
TIMER_CALLBACK_MEMBER(williams2_deferred_snd_cmd_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(williams_va11_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(williams_count240_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(williams2_va11_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(williams2_endscreen_callback);
};
@@ -165,12 +169,6 @@ extern const pia6821_interface tshoot_pia_1_intf;
extern const pia6821_interface tshoot_snd_pia_intf;
extern const pia6821_interface joust2_pia_1_intf;
-/* timer callbacks */
-TIMER_DEVICE_CALLBACK( williams_va11_callback );
-TIMER_DEVICE_CALLBACK( williams_count240_callback );
-TIMER_DEVICE_CALLBACK( williams2_va11_callback );
-TIMER_DEVICE_CALLBACK( williams2_endscreen_callback );
-
/*----------- defined in video/williams.c -----------*/
#define WILLIAMS_BLITTER_NONE 0 /* no blitter */
diff --git a/src/mame/includes/wwfsstar.h b/src/mame/includes/wwfsstar.h
index 6561a0e6ca9..19c31000159 100644
--- a/src/mame/includes/wwfsstar.h
+++ b/src/mame/includes/wwfsstar.h
@@ -27,4 +27,5 @@ public:
TILE_GET_INFO_MEMBER(get_bg0_tile_info);
virtual void video_start();
UINT32 screen_update_wwfsstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(wwfsstar_scanline);
};
diff --git a/src/mame/includes/wwfwfest.h b/src/mame/includes/wwfwfest.h
index dea70d9b641..56736d4c2c0 100644
--- a/src/mame/includes/wwfwfest.h
+++ b/src/mame/includes/wwfwfest.h
@@ -44,4 +44,5 @@ public:
virtual void video_start();
DECLARE_VIDEO_START(wwfwfstb);
UINT32 screen_update_wwfwfest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(wwfwfest_scanline);
};
diff --git a/src/mame/includes/xain.h b/src/mame/includes/xain.h
index c5e92c64dcb..bf7f2c60db9 100644
--- a/src/mame/includes/xain.h
+++ b/src/mame/includes/xain.h
@@ -69,4 +69,5 @@ public:
virtual void machine_start();
virtual void video_start();
UINT32 screen_update_xain(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(xain_scanline);
};
diff --git a/src/mame/includes/xexex.h b/src/mame/includes/xexex.h
index 3cd407687f1..49f1e695f22 100644
--- a/src/mame/includes/xexex.h
+++ b/src/mame/includes/xexex.h
@@ -66,6 +66,7 @@ public:
virtual void video_start();
UINT32 screen_update_xexex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(dmaend_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(xexex_interrupt);
};
/*----------- defined in video/xexex.c -----------*/
diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h
index 541a6b8e73b..1d3d8245392 100644
--- a/src/mame/includes/xmen.h
+++ b/src/mame/includes/xmen.h
@@ -53,6 +53,7 @@ public:
UINT32 screen_update_xmen6p_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_xmen6p_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_xmen6p(screen_device &screen, bool state);
+ TIMER_DEVICE_CALLBACK_MEMBER(xmen_scanline);
};
/*----------- defined in video/xmen.c -----------*/
diff --git a/src/mame/includes/zodiack.h b/src/mame/includes/zodiack.h
index df82552b6c9..11bf1325281 100644
--- a/src/mame/includes/zodiack.h
+++ b/src/mame/includes/zodiack.h
@@ -68,6 +68,7 @@ public:
TILE_GET_INFO_MEMBER(get_fg_tile_info);
DECLARE_PALETTE_INIT(zodiack);
INTERRUPT_GEN_MEMBER(zodiack_sound_nmi_gen);
+ TIMER_DEVICE_CALLBACK_MEMBER(zodiack_scanline);
};
class percuss_state : public zodiack_state
diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c
index f6fff92035b..60590e882b3 100644
--- a/src/mame/machine/balsente.c
+++ b/src/mame/machine/balsente.c
@@ -34,42 +34,40 @@ TIMER_CALLBACK_MEMBER(balsente_state::irq_off)
}
-TIMER_DEVICE_CALLBACK( balsente_interrupt_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(balsente_state::balsente_interrupt_timer)
{
- balsente_state *state = timer.machine().driver_data<balsente_state>();
-
/* next interrupt after scanline 256 is scanline 64 */
if (param == 256)
- state->m_scanline_timer->adjust(timer.machine().primary_screen->time_until_pos(64), 64);
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(64), 64);
else
- state->m_scanline_timer->adjust(timer.machine().primary_screen->time_until_pos(param + 64), param + 64);
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(param + 64), param + 64);
/* IRQ starts on scanline 0, 64, 128, etc. */
- timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), timer_expired_delegate(FUNC(balsente_state::irq_off),state));
+ machine().scheduler().timer_set(machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), timer_expired_delegate(FUNC(balsente_state::irq_off),this));
/* if this is Grudge Match, update the steering */
- if (state->m_grudge_steering_result & 0x80)
- update_grudge_steering(timer.machine());
+ if (m_grudge_steering_result & 0x80)
+ update_grudge_steering(machine());
/* if we're a shooter, we do a little more work */
- if (state->m_shooter)
+ if (m_shooter)
{
UINT8 tempx, tempy;
/* we latch the beam values on the first interrupt after VBLANK */
if (param == 64)
{
- state->m_shooter_x = timer.machine().root_device().ioport("FAKEX")->read();
- state->m_shooter_y = timer.machine().root_device().ioport("FAKEY")->read();
+ m_shooter_x = machine().root_device().ioport("FAKEX")->read();
+ m_shooter_y = machine().root_device().ioport("FAKEY")->read();
}
/* which bits get returned depends on which scanline we're at */
- tempx = state->m_shooter_x << ((param - 64) / 64);
- tempy = state->m_shooter_y << ((param - 64) / 64);
- state->m_nstocker_bits = ((tempx >> 4) & 0x08) | ((tempx >> 1) & 0x04) |
+ tempx = m_shooter_x << ((param - 64) / 64);
+ tempy = m_shooter_y << ((param - 64) / 64);
+ m_nstocker_bits = ((tempx >> 4) & 0x08) | ((tempx >> 1) & 0x04) |
((tempy >> 6) & 0x02) | ((tempy >> 3) & 0x01);
}
}
@@ -721,18 +719,16 @@ void balsente_state::counter_set_out(int which, int out)
}
-TIMER_DEVICE_CALLBACK( balsente_counter_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(balsente_state::balsente_counter_callback)
{
- balsente_state *state = timer.machine().driver_data<balsente_state>();
-
/* reset the counter and the count */
- state->m_counter[param].timer_active = 0;
- state->m_counter[param].count = 0;
+ m_counter[param].timer_active = 0;
+ m_counter[param].count = 0;
/* set the state of the OUT line */
/* mode 0 and 1: when firing, transition OUT to high */
- if (state->m_counter[param].mode == 0 || state->m_counter[param].mode == 1)
- state->counter_set_out(param, 1);
+ if (m_counter[param].mode == 0 || m_counter[param].mode == 1)
+ counter_set_out(param, 1);
/* no other modes handled currently */
}
@@ -867,7 +863,7 @@ static void set_counter_0_ff(timer_device &timer, int newstate)
{
state->m_counter[0].count--;
if (state->m_counter[0].count == 0)
- balsente_counter_callback(state, timer, NULL, 0);
+ state->balsente_counter_callback(timer, NULL, 0);
}
}
@@ -876,12 +872,10 @@ static void set_counter_0_ff(timer_device &timer, int newstate)
}
-TIMER_DEVICE_CALLBACK( balsente_clock_counter_0_ff )
+TIMER_DEVICE_CALLBACK_MEMBER(balsente_state::balsente_clock_counter_0_ff)
{
- balsente_state *state = timer.machine().driver_data<balsente_state>();
-
/* clock the D value through the flip-flop */
- set_counter_0_ff(timer, (state->m_counter_control >> 3) & 1);
+ set_counter_0_ff(timer, (m_counter_control >> 3) & 1);
}
diff --git a/src/mame/machine/bsktball.c b/src/mame/machine/bsktball.c
index 5df4b7abf75..75da5ab8ccd 100644
--- a/src/mame/machine/bsktball.c
+++ b/src/mame/machine/bsktball.c
@@ -19,15 +19,14 @@ WRITE8_MEMBER(bsktball_state::bsktball_nmion_w)
bsktball_interrupt
***************************************************************************/
/* NMI every 32V, IRQ every VBLANK */
-TIMER_DEVICE_CALLBACK( bsktball_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(bsktball_state::bsktball_scanline)
{
- bsktball_state *state = timer.machine().driver_data<bsktball_state>();
int scanline = param;
if(scanline == 0) // vblank irq
- timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
- else if(((scanline % 28) == 0) && (state->m_nmi_on)) // 32v timer irq
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
+ else if(((scanline % 28) == 0) && (m_nmi_on)) // 32v timer irq
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 24f778c9c4f..50c4bf09070 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -90,12 +90,11 @@ READ8_MEMBER(decocass_state::decocass_sound_command_r)
return data;
}
-TIMER_DEVICE_CALLBACK( decocass_audio_nmi_gen )
+TIMER_DEVICE_CALLBACK_MEMBER(decocass_state::decocass_audio_nmi_gen)
{
- decocass_state *state = timer.machine().driver_data<decocass_state>();
int scanline = param;
- state->m_audio_nmi_state = scanline & 8;
- state->m_audiocpu->set_input_line(INPUT_LINE_NMI, (state->m_audio_nmi_enabled && state->m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
+ m_audio_nmi_state = scanline & 8;
+ m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
}
WRITE8_MEMBER(decocass_state::decocass_sound_nmi_enable_w)
diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c
index f6e450b7571..1a335b1b284 100644
--- a/src/mame/machine/gaelco2.c
+++ b/src/mame/machine/gaelco2.c
@@ -186,18 +186,17 @@ WRITE16_MEMBER(gaelco2_state::bang_clr_gun_int_w)
m_clr_gun_int = 1;
}
-TIMER_DEVICE_CALLBACK( bang_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(gaelco2_state::bang_irq)
{
- gaelco2_state *state = timer.machine().driver_data<gaelco2_state>();
int scanline = param;
if (scanline == 256){
- state->m_maincpu->set_input_line(2, HOLD_LINE);
- state->m_clr_gun_int = 0;
+ m_maincpu->set_input_line(2, HOLD_LINE);
+ m_clr_gun_int = 0;
}
- if ((scanline % 64) == 0 && state->m_clr_gun_int)
- state->m_maincpu->set_input_line(4, HOLD_LINE);
+ if ((scanline % 64) == 0 && m_clr_gun_int)
+ m_maincpu->set_input_line(4, HOLD_LINE);
}
/***************************************************************************
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index 467d6a135eb..495fb9a4a2c 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -49,9 +49,9 @@ WRITE8_MEMBER(galaxold_state::galaxold_nmi_enable_w)
}
-TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(galaxold_state::galaxold_interrupt_timer)
{
- ttl7474_device *target = timer.machine().device<ttl7474_device>("7474_9m_2");
+ ttl7474_device *target = machine().device<ttl7474_device>("7474_9m_2");
/* 128V, 64V and 32V go to D */
target->d_w(((param & 0xe0) != 0xe0) ? 1 : 0);
@@ -61,7 +61,7 @@ TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer )
param = (param + 0x10) & 0xff;
- timer.adjust(timer.machine().primary_screen->time_until_pos(param), param);
+ timer.adjust(machine().primary_screen->time_until_pos(param), param);
}
diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c
index 9924c0c85b3..0cfb1670c2c 100644
--- a/src/mame/machine/irobot.c
+++ b/src/mame/machine/irobot.c
@@ -61,11 +61,10 @@ WRITE8_MEMBER(irobot_state::irobot_sharedmem_w)
m_combase[BYTE_XOR_BE(offset & 0xFFF)] = data;
}
-TIMER_DEVICE_CALLBACK( irobot_irvg_done_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(irobot_state::irobot_irvg_done_callback)
{
- irobot_state *state = timer.machine().driver_data<irobot_state>();
logerror("vg done. ");
- state->m_irvg_running = 0;
+ m_irvg_running = 0;
}
WRITE8_MEMBER(irobot_state::irobot_statwr_w)
@@ -412,12 +411,11 @@ DRIVER_INIT_MEMBER(irobot_state,irobot)
load_oproms(machine());
}
-TIMER_DEVICE_CALLBACK( irobot_irmb_done_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(irobot_state::irobot_irmb_done_callback)
{
- irobot_state *state = timer.machine().driver_data<irobot_state>();
logerror("mb done. ");
- state->m_irmb_running = 0;
- timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
+ m_irmb_running = 0;
+ machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
}
diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c
index 3dc17d0b7a4..5305b28df84 100644
--- a/src/mame/machine/mcr.c
+++ b/src/mame/machine/mcr.c
@@ -182,10 +182,9 @@ MACHINE_RESET_MEMBER(mcr_state,mcr)
*
*************************************/
-TIMER_DEVICE_CALLBACK( mcr_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::mcr_interrupt)
{
- //mcr_state *state = timer.machine().driver_data<mcr_state>();
- z80ctc_device *ctc = timer.machine().device<z80ctc_device>("ctc");
+ z80ctc_device *ctc = machine().device<z80ctc_device>("ctc");
int scanline = param;
/* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */
@@ -205,10 +204,9 @@ TIMER_DEVICE_CALLBACK( mcr_interrupt )
}
}
-TIMER_DEVICE_CALLBACK( mcr_ipu_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::mcr_ipu_interrupt)
{
- //mcr_state *state = timer.machine().driver_data<mcr_state>();
- z80ctc_device *ctc = timer.machine().device<z80ctc_device>("ctc");
+ z80ctc_device *ctc = machine().device<z80ctc_device>("ctc");
int scanline = param;
/* CTC line 3 is connected to 493, which is signalled once every */
diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c
index 8a0f05197af..1dfb8525f4c 100644
--- a/src/mame/machine/mhavoc.c
+++ b/src/mame/machine/mhavoc.c
@@ -16,25 +16,24 @@
*
*************************************/
-TIMER_DEVICE_CALLBACK( mhavoc_cpu_irq_clock )
+TIMER_DEVICE_CALLBACK_MEMBER(mhavoc_state::mhavoc_cpu_irq_clock)
{
- mhavoc_state *state = timer.machine().driver_data<mhavoc_state>();
/* clock the LS161 driving the alpha CPU IRQ */
- if (state->m_alpha_irq_clock_enable)
+ if (m_alpha_irq_clock_enable)
{
- state->m_alpha_irq_clock++;
- if ((state->m_alpha_irq_clock & 0x0c) == 0x0c)
+ m_alpha_irq_clock++;
+ if ((m_alpha_irq_clock & 0x0c) == 0x0c)
{
- timer.machine().device("alpha")->execute().set_input_line(0, ASSERT_LINE);
- state->m_alpha_irq_clock_enable = 0;
+ machine().device("alpha")->execute().set_input_line(0, ASSERT_LINE);
+ m_alpha_irq_clock_enable = 0;
}
}
/* clock the LS161 driving the gamma CPU IRQ */
- if (state->m_has_gamma_cpu)
+ if (m_has_gamma_cpu)
{
- state->m_gamma_irq_clock++;
- timer.machine().device("gamma")->execute().set_input_line(0, (state->m_gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE);
+ m_gamma_irq_clock++;
+ machine().device("gamma")->execute().set_input_line(0, (m_gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE);
}
}
diff --git a/src/mame/machine/nitedrvr.c b/src/mame/machine/nitedrvr.c
index c41f6492b1f..3e2102225c8 100644
--- a/src/mame/machine/nitedrvr.c
+++ b/src/mame/machine/nitedrvr.c
@@ -248,29 +248,27 @@ WRITE8_MEMBER(nitedrvr_state::nitedrvr_out1_w)
}
-TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(nitedrvr_state::nitedrvr_crash_toggle_callback)
{
- nitedrvr_state *state = timer.machine().driver_data<nitedrvr_state>();
-
- if (state->m_crash_en && state->m_crash_data_en)
+ if (m_crash_en && m_crash_data_en)
{
- state->m_crash_data--;
- address_space &space = timer.machine().driver_data()->generic_space();
- discrete_sound_w(state->m_discrete, space, NITEDRVR_BANG_DATA, state->m_crash_data); // Crash Volume
- if (!state->m_crash_data)
- state->m_crash_data_en = 0; // Done counting?
+ m_crash_data--;
+ address_space &space = machine().driver_data()->generic_space();
+ discrete_sound_w(m_discrete, space, NITEDRVR_BANG_DATA, m_crash_data); // Crash Volume
+ if (!m_crash_data)
+ m_crash_data_en = 0; // Done counting?
- if (state->m_crash_data & 0x01)
+ if (m_crash_data & 0x01)
{
/* Invert video */
- palette_set_color(timer.machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- palette_set_color(timer.machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+ palette_set_color(machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ palette_set_color(machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
}
else
{
/* Normal video */
- palette_set_color(timer.machine(), 0, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- palette_set_color(timer.machine(), 1, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+ palette_set_color(machine(), 0, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ palette_set_color(machine(), 1, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
}
}
}
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index b8ee68ca267..96bc61bd0d2 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -253,9 +253,9 @@ const pia6821_interface joust2_pia_1_intf =
*
*************************************/
-TIMER_DEVICE_CALLBACK( williams_va11_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_va11_callback)
{
- pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
+ pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1");
int scanline = param;
/* the IRQ signal comes into CB1, and is set to VA11 */
@@ -264,7 +264,7 @@ TIMER_DEVICE_CALLBACK( williams_va11_callback )
/* set a timer for the next update */
scanline += 0x20;
if (scanline >= 256) scanline = 0;
- timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(machine().primary_screen->time_until_pos(scanline), scanline);
}
@@ -277,19 +277,18 @@ TIMER_CALLBACK_MEMBER(williams_state::williams_count240_off_callback)
}
-TIMER_DEVICE_CALLBACK( williams_count240_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_count240_callback)
{
- williams_state *state = timer.machine().driver_data<williams_state>();
- pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
+ pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1");
/* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
pia_1->ca1_w(1);
/* set a timer to turn it off once the scanline counter resets */
- timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(williams_state::williams_count240_off_callback),state));
+ machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(williams_state::williams_count240_off_callback),this));
/* set a timer for next frame */
- timer.adjust(timer.machine().primary_screen->time_until_pos(240));
+ timer.adjust(machine().primary_screen->time_until_pos(240));
}
@@ -406,10 +405,10 @@ MACHINE_RESET_MEMBER(williams_state,williams)
*
*************************************/
-TIMER_DEVICE_CALLBACK( williams2_va11_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams2_va11_callback)
{
- pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
+ pia6821_device *pia_0 = machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1");
int scanline = param;
/* the IRQ signal comes into CB1, and is set to VA11 */
@@ -419,7 +418,7 @@ TIMER_DEVICE_CALLBACK( williams2_va11_callback )
/* set a timer for the next update */
scanline += 0x20;
if (scanline >= 256) scanline = 0;
- timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(machine().primary_screen->time_until_pos(scanline), scanline);
}
@@ -432,19 +431,18 @@ TIMER_CALLBACK_MEMBER(williams_state::williams2_endscreen_off_callback)
}
-TIMER_DEVICE_CALLBACK( williams2_endscreen_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams2_endscreen_callback)
{
- williams_state *state = timer.machine().driver_data<williams_state>();
- pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_0 = machine().device<pia6821_device>("pia_0");
/* the /ENDSCREEN signal comes into CA1 */
pia_0->ca1_w(0);
/* set a timer to turn it off once the scanline counter resets */
- timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(8), timer_expired_delegate(FUNC(williams_state::williams2_endscreen_off_callback),state));
+ machine().scheduler().timer_set(machine().primary_screen->time_until_pos(8), timer_expired_delegate(FUNC(williams_state::williams2_endscreen_off_callback),this));
/* set a timer for next frame */
- timer.adjust(timer.machine().primary_screen->time_until_pos(254));
+ timer.adjust(machine().primary_screen->time_until_pos(254));
}
diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c
index 7ef04315ffc..c056a249a3b 100644
--- a/src/mame/video/atarisy1.c
+++ b/src/mame/video/atarisy1.c
@@ -301,10 +301,9 @@ WRITE16_HANDLER( atarisy1_xscroll_w )
*
*************************************/
-TIMER_DEVICE_CALLBACK( atarisy1_reset_yscroll_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_reset_yscroll_callback)
{
- atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
- state->m_playfield_tilemap->set_scrolly(0, param);
+ m_playfield_tilemap->set_scrolly(0, param);
}
@@ -382,29 +381,28 @@ WRITE16_HANDLER( atarisy1_spriteram_w )
*
*************************************/
-TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_int3off_callback)
{
- address_space &space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
/* clear the state */
atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
}
-TIMER_DEVICE_CALLBACK( atarisy1_int3_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_int3_callback)
{
- atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
int scanline = param;
/* update the state */
- atarigen_scanline_int_gen(timer.machine().device("maincpu"));
+ atarigen_scanline_int_gen(machine().device("maincpu"));
/* set a timer to turn it off */
- state->m_int3off_timer->adjust(timer.machine().primary_screen->scan_period());
+ m_int3off_timer->adjust(machine().primary_screen->scan_period());
/* determine the time of the next one */
- state->m_next_timer_scanline = -1;
- update_timers(timer.machine(), scanline);
+ m_next_timer_scanline = -1;
+ update_timers(machine(), scanline);
}
diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c
index d80712ef409..faf0b7c5e2d 100644
--- a/src/mame/video/battlera.c
+++ b/src/mame/video/battlera.c
@@ -361,27 +361,26 @@ UINT32 battlera_state::screen_update_battlera(screen_device &screen, bitmap_ind1
/******************************************************************************/
-TIMER_DEVICE_CALLBACK( battlera_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(battlera_state::battlera_irq)
{
- battlera_state *state = timer.machine().driver_data<battlera_state>();
- state->m_current_scanline = param; /* 8 lines clipped at top */
+ m_current_scanline = param; /* 8 lines clipped at top */
/* If raster interrupt occurs, refresh screen _up_ to this point */
- if (state->m_rcr_enable && (state->m_current_scanline+56)==state->m_HuC6270_registers[6]) {
- timer.machine().primary_screen->update_partial(state->m_current_scanline);
- state->m_maincpu->set_input_line(0, HOLD_LINE); /* RCR interrupt */
+ if (m_rcr_enable && (m_current_scanline+56)==m_HuC6270_registers[6]) {
+ machine().primary_screen->update_partial(m_current_scanline);
+ m_maincpu->set_input_line(0, HOLD_LINE); /* RCR interrupt */
}
/* Start of vblank */
- else if (state->m_current_scanline==240) {
- state->m_bldwolf_vblank=1;
- timer.machine().primary_screen->update_partial(240);
- if (state->m_irq_enable)
- state->m_maincpu->set_input_line(0, HOLD_LINE); /* VBL */
+ else if (m_current_scanline==240) {
+ m_bldwolf_vblank=1;
+ machine().primary_screen->update_partial(240);
+ if (m_irq_enable)
+ m_maincpu->set_input_line(0, HOLD_LINE); /* VBL */
}
/* End of vblank */
- if (state->m_current_scanline==254) {
- state->m_bldwolf_vblank=0;
+ if (m_current_scanline==254) {
+ m_bldwolf_vblank=0;
}
}
diff --git a/src/mame/video/beezer.c b/src/mame/video/beezer.c
index d0bea429ad1..d07ff3549e4 100644
--- a/src/mame/video/beezer.c
+++ b/src/mame/video/beezer.c
@@ -4,18 +4,17 @@
#include "includes/beezer.h"
-TIMER_DEVICE_CALLBACK( beezer_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(beezer_state::beezer_interrupt)
{
int scanline = param;
-// beezer_state *state = timer.machine().driver_data<beezer_state>();
- via6522_device *via_0 = timer.machine().device<via6522_device>("via6522_0");
+ via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
via_0->write_ca2((scanline & 0x20) ? 1 : 0);
#if 0
if (scanline == 240) // actually unused by the game! (points to a tight loop)
- state->m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
+ m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
else
- state->m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
+ m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
#endif
}
diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c
index 4c9a8d436b1..da1d72fcf21 100644
--- a/src/mame/video/galaxian.c
+++ b/src/mame/video/galaxian.c
@@ -846,10 +846,9 @@ static void stars_update_origin(running_machine &machine)
*
*************************************/
-TIMER_DEVICE_CALLBACK( galaxian_stars_blink_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(galaxian_state::galaxian_stars_blink_timer)
{
- galaxian_state *state = timer.machine().driver_data<galaxian_state>();
- state->m_stars_blink_state++;
+ m_stars_blink_state++;
}
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index 9ef54112de6..b23148695e1 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -568,15 +568,14 @@ WRITE8_MEMBER(itech8_state::grmatch_xscroll_w)
}
-TIMER_DEVICE_CALLBACK( grmatch_palette_update )
+TIMER_DEVICE_CALLBACK_MEMBER(itech8_state::grmatch_palette_update)
{
- itech8_state *state = timer.machine().driver_data<itech8_state>();
- struct tms34061_display &tms_state = state->m_tms_state;
+ struct tms34061_display &tms_state = m_tms_state;
/* if the high bit is set, we are supposed to latch the palette values */
- if (state->m_grmatch_palcontrol & 0x80)
+ if (m_grmatch_palcontrol & 0x80)
{
/* the TMS34070s latch at the start of the frame, based on the first few bytes */
- UINT32 page_offset = (tms_state.dispstart & 0x0ffff) | state->m_grmatch_xscroll;
+ UINT32 page_offset = (tms_state.dispstart & 0x0ffff) | m_grmatch_xscroll;
int page, x;
/* iterate over both pages */
@@ -587,7 +586,7 @@ TIMER_DEVICE_CALLBACK( grmatch_palette_update )
{
UINT8 data0 = base[x * 2 + 0];
UINT8 data1 = base[x * 2 + 1];
- state->m_grmatch_palette[page][x] = MAKE_RGB(pal4bit(data0 >> 0), pal4bit(data1 >> 4), pal4bit(data1 >> 0));
+ m_grmatch_palette[page][x] = MAKE_RGB(pal4bit(data0 >> 0), pal4bit(data1 >> 4), pal4bit(data1 >> 0));
}
}
}
diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c
index 8f24702448e..00806759c62 100644
--- a/src/mame/video/spdodgeb.c
+++ b/src/mame/video/spdodgeb.c
@@ -82,20 +82,19 @@ void spdodgeb_state::video_start()
***************************************************************************/
-TIMER_DEVICE_CALLBACK( spdodgeb_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_state::spdodgeb_interrupt)
{
- spdodgeb_state *state = timer.machine().driver_data<spdodgeb_state>();
int scanline = param;
if (scanline == 256)
{
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- timer.machine().primary_screen->update_partial(256);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().primary_screen->update_partial(256);
}
else if ((scanline % 8) == 0)
{
- state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
- timer.machine().primary_screen->update_partial(scanline+16); /* TODO: pretty off ... */
+ m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
+ machine().primary_screen->update_partial(scanline+16); /* TODO: pretty off ... */
}
}
diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c
index bd37c089338..14cd34f1375 100644
--- a/src/mess/drivers/a7800.c
+++ b/src/mess/drivers/a7800.c
@@ -253,7 +253,7 @@ static MACHINE_CONFIG_START( a7800_ntsc, a7800_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, A7800_NTSC_Y1/8) /* 1.79 MHz (switches to 1.19 MHz on TIA or RIOT access) */
MCFG_CPU_PROGRAM_MAP(a7800_mem)
- MCFG_TIMER_ADD_SCANLINE("scantimer", a7800_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a7800_state, a7800_interrupt, "screen", 0, 1)
/* video hardware */
diff --git a/src/mess/drivers/ace.c b/src/mess/drivers/ace.c
index f59570711a1..f751fc297ed 100644
--- a/src/mess/drivers/ace.c
+++ b/src/mess/drivers/ace.c
@@ -364,9 +364,9 @@ GFXDECODE_END
// TIMER_DEVICE_CALLBACK( set_irq )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( set_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(ace_state::set_irq)
{
- timer.machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
+ machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
}
@@ -374,9 +374,9 @@ static TIMER_DEVICE_CALLBACK( set_irq )
// TIMER_DEVICE_CALLBACK( clear_irq )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( clear_irq )
+TIMER_DEVICE_CALLBACK_MEMBER(ace_state::clear_irq)
{
- timer.machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
+ machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
}
@@ -630,8 +630,8 @@ static MACHINE_CONFIG_START( ace, ace_state )
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DRIVER(ace_state, screen_update)
MCFG_SCREEN_RAW_PARAMS(XTAL_6_5MHz, 416, 0, 336, 312, 0, 304)
- MCFG_TIMER_ADD_SCANLINE("set_irq", set_irq, SCREEN_TAG, 31*8, 264)
- MCFG_TIMER_ADD_SCANLINE("clear_irq", clear_irq, SCREEN_TAG, 32*8, 264)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("set_irq", ace_state, set_irq, SCREEN_TAG, 31*8, 264)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("clear_irq", ace_state, clear_irq, SCREEN_TAG, 32*8, 264)
MCFG_PALETTE_LENGTH(2)
MCFG_PALETTE_INIT(black_and_white)
diff --git a/src/mess/drivers/adam.c b/src/mess/drivers/adam.c
index 9ef8d2d3b47..7c1e65d498c 100644
--- a/src/mess/drivers/adam.c
+++ b/src/mess/drivers/adam.c
@@ -1165,13 +1165,11 @@ WRITE8_MEMBER( adam_state::fdc6801_p4_w )
// TIMER_DEVICE_CALLBACK( paddle_tick )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( paddle_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(adam_state::paddle_tick)
{
- adam_state *state = timer.machine().driver_data<adam_state>();
-
// TODO: improve irq behaviour (see drivers/coleco.c)
- if (coleco_scan_paddles(timer.machine(), &state->m_joy_status0, &state->m_joy_status1))
- state->m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
+ if (coleco_scan_paddles(machine(), &m_joy_status0, &m_joy_status1))
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
}
@@ -1732,7 +1730,7 @@ static MACHINE_CONFIG_START( adam, adam_state )
MCFG_SOUND_CONFIG(psg_intf)
// devices
- MCFG_TIMER_ADD_PERIODIC("paddles", paddle_tick, attotime::from_msec(20))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("paddles", adam_state, paddle_tick, attotime::from_msec(20))
MCFG_WD2793_ADD(WD2793_TAG, fdc_intf)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, adam_floppy_interface)
MCFG_CASSETTE_ADD(CASSETTE_TAG, adam_cassette_interface)
diff --git a/src/mess/drivers/amstr_pc.c b/src/mess/drivers/amstr_pc.c
index c3e424a065a..0c0399b535c 100644
--- a/src/mess/drivers/amstr_pc.c
+++ b/src/mess/drivers/amstr_pc.c
@@ -241,7 +241,7 @@ SLOT_INTERFACE_END
MCFG_CPU_ADD("maincpu", type, clock) \
MCFG_CPU_PROGRAM_MAP(mem##_map) \
MCFG_CPU_IO_MAP(port##_io) \
- MCFG_TIMER_ADD_SCANLINE("scantimer", vblankfunc, "screen", 0, 1) \
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, vblankfunc, "screen", 0, 1) \
MCFG_CPU_CONFIG(i86_address_mask)
@@ -334,7 +334,7 @@ static MACHINE_CONFIG_START( ppc512, pc_state )
MCFG_CPU_ADD("maincpu", V30, 8000000)
MCFG_CPU_PROGRAM_MAP(ppc512_map)
MCFG_CPU_IO_MAP(ppc512_io)
- MCFG_TIMER_ADD_SCANLINE("scantimer", pc_frame_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, pc_frame_interrupt, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(pc_state,pc)
MCFG_MACHINE_RESET_OVERRIDE(pc_state,pc)
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c
index 755fffd4f8b..ff96f4ada4f 100644
--- a/src/mess/drivers/apple2.c
+++ b/src/mess/drivers/apple2.c
@@ -644,7 +644,7 @@ static MACHINE_CONFIG_START( apple2_common, apple2_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, 1021800) /* close to actual CPU frequency of 1.020484 MHz */
MCFG_CPU_PROGRAM_MAP(apple2_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", apple2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", apple2_state, apple2_interrupt, "screen", 0, 1)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_MACHINE_START_OVERRIDE(apple2_state, apple2 )
diff --git a/src/mess/drivers/apple2gs.c b/src/mess/drivers/apple2gs.c
index d7fa59e186e..70fd6b3304d 100644
--- a/src/mess/drivers/apple2gs.c
+++ b/src/mess/drivers/apple2gs.c
@@ -235,7 +235,7 @@ static MACHINE_CONFIG_START( apple2gs, apple2gs_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", G65816, APPLE2GS_14M/5)
MCFG_CPU_PROGRAM_MAP(apple2gs_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", apple2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", apple2gs_state, apple2_interrupt, "screen", 0, 1)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mess/drivers/atom.c b/src/mess/drivers/atom.c
index 43887da9489..a96332e5233 100644
--- a/src/mess/drivers/atom.c
+++ b/src/mess/drivers/atom.c
@@ -592,15 +592,13 @@ static const floppy_interface atom_floppy_interface =
cassette_interface atom_cassette_interface
-------------------------------------------------*/
-static TIMER_DEVICE_CALLBACK( cassette_output_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(atom_state::cassette_output_tick)
{
- atom_state *state = timer.machine().driver_data<atom_state>();
+ int level = !(!(!m_hz2400 && m_pc1) && m_pc0);
- int level = !(!(!state->m_hz2400 && state->m_pc1) && state->m_pc0);
+ m_cassette->output(level ? -1.0 : +1.0);
- state->m_cassette->output(level ? -1.0 : +1.0);
-
- state->m_hz2400 = !state->m_hz2400;
+ m_hz2400 = !m_hz2400;
}
static const cassette_interface atom_cassette_interface =
@@ -784,7 +782,7 @@ static MACHINE_CONFIG_START( atom, atom_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* devices */
- MCFG_TIMER_ADD_PERIODIC("hz2400", cassette_output_tick, attotime::from_hz(4806)) // X2/4/416
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("hz2400", atom_state, cassette_output_tick, attotime::from_hz(4806))
MCFG_VIA6522_ADD(R6522_TAG, X2/4, via_intf)
MCFG_I8255_ADD(INS8255_TAG, ppi_intf)
MCFG_I8271_ADD(I8271_TAG, fdc_intf)
diff --git a/src/mess/drivers/avigo.c b/src/mess/drivers/avigo.c
index 14dd2e1f747..cb37c17757e 100644
--- a/src/mess/drivers/avigo.c
+++ b/src/mess/drivers/avigo.c
@@ -809,22 +809,18 @@ static GFXDECODE_START( avigo )
GFXDECODE_END
-static TIMER_DEVICE_CALLBACK( avigo_scan_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(avigo_state::avigo_scan_timer)
{
- avigo_state *state = timer.machine().driver_data<avigo_state>();
+ m_irq |= (1<<1);
- state->m_irq |= (1<<1);
-
- state->refresh_ints();
+ refresh_ints();
}
-static TIMER_DEVICE_CALLBACK( avigo_1hz_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(avigo_state::avigo_1hz_timer)
{
- avigo_state *state = timer.machine().driver_data<avigo_state>();
+ m_irq |= (1<<4);
- state->m_irq |= (1<<4);
-
- state->refresh_ints();
+ refresh_ints();
}
static QUICKLOAD_LOAD(avigo)
@@ -930,10 +926,10 @@ static MACHINE_CONFIG_START( avigo, avigo_state )
MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", avigo_state, nvram_init)
// IRQ 1 is used for scan the pen and for cursor blinking
- MCFG_TIMER_ADD_PERIODIC("scan_timer", avigo_scan_timer, attotime::from_hz(50))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("scan_timer", avigo_state, avigo_scan_timer, attotime::from_hz(50))
// IRQ 4 is generated every second, used for auto power off
- MCFG_TIMER_ADD_PERIODIC("1hz_timer", avigo_1hz_timer, attotime::from_hz(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("1hz_timer", avigo_state, avigo_1hz_timer, attotime::from_hz(1))
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", avigo, "app", 0)
diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c
index a6ea30c57c6..783eba784b9 100644
--- a/src/mess/drivers/bullet.c
+++ b/src/mess/drivers/bullet.c
@@ -671,18 +671,16 @@ INPUT_PORTS_END
// Z80CTC_INTERFACE( ctc_intf )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( ctc_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(bullet_state::ctc_tick)
{
- bullet_state *state = timer.machine().driver_data<bullet_state>();
+ m_ctc->trg0(1);
+ m_ctc->trg0(0);
- state->m_ctc->trg0(1);
- state->m_ctc->trg0(0);
+ m_ctc->trg1(1);
+ m_ctc->trg1(0);
- state->m_ctc->trg1(1);
- state->m_ctc->trg1(0);
-
- state->m_ctc->trg2(1);
- state->m_ctc->trg2(0);
+ m_ctc->trg2(1);
+ m_ctc->trg2(0);
}
static WRITE_LINE_DEVICE_HANDLER( dart_rxtxca_w )
@@ -1164,7 +1162,7 @@ static MACHINE_CONFIG_START( bullet, bullet_state )
// devices
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/4, ctc_intf)
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", bullet_state, ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_16MHz/4, dart_intf)
MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_16MHz/4, dma_intf)
MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_16MHz/4, pio_intf)
@@ -1195,7 +1193,7 @@ static MACHINE_CONFIG_START( bulletf, bulletf_state )
// devices
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/4, ctc_intf)
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", bullet_state, ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_16MHz/4, dart_intf)
MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_16MHz/4, dma_intf)
MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_16MHz/4, bulletf_pio_intf)
diff --git a/src/mess/drivers/busicom.c b/src/mess/drivers/busicom.c
index 483c364ccf9..35d910c481a 100644
--- a/src/mess/drivers/busicom.c
+++ b/src/mess/drivers/busicom.c
@@ -178,13 +178,12 @@ static INPUT_PORTS_START( busicom )
INPUT_PORTS_END
-static TIMER_DEVICE_CALLBACK(timer_callback)
+TIMER_DEVICE_CALLBACK_MEMBER(busicom_state::timer_callback)
{
- busicom_state *state = timer.machine().driver_data<busicom_state>();
- state->m_timer ^=1;
- if (state->m_timer==1) state->m_drum_index++;
- if (state->m_drum_index==13) state->m_drum_index=0;
- i4004_set_test(timer.machine().device("maincpu"),state->m_timer);
+ m_timer ^=1;
+ if (m_timer==1) m_drum_index++;
+ if (m_drum_index==13) m_drum_index=0;
+ i4004_set_test(machine().device("maincpu"),m_timer);
}
@@ -229,7 +228,7 @@ static MACHINE_CONFIG_START( busicom, busicom_state )
MCFG_PALETTE_LENGTH(16)
- MCFG_TIMER_ADD_PERIODIC("busicom_timer", timer_callback, attotime::from_msec(28*2))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("busicom_timer", busicom_state, timer_callback, attotime::from_msec(28*2))
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/bw12.c b/src/mess/drivers/bw12.c
index 97c3af97a4d..e0193b8676d 100644
--- a/src/mess/drivers/bw12.c
+++ b/src/mess/drivers/bw12.c
@@ -91,11 +91,9 @@ void bw12_state::floppy_motor_off()
m_motor_on = 0;
}
-static TIMER_DEVICE_CALLBACK( floppy_motor_off_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(bw12_state::floppy_motor_off_tick)
{
- bw12_state *state = timer.machine().driver_data<bw12_state>();
-
- state->floppy_motor_off();
+ floppy_motor_off();
}
void bw12_state::set_floppy_motor_off_timer()
@@ -789,7 +787,7 @@ static MACHINE_CONFIG_START( common, bw12_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* devices */
- MCFG_TIMER_ADD(FLOPPY_TIMER_TAG, floppy_motor_off_tick)
+ MCFG_TIMER_DRIVER_ADD(FLOPPY_TIMER_TAG, bw12_state, floppy_motor_off_tick)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
MCFG_PIA6821_ADD(PIA6821_TAG, pia_intf)
MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_16MHz/4, sio_intf)
diff --git a/src/mess/drivers/coleco.c b/src/mess/drivers/coleco.c
index 6a0259fab1d..6bb8c985c82 100644
--- a/src/mess/drivers/coleco.c
+++ b/src/mess/drivers/coleco.c
@@ -213,25 +213,23 @@ TIMER_CALLBACK_MEMBER(coleco_state::paddle_pulse_callback)
}
}
-static TIMER_DEVICE_CALLBACK( paddle_update_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(coleco_state::paddle_update_callback)
{
// arbitrary timer for reading analog controls
- coleco_state *state = timer.machine().driver_data<coleco_state>();
-
- coleco_scan_paddles(timer.machine(), &state->m_joy_analog_reload[0], &state->m_joy_analog_reload[1]);
+ coleco_scan_paddles(machine(), &m_joy_analog_reload[0], &m_joy_analog_reload[1]);
for (int port = 0; port < 2; port++)
{
- if (state->m_joy_analog_reload[port])
+ if (m_joy_analog_reload[port])
{
const int sensitivity = 500;
- int ipt = state->m_joy_analog_reload[port];
+ int ipt = m_joy_analog_reload[port];
if (ipt & 0x80) ipt = 0x100 - ipt;
attotime freq = attotime::from_msec(sensitivity / ipt);
// change pulse intervals relative to spinner/trackball speed
- state->m_joy_pulse_reload[port] = freq;
- state->m_joy_pulse_timer[port]->adjust(min(freq, state->m_joy_pulse_timer[port]->remaining()), port);
+ m_joy_pulse_reload[port] = freq;
+ m_joy_pulse_timer[port]->adjust(min(freq, m_joy_pulse_timer[port]->remaining()), port);
}
}
}
@@ -340,7 +338,7 @@ static MACHINE_CONFIG_START( coleco, coleco_state )
/* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","coleco")
- MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_update_callback, attotime::from_msec(20))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("paddle_timer", coleco_state, paddle_update_callback, attotime::from_msec(20))
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( czz50, coleco_state )
@@ -370,7 +368,7 @@ static MACHINE_CONFIG_START( czz50, coleco_state )
/* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","coleco")
- MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_update_callback, attotime::from_msec(20))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("paddle_timer", coleco_state, paddle_update_callback, attotime::from_msec(20))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( dina, czz50 )
diff --git a/src/mess/drivers/cosmicos.c b/src/mess/drivers/cosmicos.c
index 5376c46ae39..6946156c7c5 100644
--- a/src/mess/drivers/cosmicos.c
+++ b/src/mess/drivers/cosmicos.c
@@ -341,20 +341,16 @@ INPUT_PORTS_END
/* Video */
-static TIMER_DEVICE_CALLBACK( digit_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(cosmicos_state::digit_tick)
{
- cosmicos_state *state = timer.machine().driver_data<cosmicos_state>();
+ m_digit = !m_digit;
- state->m_digit = !state->m_digit;
-
- output_set_digit_value(state->m_digit, state->m_segment);
+ output_set_digit_value(m_digit, m_segment);
}
-static TIMER_DEVICE_CALLBACK( int_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(cosmicos_state::int_tick)
{
- cosmicos_state *state = timer.machine().driver_data<cosmicos_state>();
-
- state->m_maincpu->set_input_line(COSMAC_INPUT_LINE_INT, ASSERT_LINE);
+ m_maincpu->set_input_line(COSMAC_INPUT_LINE_INT, ASSERT_LINE);
}
WRITE_LINE_MEMBER( cosmicos_state::dmaout_w )
@@ -569,8 +565,8 @@ static MACHINE_CONFIG_START( cosmicos, cosmicos_state )
/* video hardware */
MCFG_DEFAULT_LAYOUT( layout_cosmicos )
MCFG_DM9368_ADD(DM9368_TAG, led_intf)
- MCFG_TIMER_ADD_PERIODIC("digit", digit_tick, attotime::from_hz(100))
- MCFG_TIMER_ADD_PERIODIC("interrupt", int_tick, attotime::from_hz(1000))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("digit", cosmicos_state, digit_tick, attotime::from_hz(100))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("interrupt", cosmicos_state, int_tick, attotime::from_hz(1000))
MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, XTAL_1_75MHz)
MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update)
diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c
index c7d11be9d21..7a4db3294b2 100644
--- a/src/mess/drivers/einstein.c
+++ b/src/mess/drivers/einstein.c
@@ -188,24 +188,22 @@ static void einstein_scan_keyboard(running_machine &machine)
einstein->m_keyboard_data = data;
}
-static TIMER_DEVICE_CALLBACK( einstein_keyboard_timer_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(einstein_state::einstein_keyboard_timer_callback)
{
- einstein_state *einstein = timer.machine().driver_data<einstein_state>();
-
/* re-scan keyboard */
- einstein_scan_keyboard(timer.machine());
+ einstein_scan_keyboard(machine());
/* if /fire1 or /fire2 is 0, signal a fire interrupt */
- if ((timer.machine().root_device().ioport("BUTTONS")->read() & 0x03) != 0)
+ if ((machine().root_device().ioport("BUTTONS")->read() & 0x03) != 0)
{
- einstein->m_interrupt |= EINSTEIN_FIRE_INT;
+ m_interrupt |= EINSTEIN_FIRE_INT;
}
/* keyboard data changed? */
- if (einstein->m_keyboard_data != 0xff)
+ if (m_keyboard_data != 0xff)
{
/* generate interrupt */
- einstein->m_interrupt |= EINSTEIN_KEY_INT;
+ m_interrupt |= EINSTEIN_KEY_INT;
}
}
@@ -271,15 +269,13 @@ static WRITE8_DEVICE_HANDLER( einstein_drsel_w )
***************************************************************************/
/* channel 0 and 1 have a 2 MHz input clock for triggering */
-static TIMER_DEVICE_CALLBACK( einstein_ctc_trigger_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(einstein_state::einstein_ctc_trigger_callback)
{
- einstein_state *einstein = timer.machine().driver_data<einstein_state>();
-
/* toggle line status */
- einstein->m_ctc_trigger ^= 1;
+ m_ctc_trigger ^= 1;
- einstein->m_ctc->trg0(einstein->m_ctc_trigger);
- einstein->m_ctc->trg1(einstein->m_ctc_trigger);
+ m_ctc->trg0(m_ctc_trigger);
+ m_ctc->trg1(m_ctc_trigger);
}
@@ -777,13 +773,13 @@ static MACHINE_CONFIG_START( einstein, einstein_state )
/* this is actually clocked at the system clock 4 MHz, but this would be too fast for our
driver. So we update at 50Hz and hope this is good enough. */
- MCFG_TIMER_ADD_PERIODIC("keyboard", einstein_keyboard_timer_callback, attotime::from_hz(50))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", einstein_state, einstein_keyboard_timer_callback, attotime::from_hz(50))
MCFG_Z80PIO_ADD(IC_I063, XTAL_X002 / 2, einstein_pio_intf)
MCFG_Z80CTC_ADD(IC_I058, XTAL_X002 / 2, einstein_ctc_intf)
/* the input to channel 0 and 1 of the ctc is a 2 MHz clock */
- MCFG_TIMER_ADD_PERIODIC("ctc", einstein_ctc_trigger_callback, attotime::from_hz(XTAL_X002 /4))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", einstein_state, einstein_ctc_trigger_callback, attotime::from_hz(XTAL_X002 /4))
/* Einstein daisy chain support for non-Z80 devices */
MCFG_DEVICE_ADD("keyboard_daisy", EINSTEIN_KEYBOARD_DAISY, 0)
diff --git a/src/mess/drivers/fidelz80.c b/src/mess/drivers/fidelz80.c
index 8095c6d8ab3..170583b7d88 100644
--- a/src/mess/drivers/fidelz80.c
+++ b/src/mess/drivers/fidelz80.c
@@ -1008,9 +1008,9 @@ void fidelz80_state::machine_reset()
memset(m_digit_line_status, 0, sizeof(m_digit_line_status));
}
-static TIMER_DEVICE_CALLBACK( nmi_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(fidelz80_state::nmi_timer)
{
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
/******************************************************************************
@@ -1335,7 +1335,7 @@ static MACHINE_CONFIG_START( vsc, fidelz80_state )
MCFG_I8255_ADD("ppi8255", vsc_ppi8255_intf)
MCFG_Z80PIO_ADD("z80pio", XTAL_4MHz, vsc_z80pio_intf)
- MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_hz(600))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", fidelz80_state, nmi_timer, attotime::from_hz(600))
MCFG_TIMER_START_DELAY(attotime::from_hz(600))
/* sound hardware */
diff --git a/src/mess/drivers/huebler.c b/src/mess/drivers/huebler.c
index 25e83481911..076c2e9a57d 100644
--- a/src/mess/drivers/huebler.c
+++ b/src/mess/drivers/huebler.c
@@ -47,11 +47,9 @@ void amu880_state::scan_keyboard()
}
}
-static TIMER_DEVICE_CALLBACK( keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(amu880_state::keyboard_tick)
{
- amu880_state *state = timer.machine().driver_data<amu880_state>();
-
- state->scan_keyboard();
+ scan_keyboard();
}
/* Read/Write Handlers */
@@ -388,7 +386,7 @@ static MACHINE_CONFIG_START( amu880, amu880_state )
MCFG_CPU_IO_MAP(amu880_io)
MCFG_CPU_CONFIG(amu880_daisy_chain)
- MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_hz(1500))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", amu880_state, keyboard_tick, attotime::from_hz(1500))
/* video hardware */
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
diff --git a/src/mess/drivers/kc.c b/src/mess/drivers/kc.c
index 1a45facc9d0..279d3b84e25 100644
--- a/src/mess/drivers/kc.c
+++ b/src/mess/drivers/kc.c
@@ -140,7 +140,7 @@ static MACHINE_CONFIG_START( kc85_3, kc_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_28_37516MHz/2, 908, 0, 320, 312, 0, 256)
MCFG_SCREEN_UPDATE_DRIVER(kc_state, screen_update)
- MCFG_TIMER_ADD_SCANLINE("scantimer", kc_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kc_state, kc_scanline, "screen", 0, 1)
MCFG_PALETTE_LENGTH(KC85_PALETTE_SIZE)
MCFG_PALETTE_INIT_OVERRIDE(kc_state, kc85 )
@@ -192,7 +192,7 @@ static MACHINE_CONFIG_START( kc85_4, kc85_4_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_28_37516MHz/2, 908, 0, 320, 312, 0, 256)
MCFG_SCREEN_UPDATE_DRIVER(kc85_4_state, screen_update)
- MCFG_TIMER_ADD_SCANLINE("scantimer", kc_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kc85_4_state, kc_scanline, "screen", 0, 1)
MCFG_PALETTE_LENGTH(KC85_PALETTE_SIZE)
MCFG_PALETTE_INIT_OVERRIDE(kc85_4_state, kc85 )
diff --git a/src/mess/drivers/kyocera.c b/src/mess/drivers/kyocera.c
index 0b7c048e7a9..371f5d9d4bd 100644
--- a/src/mess/drivers/kyocera.c
+++ b/src/mess/drivers/kyocera.c
@@ -1287,13 +1287,11 @@ static I8085_CONFIG( kc85_i8085_config )
DEVCB_DEVICE_LINE(CASSETTE_TAG, kc85_sod_w) /* SOD changed callback (I8085A only) */
};
-static TIMER_DEVICE_CALLBACK( tandy200_tp_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(tandy200_state::tandy200_tp_tick)
{
- tandy200_state *state = timer.machine().driver_data<tandy200_state>();
+ m_maincpu->set_input_line(I8085_RST75_LINE, m_tp);
- state->m_maincpu->set_input_line(I8085_RST75_LINE, state->m_tp);
-
- state->m_tp = !state->m_tp;
+ m_tp = !m_tp;
}
static MACHINE_CONFIG_START( kc85, kc85_state )
@@ -1431,7 +1429,7 @@ static MACHINE_CONFIG_START( tandy200, tandy200_state )
MCFG_FRAGMENT_ADD(tandy200_video)
/* TP timer */
- MCFG_TIMER_ADD_PERIODIC("tp", tandy200_tp_tick, attotime::from_hz(XTAL_4_9152MHz/2/8192))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("tp", tandy200_state, tandy200_tp_tick, attotime::from_hz(XTAL_4_9152MHz/2/8192))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/mc1000.c b/src/mess/drivers/mc1000.c
index 8fdf0cc7424..2a206b6e811 100644
--- a/src/mess/drivers/mc1000.c
+++ b/src/mess/drivers/mc1000.c
@@ -409,14 +409,12 @@ void mc1000_state::machine_reset()
#define MC1000_NE555_FREQ (368) /* Hz */
#define MC1000_NE555_DUTY_CYCLE (99.745) /* % */
-static TIMER_DEVICE_CALLBACK( ne555_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(mc1000_state::ne555_tick)
{
- mc1000_state *state = timer.machine().driver_data<mc1000_state>();
-
// (m_ne555_int not needed anymore and can be done with?)
- state->m_ne555_int = param;
+ m_ne555_int = param;
- state->m_maincpu->set_input_line(INPUT_LINE_IRQ0, param);
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, param);
}
static const cassette_interface mc1000_cassette_interface =
@@ -444,10 +442,10 @@ static MACHINE_CONFIG_START( mc1000, mc1000_state )
MCFG_CPU_IO_MAP(mc1000_io)
/* timers */
- MCFG_TIMER_ADD_PERIODIC("ne555clear", ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ne555clear", mc1000_state, ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
MCFG_TIMER_PARAM(CLEAR_LINE)
- MCFG_TIMER_ADD_PERIODIC("ne555assert", ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ne555assert", mc1000_state, ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
MCFG_TIMER_START_DELAY(attotime::from_hz(MC1000_NE555_FREQ * 100 / MC1000_NE555_DUTY_CYCLE))
MCFG_TIMER_PARAM(ASSERT_LINE)
diff --git a/src/mess/drivers/mc80.c b/src/mess/drivers/mc80.c
index 063864ef27f..63da64bc3c9 100644
--- a/src/mess/drivers/mc80.c
+++ b/src/mess/drivers/mc80.c
@@ -134,16 +134,16 @@ static INPUT_PORTS_START( mc8030 )
INPUT_PORTS_END
-static TIMER_DEVICE_CALLBACK( mc8020_kbd )
+TIMER_DEVICE_CALLBACK_MEMBER(mc80_state::mc8020_kbd)
{
- device_t *cpu = timer.machine().device( "maincpu" );
+ device_t *cpu = machine().device( "maincpu" );
address_space &mem = cpu->memory().space(AS_PROGRAM);
char kbdrow[6];
UINT8 i;
for (i = 1; i < 8; i++)
{
sprintf(kbdrow,"X%X", i);
- mem.write_word(0xd20+i, timer.machine().root_device().ioport(kbdrow)->read());
+ mem.write_word(0xd20+i, machine().root_device().ioport(kbdrow)->read());
}
}
@@ -180,7 +180,7 @@ static MACHINE_CONFIG_START( mc8020, mc80_state )
/* Devices */
MCFG_Z80PIO_ADD( "z80pio", XTAL_2_4576MHz, mc8020_z80pio_intf )
MCFG_Z80CTC_ADD( "z80ctc", XTAL_2_4576MHz / 100, mc8020_ctc_intf )
- MCFG_TIMER_ADD_PERIODIC("mc8020_kbd", mc8020_kbd, attotime::from_hz(50)) // keyscanner
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("mc8020_kbd", mc80_state, mc8020_kbd, attotime::from_hz(50))
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( mc8030, mc80_state )
diff --git a/src/mess/drivers/mikromik.c b/src/mess/drivers/mikromik.c
index 3801e46ed2a..ec479735e1b 100644
--- a/src/mess/drivers/mikromik.c
+++ b/src/mess/drivers/mikromik.c
@@ -319,11 +319,9 @@ void mm1_state::scan_keyboard()
// TIMER_DEVICE_CALLBACK( kbclk_tick )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( kbclk_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(mm1_state::kbclk_tick)
{
- mm1_state *state = timer.machine().driver_data<mm1_state>();
-
- state->scan_keyboard();
+ scan_keyboard();
}
@@ -787,7 +785,7 @@ static MACHINE_CONFIG_START( mm1, mm1_state )
MCFG_CPU_PROGRAM_MAP(mm1_map)
MCFG_CPU_CONFIG(i8085_intf)
- MCFG_TIMER_ADD_PERIODIC("kbclk", kbclk_tick, attotime::from_hz(2500)) //attotime::from_hz(XTAL_6_144MHz/2/8))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("kbclk", mm1_state, kbclk_tick, attotime::from_hz(2500))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/mpf1.c b/src/mess/drivers/mpf1.c
index 34f380c583b..f666e37b906 100644
--- a/src/mess/drivers/mpf1.c
+++ b/src/mess/drivers/mpf1.c
@@ -333,14 +333,12 @@ static const tms5220_interface mpf1_tms5220_intf =
/* Machine Initialization */
-static TIMER_DEVICE_CALLBACK( check_halt_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(mpf1_state::check_halt_callback)
{
- mpf1_state *state = timer.machine().driver_data<mpf1_state>();
-
// halt-LED; the red one, is turned on when the processor is halted
// TODO: processor seems to halt, but restarts(?) at 0x0000 after a while -> fix
- INT64 led_halt = state->m_maincpu->state_int(Z80_HALT);
- set_led_status(timer.machine(), 1, led_halt);
+ INT64 led_halt = m_maincpu->state_int(Z80_HALT);
+ set_led_status(machine(), 1, led_halt);
}
void mpf1_state::machine_start()
@@ -382,7 +380,7 @@ static MACHINE_CONFIG_START( mpf1, mpf1_state )
MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("halt_timer", mpf1_state, check_halt_callback, attotime::from_hz(1))
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( mpf1b, mpf1_state )
@@ -410,7 +408,7 @@ static MACHINE_CONFIG_START( mpf1b, mpf1_state )
MCFG_SOUND_CONFIG(mpf1_tms5220_intf)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("halt_timer", mpf1_state, check_halt_callback, attotime::from_hz(1))
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( mpf1p, mpf1_state )
@@ -434,7 +432,7 @@ static MACHINE_CONFIG_START( mpf1p, mpf1_state )
MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("halt_timer", mpf1_state, check_halt_callback, attotime::from_hz(1))
MACHINE_CONFIG_END
/* ROMs */
diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c
index d7a71473d66..68aafd7c914 100644
--- a/src/mess/drivers/msx.c
+++ b/src/mess/drivers/msx.c
@@ -1148,7 +1148,7 @@ static MACHINE_CONFIG_START( msx2, msx_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_21_4772MHz/6) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(msx_memory_map)
MCFG_CPU_IO_MAP(msx2_io_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", msx2_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", msx_state, msx2_interrupt, "screen", 0, 1)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_MACHINE_START_OVERRIDE(msx_state, msx2 )
diff --git a/src/mess/drivers/mtx.c b/src/mess/drivers/mtx.c
index 79c2349ef28..3f5b2c46ba3 100644
--- a/src/mess/drivers/mtx.c
+++ b/src/mess/drivers/mtx.c
@@ -210,14 +210,12 @@ INPUT_PORTS_END
Z80CTC_INTERFACE( ctc_intf )
-------------------------------------------------*/
-static TIMER_DEVICE_CALLBACK( ctc_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(mtx_state::ctc_tick)
{
- mtx_state *state = timer.machine().driver_data<mtx_state>();
-
- state->m_z80ctc->trg1(1);
- state->m_z80ctc->trg1(0);
- state->m_z80ctc->trg2(1);
- state->m_z80ctc->trg2(0);
+ m_z80ctc->trg1(1);
+ m_z80ctc->trg1(0);
+ m_z80ctc->trg2(1);
+ m_z80ctc->trg2(0);
}
static WRITE_LINE_DEVICE_HANDLER( ctc_trg1_w )
@@ -302,12 +300,11 @@ static const z80_daisy_config rs128_daisy_chain[] =
cassette_interface mtx_cassette_interface
-------------------------------------------------*/
-static TIMER_DEVICE_CALLBACK( cassette_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(mtx_state::cassette_tick)
{
- mtx_state *state = timer.machine().driver_data<mtx_state>();
- int data = ((state->m_cassette)->input() > +0.0) ? 0 : 1;
+ int data = ((m_cassette)->input() > +0.0) ? 0 : 1;
- state->m_z80ctc->trg3(data);
+ m_z80ctc->trg3(data);
}
static const cassette_interface mtx_cassette_interface =
@@ -368,11 +365,11 @@ static MACHINE_CONFIG_START( mtx512, mtx_state )
/* devices */
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_4MHz, ctc_intf )
- MCFG_TIMER_ADD_PERIODIC("z80ctc_timer", ctc_tick, attotime::from_hz(XTAL_4MHz/13))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("z80ctc_timer", mtx_state, ctc_tick, attotime::from_hz(XTAL_4MHz/13))
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics)
MCFG_SNAPSHOT_ADD("snapshot", mtx, "mtb", 0.5)
MCFG_CASSETTE_ADD(CASSETTE_TAG, mtx_cassette_interface)
- MCFG_TIMER_ADD_PERIODIC("cassette_timer", cassette_tick, attotime::from_hz(44100))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", mtx_state, cassette_tick, attotime::from_hz(44100))
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/mz700.c b/src/mess/drivers/mz700.c
index 7295cba74d3..703f2eda03d 100644
--- a/src/mess/drivers/mz700.c
+++ b/src/mess/drivers/mz700.c
@@ -83,16 +83,14 @@
TIMER DEVICE CALLBACKS
***************************************************************************/
-static TIMER_DEVICE_CALLBACK( ne556_cursor_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(mz_state::ne556_cursor_callback)
{
- mz_state *mz = timer.machine().driver_data<mz_state>();
- mz->m_cursor_timer ^= 1;
+ m_cursor_timer ^= 1;
}
-static TIMER_DEVICE_CALLBACK( ne556_other_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(mz_state::ne556_other_callback)
{
- mz_state *mz = timer.machine().driver_data<mz_state>();
- mz->m_other_timer ^= 1;
+ m_other_timer ^= 1;
}
@@ -370,8 +368,8 @@ static MACHINE_CONFIG_START( mz700, mz_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* ne556 timers */
- MCFG_TIMER_ADD_PERIODIC("cursor", ne556_cursor_callback, attotime::from_hz(1.5))
- MCFG_TIMER_ADD_PERIODIC("other", ne556_other_callback, attotime::from_hz(34.5))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("cursor", mz_state, ne556_cursor_callback, attotime::from_hz(1.5))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("other", mz_state, ne556_other_callback, attotime::from_hz(34.5))
/* devices */
MCFG_PIT8253_ADD("pit8253", mz700_pit8253_config)
diff --git a/src/mess/drivers/mz80.c b/src/mess/drivers/mz80.c
index dafbb2277a5..9e2df894041 100644
--- a/src/mess/drivers/mz80.c
+++ b/src/mess/drivers/mz80.c
@@ -269,10 +269,9 @@ static const cassette_interface mz80k_cassette_interface =
NULL
};
-static TIMER_DEVICE_CALLBACK( ne555_tempo_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(mz80_state::ne555_tempo_callback)
{
- mz80_state *state = timer.machine().driver_data<mz80_state>();
- state->m_mz80k_tempo_strobe ^= 1;
+ m_mz80k_tempo_strobe ^= 1;
}
static MACHINE_CONFIG_START( mz80k, mz80_state )
@@ -304,7 +303,7 @@ static MACHINE_CONFIG_START( mz80k, mz80_state )
/* Devices */
MCFG_I8255_ADD( "ppi8255", mz80k_8255_int )
MCFG_PIT8253_ADD( "pit8253", mz80k_pit8253_config )
- MCFG_TIMER_ADD_PERIODIC("tempo", ne555_tempo_callback, attotime::from_hz(34)) // 33.5Hz - 34.3Hz
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("tempo", mz80_state, ne555_tempo_callback, attotime::from_hz(34))
MCFG_CASSETTE_ADD( CASSETTE_TAG, mz80k_cassette_interface )
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c
index 917cc466d53..2bcdfb25aca 100644
--- a/src/mess/drivers/nc.c
+++ b/src/mess/drivers/nc.c
@@ -492,15 +492,14 @@ static void nc_common_close_stream(running_machine &machine)
-static TIMER_DEVICE_CALLBACK(dummy_timer_callback)
+TIMER_DEVICE_CALLBACK_MEMBER(nc_state::dummy_timer_callback)
{
- nc_state *state = timer.machine().driver_data<nc_state>();
int inputport_10_state;
int changed_bits;
- inputport_10_state = timer.machine().root_device().ioport("EXTRA")->read();
+ inputport_10_state = machine().root_device().ioport("EXTRA")->read();
- changed_bits = inputport_10_state^state->m_previous_inputport_10_state;
+ changed_bits = inputport_10_state^m_previous_inputport_10_state;
/* on/off button changed state? */
if (changed_bits & 0x01)
@@ -509,19 +508,19 @@ static TIMER_DEVICE_CALLBACK(dummy_timer_callback)
{
/* on NC100 on/off button causes a nmi, on
nc200 on/off button causes an int */
- switch (state->m_type)
+ switch (m_type)
{
case NC_TYPE_1xx:
{
LOG(("nmi triggered\n"));
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
break;
case NC_TYPE_200:
{
- state->m_irq_status |= (1 << 4);
- nc_update_interrupts(timer.machine());
+ m_irq_status |= (1 << 4);
+ nc_update_interrupts(machine());
}
break;
}
@@ -532,10 +531,10 @@ static TIMER_DEVICE_CALLBACK(dummy_timer_callback)
if (changed_bits & 0x02)
{
/* yes refresh memory config */
- nc_refresh_memory_config(timer.machine());
+ nc_refresh_memory_config(machine());
}
- state->m_previous_inputport_10_state = inputport_10_state;
+ m_previous_inputport_10_state = inputport_10_state;
}
@@ -1640,7 +1639,7 @@ static MACHINE_CONFIG_START( nc100, nc_state )
MCFG_RAM_DEFAULT_SIZE("64K")
/* dummy timer */
- MCFG_TIMER_ADD_PERIODIC("dummy_timer", dummy_timer_callback, attotime::from_hz(50))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("dummy_timer", nc_state, dummy_timer_callback, attotime::from_hz(50))
MACHINE_CONFIG_END
static const floppy_interface nc200_floppy_interface =
diff --git a/src/mess/drivers/newbrain.c b/src/mess/drivers/newbrain.c
index 8dac24e0c8b..423b973f484 100644
--- a/src/mess/drivers/newbrain.c
+++ b/src/mess/drivers/newbrain.c
@@ -730,15 +730,13 @@ WRITE8_MEMBER( newbrain_state::cop_w )
}
}
-static TIMER_DEVICE_CALLBACK( cop_regint_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(newbrain_state::cop_regint_tick)
{
- newbrain_state *state = timer.machine().driver_data<newbrain_state>();
-
- if (state->m_copregint)
+ if (m_copregint)
{
logerror("COP REGINT\n");
- state->m_copint = 0;
- state->check_interrupt();
+ m_copint = 0;
+ check_interrupt();
}
}
@@ -1226,12 +1224,10 @@ static Z80CTC_INTERFACE( newbrain_ctc_intf )
DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, ctc_z2_w) /* ZC/TO2 callback */
};
-static TIMER_DEVICE_CALLBACK( ctc_c2_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(newbrain_eim_state::ctc_c2_tick)
{
- newbrain_eim_state *state = timer.machine().driver_data<newbrain_eim_state>();
-
- state->m_ctc->trg2(1);
- state->m_ctc->trg2(0);
+ m_ctc->trg2(1);
+ m_ctc->trg2(0);
}
inline int newbrain_state::get_reset_t()
@@ -1388,7 +1384,7 @@ static MACHINE_CONFIG_START( newbrain_a, newbrain_state )
MCFG_GFXDECODE(newbrain)
- MCFG_TIMER_ADD_PERIODIC("cop_regint", cop_regint_tick, attotime::from_usec(12500)) // HACK
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("cop_regint", newbrain_state, cop_regint_tick, attotime::from_usec(12500))
// video hardware
MCFG_FRAGMENT_ADD(newbrain_video)
@@ -1430,7 +1426,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( newbrain_eim, newbrain_a, newbrain_eim_stat
// devices
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/8, newbrain_ctc_intf)
- MCFG_TIMER_ADD_PERIODIC("z80ctc_c2", ctc_c2_tick, attotime::from_hz(XTAL_16MHz/4/13))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("z80ctc_c2", newbrain_eim_state, ctc_c2_tick, attotime::from_hz(XTAL_16MHz/4/13))
MCFG_ADC0808_ADD(ADC0809_TAG, 500000, adc_intf)
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
diff --git a/src/mess/drivers/pc.c b/src/mess/drivers/pc.c
index 8f6d77e9442..640d03f9b11 100644
--- a/src/mess/drivers/pc.c
+++ b/src/mess/drivers/pc.c
@@ -878,7 +878,7 @@ SLOT_INTERFACE_END
MCFG_CPU_ADD("maincpu", type, clock) \
MCFG_CPU_PROGRAM_MAP(mem##_map) \
MCFG_CPU_IO_MAP(port##_io) \
- MCFG_TIMER_ADD_SCANLINE("scantimer", vblankfunc, "screen", 0, 1) \
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, vblankfunc, "screen", 0, 1) \
MCFG_CPU_CONFIG(i86_address_mask)
diff --git a/src/mess/drivers/pc8401a.c b/src/mess/drivers/pc8401a.c
index 787c49a9e7e..c5f9569df64 100644
--- a/src/mess/drivers/pc8401a.c
+++ b/src/mess/drivers/pc8401a.c
@@ -61,11 +61,9 @@ void pc8401a_state::scan_keyboard()
if (strobe) m_key_strobe = strobe;
}
-static TIMER_DEVICE_CALLBACK( pc8401a_keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(pc8401a_state::pc8401a_keyboard_tick)
{
- pc8401a_state *state = timer.machine().driver_data<pc8401a_state>();
-
- state->scan_keyboard();
+ scan_keyboard();
}
/* Read/Write Handlers */
@@ -602,7 +600,7 @@ static MACHINE_CONFIG_START( pc8401a, pc8401a_state )
MCFG_CPU_IO_MAP(pc8401a_io)
/* fake keyboard */
- MCFG_TIMER_ADD_PERIODIC("keyboard", pc8401a_keyboard_tick, attotime::from_hz(64))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", pc8401a_state, pc8401a_keyboard_tick, attotime::from_hz(64))
/* devices */
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, rtc_intf)
@@ -635,7 +633,7 @@ static MACHINE_CONFIG_START( pc8500, pc8500_state )
MCFG_CPU_IO_MAP(pc8500_io)
/* fake keyboard */
- MCFG_TIMER_ADD_PERIODIC("keyboard", pc8401a_keyboard_tick, attotime::from_hz(64))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", pc8401a_state, pc8401a_keyboard_tick, attotime::from_hz(64))
/* devices */
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, rtc_intf)
diff --git a/src/mess/drivers/pcw.c b/src/mess/drivers/pcw.c
index 9e87a8e38ea..eda727056c9 100644
--- a/src/mess/drivers/pcw.c
+++ b/src/mess/drivers/pcw.c
@@ -169,14 +169,13 @@ TIMER_CALLBACK_MEMBER(pcw_state::pcw_timer_pulse)
}
/* callback for 1/300ths of a second interrupt */
-static TIMER_DEVICE_CALLBACK(pcw_timer_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(pcw_state::pcw_timer_interrupt)
{
- pcw_state *state = timer.machine().driver_data<pcw_state>();
- pcw_update_interrupt_counter(state);
+ pcw_update_interrupt_counter(this);
- state->m_timer_irq_flag = 1;
- pcw_update_irqs(timer.machine());
- timer.machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse),state));
+ m_timer_irq_flag = 1;
+ pcw_update_irqs(machine());
+ machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse),this));
}
/* fdc interrupt callback. set/clear fdc int */
@@ -1347,7 +1346,7 @@ static MACHINE_CONFIG_START( pcw, pcw_state )
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("256K")
- MCFG_TIMER_ADD_PERIODIC("pcw_timer", pcw_timer_interrupt, attotime::from_hz(300))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("pcw_timer", pcw_state, pcw_timer_interrupt, attotime::from_hz(300))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pcw8256, pcw )
diff --git a/src/mess/drivers/pcw16.c b/src/mess/drivers/pcw16.c
index 3f0e0dac3f8..4e9688cdc3c 100644
--- a/src/mess/drivers/pcw16.c
+++ b/src/mess/drivers/pcw16.c
@@ -134,20 +134,19 @@ void pcw16_state::pcw16_refresh_ints()
}
-static TIMER_DEVICE_CALLBACK(pcw16_timer_callback)
+TIMER_DEVICE_CALLBACK_MEMBER(pcw16_state::pcw16_timer_callback)
{
- pcw16_state *state = timer.machine().driver_data<pcw16_state>();
/* do not increment past 15 */
- if (state->m_interrupt_counter!=15)
+ if (m_interrupt_counter!=15)
{
- state->m_interrupt_counter++;
+ m_interrupt_counter++;
/* display int */
- state->m_system_status |= (1<<0);
+ m_system_status |= (1<<0);
}
- if (state->m_interrupt_counter!=0)
+ if (m_interrupt_counter!=0)
{
- state->pcw16_refresh_ints();
+ pcw16_refresh_ints();
}
}
@@ -878,11 +877,10 @@ WRITE8_MEMBER(pcw16_state::pcw16_keyboard_control_w)
}
-static TIMER_DEVICE_CALLBACK(pcw16_keyboard_timer_callback)
+TIMER_DEVICE_CALLBACK_MEMBER(pcw16_state::pcw16_keyboard_timer_callback)
{
- pcw16_state *state = timer.machine().driver_data<pcw16_state>();
at_keyboard_polling();
- if (state->pcw16_keyboard_can_transmit())
+ if (pcw16_keyboard_can_transmit())
{
int data;
@@ -895,11 +893,11 @@ static TIMER_DEVICE_CALLBACK(pcw16_keyboard_timer_callback)
// pcw16_dump_cpu_ram();
// }
- state->pcw16_keyboard_signal_byte_received(data);
+ pcw16_keyboard_signal_byte_received(data);
}
}
// TODO: fix
- state->subdevice<ns16550_device>("ns16550_2")->ri_w((timer.machine().root_device().ioport("EXTRA")->read() & 0x040) ? 0 : 1);
+ subdevice<ns16550_device>("ns16550_2")->ri_w((machine().root_device().ioport("EXTRA")->read() & 0x040) ? 0 : 1);
}
@@ -938,58 +936,57 @@ void pcw16_state::rtc_setup_max_days()
}
}
-static TIMER_DEVICE_CALLBACK(rtc_timer_callback)
+TIMER_DEVICE_CALLBACK_MEMBER(pcw16_state::rtc_timer_callback)
{
- pcw16_state *state = timer.machine().driver_data<pcw16_state>();
int fraction_of_second;
/* halt counter? */
- if ((state->m_rtc_control & 0x01)!=0)
+ if ((m_rtc_control & 0x01)!=0)
{
/* no */
/* increment 256th's of a second register */
- fraction_of_second = state->m_rtc_256ths_seconds+1;
+ fraction_of_second = m_rtc_256ths_seconds+1;
/* add bit 8 = overflow */
- state->m_rtc_seconds+=(fraction_of_second>>8);
+ m_rtc_seconds+=(fraction_of_second>>8);
/* ensure counter is in range 0-255 */
- state->m_rtc_256ths_seconds = fraction_of_second & 0x0ff;
+ m_rtc_256ths_seconds = fraction_of_second & 0x0ff;
}
- if (state->m_rtc_seconds>59)
+ if (m_rtc_seconds>59)
{
- state->m_rtc_seconds = 0;
+ m_rtc_seconds = 0;
- state->m_rtc_minutes++;
+ m_rtc_minutes++;
- if (state->m_rtc_minutes>59)
+ if (m_rtc_minutes>59)
{
- state->m_rtc_minutes = 0;
+ m_rtc_minutes = 0;
- state->m_rtc_hours++;
+ m_rtc_hours++;
- if (state->m_rtc_hours>23)
+ if (m_rtc_hours>23)
{
- state->m_rtc_hours = 0;
+ m_rtc_hours = 0;
- state->m_rtc_days++;
+ m_rtc_days++;
- if (state->m_rtc_days > state->m_rtc_days_max)
+ if (m_rtc_days > m_rtc_days_max)
{
- state->m_rtc_days = 1;
+ m_rtc_days = 1;
- state->m_rtc_months++;
+ m_rtc_months++;
- if (state->m_rtc_months>12)
+ if (m_rtc_months>12)
{
- state->m_rtc_months = 1;
+ m_rtc_months = 1;
/* 7 bit year counter */
- state->m_rtc_years = (state->m_rtc_years + 1) & 0x07f;
+ m_rtc_years = (m_rtc_years + 1) & 0x07f;
}
- state->rtc_setup_max_days();
+ rtc_setup_max_days();
}
}
@@ -1512,11 +1509,11 @@ static MACHINE_CONFIG_START( pcw16, pcw16_state )
MCFG_INTEL_E28F008SA_ADD("flash1")
/* video ints */
- MCFG_TIMER_ADD_PERIODIC("video_timer", pcw16_timer_callback, attotime::from_usec(5830))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("video_timer", pcw16_state, pcw16_timer_callback, attotime::from_usec(5830))
/* rtc timer */
- MCFG_TIMER_ADD_PERIODIC("rtc_timer", rtc_timer_callback, attotime::from_hz(256))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("rtc_timer", pcw16_state, rtc_timer_callback, attotime::from_hz(256))
/* keyboard timer */
- MCFG_TIMER_ADD_PERIODIC("keyboard_timer", pcw16_keyboard_timer_callback, attotime::from_hz(50))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", pcw16_state, pcw16_keyboard_timer_callback, attotime::from_hz(50))
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c
index cc174efa0ab..35b771ea841 100644
--- a/src/mess/drivers/portfoli.c
+++ b/src/mess/drivers/portfoli.c
@@ -247,11 +247,9 @@ void portfolio_state::scan_keyboard()
// TIMER_DEVICE_CALLBACK( keyboard_tick )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::keyboard_tick)
{
- portfolio_state *state = timer.machine().driver_data<portfolio_state>();
-
- state->scan_keyboard();
+ scan_keyboard();
}
//-------------------------------------------------
@@ -370,22 +368,18 @@ WRITE8_MEMBER( portfolio_state::unknown_w )
// TIMER_DEVICE_CALLBACK( system_tick )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( system_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::system_tick)
{
- portfolio_state *state = timer.machine().driver_data<portfolio_state>();
-
- state->trigger_interrupt(INT_TICK);
+ trigger_interrupt(INT_TICK);
}
//-------------------------------------------------
// TIMER_DEVICE_CALLBACK( counter_tick )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( counter_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick)
{
- portfolio_state *state = timer.machine().driver_data<portfolio_state>();
-
- state->m_counter++;
+ m_counter++;
}
//-------------------------------------------------
@@ -859,11 +853,11 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
MCFG_I8255A_ADD(M82C55A_TAG, ppi_intf)
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf)
MCFG_INS8250_ADD(M82C50A_TAG, i8250_intf, XTAL_1_8432MHz) // should be MCFG_INS8250A_ADD
- MCFG_TIMER_ADD_PERIODIC("counter", counter_tick, attotime::from_hz(XTAL_32_768kHz/16384))
- MCFG_TIMER_ADD_PERIODIC(TIMER_TICK_TAG, system_tick, attotime::from_hz(XTAL_32_768kHz/32768))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("counter", portfolio_state, counter_tick, attotime::from_hz(XTAL_32_768kHz/16384))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_TICK_TAG, portfolio_state, system_tick, attotime::from_hz(XTAL_32_768kHz/32768))
/* fake keyboard */
- MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_usec(2500))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", portfolio_state, keyboard_tick, attotime::from_usec(2500))
/* cartridge */
MCFG_CARTSLOT_ADD("cart")
diff --git a/src/mess/drivers/psion.c b/src/mess/drivers/psion.c
index ffa18a93200..571e8027fc7 100644
--- a/src/mess/drivers/psion.c
+++ b/src/mess/drivers/psion.c
@@ -22,12 +22,10 @@
#include "includes/psion.h"
#include "rendlay.h"
-static TIMER_DEVICE_CALLBACK( nmi_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(psion_state::nmi_timer)
{
- psion_state *state = timer.machine().driver_data<psion_state>();
-
- if (state->m_enable_nmi)
- timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_enable_nmi)
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
UINT8 psion_state::kb_read(running_machine &machine)
@@ -492,7 +490,7 @@ static MACHINE_CONFIG_START( psion_2lines, psion_state )
MCFG_NVRAM_HANDLER(psion)
- MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_seconds(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", psion_state, nmi_timer, attotime::from_seconds(1))
/* Datapack */
MCFG_PSION_DATAPACK_ADD("pack1")
diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c
index 17134bcef80..b23c591590c 100644
--- a/src/mess/drivers/super6.c
+++ b/src/mess/drivers/super6.c
@@ -349,12 +349,10 @@ INPUT_PORTS_END
// Z80CTC_INTERFACE( ctc_intf )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( ctc_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(super6_state::ctc_tick)
{
- super6_state *state = timer.machine().driver_data<super6_state>();
-
- state->m_ctc->trg0(1);
- state->m_ctc->trg0(0);
+ m_ctc->trg0(1);
+ m_ctc->trg0(0);
}
static Z80CTC_INTERFACE( ctc_intf )
@@ -570,7 +568,7 @@ static MACHINE_CONFIG_START( super6, super6_state )
// devices
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_24MHz/4, ctc_intf)
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_24MHz/16))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", super6_state, ctc_tick, attotime::from_hz(XTAL_24MHz/16))
MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_24MHz/4, dart_intf)
MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_24MHz/6, dma_intf)
MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_24MHz/4, pio_intf)
diff --git a/src/mess/drivers/svision.c b/src/mess/drivers/svision.c
index b6060605ec6..51cfffbe875 100644
--- a/src/mess/drivers/svision.c
+++ b/src/mess/drivers/svision.c
@@ -50,10 +50,9 @@ TIMER_CALLBACK_MEMBER(svision_state::svision_pet_timer)
}
}
-static TIMER_DEVICE_CALLBACK(svision_pet_timer_dev)
+TIMER_DEVICE_CALLBACK_MEMBER(svision_state::svision_pet_timer_dev)
{
- svision_state *state = timer.machine().driver_data<svision_state>();
- state->svision_pet_timer(ptr,param);
+ svision_pet_timer(ptr,param);
}
void svision_irq(running_machine &machine)
@@ -544,7 +543,7 @@ static MACHINE_CONFIG_START( svision, svision_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( svisions, svision )
- MCFG_TIMER_ADD_PERIODIC("pet_timer", svision_pet_timer_dev, attotime::from_seconds(8) * 256/4000000)
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("pet_timer", svision_state, svision_pet_timer_dev, attotime::from_seconds(8))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( svisionp, svision )
diff --git a/src/mess/drivers/tek405x.c b/src/mess/drivers/tek405x.c
index b7936225b87..856053645a0 100644
--- a/src/mess/drivers/tek405x.c
+++ b/src/mess/drivers/tek405x.c
@@ -98,11 +98,9 @@ void tek4051_state::scan_keyboard()
// TIMER_DEVICE_CALLBACK( keyboard_tick )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(tek4051_state::keyboard_tick)
{
- tek4051_state *state = timer.machine().driver_data<tek4051_state>();
-
- state->scan_keyboard();
+ scan_keyboard();
}
@@ -1230,7 +1228,7 @@ static MACHINE_CONFIG_START( tek4051, tek4051_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
- MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_hz(XTAL_12_5MHz/15/4))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", tek4051_state, keyboard_tick, attotime::from_hz(XTAL_12_5MHz/15/4))
MCFG_PIA6821_ADD(MC6820_X_TAG, x_pia_intf)
MCFG_PIA6821_ADD(MC6820_Y_TAG, y_pia_intf)
MCFG_PIA6821_ADD(MC6820_KB_TAG, kb_pia_intf)
diff --git a/src/mess/drivers/ti89.c b/src/mess/drivers/ti89.c
index c0a9ae2cc33..858328dce76 100644
--- a/src/mess/drivers/ti89.c
+++ b/src/mess/drivers/ti89.c
@@ -152,37 +152,35 @@ READ16_MEMBER ( ti68k_state::flash_r )
}
-static TIMER_DEVICE_CALLBACK( ti68k_timer_callback )
+TIMER_DEVICE_CALLBACK_MEMBER(ti68k_state::ti68k_timer_callback)
{
- ti68k_state *state = timer.machine().driver_data<ti68k_state>();
+ m_timer++;
- state->m_timer++;
-
- if (state->m_timer_on)
+ if (m_timer_on)
{
- if (!(state->m_timer & state->m_timer_mask) && BIT(state->m_io_hw1[0x0a], 3))
+ if (!(m_timer & m_timer_mask) && BIT(m_io_hw1[0x0a], 3))
{
- if (state->m_timer_val)
- state->m_timer_val++;
+ if (m_timer_val)
+ m_timer_val++;
else
- state->m_timer_val = (state->m_io_hw1[0x0b]) & 0xff;
+ m_timer_val = (m_io_hw1[0x0b]) & 0xff;
}
- if (!BIT(state->m_io_hw1[0x0a], 7) && ((state->m_hw_version == state->m_HW1) || (!BIT(state->m_io_hw1[0x0f], 2) && !BIT(state->m_io_hw1[0x0f], 1))))
+ if (!BIT(m_io_hw1[0x0a], 7) && ((m_hw_version == m_HW1) || (!BIT(m_io_hw1[0x0f], 2) && !BIT(m_io_hw1[0x0f], 1))))
{
- if (!(state->m_timer & 0x003f))
- state->m_maincpu->set_input_line(M68K_IRQ_1, HOLD_LINE);
+ if (!(m_timer & 0x003f))
+ m_maincpu->set_input_line(M68K_IRQ_1, HOLD_LINE);
- if (!(state->m_timer & 0x3fff) && !BIT(state->m_io_hw1[0x0a], 3))
- state->m_maincpu->set_input_line(M68K_IRQ_3, HOLD_LINE);
+ if (!(m_timer & 0x3fff) && !BIT(m_io_hw1[0x0a], 3))
+ m_maincpu->set_input_line(M68K_IRQ_3, HOLD_LINE);
- if (!(state->m_timer & state->m_timer_mask) && BIT(state->m_io_hw1[0x0a], 3) && state->m_timer_val == 0)
- state->m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
+ if (!(m_timer & m_timer_mask) && BIT(m_io_hw1[0x0a], 3) && m_timer_val == 0)
+ m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
}
}
- if (state->keypad_r(timer.machine()) != 0xff)
- state->m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
+ if (keypad_r(machine()) != 0xff)
+ m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
}
@@ -526,7 +524,7 @@ static MACHINE_CONFIG_START( ti89, ti68k_state )
MCFG_SHARP_UNK128MBIT_ADD("flash") //should be LH28F320 for ti89t and v200 and LH28F160S3T for other models
- MCFG_TIMER_ADD_PERIODIC("ti68k_timer", ti68k_timer_callback, attotime::from_hz(1<<14))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ti68k_timer", ti68k_state, ti68k_timer_callback, attotime::from_hz(1<<14))
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/tiki100.c b/src/mess/drivers/tiki100.c
index a1a4e1fdbbe..732411c2b61 100644
--- a/src/mess/drivers/tiki100.c
+++ b/src/mess/drivers/tiki100.c
@@ -483,15 +483,13 @@ static Z80PIO_INTERFACE( pio_intf )
/* Z80-CTC Interface */
-static TIMER_DEVICE_CALLBACK( ctc_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(tiki100_state::ctc_tick)
{
- tiki100_state *state = timer.machine().driver_data<tiki100_state>();
+ m_ctc->trg0(1);
+ m_ctc->trg0(0);
- state->m_ctc->trg0(1);
- state->m_ctc->trg0(0);
-
- state->m_ctc->trg1(1);
- state->m_ctc->trg1(0);
+ m_ctc->trg1(1);
+ m_ctc->trg1(0);
}
WRITE_LINE_MEMBER( tiki100_state::ctc_z1_w )
@@ -639,7 +637,7 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state )
MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_8MHz/4, dart_intf)
MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/4, pio_intf)
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/4, ctc_intf)
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_8MHz/4))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", tiki100_state, ctc_tick, attotime::from_hz(XTAL_8MHz/4))
MCFG_FD1797_ADD(FD1797_TAG, fdc_intf) // FD1767PL-02 or FD1797-PL
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tiki100_floppy_interface)
diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c
index 390d1470554..de616bdd34b 100644
--- a/src/mess/drivers/trs80m2.c
+++ b/src/mess/drivers/trs80m2.c
@@ -109,11 +109,9 @@ void trs80m2_state::scan_keyboard()
}
}
-static TIMER_DEVICE_CALLBACK( trs80m2_keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(trs80m2_state::trs80m2_keyboard_tick)
{
- trs80m2_state *state = timer.machine().driver_data<trs80m2_state>();
-
- state->scan_keyboard();
+ scan_keyboard();
}
@@ -833,18 +831,16 @@ static Z80DART_INTERFACE( sio_intf )
// Z80CTC_INTERFACE( ctc_intf )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( ctc_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(trs80m2_state::ctc_tick)
{
- trs80m2_state *state = timer.machine().driver_data<trs80m2_state>();
-
- state->m_ctc->trg0(1);
- state->m_ctc->trg0(0);
+ m_ctc->trg0(1);
+ m_ctc->trg0(0);
- state->m_ctc->trg1(1);
- state->m_ctc->trg1(0);
+ m_ctc->trg1(1);
+ m_ctc->trg1(0);
- state->m_ctc->trg2(1);
- state->m_ctc->trg2(0);
+ m_ctc->trg2(1);
+ m_ctc->trg2(0);
}
static Z80CTC_INTERFACE( ctc_intf )
@@ -1016,7 +1012,7 @@ static MACHINE_CONFIG_START( trs80m2, trs80m2_state )
// devices
MCFG_FD1791_ADD(FD1791_TAG, fdc_intf)
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/2, ctc_intf)
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", trs80m2_state, ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_8MHz/2, dma_intf)
MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/2, pio_intf)
MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_8MHz/2, sio_intf)
@@ -1024,7 +1020,7 @@ static MACHINE_CONFIG_START( trs80m2, trs80m2_state )
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, trs80m2_floppy_interface)
MCFG_TRS80M2_KEYBOARD_ADD(kb_intf)
- MCFG_TIMER_ADD_PERIODIC("keyboard", trs80m2_keyboard_tick,attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", trs80m2_state, trs80m2_keyboard_tick, attotime::from_hz(60))
// internal RAM
MCFG_RAM_ADD(RAM_TAG)
@@ -1067,7 +1063,7 @@ static MACHINE_CONFIG_START( trs80m16, trs80m16_state )
// devices
MCFG_FD1791_ADD(FD1791_TAG, fdc_intf)
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/2, ctc_intf)
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", trs80m2_state, ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_8MHz/2, dma_intf)
MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/2, pio_intf)
MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_8MHz/2, sio_intf)
@@ -1076,7 +1072,7 @@ static MACHINE_CONFIG_START( trs80m16, trs80m16_state )
MCFG_PIC8259_ADD(AM9519A_TAG, pic_intf)
MCFG_TRS80M2_KEYBOARD_ADD(kb_intf)
- MCFG_TIMER_ADD_PERIODIC("keyboard", trs80m2_keyboard_tick,attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", trs80m2_state, trs80m2_keyboard_tick, attotime::from_hz(60))
// internal RAM
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c
index e053eb2fcbb..c9e3f10019b 100644
--- a/src/mess/drivers/v1050.c
+++ b/src/mess/drivers/v1050.c
@@ -272,11 +272,9 @@ void v1050_state::scan_keyboard()
m_keydata = keydata;
}
-static TIMER_DEVICE_CALLBACK( v1050_keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::v1050_keyboard_tick)
{
- v1050_state *state = timer.machine().driver_data<v1050_state>();
-
- state->scan_keyboard();
+ scan_keyboard();
}
READ8_MEMBER( v1050_state::kb_data_r )
@@ -374,18 +372,14 @@ READ8_MEMBER( v1050_state::sasi_status_r )
return data;
}
-static TIMER_DEVICE_CALLBACK( sasi_ack_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_ack_tick)
{
- v1050_state *state = timer.machine().driver_data<v1050_state>();
-
- state->m_sasibus->scsi_ack_w(1);
+ m_sasibus->scsi_ack_w(1);
}
-static TIMER_DEVICE_CALLBACK( sasi_rst_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_rst_tick)
{
- v1050_state *state = timer.machine().driver_data<v1050_state>();
-
- state->m_sasibus->scsi_rst_w(1);
+ m_sasibus->scsi_rst_w(1);
}
WRITE8_MEMBER( v1050_state::sasi_ctrl_w )
@@ -867,12 +861,10 @@ static I8255A_INTERFACE( rtc_ppi_intf )
// Keyboard 8251A Interface
-static TIMER_DEVICE_CALLBACK( kb_8251_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::kb_8251_tick)
{
- v1050_state *state = timer.machine().driver_data<v1050_state>();
-
- state->m_uart_kb->transmit_clock();
- state->m_uart_kb->receive_clock();
+ m_uart_kb->transmit_clock();
+ m_uart_kb->receive_clock();
}
WRITE_LINE_MEMBER( v1050_state::kb_rxrdy_w )
@@ -895,12 +887,10 @@ static const i8251_interface kb_8251_intf =
// Serial 8251A Interface
-static TIMER_DEVICE_CALLBACK( sio_8251_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sio_8251_tick)
{
- v1050_state *state = timer.machine().driver_data<v1050_state>();
-
- state->m_uart_sio->transmit_clock();
- state->m_uart_sio->receive_clock();
+ m_uart_sio->transmit_clock();
+ m_uart_sio->receive_clock();
}
WRITE_LINE_MEMBER( v1050_state::sio_rxrdy_w )
@@ -1090,7 +1080,7 @@ static MACHINE_CONFIG_START( v1050, v1050_state )
MCFG_QUANTUM_PERFECT_CPU(M6502_TAG)
// keyboard HACK
- MCFG_TIMER_ADD_PERIODIC("keyboard", v1050_keyboard_tick, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", v1050_state, v1050_keyboard_tick, attotime::from_hz(60))
// video hardware
MCFG_FRAGMENT_ADD(v1050_video)
@@ -1106,16 +1096,16 @@ static MACHINE_CONFIG_START( v1050, v1050_state )
MCFG_I8251_ADD(I8251A_SIO_TAG, /*XTAL_16MHz/8,*/ sio_8251_intf)
MCFG_MB8877_ADD(MB8877_TAG, /*XTAL_16MHz/16,*/ fdc_intf )
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(v1050_floppy_interface)
- MCFG_TIMER_ADD_PERIODIC(TIMER_KB_TAG, kb_8251_tick, attotime::from_hz((double)XTAL_16MHz/4/13/8))
- MCFG_TIMER_ADD(TIMER_SIO_TAG, sio_8251_tick)
+ MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_KB_TAG, v1050_state, kb_8251_tick, attotime::from_hz((double)XTAL_16MHz/4/13/8))
+ MCFG_TIMER_DRIVER_ADD(TIMER_SIO_TAG, v1050_state, sio_8251_tick)
// SASI bus
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
MCFG_SCSICB_ADD(SASIBUS_TAG ":host", sasi_intf)
- MCFG_TIMER_ADD(TIMER_ACK_TAG, sasi_ack_tick)
- MCFG_TIMER_ADD(TIMER_RST_TAG, sasi_rst_tick)
+ MCFG_TIMER_DRIVER_ADD(TIMER_ACK_TAG, v1050_state, sasi_ack_tick)
+ MCFG_TIMER_DRIVER_ADD(TIMER_RST_TAG, v1050_state, sasi_rst_tick)
// keyboard
MCFG_V1050_KEYBOARD_ADD()
diff --git a/src/mess/drivers/vcs80.c b/src/mess/drivers/vcs80.c
index 916c6fb5165..4ccdc656ec3 100644
--- a/src/mess/drivers/vcs80.c
+++ b/src/mess/drivers/vcs80.c
@@ -108,19 +108,17 @@ INPUT_PORTS_END
/* Z80-PIO Interface */
-static TIMER_DEVICE_CALLBACK( vcs80_keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(vcs80_state::vcs80_keyboard_tick)
{
- vcs80_state *state = timer.machine().driver_data<vcs80_state>();
-
- if (state->m_keyclk)
+ if (m_keyclk)
{
- state->m_keylatch++;
- state->m_keylatch &= 7;
+ m_keylatch++;
+ m_keylatch &= 7;
}
- state->m_pio->port_a_write(state->m_keyclk << 7);
+ m_pio->port_a_write(m_keyclk << 7);
- state->m_keyclk = !state->m_keyclk;
+ m_keyclk = !m_keyclk;
}
READ8_MEMBER( vcs80_state::pio_pa_r )
@@ -223,7 +221,7 @@ static MACHINE_CONFIG_START( vcs80, vcs80_state )
MCFG_CPU_CONFIG(vcs80_daisy_chain)
/* keyboard timer */
- MCFG_TIMER_ADD_PERIODIC("keyboard", vcs80_keyboard_tick, attotime::from_hz(1000))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", vcs80_state, vcs80_keyboard_tick, attotime::from_hz(1000))
/* video hardware */
MCFG_DEFAULT_LAYOUT( layout_vcs80 )
diff --git a/src/mess/drivers/vixen.c b/src/mess/drivers/vixen.c
index a32207b59e0..6254e7f39c3 100644
--- a/src/mess/drivers/vixen.c
+++ b/src/mess/drivers/vixen.c
@@ -393,14 +393,12 @@ INPUT_PORTS_END
// TIMER_DEVICE_CALLBACK( vsync_tick )
//-------------------------------------------------
-static TIMER_DEVICE_CALLBACK( vsync_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(vixen_state::vsync_tick)
{
- vixen_state *state = timer.machine().driver_data<vixen_state>();
-
- if (state->m_cmd_d0)
+ if (m_cmd_d0)
{
- state->m_vsync = 1;
- state->update_interrupt();
+ m_vsync = 1;
+ update_interrupt();
}
}
@@ -846,7 +844,7 @@ static MACHINE_CONFIG_START( vixen, vixen_state )
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DRIVER(vixen_state, screen_update)
MCFG_SCREEN_RAW_PARAMS(XTAL_23_9616MHz/2, 96*8, 0*8, 81*8, 27*10, 0*10, 26*10)
- MCFG_TIMER_ADD_SCANLINE("vsync", vsync_tick, SCREEN_TAG, 26*10, 27*10)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("vsync", vixen_state, vsync_tick, SCREEN_TAG, 26*10, 27*10)
MCFG_PALETTE_LENGTH(2)
MCFG_PALETTE_INIT(monochrome_amber)
diff --git a/src/mess/drivers/x07.c b/src/mess/drivers/x07.c
index 701cde1bf84..8b652666803 100644
--- a/src/mess/drivers/x07.c
+++ b/src/mess/drivers/x07.c
@@ -1358,11 +1358,9 @@ static NVRAM_HANDLER( x07 )
}
}
-static TIMER_DEVICE_CALLBACK( blink_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(x07_state::blink_timer)
{
- x07_state *state = timer.machine().driver_data<x07_state>();
-
- state->m_blink = !state->m_blink;
+ m_blink = !m_blink;
}
TIMER_CALLBACK_MEMBER(x07_state::rsta_clear)
@@ -1524,7 +1522,7 @@ static MACHINE_CONFIG_START( x07, x07_state )
/* printer */
MCFG_PRINTER_ADD("printer")
- MCFG_TIMER_ADD_PERIODIC("blink_timer", blink_timer, attotime::from_msec(300))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("blink_timer", x07_state, blink_timer, attotime::from_msec(300))
MCFG_NVRAM_HANDLER( x07 )
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index 854ae7385c3..b77f9e39cad 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -807,26 +807,24 @@ static void cmt_command( running_machine &machine, UINT8 cmd )
logerror("CMT: Command 0xe9-0x%02x received.\n",cmd);
}
-TIMER_DEVICE_CALLBACK( x1_cmt_wind_timer )
+TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_cmt_wind_timer)
{
- x1_state *state = timer.machine().driver_data<x1_state>();
-
- if(state->m_cass->get_image() == NULL) //avoid a crash if a disk game tries to access this
+ if(m_cass->get_image() == NULL) //avoid a crash if a disk game tries to access this
return;
- switch(state->m_cmt_current_cmd)
+ switch(m_cmt_current_cmd)
{
case 0x03:
case 0x05: // Fast Forwarding tape
- state->m_cass->seek(1,SEEK_CUR);
- if(state->m_cass->get_position() >= state->m_cass->get_length()) // at end?
- cmt_command(timer.machine(),0x01); // Stop tape
+ m_cass->seek(1,SEEK_CUR);
+ if(m_cass->get_position() >= m_cass->get_length()) // at end?
+ cmt_command(machine(),0x01); // Stop tape
break;
case 0x04:
case 0x06: // Rewinding tape
- state->m_cass->seek(-1,SEEK_CUR);
- if(state->m_cass->get_position() <= 0) // at beginning?
- cmt_command(timer.machine(),0x01); // Stop tape
+ m_cass->seek(-1,SEEK_CUR);
+ if(m_cass->get_position() <= 0) // at beginning?
+ cmt_command(machine(),0x01); // Stop tape
break;
}
}
@@ -2401,33 +2399,32 @@ static IRQ_CALLBACK(x1_irq_callback)
}
#endif
-TIMER_DEVICE_CALLBACK(x1_keyboard_callback)
+TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_keyboard_callback)
{
- x1_state *state = timer.machine().driver_data<x1_state>();
- address_space &space = timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
- UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
- UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
- UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
- UINT32 key4 = timer.machine().root_device().ioport("tenkey")->read();
- UINT32 f_key = timer.machine().root_device().ioport("f_keys")->read();
+ address_space &space = machine().device("x1_cpu")->memory().space(AS_PROGRAM);
+ UINT32 key1 = machine().root_device().ioport("key1")->read();
+ UINT32 key2 = machine().root_device().ioport("key2")->read();
+ UINT32 key3 = machine().root_device().ioport("key3")->read();
+ UINT32 key4 = machine().root_device().ioport("tenkey")->read();
+ UINT32 f_key = machine().root_device().ioport("f_keys")->read();
- if(state->m_key_irq_vector)
+ if(m_key_irq_vector)
{
//if(key1 == 0 && key2 == 0 && key3 == 0 && key4 == 0 && f_key == 0)
// return;
- if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3) || (key4 != state->m_old_key4) || (f_key != state->m_old_fkey))
+ if((key1 != m_old_key1) || (key2 != m_old_key2) || (key3 != m_old_key3) || (key4 != m_old_key4) || (f_key != m_old_fkey))
{
// generate keyboard IRQ
- state->x1_sub_io_w(space,0,0xe6);
- state->m_irq_vector = state->m_key_irq_vector;
- state->m_key_irq_flag = 1;
- timer.machine().device("x1_cpu")->execute().set_input_line(0,ASSERT_LINE);
- state->m_old_key1 = key1;
- state->m_old_key2 = key2;
- state->m_old_key3 = key3;
- state->m_old_key4 = key4;
- state->m_old_fkey = f_key;
+ x1_sub_io_w(space,0,0xe6);
+ m_irq_vector = m_key_irq_vector;
+ m_key_irq_flag = 1;
+ machine().device("x1_cpu")->execute().set_input_line(0,ASSERT_LINE);
+ m_old_key1 = key1;
+ m_old_key2 = key2;
+ m_old_key3 = key3;
+ m_old_key4 = key4;
+ m_old_fkey = f_key;
}
}
}
@@ -2620,8 +2617,8 @@ static MACHINE_CONFIG_START( x1, x1_state )
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface)
MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop")
- MCFG_TIMER_ADD_PERIODIC("keyboard_timer", x1_keyboard_callback, attotime::from_hz(250))
- MCFG_TIMER_ADD_PERIODIC("cmt_wind_timer", x1_cmt_wind_timer, attotime::from_hz(16))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", x1_state, x1_keyboard_callback, attotime::from_hz(250))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("cmt_wind_timer", x1_state, x1_cmt_wind_timer, attotime::from_hz(16))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( x1turbo, x1 )
diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c
index 0be88977a9b..8790f02cc19 100644
--- a/src/mess/drivers/x1twin.c
+++ b/src/mess/drivers/x1twin.c
@@ -601,8 +601,8 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state )
MCFG_SOUND_ROUTE(1, "pce_r", 0.5)
#endif
- MCFG_TIMER_ADD_PERIODIC("keyboard_timer", x1_keyboard_callback, attotime::from_hz(250))
- MCFG_TIMER_ADD_PERIODIC("cmt_wind_timer", x1_cmt_wind_timer, attotime::from_hz(16))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", x1twin_state, x1_keyboard_callback, attotime::from_hz(250))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("cmt_wind_timer", x1twin_state, x1_cmt_wind_timer, attotime::from_hz(16))
MACHINE_CONFIG_END
ROM_START( x1twin )
diff --git a/src/mess/drivers/xerox820.c b/src/mess/drivers/xerox820.c
index ffc5ac09a6b..fc6adda008b 100644
--- a/src/mess/drivers/xerox820.c
+++ b/src/mess/drivers/xerox820.c
@@ -133,10 +133,9 @@ void xerox820_state::scan_keyboard()
m_keydata = keydata;
}
-static TIMER_DEVICE_CALLBACK( xerox820_keyboard_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(xerox820_state::xerox820_keyboard_tick)
{
- xerox820_state *state = timer.machine().driver_data<xerox820_state>();
- state->scan_keyboard();
+ scan_keyboard();
}
/* Read/Write Handlers */
@@ -552,12 +551,10 @@ static Z80DART_INTERFACE( sio_intf )
/* Z80 CTC */
-static TIMER_DEVICE_CALLBACK( ctc_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(xerox820_state::ctc_tick)
{
- xerox820_state *state = timer.machine().driver_data<xerox820_state>();
-
- state->m_ctc->trg0(1);
- state->m_ctc->trg0(0);
+ m_ctc->trg0(1);
+ m_ctc->trg0(0);
}
static WRITE_LINE_DEVICE_HANDLER( ctc_z0_w )
@@ -848,8 +845,8 @@ static MACHINE_CONFIG_START( xerox820, xerox820_state )
MCFG_PALETTE_INIT(black_and_white)
/* keyboard */
- MCFG_TIMER_ADD_PERIODIC("keyboard", xerox820_keyboard_tick,attotime::from_hz(60))
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_20MHz/8))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", xerox820_state, xerox820_keyboard_tick, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", xerox820_state, ctc_tick, attotime::from_hz(XTAL_20MHz/8))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -886,8 +883,8 @@ static MACHINE_CONFIG_START( xerox820ii, xerox820ii_state )
MCFG_PALETTE_INIT(black_and_white)
/* keyboard */
- MCFG_TIMER_ADD_PERIODIC("keyboard", xerox820_keyboard_tick, attotime::from_hz(60))
- MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_16MHz/4))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", xerox820_state, xerox820_keyboard_tick, attotime::from_hz(60))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", xerox820_state, ctc_tick, attotime::from_hz(XTAL_16MHz/4))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/includes/a7800.h b/src/mess/includes/a7800.h
index 10ecdef5e59..43847f97e20 100644
--- a/src/mess/includes/a7800.h
+++ b/src/mess/includes/a7800.h
@@ -66,13 +66,9 @@ public:
virtual void palette_init();
DECLARE_PALETTE_INIT(a7800p);
UINT32 screen_update_a7800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(a7800_interrupt);
};
-
-/*----------- defined in video/a7800.c -----------*/
-
-TIMER_DEVICE_CALLBACK( a7800_interrupt );
-
/*----------- defined in machine/a7800.c -----------*/
extern const riot6532_interface a7800_r6532_interface;
diff --git a/src/mess/includes/ace.h b/src/mess/includes/ace.h
index f36a2b5e2f9..963cda20016 100644
--- a/src/mess/includes/ace.h
+++ b/src/mess/includes/ace.h
@@ -58,6 +58,8 @@ public:
required_shared_ptr<UINT8> m_video_ram;
required_shared_ptr<UINT8> m_char_ram;
UINT32 screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(set_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(clear_irq);
};
#endif /* ACE_H_ */
diff --git a/src/mess/includes/adam.h b/src/mess/includes/adam.h
index 50289c9e3cf..560d899c0a0 100644
--- a/src/mess/includes/adam.h
+++ b/src/mess/includes/adam.h
@@ -126,6 +126,7 @@ public:
int m_wr0;
int m_wr1;
int m_track;
+ TIMER_DEVICE_CALLBACK_MEMBER(paddle_tick);
};
#endif
diff --git a/src/mess/includes/apple2.h b/src/mess/includes/apple2.h
index 19671f58086..f487edfa650 100644
--- a/src/mess/includes/apple2.h
+++ b/src/mess/includes/apple2.h
@@ -242,6 +242,7 @@ public:
DECLARE_MACHINE_START(laser128);
DECLARE_MACHINE_START(space84);
UINT32 screen_update_apple2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt);
};
@@ -270,8 +271,6 @@ DECLARE_WRITE8_HANDLER( apple2_c0xx_w );
DECLARE_READ8_HANDLER( apple2_c080_r );
DECLARE_WRITE8_HANDLER( apple2_c080_w );
-TIMER_DEVICE_CALLBACK( apple2_interrupt );
-
INT8 apple2_slotram_r(running_machine &machine, int slotnum, int offset);
void apple2_setvar(running_machine &machine, UINT32 val, UINT32 mask);
diff --git a/src/mess/includes/atom.h b/src/mess/includes/atom.h
index bb97a64e569..1817d1a0303 100644
--- a/src/mess/includes/atom.h
+++ b/src/mess/includes/atom.h
@@ -89,6 +89,7 @@ public:
/* devices */
int m_previous_i8271_int_state;
+ TIMER_DEVICE_CALLBACK_MEMBER(cassette_output_tick);
};
class atomeb_state : public atom_state
diff --git a/src/mess/includes/avigo.h b/src/mess/includes/avigo.h
index c759809e773..47ad217d334 100644
--- a/src/mess/includes/avigo.h
+++ b/src/mess/includes/avigo.h
@@ -105,5 +105,7 @@ public:
UINT8 m_warm_start;
UINT8 * m_ram_base;
virtual void palette_init();
+ TIMER_DEVICE_CALLBACK_MEMBER(avigo_scan_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(avigo_1hz_timer);
};
#endif /* AVIGO_H_ */
diff --git a/src/mess/includes/bullet.h b/src/mess/includes/bullet.h
index 433566923c4..d1c164da295 100644
--- a/src/mess/includes/bullet.h
+++ b/src/mess/includes/bullet.h
@@ -93,6 +93,7 @@ public:
int m_winrdy;
int m_exrdy1;
int m_exrdy2;
+ TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
};
class bulletf_state : public bullet_state
diff --git a/src/mess/includes/busicom.h b/src/mess/includes/busicom.h
index 9b2389d39ed..d4ba01696fa 100644
--- a/src/mess/includes/busicom.h
+++ b/src/mess/includes/busicom.h
@@ -31,6 +31,7 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_busicom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(timer_callback);
};
#endif /* BUSICOM_H_ */
diff --git a/src/mess/includes/bw12.h b/src/mess/includes/bw12.h
index 82e6e2968c3..16b5ee10d25 100644
--- a/src/mess/includes/bw12.h
+++ b/src/mess/includes/bw12.h
@@ -89,6 +89,7 @@ public:
int m_motor_on;
int m_motor0;
int m_motor1;
+ TIMER_DEVICE_CALLBACK_MEMBER(floppy_motor_off_tick);
};
#endif
diff --git a/src/mess/includes/cgc7900.h b/src/mess/includes/cgc7900.h
index c565cffb285..26cd35a7cdd 100644
--- a/src/mess/includes/cgc7900.h
+++ b/src/mess/includes/cgc7900.h
@@ -89,6 +89,7 @@ public:
required_shared_ptr<UINT16> m_roll_overlay;
int m_blink;
UINT32 screen_update_cgc7900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(blink_tick);
};
/*----------- defined in video/cgc7900.c -----------*/
diff --git a/src/mess/includes/coleco.h b/src/mess/includes/coleco.h
index b4be062369a..08b018d2ddb 100644
--- a/src/mess/includes/coleco.h
+++ b/src/mess/includes/coleco.h
@@ -46,6 +46,7 @@ public:
TIMER_CALLBACK_MEMBER(paddle_d7reset_callback);
TIMER_CALLBACK_MEMBER(paddle_irqreset_callback);
TIMER_CALLBACK_MEMBER(paddle_pulse_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(paddle_update_callback);
};
#endif
diff --git a/src/mess/includes/cosmicos.h b/src/mess/includes/cosmicos.h
index e0d01c52115..9b6f5fd8199 100644
--- a/src/mess/includes/cosmicos.h
+++ b/src/mess/includes/cosmicos.h
@@ -121,6 +121,8 @@ public:
int m_efx;
int m_video_on;
DECLARE_DRIVER_INIT(cosmicos);
+ TIMER_DEVICE_CALLBACK_MEMBER(digit_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(int_tick);
};
#endif
diff --git a/src/mess/includes/einstein.h b/src/mess/includes/einstein.h
index a5391312c16..6235140fccd 100644
--- a/src/mess/includes/einstein.h
+++ b/src/mess/includes/einstein.h
@@ -83,6 +83,8 @@ public:
DECLARE_MACHINE_START(einstein2);
DECLARE_MACHINE_RESET(einstein2);
UINT32 screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(einstein_keyboard_timer_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(einstein_ctc_trigger_callback);
};
diff --git a/src/mess/includes/fidelz80.h b/src/mess/includes/fidelz80.h
index 6512ae752ea..cc0120be103 100644
--- a/src/mess/includes/fidelz80.h
+++ b/src/mess/includes/fidelz80.h
@@ -65,6 +65,7 @@ public:
DECLARE_WRITE8_MEMBER(vsc_pio_portb_w);
DECLARE_INPUT_CHANGED_MEMBER(fidelz80_trigger_reset);
DECLARE_INPUT_CHANGED_MEMBER(abc_trigger_reset);
+ TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer);
};
diff --git a/src/mess/includes/huebler.h b/src/mess/includes/huebler.h
index 30db07b0771..31f66408a73 100644
--- a/src/mess/includes/huebler.h
+++ b/src/mess/includes/huebler.h
@@ -51,6 +51,7 @@ public:
// video state
required_shared_ptr<UINT8> m_video_ram;
const UINT8 *m_char_rom;
+ TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
};
#endif
diff --git a/src/mess/includes/kc.h b/src/mess/includes/kc.h
index 25ca9801a8f..a9887628041 100644
--- a/src/mess/includes/kc.h
+++ b/src/mess/includes/kc.h
@@ -148,6 +148,7 @@ public:
DECLARE_PALETTE_INIT(kc85);
TIMER_CALLBACK_MEMBER(kc_cassette_oneshot_timer);
TIMER_CALLBACK_MEMBER(kc_cassette_timer_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(kc_scanline);
};
@@ -185,6 +186,5 @@ public:
/*----------- defined in machine/kc.c -----------*/
QUICKLOAD_LOAD( kc );
-TIMER_DEVICE_CALLBACK( kc_scanline );
#endif /* KC_H_ */
diff --git a/src/mess/includes/kyocera.h b/src/mess/includes/kyocera.h
index b788cd618ea..7c81b6c9368 100644
--- a/src/mess/includes/kyocera.h
+++ b/src/mess/includes/kyocera.h
@@ -190,6 +190,8 @@ public:
DECLARE_PALETTE_INIT(tandy200);
+ TIMER_DEVICE_CALLBACK_MEMBER(tandy200_tp_tick);
+
void bankswitch(UINT8 data);
/* memory state */
diff --git a/src/mess/includes/mc1000.h b/src/mess/includes/mc1000.h
index 58f902a9793..ea49109cdb7 100644
--- a/src/mess/includes/mc1000.h
+++ b/src/mess/includes/mc1000.h
@@ -79,6 +79,7 @@ public:
required_shared_ptr<UINT8> m_mc6847_video_ram;
UINT8 m_mc6847_attr;
DECLARE_DRIVER_INIT(mc1000);
+ TIMER_DEVICE_CALLBACK_MEMBER(ne555_tick);
};
#endif
diff --git a/src/mess/includes/mc80.h b/src/mess/includes/mc80.h
index 0327a444553..18554be9d1b 100644
--- a/src/mess/includes/mc80.h
+++ b/src/mess/includes/mc80.h
@@ -44,6 +44,7 @@ public:
DECLARE_VIDEO_START(mc8030);
UINT32 screen_update_mc8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mc8030(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(mc8020_kbd);
};
diff --git a/src/mess/includes/mikromik.h b/src/mess/includes/mikromik.h
index 7e1061c5d62..819fed6a81c 100644
--- a/src/mess/includes/mikromik.h
+++ b/src/mess/includes/mikromik.h
@@ -113,6 +113,7 @@ public:
int m_dack3;
int m_tc;
UINT32 screen_update_mm1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(kbclk_tick);
};
diff --git a/src/mess/includes/mpf1.h b/src/mess/includes/mpf1.h
index a761abd2bc9..0b89e71e7d0 100644
--- a/src/mess/includes/mpf1.h
+++ b/src/mess/includes/mpf1.h
@@ -56,6 +56,7 @@ public:
emu_timer *m_led_refresh_timer;
DECLARE_DRIVER_INIT(mpf1);
TIMER_CALLBACK_MEMBER(led_refresh);
+ TIMER_DEVICE_CALLBACK_MEMBER(check_halt_callback);
};
#endif
diff --git a/src/mess/includes/msx.h b/src/mess/includes/msx.h
index 69fcddb3e16..91b11b3c1f8 100644
--- a/src/mess/includes/msx.h
+++ b/src/mess/includes/msx.h
@@ -125,6 +125,7 @@ public:
DECLARE_MACHINE_START(msx2);
DECLARE_MACHINE_RESET(msx2);
INTERRUPT_GEN_MEMBER(msx_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(msx2_interrupt);
};
@@ -133,7 +134,6 @@ public:
extern const i8255_interface msx_ppi8255_interface;
extern const wd17xx_interface msx_wd17xx_interface;
/* start/stop functions */
-extern TIMER_DEVICE_CALLBACK( msx2_interrupt );
DEVICE_IMAGE_LOAD( msx_cart );
DEVICE_IMAGE_UNLOAD( msx_cart );
diff --git a/src/mess/includes/mtx.h b/src/mess/includes/mtx.h
index 2c9ce009c34..f70195678f1 100644
--- a/src/mess/includes/mtx.h
+++ b/src/mess/includes/mtx.h
@@ -58,6 +58,8 @@ public:
DECLARE_WRITE8_MEMBER(hrx_attr_w);
DECLARE_MACHINE_START(mtx512);
DECLARE_MACHINE_RESET(mtx512);
+ TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(cassette_tick);
};
/*----------- defined in machine/mtx.c -----------*/
diff --git a/src/mess/includes/mz700.h b/src/mess/includes/mz700.h
index 7d844824515..d155f6aa1b9 100644
--- a/src/mess/includes/mz700.h
+++ b/src/mess/includes/mz700.h
@@ -81,6 +81,8 @@ public:
DECLARE_VIDEO_START(mz800);
UINT32 screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ne556_cursor_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(ne556_other_callback);
};
diff --git a/src/mess/includes/mz80.h b/src/mess/includes/mz80.h
index 0d3b4a377d8..fd07819d80c 100644
--- a/src/mess/includes/mz80.h
+++ b/src/mess/includes/mz80.h
@@ -57,6 +57,7 @@ public:
UINT32 screen_update_mz80k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mz80kj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mz80a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(ne555_tempo_callback);
};
diff --git a/src/mess/includes/nc.h b/src/mess/includes/nc.h
index 0dd1444d448..31cca7f8614 100644
--- a/src/mess/includes/nc.h
+++ b/src/mess/includes/nc.h
@@ -82,6 +82,7 @@ public:
UINT32 screen_update_nc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(nc_keyboard_timer_callback);
TIMER_CALLBACK_MEMBER(nc_serial_timer_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(dummy_timer_callback);
};
diff --git a/src/mess/includes/newbrain.h b/src/mess/includes/newbrain.h
index 2a48245120a..89752f6b9dd 100644
--- a/src/mess/includes/newbrain.h
+++ b/src/mess/includes/newbrain.h
@@ -158,6 +158,7 @@ public:
int m_copbytes;
int m_copregint;
INTERRUPT_GEN_MEMBER(newbrain_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(cop_regint_tick);
};
class newbrain_eim_state : public newbrain_state
@@ -206,6 +207,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
DECLARE_WRITE_LINE_MEMBER( adc_eoc_w );
+ TIMER_DEVICE_CALLBACK_MEMBER(ctc_c2_tick);
+
void bankswitch();
// paging state
diff --git a/src/mess/includes/pc.h b/src/mess/includes/pc.h
index d949e037616..7c8e26fd6b1 100644
--- a/src/mess/includes/pc.h
+++ b/src/mess/includes/pc.h
@@ -90,6 +90,9 @@ public:
TIMER_CALLBACK_MEMBER(pcjr_keyb_signal_callback);
TIMER_CALLBACK_MEMBER(mc1502_keyb_signal_callback);
TIMER_CALLBACK_MEMBER(pc_rtc_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(pc_frame_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(pc_vga_frame_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(pcjr_frame_interrupt);
};
/*----------- defined in machine/pc.c -----------*/
@@ -124,12 +127,6 @@ DECLARE_WRITE8_DEVICE_HANDLER( mc1502_wd17xx_aux_w );
DEVICE_IMAGE_LOAD( pcjr_cartridge );
-TIMER_DEVICE_CALLBACK( pc_frame_interrupt );
-TIMER_DEVICE_CALLBACK( pc_vga_frame_interrupt );
-TIMER_DEVICE_CALLBACK( pcjr_frame_interrupt );
-TIMER_DEVICE_CALLBACK( null_frame_interrupt );
-
-
void pc_rtc_init(running_machine &machine);
diff --git a/src/mess/includes/pc8401a.h b/src/mess/includes/pc8401a.h
index 902236b69a4..82e8f952a7c 100644
--- a/src/mess/includes/pc8401a.h
+++ b/src/mess/includes/pc8401a.h
@@ -80,6 +80,7 @@ public:
UINT8 *m_crt_ram; // CRT video RAM
UINT8 m_key_latch;
+ TIMER_DEVICE_CALLBACK_MEMBER(pc8401a_keyboard_tick);
};
class pc8500_state : public pc8401a_state
diff --git a/src/mess/includes/pcw.h b/src/mess/includes/pcw.h
index f87c7e6ff49..64d04ee53c1 100644
--- a/src/mess/includes/pcw.h
+++ b/src/mess/includes/pcw.h
@@ -105,6 +105,7 @@ public:
TIMER_CALLBACK_MEMBER(pcw_stepper_callback);
TIMER_CALLBACK_MEMBER(pcw_pins_callback);
TIMER_CALLBACK_MEMBER(setup_beep);
+ TIMER_DEVICE_CALLBACK_MEMBER(pcw_timer_interrupt);
};
#endif /* PCW_H_ */
diff --git a/src/mess/includes/pcw16.h b/src/mess/includes/pcw16.h
index df0229389d9..578999e2d6e 100644
--- a/src/mess/includes/pcw16.h
+++ b/src/mess/includes/pcw16.h
@@ -98,6 +98,9 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_pcw16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(pcw16_timer_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(pcw16_keyboard_timer_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(rtc_timer_callback);
};
#endif /* PCW16_H_ */
diff --git a/src/mess/includes/portfoli.h b/src/mess/includes/portfoli.h
index e7ae6dda7f7..ef05b8e1851 100644
--- a/src/mess/includes/portfoli.h
+++ b/src/mess/includes/portfoli.h
@@ -85,6 +85,9 @@ public:
/* peripheral state */
UINT8 m_pid; /* peripheral identification */
virtual void palette_init();
+ TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(system_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
};
#endif
diff --git a/src/mess/includes/psion.h b/src/mess/includes/psion.h
index 37cb9e8796f..482c9b30966 100644
--- a/src/mess/includes/psion.h
+++ b/src/mess/includes/psion.h
@@ -86,6 +86,7 @@ public:
DECLARE_READ8_MEMBER( io_r );
virtual void palette_init();
DECLARE_INPUT_CHANGED_MEMBER(psion_on);
+ TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer);
};
// device type definition
diff --git a/src/mess/includes/super6.h b/src/mess/includes/super6.h
index e5a0f991442..3bd3c81ba79 100644
--- a/src/mess/includes/super6.h
+++ b/src/mess/includes/super6.h
@@ -77,6 +77,7 @@ public:
UINT8 m_s100;
UINT8 m_bank0;
UINT8 m_bank1;
+ TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
};
#endif
diff --git a/src/mess/includes/svision.h b/src/mess/includes/svision.h
index 4f22b33e134..241a825c03e 100644
--- a/src/mess/includes/svision.h
+++ b/src/mess/includes/svision.h
@@ -59,6 +59,7 @@ public:
INTERRUPT_GEN_MEMBER(svision_frame_int);
TIMER_CALLBACK_MEMBER(svision_pet_timer);
TIMER_CALLBACK_MEMBER(svision_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(svision_pet_timer_dev);
};
diff --git a/src/mess/includes/tek405x.h b/src/mess/includes/tek405x.h
index a92ea4fddc6..9ddaf9c5a95 100644
--- a/src/mess/includes/tek405x.h
+++ b/src/mess/includes/tek405x.h
@@ -124,6 +124,7 @@ public:
// GPIB
int m_talk;
+ TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
};
class tek4052_state : public driver_device
diff --git a/src/mess/includes/ti89.h b/src/mess/includes/ti89.h
index 0d03111e2a8..376b5250f65 100644
--- a/src/mess/includes/ti89.h
+++ b/src/mess/includes/ti89.h
@@ -63,6 +63,7 @@ public:
UINT64 m_timer;
virtual void palette_init();
DECLARE_INPUT_CHANGED_MEMBER(ti68k_on_key);
+ TIMER_DEVICE_CALLBACK_MEMBER(ti68k_timer_callback);
};
#endif // TI89_H_
diff --git a/src/mess/includes/tiki100.h b/src/mess/includes/tiki100.h
index 026ef5e5557..0a300fb14cc 100644
--- a/src/mess/includes/tiki100.h
+++ b/src/mess/includes/tiki100.h
@@ -79,6 +79,7 @@ public:
/* keyboard state */
int m_keylatch;
+ TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
};
#endif
diff --git a/src/mess/includes/tmc600.h b/src/mess/includes/tmc600.h
index e4fa4e8c2f7..658e8bf447f 100644
--- a/src/mess/includes/tmc600.h
+++ b/src/mess/includes/tmc600.h
@@ -66,6 +66,7 @@ public:
// keyboard state
int m_keylatch; // key latch
+ TIMER_DEVICE_CALLBACK_MEMBER(blink_tick);
};
// ---------- defined in video/tmc600.c ----------
diff --git a/src/mess/includes/trs80m2.h b/src/mess/includes/trs80m2.h
index 70f8397b836..cbf8d810011 100644
--- a/src/mess/includes/trs80m2.h
+++ b/src/mess/includes/trs80m2.h
@@ -110,6 +110,8 @@ public:
int m_de;
int m_rtc_int;
int m_enable_rtc_int;
+ TIMER_DEVICE_CALLBACK_MEMBER(trs80m2_keyboard_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
};
class trs80m16_state : public trs80m2_state
diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h
index a667b847cea..00057b72588 100644
--- a/src/mess/includes/v1050.h
+++ b/src/mess/includes/v1050.h
@@ -157,6 +157,11 @@ public:
required_shared_ptr<UINT8> m_video_ram; // video RAM
UINT8 *m_attr_ram; // attribute RAM
UINT8 m_attr; // attribute latch
+ TIMER_DEVICE_CALLBACK_MEMBER(v1050_keyboard_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(sasi_ack_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(sasi_rst_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(kb_8251_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(sio_8251_tick);
};
//----------- defined in video/v1050.c -----------
diff --git a/src/mess/includes/vcs80.h b/src/mess/includes/vcs80.h
index 836ebcc3f13..483ab9f2ac3 100644
--- a/src/mess/includes/vcs80.h
+++ b/src/mess/includes/vcs80.h
@@ -36,6 +36,7 @@ public:
int m_keylatch;
int m_keyclk;
DECLARE_DRIVER_INIT(vcs80);
+ TIMER_DEVICE_CALLBACK_MEMBER(vcs80_keyboard_tick);
};
#endif
diff --git a/src/mess/includes/vixen.h b/src/mess/includes/vixen.h
index c5e9e1f3e58..4705adcad08 100644
--- a/src/mess/includes/vixen.h
+++ b/src/mess/includes/vixen.h
@@ -105,6 +105,7 @@ public:
const UINT8 *m_char_rom;
DECLARE_DRIVER_INIT(vixen);
UINT32 screen_update_vixen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(vsync_tick);
};
#endif
diff --git a/src/mess/includes/x07.h b/src/mess/includes/x07.h
index 6987ea9d302..904726b07f6 100644
--- a/src/mess/includes/x07.h
+++ b/src/mess/includes/x07.h
@@ -265,4 +265,5 @@ public:
TIMER_CALLBACK_MEMBER(rsta_clear);
TIMER_CALLBACK_MEMBER(rstb_clear);
TIMER_CALLBACK_MEMBER(beep_stop);
+ TIMER_DEVICE_CALLBACK_MEMBER(blink_timer);
};
diff --git a/src/mess/includes/x1.h b/src/mess/includes/x1.h
index 98398095ea4..025b20ad4c9 100644
--- a/src/mess/includes/x1.h
+++ b/src/mess/includes/x1.h
@@ -203,14 +203,10 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(ipl_reset);
DECLARE_INPUT_CHANGED_MEMBER(nmi_reset);
TIMER_CALLBACK_MEMBER(x1_rtc_increment);
+ TIMER_DEVICE_CALLBACK_MEMBER(x1_cmt_wind_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(x1_keyboard_callback);
};
-
-/*----------- shared with x1twin.c -----------*/
-
-TIMER_DEVICE_CALLBACK(x1_keyboard_callback);
-TIMER_DEVICE_CALLBACK( x1_cmt_wind_timer );
-
/*----------- defined in machine/x1.c -----------*/
extern const device_type X1_KEYBOARD;
diff --git a/src/mess/includes/xerox820.h b/src/mess/includes/xerox820.h
index 1275fb290d0..606896eccaf 100644
--- a/src/mess/includes/xerox820.h
+++ b/src/mess/includes/xerox820.h
@@ -83,6 +83,8 @@ public:
int m_8n5; /* 5.25" / 8" drive select */
int m_dsdd; /* double sided disk detect */
TIMER_CALLBACK_MEMBER(bigboard_beepoff);
+ TIMER_DEVICE_CALLBACK_MEMBER(xerox820_keyboard_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
};
class xerox820ii_state : public xerox820_state
diff --git a/src/mess/machine/apple2.c b/src/mess/machine/apple2.c
index 518f79a3d4f..ae3b6d5c30d 100644
--- a/src/mess/machine/apple2.c
+++ b/src/mess/machine/apple2.c
@@ -1213,12 +1213,12 @@ static void apple2_reset(running_machine &machine)
* Apple II interrupt; used to force partial updates
* ----------------------------------------------------------------------- */
-TIMER_DEVICE_CALLBACK( apple2_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(apple2_state::apple2_interrupt)
{
int scanline = param;
if((scanline % 8) == 0)
- timer.machine().primary_screen->update_partial(timer.machine().primary_screen->vpos());
+ machine().primary_screen->update_partial(machine().primary_screen->vpos());
}
diff --git a/src/mess/machine/kc.c b/src/mess/machine/kc.c
index f2aedb7fe0d..ed34c3ff91a 100644
--- a/src/mess/machine/kc.c
+++ b/src/mess/machine/kc.c
@@ -718,24 +718,23 @@ WRITE_LINE_MEMBER( kc_state::ctc_zc1_callback)
}
-TIMER_DEVICE_CALLBACK( kc_scanline )
+TIMER_DEVICE_CALLBACK_MEMBER(kc_state::kc_scanline)
{
- kc_state *state = timer.machine().driver_data<kc_state>();
int scanline = (int)param;
/* set clock input for channel 0 and 1 to ctc */
- state->m_z80ctc->trg0(1);
- state->m_z80ctc->trg0(0);
- state->m_z80ctc->trg1(1);
- state->m_z80ctc->trg1(0);
+ m_z80ctc->trg0(1);
+ m_z80ctc->trg0(0);
+ m_z80ctc->trg1(1);
+ m_z80ctc->trg1(0);
if (scanline == 256)
{
/* set clock input for channel 2 and 3 to ctc */
- state->m_z80ctc->trg2(1);
- state->m_z80ctc->trg2(0);
- state->m_z80ctc->trg3(1);
- state->m_z80ctc->trg3(0);
+ m_z80ctc->trg2(1);
+ m_z80ctc->trg2(0);
+ m_z80ctc->trg3(1);
+ m_z80ctc->trg3(0);
}
}
diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c
index 31906cadb4d..74bea8400e1 100644
--- a/src/mess/machine/msx.c
+++ b/src/mess/machine/msx.c
@@ -524,12 +524,11 @@ DRIVER_INIT_MEMBER(msx_state,msx)
z80_set_cycle_tables( machine().device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex );
}
-TIMER_DEVICE_CALLBACK( msx2_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2_interrupt)
{
- msx_state *state = timer.machine().driver_data<msx_state>();
- state->m_v9938->set_sprite_limit(timer.machine().root_device().ioport("DSW")->read() & 0x20);
- state->m_v9938->set_resolution(timer.machine().root_device().ioport("DSW")->read() & 0x03);
- state->m_v9938->interrupt();
+ m_v9938->set_sprite_limit(machine().root_device().ioport("DSW")->read() & 0x20);
+ m_v9938->set_resolution(machine().root_device().ioport("DSW")->read() & 0x03);
+ m_v9938->interrupt();
}
INTERRUPT_GEN_MEMBER(msx_state::msx_interrupt)
diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c
index ba5147e65da..6133bc07d3e 100644
--- a/src/mess/machine/pc.c
+++ b/src/mess/machine/pc.c
@@ -1588,7 +1588,7 @@ DEVICE_IMAGE_LOAD( pcjr_cartridge )
*
**************************************************************************/
-TIMER_DEVICE_CALLBACK( pc_frame_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(pc_state::pc_frame_interrupt)
{
int scanline = param;
@@ -1596,7 +1596,7 @@ TIMER_DEVICE_CALLBACK( pc_frame_interrupt )
pc_keyboard();
}
-TIMER_DEVICE_CALLBACK( pc_vga_frame_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(pc_state::pc_vga_frame_interrupt)
{
int scanline = param;
@@ -1607,7 +1607,7 @@ TIMER_DEVICE_CALLBACK( pc_vga_frame_interrupt )
}
}
-TIMER_DEVICE_CALLBACK( pcjr_frame_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(pc_state::pcjr_frame_interrupt)
{
int scanline = param;
diff --git a/src/mess/video/a7800.c b/src/mess/video/a7800.c
index e5e3397fd82..d0ca53775ba 100644
--- a/src/mess/video/a7800.c
+++ b/src/mess/video/a7800.c
@@ -316,45 +316,44 @@ static void maria_draw_scanline(running_machine &machine)
}
-TIMER_DEVICE_CALLBACK( a7800_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(a7800_state::a7800_interrupt)
{
- a7800_state *state = timer.machine().driver_data<a7800_state>();
int frame_scanline;
- UINT8 *ROM = timer.machine().root_device().memregion("maincpu")->base();
- address_space& space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
+ address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- state->m_maria_scanline++;
+ m_maria_scanline++;
/* why + 1? */
- frame_scanline = state->m_maria_scanline % ( state->m_lines + 1 );
+ frame_scanline = m_maria_scanline % ( m_lines + 1 );
if( frame_scanline == 1 )
{
/*logerror( "frame beg\n" );*/
}
- if( state->m_maria_wsync )
+ if( m_maria_wsync )
{
- timer.machine().scheduler().trigger( TRIGGER_HSYNC );
- state->m_maria_wsync = 0;
+ machine().scheduler().trigger( TRIGGER_HSYNC );
+ m_maria_wsync = 0;
}
if( frame_scanline == 16 )
{
/* end of vblank */
- state->m_maria_vblank=0;
- if( state->m_maria_dmaon || state->m_maria_dodma )
+ m_maria_vblank=0;
+ if( m_maria_dmaon || m_maria_dodma )
{
- state->m_maria_dodma = 1; /* if dma allowed, start it */
-
- state->m_maria_dll = (ROM[DPPH] << 8) | ROM[DPPL];
- state->m_maria_dl = (READ_MEM(state->m_maria_dll+1) << 8) | READ_MEM(state->m_maria_dll+2);
- state->m_maria_offset = READ_MEM(state->m_maria_dll) & 0x0f;
- state->m_maria_holey = (READ_MEM(state->m_maria_dll) & 0x60) >> 5;
- state->m_maria_dli = READ_MEM(state->m_maria_dll) & 0x80;
- /* logerror("DLL=%x\n",state->m_maria_dll); */
- /* logerror("DLL: DL = %x dllctrl = %x\n",state->m_maria_dl,ROM[state->m_maria_dll]); */
+ m_maria_dodma = 1; /* if dma allowed, start it */
+
+ m_maria_dll = (ROM[DPPH] << 8) | ROM[DPPL];
+ m_maria_dl = (READ_MEM(m_maria_dll+1) << 8) | READ_MEM(m_maria_dll+2);
+ m_maria_offset = READ_MEM(m_maria_dll) & 0x0f;
+ m_maria_holey = (READ_MEM(m_maria_dll) & 0x60) >> 5;
+ m_maria_dli = READ_MEM(m_maria_dll) & 0x80;
+ /* logerror("DLL=%x\n",m_maria_dll); */
+ /* logerror("DLL: DL = %x dllctrl = %x\n",m_maria_dl,ROM[m_maria_dll]); */
}
/*logerror( "vblank end on line %d\n", frame_scanline );*/
@@ -364,11 +363,11 @@ TIMER_DEVICE_CALLBACK( a7800_interrupt )
this fix made PR Baseball happy
Kung-Fu Master looks worse
don't know about others yet */
- if( frame_scanline == ( state->m_lines - 4 ) )
+ if( frame_scanline == ( m_lines - 4 ) )
{
/* vblank starts 4 scanlines before end of screen */
- state->m_maria_vblank = 0x80;
+ m_maria_vblank = 0x80;
/* fixed 2002/05/14 kubecj
when going vblank, dma must be stopped
@@ -385,39 +384,39 @@ TIMER_DEVICE_CALLBACK( a7800_interrupt )
Jinks
*/
- state->m_maria_dodma = 0;
+ m_maria_dodma = 0;
/*logerror( "vblank on line %d\n\n", frame_scanline );*/
}
- if( ( frame_scanline > 15 ) && state->m_maria_dodma )
+ if( ( frame_scanline > 15 ) && m_maria_dodma )
{
- if (state->m_maria_scanline < ( state->m_lines - 4 ) )
- maria_draw_scanline(timer.machine());
+ if (m_maria_scanline < ( m_lines - 4 ) )
+ maria_draw_scanline(machine());
- if( state->m_maria_offset == 0 )
+ if( m_maria_offset == 0 )
{
- state->m_maria_dll+=3;
- state->m_maria_dl = (READ_MEM(state->m_maria_dll+1) << 8) | READ_MEM(state->m_maria_dll+2);
- state->m_maria_offset = READ_MEM(state->m_maria_dll) & 0x0f;
- state->m_maria_holey = (READ_MEM(state->m_maria_dll) & 0x60) >> 5;
- state->m_maria_dli = READ_MEM(state->m_maria_dll) & 0x80;
+ m_maria_dll+=3;
+ m_maria_dl = (READ_MEM(m_maria_dll+1) << 8) | READ_MEM(m_maria_dll+2);
+ m_maria_offset = READ_MEM(m_maria_dll) & 0x0f;
+ m_maria_holey = (READ_MEM(m_maria_dll) & 0x60) >> 5;
+ m_maria_dli = READ_MEM(m_maria_dll) & 0x80;
}
else
{
- state->m_maria_offset--;
+ m_maria_offset--;
}
}
- if( state->m_maria_dli )
+ if( m_maria_dli )
{
/*logerror( "dli on line %d [%02X] [%02X] [%02X]\n", frame_scanline, ROM[0x7E], ROM[0x7C], ROM[0x7D] );*/
}
- if( state->m_maria_dli )
+ if( m_maria_dli )
{
- state->m_maria_dli = 0;
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_maria_dli = 0;
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
diff --git a/src/mess/video/cgc7900.c b/src/mess/video/cgc7900.c
index 779951bf6f0..5885df5f878 100644
--- a/src/mess/video/cgc7900.c
+++ b/src/mess/video/cgc7900.c
@@ -173,11 +173,9 @@ void cgc7900_state::draw_overlay(screen_device *screen, bitmap_rgb32 &bitmap)
TIMER_DEVICE_CALLBACK( blink_tick )
-------------------------------------------------*/
-static TIMER_DEVICE_CALLBACK( blink_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(cgc7900_state::blink_tick)
{
- cgc7900_state *state = timer.machine().driver_data<cgc7900_state>();
-
- state->m_blink = !state->m_blink;
+ m_blink = !m_blink;
}
/*-------------------------------------------------
@@ -244,5 +242,5 @@ MACHINE_CONFIG_FRAGMENT( cgc7900_video )
MCFG_GFXDECODE(cgc7900)
- MCFG_TIMER_ADD_PERIODIC("blink", blink_tick, attotime::from_hz(XTAL_28_48MHz/7500000))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("blink", cgc7900_state, blink_tick, attotime::from_hz(XTAL_28_48MHz/7500000))
MACHINE_CONFIG_END
diff --git a/src/mess/video/tmc600.c b/src/mess/video/tmc600.c
index 0db03796f85..4f3580fdfe7 100644
--- a/src/mess/video/tmc600.c
+++ b/src/mess/video/tmc600.c
@@ -43,11 +43,9 @@ WRITE8_MEMBER( tmc600_state::vismac_data_w )
}
}
-static TIMER_DEVICE_CALLBACK( blink_tick )
+TIMER_DEVICE_CALLBACK_MEMBER(tmc600_state::blink_tick)
{
- tmc600_state *state = timer.machine().driver_data<tmc600_state>();
-
- state->m_blink = !state->m_blink;
+ m_blink = !m_blink;
}
UINT8 tmc600_state::get_color(UINT16 pma)
@@ -146,7 +144,7 @@ GFXDECODE_END
MACHINE_CONFIG_FRAGMENT( tmc600_video )
// video hardware
MCFG_CDP1869_SCREEN_PAL_ADD(CDP1869_TAG, SCREEN_TAG, CDP1869_DOT_CLK_PAL)
- MCFG_TIMER_ADD_PERIODIC("blink", blink_tick, attotime::from_hz(2))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("blink", tmc600_state, blink_tick, attotime::from_hz(2))
MCFG_GFXDECODE(tmc600)
// sound hardware