summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2016-04-30 16:31:47 -0400
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2016-04-30 16:39:27 -0400
commitdafe4d8e22d41a6d2f79c1d1d076ca1a18291401 (patch) (github)
tree11a27122fbf7a667498a60c1270443e6c75c4e27 /src
parenta717ba24ede14435f1c4f0dd15f76b2812db27b7 (diff)
downloadmame-dafe4d8e22d41a6d2f79c1d1d076ca1a18291401.tar.bz2
mame-dafe4d8e22d41a6d2f79c1d1d076ca1a18291401.zip
Make watchdog timer a separate device
- Separate watchdog implementation from running_machine (once again) and driver_device - Old-style methods, now hidden behind #ifdefs, will probably be safe to remove soon
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/abckb/abc77.cpp5
-rw-r--r--src/devices/bus/abckb/abc77.h2
-rw-r--r--src/devices/machine/watchdog.cpp223
-rw-r--r--src/devices/machine/watchdog.h95
-rw-r--r--src/emu/driver.cpp4
-rw-r--r--src/emu/driver.h2
-rw-r--r--src/emu/machine.cpp12
-rw-r--r--src/emu/machine.h6
-rw-r--r--src/emu/mconfig.cpp2
-rw-r--r--src/emu/mconfig.h4
-rw-r--r--src/mame/drivers/1943.cpp5
-rw-r--r--src/mame/drivers/20pacgal.cpp7
-rw-r--r--src/mame/drivers/8080bw.cpp94
-rw-r--r--src/mame/drivers/88games.cpp5
-rw-r--r--src/mame/drivers/abc1600.cpp2
-rw-r--r--src/mame/drivers/acefruit.cpp5
-rw-r--r--src/mame/drivers/airbustr.cpp5
-rw-r--r--src/mame/drivers/ajax.cpp2
-rw-r--r--src/mame/drivers/albazg.cpp8
-rw-r--r--src/mame/drivers/aliens.cpp5
-rw-r--r--src/mame/drivers/ambush.cpp5
-rw-r--r--src/mame/drivers/ampoker2.cpp4
-rw-r--r--src/mame/drivers/arcadecl.cpp5
-rw-r--r--src/mame/drivers/aristmk5.cpp9
-rw-r--r--src/mame/drivers/arkanoid.cpp13
-rw-r--r--src/mame/drivers/asteroid.cpp9
-rw-r--r--src/mame/drivers/asuka.cpp5
-rw-r--r--src/mame/drivers/atari_s1.cpp9
-rw-r--r--src/mame/drivers/atari_s2.cpp6
-rw-r--r--src/mame/drivers/atarifb.cpp10
-rw-r--r--src/mame/drivers/atarig1.cpp5
-rw-r--r--src/mame/drivers/atarig42.cpp5
-rw-r--r--src/mame/drivers/atarisy1.cpp5
-rw-r--r--src/mame/drivers/atarisy2.cpp4
-rw-r--r--src/mame/drivers/atetris.cpp11
-rw-r--r--src/mame/drivers/avalnche.cpp6
-rw-r--r--src/mame/drivers/aztarac.cpp6
-rw-r--r--src/mame/drivers/badlands.cpp7
-rw-r--r--src/mame/drivers/balsente.cpp5
-rw-r--r--src/mame/drivers/baraduke.cpp5
-rw-r--r--src/mame/drivers/batman.cpp5
-rw-r--r--src/mame/drivers/battlnts.cpp4
-rw-r--r--src/mame/drivers/beathead.cpp6
-rw-r--r--src/mame/drivers/beezer.cpp2
-rw-r--r--src/mame/drivers/bfm_sc1.cpp5
-rw-r--r--src/mame/drivers/bfm_sc2.cpp11
-rw-r--r--src/mame/drivers/bking.cpp7
-rw-r--r--src/mame/drivers/bladestl.cpp4
-rw-r--r--src/mame/drivers/blktiger.cpp6
-rw-r--r--src/mame/drivers/blockhl.cpp5
-rw-r--r--src/mame/drivers/blstroid.cpp5
-rw-r--r--src/mame/drivers/blueprnt.cpp5
-rw-r--r--src/mame/drivers/bottom9.cpp5
-rw-r--r--src/mame/drivers/boxer.cpp5
-rw-r--r--src/mame/drivers/bublbobl.cpp9
-rw-r--r--src/mame/drivers/buggychl.cpp4
-rw-r--r--src/mame/drivers/bwidow.cpp4
-rw-r--r--src/mame/drivers/bzone.cpp7
-rw-r--r--src/mame/drivers/canyon.cpp6
-rw-r--r--src/mame/drivers/capbowl.cpp4
-rw-r--r--src/mame/drivers/cave.cpp22
-rw-r--r--src/mame/drivers/ccastles.cpp6
-rw-r--r--src/mame/drivers/cchasm.cpp5
-rw-r--r--src/mame/drivers/centiped.cpp17
-rw-r--r--src/mame/drivers/champbas.cpp17
-rw-r--r--src/mame/drivers/changela.cpp4
-rw-r--r--src/mame/drivers/chqflag.cpp5
-rw-r--r--src/mame/drivers/circusc.cpp7
-rw-r--r--src/mame/drivers/cischeat.cpp4
-rw-r--r--src/mame/drivers/clayshoo.cpp4
-rw-r--r--src/mame/drivers/cloak.cpp5
-rw-r--r--src/mame/drivers/cloud9.cpp6
-rw-r--r--src/mame/drivers/combatsc.cpp5
-rw-r--r--src/mame/drivers/crimfght.cpp5
-rw-r--r--src/mame/drivers/cyberbal.cpp9
-rw-r--r--src/mame/drivers/dambustr.cpp5
-rw-r--r--src/mame/drivers/darius.cpp9
-rw-r--r--src/mame/drivers/dblcrown.cpp7
-rw-r--r--src/mame/drivers/dcheese.cpp7
-rw-r--r--src/mame/drivers/ddribble.cpp4
-rw-r--r--src/mame/drivers/deadang.cpp5
-rw-r--r--src/mame/drivers/decocass.cpp1
-rw-r--r--src/mame/drivers/destroyr.cpp6
-rw-r--r--src/mame/drivers/dlair.cpp4
-rw-r--r--src/mame/drivers/docastle.cpp9
-rw-r--r--src/mame/drivers/dragrace.cpp8
-rw-r--r--src/mame/drivers/dribling.cpp4
-rw-r--r--src/mame/drivers/dunhuang.cpp5
-rw-r--r--src/mame/drivers/epos.cpp8
-rw-r--r--src/mame/drivers/eprom.cpp11
-rw-r--r--src/mame/drivers/equites.cpp5
-rw-r--r--src/mame/drivers/espial.cpp6
-rw-r--r--src/mame/drivers/expro02.cpp3
-rw-r--r--src/mame/drivers/exterm.cpp5
-rw-r--r--src/mame/drivers/fastfred.cpp7
-rw-r--r--src/mame/drivers/fastlane.cpp5
-rw-r--r--src/mame/drivers/finalizr.cpp5
-rw-r--r--src/mame/drivers/firefox.cpp4
-rw-r--r--src/mame/drivers/firetrk.cpp12
-rw-r--r--src/mame/drivers/flkatck.cpp3
-rw-r--r--src/mame/drivers/foodf.cpp6
-rw-r--r--src/mame/drivers/fortecar.cpp7
-rw-r--r--src/mame/drivers/funkybee.cpp5
-rw-r--r--src/mame/drivers/gaelco.cpp2
-rw-r--r--src/mame/drivers/gaiden.cpp9
-rw-r--r--src/mame/drivers/galaga.cpp20
-rw-r--r--src/mame/drivers/galastrm.cpp4
-rw-r--r--src/mame/drivers/galaxian.cpp46
-rw-r--r--src/mame/drivers/galaxold.cpp39
-rw-r--r--src/mame/drivers/galpani3.cpp5
-rw-r--r--src/mame/drivers/galpanic.cpp4
-rw-r--r--src/mame/drivers/gaplus.cpp7
-rw-r--r--src/mame/drivers/gauntlet.cpp5
-rw-r--r--src/mame/drivers/gberet.cpp6
-rw-r--r--src/mame/drivers/gottlieb.cpp9
-rw-r--r--src/mame/drivers/gotya.cpp4
-rw-r--r--src/mame/drivers/gradius3.cpp5
-rw-r--r--src/mame/drivers/grchamp.cpp5
-rw-r--r--src/mame/drivers/gridlee.cpp5
-rw-r--r--src/mame/drivers/groundfx.cpp4
-rw-r--r--src/mame/drivers/gunbustr.cpp4
-rw-r--r--src/mame/drivers/gunsmoke.cpp5
-rw-r--r--src/mame/drivers/harddriv.cpp13
-rw-r--r--src/mame/drivers/hcastle.cpp4
-rw-r--r--src/mame/drivers/hexion.cpp6
-rw-r--r--src/mame/drivers/holeland.cpp7
-rw-r--r--src/mame/drivers/hornet.cpp9
-rw-r--r--src/mame/drivers/hyperspt.cpp7
-rw-r--r--src/mame/drivers/itech32.cpp13
-rw-r--r--src/mame/drivers/jackal.cpp4
-rw-r--r--src/mame/drivers/jaguar.cpp7
-rw-r--r--src/mame/drivers/jailbrek.cpp4
-rw-r--r--src/mame/drivers/jchan.cpp7
-rw-r--r--src/mame/drivers/jedi.cpp5
-rw-r--r--src/mame/drivers/junofrst.cpp5
-rw-r--r--src/mame/drivers/kaneko16.cpp27
-rw-r--r--src/mame/drivers/klax.cpp7
-rw-r--r--src/mame/drivers/kyugo.cpp36
-rw-r--r--src/mame/drivers/labyrunr.cpp4
-rw-r--r--src/mame/drivers/liberatr.cpp6
-rw-r--r--src/mame/drivers/lockon.cpp3
-rw-r--r--src/mame/drivers/looping.cpp5
-rw-r--r--src/mame/drivers/lwings.cpp11
-rw-r--r--src/mame/drivers/mappy.cpp19
-rw-r--r--src/mame/drivers/mcatadv.cpp5
-rw-r--r--src/mame/drivers/mcr.cpp10
-rw-r--r--src/mame/drivers/mcr3.cpp8
-rw-r--r--src/mame/drivers/mcr68.cpp16
-rw-r--r--src/mame/drivers/megazone.cpp7
-rw-r--r--src/mame/drivers/meritm.cpp4
-rw-r--r--src/mame/drivers/metro.cpp17
-rw-r--r--src/mame/drivers/mhavoc.cpp7
-rw-r--r--src/mame/drivers/midtunit.cpp5
-rw-r--r--src/mame/drivers/midvunit.cpp8
-rw-r--r--src/mame/drivers/mikie.cpp4
-rw-r--r--src/mame/drivers/missile.cpp8
-rw-r--r--src/mame/drivers/momoko.cpp5
-rw-r--r--src/mame/drivers/multfish.cpp3
-rw-r--r--src/mame/drivers/mw18w.cpp5
-rw-r--r--src/mame/drivers/mw8080bw.cpp72
-rw-r--r--src/mame/drivers/mwsub.cpp5
-rw-r--r--src/mame/drivers/namcos86.cpp5
-rw-r--r--src/mame/drivers/nemesis.cpp29
-rw-r--r--src/mame/drivers/neogeo.cpp6
-rw-r--r--src/mame/drivers/nitedrvr.cpp7
-rw-r--r--src/mame/drivers/nova2001.cpp5
-rw-r--r--src/mame/drivers/offtwall.cpp5
-rw-r--r--src/mame/drivers/ohmygod.cpp4
-rw-r--r--src/mame/drivers/omegrace.cpp5
-rw-r--r--src/mame/drivers/onetwo.cpp6
-rw-r--r--src/mame/drivers/orbit.cpp4
-rw-r--r--src/mame/drivers/pacland.cpp7
-rw-r--r--src/mame/drivers/pacman.cpp35
-rw-r--r--src/mame/drivers/pandoras.cpp6
-rw-r--r--src/mame/drivers/parodius.cpp6
-rw-r--r--src/mame/drivers/pingpong.cpp6
-rw-r--r--src/mame/drivers/pitnrun.cpp4
-rw-r--r--src/mame/drivers/plygonet.cpp5
-rw-r--r--src/mame/drivers/polepos.cpp9
-rw-r--r--src/mame/drivers/poolshrk.cpp6
-rw-r--r--src/mame/drivers/pooyan.cpp4
-rw-r--r--src/mame/drivers/psikyosh.cpp4
-rw-r--r--src/mame/drivers/quantum.cpp5
-rw-r--r--src/mame/drivers/rallyx.cpp9
-rw-r--r--src/mame/drivers/rampart.cpp6
-rw-r--r--src/mame/drivers/rastan.cpp4
-rw-r--r--src/mame/drivers/relief.cpp5
-rw-r--r--src/mame/drivers/retofinv.cpp5
-rw-r--r--src/mame/drivers/rockrage.cpp4
-rw-r--r--src/mame/drivers/rocnrope.cpp5
-rw-r--r--src/mame/drivers/rollerg.cpp5
-rw-r--r--src/mame/drivers/sandscrp.cpp4
-rw-r--r--src/mame/drivers/sauro.cpp9
-rw-r--r--src/mame/drivers/sbasketb.cpp5
-rw-r--r--src/mame/drivers/sbowling.cpp5
-rw-r--r--src/mame/drivers/sbrkout.cpp8
-rw-r--r--src/mame/drivers/scobra.cpp19
-rw-r--r--src/mame/drivers/scotrsht.cpp5
-rw-r--r--src/mame/drivers/scramble.cpp33
-rw-r--r--src/mame/drivers/segaorun.cpp8
-rw-r--r--src/mame/drivers/segas16a.cpp6
-rw-r--r--src/mame/drivers/segaxbd.cpp5
-rw-r--r--src/mame/drivers/segaybd.cpp4
-rw-r--r--src/mame/drivers/seicross.cpp5
-rw-r--r--src/mame/drivers/seta.cpp37
-rw-r--r--src/mame/drivers/seta2.cpp27
-rw-r--r--src/mame/drivers/shadfrce.cpp5
-rw-r--r--src/mame/drivers/shaolins.cpp4
-rw-r--r--src/mame/drivers/shougi.cpp7
-rw-r--r--src/mame/drivers/shuuz.cpp5
-rw-r--r--src/mame/drivers/sidearms.cpp13
-rw-r--r--src/mame/drivers/sigmab98.cpp11
-rw-r--r--src/mame/drivers/simpsons.cpp5
-rw-r--r--src/mame/drivers/skullxbo.cpp7
-rw-r--r--src/mame/drivers/skydiver.cpp6
-rw-r--r--src/mame/drivers/skykid.cpp6
-rw-r--r--src/mame/drivers/skyraid.cpp7
-rw-r--r--src/mame/drivers/snowbros.cpp12
-rw-r--r--src/mame/drivers/speedatk.cpp6
-rw-r--r--src/mame/drivers/sprint2.cpp8
-rw-r--r--src/mame/drivers/sprint4.cpp7
-rw-r--r--src/mame/drivers/spy.cpp6
-rw-r--r--src/mame/drivers/sspeedr.cpp5
-rw-r--r--src/mame/drivers/ssv.cpp55
-rw-r--r--src/mame/drivers/starwars.cpp5
-rw-r--r--src/mame/drivers/suna8.cpp5
-rw-r--r--src/mame/drivers/supdrapo.cpp6
-rw-r--r--src/mame/drivers/superchs.cpp4
-rw-r--r--src/mame/drivers/supertnk.cpp5
-rw-r--r--src/mame/drivers/suprridr.cpp5
-rw-r--r--src/mame/drivers/surpratk.cpp5
-rw-r--r--src/mame/drivers/taito_f2.cpp19
-rw-r--r--src/mame/drivers/taito_f3.cpp4
-rw-r--r--src/mame/drivers/taito_o.cpp3
-rw-r--r--src/mame/drivers/taitosj.cpp5
-rw-r--r--src/mame/drivers/tecmo.cpp7
-rw-r--r--src/mame/drivers/tecmosys.cpp6
-rw-r--r--src/mame/drivers/tehkanwc.cpp7
-rw-r--r--src/mame/drivers/tempest.cpp8
-rw-r--r--src/mame/drivers/tetrisp2.cpp25
-rw-r--r--src/mame/drivers/thedealr.cpp5
-rw-r--r--src/mame/drivers/thepit.cpp9
-rw-r--r--src/mame/drivers/thoop2.cpp5
-rw-r--r--src/mame/drivers/thunderj.cpp5
-rw-r--r--src/mame/drivers/thunderx.cpp6
-rw-r--r--src/mame/drivers/tickee.cpp5
-rw-r--r--src/mame/drivers/timelimt.cpp4
-rw-r--r--src/mame/drivers/timeplt.cpp5
-rw-r--r--src/mame/drivers/tmaster.cpp4
-rw-r--r--src/mame/drivers/tmnt.cpp41
-rw-r--r--src/mame/drivers/toki.cpp5
-rw-r--r--src/mame/drivers/tomcat.cpp5
-rw-r--r--src/mame/drivers/toobin.cpp6
-rw-r--r--src/mame/drivers/tourtabl.cpp11
-rw-r--r--src/mame/drivers/tp84.cpp6
-rw-r--r--src/mame/drivers/trackfld.cpp15
-rw-r--r--src/mame/drivers/triplhnt.cpp4
-rw-r--r--src/mame/drivers/truco.cpp4
-rw-r--r--src/mame/drivers/trucocl.cpp5
-rw-r--r--src/mame/drivers/tutankhm.cpp5
-rw-r--r--src/mame/drivers/twin16.cpp9
-rw-r--r--src/mame/drivers/twinkle.cpp4
-rw-r--r--src/mame/drivers/tx1.cpp13
-rw-r--r--src/mame/drivers/ultraman.cpp5
-rw-r--r--src/mame/drivers/ultratnk.cpp7
-rw-r--r--src/mame/drivers/undrfire.cpp7
-rw-r--r--src/mame/drivers/vastar.cpp5
-rw-r--r--src/mame/drivers/vendetta.cpp5
-rw-r--r--src/mame/drivers/videopin.cpp4
-rw-r--r--src/mame/drivers/vindictr.cpp5
-rw-r--r--src/mame/drivers/vlc.cpp4
-rw-r--r--src/mame/drivers/warpwarp.cpp4
-rw-r--r--src/mame/drivers/wc90.cpp7
-rw-r--r--src/mame/drivers/williams.cpp9
-rw-r--r--src/mame/drivers/wiping.cpp5
-rw-r--r--src/mame/drivers/wiz.cpp5
-rw-r--r--src/mame/drivers/wmg.cpp2
-rw-r--r--src/mame/drivers/wolfpack.cpp5
-rw-r--r--src/mame/drivers/xmen.cpp9
-rw-r--r--src/mame/drivers/xtheball.cpp7
-rw-r--r--src/mame/drivers/xybots.cpp5
-rw-r--r--src/mame/drivers/yiear.cpp4
-rw-r--r--src/mame/drivers/zaccaria.cpp5
-rw-r--r--src/mame/drivers/zodiack.cpp5
-rw-r--r--src/mame/drivers/zr107.cpp9
-rw-r--r--src/mame/includes/airbustr.h5
-rw-r--r--src/mame/includes/ajax.h3
-rw-r--r--src/mame/includes/ampoker2.h5
-rw-r--r--src/mame/includes/atarisy2.h1
-rw-r--r--src/mame/includes/beezer.h3
-rw-r--r--src/mame/includes/canyon.h3
-rw-r--r--src/mame/includes/capbowl.h3
-rw-r--r--src/mame/includes/champbas.h3
-rw-r--r--src/mame/includes/cischeat.h3
-rw-r--r--src/mame/includes/darius.h1
-rw-r--r--src/mame/includes/decocass.h3
-rw-r--r--src/mame/includes/dragrace.h3
-rw-r--r--src/mame/includes/dribling.h4
-rw-r--r--src/mame/includes/firetrk.h3
-rw-r--r--src/mame/includes/flkatck.h4
-rw-r--r--src/mame/includes/funkybee.h4
-rw-r--r--src/mame/includes/galastrm.h3
-rw-r--r--src/mame/includes/grchamp.h3
-rw-r--r--src/mame/includes/groundfx.h4
-rw-r--r--src/mame/includes/gunbustr.h3
-rw-r--r--src/mame/includes/harddriv.h2
-rw-r--r--src/mame/includes/kyugo.h1
-rw-r--r--src/mame/includes/liberatr.h1
-rw-r--r--src/mame/includes/lockon.h3
-rw-r--r--src/mame/includes/mcatadv.h4
-rw-r--r--src/mame/includes/mcr.h7
-rw-r--r--src/mame/includes/mcr68.h3
-rw-r--r--src/mame/includes/midvunit.h3
-rw-r--r--src/mame/includes/multfish.h1
-rw-r--r--src/mame/includes/mw8080bw.h3
-rw-r--r--src/mame/includes/namcos86.h3
-rw-r--r--src/mame/includes/poolshrk.h3
-rw-r--r--src/mame/includes/segaorun.h3
-rw-r--r--src/mame/includes/segas16a.h3
-rw-r--r--src/mame/includes/segaxbd.h2
-rw-r--r--src/mame/includes/segaybd.h3
-rw-r--r--src/mame/includes/skydiver.h3
-rw-r--r--src/mame/includes/sprint2.h3
-rw-r--r--src/mame/includes/sprint4.h5
-rw-r--r--src/mame/includes/superchs.h3
-rw-r--r--src/mame/includes/taito_f3.h3
-rw-r--r--src/mame/includes/taito_o.h3
-rw-r--r--src/mame/includes/tecmosys.h3
-rw-r--r--src/mame/includes/triplhnt.h3
-rw-r--r--src/mame/includes/truco.h4
-rw-r--r--src/mame/includes/ultratnk.h3
-rw-r--r--src/mame/includes/undrfire.h4
-rw-r--r--src/mame/includes/warpwarp.h3
-rw-r--r--src/mame/includes/williams.h8
-rw-r--r--src/mame/machine/abc1600mac.cpp13
-rw-r--r--src/mame/machine/abc1600mac.h4
-rw-r--r--src/mame/machine/ajax.cpp2
-rw-r--r--src/mame/machine/beezer.cpp2
-rw-r--r--src/mame/machine/c117.cpp21
-rw-r--r--src/mame/machine/c117.h5
-rw-r--r--src/mame/machine/kaneko_hit.cpp5
-rw-r--r--src/mame/machine/kaneko_hit.h4
-rw-r--r--src/mame/machine/mcr68.cpp3
-rw-r--r--src/mame/machine/taitoio.cpp44
-rw-r--r--src/mame/machine/taitoio.h11
-rw-r--r--src/mame/machine/williams.cpp9
-rw-r--r--src/mame/video/airbustr.cpp1
-rw-r--r--src/mame/video/canyon.cpp2
-rw-r--r--src/mame/video/cischeat.cpp2
-rw-r--r--src/mame/video/decocass.cpp4
-rw-r--r--src/mame/video/mcr68.cpp1
-rw-r--r--src/mame/video/skydiver.cpp2
352 files changed, 2175 insertions, 720 deletions
diff --git a/src/devices/bus/abckb/abc77.cpp b/src/devices/bus/abckb/abc77.cpp
index ecf70d0864b..315d678db8b 100644
--- a/src/devices/bus/abckb/abc77.cpp
+++ b/src/devices/bus/abckb/abc77.cpp
@@ -136,6 +136,7 @@ static MACHINE_CONFIG_FRAGMENT( abc77 )
MCFG_CPU_IO_MAP(abc77_io)
// watchdog
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_hz(XTAL_4_608MHz/3/5/4096))
// discrete sound
@@ -425,6 +426,7 @@ abc77_device::abc77_device(const machine_config &mconfig, const char *tag, devic
device_t(mconfig, ABC77, "Luxor ABC 77", tag, owner, clock, "abc77", __FILE__),
abc_keyboard_interface(mconfig, *this),
m_maincpu(*this, I8035_TAG),
+ m_watchdog(*this, "watchdog"),
m_discrete(*this, DISCRETE_TAG),
m_x0(*this, "X0"),
m_x1(*this, "X1"),
@@ -450,6 +452,7 @@ abc77_device::abc77_device(const machine_config &mconfig, device_type type, cons
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
abc_keyboard_interface(mconfig, *this),
m_maincpu(*this, I8035_TAG),
+ m_watchdog(*this, "watchdog"),
m_discrete(*this, DISCRETE_TAG),
m_x0(*this, "X0"),
m_x1(*this, "X1"),
@@ -610,7 +613,7 @@ WRITE8_MEMBER( abc77_device::p2_w )
if (m_keylatch == 1)
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
}
diff --git a/src/devices/bus/abckb/abc77.h b/src/devices/bus/abckb/abc77.h
index 340dd86f8c6..0e8744ed6c2 100644
--- a/src/devices/bus/abckb/abc77.h
+++ b/src/devices/bus/abckb/abc77.h
@@ -13,6 +13,7 @@
#include "emu.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/watchdog.h"
#include "abckb.h"
#include "sound/discrete.h"
#include "sound/speaker.h"
@@ -66,6 +67,7 @@ protected:
inline void key_down(int state);
required_device<cpu_device> m_maincpu;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<discrete_sound_device> m_discrete;
required_ioport m_x0;
required_ioport m_x1;
diff --git a/src/devices/machine/watchdog.cpp b/src/devices/machine/watchdog.cpp
new file mode 100644
index 00000000000..845094daaba
--- /dev/null
+++ b/src/devices/machine/watchdog.cpp
@@ -0,0 +1,223 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ watchdog.c
+
+ Watchdog timer device.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "watchdog.h"
+
+
+//**************************************************************************
+// WATCHDOG TIMER DEVICE
+//**************************************************************************
+
+const device_type WATCHDOG_TIMER = &device_creator<watchdog_timer_device>;
+
+//-------------------------------------------------
+// watchdog_timer_device - constructor
+//-------------------------------------------------
+
+watchdog_timer_device::watchdog_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WATCHDOG_TIMER, "Watchdog timer", tag, owner, clock, "watchdog", __FILE__),
+ m_vblank_count(0),
+ m_time(attotime::zero),
+ m_screen_tag(nullptr)
+{
+}
+
+
+//-------------------------------------------------
+// static_set_vblank_count - configuration helper
+// to set the number of VBLANKs
+//-------------------------------------------------
+
+void watchdog_timer_device::static_set_vblank_count(device_t &device, const char *screen_tag, INT32 count)
+{
+ watchdog_timer_device &watchdog = downcast<watchdog_timer_device &>(device);
+ watchdog.m_screen_tag = screen_tag;
+ watchdog.m_vblank_count = count;
+}
+
+
+//-------------------------------------------------
+// static_set_time - configuration helper to set
+// the time until reset
+//-------------------------------------------------
+
+void watchdog_timer_device::static_set_time(device_t &device, attotime time)
+{
+ watchdog_timer_device &watchdog = downcast<watchdog_timer_device &>(device);
+ watchdog.m_time = time;
+}
+
+
+//-------------------------------------------------
+// device_validity_check - validate the device
+// configuration
+//-------------------------------------------------
+
+void watchdog_timer_device::device_validity_check(validity_checker &valid) const
+{
+ if (m_vblank_count != 0)
+ {
+ screen_device *screen = dynamic_cast<screen_device *>(siblingdevice(m_screen_tag));
+ if (screen == nullptr)
+ osd_printf_error("Invalid screen tag specified\n");
+ }
+}
+
+
+//-------------------------------------------------
+// device_start - perform device-specific
+// startup
+//-------------------------------------------------
+
+void watchdog_timer_device::device_start()
+{
+ // initialize the watchdog
+ m_counter = 0;
+ m_timer = timer_alloc();
+
+ if (m_vblank_count != 0)
+ {
+ // fetch the screen
+ screen_device *screen = siblingdevice<screen_device>(m_screen_tag);
+ if (screen != nullptr)
+ screen->register_vblank_callback(vblank_state_delegate(FUNC(watchdog_timer_device::watchdog_vblank), this));
+ }
+ save_item(NAME(m_enabled));
+ save_item(NAME(m_counter));
+}
+
+
+//-------------------------------------------------
+// device_reset - reset the device
+//-------------------------------------------------
+
+void watchdog_timer_device::device_reset()
+{
+ // set up the watchdog timer; only start off enabled if explicitly configured
+ m_enabled = (m_vblank_count != 0 || m_time != attotime::zero);
+ watchdog_reset();
+ m_enabled = true;
+}
+
+
+//-------------------------------------------------
+// device_timer - handle timer expiration events
+//-------------------------------------------------
+
+void watchdog_timer_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ watchdog_fired();
+}
+
+
+//-------------------------------------------------
+// watchdog_reset - reset the watchdog timer
+//-------------------------------------------------
+
+void watchdog_timer_device::watchdog_reset()
+{
+ // if we're not enabled, skip it
+ if (!m_enabled)
+ m_timer->adjust(attotime::never);
+
+ // VBLANK-based watchdog?
+ else if (m_vblank_count != 0)
+ m_counter = m_vblank_count;
+
+ // timer-based watchdog?
+ else if (m_time != attotime::zero)
+ m_timer->adjust(m_time);
+
+ // default to an obscene amount of time (3 seconds)
+ else
+ m_timer->adjust(attotime::from_seconds(3));
+}
+
+
+//-------------------------------------------------
+// watchdog_enable - reset the watchdog timer
+//-------------------------------------------------
+
+void watchdog_timer_device::watchdog_enable(bool enable)
+{
+ // when re-enabled, we reset our state
+ if (m_enabled != enable)
+ {
+ m_enabled = enable;
+ watchdog_reset();
+ }
+}
+
+
+//-------------------------------------------------
+// watchdog_fired - trigger machine reset
+//-------------------------------------------------
+
+void watchdog_timer_device::watchdog_fired()
+{
+ logerror("Reset caused by the watchdog!!!\n");
+
+ bool verbose = machine().options().verbose();
+#ifdef MAME_DEBUG
+ verbose = true;
+#endif
+ if (verbose)
+ popmessage("Reset caused by the watchdog!!!\n");
+
+ machine().schedule_soft_reset();
+}
+
+
+//-------------------------------------------------
+// watchdog_vblank - VBLANK state callback for
+// watchdog timers
+//-------------------------------------------------
+
+void watchdog_timer_device::watchdog_vblank(screen_device &screen, bool vblank_state)
+{
+ // VBLANK starting
+ if (vblank_state && m_enabled)
+ {
+ // check the watchdog
+ if (m_vblank_count != 0)
+ if (--m_counter == 0)
+ watchdog_fired();
+ }
+}
+
+
+//**************************************************************************
+// WATCHDOG READ/WRITE HELPERS
+//**************************************************************************
+
+//-------------------------------------------------
+// 8-bit reset read/write handlers
+//-------------------------------------------------
+
+WRITE8_MEMBER( watchdog_timer_device::reset_w ) { watchdog_reset(); }
+READ8_MEMBER( watchdog_timer_device::reset_r ) { watchdog_reset(); return space.unmap(); }
+
+
+//-------------------------------------------------
+// 16-bit reset read/write handlers
+//-------------------------------------------------
+
+WRITE16_MEMBER( watchdog_timer_device::reset16_w ) { watchdog_reset(); }
+READ16_MEMBER( watchdog_timer_device::reset16_r ) { watchdog_reset(); return space.unmap(); }
+
+
+//-------------------------------------------------
+// 32-bit reset read/write handlers
+//-------------------------------------------------
+
+WRITE32_MEMBER( watchdog_timer_device::reset32_w ) { watchdog_reset(); }
+READ32_MEMBER( watchdog_timer_device::reset32_r ) { watchdog_reset(); return space.unmap(); }
diff --git a/src/devices/machine/watchdog.h b/src/devices/machine/watchdog.h
new file mode 100644
index 00000000000..67cc915b092
--- /dev/null
+++ b/src/devices/machine/watchdog.h
@@ -0,0 +1,95 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+
+#pragma once
+
+#ifndef __WATCHDOG_H__
+#define __WATCHDOG_H__
+
+
+//**************************************************************************
+// DEVICE CONFIGURATION MACROS
+//**************************************************************************
+
+#ifdef LEGACY_WATCHDOG
+#undef MCFG_WATCHDOG_VBLANK_INIT
+#undef MCFG_WATCHDOG_TIME_INIT
+#define watchdog_reset_r MUST_USE_WATCHDOG_DEVICE_INSTEAD
+#define watchdog_reset_w MUST_USE_WATCHDOG_DEVICE_INSTEAD
+#define watchdog_reset16_r MUST_USE_WATCHDOG_DEVICE_INSTEAD
+#define watchdog_reset16_w MUST_USE_WATCHDOG_DEVICE_INSTEAD
+#define watchdog_reset32_r MUST_USE_WATCHDOG_DEVICE_INSTEAD
+#define watchdog_reset32_w MUST_USE_WATCHDOG_DEVICE_INSTEAD
+#endif
+
+#define MCFG_WATCHDOG_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, WATCHDOG_TIMER, 0)
+#define MCFG_WATCHDOG_MODIFY(_tag) \
+ MCFG_DEVICE_MODIFY(_tag)
+#define MCFG_WATCHDOG_VBLANK_INIT(_screen, _count) \
+ watchdog_timer_device::static_set_vblank_count(*device, _screen, _count);
+#define MCFG_WATCHDOG_TIME_INIT(_time) \
+ watchdog_timer_device::static_set_time(*device, _time);
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> watchdog_timer_device
+
+class watchdog_timer_device : public device_t
+{
+public:
+ // construction/destruction
+ watchdog_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_vblank_count(device_t &device, const char *screen_tag, INT32 count);
+ static void static_set_time(device_t &device, attotime time);
+
+ // watchdog control
+ void watchdog_reset();
+ void watchdog_enable(bool enable = true);
+ INT32 get_vblank_counter() const { return m_counter; }
+
+ // read/write handlers
+ DECLARE_WRITE8_MEMBER( reset_w );
+ DECLARE_READ8_MEMBER( reset_r );
+ DECLARE_WRITE16_MEMBER( reset16_w );
+ DECLARE_READ16_MEMBER( reset16_r );
+ DECLARE_WRITE32_MEMBER( reset32_w );
+ DECLARE_READ32_MEMBER( reset32_r );
+
+protected:
+ // device-level overrides
+ virtual void device_validity_check(validity_checker &valid) const override;
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+private:
+ // internal helpers
+ void watchdog_fired();
+ void watchdog_vblank(screen_device &screen, bool vblank_state);
+
+ // configuration data
+ INT32 m_vblank_count; // number of VBLANKs until resetting the machine
+ attotime m_time; // length of time until resetting the machine
+ const char * m_screen_tag; // the tag of the screen this timer tracks
+
+ // internal state
+ bool m_enabled; // is the watchdog enabled?
+ INT32 m_counter; // counter for VBLANK tracking
+ emu_timer * m_timer; // timer for triggering reset
+};
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+extern const device_type WATCHDOG_TIMER;
+
+
+#endif
diff --git a/src/emu/driver.cpp b/src/emu/driver.cpp
index a2240ee7dd7..5319b9110b4 100644
--- a/src/emu/driver.cpp
+++ b/src/emu/driver.cpp
@@ -381,6 +381,8 @@ INTERRUPT_GEN_MEMBER( driver_device::irq7_line_assert ) { device.execute().set_i
// WATCHDOG READ/WRITE HELPERS
//**************************************************************************
+#ifdef LEGACY_WATCHDOG
+
//-------------------------------------------------
// 8-bit reset read/write handlers
//-------------------------------------------------
@@ -404,6 +406,8 @@ READ16_MEMBER( driver_device::watchdog_reset16_r ) { machine().watchdog_reset();
WRITE32_MEMBER( driver_device::watchdog_reset32_w ) { machine().watchdog_reset(); }
READ32_MEMBER( driver_device::watchdog_reset32_r ) { machine().watchdog_reset(); return space.unmap(); }
+#endif
+
//**************************************************************************
diff --git a/src/emu/driver.h b/src/emu/driver.h
index 20d4036dc43..c89c2c3ccd0 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -179,6 +179,7 @@ public:
INTERRUPT_GEN_MEMBER( irq7_line_pulse );
INTERRUPT_GEN_MEMBER( irq7_line_assert );
+#ifdef LEGACY_WATCHDOG
// watchdog read/write handlers
DECLARE_WRITE8_MEMBER( watchdog_reset_w );
DECLARE_READ8_MEMBER( watchdog_reset_r );
@@ -186,6 +187,7 @@ public:
DECLARE_READ16_MEMBER( watchdog_reset16_r );
DECLARE_WRITE32_MEMBER( watchdog_reset32_w );
DECLARE_READ32_MEMBER( watchdog_reset32_r );
+#endif
// generic audio
void soundlatch_setclearedvalue(UINT16 value) { m_latch_clear_value = value; }
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index a11afa2ab5b..01072161b1b 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -230,6 +230,7 @@ void running_machine::start()
m_rom_load = make_unique_clear<rom_load_manager>(*this);
m_memory.initialize();
+#ifdef LEGACY_WATCHDOG
// initialize the watchdog
m_watchdog_counter = 0;
m_watchdog_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::watchdog_fired), this));
@@ -237,6 +238,7 @@ void running_machine::start()
primary_screen->register_vblank_callback(vblank_state_delegate(FUNC(running_machine::watchdog_vblank), this));
save().save_item(NAME(m_watchdog_enabled));
save().save_item(NAME(m_watchdog_counter));
+#endif
// save the random seed or save states might be broken in drivers that use the rand() method
save().save_item(NAME(m_rand_seed));
@@ -877,10 +879,12 @@ void running_machine::soft_reset(void *ptr, INT32 param)
// temporarily in the reset phase
m_current_phase = MACHINE_PHASE_RESET;
+#ifdef LEGACY_WATCHDOG
// set up the watchdog timer; only start off enabled if explicitly configured
m_watchdog_enabled = (config().m_watchdog_vblank_count != 0 || config().m_watchdog_time != attotime::zero);
watchdog_reset();
m_watchdog_enabled = true;
+#endif
// call all registered reset callbacks
call_notifiers(MACHINE_NOTIFY_RESET);
@@ -894,6 +898,7 @@ void running_machine::soft_reset(void *ptr, INT32 param)
// watchdog_reset - reset the watchdog timer
//-------------------------------------------------
+#ifdef LEGACY_WATCHDOG
void running_machine::watchdog_reset()
{
// if we're not enabled, skip it
@@ -912,12 +917,14 @@ void running_machine::watchdog_reset()
else
m_watchdog_timer->adjust(attotime::from_seconds(3));
}
+#endif
//-------------------------------------------------
// watchdog_enable - reset the watchdog timer
//-------------------------------------------------
+#ifdef LEGACY_WATCHDOG
void running_machine::watchdog_enable(bool enable)
{
// when re-enabled, we reset our state
@@ -927,12 +934,14 @@ void running_machine::watchdog_enable(bool enable)
watchdog_reset();
}
}
+#endif
//-------------------------------------------------
// watchdog_fired - watchdog timer callback
//-------------------------------------------------
+#ifdef LEGACY_WATCHDOG
void running_machine::watchdog_fired(void *ptr, INT32 param)
{
logerror("Reset caused by the watchdog!!!\n");
@@ -946,6 +955,7 @@ void running_machine::watchdog_fired(void *ptr, INT32 param)
schedule_soft_reset();
}
+#endif
//-------------------------------------------------
@@ -953,6 +963,7 @@ void running_machine::watchdog_fired(void *ptr, INT32 param)
// watchdog timers
//-------------------------------------------------
+#ifdef LEGACY_WATCHDOG
void running_machine::watchdog_vblank(screen_device &screen, bool vblank_state)
{
// VBLANK starting
@@ -964,6 +975,7 @@ void running_machine::watchdog_vblank(screen_device &screen, bool vblank_state)
watchdog_fired();
}
}
+#endif
//-------------------------------------------------
diff --git a/src/emu/machine.h b/src/emu/machine.h
index 008a350c78d..421ffb5162b 100644
--- a/src/emu/machine.h
+++ b/src/emu/machine.h
@@ -227,10 +227,12 @@ public:
void base_datetime(system_time &systime);
void current_datetime(system_time &systime);
+#ifdef LEGACY_WATCHDOG
// watchdog control
void watchdog_reset();
void watchdog_enable(bool enable = true);
INT32 get_vblank_watchdog_counter() const { return m_watchdog_counter; }
+#endif
// misc
void popmessage() const { popmessage(static_cast<char const *>(nullptr)); }
@@ -262,8 +264,10 @@ private:
std::string get_statename(const char *statename_opt) const;
void handle_saveload();
void soft_reset(void *ptr = nullptr, INT32 param = 0);
+#ifdef LEGACY_WATCHDOG
void watchdog_fired(void *ptr = nullptr, INT32 param = 0);
void watchdog_vblank(screen_device &screen, bool vblank_state);
+#endif
std::string nvram_filename(device_t &device) const;
void nvram_load();
void nvram_save();
@@ -309,10 +313,12 @@ private:
bool m_exit_pending; // is an exit pending?
emu_timer * m_soft_reset_timer; // timer used to schedule a soft reset
+#ifdef LEGACY_WATCHDOG
// watchdog state
bool m_watchdog_enabled; // is the watchdog enabled?
INT32 m_watchdog_counter; // counter for watchdog tracking
emu_timer * m_watchdog_timer; // timer for watchdog tracking
+#endif
// misc state
UINT32 m_rand_seed; // current random number seed
diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp
index 17e948f7844..196903b1df1 100644
--- a/src/emu/mconfig.cpp
+++ b/src/emu/mconfig.cpp
@@ -23,8 +23,10 @@
machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
: m_minimum_quantum(attotime::zero),
+#ifdef LEGACY_WATCHDOG
m_watchdog_vblank_count(0),
m_watchdog_time(attotime::zero),
+#endif
m_default_layout(nullptr),
m_gamedrv(gamedrv),
m_options(options)
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index a2ae9638527..0a79173dff5 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -68,8 +68,10 @@ public:
// public state
attotime m_minimum_quantum; // minimum scheduling quantum
std::string m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling
+#ifdef LEGACY_WATCHDOG
INT32 m_watchdog_vblank_count; // number of VBLANKs until the watchdog kills us
attotime m_watchdog_time; // length of time until the watchdog kills us
+#endif
// other parameters
const internal_layout * m_default_layout; // default layout for this machine
@@ -199,11 +201,13 @@ References an external machine config.
#define MCFG_QUANTUM_PERFECT_CPU(_cputag) \
config.m_perfect_cpu_quantum = owner->subtag(_cputag);
+#ifdef LEGACY_WATCHDOG
// watchdog configuration
#define MCFG_WATCHDOG_VBLANK_INIT(_count) \
config.m_watchdog_vblank_count = _count;
#define MCFG_WATCHDOG_TIME_INIT(_time) \
config.m_watchdog_time = _time;
+#endif
// core video parameters
#define MCFG_DEFAULT_LAYOUT(_layout) \
diff --git a/src/mame/drivers/1943.cpp b/src/mame/drivers/1943.cpp
index d794c1e98aa..2bf3b4037f9 100644
--- a/src/mame/drivers/1943.cpp
+++ b/src/mame/drivers/1943.cpp
@@ -32,6 +32,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/1943.h"
@@ -107,7 +108,7 @@ static ADDRESS_MAP_START( c1943_map, AS_PROGRAM, 8, _1943_state )
AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r)
AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xc804, 0xc804) AM_WRITE(c1943_c804_w) // ROM bank switch, screen flip
- AM_RANGE(0xc806, 0xc806) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc806, 0xc806) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xc807, 0xc807) AM_WRITE(c1943_protection_w)
AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(c1943_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(c1943_colorram_w) AM_SHARE("colorram")
@@ -314,6 +315,8 @@ static MACHINE_CONFIG_START( 1943, _1943_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(_1943_state, irq0_line_hold, 4*60)
+ MCFG_WATCHDOG_ADD("watchdog")
+
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/20pacgal.cpp b/src/mame/drivers/20pacgal.cpp
index ddfa3b412af..2bc2375d6f3 100644
--- a/src/mame/drivers/20pacgal.cpp
+++ b/src/mame/drivers/20pacgal.cpp
@@ -86,6 +86,7 @@ Graphics: CY37256P160-83AC x 2 (Ultra37000 CPLD family - 160 pin TQFP, 256 Macro
#include "emu.h"
#include "cpu/z180/z180.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "includes/20pacgal.h"
@@ -235,7 +236,7 @@ READ8_MEMBER( _25pacman_state::_25pacman_io_87_r )
AM_RANGE(0x80, 0x80) AM_READ_PORT("P1")
AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
AM_RANGE(0x82, 0x82) AM_READ_PORT("SERVICE")
- AM_RANGE(0x80, 0x80) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x80, 0x80) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x81, 0x81) AM_WRITE(timer_pulse_w) /* ??? pulsed by the timer irq */
AM_RANGE(0x82, 0x82) AM_WRITE(irqack_w)
// AM_RANGE(0x84, 0x84) AM_NOP /* ?? */
@@ -257,7 +258,7 @@ static ADDRESS_MAP_START( 20pacgal_io_map, AS_IO, 8, _20pacgal_state )
AM_RANGE(0x80, 0x80) AM_READ_PORT("P1")
AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
AM_RANGE(0x82, 0x82) AM_READ_PORT("SERVICE")
- AM_RANGE(0x80, 0x80) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x80, 0x80) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x81, 0x81) AM_WRITE(timer_pulse_w) /* ??? pulsed by the timer irq */
AM_RANGE(0x82, 0x82) AM_WRITE(irqack_w)
AM_RANGE(0x84, 0x84) AM_NOP /* ?? */
@@ -395,6 +396,8 @@ static MACHINE_CONFIG_START( 20pacgal, _20pacgal_state )
MCFG_EEPROM_SERIAL_93C46_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_FRAGMENT_ADD(20pacgal_video)
diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp
index 5afad4915b6..2eed885f72d 100644
--- a/src/mame/drivers/8080bw.cpp
+++ b/src/mame/drivers/8080bw.cpp
@@ -196,6 +196,7 @@
#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "cpu/i8085/i8085.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/speaker.h"
#include "includes/8080bw.h"
@@ -375,7 +376,7 @@ static ADDRESS_MAP_START( invadpt2_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -413,7 +414,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( invadpt2, mw8080bw_root, _8080bw_state )
/* 60 Hz signal clocks two LS161. Ripple carry will */
/* reset circuit, if LS161 not cleared before. */
- MCFG_WATCHDOG_VBLANK_INIT(255)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 255)
/* add shifter */
MCFG_MB14241_ADD("mb14241")
@@ -443,7 +445,7 @@ static ADDRESS_MAP_START( spacerng_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(spacerng_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static MACHINE_CONFIG_DERIVED_CLASS( spacerng, invadpt2, _8080bw_state )
@@ -525,7 +527,7 @@ static ADDRESS_MAP_START( astropal_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_WRITE(invaders_audio_1_w)
AM_RANGE(0x05, 0x05) AM_WRITE(invaders_audio_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static INPUT_PORTS_START( astropal )
@@ -569,6 +571,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( astropal, invaders, _8080bw_state )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(astropal_io_map)
+
MACHINE_CONFIG_END
@@ -593,7 +596,7 @@ static ADDRESS_MAP_START( cosmo_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITENOP
AM_RANGE(0x03, 0x03) AM_WRITE(invadpt2_sh_port_1_w)
AM_RANGE(0x05, 0x05) AM_WRITE(cosmo_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_WRITENOP
ADDRESS_MAP_END
@@ -620,6 +623,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( cosmo, mw8080bw_root, _8080bw_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(cosmo_map)
MCFG_CPU_IO_MAP(cosmo_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw)
/* video hardware */
@@ -825,7 +829,7 @@ static ADDRESS_MAP_START( invrvnge_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invrvnge_sh_port_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(invrvnge_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( invrvnge_sound_map, AS_PROGRAM, 8, _8080bw_state )
@@ -888,6 +892,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( invrvnge, mw8080bw_root, _8080bw_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(invrvnge_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_CPU_ADD("audiocpu", M6808, XTAL_4MHz/2) // MC6808P
MCFG_CPU_PROGRAM_MAP(invrvnge_sound_map)
@@ -1014,7 +1020,7 @@ static ADDRESS_MAP_START( starw1_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_WRITENOP /* writes 9B at boot */
AM_RANGE(0x04, 0x04) AM_WRITE(invadpt2_sh_port_1_w)
AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_WRITENOP /* writes 89 at boot */
ADDRESS_MAP_END
@@ -1142,7 +1148,7 @@ static ADDRESS_MAP_START( cosmicmo_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_WRITE(invaders_audio_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(cosmicmo_05_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static MACHINE_CONFIG_DERIVED_CLASS( cosmicmo, mw8080bw_root, _8080bw_state )
@@ -1154,7 +1160,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( cosmicmo, mw8080bw_root, _8080bw_state )
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw)
- MCFG_WATCHDOG_VBLANK_INIT(255)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 255)
/* add shifter */
MCFG_MB14241_ADD("mb14241")
@@ -1308,7 +1315,7 @@ static ADDRESS_MAP_START( schaser_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(schaser_sh_port_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(schaser_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -1395,7 +1402,9 @@ static MACHINE_CONFIG_DERIVED_CLASS( schaser, mw8080bw_root, _8080bw_state )
MCFG_CPU_REPLACE("maincpu",I8080,1996800) /* 19.968MHz / 10 */
MCFG_CPU_PROGRAM_MAP(schaser_map)
MCFG_CPU_IO_MAP(schaser_io_map)
- MCFG_WATCHDOG_VBLANK_INIT(255)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 255)
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,schaser)
MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state,schaser)
@@ -1628,7 +1637,7 @@ static ADDRESS_MAP_START( lupin3_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(lupin3_sh_port_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(lupin3_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -1691,6 +1700,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( lupin3, mw8080bw_root, _8080bw_state )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(lupin3_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw)
/* add shifter */
@@ -1731,50 +1741,11 @@ static MACHINE_CONFIG_DERIVED_CLASS( lupin3, mw8080bw_root, _8080bw_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED_CLASS( lupin3a, mw8080bw_root, _8080bw_state )
-
- /* basic machine hardware */
- MCFG_CPU_MODIFY("maincpu")
- MCFG_CPU_PROGRAM_MAP(schaser_map)
- MCFG_CPU_IO_MAP(lupin3_io_map)
- MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw)
-
- /* add shifter */
- MCFG_MB14241_ADD("mb14241")
+static MACHINE_CONFIG_DERIVED( lupin3a, lupin3 )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_lupin3)
-
- MCFG_PALETTE_ADD_3BIT_RBG("palette")
-
- /* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_SOUND_ADD("snsnd", SN76477, 0)
- MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C
- MCFG_SN76477_DECAY_RES(0) // decay_res: N/C
- MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res
- MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res
- MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res
- MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res
- MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage
- MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res
- MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C
- MCFG_SN76477_VCO_MODE(1) // VCO mode
- MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C
- MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2
- MCFG_SN76477_ENABLE(1) // enable
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
-
- MCFG_SOUND_ADD("samples", SAMPLES, 0)
- MCFG_SAMPLES_CHANNELS(4)
- MCFG_SAMPLES_NAMES(lupin3_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
- MCFG_SOUND_ADD("discrete", DISCRETE, 0)
- MCFG_DISCRETE_INTF(indianbt)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1823,7 +1794,7 @@ static ADDRESS_MAP_START( polaris_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(polaris_sh_port_1_w)
AM_RANGE(0x03, 0x03) AM_DEVREADWRITE("mb14241", mb14241_device, shift_result_r, shift_data_w)
AM_RANGE(0x04, 0x04) AM_WRITE(polaris_sh_port_2_w)
- AM_RANGE(0x05, 0x05) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x05, 0x05) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x06, 0x06) AM_WRITE(polaris_sh_port_3_w)
ADDRESS_MAP_END
@@ -1888,8 +1859,11 @@ static MACHINE_CONFIG_DERIVED_CLASS( polaris, mw8080bw_root, _8080bw_state )
MCFG_CPU_REPLACE("maincpu",I8080,1996800) /* 19.968MHz / 10 */
MCFG_CPU_PROGRAM_MAP(schaser_map)
MCFG_CPU_IO_MAP(polaris_io_map)
- MCFG_WATCHDOG_VBLANK_INIT(255)
MCFG_CPU_VBLANK_INT_DRIVER("screen", _8080bw_state, polaris_interrupt)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 255)
+
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,polaris)
/* add shifter */
@@ -2238,7 +2212,7 @@ static ADDRESS_MAP_START( indianbt_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(indianbt_sh_port_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(indianbt_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_WRITE(indianbt_sh_port_3_w)
ADDRESS_MAP_END
@@ -2249,7 +2223,7 @@ static ADDRESS_MAP_START( indianbtbr_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(indianbtbr_sh_port_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(indianbtbr_sh_port_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_WRITENOP
ADDRESS_MAP_END
@@ -2259,6 +2233,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( indianbt, mw8080bw_root, _8080bw_state )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(indianbt_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw)
/* add shifter */
@@ -2284,6 +2259,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( indianbtbr, mw8080bw_root, _8080bw_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(schaser_map)
MCFG_CPU_IO_MAP(indianbtbr_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw)
/* add shifter */
@@ -2693,7 +2669,7 @@ static ADDRESS_MAP_START( vortex_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x01, 0x01) AM_WRITE(invaders_audio_1_w)
AM_RANGE(0x06, 0x06) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x07, 0x07) AM_WRITE(invaders_audio_2_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -2727,6 +2703,8 @@ MACHINE_CONFIG_DERIVED_CLASS( vortex, mw8080bw_root, _8080bw_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(vortex_io_map)
MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_usec(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
/* video hardware */
@@ -2971,7 +2949,7 @@ static ADDRESS_MAP_START( claybust_io_map, AS_IO, 8, _8080bw_state )
AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_READ(claybust_gun_lo_r) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) //AM_WRITENOP // port3 write looks sound-related
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
//AM_RANGE(0x05, 0x05) AM_WRITENOP // ?
AM_RANGE(0x06, 0x06) AM_READ(claybust_gun_hi_r)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/88games.cpp b/src/mame/drivers/88games.cpp
index 3aa93366913..c6fb22de23d 100644
--- a/src/mame/drivers/88games.cpp
+++ b/src/mame/drivers/88games.cpp
@@ -11,6 +11,7 @@
#include "cpu/z80/z80.h"
#include "sound/2151intf.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/88games.h"
@@ -123,7 +124,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, _88games_state )
AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x3800, 0x3fff) AM_READWRITE(bankedram_r, bankedram_w) AM_SHARE("ram")
AM_RANGE(0x5f84, 0x5f84) AM_WRITE(k88games_5f84_w)
- AM_RANGE(0x5f88, 0x5f88) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5f88, 0x5f88) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x5f90, 0x5f90) AM_WRITE(k88games_sh_irqtrigger_w)
AM_RANGE(0x5f94, 0x5f94) AM_READ_PORT("IN0")
@@ -309,6 +310,8 @@ static MACHINE_CONFIG_START( 88games, _88games_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp
index f1c95f0b1fc..521e71e2bc9 100644
--- a/src/mame/drivers/abc1600.cpp
+++ b/src/mame/drivers/abc1600.cpp
@@ -46,6 +46,7 @@
*/
#include "includes/abc1600.h"
+#include "machine/watchdog.h"
#include "softlist.h"
@@ -844,6 +845,7 @@ static MACHINE_CONFIG_START( abc1600, abc1600_state )
MCFG_CPU_PROGRAM_MAP(abc1600_mem)
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(abc1600_state,abc1600_int_ack)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1600)) // XTAL_64MHz/8/10/20000/8/8
// video hardware
diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp
index 577f1e28391..82d32c65e85 100644
--- a/src/mame/drivers/acefruit.cpp
+++ b/src/mame/drivers/acefruit.cpp
@@ -13,6 +13,7 @@ Inputs and Dip Switches by Stephh
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "sidewndr.lh"
@@ -329,7 +330,7 @@ static ADDRESS_MAP_START( acefruit_map, AS_PROGRAM, 8, acefruit_state )
AM_RANGE(0xa002, 0xa003) AM_WRITE(acefruit_coin_w)
AM_RANGE(0xa004, 0xa004) AM_WRITE(acefruit_solenoid_w)
AM_RANGE(0xa005, 0xa006) AM_WRITE(acefruit_sound_w)
- AM_RANGE(0xc000, 0xc000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc000, 0xc000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xe000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -610,6 +611,8 @@ static MACHINE_CONFIG_START( acefruit, acefruit_state )
MCFG_CPU_IO_MAP(acefruit_io)
MCFG_CPU_VBLANK_INT_DRIVER("screen", acefruit_state, acefruit_vblank)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", acefruit)
/* video hardware */
diff --git a/src/mame/drivers/airbustr.cpp b/src/mame/drivers/airbustr.cpp
index 8c6b6473bb3..cc23b1837f1 100644
--- a/src/mame/drivers/airbustr.cpp
+++ b/src/mame/drivers/airbustr.cpp
@@ -235,7 +235,7 @@ READ8_MEMBER(airbustr_state::devram_r)
that would reset the main cpu. We avoid this and patch
the rom instead (main cpu has to be reset once at startup) */
case 0xfe0:
- return watchdog_reset_r(space, 0);
+ return m_watchdog->reset_r(space, 0);
/* Reading a word at eff2 probably yelds the product
of the words written to eff0 and eff2 */
@@ -600,6 +600,8 @@ static MACHINE_CONFIG_START( airbustr, airbustr_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // Palette RAM is filled by sub cpu with data supplied by main cpu
// Maybe a high value is safer in order to avoid glitches
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
/* video hardware */
@@ -636,6 +638,7 @@ static MACHINE_CONFIG_START( airbustr, airbustr_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( airbustrb, airbustr )
+ MCFG_WATCHDOG_MODIFY("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(0)) // no protection device or watchdog
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ajax.cpp b/src/mame/drivers/ajax.cpp
index 9ac2ffcfcd7..85f8f809e2f 100644
--- a/src/mame/drivers/ajax.cpp
+++ b/src/mame/drivers/ajax.cpp
@@ -178,6 +178,8 @@ static MACHINE_CONFIG_START( ajax, ajax_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
diff --git a/src/mame/drivers/albazg.cpp b/src/mame/drivers/albazg.cpp
index 9666975f2f3..9568167f93a 100644
--- a/src/mame/drivers/albazg.cpp
+++ b/src/mame/drivers/albazg.cpp
@@ -37,9 +37,10 @@ PCB:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/eepromser.h"
+#include "machine/i8255.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "video/mc6845.h"
-#include "machine/i8255.h"
#define MASTER_CLOCK XTAL_12MHz
@@ -222,7 +223,7 @@ static ADDRESS_MAP_START( port_map, AS_IO, 8, albazg_state )
AM_RANGE(0x40, 0x40) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
- AM_RANGE(0xc0, 0xc0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc0, 0xc0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
/***************************************************************************************/
@@ -353,7 +354,8 @@ static MACHINE_CONFIG_START( yumefuda, albazg_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
- MCFG_WATCHDOG_VBLANK_INIT(8) // timing is unknown
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8) // timing is unknown
MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(albazg_state, mux_w))
diff --git a/src/mame/drivers/aliens.cpp b/src/mame/drivers/aliens.cpp
index 907b16a65fa..b39437c2de2 100644
--- a/src/mame/drivers/aliens.cpp
+++ b/src/mame/drivers/aliens.cpp
@@ -12,6 +12,7 @@ Preliminary driver by:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/konamipt.h"
#include "includes/aliens.h"
@@ -91,7 +92,7 @@ static ADDRESS_MAP_START( aliens_map, AS_PROGRAM, 8, aliens_state )
AM_RANGE(0x5f82, 0x5f82) AM_READ_PORT("P2")
AM_RANGE(0x5f83, 0x5f83) AM_READ_PORT("DSW2")
AM_RANGE(0x5f84, 0x5f84) AM_READ_PORT("DSW1")
- AM_RANGE(0x5f88, 0x5f88) AM_READ(watchdog_reset_r) AM_WRITE(aliens_coin_counter_w) /* coin counters */
+ AM_RANGE(0x5f88, 0x5f88) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(aliens_coin_counter_w) /* coin counters */
AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(aliens_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x4000, 0x7fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("maincpu", 0x28000) /* ROM e24_j02.bin */
@@ -205,6 +206,8 @@ static MACHINE_CONFIG_START( aliens, aliens_state )
MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(11)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x400)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240) // measured 59.17
diff --git a/src/mame/drivers/ambush.cpp b/src/mame/drivers/ambush.cpp
index 835e601f91b..efb124e4f54 100644
--- a/src/mame/drivers/ambush.cpp
+++ b/src/mame/drivers/ambush.cpp
@@ -37,6 +37,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/ambush.h"
@@ -68,7 +69,7 @@ WRITE8_MEMBER(ambush_state::flip_screen_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, ambush_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0xa000, 0xa000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xa000, 0xa000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xc000, 0xc7ff) AM_RAM
AM_RANGE(0xc080, 0xc09f) AM_SHARE("scrollram")
AM_RANGE(0xc100, 0xc1ff) AM_SHARE("colorram")
@@ -209,6 +210,8 @@ static MACHINE_CONFIG_START( ambush, ambush_state )
MCFG_CPU_IO_MAP(main_portmap)
MCFG_CPU_VBLANK_INT_DRIVER("screen", ambush_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/ampoker2.cpp b/src/mame/drivers/ampoker2.cpp
index 4297c6517d9..bc56ff7429d 100644
--- a/src/mame/drivers/ampoker2.cpp
+++ b/src/mame/drivers/ampoker2.cpp
@@ -573,7 +573,7 @@ WRITE8_MEMBER(ampoker2_state::ampoker2_watchdog_reset_w)
if (((data >> 3) & 0x01) == 0) /* check for refresh value (0x08) */
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
// popmessage("%02x", data);
}
else
@@ -1142,6 +1142,8 @@ static MACHINE_CONFIG_START( ampoker2, ampoker2_state )
MCFG_CPU_PROGRAM_MAP(ampoker2_map)
MCFG_CPU_IO_MAP(ampoker2_io_map)
MCFG_CPU_PERIODIC_INT_DRIVER(ampoker2_state, nmi_line_pulse, 1536)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(200)) /* 200 ms, measured */
MCFG_NVRAM_ADD_0FILL("nvram")
diff --git a/src/mame/drivers/arcadecl.cpp b/src/mame/drivers/arcadecl.cpp
index 1e821db2466..e7316b3f797 100644
--- a/src/mame/drivers/arcadecl.cpp
+++ b/src/mame/drivers/arcadecl.cpp
@@ -70,6 +70,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "video/atarimo.h"
#include "includes/arcadecl.h"
@@ -163,7 +164,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, arcadecl_state )
AM_RANGE(0x641000, 0x641fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
AM_RANGE(0x642000, 0x642001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00)
AM_RANGE(0x646000, 0x646fff) AM_WRITE(scanline_int_ack_w)
- AM_RANGE(0x647000, 0x647fff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x647000, 0x647fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
ADDRESS_MAP_END
@@ -325,6 +326,8 @@ static MACHINE_CONFIG_START( arcadecl, arcadecl_state )
MCFG_MACHINE_RESET_OVERRIDE(arcadecl_state,arcadecl)
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", arcadecl)
MCFG_PALETTE_ADD("palette", 512)
diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp
index 89bb3a3d38c..58ee4af5364 100644
--- a/src/mame/drivers/aristmk5.cpp
+++ b/src/mame/drivers/aristmk5.cpp
@@ -171,6 +171,7 @@
#include "emu.h"
#include "cpu/arm/arm.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "includes/archimds.h"
//#include "machine/i2cmem.h"
@@ -417,7 +418,7 @@ static ADDRESS_MAP_START( aristmk5_map, AS_PROGRAM, 32, aristmk5_state )
// AM_RANGE(0x0301049c, 0x0301051f) AM_DEVREADWRITE_LEGACY("eeprom", eeprom_r, eeprom_w) // eeprom ???
- AM_RANGE(0x03010810, 0x03010813) AM_READWRITE(watchdog_reset32_r,watchdog_reset32_w) //MK-5 specific, watchdog
+ AM_RANGE(0x03010810, 0x03010813) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset32_r, reset32_w) //MK-5 specific, watchdog
// System Startup Code Enabled protection appears to be located at 0x3010400 - 0x30104ff
AM_RANGE(0x03220000, 0x0323ffff) AM_RAMBANK("sram_bank") //AM_BASE_SIZE_GENERIC(nvram) // nvram 32kbytes x 3
@@ -443,7 +444,7 @@ static ADDRESS_MAP_START( aristmk5_drame_map, AS_PROGRAM, 32, aristmk5_state )
// AM_RANGE(0x0301049c, 0x0301051f) AM_DEVREADWRITE_LEGACY("eeprom", eeprom_r, eeprom_w) // eeprom ???
- AM_RANGE(0x03010810, 0x03010813) AM_READWRITE(watchdog_reset32_r,watchdog_reset32_w) //MK-5 specific, watchdog
+ AM_RANGE(0x03010810, 0x03010813) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset32_r, reset32_w) //MK-5 specific, watchdog
// System Startup Code Enabled protection appears to be located at 0x3010400 - 0x30104ff
AM_RANGE(0x03220000, 0x0323ffff) AM_RAMBANK("sram_bank") //AM_BASE_SIZE_GENERIC(nvram) // nvram 32kbytes x 3
@@ -530,6 +531,8 @@ void aristmk5_state::machine_reset()
static MACHINE_CONFIG_START( aristmk5, aristmk5_state )
MCFG_CPU_ADD("maincpu", ARM, MASTER_CLOCK/6) // 12000000
MCFG_CPU_PROGRAM_MAP(aristmk5_drame_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(2)) /* 1.6 - 2 seconds */
// MCFG_I2CMEM_ADD("i2cmem")
@@ -576,6 +579,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( aristmk5_usa, aristmk5_state )
MCFG_CPU_ADD("maincpu", ARM, MASTER_CLOCK/6) // 12000000
MCFG_CPU_PROGRAM_MAP(aristmk5_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(2)) /* 1.6 - 2 seconds */
// MCFG_I2CMEM_ADD("i2cmem")
diff --git a/src/mame/drivers/arkanoid.cpp b/src/mame/drivers/arkanoid.cpp
index 70d0bf7423f..6635193d02a 100644
--- a/src/mame/drivers/arkanoid.cpp
+++ b/src/mame/drivers/arkanoid.cpp
@@ -765,6 +765,7 @@ DIP locations verified for:
#include "includes/arkanoid.h"
#include "sound/ay8910.h"
#include "cpu/m6805/m6805.h"
+#include "machine/watchdog.h"
/***************************************************************************/
@@ -777,7 +778,7 @@ static ADDRESS_MAP_START( arkanoid_map, AS_PROGRAM, 8, arkanoid_state )
AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0xd008, 0xd008) AM_WRITE(arkanoid_d008_w) /* gfx bank, flip screen etc. */
AM_RANGE(0xd00c, 0xd00c) AM_READ_PORT("SYSTEM") /* 2 bits from the 68705 */
- AM_RANGE(0xd010, 0xd010) AM_READ_PORT("BUTTONS") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xd010, 0xd010) AM_READ_PORT("BUTTONS") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd018, 0xd018) AM_READWRITE(arkanoid_Z80_mcu_r, arkanoid_Z80_mcu_w) /* input from the 68705 */
AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(arkanoid_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xe800, 0xe83f) AM_RAM AM_SHARE("spriteram")
@@ -792,7 +793,7 @@ static ADDRESS_MAP_START( bootleg_map, AS_PROGRAM, 8, arkanoid_state )
AM_RANGE(0xd001, 0xd001) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
AM_RANGE(0xd008, 0xd008) AM_WRITE(arkanoid_d008_w) /* gfx bank, flip screen etc. */
AM_RANGE(0xd00c, 0xd00c) AM_READ_PORT("SYSTEM")
- AM_RANGE(0xd010, 0xd010) AM_READ_PORT("BUTTONS") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xd010, 0xd010) AM_READ_PORT("BUTTONS") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd018, 0xd018) AM_READ_PORT("MUX") AM_WRITENOP
AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(arkanoid_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xe800, 0xe83f) AM_RAM AM_SHARE("spriteram")
@@ -807,7 +808,7 @@ static ADDRESS_MAP_START( hexa_map, AS_PROGRAM, 8, arkanoid_state )
AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0xd008, 0xd008) AM_WRITE(hexa_d008_w)
- AM_RANGE(0xd010, 0xd010) AM_WRITE(watchdog_reset_w) /* or IRQ acknowledge, or both */
+ AM_RANGE(0xd010, 0xd010) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* or IRQ acknowledge, or both */
AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(arkanoid_videoram_w) AM_SHARE("videoram")
ADDRESS_MAP_END
@@ -829,7 +830,7 @@ static ADDRESS_MAP_START( hexaa_map, AS_PROGRAM, 8, arkanoid_state )
AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0xd008, 0xd008) AM_WRITE(hexa_d008_w)
- AM_RANGE(0xd010, 0xd010) AM_WRITE(watchdog_reset_w) /* or IRQ acknowledge, or both */
+ AM_RANGE(0xd010, 0xd010) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* or IRQ acknowledge, or both */
AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(arkanoid_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xe800, 0xefff) AM_RAM
AM_RANGE(0xf000, 0xf000) AM_READWRITE(hexaa_f000_r, hexaa_f000_w)
@@ -1319,6 +1320,8 @@ static MACHINE_CONFIG_START( arkanoid, arkanoid_state )
MCFG_CPU_PROGRAM_MAP(arkanoid_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", arkanoid_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_CPU_ADD("mcu", M68705, XTAL_12MHz/4) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mcu_map)
@@ -1355,6 +1358,8 @@ static MACHINE_CONFIG_START( hexa, arkanoid_state )
MCFG_CPU_PROGRAM_MAP(hexa_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", arkanoid_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
// MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp
index 8b1d84564e5..ac563c69b32 100644
--- a/src/mame/drivers/asteroid.cpp
+++ b/src/mame/drivers/asteroid.cpp
@@ -187,6 +187,7 @@ There is not a rev 03 known or dumped. An Asteroids rev 03 is not mentioned in a
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "video/vector.h"
#include "video/avgdvg.h"
#include "machine/atari_vg.h"
@@ -247,7 +248,7 @@ static ADDRESS_MAP_START( asteroid_map, AS_PROGRAM, 8, asteroid_state )
AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r) /* DSW1 */
AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("dvg", dvg_device, go_w)
AM_RANGE(0x3200, 0x3200) AM_WRITE(asteroid_bank_switch_w)
- AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3400, 0x3400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
AM_RANGE(0x3a00, 0x3a00) AM_WRITE(asteroid_thump_w)
AM_RANGE(0x3c00, 0x3c05) AM_WRITE(asteroid_sounds_w)
@@ -270,7 +271,7 @@ static ADDRESS_MAP_START( astdelux_map, AS_PROGRAM, 8, asteroid_state )
AM_RANGE(0x2c40, 0x2c7f) AM_DEVREAD("earom", atari_vg_earom_device, read)
AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("dvg", dvg_device, go_w)
AM_RANGE(0x3200, 0x323f) AM_DEVWRITE("earom", atari_vg_earom_device, write)
- AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3400, 0x3400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
AM_RANGE(0x3a00, 0x3a00) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
AM_RANGE(0x3c00, 0x3c01) AM_WRITE(astdelux_led_w)
@@ -293,7 +294,7 @@ static ADDRESS_MAP_START( llander_map, AS_PROGRAM, 8, asteroid_state )
AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("THRUST")
AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("dvg", dvg_device, go_w)
AM_RANGE(0x3200, 0x3200) AM_WRITE(llander_led_w)
- AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3400, 0x3400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3c00, 0x3c00) AM_WRITE(llander_sounds_w)
AM_RANGE(0x3e00, 0x3e00) AM_WRITE(llander_snd_reset_w)
AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
@@ -648,6 +649,8 @@ static MACHINE_CONFIG_START( asteroid, asteroid_state )
MCFG_CPU_PROGRAM_MAP(asteroid_map)
MCFG_CPU_PERIODIC_INT_DRIVER(asteroid_state, asteroid_interrupt, CLOCK_3KHZ/12)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/asuka.cpp b/src/mame/drivers/asuka.cpp
index 9574745f60e..6393dac93d3 100644
--- a/src/mame/drivers/asuka.cpp
+++ b/src/mame/drivers/asuka.cpp
@@ -221,6 +221,7 @@ DIP locations verified for:
#include "cpu/m68000/m68000.h"
#include "includes/taitoipt.h"
#include "audio/taitosnd.h"
+#include "machine/watchdog.h"
#include "sound/2610intf.h"
#include "sound/2151intf.h"
#include "sound/msm5205.h"
@@ -321,7 +322,7 @@ static ADDRESS_MAP_START( bonzeadv_map, AS_PROGRAM, 16, asuka_state )
AM_RANGE(0x390000, 0x390001) AM_READ_PORT("DSWA")
AM_RANGE(0x3a0000, 0x3a0001) AM_WRITE(asuka_spritectrl_w)
AM_RANGE(0x3b0000, 0x3b0001) AM_READ_PORT("DSWB")
- AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x3c0000, 0x3c0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x3d0000, 0x3d0001) AM_READNOP
AM_RANGE(0x3e0000, 0x3e0001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
@@ -835,6 +836,8 @@ static MACHINE_CONFIG_START( bonzeadv, asuka_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/atari_s1.cpp b/src/mame/drivers/atari_s1.cpp
index 48bc91e6816..51e862f858d 100644
--- a/src/mame/drivers/atari_s1.cpp
+++ b/src/mame/drivers/atari_s1.cpp
@@ -45,6 +45,7 @@ ToDo:
#include "machine/genpin.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "atari_s1.lh"
@@ -110,7 +111,7 @@ static ADDRESS_MAP_START( atari_s1_map, AS_PROGRAM, 8, atari_s1_state )
AM_RANGE(0x108c, 0x108f) AM_READWRITE(m108c_r,m108c_w)
AM_RANGE(0x2000, 0x204f) AM_MIRROR(0x0F80) AM_READ(switch_r) AM_WRITENOP // aavenger ROL 200B causes a spurious write
AM_RANGE(0x3000, 0x3fff) AM_WRITE(audioen_w) // audio enable
- AM_RANGE(0x4000, 0x4fff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5080, 0x508c) AM_MIRROR(3) AM_WRITE(meter_w) // time2000 only
AM_RANGE(0x6000, 0x6fff) AM_WRITE(audiores_w) // audio reset
AM_RANGE(0x7000, 0x7fff) AM_ROM
@@ -125,7 +126,7 @@ static ADDRESS_MAP_START( atarians_map, AS_PROGRAM, 8, atari_s1_state ) // more
AM_RANGE(0x108c, 0x108f) AM_READWRITE(m108c_r,m108c_w)
AM_RANGE(0x2000, 0x204f) AM_MIRROR(0x0F80) AM_READ(switch_r)
AM_RANGE(0x3000, 0x3fff) AM_WRITE(audioen_w) // audio enable
- AM_RANGE(0x4000, 0x4fff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x6000, 0x6fff) AM_WRITE(audiores_w) // audio reset
AM_RANGE(0x7000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -136,7 +137,7 @@ static ADDRESS_MAP_START( midearth_map, AS_PROGRAM, 8, atari_s1_state )
AM_RANGE(0x1000, 0x11ff) AM_WRITE(midearth_w)
AM_RANGE(0x2000, 0x204f) AM_MIRROR(0x0F80) AM_READ(switch_r)
AM_RANGE(0x3000, 0x3fff) AM_WRITE(audioen_w) // audio enable
- AM_RANGE(0x4000, 0x4fff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x6000, 0x6fff) AM_WRITE(audiores_w) // audio reset
AM_RANGE(0x7000, 0x7fff) AM_ROM AM_WRITENOP // writes to FFFF due to poor coding at 7FF5
ADDRESS_MAP_END
@@ -433,6 +434,8 @@ static MACHINE_CONFIG_START( atari_s1, atari_s1_state )
MCFG_CPU_ADD("maincpu", M6800, MASTER_CLK)
MCFG_CPU_PROGRAM_MAP(atari_s1_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/atari_s2.cpp b/src/mame/drivers/atari_s2.cpp
index 1399a296577..bafac12ebfb 100644
--- a/src/mame/drivers/atari_s2.cpp
+++ b/src/mame/drivers/atari_s2.cpp
@@ -23,6 +23,7 @@ ToDo:
#include "machine/genpin.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "atari_s2.lh"
@@ -80,7 +81,7 @@ static ADDRESS_MAP_START( atari_s2_map, AS_PROGRAM, 8, atari_s2_state )
AM_RANGE(0x1860, 0x1867) AM_MIRROR(0x0718) AM_WRITE(lamp_w)
AM_RANGE(0x1880, 0x1880) AM_MIRROR(0x071F) AM_WRITE(sol0_w)
AM_RANGE(0x18a0, 0x18a7) AM_MIRROR(0x0718) AM_WRITE(sol1_w)
- AM_RANGE(0x18c0, 0x18c0) AM_MIRROR(0x071F) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x18c0, 0x18c0) AM_MIRROR(0x071F) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x18e0, 0x18e0) AM_MIRROR(0x071F) AM_WRITE(intack_w)
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x07FC) AM_READ_PORT("DSW0")
AM_RANGE(0x2001, 0x2001) AM_MIRROR(0x07FC) AM_READ_PORT("DSW1")
@@ -107,7 +108,7 @@ static ADDRESS_MAP_START( atari_s3_map, AS_PROGRAM, 8, atari_s2_state )
AM_RANGE(0x1860, 0x1867) AM_MIRROR(0x0718) AM_WRITE(lamp_w)
AM_RANGE(0x1880, 0x1880) AM_MIRROR(0x071F) AM_WRITE(sol0_w)
AM_RANGE(0x18a0, 0x18a7) AM_MIRROR(0x0718) AM_WRITE(sol1_w)
- AM_RANGE(0x18c0, 0x18c0) AM_MIRROR(0x071F) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x18c0, 0x18c0) AM_MIRROR(0x071F) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x18e0, 0x18e0) AM_MIRROR(0x071F) AM_WRITE(intack_w)
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x07F4) AM_READ_PORT("DSW0")
AM_RANGE(0x2001, 0x2001) AM_MIRROR(0x07F4) AM_READ_PORT("DSW1")
@@ -460,6 +461,7 @@ static MACHINE_CONFIG_START( atari_s2, atari_s2_state )
MCFG_CPU_ADD("maincpu", M6800, XTAL_4MHz / 4)
MCFG_CPU_PROGRAM_MAP(atari_s2_map)
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
diff --git a/src/mame/drivers/atarifb.cpp b/src/mame/drivers/atarifb.cpp
index 46b9bf81863..64572ecbc7d 100644
--- a/src/mame/drivers/atarifb.cpp
+++ b/src/mame/drivers/atarifb.cpp
@@ -107,6 +107,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "includes/atarifb.h"
+#include "machine/watchdog.h"
#include "sound/discrete.h"
#include "atarifb.lh"
@@ -163,7 +164,7 @@ static ADDRESS_MAP_START( atarifb_map, AS_PROGRAM, 8, atarifb_state )
AM_RANGE(0x3000, 0x3000) AM_NOP /* Interrupt Acknowledge */
AM_RANGE(0x4000, 0x4000) AM_READ(atarifb_in0_r)
AM_RANGE(0x4002, 0x4002) AM_READ(atarifb_in2_r)
- AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5000, 0x5000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x6000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -184,7 +185,7 @@ static ADDRESS_MAP_START( atarifb4_map, AS_PROGRAM, 8, atarifb_state )
AM_RANGE(0x4000, 0x4000) AM_READ(atarifb4_in0_r)
AM_RANGE(0x4001, 0x4001) AM_READ_PORT("EXTRA")
AM_RANGE(0x4002, 0x4002) AM_READ(atarifb4_in2_r)
- AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5000, 0x5000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x6000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -204,7 +205,7 @@ static ADDRESS_MAP_START( abaseb_map, AS_PROGRAM, 8, atarifb_state )
AM_RANGE(0x3000, 0x3000) AM_NOP /* Interrupt Acknowledge */
AM_RANGE(0x4000, 0x4000) AM_READ(atarifb_in0_r)
AM_RANGE(0x4002, 0x4002) AM_READ(atarifb_in2_r)
- AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5000, 0x5000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x6000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -221,7 +222,7 @@ static ADDRESS_MAP_START( soccer_map, AS_PROGRAM, 8, atarifb_state )
AM_RANGE(0x1001, 0x1001) AM_WRITE(soccer_out1_w) /* OUT 1 */
AM_RANGE(0x1002, 0x1002) AM_WRITE(soccer_out2_w) /* OUT 2 */
AM_RANGE(0x1004, 0x1004) AM_WRITENOP /* Interrupt Acknowledge */
- AM_RANGE(0x1005, 0x1005) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1005, 0x1005) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1800, 0x1800) AM_READ(atarifb4_in0_r)
AM_RANGE(0x1801, 0x1801) AM_READ_PORT("EXTRA")
AM_RANGE(0x1802, 0x1802) AM_READ(atarifb4_in2_r)
@@ -555,6 +556,7 @@ static MACHINE_CONFIG_START( atarifb, atarifb_state )
MCFG_CPU_PROGRAM_MAP(atarifb_map)
MCFG_CPU_PERIODIC_INT_DRIVER(atarifb_state, irq0_line_hold, 4*60)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/atarig1.cpp b/src/mame/drivers/atarig1.cpp
index b4633e6ef69..770b916a4be 100644
--- a/src/mame/drivers/atarig1.cpp
+++ b/src/mame/drivers/atarig1.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
+#include "machine/watchdog.h"
#include "video/atarirle.h"
#include "includes/atarig1.h"
@@ -192,7 +193,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig1_state )
AM_RANGE(0x038000, 0x03ffff) AM_ROM /* pitfight slapstic goes here */
AM_RANGE(0x040000, 0x077fff) AM_ROM
AM_RANGE(0x078000, 0x07ffff) AM_ROM /* hydra slapstic goes here */
- AM_RANGE(0xf80000, 0xf80001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xf80000, 0xf80001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xf88000, 0xf8ffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
AM_RANGE(0xf90000, 0xf90001) AM_DEVWRITE8("jsa", atari_jsa_ii_device, main_command_w, 0xff00)
AM_RANGE(0xf98000, 0xf98001) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
@@ -433,6 +434,8 @@ static MACHINE_CONFIG_START( atarig1, atarig1_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atarig1)
MCFG_PALETTE_ADD("palette", 1280)
diff --git a/src/mame/drivers/atarig42.cpp b/src/mame/drivers/atarig42.cpp
index 2a3ed72b35e..6f474762482 100644
--- a/src/mame/drivers/atarig42.cpp
+++ b/src/mame/drivers/atarig42.cpp
@@ -20,6 +20,7 @@
***************************************************************************/
#include "emu.h"
+#include "machine/watchdog.h"
#include "video/atarirle.h"
#include "includes/atarig42.h"
@@ -341,7 +342,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig42_state )
AM_RANGE(0xe00050, 0xe00051) AM_WRITE(io_latch_w)
AM_RANGE(0xe00060, 0xe00061) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
AM_RANGE(0xe03000, 0xe03001) AM_WRITE(video_int_ack_w)
- AM_RANGE(0xe03800, 0xe03801) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xe03800, 0xe03801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xe80000, 0xe80fff) AM_RAM
AM_RANGE(0xf40000, 0xf40001) AM_DEVREAD("asic65", asic65_device, io_r)
AM_RANGE(0xf60000, 0xf60001) AM_DEVREAD("asic65", asic65_device, read)
@@ -543,6 +544,8 @@ static MACHINE_CONFIG_START( atarig42, atarig42_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atarig42)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp
index faf9e1d9562..4eddb67d945 100644
--- a/src/mame/drivers/atarisy1.cpp
+++ b/src/mame/drivers/atarisy1.cpp
@@ -195,6 +195,7 @@ RoadBlasters (aka Future Vette):005*
#include "cpu/m6502/m6502.h"
#include "machine/atarigen.h"
#include "machine/6522via.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "sound/pokey.h"
#include "video/atarimo.h"
@@ -435,7 +436,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy1_state )
AM_RANGE(0x820000, 0x820001) AM_WRITE(atarisy1_yscroll_w) AM_SHARE("yscroll")
AM_RANGE(0x840000, 0x840001) AM_WRITE(atarisy1_priority_w)
AM_RANGE(0x860000, 0x860001) AM_WRITE(atarisy1_bankselect_w) AM_SHARE("bankselect")
- AM_RANGE(0x880000, 0x880001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x880000, 0x880001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x8a0000, 0x8a0001) AM_WRITE(video_int_ack_w)
AM_RANGE(0x8c0000, 0x8c0001) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
AM_RANGE(0x900000, 0x9fffff) AM_RAM
@@ -721,6 +722,8 @@ static MACHINE_CONFIG_START( atarisy1, atarisy1_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
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)
diff --git a/src/mame/drivers/atarisy2.cpp b/src/mame/drivers/atarisy2.cpp
index 72161c4ca03..10641c5e4c8 100644
--- a/src/mame/drivers/atarisy2.cpp
+++ b/src/mame/drivers/atarisy2.cpp
@@ -763,7 +763,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy2_state )
AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE(xscroll_w) AM_SHARE("xscroll")
AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE(yscroll_w) AM_SHARE("yscroll")
- AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x1c00, 0x1c01) AM_MIRROR(0x03fe) AM_READ(sound_r)
AM_RANGE(0x2000, 0x3fff) AM_READWRITE(videoram_r, videoram_w)
AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("rombank1")
@@ -1199,6 +1199,8 @@ static MACHINE_CONFIG_START( atarisy2, atarisy2_state )
MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atarisy2)
MCFG_PALETTE_ADD("palette", 256)
diff --git a/src/mame/drivers/atetris.cpp b/src/mame/drivers/atetris.cpp
index a4f0365d896..639d7c5c6dd 100644
--- a/src/mame/drivers/atetris.cpp
+++ b/src/mame/drivers/atetris.cpp
@@ -56,6 +56,7 @@
#include "sound/sn76496.h"
#include "sound/pokey.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#define MASTER_CLOCK XTAL_14_31818MHz
@@ -198,7 +199,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, atetris_state )
AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram")
AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_DEVREADWRITE("pokey1", pokey_device, read, write)
AM_RANGE(0x2810, 0x281f) AM_MIRROR(0x03e0) AM_DEVREADWRITE("pokey2", pokey_device, read, write)
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITE(nvram_enable_w)
AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(irq_ack_w)
AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(coincount_w)
@@ -218,7 +219,7 @@ static ADDRESS_MAP_START( atetrisb2_map, AS_PROGRAM, 8, atetris_state )
AM_RANGE(0x2806, 0x2806) AM_DEVWRITE("sn3", sn76496_device, write)
AM_RANGE(0x2808, 0x2808) AM_READ_PORT("IN0")
AM_RANGE(0x2818, 0x2818) AM_READ_PORT("IN1")
- AM_RANGE(0x3000, 0x3000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3400, 0x3400) AM_WRITE(nvram_enable_w)
AM_RANGE(0x3800, 0x3800) AM_WRITE(irq_ack_w)
AM_RANGE(0x3c00, 0x3c00) AM_WRITE(coincount_w)
@@ -238,7 +239,7 @@ static ADDRESS_MAP_START( atetrisb3_map, AS_PROGRAM, 8, atetris_state )
//AM_RANGE(0x2806, 0x2806) AM_DEVWRITE("sn3", sn76489_device, write)
AM_RANGE(0x2808, 0x2808) AM_READ_PORT("IN0")
AM_RANGE(0x2818, 0x2818) AM_READ_PORT("IN1")
- AM_RANGE(0x3000, 0x3000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3400, 0x3400) AM_WRITE(nvram_enable_w)
AM_RANGE(0x3800, 0x3800) AM_WRITE(irq_ack_w)
AM_RANGE(0x3c00, 0x3c00) AM_WRITE(coincount_w)
@@ -334,6 +335,8 @@ static MACHINE_CONFIG_START( atetris, atetris_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atetris)
@@ -371,6 +374,8 @@ static MACHINE_CONFIG_START( atetrisb2, atetris_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atetris)
diff --git a/src/mame/drivers/avalnche.cpp b/src/mame/drivers/avalnche.cpp
index b52c51aa261..8badaf71d69 100644
--- a/src/mame/drivers/avalnche.cpp
+++ b/src/mame/drivers/avalnche.cpp
@@ -32,6 +32,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/discrete.h"
#include "includes/avalnche.h"
@@ -117,7 +118,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, avalnche_state )
AM_RANGE(0x2001, 0x2001) AM_MIRROR(0x0ffc) AM_READ_PORT("IN1")
AM_RANGE(0x2002, 0x2002) AM_MIRROR(0x0ffc) AM_READ_PORT("PADDLE")
AM_RANGE(0x2003, 0x2003) AM_MIRROR(0x0ffc) AM_READNOP
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_1_lamp_w)
AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_WRITE(avalnche_attract_enable_w)
AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE(avalance_video_invert_w)
@@ -135,7 +136,7 @@ static ADDRESS_MAP_START( catch_map, AS_PROGRAM, 8, avalnche_state )
AM_RANGE(0x2001, 0x2001) AM_MIRROR(0x0ffc) AM_READ_PORT("IN1")
AM_RANGE(0x2002, 0x2002) AM_MIRROR(0x0ffc) AM_READ_PORT("PADDLE")
AM_RANGE(0x2003, 0x2003) AM_MIRROR(0x0ffc) AM_READNOP
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_1_lamp_w)
// AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_WRITE(avalnche_attract_enable_w) /* It is attract_enable just like avalnche, but not hooked up yet. */
AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE(avalance_video_invert_w)
@@ -250,6 +251,7 @@ static MACHINE_CONFIG_START( avalnche, avalnche_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_PERIODIC_INT_DRIVER(avalnche_state, nmi_line_pulse, 8*60)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/aztarac.cpp b/src/mame/drivers/aztarac.cpp
index b427530a3de..ba879e5f052 100644
--- a/src/mame/drivers/aztarac.cpp
+++ b/src/mame/drivers/aztarac.cpp
@@ -21,7 +21,7 @@
#include "includes/aztarac.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
-
+#include "machine/watchdog.h"
/*************************************
@@ -83,7 +83,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, aztarac_state )
AM_RANGE(0x027004, 0x027005) AM_READ_PORT("INPUTS")
AM_RANGE(0x027008, 0x027009) AM_READWRITE(sound_r, sound_w)
AM_RANGE(0x02700c, 0x02700d) AM_READ_PORT("DIAL")
- AM_RANGE(0x02700e, 0x02700f) AM_READ(watchdog_reset16_r)
+ AM_RANGE(0x02700e, 0x02700f) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0xff8000, 0xffafff) AM_RAM AM_SHARE("vectorram")
AM_RANGE(0xffb000, 0xffb001) AM_WRITE(ubr_w)
AM_RANGE(0xffe000, 0xffffff) AM_RAM
@@ -159,6 +159,8 @@ static MACHINE_CONFIG_START( aztarac, aztarac_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/badlands.cpp b/src/mame/drivers/badlands.cpp
index f0443dac434..17f7cf3369a 100644
--- a/src/mame/drivers/badlands.cpp
+++ b/src/mame/drivers/badlands.cpp
@@ -167,6 +167,7 @@ Measurements -
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/badlands.h"
@@ -376,7 +377,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xfe0000, 0xfe1fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(video_int_ack_w)
AM_RANGE(0xfe4000, 0xfe5fff) AM_READ_PORT("FE4000")
AM_RANGE(0xfe6000, 0xfe6001) AM_READ_PORT("FE6000")
@@ -509,6 +510,8 @@ static MACHINE_CONFIG_START( badlands, badlands_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", badlands)
MCFG_PALETTE_ADD("palette", 256)
@@ -649,7 +652,7 @@ static ADDRESS_MAP_START( bootleg_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- //AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w)
+ //AM_RANGE(0xfe0000, 0xfe1fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(video_int_ack_w)
AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w)
diff --git a/src/mame/drivers/balsente.cpp b/src/mame/drivers/balsente.cpp
index c802794d525..3a2dc41fd2b 100644
--- a/src/mame/drivers/balsente.cpp
+++ b/src/mame/drivers/balsente.cpp
@@ -233,6 +233,7 @@ DIP locations verified for:
#include "includes/balsente.h"
#include "sound/cem3394.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "stocker.lh"
@@ -254,7 +255,7 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, balsente_state )
AM_RANGE(0x9880, 0x989f) AM_WRITE(balsente_random_reset_w)
AM_RANGE(0x98a0, 0x98bf) AM_WRITE(balsente_rombank_select_w)
AM_RANGE(0x98c0, 0x98df) AM_WRITE(balsente_palette_select_w)
- AM_RANGE(0x98e0, 0x98ff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x98e0, 0x98ff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x9900, 0x9900) AM_READ_PORT("SWH")
AM_RANGE(0x9901, 0x9901) AM_READ_PORT("SWG")
AM_RANGE(0x9902, 0x9902) AM_READ_PORT("IN0")
@@ -1289,6 +1290,8 @@ static MACHINE_CONFIG_START( balsente, balsente_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
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)
diff --git a/src/mame/drivers/baraduke.cpp b/src/mame/drivers/baraduke.cpp
index 16522d28f32..dbbe8eee691 100644
--- a/src/mame/drivers/baraduke.cpp
+++ b/src/mame/drivers/baraduke.cpp
@@ -110,6 +110,7 @@ DIP locations verified for:
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "includes/baraduke.h"
@@ -166,7 +167,7 @@ static ADDRESS_MAP_START( baraduke_map, AS_PROGRAM, 8, baraduke_state )
AM_RANGE(0x2000, 0x3fff) AM_READWRITE(baraduke_videoram_r,baraduke_videoram_w) AM_SHARE("videoram") /* Video RAM */
AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
AM_RANGE(0x4800, 0x4fff) AM_READWRITE(baraduke_textram_r,baraduke_textram_w) AM_SHARE("textram")/* video RAM (text layer) */
- AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog reset */
AM_RANGE(0x8800, 0x8800) AM_WRITE(baraduke_irq_ack_w) /* irq acknowledge */
AM_RANGE(0xb000, 0xb002) AM_WRITE(baraduke_scroll0_w) /* scroll (layer 0) */
AM_RANGE(0xb004, 0xb006) AM_WRITE(baraduke_scroll1_w) /* scroll (layer 1) */
@@ -380,6 +381,8 @@ static MACHINE_CONFIG_START( baraduke, baraduke_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* we need heavy synch */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_49_152MHz/8, 384, 0, 36*8, 264, 2*8, 30*8)
diff --git a/src/mame/drivers/batman.cpp b/src/mame/drivers/batman.cpp
index bde69a49251..fd02aab2453 100644
--- a/src/mame/drivers/batman.cpp
+++ b/src/mame/drivers/batman.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "video/atarimo.h"
#include "includes/batman.h"
@@ -105,7 +106,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, batman_state )
AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_DEVWRITE8("jsa", atari_jsa_iii_device, main_command_w, 0x00ff)
AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE(latch_w)
AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
- AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x3e0000, 0x3e0fff) AM_MIRROR(0x100000) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x3effc0, 0x3effff) AM_MIRROR(0x100000) AM_DEVREADWRITE("vad", atari_vad_device, control_read, control_write)
AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x100000) AM_DEVWRITE("vad", atari_vad_device, playfield2_latched_msb_w) AM_SHARE("vad:playfield2")
@@ -205,6 +206,8 @@ static MACHINE_CONFIG_START( batman, batman_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", batman)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/battlnts.cpp b/src/mame/drivers/battlnts.cpp
index e4fa41bac78..b4d00a994d8 100644
--- a/src/mame/drivers/battlnts.cpp
+++ b/src/mame/drivers/battlnts.cpp
@@ -15,6 +15,7 @@
#include "emu.h"
#include "cpu/m6809/hd6309.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/3812intf.h"
#include "includes/konamipt.h"
#include "includes/battlnts.h"
@@ -69,7 +70,7 @@ static ADDRESS_MAP_START( battlnts_map, AS_PROGRAM, 8, battlnts_state )
AM_RANGE(0x2e04, 0x2e04) AM_READ_PORT("DSW2")
AM_RANGE(0x2e08, 0x2e08) AM_WRITE(battlnts_bankswitch_w) /* bankswitch control */
AM_RANGE(0x2e0c, 0x2e0c) AM_WRITE(battlnts_spritebank_w) /* sprite bank select */
- AM_RANGE(0x2e10, 0x2e10) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x2e10, 0x2e10) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2e14, 0x2e14) AM_WRITE(soundlatch_byte_w) /* sound code # */
AM_RANGE(0x2e18, 0x2e18) AM_WRITE(battlnts_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("rombank") /* banked ROM */
@@ -234,6 +235,7 @@ static MACHINE_CONFIG_START( battlnts, battlnts_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_24MHz / 6 /* 3579545? */)
MCFG_CPU_PROGRAM_MAP(battlnts_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/beathead.cpp b/src/mame/drivers/beathead.cpp
index 59de21205b5..d2b815b2ddb 100644
--- a/src/mame/drivers/beathead.cpp
+++ b/src/mame/drivers/beathead.cpp
@@ -102,7 +102,7 @@
#include "emu.h"
#include "includes/beathead.h"
#include "machine/nvram.h"
-
+#include "machine/watchdog.h"
#define MAX_SCANLINES 262
@@ -290,7 +290,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, beathead_state)
AM_RANGE(0x41000400, 0x41000403) AM_WRITEONLY AM_SHARE("palette_select")
AM_RANGE(0x41000500, 0x41000503) AM_WRITE(eeprom_enable_w)
AM_RANGE(0x41000600, 0x41000603) AM_WRITE(finescroll_w)
- AM_RANGE(0x41000700, 0x41000703) AM_WRITE(watchdog_reset32_w)
+ AM_RANGE(0x41000700, 0x41000703) AM_DEVWRITE("watchdog", watchdog_timer_device, reset32_w)
AM_RANGE(0x42000000, 0x4201ffff) AM_DEVREADWRITE16("palette", palette_device, read, write, 0x0000ffff) AM_SHARE("palette")
AM_RANGE(0x43000000, 0x43000007) AM_READWRITE(hsync_ram_r, hsync_ram_w)
AM_RANGE(0x8df80000, 0x8df80003) AM_READNOP /* noisy x4 during scanline int */
@@ -368,6 +368,8 @@ static MACHINE_CONFIG_START( beathead, beathead_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_TIMER_DRIVER_ADD("scan_timer", beathead_state, scanline_callback)
/* video hardware */
diff --git a/src/mame/drivers/beezer.cpp b/src/mame/drivers/beezer.cpp
index ab4cbbe31f1..78522fdec37 100644
--- a/src/mame/drivers/beezer.cpp
+++ b/src/mame/drivers/beezer.cpp
@@ -93,6 +93,8 @@ static MACHINE_CONFIG_START( beezer, beezer_state )
MCFG_CPU_ADD("audiocpu", M6809, 1000000) /* 1 MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp
index 49a4a89f6e7..df1c922a914 100644
--- a/src/mame/drivers/bfm_sc1.cpp
+++ b/src/mame/drivers/bfm_sc1.cpp
@@ -98,6 +98,7 @@ Optional (on expansion card) (Viper)
#include "sound/ay8910.h"
#include "sound/upd7759.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "machine/bfm_comn.h"
#include "sc1_vfd.lh"
@@ -689,7 +690,7 @@ static ADDRESS_MAP_START( sc1_base, AS_PROGRAM, 8, bfm_sc1_state )
AM_RANGE(0x4000, 0x5FFF) AM_ROM // 8k ROM
AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK("bank1") // 8k paged ROM (4 pages)
- AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE (watchdog_reset_w) // 32k ROM
+ AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) // 32k ROM
ADDRESS_MAP_END
@@ -1066,6 +1067,8 @@ static MACHINE_CONFIG_START( scorpion1, bfm_sc1_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz
MCFG_CPU_PROGRAM_MAP(sc1_base) // setup read and write memorymap
MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc1_state, timer_irq, 1000) // generate 1000 IRQ's per second
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp
index 38045b108ec..c1af8bb6e2c 100644
--- a/src/mame/drivers/bfm_sc2.cpp
+++ b/src/mame/drivers/bfm_sc2.cpp
@@ -145,6 +145,7 @@ Adder hardware:
#include "cpu/m6809/m6809.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "video/bfm_adr2.h"
@@ -1439,7 +1440,7 @@ static ADDRESS_MAP_START( sc2_basemap, AS_PROGRAM, 8, bfm_sc2_state )
AM_RANGE(0x232F, 0x232F) AM_WRITE(coininhib_w)
AM_RANGE(0x2330, 0x2330) AM_WRITE(payout_latch_w)
AM_RANGE(0x2331, 0x2331) AM_WRITE(payout_triac_w)
- AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2332, 0x2332) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2333, 0x2333) AM_WRITE(mmtr_w)
AM_RANGE(0x2334, 0x2335) AM_WRITE(unknown_w)
AM_RANGE(0x2336, 0x2336) AM_WRITE(dimcnt_w)
@@ -2169,9 +2170,11 @@ static MACHINE_CONFIG_START( scorpion2_vid, bfm_sc2_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 ) // 6809 CPU at 2 Mhz
MCFG_CPU_PROGRAM_MAP(memmap_vid) // setup scorpion2 board memorymap
MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc2_state, timer_irq, 1000) // generate 1000 IRQ's per second
- MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
MCFG_QUANTUM_TIME(attotime::from_hz(960)) // needed for serial communication !!
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
+
MCFG_BFMBD1_ADD("vfd0",0)
MCFG_BFMBD1_ADD("vfd1",1)
@@ -3624,6 +3627,8 @@ static MACHINE_CONFIG_START( scorpion2, bfm_sc2_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 )
MCFG_CPU_PROGRAM_MAP(memmap_no_vid)
MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc2_state, timer_irq, 1000)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
MCFG_BFMBD1_ADD("vfd0",0)
@@ -3682,6 +3687,8 @@ static MACHINE_CONFIG_START( scorpion2_dm01, bfm_sc2_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 )
MCFG_CPU_PROGRAM_MAP(memmap_no_vid)
MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc2_state, timer_irq, 1000)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/bking.cpp b/src/mame/drivers/bking.cpp
index 6d25f92bba9..e6085af308e 100644
--- a/src/mame/drivers/bking.cpp
+++ b/src/mame/drivers/bking.cpp
@@ -20,6 +20,7 @@ DIP Locations verified for:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "includes/bking.h"
@@ -91,7 +92,7 @@ static ADDRESS_MAP_START( bking_io_map, AS_IO, 8, bking_state )
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSWC") AM_WRITE(bking_xld3_w)
AM_RANGE(0x05, 0x05) AM_READWRITE(bking_input_port_5_r, bking_yld3_w)
AM_RANGE(0x06, 0x06) AM_READWRITE(bking_input_port_6_r, bking_msk_w)
- AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x07, 0x07) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x08, 0x08) AM_WRITE(bking_cont1_w)
AM_RANGE(0x09, 0x09) AM_WRITE(bking_cont2_w)
AM_RANGE(0x0a, 0x0a) AM_WRITE(bking_cont3_w)
@@ -110,7 +111,7 @@ static ADDRESS_MAP_START( bking3_io_map, AS_IO, 8, bking_state )
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSWC") AM_WRITE(bking_xld3_w)
AM_RANGE(0x05, 0x05) AM_READWRITE(bking_input_port_5_r, bking_yld3_w)
AM_RANGE(0x06, 0x06) AM_READWRITE(bking_input_port_6_r, bking_msk_w)
- AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x07, 0x07) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x08, 0x08) AM_WRITE(bking_cont1_w)
AM_RANGE(0x09, 0x09) AM_WRITE(bking_cont2_w)
AM_RANGE(0x0a, 0x0a) AM_WRITE(bking_cont3_w)
@@ -463,6 +464,8 @@ static MACHINE_CONFIG_START( bking, bking_state )
/* - periodic IRQ, with frequency 6000000/(4*16*16*10*16) = 36.621 Hz, */
MCFG_CPU_PERIODIC_INT_DRIVER(bking_state, irq0_line_hold, (double)6000000/(4*16*16*10*16))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/bladestl.cpp b/src/mame/drivers/bladestl.cpp
index 565ba8b3fab..a15997f06c4 100644
--- a/src/mame/drivers/bladestl.cpp
+++ b/src/mame/drivers/bladestl.cpp
@@ -31,6 +31,7 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6809/hd6309.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/konamipt.h"
#include "includes/bladestl.h"
@@ -133,7 +134,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bladestl_state )
AM_RANGE(0x2e03, 0x2e03) AM_READ_PORT("DSW2") /* DISPW #2 */
AM_RANGE(0x2e40, 0x2e40) AM_READ_PORT("DSW1") /* DIPSW #1 */
AM_RANGE(0x2e80, 0x2e80) AM_WRITE(bladestl_sh_irqtrigger_w) /* cause interrupt on audio CPU */
- AM_RANGE(0x2ec0, 0x2ec0) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x2ec0, 0x2ec0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2f00, 0x2f03) AM_READ(trackball_r) /* Trackballs */
AM_RANGE(0x2f40, 0x2f40) AM_WRITE(bladestl_bankswitch_w) /* bankswitch control */
AM_RANGE(0x2f80, 0x2f9f) AM_DEVREADWRITE("k051733", k051733_device, read, write) /* Protection: 051733 */
@@ -307,6 +308,7 @@ static MACHINE_CONFIG_START( bladestl, bladestl_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600))
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/blktiger.cpp b/src/mame/drivers/blktiger.cpp
index 869195e3a6d..dbdd1146677 100644
--- a/src/mame/drivers/blktiger.cpp
+++ b/src/mame/drivers/blktiger.cpp
@@ -17,6 +17,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "cpu/mcs51/mcs51.h"
#include "includes/blktiger.h"
@@ -88,7 +89,7 @@ static ADDRESS_MAP_START( blktiger_io_map, AS_IO, 8, blktiger_state )
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE(blktiger_coinlockout_w)
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1") AM_WRITE(blktiger_video_control_w)
AM_RANGE(0x05, 0x05) AM_READ_PORT("FREEZE")
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_READWRITE(blktiger_from_mcu_r,blktiger_to_mcu_w) /* Software protection (7) */
AM_RANGE(0x08, 0x09) AM_WRITE(blktiger_scrollx_w)
AM_RANGE(0x0a, 0x0b) AM_WRITE(blktiger_scrolly_w)
@@ -105,7 +106,7 @@ static ADDRESS_MAP_START( blktigerbl_io_map, AS_IO, 8, blktiger_state )
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE(blktiger_coinlockout_w)
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1") AM_WRITE(blktiger_video_control_w)
AM_RANGE(0x05, 0x05) AM_READ_PORT("FREEZE")
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_NOP /* Software protection (7) */
AM_RANGE(0x08, 0x09) AM_WRITE(blktiger_scrollx_w)
AM_RANGE(0x0a, 0x0b) AM_WRITE(blktiger_scrolly_w)
@@ -313,6 +314,7 @@ static MACHINE_CONFIG_START( blktiger, blktiger_state )
MCFG_CPU_IO_MAP(blktiger_mcu_io_map)
//MCFG_CPU_VBLANK_INT_DRIVER("screen", blktiger_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/blockhl.cpp b/src/mame/drivers/blockhl.cpp
index 8cca358e26a..7117471785e 100644
--- a/src/mame/drivers/blockhl.cpp
+++ b/src/mame/drivers/blockhl.cpp
@@ -21,6 +21,7 @@
#include "cpu/m6809/konami.h"
#include "cpu/z80/z80.h"
#include "machine/bankdev.h"
+#include "machine/watchdog.h"
#include "video/k052109.h"
#include "video/k051960.h"
#include "sound/2151intf.h"
@@ -73,7 +74,7 @@ private:
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, blockhl_state )
AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x1f88, 0x1f88) AM_WRITE(sound_irq_w)
- AM_RANGE(0x1f8c, 0x1f8c) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1f8c, 0x1f8c) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1f94, 0x1f94) AM_READ_PORT("DSW3")
AM_RANGE(0x1f95, 0x1f95) AM_READ_PORT("P1")
AM_RANGE(0x1f96, 0x1f96) AM_READ_PORT("P2")
@@ -281,6 +282,8 @@ static MACHINE_CONFIG_START( blockhl, blockhl_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(audio_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
diff --git a/src/mame/drivers/blstroid.cpp b/src/mame/drivers/blstroid.cpp
index f208e11cb69..9c9e159b52b 100644
--- a/src/mame/drivers/blstroid.cpp
+++ b/src/mame/drivers/blstroid.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "machine/atarigen.h"
#include "includes/blstroid.h"
@@ -64,7 +65,7 @@ MACHINE_RESET_MEMBER(blstroid_state,blstroid)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, blstroid_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x7c0000) AM_ROM
- AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x7f81fe) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x7f81fe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xff8200, 0xff8201) AM_MIRROR(0x7f81fe) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x7f81fe) AM_WRITE(video_int_ack_w)
AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x7f81fe) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
@@ -181,6 +182,8 @@ static MACHINE_CONFIG_START( blstroid, blstroid_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", blstroid)
diff --git a/src/mame/drivers/blueprnt.cpp b/src/mame/drivers/blueprnt.cpp
index 1c21a0ca56d..f318bcf649a 100644
--- a/src/mame/drivers/blueprnt.cpp
+++ b/src/mame/drivers/blueprnt.cpp
@@ -50,6 +50,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/blueprnt.h"
@@ -105,7 +106,7 @@ static ADDRESS_MAP_START( blueprnt_map, AS_PROGRAM, 8, blueprnt_state )
AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P2")
AM_RANGE(0xc003, 0xc003) AM_READ(blueprnt_sh_dipsw_r)
AM_RANGE(0xd000, 0xd000) AM_WRITE(blueprnt_sound_command_w)
- AM_RANGE(0xe000, 0xe000) AM_READ(watchdog_reset_r) AM_WRITE(blueprnt_flipscreen_w)
+ AM_RANGE(0xe000, 0xe000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(blueprnt_flipscreen_w)
AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(blueprnt_colorram_w) AM_MIRROR(0x400) AM_SHARE("colorram")
ADDRESS_MAP_END
@@ -351,6 +352,8 @@ static MACHINE_CONFIG_START( blueprnt, blueprnt_state )
MCFG_QUANTUM_PERFECT_CPU("maincpu")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/bottom9.cpp b/src/mame/drivers/bottom9.cpp
index 7d3e5d9a61f..9a88444c5a6 100644
--- a/src/mame/drivers/bottom9.cpp
+++ b/src/mame/drivers/bottom9.cpp
@@ -17,6 +17,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "includes/konamipt.h"
#include "includes/bottom9.h"
@@ -158,7 +159,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bottom9_state )
AM_RANGE(0x0000, 0x07ff) AM_READWRITE(bottom9_bankedram1_r, bottom9_bankedram1_w)
AM_RANGE(0x1f80, 0x1f80) AM_WRITE(bankswitch_w)
AM_RANGE(0x1f90, 0x1f90) AM_WRITE(bottom9_1f90_w)
- AM_RANGE(0x1fa0, 0x1fa0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1fa0, 0x1fa0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1fb0, 0x1fb0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x1fc0, 0x1fc0) AM_WRITE(bottom9_sh_irqtrigger_w)
AM_RANGE(0x1fd0, 0x1fd0) AM_READ_PORT("SYSTEM")
@@ -304,6 +305,8 @@ static MACHINE_CONFIG_START( bottom9, bottom9_state )
MCFG_CPU_PROGRAM_MAP(audio_map)
MCFG_CPU_PERIODIC_INT_DRIVER(bottom9_state, bottom9_sound_interrupt, 8*60) /* irq is triggered by the main CPU */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/boxer.cpp b/src/mame/drivers/boxer.cpp
index eb31c5dc174..2dde29fe8e3 100644
--- a/src/mame/drivers/boxer.cpp
+++ b/src/mame/drivers/boxer.cpp
@@ -12,7 +12,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
-
+#include "machine/watchdog.h"
#define MASTER_CLOCK XTAL_12_096MHz
@@ -346,7 +346,7 @@ static ADDRESS_MAP_START( boxer_map, AS_PROGRAM, 8, boxer_state )
AM_RANGE(0x1c00, 0x1cff) AM_WRITE(boxer_irq_reset_w)
AM_RANGE(0x1d00, 0x1dff) AM_WRITE(boxer_bell_w)
AM_RANGE(0x1e00, 0x1eff) AM_WRITEONLY AM_SHARE("sprite_ram")
- AM_RANGE(0x1f00, 0x1fff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1f00, 0x1fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3000, 0x3fff) AM_ROM
ADDRESS_MAP_END
@@ -480,6 +480,7 @@ static MACHINE_CONFIG_START( boxer, boxer_state )
MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 16)
MCFG_CPU_PROGRAM_MAP(boxer_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/bublbobl.cpp b/src/mame/drivers/bublbobl.cpp
index a14e4eda207..0f5f57528e6 100644
--- a/src/mame/drivers/bublbobl.cpp
+++ b/src/mame/drivers/bublbobl.cpp
@@ -276,6 +276,7 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "sound/3526intf.h"
#include "cpu/m6805/m6805.h"
@@ -300,7 +301,7 @@ static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, bublbobl_state )
AM_RANGE(0xf800, 0xf9ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xfa00, 0xfa00) AM_READWRITE(bublbobl_sound_status_r, bublbobl_sound_command_w)
AM_RANGE(0xfa03, 0xfa03) AM_WRITE(bublbobl_soundcpu_reset_w)
- AM_RANGE(0xfa80, 0xfa80) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xfa80, 0xfa80) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xfb40, 0xfb40) AM_WRITE(bublbobl_bankswitch_w)
AM_RANGE(0xfc00, 0xffff) AM_RAM AM_SHARE("mcu_sharedram")
ADDRESS_MAP_END
@@ -378,7 +379,7 @@ static ADDRESS_MAP_START( tokio_map, AS_PROGRAM, 8, bublbobl_state )
AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_SHARE("objectram")
AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("share1")
AM_RANGE(0xf800, 0xf9ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0xfa00, 0xfa00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xfa00, 0xfa00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xfa03, 0xfa03) AM_READ_PORT("DSW0")
AM_RANGE(0xfa04, 0xfa04) AM_READ_PORT("DSW1")
AM_RANGE(0xfa05, 0xfa05) AM_READ_PORT("IN0")
@@ -782,6 +783,8 @@ static MACHINE_CONFIG_START( tokio, bublbobl_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_START_OVERRIDE(bublbobl_state, tokio)
MCFG_MACHINE_RESET_OVERRIDE(bublbobl_state, tokio)
@@ -864,6 +867,8 @@ static MACHINE_CONFIG_START( bublbobl, bublbobl_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_START_OVERRIDE(bublbobl_state, bublbobl)
MCFG_MACHINE_RESET_OVERRIDE(bublbobl_state, bublbobl)
diff --git a/src/mame/drivers/buggychl.cpp b/src/mame/drivers/buggychl.cpp
index 6892af92550..3563b156be8 100644
--- a/src/mame/drivers/buggychl.cpp
+++ b/src/mame/drivers/buggychl.cpp
@@ -80,6 +80,7 @@ Dip locations and factory settings verified from dip listing
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/buggychl.h"
@@ -137,7 +138,7 @@ static ADDRESS_MAP_START( buggychl_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0xd100, 0xd100) AM_WRITE(buggychl_ctrl_w)
AM_RANGE(0xd200, 0xd200) AM_WRITE(bankswitch_w)
- AM_RANGE(0xd300, 0xd300) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xd300, 0xd300) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd303, 0xd303) AM_WRITE(buggychl_sprite_lookup_bank_w)
AM_RANGE(0xd400, 0xd400) AM_DEVREADWRITE("bmcu", buggychl_mcu_device, buggychl_mcu_r, buggychl_mcu_w)
AM_RANGE(0xd401, 0xd401) AM_DEVREAD("bmcu", buggychl_mcu_device, buggychl_mcu_status_r)
@@ -373,6 +374,7 @@ static MACHINE_CONFIG_START( buggychl, buggychl_state )
MCFG_CPU_PROGRAM_MAP(buggychl_mcu_map)
MCFG_DEVICE_ADD("bmcu", BUGGYCHL_MCU, 0)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/bwidow.cpp b/src/mame/drivers/bwidow.cpp
index a899bd8bd9a..6c738de146f 100644
--- a/src/mame/drivers/bwidow.cpp
+++ b/src/mame/drivers/bwidow.cpp
@@ -220,6 +220,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "video/vector.h"
#include "video/avgdvg.h"
#include "machine/atari_vg.h"
@@ -400,7 +401,7 @@ static ADDRESS_MAP_START( bwidowp_map, AS_PROGRAM, 8, bwidow_state )
AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0")
AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("avg", avg_device, go_w)
AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("avg", avg_device, reset_w)
- AM_RANGE(0x3000, 0x3000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3800, 0x3800) AM_WRITE(bwidow_misc_w) /* coin counters, leds */
AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
AM_RANGE(0x4800, 0x6fff) AM_ROM
@@ -757,6 +758,7 @@ static MACHINE_CONFIG_DERIVED( bwidowp, bwidow )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(bwidowp_map)
+ MCFG_WATCHDOG_ADD("watchdog")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gravitar, bwidow )
diff --git a/src/mame/drivers/bzone.cpp b/src/mame/drivers/bzone.cpp
index 787b8914163..f95bf75f3d7 100644
--- a/src/mame/drivers/bzone.cpp
+++ b/src/mame/drivers/bzone.cpp
@@ -208,6 +208,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "video/vector.h"
#include "video/avgdvg.h"
#include "machine/atari_vg.h"
@@ -304,7 +305,7 @@ static ADDRESS_MAP_START( bzone_map, AS_PROGRAM, 8, bzone_state )
AM_RANGE(0x0c00, 0x0c00) AM_READ_PORT("DSW1")
AM_RANGE(0x1000, 0x1000) AM_WRITE(bzone_coin_counter_w)
AM_RANGE(0x1200, 0x1200) AM_DEVWRITE("avg", avg_bzone_device, go_w)
- AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1400, 0x1400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1600, 0x1600) AM_DEVWRITE("avg", avg_bzone_device, reset_w)
AM_RANGE(0x1800, 0x1800) AM_DEVREAD("mathbox", mathbox_device, status_r)
AM_RANGE(0x1810, 0x1810) AM_DEVREAD("mathbox", mathbox_device, lo_r)
@@ -324,7 +325,7 @@ static ADDRESS_MAP_START( redbaron_map, AS_PROGRAM, 8, bzone_state )
AM_RANGE(0x0c00, 0x0c00) AM_READ_PORT("DSW1")
AM_RANGE(0x1000, 0x1000) AM_WRITENOP /* coin out - Manual states this is "Coin Counter" */
AM_RANGE(0x1200, 0x1200) AM_DEVWRITE("avg", avg_bzone_device, go_w)
- AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1400, 0x1400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1600, 0x1600) AM_DEVWRITE("avg", avg_bzone_device, reset_w)
AM_RANGE(0x1800, 0x1800) AM_DEVREAD("mathbox", mathbox_device, status_r)
AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN4")
@@ -538,6 +539,8 @@ static MACHINE_CONFIG_START( bzone_base, bzone_state )
MCFG_CPU_PROGRAM_MAP(bzone_map)
MCFG_CPU_PERIODIC_INT_DRIVER(bzone_state, bzone_interrupt, BZONE_CLOCK_3KHZ / 12)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/canyon.cpp b/src/mame/drivers/canyon.cpp
index 41a9fe0bbad..cfd770af0e1 100644
--- a/src/mame/drivers/canyon.cpp
+++ b/src/mame/drivers/canyon.cpp
@@ -112,7 +112,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, canyon_state )
AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x100) AM_RAM
AM_RANGE(0x0400, 0x0401) AM_WRITE(canyon_motor_w)
AM_RANGE(0x0500, 0x0500) AM_WRITE(canyon_explode_w)
- AM_RANGE(0x0501, 0x0501) AM_WRITE(watchdog_reset_w) /* watchdog, disabled in service mode */
+ AM_RANGE(0x0501, 0x0501) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog, disabled in service mode */
AM_RANGE(0x0600, 0x0603) AM_WRITE(canyon_whistle_w)
AM_RANGE(0x0680, 0x0683) AM_WRITE(canyon_led_w)
AM_RANGE(0x0700, 0x0703) AM_WRITE(canyon_attract_w)
@@ -242,7 +242,9 @@ static MACHINE_CONFIG_START( canyon, canyon_state )
MCFG_CPU_ADD("maincpu", M6502, XTAL_12_096MHz / 16)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", canyon_state, nmi_line_pulse)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp
index f3d1deae057..1512534c7c4 100644
--- a/src/mame/drivers/capbowl.cpp
+++ b/src/mame/drivers/capbowl.cpp
@@ -181,7 +181,7 @@ WRITE8_MEMBER(capbowl_state::track_reset_w)
m_last_trackball_val[0] = ioport("TRACKY")->read();
m_last_trackball_val[1] = ioport("TRACKX")->read();
- watchdog_reset_w(space, offset, data);
+ m_watchdog->reset_w(space, offset, data);
}
@@ -316,6 +316,8 @@ static MACHINE_CONFIG_START( capbowl, capbowl_state )
MCFG_CPU_ADD("maincpu", M6809E, MASTER_CLOCK)
MCFG_CPU_PROGRAM_MAP(capbowl_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", capbowl_state, interrupt)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_ASTABLE(100000.0, 100000.0, 0.1e-6) * 15.5) // ~0.3s
MCFG_CPU_ADD("audiocpu", M6809E, MASTER_CLOCK)
diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp
index aedaac4dd3c..05d37048af7 100644
--- a/src/mame/drivers/cave.cpp
+++ b/src/mame/drivers/cave.cpp
@@ -78,6 +78,7 @@ Versions known to exist but not dumped:
#include "cpu/m68000/m68000.h"
#include "machine/eepromser.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "cpu/z80/z80.h"
#include "includes/cave.h"
#include "sound/2203intf.h"
@@ -567,7 +568,7 @@ static ADDRESS_MAP_START( gaia_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0xd00010, 0xd00011) AM_WRITE(gaia_coin_lsb_w) // Coin counter only
AM_RANGE(0xd00012, 0xd00013) AM_READ_PORT("IN1") // Inputs
AM_RANGE(0xd00014, 0xd00015) AM_READ_PORT("DSW") // Dips
- AM_RANGE(0xd00014, 0xd00015) AM_WRITE(watchdog_reset16_w) // Watchdog?
+ AM_RANGE(0xd00014, 0xd00015) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // Watchdog?
ADDRESS_MAP_END
@@ -735,7 +736,7 @@ static ADDRESS_MAP_START( mazinger_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0x200000, 0x207fff) AM_RAM AM_SHARE("spriteram.0") // Sprites
/**/AM_RANGE(0x208000, 0x20ffff) AM_RAM AM_SHARE("spriteram_2.0") // Sprites?
AM_RANGE(0x300000, 0x300007) AM_READ(cave_irq_cause_r) // IRQ Cause
- AM_RANGE(0x300068, 0x300069) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x300068, 0x300069) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // Watchdog
AM_RANGE(0x30006e, 0x30006f) AM_READWRITE(soundlatch_ack_r, sound_cmd_w) // From Sound CPU
AM_RANGE(0x300000, 0x30007f) AM_WRITEONLY AM_SHARE("videoregs.0") // Video Regs
AM_RANGE(0x400000, 0x407fff) AM_RAM_WRITE(cave_vram_1_8x8_w) AM_SHARE("vram.1") // Layer 1
@@ -759,7 +760,7 @@ static ADDRESS_MAP_START( metmqstr_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x100000, 0x17ffff) AM_ROM // ROM
AM_RANGE(0x200000, 0x27ffff) AM_ROM // ROM
AM_RANGE(0x408000, 0x408fff) AM_RAM AM_SHARE("paletteram.0") // Palette
- AM_RANGE(0x600000, 0x600001) AM_READ(watchdog_reset16_r) // Watchdog?
+ AM_RANGE(0x600000, 0x600001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog?
AM_RANGE(0x880000, 0x887fff) AM_RAM_WRITE(cave_vram_2_w) AM_SHARE("vram.2") // Layer 2
AM_RANGE(0x888000, 0x88ffff) AM_RAM //
AM_RANGE(0x900000, 0x907fff) AM_RAM_WRITE(cave_vram_1_w) AM_SHARE("vram.1") // Layer 1
@@ -767,7 +768,7 @@ static ADDRESS_MAP_START( metmqstr_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x980000, 0x987fff) AM_RAM_WRITE(cave_vram_0_w) AM_SHARE("vram.0") // Layer 0
AM_RANGE(0x988000, 0x98ffff) AM_RAM //
AM_RANGE(0xa80000, 0xa80007) AM_READ(cave_irq_cause_r) // IRQ Cause
- AM_RANGE(0xa80068, 0xa80069) AM_WRITE(watchdog_reset16_w) // Watchdog?
+ AM_RANGE(0xa80068, 0xa80069) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // Watchdog?
AM_RANGE(0xa8006c, 0xa8006d) AM_READ(soundflags_ack_r) AM_WRITENOP // Communication
AM_RANGE(0xa8006e, 0xa8006f) AM_READWRITE(soundlatch_ack_r, sound_cmd_w) // From Sound CPU
AM_RANGE(0xa80000, 0xa8007f) AM_WRITEONLY AM_SHARE("videoregs.0") // Video Regs
@@ -880,7 +881,7 @@ static ADDRESS_MAP_START( ppsatan_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x200004, 0x200005) AM_READWRITE(ppsatan_touch1_r, ppsatan_io_mux_w) // Touch Screen
AM_RANGE(0x200006, 0x200007) AM_WRITENOP // Lev. 2 IRQ Ack?
AM_RANGE(0x2c0000, 0x2c0007) AM_READ(cave_irq_cause_r) // IRQ Cause
- AM_RANGE(0x2c0068, 0x2c0069) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x2c0068, 0x2c0069) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // Watchdog
AM_RANGE(0x2c0000, 0x2c007f) AM_WRITEONLY AM_SHARE("videoregs.1") // Video Regs
AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // M6295
@@ -1057,7 +1058,7 @@ static ADDRESS_MAP_START( tjumpman_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x600000, 0x600001) AM_READ_PORT("IN0") // Inputs + EEPROM + Hopper
AM_RANGE(0x600002, 0x600003) AM_READ_PORT("IN1") // Inputs
AM_RANGE(0x700000, 0x700007) AM_READ(cave_irq_cause_r) // IRQ Cause
- AM_RANGE(0x700068, 0x700069) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x700068, 0x700069) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // Watchdog
AM_RANGE(0x700000, 0x70007f) AM_WRITEONLY AM_SHARE("videoregs.0") // Video Regs
AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) // M6295
AM_RANGE(0xc00000, 0xc00001) AM_WRITE(tjumpman_leds_w) // Leds + Hopper
@@ -1092,7 +1093,7 @@ static ADDRESS_MAP_START( pacslot_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x208000, 0x20ffff) AM_RAM AM_SHARE("spriteram_2.0") // Sprite bank 2
AM_RANGE(0x300000, 0x307fff) AM_RAM_WRITE(cave_vram_0_w) AM_SHARE("vram.0") // Layer 0
AM_RANGE(0x400000, 0x400007) AM_READ(cave_irq_cause_r) // IRQ Cause
- AM_RANGE(0x400068, 0x400069) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x400068, 0x400069) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // Watchdog
AM_RANGE(0x400000, 0x40007f) AM_WRITEONLY AM_SHARE("videoregs.0") // Video Regs
AM_RANGE(0x500000, 0x500005) AM_WRITEONLY AM_SHARE("vctrl.0") // Layer 0 Control
AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("paletteram.0") // Palette
@@ -2146,6 +2147,8 @@ static MACHINE_CONFIG_START( gaia, cave_state )
MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(15625/271.5)
@@ -2321,6 +2324,7 @@ static MACHINE_CONFIG_START( mazinger, cave_state )
MCFG_CPU_PROGRAM_MAP(mazinger_sound_map)
MCFG_CPU_IO_MAP(mazinger_sound_portmap)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
@@ -2374,6 +2378,7 @@ static MACHINE_CONFIG_START( metmqstr, cave_state )
MCFG_CPU_PROGRAM_MAP(metmqstr_sound_map)
MCFG_CPU_IO_MAP(metmqstr_sound_portmap)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
@@ -2426,6 +2431,7 @@ static MACHINE_CONFIG_START( pacslot, cave_state )
MCFG_CPU_PROGRAM_MAP(pacslot_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
@@ -2480,6 +2486,7 @@ static MACHINE_CONFIG_START( ppsatan, cave_state )
MCFG_CPU_PROGRAM_MAP(ppsatan_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt_ppsatan)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(1)) /* a guess, and certainly wrong */
MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
@@ -2654,6 +2661,7 @@ static MACHINE_CONFIG_START( tjumpman, cave_state )
MCFG_CPU_PROGRAM_MAP(tjumpman_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
diff --git a/src/mame/drivers/ccastles.cpp b/src/mame/drivers/ccastles.cpp
index 4d5ae422e6c..170e738f1c8 100644
--- a/src/mame/drivers/ccastles.cpp
+++ b/src/mame/drivers/ccastles.cpp
@@ -121,6 +121,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/pokey.h"
#include "includes/ccastles.h"
@@ -333,7 +334,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, ccastles_state )
AM_RANGE(0x9c80, 0x9cff) AM_WRITE(ccastles_hscroll_w)
AM_RANGE(0x9d00, 0x9d7f) AM_WRITE(ccastles_vscroll_w)
AM_RANGE(0x9d80, 0x9dff) AM_WRITE(irq_ack_w)
- AM_RANGE(0x9e00, 0x9e7f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x9e00, 0x9e7f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x9e80, 0x9e81) AM_MIRROR(0x0078) AM_WRITE(led_w)
AM_RANGE(0x9e82, 0x9e83) AM_MIRROR(0x0078) AM_WRITE(nvram_store_w)
AM_RANGE(0x9e85, 0x9e86) AM_MIRROR(0x0078) AM_WRITE(ccounter_w)
@@ -454,7 +455,8 @@ static MACHINE_CONFIG_START( ccastles, ccastles_state )
MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8)
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_X2212_ADD_AUTOSAVE("nvram_4b")
MCFG_X2212_ADD_AUTOSAVE("nvram_4a")
diff --git a/src/mame/drivers/cchasm.cpp b/src/mame/drivers/cchasm.cpp
index 237f34e87f3..7b8c2b2f556 100644
--- a/src/mame/drivers/cchasm.cpp
+++ b/src/mame/drivers/cchasm.cpp
@@ -22,6 +22,7 @@
#include "sound/dac.h"
#include "machine/6840ptm.h"
#include "machine/z80ctc.h"
+#include "machine/watchdog.h"
#include "includes/cchasm.h"
#define CCHASM_68K_CLOCK (XTAL_8MHz)
@@ -37,7 +38,7 @@ static ADDRESS_MAP_START( memmap, AS_PROGRAM, 16, cchasm_state )
AM_RANGE(0x040000, 0x04000f) AM_DEVREADWRITE8("6840ptm", ptm6840_device, read, write, 0xff)
AM_RANGE(0x050000, 0x050001) AM_WRITE(refresh_control_w)
AM_RANGE(0x060000, 0x060001) AM_READ_PORT("DSW") AM_WRITE(led_w)
- AM_RANGE(0x070000, 0x070001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x070000, 0x070001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xf80000, 0xf800ff) AM_READWRITE(io_r,io_w)
AM_RANGE(0xffb000, 0xffffff) AM_RAM AM_SHARE("ram")
ADDRESS_MAP_END
@@ -157,6 +158,8 @@ static MACHINE_CONFIG_START( cchasm, cchasm_state )
MCFG_Z80CTC_ZC1_CB(WRITELINE(cchasm_state, ctc_timer_1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(cchasm_state, ctc_timer_2_w))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/centiped.cpp b/src/mame/drivers/centiped.cpp
index 9f8b5a21fcc..c77e526945e 100644
--- a/src/mame/drivers/centiped.cpp
+++ b/src/mame/drivers/centiped.cpp
@@ -418,6 +418,7 @@ each direction to assign the boundries.
#include "cpu/m6502/m6502.h"
#include "cpu/s2650/s2650.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "machine/atari_vg.h"
#include "includes/centiped.h"
#include "sound/ay8910.h"
@@ -665,7 +666,7 @@ static ADDRESS_MAP_START( centiped_base_map, AS_PROGRAM, 8, centiped_state )
AM_RANGE(0x1c00, 0x1c02) AM_WRITE(coin_count_w)
AM_RANGE(0x1c03, 0x1c04) AM_WRITE(led_w)
AM_RANGE(0x1c07, 0x1c07) AM_WRITE(centiped_flip_screen_w)
- AM_RANGE(0x2000, 0x2000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2000, 0x3fff) AM_ROM
ADDRESS_MAP_END
@@ -759,7 +760,7 @@ static ADDRESS_MAP_START( milliped_map, AS_PROGRAM, 8, centiped_state )
AM_RANGE(0x2506, 0x2506) AM_WRITE(centiped_flip_screen_w)
AM_RANGE(0x2507, 0x2507) AM_WRITE(control_select_w) /* CNTRLSEL */
AM_RANGE(0x2600, 0x2600) AM_WRITE(irq_ack_w)
- AM_RANGE(0x2680, 0x2680) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2680, 0x2680) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2700, 0x2700) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
AM_RANGE(0x2780, 0x27bf) AM_DEVWRITE("earom", atari_vg_earom_device, write)
AM_RANGE(0x4000, 0x7fff) AM_ROM
@@ -807,7 +808,7 @@ static ADDRESS_MAP_START( multiped_map, AS_PROGRAM, 8, centiped_state )
AM_RANGE(0x2506, 0x2506) AM_WRITE(centiped_flip_screen_w)
AM_RANGE(0x2507, 0x2507) AM_WRITE(control_select_w)
AM_RANGE(0x2600, 0x2600) AM_WRITE(irq_ack_w)
- AM_RANGE(0x2680, 0x2680) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2680, 0x2680) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2700, 0x2700) AM_WRITENOP
AM_RANGE(0x2780, 0x27bf) AM_WRITENOP
AM_RANGE(0x4000, 0x5fff) AM_ROM
@@ -878,7 +879,7 @@ static ADDRESS_MAP_START( warlords_map, AS_PROGRAM, 8, centiped_state )
AM_RANGE(0x1800, 0x1800) AM_WRITE(irq_ack_w)
AM_RANGE(0x1c00, 0x1c02) AM_WRITE(coin_count_w)
AM_RANGE(0x1c03, 0x1c06) AM_WRITE(led_w)
- AM_RANGE(0x4000, 0x4000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -910,7 +911,7 @@ static ADDRESS_MAP_START( mazeinv_map, AS_PROGRAM, 8, centiped_state )
AM_RANGE(0x2506, 0x2506) AM_WRITE(centiped_flip_screen_w)
AM_RANGE(0x2580, 0x2583) AM_WRITE(mazeinv_input_select_w)
AM_RANGE(0x2600, 0x2600) AM_WRITE(irq_ack_w)
- AM_RANGE(0x2680, 0x2680) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2680, 0x2680) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2700, 0x2700) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
AM_RANGE(0x2780, 0x27bf) AM_DEVWRITE("earom", atari_vg_earom_device, write)
AM_RANGE(0x3000, 0x7fff) AM_ROM
@@ -937,7 +938,7 @@ static ADDRESS_MAP_START( bullsdrt_map, AS_PROGRAM, 8, centiped_state )
AM_RANGE(0x1481, 0x1481) AM_MIRROR(0x6000) AM_WRITE(bullsdrt_coin_count_w)
AM_RANGE(0x1483, 0x1484) AM_MIRROR(0x6000) AM_WRITE(led_w)
AM_RANGE(0x1487, 0x1487) AM_MIRROR(0x6000) AM_WRITE(centiped_flip_screen_w)
- AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_NOP
AM_RANGE(0x1800, 0x1bbf) AM_MIRROR(0x6000) AM_WRITE(centiped_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x1bc0, 0x1bff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("spriteram")
@@ -1690,6 +1691,8 @@ static MACHINE_CONFIG_START( centiped_base, centiped_state )
MCFG_ATARIVGEAROM_ADD("earom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* timer */
MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", centiped_state, generate_interrupt, "screen", 0, 16)
@@ -1849,6 +1852,8 @@ static MACHINE_CONFIG_START( bullsdrt, centiped_state )
MCFG_ATARIVGEAROM_ADD("earom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp
index 370f16ac6a4..604562855ad 100644
--- a/src/mame/drivers/champbas.cpp
+++ b/src/mame/drivers/champbas.cpp
@@ -80,6 +80,7 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/champbas.h"
@@ -93,7 +94,7 @@ TODO:
CUSTOM_INPUT_MEMBER(champbas_state::watchdog_bit2)
{
- return (0x10 - machine().get_vblank_watchdog_counter()) >> 2 & 1;
+ return (0x10 - m_watchdog->get_vblank_counter()) >> 2 & 1;
}
WRITE8_MEMBER(champbas_state::irq_enable_w)
@@ -205,7 +206,7 @@ static ADDRESS_MAP_START( champbas_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0xa060, 0xa06f) AM_WRITEONLY AM_SHARE("spriteram")
AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_byte_w)
- AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa0c0, 0xa0c0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
// base map + ALPHA-8x0x protection
@@ -528,7 +529,8 @@ static MACHINE_CONFIG_START( talbot, champbas_state )
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
- MCFG_WATCHDOG_VBLANK_INIT(0x10)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 0x10)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -561,7 +563,8 @@ static MACHINE_CONFIG_START( champbas, champbas_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6)
MCFG_CPU_PROGRAM_MAP(champbas_sound_map)
- MCFG_WATCHDOG_VBLANK_INIT(0x10)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 0x10)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -630,7 +633,8 @@ static MACHINE_CONFIG_START( exctsccr, champbas_state )
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8) // note: 8302 rom, or 8303 on exctscc2 (same device!)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
- MCFG_WATCHDOG_VBLANK_INIT(0x10)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 0x10)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -683,7 +687,8 @@ static MACHINE_CONFIG_START( exctsccrb, champbas_state )
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8) // champbasj 8201 on pcb, though unused
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
- MCFG_WATCHDOG_VBLANK_INIT(0x10)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 0x10)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/changela.cpp b/src/mame/drivers/changela.cpp
index 377c9ff0e10..ed561edf1d4 100644
--- a/src/mame/drivers/changela.cpp
+++ b/src/mame/drivers/changela.cpp
@@ -13,6 +13,7 @@ Tomasz Slanina
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/changela.h"
@@ -236,7 +237,7 @@ static ADDRESS_MAP_START( changela_map, AS_PROGRAM, 8, changela_state )
AM_RANGE(0xd030, 0xd030) AM_READWRITE(changela_30_r, mcu_w)
AM_RANGE(0xd031, 0xd031) AM_READ(changela_31_r)
- AM_RANGE(0xe000, 0xe000) AM_WRITE(watchdog_reset_w) /* Watchdog */
+ AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* Watchdog */
AM_RANGE(0xf000, 0xf7ff) AM_RAM /* RAM2 (Processor RAM) */
ADDRESS_MAP_END
@@ -483,6 +484,7 @@ static MACHINE_CONFIG_START( changela, changela_state )
MCFG_CPU_PROGRAM_MAP(mcu_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", changela_state, chl_mcu_irq)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/chqflag.cpp b/src/mame/drivers/chqflag.cpp
index 052e2916a2a..289df90540e 100644
--- a/src/mame/drivers/chqflag.cpp
+++ b/src/mame/drivers/chqflag.cpp
@@ -17,6 +17,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/chqflag.h"
#include "includes/konamipt.h"
@@ -132,7 +133,7 @@ static ADDRESS_MAP_START( chqflag_map, AS_PROGRAM, 8, chqflag_state )
AM_RANGE(0x3200, 0x3200) AM_READ_PORT("IN1") /* COINSW, STARTSW, test mode */
AM_RANGE(0x3201, 0x3201) AM_READ_PORT("IN0") /* DIPSW #3, SW 4 */
AM_RANGE(0x3203, 0x3203) AM_READ_PORT("DSW2") /* DIPSW #2 */
- AM_RANGE(0x3300, 0x3300) AM_WRITE(watchdog_reset_w) /* watchdog timer */
+ AM_RANGE(0x3300, 0x3300) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog timer */
AM_RANGE(0x3400, 0x341f) AM_DEVREADWRITE("k051733", k051733_device, read, write) /* 051733 (protection) */
AM_RANGE(0x3500, 0x350f) AM_DEVWRITE("k051316_1", k051316_device, ctrl_w) /* 051316 control registers (chip 1) */
AM_RANGE(0x3600, 0x360f) AM_DEVWRITE("k051316_2", k051316_device, ctrl_w) /* 051316 control registers (chip 2) */
@@ -302,6 +303,8 @@ static MACHINE_CONFIG_START( chqflag, chqflag_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 96, 400, 256, 16, 240) // measured Vsync 59.17hz Hsync 15.13 / 15.19khz
diff --git a/src/mame/drivers/circusc.cpp b/src/mame/drivers/circusc.cpp
index f0955c0f396..a63a76c93cd 100644
--- a/src/mame/drivers/circusc.cpp
+++ b/src/mame/drivers/circusc.cpp
@@ -55,6 +55,7 @@ This bug is due to 380_r02.6h, it differs from 380_q02.6h by 2 bytes, at
#include "cpu/z80/z80.h"
#include "machine/konami1.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "sound/discrete.h"
#include "includes/circusc.h"
@@ -144,7 +145,7 @@ static ADDRESS_MAP_START( circusc_map, AS_PROGRAM, 8, circusc_state )
// AM_RANGE(0x0002, 0x0002) AM_MIRROR(0x03f8) AM_WRITENOP /* MUT - not used /*
AM_RANGE(0x0003, 0x0004) AM_MIRROR(0x03f8) AM_WRITE(circusc_coin_counter_w) /* COIN1, COIN2 */
AM_RANGE(0x0005, 0x0005) AM_MIRROR(0x03f8) AM_WRITEONLY AM_SHARE("spritebank") /* OBJ CHENG */
- AM_RANGE(0x0400, 0x0400) AM_MIRROR(0x03ff) AM_WRITE(watchdog_reset_w) /* WDOG */
+ AM_RANGE(0x0400, 0x0400) AM_MIRROR(0x03ff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* WDOG */
AM_RANGE(0x0800, 0x0800) AM_MIRROR(0x03ff) AM_WRITE(soundlatch_byte_w) /* SOUND DATA */
AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x03ff) AM_WRITE(circusc_sh_irqtrigger_w) /* SOUND-ON causes interrupt on audio CPU */
AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x03fc) AM_READ_PORT("SYSTEM")
@@ -337,7 +338,9 @@ static MACHINE_CONFIG_START( circusc, circusc_state )
MCFG_CPU_ADD("maincpu", KONAMI1, 2048000) /* 2 MHz? */
MCFG_CPU_PROGRAM_MAP(circusc_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", circusc_state, vblank_irq)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz/4)
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp
index 6c8426c16ba..e0489d75491 100644
--- a/src/mame/drivers/cischeat.cpp
+++ b/src/mame/drivers/cischeat.cpp
@@ -1881,6 +1881,8 @@ static MACHINE_CONFIG_START( scudhamm, cischeat_state )
MCFG_CPU_PROGRAM_MAP(scudhamm_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cischeat_state, scudhamm_scanline, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -1967,6 +1969,8 @@ static MACHINE_CONFIG_START( captflag, cischeat_state )
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH )
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
// MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
diff --git a/src/mame/drivers/clayshoo.cpp b/src/mame/drivers/clayshoo.cpp
index 1db6d72efe3..230506cd161 100644
--- a/src/mame/drivers/clayshoo.cpp
+++ b/src/mame/drivers/clayshoo.cpp
@@ -19,6 +19,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
+#include "machine/watchdog.h"
class clayshoo_state : public driver_device
@@ -221,7 +222,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( main_io_map, AS_IO, 8, clayshoo_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
// AM_RANGE(0x40, 0x43) AM_NOP // 8253 for sound?
@@ -316,6 +317,7 @@ static MACHINE_CONFIG_START( clayshoo, clayshoo_state )
MCFG_CPU_IO_MAP(main_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", clayshoo_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/cloak.cpp b/src/mame/drivers/cloak.cpp
index ff2c8aab3c3..137fed27c22 100644
--- a/src/mame/drivers/cloak.cpp
+++ b/src/mame/drivers/cloak.cpp
@@ -120,6 +120,7 @@
#include "cpu/m6502/m6502.h"
#include "sound/pokey.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/cloak.h"
/*************************************
@@ -183,7 +184,7 @@ static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, cloak_state )
AM_RANGE(0x3803, 0x3803) AM_WRITE(cloak_flipscreen_w)
AM_RANGE(0x3805, 0x3805) AM_WRITENOP // ???
AM_RANGE(0x3806, 0x3807) AM_WRITE(cloak_led_w)
- AM_RANGE(0x3a00, 0x3a00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3a00, 0x3a00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3c00, 0x3c00) AM_WRITE(cloak_irq_reset_0_w)
AM_RANGE(0x3e00, 0x3e00) AM_WRITE(cloak_nvram_enable_w)
AM_RANGE(0x4000, 0xffff) AM_ROM
@@ -324,6 +325,8 @@ static MACHINE_CONFIG_START( cloak, cloak_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/cloud9.cpp b/src/mame/drivers/cloud9.cpp
index b0e0a21f0cc..f080e13730a 100644
--- a/src/mame/drivers/cloud9.cpp
+++ b/src/mame/drivers/cloud9.cpp
@@ -94,6 +94,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/pokey.h"
#include "includes/cloud9.h"
@@ -266,7 +267,7 @@ static ADDRESS_MAP_START( cloud9_map, AS_PROGRAM, 8, cloud9_state )
AM_RANGE(0x0002, 0x0002) AM_READWRITE(cloud9_bitmode_r, cloud9_bitmode_w)
AM_RANGE(0x0000, 0x4fff) AM_ROMBANK("bank1") AM_WRITE(cloud9_videoram_w)
AM_RANGE(0x5000, 0x53ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x5400, 0x547f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5400, 0x547f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5480, 0x54ff) AM_WRITE(irq_ack_w)
AM_RANGE(0x5500, 0x557f) AM_RAM_WRITE(cloud9_paletteram_w) AM_SHARE("paletteram")
AM_RANGE(0x5580, 0x5587) AM_MIRROR(0x0078) AM_WRITE(cloud9_video_control_w)
@@ -407,7 +408,8 @@ static MACHINE_CONFIG_START( cloud9, cloud9_state )
MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8)
MCFG_CPU_PROGRAM_MAP(cloud9_map)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_X2212_ADD_AUTOSAVE("nvram")
diff --git a/src/mame/drivers/combatsc.cpp b/src/mame/drivers/combatsc.cpp
index a0ca9509c9d..b7ae2deb8e0 100644
--- a/src/mame/drivers/combatsc.cpp
+++ b/src/mame/drivers/combatsc.cpp
@@ -124,6 +124,7 @@ Dip location and recommended settings verified with the US manual
#include "emu.h"
#include "cpu/m6809/hd6309.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/combatsc.h"
@@ -364,7 +365,7 @@ static ADDRESS_MAP_START( combatsc_map, AS_PROGRAM, 8, combatsc_state )
AM_RANGE(0x0410, 0x0410) AM_WRITE(combatsc_bankselect_w)
AM_RANGE(0x0414, 0x0414) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x0418, 0x0418) AM_WRITE(combatsc_sh_irqtrigger_w)
- AM_RANGE(0x041c, 0x041c) AM_WRITE(watchdog_reset_w) /* watchdog reset? */
+ AM_RANGE(0x041c, 0x041c) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog reset? */
AM_RANGE(0x0600, 0x06ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
AM_RANGE(0x0800, 0x1fff) AM_RAM /* RAM */
@@ -704,6 +705,8 @@ static MACHINE_CONFIG_START( combatsc, combatsc_state )
MCFG_MACHINE_START_OVERRIDE(combatsc_state,combatsc)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/crimfght.cpp b/src/mame/drivers/crimfght.cpp
index 547b8b0d486..1d77ed5b684 100644
--- a/src/mame/drivers/crimfght.cpp
+++ b/src/mame/drivers/crimfght.cpp
@@ -16,6 +16,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/konamipt.h"
#include "includes/crimfght.h"
@@ -89,7 +90,7 @@ static ADDRESS_MAP_START( crimfght_map, AS_PROGRAM, 8, crimfght_state )
AM_RANGE(0x3f85, 0x3f85) AM_READ_PORT("P3")
AM_RANGE(0x3f86, 0x3f86) AM_READ_PORT("P4")
AM_RANGE(0x3f87, 0x3f87) AM_READ_PORT("DSW1")
- AM_RANGE(0x3f88, 0x3f88) AM_MIRROR(0x03) AM_READ(watchdog_reset_r) AM_WRITE(crimfght_coin_w) // 051550
+ AM_RANGE(0x3f88, 0x3f88) AM_MIRROR(0x03) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(crimfght_coin_w) // 051550
AM_RANGE(0x3f8c, 0x3f8c) AM_MIRROR(0x03) AM_WRITE(sound_w)
AM_RANGE(0x2000, 0x5fff) AM_READWRITE(k052109_051960_r, k052109_051960_w) /* video RAM + sprite RAM */
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("rombank") /* banked ROM */
@@ -312,6 +313,8 @@ static MACHINE_CONFIG_START( crimfght, crimfght_state )
MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(11)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x400)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 96, 416, 256, 16, 240) // measured 59.17
diff --git a/src/mame/drivers/cyberbal.cpp b/src/mame/drivers/cyberbal.cpp
index 3e4c6036038..9b263dace2b 100644
--- a/src/mame/drivers/cyberbal.cpp
+++ b/src/mame/drivers/cyberbal.cpp
@@ -22,6 +22,7 @@
#include "emu.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "rendlay.h"
#include "includes/cyberbal.h"
@@ -128,7 +129,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0xfc8000, 0xfcffff) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff00)
AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
AM_RANGE(0xfd2000, 0xfd3fff) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
- AM_RANGE(0xfd4000, 0xfd5fff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xfd4000, 0xfd5fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE(p2_reset_w)
AM_RANGE(0xfd8000, 0xfd9fff) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff00)
AM_RANGE(0xfe0000, 0xfe0fff) AM_READ_PORT("IN0")
@@ -232,7 +233,7 @@ static ADDRESS_MAP_START( cyberbal2p_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0xfca000, 0xfcafff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xfd0000, 0xfd0003) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
AM_RANGE(0xfd2000, 0xfd2003) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
- AM_RANGE(0xfd4000, 0xfd4003) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xfd4000, 0xfd4003) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xfd6000, 0xfd6003) AM_WRITE(video_int_ack_w)
AM_RANGE(0xfd8000, 0xfd8003) AM_DEVWRITE8("jsa", atari_jsa_ii_device, main_command_w, 0xff00)
AM_RANGE(0xfe0000, 0xfe0003) AM_READ(sound_state_r)
@@ -415,6 +416,8 @@ static MACHINE_CONFIG_START( cyberbal, cyberbal_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "lpalette", interleaved)
@@ -488,6 +491,8 @@ static MACHINE_CONFIG_START( cyberbal2p, cyberbal_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", cyberbal)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/dambustr.cpp b/src/mame/drivers/dambustr.cpp
index 13626af687b..d6b2032b695 100644
--- a/src/mame/drivers/dambustr.cpp
+++ b/src/mame/drivers/dambustr.cpp
@@ -53,6 +53,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "audio/galaxian.h"
#include "includes/galaxold.h"
@@ -117,7 +118,7 @@ static ADDRESS_MAP_START( dambustr_map, AS_PROGRAM, 8, dambustr_state )
AM_RANGE(0xf007, 0xf007) AM_WRITE(galaxold_flip_screen_y_w)
AM_RANGE(0xf800, 0xf800) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
- AM_RANGE(0xf800, 0xffff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf800, 0xffff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
@@ -264,6 +265,8 @@ static MACHINE_CONFIG_START( dambustr, dambustr_state )
MCFG_TIMER_DRIVER_ADD("int_timer", dambustr_state, galaxold_interrupt_timer)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(16000.0/132/2)
diff --git a/src/mame/drivers/darius.cpp b/src/mame/drivers/darius.cpp
index 4026a85fde3..ab67d05498a 100644
--- a/src/mame/drivers/darius.cpp
+++ b/src/mame/drivers/darius.cpp
@@ -132,6 +132,7 @@ sounds.
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "audio/taitosnd.h"
#include "sound/2203intf.h"
#include "sound/msm5205.h"
@@ -160,11 +161,6 @@ WRITE16_MEMBER(darius_state::cpua_ctrl_w)
logerror("CPU #0 PC %06x: write %04x to cpu control\n", space.device().safe_pc(), data);
}
-WRITE16_MEMBER(darius_state::darius_watchdog_w)
-{
- watchdog_reset_w(space, 0, data);
-}
-
/**********************************************************
GAME INPUTS
@@ -240,7 +236,7 @@ static ADDRESS_MAP_START( darius_map, AS_PROGRAM, 16, darius_state )
AM_RANGE(0x000000, 0x05ffff) AM_ROM
AM_RANGE(0x080000, 0x08ffff) AM_RAM /* main RAM */
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(cpua_ctrl_w)
- AM_RANGE(0x0b0000, 0x0b0001) AM_WRITE(darius_watchdog_w)
+ AM_RANGE(0x0b0000, 0x0b0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xc00000, 0xc0007f) AM_READWRITE(darius_ioc_r, darius_ioc_w) /* inputs, sound */
AM_RANGE(0xd00000, 0xd0ffff) AM_DEVREADWRITE("pc080sn", pc080sn_device, word_r, word_w) /* tilemaps */
AM_RANGE(0xd20000, 0xd20003) AM_DEVWRITE("pc080sn", pc080sn_device, yscroll_word_w)
@@ -764,6 +760,7 @@ static MACHINE_CONFIG_START( darius, darius_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame ? */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", darius)
diff --git a/src/mame/drivers/dblcrown.cpp b/src/mame/drivers/dblcrown.cpp
index ed23cd2b96b..d766e0c425d 100644
--- a/src/mame/drivers/dblcrown.cpp
+++ b/src/mame/drivers/dblcrown.cpp
@@ -48,6 +48,7 @@
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "dblcrown.lh"
#define DEBUG_VRAM
@@ -58,12 +59,14 @@ public:
dblcrown_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_watchdog(*this, "watchdog"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette")
{ }
// devices
required_device<cpu_device> m_maincpu;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -341,7 +344,7 @@ WRITE8_MEMBER(dblcrown_state::watchdog_w)
{
if (data & 0x01) /* check for refresh value (0x01) */
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
else
{
@@ -615,6 +618,8 @@ static MACHINE_CONFIG_START( dblcrown, dblcrown_state )
MCFG_CPU_PROGRAM_MAP(dblcrown_map)
MCFG_CPU_IO_MAP(dblcrown_io)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dblcrown_state, dblcrown_irq_scanline, "screen", 0, 1)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1000)) /* 1000 ms. (minimal of MAX693A watchdog long timeout period with internal oscillator) */
/* video hardware */
diff --git a/src/mame/drivers/dcheese.cpp b/src/mame/drivers/dcheese.cpp
index 4369520d168..3ef3b044404 100644
--- a/src/mame/drivers/dcheese.cpp
+++ b/src/mame/drivers/dcheese.cpp
@@ -35,6 +35,7 @@
#include "cpu/m68000/m68000.h"
#include "machine/eepromser.h"
#include "machine/ticket.h"
+#include "machine/watchdog.h"
#include "sound/bsmt2000.h"
#include "includes/dcheese.h"
@@ -201,7 +202,7 @@ static ADDRESS_MAP_START( main_cpu_map, AS_PROGRAM, 16, dcheese_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_RAM
- AM_RANGE(0x200000, 0x200001) AM_READ_PORT("200000") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x200000, 0x200001) AM_READ_PORT("200000") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x220000, 0x220001) AM_READ_PORT("220000") AM_WRITE(madmax_blitter_color_w)
AM_RANGE(0x240000, 0x240001) AM_READ_PORT("240000") AM_WRITE(eeprom_control_w)
AM_RANGE(0x260000, 0x26001f) AM_WRITE(madmax_blitter_xparam_w)
@@ -405,10 +406,12 @@ static MACHINE_CONFIG_START( dcheese, dcheese_state )
MCFG_CPU_PROGRAM_MAP(sound_cpu_map)
MCFG_CPU_PERIODIC_INT_DRIVER(dcheese_state, irq1_line_hold, 480) /* accurate for fredmem */
-
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/ddribble.cpp b/src/mame/drivers/ddribble.cpp
index 4000dd166af..68e9cf8af0c 100644
--- a/src/mame/drivers/ddribble.cpp
+++ b/src/mame/drivers/ddribble.cpp
@@ -13,6 +13,7 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/konamipt.h"
#include "includes/ddribble.h"
@@ -130,7 +131,7 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, ddribble_state )
AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("DSW2")
AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW3")
AM_RANGE(0x3400, 0x3400) AM_WRITE(ddribble_coin_counter_w) /* coin counters */
- AM_RANGE(0x3c00, 0x3c00) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x3c00, 0x3c00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog reset */
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
@@ -265,6 +266,7 @@ static MACHINE_CONFIG_START( ddribble, ddribble_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* we need heavy synch */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/deadang.cpp b/src/mame/drivers/deadang.cpp
index 62f785fdf2d..0f996db2c44 100644
--- a/src/mame/drivers/deadang.cpp
+++ b/src/mame/drivers/deadang.cpp
@@ -42,6 +42,7 @@ Dip locations and factory settings verified with US manual
#include "emu.h"
#include "cpu/nec/nec.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "sound/msm5205.h"
#include "includes/deadang.h"
@@ -83,7 +84,7 @@ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, deadang_state )
AM_RANGE(0x03800, 0x03fff) AM_RAM_WRITE(foreground_w) AM_SHARE("video_data")
AM_RANGE(0x04000, 0x04fff) AM_RAM AM_SHARE("share1")
AM_RANGE(0x08000, 0x08001) AM_WRITE(bank_w)
- AM_RANGE(0x0c000, 0x0c001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0c000, 0x0c001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xe0000, 0xfffff) AM_ROM
ADDRESS_MAP_END
@@ -250,6 +251,8 @@ static MACHINE_CONFIG_START( deadang, deadang_state )
MCFG_QUANTUM_TIME(attotime::from_hz(60)) // the game stops working with higher interleave rates..
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/decocass.cpp b/src/mame/drivers/decocass.cpp
index 31f18fc6083..ca3eac4f74b 100644
--- a/src/mame/drivers/decocass.cpp
+++ b/src/mame/drivers/decocass.cpp
@@ -728,6 +728,7 @@ static MACHINE_CONFIG_START( decocass, decocass_state )
MCFG_QUANTUM_TIME(attotime::from_hz(4200)) /* interleave CPUs */
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_DECOCASS_TAPE_ADD("cassette")
diff --git a/src/mame/drivers/destroyr.cpp b/src/mame/drivers/destroyr.cpp
index 026e057f14b..5ddbff17f68 100644
--- a/src/mame/drivers/destroyr.cpp
+++ b/src/mame/drivers/destroyr.cpp
@@ -14,6 +14,7 @@ TODO:
#include "emu.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "destroyr.lh"
@@ -30,6 +31,7 @@ public:
destroyr_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_watchdog(*this, "watchdog"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
@@ -39,6 +41,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -230,7 +233,7 @@ WRITE8_MEMBER(destroyr_state::misc_w)
WRITE8_MEMBER(destroyr_state::cursor_load_w)
{
m_cursor = data;
- watchdog_reset_w(space, offset, data);
+ m_watchdog->reset_w(space, offset, data);
}
@@ -493,6 +496,7 @@ static MACHINE_CONFIG_START( destroyr, destroyr_state )
MCFG_CPU_PROGRAM_MAP(destroyr_map)
MCFG_CPU_PERIODIC_INT_DRIVER(destroyr_state, irq0_line_assert, 4*60)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/dlair.cpp b/src/mame/drivers/dlair.cpp
index f533bec8e32..2969e3f15f4 100644
--- a/src/mame/drivers/dlair.cpp
+++ b/src/mame/drivers/dlair.cpp
@@ -40,6 +40,7 @@
#include "cpu/z80/z80daisy.h"
#include "machine/ldv1000.h"
#include "machine/ldstub.h"
+#include "machine/watchdog.h"
#include "machine/z80ctc.h"
#include "machine/z80dart.h"
#include "sound/ay8910.h"
@@ -390,7 +391,7 @@ static ADDRESS_MAP_START( dleuro_map, AS_PROGRAM, 8, dlair_state )
AM_RANGE(0xe018, 0xe018) AM_MIRROR(0x1f47) AM_WRITE(led_den2_w) // WT EXT LED 2
AM_RANGE(0xe020, 0xe020) AM_MIRROR(0x1f47) AM_WRITE(laserdisc_w) // DISC WT
AM_RANGE(0xe028, 0xe028) AM_MIRROR(0x1f47) AM_WRITE(dleuro_misc_w) // WT MISC
- AM_RANGE(0xe030, 0xe030) AM_MIRROR(0x1f47) AM_WRITE(watchdog_reset_w) // CLR WDOG
+ AM_RANGE(0xe030, 0xe030) AM_MIRROR(0x1f47) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) // CLR WDOG
AM_RANGE(0xe080, 0xe080) AM_MIRROR(0x1f47) AM_READ_PORT("P1") // CP A
AM_RANGE(0xe088, 0xe088) AM_MIRROR(0x1f47) AM_READ_PORT("SYSTEM") // CP B
AM_RANGE(0xe090, 0xe090) AM_MIRROR(0x1f47) AM_READ_PORT("DSW1") // OPT SW A
@@ -709,6 +710,7 @@ static MACHINE_CONFIG_START( dleuro, dlair_state )
MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
// TODO: hook up tx and rx callbacks
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_hz(MASTER_CLOCK_EURO/(16*16*16*16*16*8)))
MCFG_MACHINE_START_OVERRIDE(dlair_state,dlair)
diff --git a/src/mame/drivers/docastle.cpp b/src/mame/drivers/docastle.cpp
index 71ac8c5bf45..e5e18c8a1bb 100644
--- a/src/mame/drivers/docastle.cpp
+++ b/src/mame/drivers/docastle.cpp
@@ -154,6 +154,7 @@ Dip locations verified with manual for docastle, dorunrun and dowild.
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "includes/docastle.h"
@@ -218,7 +219,7 @@ static ADDRESS_MAP_START( docastle_map, AS_PROGRAM, 8, docastle_state )
AM_RANGE(0x8000, 0x97ff) AM_RAM
AM_RANGE(0x9800, 0x99ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w)
- AM_RANGE(0xa800, 0xa800) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xe000, 0xe000) AM_WRITE(docastle_nmitrigger_w)
@@ -261,7 +262,7 @@ static ADDRESS_MAP_START( dorunrun_map, AS_PROGRAM, 8, docastle_state )
AM_RANGE(0x3800, 0x39ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x4000, 0x9fff) AM_ROM
AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w)
- AM_RANGE(0xa800, 0xa800) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xb000, 0xb3ff) AM_RAM_WRITE(docastle_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xb400, 0xb7ff) AM_RAM_WRITE(docastle_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xb800, 0xb800) AM_WRITE(docastle_nmitrigger_w)
@@ -290,7 +291,7 @@ static ADDRESS_MAP_START( idsoccer_map, AS_PROGRAM, 8, docastle_state )
AM_RANGE(0x5800, 0x59ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x6000, 0x9fff) AM_ROM
AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w)
- AM_RANGE(0xa800, 0xa800) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xc000, 0xc000) AM_READWRITE(idsoccer_adpcm_status_r, idsoccer_adpcm_w)
@@ -597,6 +598,8 @@ static MACHINE_CONFIG_START( docastle, docastle_state )
MCFG_CPU_PROGRAM_MAP(docastle_map3)
MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, nmi_line_pulse)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_9_828MHz / 16)
/*
diff --git a/src/mame/drivers/dragrace.cpp b/src/mame/drivers/dragrace.cpp
index 5e53f685474..5a8a1ecb968 100644
--- a/src/mame/drivers/dragrace.cpp
+++ b/src/mame/drivers/dragrace.cpp
@@ -33,7 +33,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(dragrace_state::dragrace_frame_callback)
output().set_value("P2gear", m_gear[1]);
/* watchdog is disabled during service mode */
- machine().watchdog_enable(ioport("IN0")->read() & 0x20);
+ m_watchdog->watchdog_enable(ioport("IN0")->read() & 0x20);
}
@@ -173,7 +173,7 @@ static ADDRESS_MAP_START( dragrace_map, AS_PROGRAM, 8, dragrace_state )
AM_RANGE(0x0b00, 0x0bff) AM_WRITEONLY AM_SHARE("position_ram")
AM_RANGE(0x0c00, 0x0c00) AM_READ(dragrace_steering_r)
AM_RANGE(0x0d00, 0x0d00) AM_READ(dragrace_scanline_r)
- AM_RANGE(0x0e00, 0x0eff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0e00, 0x0eff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1000, 0x1fff) AM_ROM /* program */
AM_RANGE(0xf800, 0xffff) AM_ROM /* program mirror */
ADDRESS_MAP_END
@@ -330,7 +330,9 @@ static MACHINE_CONFIG_START( dragrace, dragrace_state )
MCFG_CPU_ADD("maincpu", M6800, XTAL_12_096MHz / 12)
MCFG_CPU_PROGRAM_MAP(dragrace_map)
MCFG_CPU_PERIODIC_INT_DRIVER(dragrace_state, irq0_line_hold, 4*60)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_TIMER_DRIVER_ADD_PERIODIC("frame_timer", dragrace_state, dragrace_frame_callback, attotime::from_hz(60))
diff --git a/src/mame/drivers/dribling.cpp b/src/mame/drivers/dribling.cpp
index 9b900666ad3..f59060e0b51 100644
--- a/src/mame/drivers/dribling.cpp
+++ b/src/mame/drivers/dribling.cpp
@@ -129,7 +129,7 @@ WRITE8_MEMBER(dribling_state::shr_w)
{
/* bit 3 = watchdog */
if (data & 0x08)
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
/* bit 2-0 = SH0-2 */
m_sh = data & 0x07;
@@ -283,6 +283,8 @@ static MACHINE_CONFIG_START( dribling, dribling_state )
MCFG_I8255_IN_PORTC_CB(IOPORT("IN0"))
MCFG_I8255_OUT_PORTC_CB(WRITE8(dribling_state, shr_w))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/dunhuang.cpp b/src/mame/drivers/dunhuang.cpp
index 44c44c38510..9c3c9d7a695 100644
--- a/src/mame/drivers/dunhuang.cpp
+++ b/src/mame/drivers/dunhuang.cpp
@@ -53,6 +53,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/okim6295.h"
#include "sound/2413intf.h"
@@ -499,7 +500,7 @@ static ADDRESS_MAP_START( dunhuang_io_map, AS_IO, 8, dunhuang_state )
AM_RANGE( 0x0008, 0x0008 ) AM_WRITE(dunhuang_vert_clear_w )
- AM_RANGE( 0x000c, 0x000c ) AM_READ(watchdog_reset_r )
+ AM_RANGE( 0x000c, 0x000c ) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE( 0x000f, 0x000f ) AM_WRITE(dunhuang_block_addr_lo_w )
AM_RANGE( 0x0010, 0x0010 ) AM_WRITE(dunhuang_block_addr_hi_w )
@@ -817,7 +818,7 @@ static MACHINE_CONFIG_START( dunhuang, dunhuang_state )
MCFG_CPU_IO_MAP(dunhuang_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", dunhuang_state, irq0_line_hold)
-
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(5))
/* video hardware */
diff --git a/src/mame/drivers/epos.cpp b/src/mame/drivers/epos.cpp
index 65038cf3d72..8d292830ca1 100644
--- a/src/mame/drivers/epos.cpp
+++ b/src/mame/drivers/epos.cpp
@@ -33,6 +33,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/epos.h"
@@ -79,7 +80,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( io_map, AS_IO, 8, epos_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x01, 0x01) AM_READ_PORT("SYSTEM") AM_WRITE(epos_port_1_w)
AM_RANGE(0x02, 0x02) AM_READ_PORT("INPUTS") AM_DEVWRITE("aysnd", ay8910_device, data_w)
AM_RANGE(0x03, 0x03) AM_READ_PORT("UNK")
@@ -93,7 +94,7 @@ static ADDRESS_MAP_START( dealer_io_map, AS_IO, 8, epos_state )
AM_RANGE(0x34, 0x34) AM_DEVWRITE("aysnd", ay8910_device, data_w)
AM_RANGE(0x38, 0x38) AM_READ_PORT("DSW")
AM_RANGE(0x3C, 0x3C) AM_DEVWRITE("aysnd", ay8910_device, address_w)
- AM_RANGE(0x40, 0x40) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x40, 0x40) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -388,6 +389,7 @@ static MACHINE_CONFIG_START( epos, epos_state )
MCFG_CPU_IO_MAP(io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", epos_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -418,6 +420,8 @@ static MACHINE_CONFIG_START( dealer, epos_state )
MCFG_MACHINE_START_OVERRIDE(epos_state,dealer)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/eprom.cpp b/src/mame/drivers/eprom.cpp
index 575689aca8a..b6bad2adaf2 100644
--- a/src/mame/drivers/eprom.cpp
+++ b/src/mame/drivers/eprom.cpp
@@ -27,6 +27,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "includes/eprom.h"
@@ -148,7 +149,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, eprom_state )
AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("jsa", atari_jsa_base_device, main_response_r, 0x00ff)
- AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2e0000, 0x2e0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(video_int_ack_w)
AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("jsa", atari_jsa_base_device, sound_reset_w)
@@ -173,7 +174,7 @@ static ADDRESS_MAP_START( guts_map, AS_PROGRAM, 16, eprom_state )
AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("jsa", atari_jsa_ii_device, main_response_r, 0x00ff)
- AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2e0000, 0x2e0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(video_int_ack_w)
// AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
@@ -395,6 +396,8 @@ static MACHINE_CONFIG_START( eprom, eprom_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", eprom)
MCFG_PALETTE_ADD("palette", 2048)
@@ -437,6 +440,8 @@ static MACHINE_CONFIG_START( klaxp, eprom_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", eprom)
MCFG_PALETTE_ADD("palette", 2048)
@@ -478,6 +483,8 @@ static MACHINE_CONFIG_START( guts, eprom_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", guts)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp
index c46f7a6285b..071c92b9cdd 100644
--- a/src/mame/drivers/equites.cpp
+++ b/src/mame/drivers/equites.cpp
@@ -361,6 +361,7 @@ D
#include "cpu/i8085/i8085.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/equites.h"
#define FRQ_ADJUSTER_TAG "FRQ"
@@ -667,7 +668,7 @@ static ADDRESS_MAP_START( equites_map, AS_PROGRAM, 16, equites_state )
AM_RANGE(0x18c000, 0x18c001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE(mcu_switch_w)
AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("IN0") AM_WRITE(equites_scrollreg_w)
AM_RANGE(0x380000, 0x380001) AM_WRITE8(equites_bgcolor_w, 0xff00)
- AM_RANGE(0x780000, 0x780001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x780000, 0x780001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( gekisou_map, AS_PROGRAM, 16, equites_state )
@@ -1148,6 +1149,8 @@ static MACHINE_CONFIG_START( equites, equites_state )
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, 4000000/8) // 8303 or 8304 (same device!)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/espial.cpp b/src/mame/drivers/espial.cpp
index f563add57a0..ff6fc3d5c85 100644
--- a/src/mame/drivers/espial.cpp
+++ b/src/mame/drivers/espial.cpp
@@ -41,6 +41,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "includes/espial.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
@@ -106,7 +107,7 @@ static ADDRESS_MAP_START( espial_map, AS_PROGRAM, 8, espial_state )
AM_RANGE(0x6083, 0x6083) AM_READ_PORT("IN1")
AM_RANGE(0x6084, 0x6084) AM_READ_PORT("IN2")
AM_RANGE(0x6090, 0x6090) AM_READ(soundlatch2_byte_r) AM_WRITE(espial_master_soundlatch_w)
- AM_RANGE(0x7000, 0x7000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset_r, reset_w)
AM_RANGE(0x7100, 0x7100) AM_WRITE(espial_master_interrupt_mask_w)
AM_RANGE(0x7200, 0x7200) AM_WRITE(espial_flipscreen_w)
AM_RANGE(0x8000, 0x801f) AM_RAM AM_SHARE("spriteram_1")
@@ -131,7 +132,7 @@ static ADDRESS_MAP_START( netwars_map, AS_PROGRAM, 8, espial_state )
AM_RANGE(0x6083, 0x6083) AM_READ_PORT("IN1")
AM_RANGE(0x6084, 0x6084) AM_READ_PORT("IN2")
AM_RANGE(0x6090, 0x6090) AM_READ(soundlatch2_byte_r) AM_WRITE(espial_master_soundlatch_w)
- AM_RANGE(0x7000, 0x7000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset_r, reset_w)
AM_RANGE(0x7100, 0x7100) AM_WRITE(espial_master_interrupt_mask_w)
AM_RANGE(0x7200, 0x7200) AM_WRITE(espial_flipscreen_w)
AM_RANGE(0x8000, 0x801f) AM_RAM AM_SHARE("spriteram_1")
@@ -324,6 +325,7 @@ static MACHINE_CONFIG_START( espial, espial_state )
MCFG_CPU_IO_MAP(espial_sound_io_map)
MCFG_CPU_PERIODIC_INT_DRIVER(espial_state, espial_sound_nmi_gen, 4*60)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp
index 79549bfa123..362dccd324d 100644
--- a/src/mame/drivers/expro02.cpp
+++ b/src/mame/drivers/expro02.cpp
@@ -208,6 +208,7 @@ TODO:
#include "cpu/m68000/m68000.h"
#include "sound/okim6295.h"
#include "machine/kaneko_hit.h"
+#include "machine/watchdog.h"
#include "video/kaneko_tmap.h"
#include "video/kaneko_spr.h"
#include "includes/galpnipt.h"
@@ -940,6 +941,7 @@ static MACHINE_CONFIG_START( expro02, expro02_state )
/* arm watchdog */
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
/* sound hardware */
@@ -963,6 +965,7 @@ static MACHINE_CONFIG_DERIVED( comad, expro02 )
kaneko_view2_tilemap_device::set_invert_flip(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, -256, -216, 256, 224);
+ MCFG_WATCHDOG_MODIFY("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(0)) /* a guess, and certainly wrong */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/exterm.cpp b/src/mame/drivers/exterm.cpp
index 1b3d1f4c7e8..d0432f005f6 100644
--- a/src/mame/drivers/exterm.cpp
+++ b/src/mame/drivers/exterm.cpp
@@ -68,6 +68,7 @@
#include "sound/dac.h"
#include "sound/2151intf.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/exterm.h"
@@ -283,7 +284,7 @@ static ADDRESS_MAP_START( master_map, AS_PROGRAM, 16, exterm_state )
AM_RANGE(0x01480000, 0x014bffff) AM_MIRROR(0xfc000000) AM_READ_PORT("DSW")
AM_RANGE(0x01500000, 0x0153ffff) AM_MIRROR(0xfc000000) AM_WRITE(exterm_output_port_0_w)
AM_RANGE(0x01580000, 0x015bffff) AM_MIRROR(0xfc000000) AM_WRITE(sound_latch_w)
- AM_RANGE(0x015c0000, 0x015fffff) AM_MIRROR(0xfc000000) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x015c0000, 0x015fffff) AM_MIRROR(0xfc000000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x01800000, 0x01807fff) AM_MIRROR(0xfc7f8000) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x02800000, 0x02807fff) AM_MIRROR(0xfc7f8000) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x03000000, 0x03ffffff) AM_MIRROR(0xfc000000) AM_ROM AM_REGION("user1", 0)
@@ -432,6 +433,8 @@ static MACHINE_CONFIG_START( exterm, exterm_state )
MCFG_TIMER_DRIVER_ADD("snd_nmi_timer", exterm_state, master_sound_nmi_callback)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_PALETTE_ADD("palette", 2048+32768)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
diff --git a/src/mame/drivers/fastfred.cpp b/src/mame/drivers/fastfred.cpp
index 21e01328518..99f4f8ce5c7 100644
--- a/src/mame/drivers/fastfred.cpp
+++ b/src/mame/drivers/fastfred.cpp
@@ -13,6 +13,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "includes/fastfred.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
@@ -200,7 +201,7 @@ static ADDRESS_MAP_START( fastfred_map, AS_PROGRAM, 8, fastfred_state )
AM_RANGE(0xf007, 0xf007) AM_WRITE(fastfred_flip_screen_y_w)
AM_RANGE(0xf116, 0xf116) AM_WRITE(fastfred_flip_screen_x_w)
AM_RANGE(0xf117, 0xf117) AM_WRITE(fastfred_flip_screen_y_w)
- AM_RANGE(0xf800, 0xf800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w)
+ AM_RANGE(0xf800, 0xf800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(soundlatch_byte_w)
ADDRESS_MAP_END
@@ -226,7 +227,7 @@ static ADDRESS_MAP_START( jumpcoas_map, AS_PROGRAM, 8, fastfred_state )
AM_RANGE(0xf007, 0xf007) AM_WRITE(fastfred_flip_screen_y_w)
AM_RANGE(0xf116, 0xf116) AM_WRITE(fastfred_flip_screen_x_w)
AM_RANGE(0xf117, 0xf117) AM_WRITE(fastfred_flip_screen_y_w)
- //AM_RANGE(0xf800, 0xf800) AM_READ(watchdog_reset_r) // Why doesn't this work???
+ //AM_RANGE(0xf800, 0xf800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) // Why doesn't this work???
AM_RANGE(0xf800, 0xf801) AM_READNOP AM_DEVWRITE("ay8910.1", ay8910_device, address_data_w)
ADDRESS_MAP_END
@@ -654,6 +655,8 @@ static MACHINE_CONFIG_START( fastfred, fastfred_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(fastfred_state, sound_timer_irq, 4*60)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/fastlane.cpp b/src/mame/drivers/fastlane.cpp
index 6dea035e86c..a8358444eb3 100644
--- a/src/mame/drivers/fastlane.cpp
+++ b/src/mame/drivers/fastlane.cpp
@@ -13,6 +13,7 @@
#include "emu.h"
#include "cpu/m6809/hd6309.h"
+#include "machine/watchdog.h"
#include "includes/konamipt.h"
#include "includes/fastlane.h"
@@ -81,7 +82,7 @@ static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8, fastlane_state )
AM_RANGE(0x0803, 0x0803) AM_READ_PORT("SYSTEM")
AM_RANGE(0x0900, 0x0900) AM_READ_PORT("DSW1")
AM_RANGE(0x0901, 0x0901) AM_READ_PORT("DSW2")
- AM_RANGE(0x0b00, 0x0b00) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x0b00, 0x0b00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0c00, 0x0c00) AM_WRITE(fastlane_bankswitch_w) /* bankswitch control */
AM_RANGE(0x0d00, 0x0d0d) AM_READWRITE(fastlane_k1_k007232_r, fastlane_k1_k007232_w) /* 007232 registers (chip 1) */
AM_RANGE(0x0e00, 0x0e0d) AM_READWRITE(fastlane_k2_k007232_r, fastlane_k2_k007232_w) /* 007232 registers (chip 2) */
@@ -201,6 +202,8 @@ static MACHINE_CONFIG_START( fastlane, fastlane_state )
MCFG_CPU_PROGRAM_MAP(fastlane_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", fastlane_state, fastlane_scanline, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.17) // measured
diff --git a/src/mame/drivers/finalizr.cpp b/src/mame/drivers/finalizr.cpp
index e52e22420c3..1eb060a9169 100644
--- a/src/mame/drivers/finalizr.cpp
+++ b/src/mame/drivers/finalizr.cpp
@@ -16,6 +16,7 @@
#include "machine/konami1.h"
#include "cpu/m6809/m6809.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "sound/dac.h"
#include "includes/konamipt.h"
@@ -108,7 +109,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, finalizr_state )
AM_RANGE(0x0811, 0x0811) AM_READ_PORT("P1")
AM_RANGE(0x0812, 0x0812) AM_READ_PORT("P2")
AM_RANGE(0x0813, 0x0813) AM_READ_PORT("DSW1")
- AM_RANGE(0x0818, 0x0818) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0818, 0x0818) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0819, 0x0819) AM_WRITE(finalizr_coin_w)
AM_RANGE(0x081a, 0x081a) AM_DEVWRITE("snsnd", sn76489a_device, write) /* This address triggers the SN chip to read the data port. */
AM_RANGE(0x081b, 0x081b) AM_WRITENOP /* Loads the snd command into the snd latch */
@@ -268,6 +269,8 @@ static MACHINE_CONFIG_START( finalizr, finalizr_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index adffd9c43ed..6b8a2a0f421 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -35,6 +35,7 @@ but requires a special level III player for proper control. Video: CAV. Audio: A
#include "sound/tms5220.h"
#include "machine/ldvp931.h"
#include "machine/6532riot.h"
+#include "machine/watchdog.h"
#include "machine/x2212.h"
@@ -538,7 +539,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, firefox_state )
AM_RANGE(0x4107, 0x4107) AM_MIRROR(0x00f8) AM_READ(adc_r) /* ADC */
AM_RANGE(0x4200, 0x4200) AM_MIRROR(0x0047) AM_WRITE(main_irq_clear_w) /* RSTIRQ */
AM_RANGE(0x4208, 0x4208) AM_MIRROR(0x0047) AM_WRITE(main_firq_clear_w) /* RSTFIRQ */
- AM_RANGE(0x4210, 0x4210) AM_MIRROR(0x0047) AM_WRITE(watchdog_reset_w) /* WDCLK */
+ AM_RANGE(0x4210, 0x4210) AM_MIRROR(0x0047) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* WDCLK */
AM_RANGE(0x4218, 0x4218) AM_MIRROR(0x0047) AM_WRITE(firefox_disc_read_w) /* DSKREAD */
AM_RANGE(0x4220, 0x4223) AM_MIRROR(0x0044) AM_WRITE(adc_select_w) /* ADCSTART */
AM_RANGE(0x4230, 0x4230) AM_MIRROR(0x0047) AM_WRITE(self_reset_w) /* AMUCK */
@@ -716,6 +717,7 @@ static MACHINE_CONFIG_START( firefox, firefox_state )
MCFG_QUANTUM_TIME(attotime::from_hz(60000))
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_hz((double)MASTER_XTAL/8/16/16/16/16))
/* video hardware */
diff --git a/src/mame/drivers/firetrk.cpp b/src/mame/drivers/firetrk.cpp
index f53f50a5368..9f616ef9808 100644
--- a/src/mame/drivers/firetrk.cpp
+++ b/src/mame/drivers/firetrk.cpp
@@ -22,7 +22,7 @@ void firetrk_state::set_service_mode(int enable)
m_in_service_mode = enable;
/* watchdog is disabled during service mode */
- machine().watchdog_enable(!enable);
+ m_watchdog->watchdog_enable(!enable);
/* change CPU clock speed according to service switch change */
m_maincpu->set_unscaled_clock(enable ? (MASTER_CLOCK/16) : (MASTER_CLOCK/12));
@@ -307,7 +307,7 @@ static ADDRESS_MAP_START( firetrk_map, AS_PROGRAM, 8, firetrk_state )
AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_reset_w)
AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("car_rot")
AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w)
- AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x001f) AM_WRITE(blink_on_w) AM_SHARE("blink")
AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_WRITE(firetrk_motor_snd_w)
AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w)
@@ -332,7 +332,7 @@ static ADDRESS_MAP_START( superbug_map, AS_PROGRAM, 8, firetrk_state )
AM_RANGE(0x0160, 0x0160) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_reset_w)
AM_RANGE(0x0180, 0x0180) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("car_rot")
AM_RANGE(0x01a0, 0x01a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w)
- AM_RANGE(0x01c0, 0x01c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x01c0, 0x01c0) AM_MIRROR(0x001f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x01e0, 0x01e0) AM_MIRROR(0x001f) AM_WRITE(blink_on_w) AM_SHARE("blink")
AM_RANGE(0x0200, 0x0207) AM_MIRROR(0x0018) AM_READ(firetrk_input_r)
AM_RANGE(0x0220, 0x0220) AM_MIRROR(0x001f) AM_WRITE(firetrk_xtndply_w)
@@ -357,7 +357,7 @@ static ADDRESS_MAP_START( montecar_map, AS_PROGRAM, 8, firetrk_state )
AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x001f) AM_WRITE(montecar_car_reset_w)
AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("car_rot")
AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w)
- AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x001f) AM_WRITE(montecar_skid_reset_w)
AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_WRITE(firetrk_motor_snd_w)
AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w)
@@ -860,7 +860,9 @@ static MACHINE_CONFIG_START( firetrk, firetrk_state )
MCFG_CPU_ADD("maincpu", M6800, MASTER_CLOCK/12) /* 750Khz during service mode */
MCFG_CPU_PROGRAM_MAP(firetrk_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", firetrk_state, firetrk_scanline, "screen", 0, 1)
- MCFG_WATCHDOG_VBLANK_INIT(5)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 5)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/flkatck.cpp b/src/mame/drivers/flkatck.cpp
index e893d67a639..140729c7167 100644
--- a/src/mame/drivers/flkatck.cpp
+++ b/src/mame/drivers/flkatck.cpp
@@ -72,7 +72,7 @@ WRITE8_MEMBER(flkatck_state::flkatck_ls138_w)
m_audiocpu->set_input_line(0, HOLD_LINE);
break;
case 0x07: /* watchdog reset */
- watchdog_reset_w(space, 0, data);
+ m_watchdog->reset_w(space, 0, data);
break;
}
}
@@ -216,6 +216,7 @@ static MACHINE_CONFIG_START( flkatck, flkatck_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600))
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/foodf.cpp b/src/mame/drivers/foodf.cpp
index f23669fb8a0..6a5f34d5355 100644
--- a/src/mame/drivers/foodf.cpp
+++ b/src/mame/drivers/foodf.cpp
@@ -78,6 +78,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "machine/atarigen.h"
+#include "machine/watchdog.h"
#include "sound/pokey.h"
#include "includes/foodf.h"
@@ -218,7 +219,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, foodf_state )
AM_RANGE(0x948000, 0x948001) AM_MIRROR(0x023ffe) AM_READ_PORT("SYSTEM") AM_WRITE8(digital_w, 0x00ff)
AM_RANGE(0x950000, 0x9501ff) AM_MIRROR(0x023e00) AM_WRITE(foodf_paletteram_w) AM_SHARE("paletteram")
AM_RANGE(0x954000, 0x954001) AM_MIRROR(0x023ffe) AM_WRITE(nvram_recall_w)
- AM_RANGE(0x958000, 0x958001) AM_MIRROR(0x023ffe) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w)
+ AM_RANGE(0x958000, 0x958001) AM_MIRROR(0x023ffe) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0xa40000, 0xa4001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8("pokey2", pokey_device, read, write, 0x00ff)
AM_RANGE(0xa80000, 0xa8001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8("pokey1", pokey_device, read, write, 0x00ff)
AM_RANGE(0xac0000, 0xac001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8("pokey3", pokey_device, read, write, 0x00ff)
@@ -345,7 +346,8 @@ static MACHINE_CONFIG_START( foodf, foodf_state )
MCFG_X2212_ADD_AUTOSAVE("nvram")
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_TIMER_DRIVER_ADD("scan_timer", foodf_state, scanline_update_timer)
diff --git a/src/mame/drivers/fortecar.cpp b/src/mame/drivers/fortecar.cpp
index 59043194bfe..5ae79558571 100644
--- a/src/mame/drivers/fortecar.cpp
+++ b/src/mame/drivers/fortecar.cpp
@@ -317,6 +317,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "machine/i8255.h"
#include "machine/v3021.h"
@@ -333,12 +334,14 @@ public:
fortecar_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
+ m_watchdog(*this, "watchdog"),
m_vram(*this, "vram"),
m_eeprom(*this, "eeprom"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
required_device<cpu_device> m_maincpu;
+ required_device<watchdog_timer_device> m_watchdog;
required_shared_ptr<UINT8> m_vram;
DECLARE_WRITE8_MEMBER(ppi0_portc_w);
DECLARE_READ8_MEMBER(ppi0_portc_r);
@@ -508,7 +511,7 @@ Seems to work properly, but must be checked closely...
*/
if (((data >> 7) & 0x01) == 0) /* check for bit7 */
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
// logerror("AY port B write %02x\n",data);
@@ -640,6 +643,8 @@ static MACHINE_CONFIG_START( fortecar, fortecar_state )
MCFG_CPU_PROGRAM_MAP(fortecar_map)
MCFG_CPU_IO_MAP(fortecar_ports)
MCFG_CPU_VBLANK_INT_DRIVER("screen", fortecar_state, nmi_line_pulse)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(200)) /* guess */
MCFG_NVRAM_ADD_0FILL("nvram")
diff --git a/src/mame/drivers/funkybee.cpp b/src/mame/drivers/funkybee.cpp
index 9c059b052f9..fb41cc40e5a 100644
--- a/src/mame/drivers/funkybee.cpp
+++ b/src/mame/drivers/funkybee.cpp
@@ -81,7 +81,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
READ8_MEMBER(funkybee_state::funkybee_input_port_0_r)
{
- watchdog_reset_r(space, 0);
+ m_watchdog->reset_r(space, 0);
return ioport("IN0")->read();
}
@@ -100,7 +100,7 @@ static ADDRESS_MAP_START( funkybee_map, AS_PROGRAM, 8, funkybee_state )
AM_RANGE(0xe802, 0xe803) AM_WRITE(funkybee_coin_counter_w)
AM_RANGE(0xe805, 0xe805) AM_WRITE(funkybee_gfx_bank_w)
AM_RANGE(0xf000, 0xf000) AM_READNOP /* IRQ Ack */
- AM_RANGE(0xf800, 0xf800) AM_READWRITE(funkybee_input_port_0_r, watchdog_reset_w)
+ AM_RANGE(0xf800, 0xf800) AM_READ(funkybee_input_port_0_r) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xf801, 0xf801) AM_READ_PORT("IN1")
AM_RANGE(0xf802, 0xf802) AM_READ_PORT("IN2")
ADDRESS_MAP_END
@@ -287,6 +287,7 @@ static MACHINE_CONFIG_START( funkybee, funkybee_state )
MCFG_CPU_IO_MAP(io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", funkybee_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/gaelco.cpp b/src/mame/drivers/gaelco.cpp
index 4346627264e..5b301f59ddc 100644
--- a/src/mame/drivers/gaelco.cpp
+++ b/src/mame/drivers/gaelco.cpp
@@ -116,7 +116,7 @@ static ADDRESS_MAP_START( bigkarnk_map, AS_PROGRAM, 16, gaelco_state )
AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(gaelco_vram_w) AM_SHARE("videoram") /* Video RAM */
AM_RANGE(0x102000, 0x103fff) AM_RAM /* Screen RAM */
AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_SHARE("vregs") /* Video Registers */
-// AM_RANGE(0x10800c, 0x10800d) AM_WRITE(watchdog_reset_w) /* INT 6 ACK/Watchdog timer */
+// AM_RANGE(0x10800c, 0x10800d) AM_DEVWRITE(watchdog_reset_w) /* INT 6 ACK/Watchdog timer */
AM_RANGE(0x200000, 0x2007ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") /* Palette */
AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("spriteram") /* Sprite RAM */
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW1")
diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp
index 249e6313b8c..ac47862d22a 100644
--- a/src/mame/drivers/gaiden.cpp
+++ b/src/mame/drivers/gaiden.cpp
@@ -133,6 +133,7 @@ Notes:
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
@@ -400,7 +401,7 @@ static ADDRESS_MAP_START( gaiden_map, AS_PROGRAM, 16, gaiden_state )
AM_RANGE(0x07a304, 0x07a305) AM_WRITE(gaiden_bgscrolly_w)
AM_RANGE(0x07a308, 0x07a309) AM_WRITE(gaiden_bgoffsety_w)
AM_RANGE(0x07a30c, 0x07a30d) AM_WRITE(gaiden_bgscrollx_w)
- AM_RANGE(0x07a800, 0x07a801) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x07a800, 0x07a801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x07a802, 0x07a803) AM_WRITE(gaiden_sound_command_w)
AM_RANGE(0x07a806, 0x07a807) AM_WRITENOP
AM_RANGE(0x07a808, 0x07a809) AM_WRITE(gaiden_flip_w)
@@ -757,6 +758,8 @@ static MACHINE_CONFIG_START( shadoww, gaiden_state )
MCFG_MACHINE_START_OVERRIDE(gaiden_state,raiga)
MCFG_MACHINE_RESET_OVERRIDE(gaiden_state,raiga)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
@@ -925,7 +928,7 @@ static ADDRESS_MAP_START( mastninj_map, AS_PROGRAM, 16, gaiden_state )
AM_RANGE(0x07f002, 0x07f003) AM_WRITE(gaiden_bgscrollx_w)
AM_RANGE(0x07f004, 0x07f005) AM_WRITE(gaiden_fgscrolly_w)
AM_RANGE(0x07f006, 0x07f007) AM_WRITE(gaiden_fgscrollx_w)
- AM_RANGE(0x07a800, 0x07a801) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x07a800, 0x07a801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x07e000, 0x07e001) AM_WRITE(gaiden_sound_command_w)
// AM_RANGE(0x07a806, 0x07a807) AM_WRITENOP
// AM_RANGE(0x07a808, 0x07a809) AM_WRITE(gaiden_flip_w)
@@ -945,6 +948,8 @@ static MACHINE_CONFIG_START( mastninj, gaiden_state )
MCFG_MACHINE_START_OVERRIDE(gaiden_state,raiga)
MCFG_MACHINE_RESET_OVERRIDE(gaiden_state,raiga)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp
index 7d87ee71069..46edb856148 100644
--- a/src/mame/drivers/galaga.cpp
+++ b/src/mame/drivers/galaga.cpp
@@ -709,6 +709,7 @@ TODO:
#include "includes/galaga.h"
#include "audio/namco52.h"
#include "machine/rescap.h"
+#include "machine/watchdog.h"
#include "sound/samples.h"
#include "audio/namco54.h"
@@ -879,7 +880,7 @@ static ADDRESS_MAP_START( bosco_map, AS_PROGRAM, 8, bosco_state )
AM_RANGE(0x6800, 0x6807) AM_READ(bosco_dsw_r)
AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */
- AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x6830, 0x6830) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx_0", namco_06xx_device, data_r, data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx_0", namco_06xx_device, ctrl_r, ctrl_w)
AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE("share1")
@@ -901,7 +902,7 @@ static ADDRESS_MAP_START( galaga_map, AS_PROGRAM, 8, galaga_state )
AM_RANGE(0x6800, 0x6807) AM_READ(bosco_dsw_r)
AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */
- AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x6830, 0x6830) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_device, data_r, data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_device, ctrl_r, ctrl_w)
AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(galaga_videoram_w) AM_SHARE("videoram")
@@ -918,7 +919,7 @@ static ADDRESS_MAP_START( xevious_map, AS_PROGRAM, 8, xevious_state )
AM_RANGE(0x6800, 0x6807) AM_READ(bosco_dsw_r)
AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */
- AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x6830, 0x6830) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_device, data_r, data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_device, ctrl_r, ctrl_w)
AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE("share1") /* work RAM */
@@ -938,7 +939,7 @@ static ADDRESS_MAP_START( digdug_map, AS_PROGRAM, 8, digdug_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM AM_WRITENOP /* the only area different for each CPU */
AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */
- AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x6830, 0x6830) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_device, data_r, data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_device, ctrl_r, ctrl_w)
AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(digdug_videoram_w) AM_SHARE("videoram") /* tilemap RAM (bottom half of RAM 0 */
@@ -1649,7 +1650,8 @@ static MACHINE_CONFIG_START( bosco, bosco_state )
MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("50xx_2", namco_50xx_device, write))
MCFG_NAMCO_06XX_WRITE_1_CB(DEVWRITE8("52xx", namco_52xx_device, write))
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
MCFG_MACHINE_START_OVERRIDE(bosco_state,galaga)
@@ -1713,7 +1715,8 @@ static MACHINE_CONFIG_START( galaga, galaga_state )
MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
MCFG_NAMCO_06XX_WRITE_3_CB(DEVWRITE8("54xx", namco_54xx_device, write))
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
MCFG_MACHINE_START_OVERRIDE(galaga_state,galaga)
@@ -1802,7 +1805,8 @@ static MACHINE_CONFIG_START( xevious, xevious_state )
MCFG_NAMCO_06XX_WRITE_2_CB(DEVWRITE8("50xx", namco_50xx_device, write))
MCFG_NAMCO_06XX_WRITE_3_CB(DEVWRITE8("54xx", namco_54xx_device, write))
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_QUANTUM_TIME(attotime::from_hz(60000)) /* 1000 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
MCFG_MACHINE_START_OVERRIDE(galaga_state,galaga)
@@ -1911,6 +1915,8 @@ static MACHINE_CONFIG_START( digdug, digdug_state )
MCFG_ATARIVGEAROM_ADD("earom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 288, 264, 0, 224)
diff --git a/src/mame/drivers/galastrm.cpp b/src/mame/drivers/galastrm.cpp
index 9122a41b935..c9b64c4e9dd 100644
--- a/src/mame/drivers/galastrm.cpp
+++ b/src/mame/drivers/galastrm.cpp
@@ -121,7 +121,7 @@ popmessage(t);
{
if (ACCESSING_BITS_24_31) /* $400000 is watchdog */
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
if (ACCESSING_BITS_0_7)
@@ -287,6 +287,8 @@ static MACHINE_CONFIG_START( galastrm, galastrm_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index 9e4eacf040f..0dd6bb813f6 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -658,6 +658,7 @@ TODO:
#include "cpu/z80/z80.h"
#include "cpu/s2650/s2650.h"
#include "machine/i8255.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "sound/dac.h"
#include "sound/discrete.h"
@@ -1571,7 +1572,7 @@ static ADDRESS_MAP_START( galaxian_map_base, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0x7006, 0x7006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0x7007, 0x7007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
//AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
- AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( galaxian_map, AS_PROGRAM, 8, galaxian_state )
@@ -1605,7 +1606,7 @@ static ADDRESS_MAP_START( mooncrst_map_base, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xb006, 0xb006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
// AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
- AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( moonqsr_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, galaxian_state )
@@ -1632,7 +1633,7 @@ static ADDRESS_MAP_START( fantastc_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1")
AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2")
AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
- AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xfffe, 0xfffe) AM_NOP // ?
ADDRESS_MAP_END
@@ -1651,7 +1652,7 @@ static ADDRESS_MAP_START( timefgtr_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2")
AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
AM_RANGE(0xb004, 0xb004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
- AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
// AM_RANGE(0xb800, 0xb800) AM_WRITENOP // ?
// AM_RANGE(0xfff8, 0xffff) AM_WRITENOP // sound related?
ADDRESS_MAP_END
@@ -1676,7 +1677,7 @@ static ADDRESS_MAP_START( dambustr_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xf004, 0xf004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
AM_RANGE(0xf006, 0xf006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0xf007, 0xf007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
- AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07ff) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
#endif
@@ -1696,7 +1697,7 @@ static ADDRESS_MAP_START( theend_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0x6805, 0x6805) AM_MIRROR(0x07f8) //POUT2
AM_RANGE(0x6806, 0x6806) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0x6807, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8000, 0xffff) AM_READWRITE(theend_ppi8255_r, theend_ppi8255_w)
ADDRESS_MAP_END
@@ -1717,7 +1718,7 @@ static ADDRESS_MAP_START( scobra_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xa805, 0xa805) AM_MIRROR(0x47f8) /* POUT2 */
AM_RANGE(0xa806, 0xa806) AM_MIRROR(0x47f8) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0xa807, 0xa807) AM_MIRROR(0x47f8) AM_WRITE(galaxian_flip_screen_y_w)
- AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x47ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x47ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
@@ -1734,7 +1735,7 @@ static ADDRESS_MAP_START( anteateruk_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0x1006, 0x1006) AM_MIRROR(0x01f8) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0x1007, 0x1007) AM_MIRROR(0x01f8) AM_WRITE(galaxian_flip_screen_y_w)
AM_RANGE(0x1200, 0x12ff) AM_MIRROR(0x0100) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
- AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x4000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
@@ -1769,7 +1770,7 @@ static ADDRESS_MAP_START( spactrai_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0x6800, 0x6800) AM_READ_PORT("IN1")
AM_RANGE(0x7000, 0x7000) AM_READ_PORT("IN2")
- AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x7800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xfe00, 0xfeff) AM_RAM AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
@@ -1791,7 +1792,7 @@ static ADDRESS_MAP_START( anteaterg_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0x2607, 0x2607) AM_MIRROR(0x01f8) AM_WRITE(galaxian_flip_screen_y_w)
AM_RANGE(0x4000, 0xbfff) AM_ROM
AM_RANGE(0x7c00, 0x7fff) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram") /* mirror! */
- AM_RANGE(0xf400, 0xf400) AM_MIRROR(0x01ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf400, 0xf400) AM_MIRROR(0x01ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x01fc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
ADDRESS_MAP_END
@@ -1812,7 +1813,7 @@ static ADDRESS_MAP_START( anteatergg_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0x7004, 0x7004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
AM_RANGE(0x7006, 0x7006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0x7007, 0x7007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
- AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x7800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_IMPORT_FROM(galaxian_map_discrete)
ADDRESS_MAP_END
@@ -1821,7 +1822,7 @@ static ADDRESS_MAP_START( frogger_map, AS_PROGRAM, 8, galaxian_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
AM_RANGE(0xb808, 0xb808) AM_MIRROR(0x07e3) AM_WRITE(irq_enable_w)
@@ -1848,7 +1849,7 @@ static ADDRESS_MAP_START( turtles_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xa028, 0xa028) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_blue_w)
AM_RANGE(0xa030, 0xa030) AM_MIRROR(0x47c7) AM_WRITE(coin_count_0_w)
AM_RANGE(0xa038, 0xa038) AM_MIRROR(0x47c7) AM_WRITE(coin_count_1_w)
- AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x47ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x47ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xb000, 0xb03f) AM_MIRROR(0x47cf) AM_READWRITE(turtles_ppi8255_0_r, turtles_ppi8255_0_w)
AM_RANGE(0xb800, 0xb83f) AM_MIRROR(0x47cf) AM_READWRITE(turtles_ppi8255_1_r, turtles_ppi8255_1_w)
ADDRESS_MAP_END
@@ -1937,7 +1938,7 @@ static ADDRESS_MAP_START( frogf_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xa806, 0xa806) AM_MIRROR(0x07f1) AM_WRITE(galaxian_flip_screen_y_w)
AM_RANGE(0xa808, 0xa808) AM_MIRROR(0x07f1) AM_WRITE(coin_count_1_w)
AM_RANGE(0xa80e, 0xa80e) AM_MIRROR(0x07f1) AM_WRITE(coin_count_0_w)
- AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xc000, 0xffff) AM_READWRITE(frogf_ppi8255_r, frogf_ppi8255_w)
ADDRESS_MAP_END
@@ -1959,7 +1960,7 @@ static ADDRESS_MAP_START( mshuttle_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("cclimber_audio", cclimber_audio_device, sample_rate_w)
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("IN2")
AM_RANGE(0xb000, 0xb000) AM_DEVWRITE("cclimber_audio", cclimber_audio_device, sample_volume_w)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mshuttle_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, galaxian_state )
@@ -2006,7 +2007,7 @@ static ADDRESS_MAP_START( froggeram_map, AS_PROGRAM, 8, galaxian_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x8800, 0x8800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x8800, 0x8800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xa800, 0xabff) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xb000, 0xb0ff) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
AM_RANGE(0xb801, 0xb801) AM_WRITE(irq_enable_w)
@@ -5457,7 +5458,8 @@ static MACHINE_CONFIG_START( galaxian_base, galaxian_state )
MCFG_CPU_PROGRAM_MAP(galaxian_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", galaxian_state, interrupt_gen)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", galaxian)
@@ -5672,7 +5674,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( jumpbug, galaxian_base )
- MCFG_WATCHDOG_VBLANK_INIT(0)
+ MCFG_DEVICE_REMOVE("watchdog")
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
@@ -5886,7 +5888,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( sfx, galaxian_base )
MCFG_FRAGMENT_ADD(konami_sound_2x_ay8910)
- MCFG_WATCHDOG_VBLANK_INIT(0)
+ MCFG_DEVICE_REMOVE("watchdog")
/* alternate memory map */
MCFG_CPU_MODIFY("maincpu")
@@ -6928,7 +6930,8 @@ DRIVER_INIT_MEMBER(galaxian_state,explorer)
common_init(&galaxian_state::scramble_draw_bullet, &galaxian_state::scramble_draw_background, nullptr, nullptr);
/* watchdog works for writes as well? (or is it just disabled?) */
- space.install_write_handler(0x7000, 0x7000, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::watchdog_reset_w),this));
+ watchdog_timer_device *wdog = subdevice<watchdog_timer_device>("watchdog");
+ space.install_write_handler(0x7000, 0x7000, 0, 0x7ff, write8_delegate(FUNC(watchdog_timer_device::reset_w), wdog));
/* I/O appears to be direct, not via PPIs */
space.unmap_readwrite(0x8000, 0xffff);
@@ -6961,8 +6964,9 @@ DRIVER_INIT_MEMBER(galaxian_state,atlantis)
common_init(&galaxian_state::scramble_draw_bullet, &galaxian_state::scramble_draw_background, nullptr, nullptr);
/* watchdog is at $7800? (or is it just disabled?) */
+ watchdog_timer_device *wdog = subdevice<watchdog_timer_device>("watchdog");
space.unmap_read(0x7000, 0x7000, 0, 0x7ff);
- space.install_read_handler(0x7800, 0x7800, 0, 0x7ff, read8_delegate(FUNC(galaxian_state::watchdog_reset_r),this));
+ space.install_read_handler(0x7800, 0x7800, 0, 0x7ff, read8_delegate(FUNC(watchdog_timer_device::reset_r), wdog));
}
diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp
index 3396ffdc94b..b66bdceb980 100644
--- a/src/mame/drivers/galaxold.cpp
+++ b/src/mame/drivers/galaxold.cpp
@@ -102,6 +102,7 @@ Stephh's notes (based on the games Z80 code and some tests) for other games :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/s2650/s2650.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/sn76496.h"
#include "sound/dac.h"
@@ -167,7 +168,7 @@ static ADDRESS_MAP_START( galaxold_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x7fff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x7800, 0x7800) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
AM_RANGE(0xfffc, 0xffff) AM_RAM
ADDRESS_MAP_END
@@ -195,7 +196,7 @@ static ADDRESS_MAP_START( mooncrst_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xb800, 0xb800) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
@@ -215,7 +216,7 @@ static ADDRESS_MAP_START( hustlerb3_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW0")
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xa004, 0xa007) AM_DEVWRITE("cust", galaxian_sound_device, lfo_freq_w)
AM_RANGE(0xa800, 0xa802) AM_DEVWRITE("cust", galaxian_sound_device, background_enable_w)
@@ -253,7 +254,7 @@ static ADDRESS_MAP_START( rockclim_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW0") AM_WRITE(galaxold_nmi_enable_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xb800, 0xb800) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
@@ -281,7 +282,7 @@ static ADDRESS_MAP_START( ckongg_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xc804, 0xc804) AM_WRITENOP // link cut
AM_RANGE(0xc806, 0xc806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xc807, 0xc807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xcc00, 0xcc00) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
+ AM_RANGE(0xcc00, 0xcc00) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
/* Memory map based on mooncrst_map according to Z80 code - seems to be good but needs further checking */
@@ -308,7 +309,7 @@ static ADDRESS_MAP_START( ckongmc_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xb004, 0xb004) AM_WRITENOP /* AM_WRITE(galaxold_stars_enable_w) */
AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w) /* GUESS */
AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w) /* GUESS */
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w) /* GUESS */
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w) /* GUESS */
ADDRESS_MAP_END
@@ -336,7 +337,7 @@ static ADDRESS_MAP_START( scramblb_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x7800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x7800, 0x7800) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
AM_RANGE(0x8102, 0x8102) AM_READ(scramblb_protection_1_r)
AM_RANGE(0x8202, 0x8202) AM_READ(scramblb_protection_2_r)
@@ -364,7 +365,7 @@ static ADDRESS_MAP_START( scramb2_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7007) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7007) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x7006, 0x7006) AM_WRITENOP
AM_RANGE(0x7007, 0x7007) AM_WRITENOP
AM_RANGE(0x7800, 0x7807) AM_READ(scramb2_port2_r) // reads from 8 addresses, 1 bit per address
@@ -406,7 +407,7 @@ static ADDRESS_MAP_START( scrambler_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x7800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x7800, 0x7800) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
// AM_RANGE(0x8102, 0x8102) AM_READ(scramblb_protection_1_r)
AM_RANGE(0x8202, 0x8202) AM_READ(scrambler_protection_2_r)
@@ -451,7 +452,7 @@ static ADDRESS_MAP_START( guttang_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x7000, 0x7000) AM_READ_PORT("IN2")
AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxold_nmi_enable_w)
- AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
+ AM_RANGE(0x7800, 0x7800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
@@ -480,7 +481,7 @@ static ADDRESS_MAP_START( _4in1_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7800, 0x78ff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x78ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x7800, 0x78ff) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
AM_RANGE(0x8000, 0x8000) AM_WRITE(_4in1_bank_w)
AM_RANGE(0xc000, 0xdfff) AM_ROM /* fixed menu code */
@@ -505,7 +506,7 @@ static ADDRESS_MAP_START( bagmanmc_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xb002, 0xb002) AM_WRITE(galaxold_gfxbank_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
@@ -531,7 +532,7 @@ static ADDRESS_MAP_START( dkongjrm_map, AS_PROGRAM, 8, galaxold_state )
//AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
@@ -544,7 +545,7 @@ static ADDRESS_MAP_START( tazzmang, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x8860, 0x887f) AM_RAM AM_SHARE("bulletsram")
AM_RANGE(0x8880, 0x8bff) AM_WRITENOP
AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x9800, 0x9800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
AM_RANGE(0xa7ff, 0xa7ff) AM_READ_PORT("IN0") /* mirror */
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") AM_DEVWRITE("cust", galaxian_sound_device, background_enable_w)
@@ -556,7 +557,7 @@ static ADDRESS_MAP_START( tazzmang, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
ADDRESS_MAP_END
@@ -576,7 +577,7 @@ static ADDRESS_MAP_START( bongo, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_WRITENOP
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITENOP
ADDRESS_MAP_END
static ADDRESS_MAP_START( bongo_io, AS_IO, 8, galaxold_state )
@@ -629,7 +630,7 @@ static ADDRESS_MAP_START( hunchbkg, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x1604, 0x1604) AM_MIRROR(0x6000) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x1606, 0x1606) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x1607, 0x1607) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
+ AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
AM_RANGE(0x2000, 0x2fff) AM_ROM
@@ -653,7 +654,7 @@ static ADDRESS_MAP_START( spcwarp, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x1585, 0x1585) AM_MIRROR(0x6000) AM_DEVWRITE("cust", galaxian_sound_device, fire_enable_w)
AM_RANGE(0x1586, 0x1587) AM_MIRROR(0x6000) AM_DEVWRITE("cust", galaxian_sound_device, vol_w)
// everything else in the $16xx range is moved to $17xx
- AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READ(watchdog_reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
+ AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("cust", galaxian_sound_device, pitch_w)
AM_RANGE(0x1700, 0x1700) AM_MIRROR(0x6000) AM_READ_PORT("DSW0")
AM_RANGE(0x1701, 0x1701) AM_MIRROR(0x6000) AM_WRITE(galaxold_nmi_enable_w)
AM_RANGE(0x1704, 0x1704) AM_MIRROR(0x6000) AM_WRITE(galaxold_stars_enable_w)
@@ -2223,6 +2224,8 @@ static MACHINE_CONFIG_START( galaxold_base, galaxold_state )
MCFG_TIMER_DRIVER_ADD("int_timer", galaxold_state, galaxold_interrupt_timer)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", galaxian)
MCFG_PALETTE_ADD("palette", 32+2+64) /* 32 for the characters, 2 for the bullets, 64 for the stars */
diff --git a/src/mame/drivers/galpani3.cpp b/src/mame/drivers/galpani3.cpp
index c54af2de04d..89d8e0dedbf 100644
--- a/src/mame/drivers/galpani3.cpp
+++ b/src/mame/drivers/galpani3.cpp
@@ -68,6 +68,7 @@ Dumped by Uki
#include "sound/ymz280b.h"
#include "video/sknsspr.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "machine/kaneko_toybox.h"
#include "video/kaneko_grap2.h"
@@ -493,7 +494,7 @@ static ADDRESS_MAP_START( galpani3_map, AS_PROGRAM, 16, galpani3_state )
AM_RANGE(0xf00014, 0xf00015) AM_READ_PORT("COIN")
AM_RANGE(0xf00016, 0xf00017) AM_NOP // ? read, but overwritten
AM_RANGE(0xf00020, 0xf00023) AM_DEVWRITE8("ymz", ymz280b_device, write, 0x00ff) // sound
- AM_RANGE(0xf00040, 0xf00041) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // watchdog
+ AM_RANGE(0xf00040, 0xf00041) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0xf00050, 0xf00051) AM_NOP // ? written once (3rd opcode, $30.b)
ADDRESS_MAP_END
@@ -513,6 +514,8 @@ static MACHINE_CONFIG_START( galpani3, galpani3_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_DEVICE_ADD("toybox", KANEKO_TOYBOX, 0)
MCFG_PALETTE_ADD("palette", 0x4303)
diff --git a/src/mame/drivers/galpanic.cpp b/src/mame/drivers/galpanic.cpp
index 9c355309e77..f855b3f25e0 100644
--- a/src/mame/drivers/galpanic.cpp
+++ b/src/mame/drivers/galpanic.cpp
@@ -68,6 +68,7 @@ Stephh's additional notes :
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "includes/kaneko16.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "video/kan_pand.h"
#include "machine/kaneko_hit.h"
@@ -230,6 +231,8 @@ static MACHINE_CONFIG_START( galpanic, galpanic_state )
MCFG_CPU_PROGRAM_MAP(galpanic_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", galpanic_state, scanline, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -266,6 +269,7 @@ static MACHINE_CONFIG_DERIVED( galpanica, galpanic )
/* basic machine hardware */
/* arm watchdog */
+ MCFG_WATCHDOG_MODIFY("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gaplus.cpp b/src/mame/drivers/gaplus.cpp
index f09e3a40d51..a84134081ca 100644
--- a/src/mame/drivers/gaplus.cpp
+++ b/src/mame/drivers/gaplus.cpp
@@ -154,6 +154,7 @@ TODO:
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "machine/namco62.h"
+#include "machine/watchdog.h"
#include "sound/samples.h"
#include "includes/gaplus.h"
@@ -277,7 +278,7 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, gaplus_state )
AM_RANGE(0x6810, 0x681f) AM_DEVREADWRITE("namcoio_2", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x6820, 0x682f) AM_READWRITE(customio_3_r, customio_3_w) AM_SHARE("customio_3") /* custom I/O chip #3 interface */
AM_RANGE(0x7000, 0x7fff) AM_WRITE(irq_1_ctrl_w) /* main CPU irq control */
- AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r) /* watchdog */
+ AM_RANGE(0x7800, 0x7fff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8000, 0x8fff) AM_WRITE(sreset_w) /* reset CPU #2 & #3, enable sound */
AM_RANGE(0x9000, 0x9fff) AM_WRITE(freset_w) /* reset I/O chips */
AM_RANGE(0xa000, 0xa7ff) AM_WRITE(starfield_control_w) /* starfield control */
@@ -294,7 +295,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cpu3_map, AS_PROGRAM, 8, gaplus_state )
AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", namco_15xx_device, sharedram_r, sharedram_w) /* shared RAM with the main CPU + sound registers */
- AM_RANGE(0x2000, 0x3fff) AM_READWRITE(watchdog_reset_r, watchdog_reset_w) /* watchdog? */
+ AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset_r, reset_w) /* watchdog? */
AM_RANGE(0x4000, 0x7fff) AM_WRITE(irq_3_ctrl_w) /* interrupt enable/disable */
AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
@@ -523,6 +524,8 @@ static MACHINE_CONFIG_START( gaplus, gaplus_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* a high value to ensure proper synchronization of the CPUs */
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_DEVICE_ADD("namcoio_1", NAMCO56XX, 0)
MCFG_NAMCO56XX_IN_0_CB(IOPORT("COINS"))
MCFG_NAMCO56XX_IN_1_CB(IOPORT("P1"))
diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp
index f10375d51fe..32ceadc4083 100644
--- a/src/mame/drivers/gauntlet.cpp
+++ b/src/mame/drivers/gauntlet.cpp
@@ -123,6 +123,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/tms5220.h"
#include "sound/2151intf.h"
#include "sound/pokey.h"
@@ -291,7 +292,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, gauntlet_state )
AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ_PORT("803006")
AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ_PORT("803008")
AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
- AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x803140, 0x803141) AM_MIRROR(0x2fce8e) AM_WRITE(video_int_ack_w)
AM_RANGE(0x803150, 0x803151) AM_MIRROR(0x2fce8e) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
@@ -504,6 +505,8 @@ static MACHINE_CONFIG_START( gauntlet_base, gauntlet_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gauntlet)
diff --git a/src/mame/drivers/gberet.cpp b/src/mame/drivers/gberet.cpp
index 64496a345b6..dea084ac579 100644
--- a/src/mame/drivers/gberet.cpp
+++ b/src/mame/drivers/gberet.cpp
@@ -74,6 +74,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "includes/konamipt.h"
#include "includes/gberet.h"
@@ -162,7 +163,7 @@ static ADDRESS_MAP_START( gberet_map, AS_PROGRAM, 8, gberet_state )
AM_RANGE(0xf000, 0xf000) AM_WRITE(gberet_coin_counter_w)
AM_RANGE(0xf200, 0xf200) AM_READ_PORT("DSW2") AM_WRITEONLY AM_SHARE("soundlatch")
AM_RANGE(0xf400, 0xf400) AM_READ_PORT("DSW3") AM_WRITE(gberet_sound_w)
- AM_RANGE(0xf600, 0xf600) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xf600, 0xf600) AM_READ_PORT("DSW1") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xf601, 0xf601) AM_READ_PORT("P2")
AM_RANGE(0xf602, 0xf602) AM_READ_PORT("P1")
AM_RANGE(0xf603, 0xf603) AM_READ_PORT("SYSTEM")
@@ -182,7 +183,7 @@ static ADDRESS_MAP_START( mrgoemon_map, AS_PROGRAM, 8, gberet_state )
AM_RANGE(0xf000, 0xf000) AM_WRITE(mrgoemon_coin_counter_w)
AM_RANGE(0xf200, 0xf200) AM_READ_PORT("DSW2") AM_WRITEONLY AM_SHARE("soundlatch")
AM_RANGE(0xf400, 0xf400) AM_READ_PORT("DSW3") AM_WRITE(gberet_sound_w)
- AM_RANGE(0xf600, 0xf600) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xf600, 0xf600) AM_READ_PORT("DSW1") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xf601, 0xf601) AM_READ_PORT("P2")
AM_RANGE(0xf602, 0xf602) AM_READ_PORT("P1")
AM_RANGE(0xf603, 0xf603) AM_READ_PORT("SYSTEM")
@@ -405,6 +406,7 @@ static MACHINE_CONFIG_START( gberet, gberet_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) // X1S (generated by a custom IC)
MCFG_CPU_PROGRAM_MAP(gberet_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gberet_state, gberet_interrupt_tick, "screen", 0, 16)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_MACHINE_START_OVERRIDE(gberet_state,gberet)
MCFG_MACHINE_RESET_OVERRIDE(gberet_state,gberet)
diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp
index eb26cf3a296..fcc00892148 100644
--- a/src/mame/drivers/gottlieb.cpp
+++ b/src/mame/drivers/gottlieb.cpp
@@ -198,6 +198,7 @@ VBlank duration: 1/VSYNC * (16/256) = 1017.6 us
#include "includes/gottlieb.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#define LOG_AUDIO_DECODE (0)
@@ -753,7 +754,7 @@ static ADDRESS_MAP_START( reactor_map, AS_PROGRAM, 8, gottlieb_state )
AM_RANGE(0x4000, 0x4fff) AM_RAM_WRITE(gottlieb_charram_w) AM_SHARE("charram") /* BOJRSEL1 */
/* AM_RANGE(0x5000, 0x5fff) AM_WRITE() */ /* BOJRSEL2 */
AM_RANGE(0x6000, 0x601f) AM_MIRROR(0x0fe0) AM_WRITE(gottlieb_paletteram_w) AM_SHARE("paletteram") /* COLSEL */
- AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0ff8) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0ff8) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x0ff8) AM_WRITE(gottlieb_analog_reset_w) /* A1J2 interface */
AM_RANGE(0x7002, 0x7002) AM_MIRROR(0x0ff8) AM_WRITE(gottlieb_sh_w) /* trackball H */
AM_RANGE(0x7003, 0x7003) AM_MIRROR(0x0ff8) AM_WRITE(reactor_output_w) /* trackball V */
@@ -775,7 +776,7 @@ static ADDRESS_MAP_START( gottlieb_map, AS_PROGRAM, 8, gottlieb_state )
AM_RANGE(0x3800, 0x3bff) AM_MIRROR(0x0400) AM_RAM_WRITE(gottlieb_videoram_w) AM_SHARE("videoram") /* BRSEL */
AM_RANGE(0x4000, 0x4fff) AM_RAM_WRITE(gottlieb_charram_w) AM_SHARE("charram") /* BOJRSEL1 */
AM_RANGE(0x5000, 0x501f) AM_MIRROR(0x07e0) AM_WRITE(gottlieb_paletteram_w) AM_SHARE("paletteram") /* COLSEL */
- AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x07f8) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x07f8) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5801, 0x5801) AM_MIRROR(0x07f8) AM_WRITE(gottlieb_analog_reset_w) /* A1J2 interface */
AM_RANGE(0x5802, 0x5802) AM_MIRROR(0x07f8) AM_WRITE(gottlieb_sh_w) /* OP20-27 */
AM_RANGE(0x5803, 0x5803) AM_MIRROR(0x07f8) AM_WRITE(general_output_w) /* OP30-37 */
@@ -1768,7 +1769,9 @@ static MACHINE_CONFIG_START( gottlieb_core, gottlieb_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", gottlieb_state, gottlieb_interrupt)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_WATCHDOG_VBLANK_INIT(16)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 16)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/gotya.cpp b/src/mame/drivers/gotya.cpp
index 2bf64918c6e..f546b157885 100644
--- a/src/mame/drivers/gotya.cpp
+++ b/src/mame/drivers/gotya.cpp
@@ -37,6 +37,7 @@ TODO: Emulated sound
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/samples.h"
#include "includes/gotya.h"
@@ -50,7 +51,7 @@ static ADDRESS_MAP_START( gotya_map, AS_PROGRAM, 8, gotya_state )
AM_RANGE(0x6004, 0x6004) AM_WRITE(gotya_video_control_w)
AM_RANGE(0x6005, 0x6005) AM_WRITE(gotya_soundlatch_w)
AM_RANGE(0x6006, 0x6006) AM_WRITEONLY AM_SHARE("scroll")
- AM_RANGE(0x6007, 0x6007) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x6007, 0x6007) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(gotya_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(gotya_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xd000, 0xd3df) AM_RAM AM_SHARE("videoram2")
@@ -188,6 +189,7 @@ static MACHINE_CONFIG_START( gotya, gotya_state )
MCFG_CPU_PROGRAM_MAP(gotya_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", gotya_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/gradius3.cpp b/src/mame/drivers/gradius3.cpp
index cde1399e4bf..aaf3b913224 100644
--- a/src/mame/drivers/gradius3.cpp
+++ b/src/mame/drivers/gradius3.cpp
@@ -26,6 +26,7 @@
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/konamipt.h"
#include "includes/gradius3.h"
@@ -156,7 +157,7 @@ static ADDRESS_MAP_START( gradius3_map, AS_PROGRAM, 16, gradius3_state )
AM_RANGE(0x0d0000, 0x0d0001) AM_READ_PORT("DSW1")
AM_RANGE(0x0d0002, 0x0d0003) AM_READ_PORT("DSW2")
AM_RANGE(0x0d8000, 0x0d8001) AM_WRITE(cpuB_irqtrigger_w)
- AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0e0000, 0x0e0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0e8000, 0x0e8001) AM_WRITE8(soundlatch_byte_w, 0xff00)
AM_RANGE(0x0f0000, 0x0f0001) AM_WRITE(sound_irq_w)
AM_RANGE(0x100000, 0x103fff) AM_RAM AM_SHARE("share1")
@@ -287,6 +288,8 @@ static MACHINE_CONFIG_START( gradius3, gradius3_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/grchamp.cpp b/src/mame/drivers/grchamp.cpp
index 583b6c09eb2..15b52ed0bdb 100644
--- a/src/mame/drivers/grchamp.cpp
+++ b/src/mame/drivers/grchamp.cpp
@@ -195,7 +195,7 @@ WRITE8_MEMBER(grchamp_state::cpu0_outputs_w)
break;
case 0x0d: /* OUT13 */
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
break;
case 0x0e: /* OUT14 */
@@ -662,7 +662,8 @@ static MACHINE_CONFIG_START( grchamp, grchamp_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(grchamp_state, irq0_line_hold, (double)SOUND_CLOCK/4/16/16/10/16)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
/* video hardware */
diff --git a/src/mame/drivers/gridlee.cpp b/src/mame/drivers/gridlee.cpp
index 3e892cff691..c452e2580d8 100644
--- a/src/mame/drivers/gridlee.cpp
+++ b/src/mame/drivers/gridlee.cpp
@@ -83,6 +83,7 @@
#include "cpu/m6809/m6809.h"
#include "sound/samples.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/gridlee.h"
@@ -305,7 +306,7 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, gridlee_state )
/* { 0x9060, 0x9060, unknown - only written to at startup */
AM_RANGE(0x9070, 0x9070) AM_WRITE(gridlee_cocktail_flip_w)
AM_RANGE(0x9200, 0x9200) AM_WRITE(gridlee_palette_select_w)
- AM_RANGE(0x9380, 0x9380) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x9380, 0x9380) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x9500, 0x9501) AM_READ(analog_port_r)
AM_RANGE(0x9502, 0x9502) AM_READ_PORT("IN0")
AM_RANGE(0x9503, 0x9503) AM_READ_PORT("IN1")
@@ -415,6 +416,8 @@ static MACHINE_CONFIG_START( gridlee, gridlee_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(GRIDLEE_PIXEL_CLOCK, GRIDLEE_HTOTAL, GRIDLEE_HBEND, GRIDLEE_HBSTART, GRIDLEE_VTOTAL, GRIDLEE_VBEND, GRIDLEE_VBSTART)
diff --git a/src/mame/drivers/groundfx.cpp b/src/mame/drivers/groundfx.cpp
index 3ca97e168f3..d00eb7b0622 100644
--- a/src/mame/drivers/groundfx.cpp
+++ b/src/mame/drivers/groundfx.cpp
@@ -110,7 +110,7 @@ WRITE32_MEMBER(groundfx_state::groundfx_input_w)
case 0x00:
if (ACCESSING_BITS_24_31) /* $500000 is watchdog */
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
if (ACCESSING_BITS_0_7)
@@ -318,6 +318,8 @@ static MACHINE_CONFIG_START( groundfx, groundfx_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/gunbustr.cpp b/src/mame/drivers/gunbustr.cpp
index 325717e7e55..1c09749e67a 100644
--- a/src/mame/drivers/gunbustr.cpp
+++ b/src/mame/drivers/gunbustr.cpp
@@ -85,7 +85,7 @@ WRITE32_MEMBER(gunbustr_state::gunbustr_input_w)
if (ACCESSING_BITS_24_31)
{
/* $400000 is watchdog */
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
if (ACCESSING_BITS_0_7)
@@ -283,6 +283,8 @@ static MACHINE_CONFIG_START( gunbustr, gunbustr_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/gunsmoke.cpp b/src/mame/drivers/gunsmoke.cpp
index ea5550f3c89..64dcf75b2c2 100644
--- a/src/mame/drivers/gunsmoke.cpp
+++ b/src/mame/drivers/gunsmoke.cpp
@@ -71,6 +71,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/gunsmoke.h"
@@ -111,7 +112,7 @@ static ADDRESS_MAP_START( gunsmoke_map, AS_PROGRAM, 8, gunsmoke_state )
AM_RANGE(0xc4c9, 0xc4cb) AM_READ(gunsmoke_protection_r)
AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xc804, 0xc804) AM_WRITE(gunsmoke_c804_w) // ROM bank switch, screen flip
- AM_RANGE(0xc806, 0xc806) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc806, 0xc806) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(gunsmoke_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(gunsmoke_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xd800, 0xd801) AM_RAM AM_SHARE("scrollx")
@@ -305,6 +306,8 @@ static MACHINE_CONFIG_START( gunsmoke, gunsmoke_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(gunsmoke_state, irq0_line_hold, 4*60)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp
index 4d57c28a3c7..580a7ca1aa3 100644
--- a/src/mame/drivers/harddriv.cpp
+++ b/src/mame/drivers/harddriv.cpp
@@ -326,6 +326,7 @@ Notes:
#include "emu.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "includes/slapstic.h"
#include "includes/harddriv.h"
@@ -522,16 +523,12 @@ public:
};
-WRITE16_MEMBER( harddriv_state::watchdog_reset16_w )
-{
-}
-
static ADDRESS_MAP_START( driver_68k_map, AS_PROGRAM, 16, harddriv_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x600000, 0x603fff) AM_READ(hd68k_port0_r)
AM_RANGE(0x604000, 0x607fff) AM_WRITE(hd68k_nwr_w)
- AM_RANGE(0x608000, 0x60bfff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x608000, 0x60bfff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x60c000, 0x60ffff) AM_WRITE(hd68k_irq_ack_w)
AM_RANGE(0xa00000, 0xa7ffff) AM_WRITE(hd68k_wr0_write)
AM_RANGE(0xa80000, 0xafffff) AM_READ(hd68k_a80000_r) AM_WRITE(hd68k_wr1_write)
@@ -578,7 +575,7 @@ static ADDRESS_MAP_START( multisync_68k_map, AS_PROGRAM, 16, harddriv_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x604000, 0x607fff) AM_READWRITE(hd68k_sound_reset_r, hd68k_nwr_w)
- AM_RANGE(0x608000, 0x60bfff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x608000, 0x60bfff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x60c000, 0x60ffff) AM_READWRITE(hd68k_port0_r, hd68k_irq_ack_w)
AM_RANGE(0xa00000, 0xa7ffff) AM_WRITE(hd68k_wr0_write)
AM_RANGE(0xa80000, 0xafffff) AM_READ(hd68k_a80000_r) AM_WRITE(hd68k_wr1_write)
@@ -616,7 +613,7 @@ static ADDRESS_MAP_START( multisync2_68k_map, AS_PROGRAM, 16, harddriv_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x1fffff) AM_ROM
AM_RANGE(0x604000, 0x607fff) AM_WRITE(hd68k_nwr_w)
- AM_RANGE(0x608000, 0x60bfff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x608000, 0x60bfff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x60c000, 0x60ffff) AM_READWRITE(hd68k_port0_r, hd68k_irq_ack_w)
AM_RANGE(0xa00000, 0xa7ffff) AM_WRITE(hd68k_wr0_write)
AM_RANGE(0xa80000, 0xafffff) AM_READ(hd68k_a80000_r) AM_WRITE(hd68k_wr1_write)
@@ -1429,6 +1426,8 @@ static MACHINE_CONFIG_FRAGMENT( driver_nomsp )
MCFG_SLAPSTIC_ADD("slapstic", 117)
MCFG_SLAPSTIC_68K_ACCESS(1)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_CPU_ADD("gsp", TMS34010, HARDDRIV_GSP_CLOCK)
MCFG_CPU_PROGRAM_MAP(driver_gsp_map)
MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
diff --git a/src/mame/drivers/hcastle.cpp b/src/mame/drivers/hcastle.cpp
index 8b12afc5b74..851694a5cb1 100644
--- a/src/mame/drivers/hcastle.cpp
+++ b/src/mame/drivers/hcastle.cpp
@@ -11,6 +11,7 @@
#include "emu.h"
#include "cpu/m6809/konami.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/3812intf.h"
#include "sound/k051649.h"
#include "includes/konamipt.h"
@@ -43,7 +44,7 @@ static ADDRESS_MAP_START( hcastle_map, AS_PROGRAM, 8, hcastle_state )
AM_RANGE(0x0400, 0x0400) AM_WRITE(hcastle_bankswitch_w)
AM_RANGE(0x0404, 0x0404) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x0408, 0x0408) AM_WRITE(hcastle_soundirq_w)
- AM_RANGE(0x040c, 0x040c) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x040c, 0x040c) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0410, 0x0410) AM_READ_PORT("SYSTEM") AM_WRITE(hcastle_coin_w)
AM_RANGE(0x0411, 0x0411) AM_READ_PORT("P1")
AM_RANGE(0x0412, 0x0412) AM_READ_PORT("P2")
@@ -192,6 +193,7 @@ static MACHINE_CONFIG_START( hcastle, hcastle_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545)
MCFG_CPU_PROGRAM_MAP(sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
diff --git a/src/mame/drivers/hexion.cpp b/src/mame/drivers/hexion.cpp
index 2eb38d0957c..c2959a33711 100644
--- a/src/mame/drivers/hexion.cpp
+++ b/src/mame/drivers/hexion.cpp
@@ -80,6 +80,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "sound/k051649.h"
#include "includes/konamipt.h"
@@ -134,7 +135,7 @@ static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0xf480, 0xf480) AM_WRITE(bankswitch_w)
AM_RANGE(0xf4c0, 0xf4c0) AM_WRITE(coincntr_w)
AM_RANGE(0xf500, 0xf500) AM_WRITE(gfxrom_select_w)
- AM_RANGE(0xf540, 0xf540) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf540, 0xf540) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( hexionb_map, AS_PROGRAM, 8, hexion_state )
@@ -160,7 +161,7 @@ static ADDRESS_MAP_START( hexionb_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0xf480, 0xf480) AM_WRITE(bankswitch_w)
AM_RANGE(0xf4c0, 0xf4c0) AM_WRITE(coincntr_w)
AM_RANGE(0xf500, 0xf500) AM_WRITE(gfxrom_select_w)
- AM_RANGE(0xf540, 0xf540) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf540, 0xf540) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xf5c0, 0xf5c0) AM_DEVWRITE("oki2", okim6295_device, write)
ADDRESS_MAP_END
@@ -241,6 +242,7 @@ static MACHINE_CONFIG_START( hexion, hexion_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_24MHz/4) /* Z80B 6 MHz @ 17F, xtal verified, divider not verified */
MCFG_CPU_PROGRAM_MAP(hexion_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hexion_state, scanline, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_DEVICE_ADD("k053252", K053252, XTAL_24MHz/2) /* K053252, X0-010(?) @8D, xtal verified, divider not verified */
MCFG_K053252_INT1_ACK_CB(WRITELINE(hexion_state, irq_ack_w))
diff --git a/src/mame/drivers/holeland.cpp b/src/mame/drivers/holeland.cpp
index 6b48104e736..1c3085c6a8b 100644
--- a/src/mame/drivers/holeland.cpp
+++ b/src/mame/drivers/holeland.cpp
@@ -15,6 +15,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
#include "includes/holeland.h"
@@ -43,7 +44,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( io_map, AS_IO, 8, holeland_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x01, 0x01) AM_READ(watchdog_reset_r) /* ? */
+ AM_RANGE(0x01, 0x01) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) /* ? */
AM_RANGE(0x04, 0x04) AM_DEVREAD("ay1", ay8910_device, data_r)
AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0x06, 0x06) AM_DEVREAD("ay2", ay8910_device, data_r)
@@ -261,6 +262,8 @@ static MACHINE_CONFIG_START( holeland, holeland_state )
MCFG_CPU_IO_MAP(io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", holeland_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -332,6 +335,8 @@ static MACHINE_CONFIG_START( crzrally, holeland_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59)
diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp
index 2b98d34e74a..0f070dd2494 100644
--- a/src/mame/drivers/hornet.cpp
+++ b/src/mame/drivers/hornet.cpp
@@ -319,6 +319,7 @@
#include "machine/konppc.h"
#include "machine/timekpr.h"
#include "machine/ds2401.h"
+#include "machine/watchdog.h"
#include "sound/rf5c400.h"
#include "sound/k056800.h"
#include "video/voodoo.h"
@@ -354,7 +355,8 @@ public:
m_analog2(*this, "ANALOG2"),
m_user3_ptr(*this, "user3"),
m_user5_ptr(*this, "user5"),
- m_lan_ds2401(*this, "lan_serial_id")
+ m_lan_ds2401(*this, "lan_serial_id"),
+ m_watchdog(*this, "watchdog")
{ }
// TODO: Needs verification on real hardware
@@ -379,6 +381,7 @@ public:
optional_region_ptr<UINT8> m_user3_ptr;
optional_region_ptr<UINT8> m_user5_ptr;
optional_device<ds2401_device> m_lan_ds2401;
+ required_device<watchdog_timer_device> m_watchdog;
emu_timer *m_sound_irq_timer;
UINT8 m_led_reg0;
@@ -625,7 +628,7 @@ WRITE8_MEMBER(hornet_state::sysreg_w)
0x80 = WDTCLK
*/
if (data & 0x80)
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
break;
case 7: /* CG Control Register */
@@ -1012,6 +1015,8 @@ static MACHINE_CONFIG_START( hornet, hornet_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
// PCB description at top doesn't mention any EEPROM on the base board...
// MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
diff --git a/src/mame/drivers/hyperspt.cpp b/src/mame/drivers/hyperspt.cpp
index 1a052fc6e87..2a835eda64c 100644
--- a/src/mame/drivers/hyperspt.cpp
+++ b/src/mame/drivers/hyperspt.cpp
@@ -15,6 +15,7 @@ Based on drivers from Juno First emulator by Chris Hardy (chrish@kcbbs.gen.nz)
#include "sound/dac.h"
#include "machine/konami1.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/konamipt.h"
#include "audio/trackfld.h"
#include "audio/hyprolyb.h"
@@ -34,7 +35,7 @@ WRITE8_MEMBER(hyperspt_state::irq_mask_w)
static ADDRESS_MAP_START( hyperspt_map, AS_PROGRAM, 8, hyperspt_state )
AM_RANGE(0x1000, 0x10bf) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x10c0, 0x10ff) AM_RAM AM_SHARE("scroll") /* Scroll amount */
- AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1400, 0x1400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1480, 0x1480) AM_WRITE(hyperspt_flipscreen_w)
AM_RANGE(0x1481, 0x1481) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x1483, 0x1484) AM_WRITE(hyperspt_coin_counter_w)
@@ -55,7 +56,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( roadf_map, AS_PROGRAM, 8, hyperspt_state )
AM_RANGE(0x1000, 0x10bf) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x10c0, 0x10ff) AM_RAM AM_SHARE("scroll") /* Scroll amount */
- AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1400, 0x1400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1480, 0x1480) AM_WRITE(hyperspt_flipscreen_w)
AM_RANGE(0x1481, 0x1481) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x1483, 0x1484) AM_WRITE(hyperspt_coin_counter_w)
@@ -301,6 +302,8 @@ static MACHINE_CONFIG_START( hyperspt, hyperspt_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp
index 2b3d89212fa..dbfba1fcadb 100644
--- a/src/mame/drivers/itech32.cpp
+++ b/src/mame/drivers/itech32.cpp
@@ -358,6 +358,7 @@ Notes:
#include "machine/6522via.h"
#include "machine/nvram.h"
#include "machine/ticket.h"
+#include "machine/watchdog.h"
#include "includes/itech32.h"
#include "sound/es5506.h"
#include "machine/timekpr.h"
@@ -873,7 +874,7 @@ static ADDRESS_MAP_START( timekill_map, AS_PROGRAM, 16, itech32_state )
AM_RANGE(0x040000, 0x040001) AM_READ_PORT("P1")
AM_RANGE(0x048000, 0x048001) AM_READ_PORT("P2")
AM_RANGE(0x050000, 0x050001) AM_READ_PORT("SYSTEM") AM_WRITE(timekill_intensity_w)
- AM_RANGE(0x058000, 0x058001) AM_READ_PORT("DIPS") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x058000, 0x058001) AM_READ_PORT("DIPS") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x060000, 0x060001) AM_WRITE(timekill_colora_w)
AM_RANGE(0x068000, 0x068001) AM_WRITE(timekill_colorbc_w)
AM_RANGE(0x070000, 0x070001) AM_WRITENOP /* noisy */
@@ -891,11 +892,11 @@ static ADDRESS_MAP_START( bloodstm_map, AS_PROGRAM, 16, itech32_state )
AM_RANGE(0x080000, 0x080001) AM_READ_PORT("P1") AM_WRITE(int1_ack_w)
AM_RANGE(0x100000, 0x100001) AM_READ_PORT("P2")
AM_RANGE(0x180000, 0x180001) AM_READ_PORT("P3")
- AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P4") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P4") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x280000, 0x280001) AM_READ_PORT("DIPS")
AM_RANGE(0x300000, 0x300001) AM_WRITE(bloodstm_color1_w)
AM_RANGE(0x380000, 0x380001) AM_WRITE(bloodstm_color2_w)
- AM_RANGE(0x400000, 0x400001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x400000, 0x400001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x480000, 0x480001) AM_WRITE(sound_data_w)
AM_RANGE(0x500000, 0x5000ff) AM_READWRITE(bloodstm_video_r, bloodstm_video_w) AM_SHARE("video")
AM_RANGE(0x580000, 0x59ffff) AM_RAM_WRITE(bloodstm_paletteram_w) AM_SHARE("palette")
@@ -970,7 +971,7 @@ AM_RANGE(0x000c00, 0x007fff) AM_MIRROR(0x40000) AM_READWRITE(test2_r, test2_w)
AM_RANGE(0x200000, 0x200003) AM_READ_PORT("200000")
AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(tms1_68k_ram_w) AM_SHARE("tms1_ram")
AM_RANGE(0x300000, 0x300fff) AM_RAM_WRITE(tms2_68k_ram_w) AM_SHARE("tms2_ram")
- AM_RANGE(0x380000, 0x380003) AM_WRITENOP // AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x380000, 0x380003) AM_WRITENOP // AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x600000, 0x607fff) AM_ROM AM_REGION("user1", 0) AM_SHARE("main_rom")
ADDRESS_MAP_END
@@ -996,7 +997,7 @@ static ADDRESS_MAP_START( itech020_map, AS_PROGRAM, 32, itech32_state )
AM_RANGE(0x280000, 0x280003) AM_READ_PORT("DIPS")
AM_RANGE(0x300000, 0x300003) AM_WRITE(itech020_color1_w)
AM_RANGE(0x380000, 0x380003) AM_WRITE(itech020_color2_w)
- AM_RANGE(0x400000, 0x400003) AM_WRITE(watchdog_reset32_w)
+ AM_RANGE(0x400000, 0x400003) AM_DEVWRITE("watchdog", watchdog_timer_device, reset32_w)
AM_RANGE(0x480000, 0x480003) AM_WRITE(sound_data32_w)
AM_RANGE(0x500000, 0x5000ff) AM_READWRITE(itech020_video_r, itech020_video_w) AM_SHARE("video")
AM_RANGE(0x578000, 0x57ffff) AM_READNOP /* touched by protection */
@@ -1659,6 +1660,8 @@ static MACHINE_CONFIG_START( timekill, itech32_state )
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_PALETTE_ADD("palette", 8192)
MCFG_PALETTE_FORMAT(GRBX)
diff --git a/src/mame/drivers/jackal.cpp b/src/mame/drivers/jackal.cpp
index b2b90ea120f..5dfc0c3b6ad 100644
--- a/src/mame/drivers/jackal.cpp
+++ b/src/mame/drivers/jackal.cpp
@@ -73,6 +73,7 @@ Address Dir Data Description
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/jackal.h"
#include "includes/konamipt.h"
@@ -164,7 +165,7 @@ static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, jackal_state )
AM_RANGE(0x0013, 0x0013) AM_READ_PORT("IN0")
AM_RANGE(0x0014, 0x0015) AM_READ(jackalr_rotary_r)
AM_RANGE(0x0018, 0x0018) AM_READ_PORT("DSW2")
- AM_RANGE(0x0019, 0x0019) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0019, 0x0019) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x001c, 0x001c) AM_WRITE(jackal_rambank_w)
AM_RANGE(0x0020, 0x005f) AM_READWRITE(jackal_zram_r, jackal_zram_w) // MAIN Z RAM,SUB Z RAM
AM_RANGE(0x0060, 0x1fff) AM_RAM AM_SHARE("share1") // M COMMON RAM,S COMMON RAM
@@ -360,6 +361,7 @@ static MACHINE_CONFIG_START( jackal, jackal_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp
index dbde2d5a3c9..b6c9f306dc1 100644
--- a/src/mame/drivers/jaguar.cpp
+++ b/src/mame/drivers/jaguar.cpp
@@ -342,6 +342,7 @@ Notes:
#include "imagedev/snapquik.h"
#include "sound/dac.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/cdda.h"
#include "cdrom.h"
#include "imagedev/chd_cd.h"
@@ -1343,7 +1344,7 @@ static ADDRESS_MAP_START( r3000_map, AS_PROGRAM, 32, jaguar_state )
AM_RANGE(0x06000000, 0x06000003) AM_READWRITE(misc_control_r, misc_control_w)
AM_RANGE(0x10000000, 0x1007ffff) AM_RAM
AM_RANGE(0x12000000, 0x120fffff) AM_RAM // tested in self-test only?
- AM_RANGE(0x14000004, 0x14000007) AM_WRITE(watchdog_reset32_w)
+ AM_RANGE(0x14000004, 0x14000007) AM_DEVWRITE("watchdog", watchdog_timer_device, reset32_w)
AM_RANGE(0x16000000, 0x16000003) AM_WRITE(eeprom_enable_w)
AM_RANGE(0x18000000, 0x18001fff) AM_READWRITE(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram")
AM_RANGE(0x1fc00000, 0x1fdfffff) AM_ROM AM_REGION("maincpu", 0) AM_SHARE("rom")
@@ -1355,7 +1356,7 @@ static ADDRESS_MAP_START( m68020_map, AS_PROGRAM, 32, jaguar_state )
AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION("maincpu", 0) AM_SHARE("rom")
AM_RANGE(0xa00000, 0xa1ffff) AM_RAM
AM_RANGE(0xa20000, 0xa21fff) AM_READWRITE(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram")
- AM_RANGE(0xa30000, 0xa30003) AM_WRITE(watchdog_reset32_w)
+ AM_RANGE(0xa30000, 0xa30003) AM_DEVWRITE("watchdog", watchdog_timer_device, reset32_w)
AM_RANGE(0xa40000, 0xa40003) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xb70000, 0xb70003) AM_READWRITE(misc_control_r, misc_control_w)
AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("mainsndbank")
@@ -1817,6 +1818,8 @@ static MACHINE_CONFIG_START( cojagr3k, jaguar_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_VT83C461_ADD("ide", cojag_devices, "hdd", nullptr, true)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(jaguar_state, external_int))
diff --git a/src/mame/drivers/jailbrek.cpp b/src/mame/drivers/jailbrek.cpp
index db6e358f6f8..5c9d36f2036 100644
--- a/src/mame/drivers/jailbrek.cpp
+++ b/src/mame/drivers/jailbrek.cpp
@@ -88,6 +88,7 @@ Notes:
#include "emu.h"
#include "machine/konami1.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "includes/konamipt.h"
#include "includes/jailbrek.h"
@@ -140,7 +141,7 @@ static ADDRESS_MAP_START( jailbrek_map, AS_PROGRAM, 8, jailbrek_state )
AM_RANGE(0x3000, 0x307f) AM_RAM /* related to sprites? */
AM_RANGE(0x3100, 0x3100) AM_READ_PORT("DSW2") AM_DEVWRITE("snsnd", sn76489a_device, write)
AM_RANGE(0x3200, 0x3200) AM_READ_PORT("DSW3") AM_WRITENOP /* mirror of the previous? */
- AM_RANGE(0x3300, 0x3300) AM_READ_PORT("SYSTEM") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3300, 0x3300) AM_READ_PORT("SYSTEM") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3301, 0x3301) AM_READ_PORT("P1")
AM_RANGE(0x3302, 0x3302) AM_READ_PORT("P2")
AM_RANGE(0x3303, 0x3303) AM_READ_PORT("DSW1")
@@ -251,6 +252,7 @@ static MACHINE_CONFIG_START( jailbrek, jailbrek_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", jailbrek_state, jb_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(jailbrek_state, jb_interrupt_nmi, 500) /* ? */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", jailbrek)
diff --git a/src/mame/drivers/jchan.cpp b/src/mame/drivers/jchan.cpp
index a5eb0ba0699..fa8857ddff3 100644
--- a/src/mame/drivers/jchan.cpp
+++ b/src/mame/drivers/jchan.cpp
@@ -159,6 +159,7 @@ JC-301-00 W11 9510K7059 23C16000 U85
#include "sound/ymz280b.h"
#include "video/sknsspr.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "video/kaneko_tmap.h"
#include "machine/kaneko_toybox.h"
@@ -444,7 +445,7 @@ static ADDRESS_MAP_START( jchan_main, AS_PROGRAM, 16, jchan_state )
AM_RANGE(0xf00000, 0xf00007) AM_READWRITE(ctrl_r, ctrl_w) AM_SHARE("ctrl")
- AM_RANGE(0xf80000, 0xf80001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // watchdog
+ AM_RANGE(0xf80000, 0xf80001) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
ADDRESS_MAP_END
@@ -464,7 +465,7 @@ static ADDRESS_MAP_START( jchan_sub, AS_PROGRAM, 16, jchan_state )
AM_RANGE(0x800000, 0x800003) AM_DEVWRITE8("ymz", ymz280b_device, write, 0x00ff) // sound
- AM_RANGE(0xa00000, 0xa00001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // watchdog
+ AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
ADDRESS_MAP_END
@@ -582,6 +583,8 @@ static MACHINE_CONFIG_START( jchan, jchan_state )
MCFG_CPU_ADD("sub", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(jchan_sub)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", jchan)
diff --git a/src/mame/drivers/jedi.cpp b/src/mame/drivers/jedi.cpp
index 7c20d0d399f..11664bd166a 100644
--- a/src/mame/drivers/jedi.cpp
+++ b/src/mame/drivers/jedi.cpp
@@ -115,6 +115,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/jedi.h"
@@ -270,7 +271,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, jedi_state )
AM_RANGE(0x1c80, 0x1c82) AM_MIRROR(0x0078) AM_READNOP AM_WRITE(a2d_select_w)
AM_RANGE(0x1c83, 0x1c87) AM_MIRROR(0x0078) AM_NOP
AM_RANGE(0x1d00, 0x1d00) AM_MIRROR(0x007f) AM_NOP /* write: NVRAM store */
- AM_RANGE(0x1d80, 0x1d80) AM_MIRROR(0x007f) AM_READNOP AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1d80, 0x1d80) AM_MIRROR(0x007f) AM_READNOP AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1e00, 0x1e00) AM_MIRROR(0x007f) AM_READNOP AM_WRITE(main_irq_ack_w)
AM_RANGE(0x1e80, 0x1e81) AM_MIRROR(0x0078) AM_READNOP AM_WRITE(jedi_coin_counter_w)
AM_RANGE(0x1e82, 0x1e83) AM_MIRROR(0x0078) AM_NOP /* write: LED control - not used */
@@ -342,6 +343,8 @@ static MACHINE_CONFIG_START( jedi, jedi_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_FRAGMENT_ADD(jedi_video)
diff --git a/src/mame/drivers/junofrst.cpp b/src/mame/drivers/junofrst.cpp
index f8a5b55b9d8..498599dd144 100644
--- a/src/mame/drivers/junofrst.cpp
+++ b/src/mame/drivers/junofrst.cpp
@@ -83,6 +83,7 @@ Blitter source graphics
#include "cpu/m6809/m6809.h"
#include "cpu/mcs48/mcs48.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "sound/flt_rc.h"
@@ -293,7 +294,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, junofrst_state )
AM_RANGE(0x0000, 0x7fff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0x8000, 0x800f) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x8010, 0x8010) AM_READ_PORT("DSW2")
- AM_RANGE(0x801c, 0x801c) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x801c, 0x801c) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8020, 0x8020) AM_READ_PORT("SYSTEM")
AM_RANGE(0x8024, 0x8024) AM_READ_PORT("P1")
AM_RANGE(0x8028, 0x8028) AM_READ_PORT("P2")
@@ -420,6 +421,8 @@ static MACHINE_CONFIG_START( junofrst, junofrst_state )
MCFG_CPU_PROGRAM_MAP(mcu_map)
MCFG_CPU_IO_MAP(mcu_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_START_OVERRIDE(junofrst_state,junofrst)
MCFG_MACHINE_RESET_OVERRIDE(junofrst_state,junofrst)
diff --git a/src/mame/drivers/kaneko16.cpp b/src/mame/drivers/kaneko16.cpp
index adfd555bc8e..063e8b7f24b 100644
--- a/src/mame/drivers/kaneko16.cpp
+++ b/src/mame/drivers/kaneko16.cpp
@@ -100,6 +100,7 @@ Non-Bugs (happen on real PCB)
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "includes/kaneko16.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
#include "machine/kaneko_hit.h"
@@ -317,7 +318,7 @@ static ADDRESS_MAP_START( berlwall, AS_PROGRAM, 16, kaneko16_berlwall_state )
AM_RANGE(0x680004, 0x680005) AM_READ_PORT("SYSTEM")
// AM_RANGE(0x680006, 0x680007) AM_READ_PORT("UNK")
AM_RANGE(0x700000, 0x700001) AM_WRITE(kaneko16_coin_lockout_w) // Coin Lockout
- AM_RANGE(0x780000, 0x780001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x780000, 0x780001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x800000, 0x80001f) AM_READWRITE(kaneko16_ay1_YM2149_r, kaneko16_ay1_YM2149_w) // Sound
AM_RANGE(0x800200, 0x80021f) AM_READWRITE(kaneko16_ay2_YM2149_r, kaneko16_ay2_YM2149_w)
AM_RANGE(0x8003fe, 0x8003ff) AM_NOP // for OKI when accessed as .l
@@ -357,7 +358,7 @@ static ADDRESS_MAP_START( bakubrkr, AS_PROGRAM, 16, kaneko16_state )
AM_RANGE(0x700000, 0x700fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE("view2_0", kaneko_view2_tilemap_device, kaneko_tmap_regs_r, kaneko_tmap_regs_w)
AM_RANGE(0x900000, 0x90001f) AM_DEVREADWRITE("kan_spr", kaneko16_sprite_device, kaneko16_sprites_regs_r, kaneko16_sprites_regs_w)
- AM_RANGE(0xa80000, 0xa80001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0xa80000, 0xa80001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0xb00000, 0xb0001f) AM_DEVREADWRITE("view2_1", kaneko_view2_tilemap_device, kaneko_tmap_regs_r, kaneko_tmap_regs_w)
AM_RANGE(0xd00000, 0xd00001) AM_WRITE(kaneko16_eeprom_w) // EEPROM
AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("P1")
@@ -443,7 +444,7 @@ static ADDRESS_MAP_START( bloodwar, AS_PROGRAM, 16, kaneko16_gtmr_state )
AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x880000, 0x880001) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x900000, 0x900039) AM_DEVREADWRITE("kan_hit", kaneko_hit_device, kaneko_hit_r,kaneko_hit_w)
- AM_RANGE(0xa00000, 0xa00001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // Watchdog
+ AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1")
AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2")
AM_RANGE(0xb00004, 0xb00005) AM_READ_PORT("SYSTEM")
@@ -497,7 +498,7 @@ static ADDRESS_MAP_START( bonkadv, AS_PROGRAM, 16, kaneko16_gtmr_state )
AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x880000, 0x880001) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x900000, 0x900015) AM_DEVREADWRITE("kan_hit", kaneko_hit_device, kaneko_hit_r,kaneko_hit_w)
- AM_RANGE(0xa00000, 0xa00001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // Watchdog
+ AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w) // Watchdog
AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1")
AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2")
AM_RANGE(0xb00004, 0xb00005) AM_READ_PORT("SYSTEM")
@@ -575,7 +576,7 @@ static ADDRESS_MAP_START( gtmr_map, AS_PROGRAM, 16, kaneko16_gtmr_state )
AM_RANGE(0x880000, 0x880001) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x900000, 0x900039) AM_DEVREADWRITE("kan_hit", kaneko_hit_device, kaneko_hit_r,kaneko_hit_w) // only used for random number
- AM_RANGE(0xa00000, 0xa00001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // Watchdog
+ AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1")
AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2")
@@ -642,7 +643,7 @@ static ADDRESS_MAP_START( gtmr2_map, AS_PROGRAM, 16, kaneko16_gtmr_state )
AM_RANGE(0x880000, 0x880001) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x900000, 0x900039) AM_DEVREADWRITE("kan_hit", kaneko_hit_device, kaneko_hit_r,kaneko_hit_w) // only used for random number
- AM_RANGE(0xa00000, 0xa00001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // Watchdog
+ AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w) // Watchdog
AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1")
// AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2")
@@ -675,7 +676,7 @@ static ADDRESS_MAP_START( mgcrystl, AS_PROGRAM, 16, kaneko16_state )
AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE("view2_0", kaneko_view2_tilemap_device, kaneko_tmap_regs_r, kaneko_tmap_regs_w)
AM_RANGE(0x900000, 0x90001f) AM_DEVREADWRITE("kan_spr", kaneko16_sprite_device, kaneko16_sprites_regs_r, kaneko16_sprites_regs_w)
AM_RANGE(0xb00000, 0xb0001f) AM_DEVREADWRITE("view2_1", kaneko_view2_tilemap_device, kaneko_tmap_regs_r, kaneko_tmap_regs_w)
- AM_RANGE(0xa00000, 0xa00001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0xa00000, 0xa00001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog
AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("DSW_P1")
AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("P2")
AM_RANGE(0xc00004, 0xc00005) AM_READ_PORT("SYSTEM")
@@ -738,7 +739,7 @@ static ADDRESS_MAP_START( shogwarr, AS_PROGRAM, 16, kaneko16_shogwarr_state )
AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE("view2_0", kaneko_view2_tilemap_device, kaneko_tmap_regs_r, kaneko_tmap_regs_w)
AM_RANGE(0x900000, 0x90001f) AM_DEVREADWRITE("kan_spr", kaneko16_sprite_device, kaneko16_sprites_regs_r, kaneko16_sprites_regs_w)
AM_RANGE(0xa00000, 0xa0007f) AM_DEVREADWRITE("kan_hit", kaneko_hit_device, kaneko_hit_r,kaneko_hit_w)
- AM_RANGE(0xa80000, 0xa80001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // Watchdog
+ AM_RANGE(0xa80000, 0xa80001) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0xb80000, 0xb80001) AM_READ_PORT("P1")
AM_RANGE(0xb80002, 0xb80003) AM_READ_PORT("P2")
AM_RANGE(0xb80004, 0xb80005) AM_READ_PORT("SYSTEM")
@@ -1866,6 +1867,8 @@ static MACHINE_CONFIG_START( berlwall, kaneko16_berlwall_state )
MCFG_CPU_PROGRAM_MAP(berlwall)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
// MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) // mangled sprites otherwise
@@ -1926,6 +1929,8 @@ static MACHINE_CONFIG_START( bakubrkr, kaneko16_state )
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_state,gtmr)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) // mangled sprites otherwise
@@ -2116,6 +2121,8 @@ static MACHINE_CONFIG_START( gtmr, kaneko16_gtmr_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2236,6 +2243,8 @@ static MACHINE_CONFIG_START( mgcrystl, kaneko16_state )
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_state,mgcrystl)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2365,6 +2374,8 @@ static MACHINE_CONFIG_START( shogwarr, kaneko16_shogwarr_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
MCFG_EEPROM_SERIAL_DATA(shogwarr_default_eeprom, 128)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.1854)
diff --git a/src/mame/drivers/klax.cpp b/src/mame/drivers/klax.cpp
index 527d86b2525..6440e144daf 100644
--- a/src/mame/drivers/klax.cpp
+++ b/src/mame/drivers/klax.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "includes/klax.h"
@@ -82,7 +83,7 @@ static ADDRESS_MAP_START( klax_map, AS_PROGRAM, 16, klax_state )
AM_RANGE(0x260000, 0x260001) AM_READ_PORT("P1") AM_WRITE(klax_latch_w)
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("P2")
AM_RANGE(0x270000, 0x270001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
- AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2e0000, 0x2e0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(interrupt_ack_w)
AM_RANGE(0x3e0000, 0x3e07ff) AM_DEVREADWRITE8("palette", palette_device, read, write, 0xff00) AM_SHARE("palette")
AM_RANGE(0x3f0000, 0x3f0f7f) AM_RAM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
@@ -99,7 +100,7 @@ static ADDRESS_MAP_START( klax2bl_map, AS_PROGRAM, 16, klax_state )
AM_RANGE(0x260000, 0x260001) AM_READ_PORT("P1") AM_WRITE(klax_latch_w)
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("P2")
// AM_RANGE(0x270000, 0x270001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // no OKI here
- AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2e0000, 0x2e0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(interrupt_ack_w)
AM_RANGE(0x3e0000, 0x3e07ff) AM_DEVREADWRITE8("palette", palette_device, read, write, 0xff00) AM_SHARE("palette")
AM_RANGE(0x3f0000, 0x3f0f7f) AM_RAM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
@@ -198,6 +199,8 @@ static MACHINE_CONFIG_START( klax, klax_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", klax)
MCFG_PALETTE_ADD("palette", 512)
diff --git a/src/mame/drivers/kyugo.cpp b/src/mame/drivers/kyugo.cpp
index 21c80927bfd..de6c30e318f 100644
--- a/src/mame/drivers/kyugo.cpp
+++ b/src/mame/drivers/kyugo.cpp
@@ -25,6 +25,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/kyugo.h"
@@ -48,6 +49,11 @@ static ADDRESS_MAP_START( kyugo_main_map, AS_PROGRAM, 8, kyugo_state )
AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("shared_ram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( gyrodine_main_map, AS_PROGRAM, 8, kyugo_state )
+ AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
+ AM_IMPORT_FROM(kyugo_main_map)
+ADDRESS_MAP_END
+
/*************************************
@@ -75,6 +81,7 @@ ADDRESS_MAP_END
+
/*************************************
*
* Sub CPU memory handlers
@@ -508,7 +515,7 @@ INTERRUPT_GEN_MEMBER(kyugo_state::vblank_irq)
}
-static MACHINE_CONFIG_START( gyrodine, kyugo_state )
+static MACHINE_CONFIG_START( kyugo_base, kyugo_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) /* verified on pcb */
@@ -548,7 +555,14 @@ static MACHINE_CONFIG_START( gyrodine, kyugo_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( repulse, gyrodine )
+static MACHINE_CONFIG_DERIVED( gyrodine, kyugo_base )
+ /* add watchdog */
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(gyrodine_main_map)
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( repulse, kyugo_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("sub")
@@ -556,7 +570,7 @@ static MACHINE_CONFIG_DERIVED( repulse, gyrodine )
MCFG_CPU_IO_MAP(repulse_sub_portmap)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( srdmissn, gyrodine )
+static MACHINE_CONFIG_DERIVED( srdmissn, kyugo_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("sub")
@@ -564,7 +578,7 @@ static MACHINE_CONFIG_DERIVED( srdmissn, gyrodine )
MCFG_CPU_IO_MAP(srdmissn_sub_portmap)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( flashgala, gyrodine )
+static MACHINE_CONFIG_DERIVED( flashgala, kyugo_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("sub")
@@ -572,7 +586,7 @@ static MACHINE_CONFIG_DERIVED( flashgala, gyrodine )
MCFG_CPU_IO_MAP(flashgala_sub_portmap)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( legend, gyrodine )
+static MACHINE_CONFIG_DERIVED( legend, kyugo_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("sub")
@@ -1342,12 +1356,6 @@ ROM_END
*
*************************************/
-DRIVER_INIT_MEMBER(kyugo_state,gyrodine)
-{
- /* add watchdog */
- m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000, 0xe000, write8_delegate(FUNC(kyugo_state::watchdog_reset_w),this));
-}
-
DRIVER_INIT_MEMBER(kyugo_state,srdmissn)
{
@@ -1366,9 +1374,9 @@ DRIVER_INIT_MEMBER(kyugo_state,srdmissn)
*
*************************************/
-GAME( 1984, gyrodine, 0, gyrodine, gyrodine, kyugo_state, gyrodine, ROT90, "Crux", "Gyrodine", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, gyrodinet, gyrodine, gyrodine, gyrodine, kyugo_state, gyrodine, ROT90, "Crux (Taito Corporation license)", "Gyrodine (Taito Corporation license)", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, buzzard, gyrodine, gyrodine, gyrodine, kyugo_state, gyrodine, ROT90, "Crux", "Buzzard", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, gyrodine, 0, gyrodine, gyrodine, driver_device, 0, ROT90, "Crux", "Gyrodine", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, gyrodinet, gyrodine, gyrodine, gyrodine, driver_device, 0, ROT90, "Crux (Taito Corporation license)", "Gyrodine (Taito Corporation license)", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, buzzard, gyrodine, gyrodine, gyrodine, driver_device, 0, ROT90, "Crux", "Buzzard", MACHINE_SUPPORTS_SAVE )
GAME( 1985, repulse, 0, repulse, repulse, driver_device, 0, ROT90, "Crux / Sega", "Repulse", MACHINE_SUPPORTS_SAVE )
GAME( 1985, 99lstwar, repulse, repulse, repulse, driver_device, 0, ROT90, "Crux / Proma", "'99: The Last War (set 1)", MACHINE_SUPPORTS_SAVE ) // Crux went bankrupt during Repulse development,
GAME( 1985, 99lstwara, repulse, repulse, repulse, driver_device, 0, ROT90, "Crux / Proma", "'99: The Last War (set 2)", MACHINE_SUPPORTS_SAVE ) // some of their staff later worked on the newer games on this hardware,
diff --git a/src/mame/drivers/labyrunr.cpp b/src/mame/drivers/labyrunr.cpp
index e8f0957d10f..948d851040e 100644
--- a/src/mame/drivers/labyrunr.cpp
+++ b/src/mame/drivers/labyrunr.cpp
@@ -12,6 +12,7 @@
#include "emu.h"
#include "cpu/m6809/hd6309.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/konamipt.h"
@@ -57,7 +58,7 @@ static ADDRESS_MAP_START( labyrunr_map, AS_PROGRAM, 8, labyrunr_state )
AM_RANGE(0x0b00, 0x0b00) AM_READ_PORT("SYSTEM")
AM_RANGE(0x0c00, 0x0c00) AM_WRITE(labyrunr_bankswitch_w)
AM_RANGE(0x0d00, 0x0d1f) AM_DEVREADWRITE("k051733", k051733_device, read, write)
- AM_RANGE(0x0e00, 0x0e00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1000, 0x10ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
AM_RANGE(0x1800, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2fff) AM_RAM AM_SHARE("spriteram")
@@ -170,6 +171,7 @@ static MACHINE_CONFIG_START( labyrunr, labyrunr_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", labyrunr_state, labyrunr_vblank_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(labyrunr_state, labyrunr_timer_interrupt, 4*60)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/liberatr.cpp b/src/mame/drivers/liberatr.cpp
index b6c46aea717..121050b3bd9 100644
--- a/src/mame/drivers/liberatr.cpp
+++ b/src/mame/drivers/liberatr.cpp
@@ -277,7 +277,7 @@ static ADDRESS_MAP_START( liberatr_map, AS_PROGRAM, 8, liberatr_state )
AM_RANGE(0x6400, 0x6400) AM_WRITENOP
AM_RANGE(0x6600, 0x6600) AM_WRITE(earom_control_w)
AM_RANGE(0x6800, 0x6800) AM_WRITEONLY AM_SHARE("planet_frame")
- AM_RANGE(0x6a00, 0x6a00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x6a00, 0x6a00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x6c00, 0x6c01) AM_WRITE(led_w)
AM_RANGE(0x6c04, 0x6c04) AM_WRITE(trackball_reset_w)
AM_RANGE(0x6c05, 0x6c06) AM_WRITE(coin_counter_w)
@@ -310,7 +310,7 @@ static ADDRESS_MAP_START( liberat2_map, AS_PROGRAM, 8, liberatr_state )
AM_RANGE(0x4600, 0x4600) AM_WRITE(earom_control_w)
AM_RANGE(0x4800, 0x483f) AM_READ(earom_r)
AM_RANGE(0x4800, 0x4800) AM_WRITEONLY AM_SHARE("planet_frame")
- AM_RANGE(0x4a00, 0x4a00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x4a00, 0x4a00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x4c00, 0x4c01) AM_WRITE(led_w)
AM_RANGE(0x4c04, 0x4c04) AM_WRITE(trackball_reset_w)
AM_RANGE(0x4c05, 0x4c06) AM_WRITE(coin_counter_w)
@@ -423,6 +423,8 @@ static MACHINE_CONFIG_START( liberatr, liberatr_state )
MCFG_ER2055_ADD("earom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/lockon.cpp b/src/mame/drivers/lockon.cpp
index 4943e440c86..75e97a43ec1 100644
--- a/src/mame/drivers/lockon.cpp
+++ b/src/mame/drivers/lockon.cpp
@@ -133,7 +133,7 @@ WRITE16_MEMBER(lockon_state::inten_w)
WRITE16_MEMBER(lockon_state::emres_w)
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
m_main_inten = 0;
}
@@ -492,6 +492,7 @@ static MACHINE_CONFIG_START( lockon, lockon_state )
MCFG_CPU_PROGRAM_MAP(sound_prg)
MCFG_CPU_IO_MAP(sound_io)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_ASTABLE(10000, 4700, 10000e-12) * 4096)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp
index 5be0687f956..c7ec5bfc4ba 100644
--- a/src/mame/drivers/looping.cpp
+++ b/src/mame/drivers/looping.cpp
@@ -57,6 +57,7 @@ L056-6 9A " " VLI-8-4 7A "
#include "emu.h"
#include "cpu/tms9900/tms9995.h"
#include "cpu/tms9900/tms9980a.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "sound/tms5220.h"
@@ -557,7 +558,7 @@ static ADDRESS_MAP_START( looping_io_map, AS_IO, 8, looping_state )
/* 404 = C0 */
/* 405 = C1 */
AM_RANGE(0x406, 0x406) AM_WRITE(main_irq_ack_w)
- AM_RANGE(0x407, 0x407) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x407, 0x407) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x10000, 0x10000) AM_NOP /* external IDLE signal -- we can ignore it */
ADDRESS_MAP_END
@@ -633,6 +634,8 @@ static MACHINE_CONFIG_START( looping, looping_state )
MCFG_COP400_READ_IN_CB(READ8(looping_state, cop_unk_r))
MCFG_COP400_READ_SI_CB(READLINE(looping_state, cop_serial_r))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
diff --git a/src/mame/drivers/lwings.cpp b/src/mame/drivers/lwings.cpp
index 7a7e735f681..edee2b3a8d3 100644
--- a/src/mame/drivers/lwings.cpp
+++ b/src/mame/drivers/lwings.cpp
@@ -51,9 +51,10 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
-#include "includes/lwings.h"
#include "sound/okim6295.h"
+#include "includes/lwings.h"
/* Avengers runs on hardware almost identical to Trojan, but with a protection
* device and some small changes to the memory map and videohardware.
@@ -322,7 +323,7 @@ static ADDRESS_MAP_START( lwings_map, AS_PROGRAM, 8, lwings_state )
AM_RANGE(0xf80b, 0xf80b) AM_READ_PORT("DSWA")
AM_RANGE(0xf80a, 0xf80b) AM_WRITE(lwings_bg1_scrolly_w)
AM_RANGE(0xf80c, 0xf80c) AM_READ_PORT("DSWB") AM_WRITE(soundlatch_byte_w)
- AM_RANGE(0xf80d, 0xf80d) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xf80d, 0xf80d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xf80e, 0xf80e) AM_WRITE(lwings_bankswitch_w)
ADDRESS_MAP_END
@@ -379,7 +380,7 @@ static ADDRESS_MAP_START( fball_map, AS_PROGRAM, 8, lwings_state )
AM_RANGE(0xf80b, 0xf80b) AM_READ_PORT("DSWA")
AM_RANGE(0xf80a, 0xf80b) AM_WRITE(lwings_bg1_scrolly_w)
AM_RANGE(0xf80c, 0xf80c) AM_WRITE(soundlatch_byte_w)
- AM_RANGE(0xf80d, 0xf80d) AM_READ_PORT("P3") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xf80d, 0xf80d) AM_READ_PORT("P3") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xf80e, 0xf80e) AM_READ_PORT("P4")
AM_RANGE(0xf80e, 0xf80e) AM_WRITE(lwings_bankswitch_w)
@@ -923,6 +924,8 @@ static MACHINE_CONFIG_START( lwings, lwings_state )
MCFG_CPU_PROGRAM_MAP(lwings_sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(lwings_state, irq0_line_hold, 222) // approximation from pcb music recording - where is the frequency actually derived from??
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
@@ -975,6 +978,8 @@ static MACHINE_CONFIG_START( fball, lwings_state )
MCFG_CPU_PROGRAM_MAP(fball_sound_map)
// MCFG_CPU_PERIODIC_INT_DRIVER(lwings_state, irq0_line_hold, 222)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
diff --git a/src/mame/drivers/mappy.cpp b/src/mame/drivers/mappy.cpp
index 0c82f9affba..784d951bca5 100644
--- a/src/mame/drivers/mappy.cpp
+++ b/src/mame/drivers/mappy.cpp
@@ -550,6 +550,7 @@ TODO:
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "includes/mappy.h"
@@ -960,7 +961,7 @@ static ADDRESS_MAP_START( superpac_cpu1_map, AS_PROGRAM, 8, mappy_state )
AM_RANGE(0x4800, 0x480f) AM_DEVREADWRITE("namcoio_1", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x4810, 0x481f) AM_DEVREADWRITE("namcoio_2", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x5000, 0x500f) AM_WRITE(superpac_latch_w) /* various control bits */
- AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xa000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -971,7 +972,7 @@ static ADDRESS_MAP_START( phozon_cpu1_map, AS_PROGRAM, 8, mappy_state )
AM_RANGE(0x4800, 0x480f) AM_DEVREADWRITE("namcoio_1", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x4810, 0x481f) AM_DEVREADWRITE("namcoio_2", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x5000, 0x500f) AM_WRITE(phozon_latch_w) /* various control bits */
- AM_RANGE(0x7000, 0x7000) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x7000, 0x7000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
@@ -983,7 +984,7 @@ static ADDRESS_MAP_START( mappy_cpu1_map, AS_PROGRAM, 8, mappy_state )
AM_RANGE(0x4800, 0x480f) AM_DEVREADWRITE("namcoio_1", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x4810, 0x481f) AM_DEVREADWRITE("namcoio_2", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x5000, 0x500f) AM_WRITE(mappy_latch_w) /* various control bits */
- AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM code (only a000-ffff in Mappy) */
ADDRESS_MAP_END
@@ -1673,7 +1674,8 @@ static MACHINE_CONFIG_FRAGMENT( superpac_common )
MCFG_CPU_PROGRAM_MAP(superpac_cpu2_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mappy_state, sub_vblank_irq)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
@@ -1784,7 +1786,8 @@ static MACHINE_CONFIG_START( phozon, mappy_state )
MCFG_CPU_PROGRAM_MAP(phozon_cpu3_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mappy_state, sub2_vblank_irq)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
MCFG_MACHINE_START_OVERRIDE(mappy_state,mappy)
@@ -1836,7 +1839,8 @@ static MACHINE_CONFIG_FRAGMENT( mappy_common )
MCFG_CPU_PROGRAM_MAP(mappy_cpu2_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mappy_state, sub_vblank_irq)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
MCFG_MACHINE_START_OVERRIDE(mappy_state,mappy)
@@ -1888,7 +1892,8 @@ static MACHINE_CONFIG_START( digdug2, mappy_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_VBLANK_INT_DRIVER("screen", mappy_state, digdug2_main_vblank_irq) // also update the custom I/O chips
- MCFG_WATCHDOG_VBLANK_INIT(0)
+ MCFG_WATCHDOG_MODIFY("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 0)
MCFG_DEVICE_ADD("namcoio_1", NAMCO58XX, 0)
MCFG_NAMCO58XX_IN_0_CB(IOPORT("COINS"))
diff --git a/src/mame/drivers/mcatadv.cpp b/src/mame/drivers/mcatadv.cpp
index 74b00d9738e..7e07057a7c2 100644
--- a/src/mame/drivers/mcatadv.cpp
+++ b/src/mame/drivers/mcatadv.cpp
@@ -167,7 +167,7 @@ WRITE16_MEMBER(mcatadv_state::mcat_coin_w)
READ16_MEMBER(mcatadv_state::mcat_wd_r)
{
- watchdog_reset_r(space, 0);
+ m_watchdog->reset_r(space, 0);
return 0xc00;
}
@@ -198,7 +198,7 @@ static ADDRESS_MAP_START( mcatadv_map, AS_PROGRAM, 16, mcatadv_state )
AM_RANGE(0xb00000, 0xb0000f) AM_RAM AM_SHARE("vidregs")
- AM_RANGE(0xb00018, 0xb00019) AM_WRITE(watchdog_reset16_w) // NOST Only
+ AM_RANGE(0xb00018, 0xb00019) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // NOST Only
AM_RANGE(0xb0001e, 0xb0001f) AM_READ(mcat_wd_r) // MCAT Only
AM_RANGE(0xc00000, 0xc00001) AM_READ(soundlatch2_word_r) AM_WRITE(mcat_soundlatch_w)
ADDRESS_MAP_END
@@ -458,6 +458,7 @@ static MACHINE_CONFIG_START( mcatadv, mcatadv_state )
MCFG_PALETTE_ADD("palette", 0x2000/2)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
diff --git a/src/mame/drivers/mcr.cpp b/src/mame/drivers/mcr.cpp
index 2db2016653d..1080f96513f 100644
--- a/src/mame/drivers/mcr.cpp
+++ b/src/mame/drivers/mcr.cpp
@@ -718,7 +718,7 @@ static ADDRESS_MAP_START( cpu_90009_portmap, AS_IO, 8, mcr_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
SSIO_INPUT_PORTS("ssio")
- AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xe0, 0xe0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xe8, 0xe8) AM_WRITENOP
AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
ADDRESS_MAP_END
@@ -745,7 +745,7 @@ static ADDRESS_MAP_START( cpu_90010_portmap, AS_IO, 8, mcr_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
SSIO_INPUT_PORTS("ssio")
- AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xe0, 0xe0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xe8, 0xe8) AM_WRITENOP
AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
ADDRESS_MAP_END
@@ -773,7 +773,7 @@ static ADDRESS_MAP_START( cpu_91490_portmap, AS_IO, 8, mcr_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
SSIO_INPUT_PORTS("ssio")
- AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xe0, 0xe0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xe8, 0xe8) AM_WRITENOP
AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
ADDRESS_MAP_END
@@ -1766,7 +1766,9 @@ static MACHINE_CONFIG_START( mcr_90009, mcr_state )
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MCFG_Z80CTC_ZC0_CB(DEVWRITELINE("ctc", z80ctc_device, trg1))
- MCFG_WATCHDOG_VBLANK_INIT(16)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 16)
+
MCFG_MACHINE_START_OVERRIDE(mcr_state,mcr)
MCFG_MACHINE_RESET_OVERRIDE(mcr_state,mcr)
MCFG_NVRAM_ADD_1FILL("nvram")
diff --git a/src/mame/drivers/mcr3.cpp b/src/mame/drivers/mcr3.cpp
index 5a7d07c6909..f0c4804d4f6 100644
--- a/src/mame/drivers/mcr3.cpp
+++ b/src/mame/drivers/mcr3.cpp
@@ -500,7 +500,7 @@ static ADDRESS_MAP_START( mcrmono_portmap, AS_IO, 8, mcr3_state )
AM_RANGE(0x03, 0x03) AM_MIRROR(0x78) AM_READ_PORT("MONO.IP3")
AM_RANGE(0x04, 0x04) AM_MIRROR(0x78) AM_READ_PORT("MONO.IP4")
AM_RANGE(0x05, 0x05) AM_MIRROR(0x78) AM_WRITE(mcrmono_control_port_w)
- AM_RANGE(0x07, 0x07) AM_MIRROR(0x78) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x07, 0x07) AM_MIRROR(0x78) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xf0, 0xf3) AM_MIRROR(0x0c) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
ADDRESS_MAP_END
@@ -529,7 +529,7 @@ static ADDRESS_MAP_START( spyhunt_portmap, AS_IO, 8, mcr3_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
SSIO_INPUT_PORTS("ssio")
AM_RANGE(0x84, 0x86) AM_WRITE(spyhunt_scroll_value_w)
- AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xe0, 0xe0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xe8, 0xe8) AM_WRITENOP
AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
ADDRESS_MAP_END
@@ -1092,7 +1092,9 @@ static MACHINE_CONFIG_START( mcrmono, mcr3_state )
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MCFG_Z80CTC_ZC0_CB(DEVWRITELINE("ctc", z80ctc_device, trg1))
- MCFG_WATCHDOG_VBLANK_INIT(16)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 16)
+
MCFG_MACHINE_START_OVERRIDE(mcr3_state,mcr)
MCFG_MACHINE_RESET_OVERRIDE(mcr3_state,mcr)
MCFG_NVRAM_ADD_0FILL("nvram")
diff --git a/src/mame/drivers/mcr68.cpp b/src/mame/drivers/mcr68.cpp
index f986a076dd3..6c321f892cb 100644
--- a/src/mame/drivers/mcr68.cpp
+++ b/src/mame/drivers/mcr68.cpp
@@ -58,7 +58,6 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "machine/nvram.h"
-#include "includes/mcr.h"
#include "includes/mcr68.h"
@@ -310,7 +309,7 @@ static ADDRESS_MAP_START( mcr68_map, AS_PROGRAM, 16, mcr68_state )
AM_RANGE(0x080000, 0x080fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x090000, 0x09007f) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x0a0000, 0x0a000f) AM_READWRITE(mcr68_6840_upper_r, mcr68_6840_upper_w)
- AM_RANGE(0x0b0000, 0x0bffff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0b0000, 0x0bffff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0d0000, 0x0dffff) AM_READ_PORT("IN0")
AM_RANGE(0x0e0000, 0x0effff) AM_READ_PORT("IN1")
AM_RANGE(0x0f0000, 0x0fffff) AM_READ_PORT("DSW")
@@ -353,7 +352,7 @@ static ADDRESS_MAP_START( pigskin_map, AS_PROGRAM, 16, mcr68_state )
AM_RANGE(0x080000, 0x08ffff) AM_READ(pigskin_port_1_r)
AM_RANGE(0x0a0000, 0x0affff) AM_READ(pigskin_port_2_r)
AM_RANGE(0x0c0000, 0x0c007f) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x0e0000, 0x0effff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0e0000, 0x0effff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(mcr68_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x120000, 0x120001) AM_READWRITE(pigskin_protection_r, pigskin_protection_w)
AM_RANGE(0x140000, 0x143fff) AM_RAM
@@ -383,7 +382,7 @@ static ADDRESS_MAP_START( trisport_map, AS_PROGRAM, 16, mcr68_state )
AM_RANGE(0x160000, 0x160fff) AM_RAM_WRITE(mcr68_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x180000, 0x18000f) AM_READWRITE(mcr68_6840_upper_r, mcr68_6840_upper_w)
AM_RANGE(0x1a0000, 0x1affff) AM_WRITE(archrivl_control_w)
- AM_RANGE(0x1c0000, 0x1cffff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x1c0000, 0x1cffff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x1e0000, 0x1effff) AM_READ_PORT("IN0")
ADDRESS_MAP_END
@@ -1023,7 +1022,8 @@ static MACHINE_CONFIG_START( zwackery, mcr68_state )
MCFG_CPU_PROGRAM_MAP(zwackery_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mcr68_state, mcr68_interrupt)
-// MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+// MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_MACHINE_START_OVERRIDE(mcr68_state,zwackery)
MCFG_MACHINE_RESET_OVERRIDE(mcr68_state,zwackery)
@@ -1072,7 +1072,8 @@ static MACHINE_CONFIG_START( mcr68, mcr68_state )
MCFG_CPU_PROGRAM_MAP(mcr68_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mcr68_state, mcr68_interrupt)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
MCFG_MACHINE_START_OVERRIDE(mcr68_state,mcr68)
MCFG_MACHINE_RESET_OVERRIDE(mcr68_state,mcr68)
@@ -1109,7 +1110,8 @@ static MACHINE_CONFIG_DERIVED( intlaser, mcr68 )
MCFG_MIDWAY_SOUNDS_GOOD_ADD("sg")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_WATCHDOG_VBLANK_INIT(800)
+ MCFG_WATCHDOG_MODIFY("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 800)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp
index 52422a8a860..f21dcc38daf 100644
--- a/src/mame/drivers/megazone.cpp
+++ b/src/mame/drivers/megazone.cpp
@@ -13,6 +13,7 @@ To enter service mode, keep 1&2 pressed on reset
#include "cpu/m6809/m6809.h"
#include "cpu/mcs48/mcs48.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "sound/flt_rc.h"
@@ -84,7 +85,7 @@ static ADDRESS_MAP_START( megazone_map, AS_PROGRAM, 8, megazone_state )
AM_RANGE(0x0000, 0x0001) AM_WRITE(megazone_coin_counter_w) /* coin counter 2, coin counter 1 */
AM_RANGE(0x0005, 0x0005) AM_WRITE(megazone_flipscreen_w)
AM_RANGE(0x0007, 0x0007) AM_WRITE(irq_mask_w)
- AM_RANGE(0x0800, 0x0800) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1000, 0x1000) AM_WRITEONLY AM_SHARE("scrolly")
AM_RANGE(0x1800, 0x1800) AM_WRITEONLY AM_SHARE("scrollx")
AM_RANGE(0x2000, 0x23ff) AM_RAM AM_SHARE("videoram")
@@ -107,7 +108,7 @@ static ADDRESS_MAP_START( megazone_sound_map, AS_PROGRAM, 8, megazone_state )
AM_RANGE(0x8001, 0x8001) AM_READ_PORT("DSW1")
AM_RANGE(0xa000, 0xa000) AM_WRITENOP /* INTMAIN - Interrupts main CPU (unused) */
AM_RANGE(0xc000, 0xc000) AM_WRITENOP /* INT (Actually is NMI) enable/disable (unused)*/
- AM_RANGE(0xc001, 0xc001) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc001, 0xc001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1")
ADDRESS_MAP_END
@@ -249,6 +250,8 @@ static MACHINE_CONFIG_START( megazone, megazone_state )
MCFG_QUANTUM_TIME(attotime::from_hz(900))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/meritm.cpp b/src/mame/drivers/meritm.cpp
index d1d4ce7c222..cdc8d4e7d10 100644
--- a/src/mame/drivers/meritm.cpp
+++ b/src/mame/drivers/meritm.cpp
@@ -182,6 +182,7 @@ Not all regional versions are available for each Megatouch series
#include "machine/ins8250.h"
#include "machine/microtch.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
class meritm_state : public driver_device
@@ -570,7 +571,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( meritm_io_map, AS_IO, 8, meritm_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(meritm_psd_a15_w)
- AM_RANGE(0x01, 0x01) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("v9938_0", v9938_device, read, write)
AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("v9938_1", v9938_device, read, write)
AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
@@ -1157,6 +1158,7 @@ static MACHINE_CONFIG_DERIVED( meritm_crt260, meritm_crt250 )
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
MCFG_I8255_IN_PORTC_CB(READ8(meritm_state, meritm_8255_port_c_r))
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) // DS1232, TD connected to VCC
MCFG_MACHINE_START_OVERRIDE(meritm_state,meritm_crt260)
diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp
index bfeeff6e742..8c1981adcee 100644
--- a/src/mame/drivers/metro.cpp
+++ b/src/mame/drivers/metro.cpp
@@ -106,6 +106,7 @@ driver modified by Hau
#include "cpu/h8/h83006.h"
#include "includes/metro.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "sound/2413intf.h"
#include "sound/2610intf.h"
@@ -1242,7 +1243,7 @@ static ADDRESS_MAP_START( gakusai_map, AS_PROGRAM, 16, metro_state )
AM_RANGE(0x278820, 0x27882f) AM_WRITEONLY AM_SHARE("irq_vectors") // IRQ Vectors
AM_RANGE(0x278830, 0x278831) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable
AM_RANGE(0x278832, 0x278833) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge
- AM_RANGE(0x278836, 0x278837) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x278836, 0x278837) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x278840, 0x27884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter
AM_RANGE(0x278850, 0x27885b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs
AM_RANGE(0x278860, 0x27886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window
@@ -1281,7 +1282,7 @@ static ADDRESS_MAP_START( gakusai2_map, AS_PROGRAM, 16, metro_state )
AM_RANGE(0x678820, 0x67882f) AM_WRITEONLY AM_SHARE("irq_vectors") // IRQ Vectors
AM_RANGE(0x678830, 0x678831) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable
AM_RANGE(0x678832, 0x678833) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge
- AM_RANGE(0x678836, 0x678837) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x678836, 0x678837) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x678840, 0x67884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter
AM_RANGE(0x678850, 0x67885b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs
AM_RANGE(0x678860, 0x67886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window
@@ -1350,7 +1351,7 @@ static ADDRESS_MAP_START( dokyusp_map, AS_PROGRAM, 16, metro_state )
AM_RANGE(0x278820, 0x27882f) AM_WRITEONLY AM_SHARE("irq_vectors") // IRQ Vectors
AM_RANGE(0x278830, 0x278831) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable
AM_RANGE(0x278832, 0x278833) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge
- AM_RANGE(0x278836, 0x278837) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x278836, 0x278837) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x278840, 0x27884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter
AM_RANGE(0x278850, 0x27885b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs
AM_RANGE(0x278860, 0x27886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window
@@ -1676,7 +1677,7 @@ static ADDRESS_MAP_START( mouja_map, AS_PROGRAM, 16, metro_state )
AM_RANGE(0x478830, 0x478831) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable
AM_RANGE(0x478832, 0x478833) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge
AM_RANGE(0x478834, 0x478835) AM_WRITE(mouja_irq_timer_ctrl_w) // IRQ set timer count
- AM_RANGE(0x478836, 0x478837) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x478836, 0x478837) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x478850, 0x47885b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs
AM_RANGE(0x478860, 0x47886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window
AM_RANGE(0x478880, 0x478881) AM_READ_PORT("IN0") // Inputs
@@ -3969,6 +3970,8 @@ static MACHINE_CONFIG_START( dokyusp, metro_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -4006,6 +4009,8 @@ static MACHINE_CONFIG_START( gakusai, metro_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -4043,6 +4048,8 @@ static MACHINE_CONFIG_START( gakusai2, metro_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -4279,6 +4286,8 @@ static MACHINE_CONFIG_START( mouja, metro_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", metro_state, metro_vblank_interrupt)
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(metro_state,metro_irq_callback)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
diff --git a/src/mame/drivers/mhavoc.cpp b/src/mame/drivers/mhavoc.cpp
index d9e7cde80a4..e60d95402ce 100644
--- a/src/mame/drivers/mhavoc.cpp
+++ b/src/mame/drivers/mhavoc.cpp
@@ -193,6 +193,7 @@
#include "sound/tms5220.h"
#include "sound/pokey.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/mhavoc.h"
/* Quad pokey hookup (based on schematics):
@@ -282,7 +283,7 @@ static ADDRESS_MAP_START( alpha_map, AS_PROGRAM, 8, mhavoc_state )
AM_RANGE(0x1400, 0x141f) AM_RAM AM_SHARE("colorram") /* ColorRAM */
AM_RANGE(0x1600, 0x1600) AM_WRITE(mhavoc_out_0_w) /* Control Signals */
AM_RANGE(0x1640, 0x1640) AM_DEVWRITE("avg", avg_mhavoc_device, go_w) /* Vector Generator GO */
- AM_RANGE(0x1680, 0x1680) AM_WRITE(watchdog_reset_w) /* Watchdog Clear */
+ AM_RANGE(0x1680, 0x1680) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* Watchdog Clear */
AM_RANGE(0x16c0, 0x16c0) AM_DEVWRITE("avg", avg_mhavoc_device, reset_w) /* Vector Generator Reset */
AM_RANGE(0x1700, 0x1700) AM_WRITE(mhavoc_alpha_irq_ack_w) /* IRQ ack */
AM_RANGE(0x1740, 0x1740) AM_WRITE(mhavoc_rom_banksel_w) /* Program ROM Page Select */
@@ -359,7 +360,7 @@ static ADDRESS_MAP_START( alphaone_map, AS_PROGRAM, 8, mhavoc_state )
AM_RANGE(0x1080, 0x1080) AM_READ_PORT("DIAL") /* Roller Controller Input*/
AM_RANGE(0x10a0, 0x10a0) AM_WRITE(alphaone_out_0_w) /* Control Signals */
AM_RANGE(0x10a4, 0x10a4) AM_DEVWRITE("avg", avg_mhavoc_device, go_w) /* Vector Generator GO */
- AM_RANGE(0x10a8, 0x10a8) AM_WRITE(watchdog_reset_w) /* Watchdog Clear */
+ AM_RANGE(0x10a8, 0x10a8) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* Watchdog Clear */
AM_RANGE(0x10ac, 0x10ac) AM_DEVWRITE("avg", avg_mhavoc_device, reset_w) /* Vector Generator Reset */
AM_RANGE(0x10b0, 0x10b0) AM_WRITE(mhavoc_alpha_irq_ack_w) /* IRQ ack */
AM_RANGE(0x10b4, 0x10b4) AM_WRITE(mhavoc_rom_banksel_w)
@@ -534,6 +535,8 @@ static MACHINE_CONFIG_START( mhavoc, mhavoc_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("5k_timer", mhavoc_state, mhavoc_cpu_irq_clock, attotime::from_hz(MHAVOC_CLOCK_5K))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/midtunit.cpp b/src/mame/drivers/midtunit.cpp
index 15e50184a56..a54bed49a1f 100644
--- a/src/mame/drivers/midtunit.cpp
+++ b/src/mame/drivers/midtunit.cpp
@@ -26,6 +26,7 @@
#include "cpu/tms34010/tms34010.h"
#include "cpu/adsp2100/adsp2100.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/midtunit.h"
@@ -56,7 +57,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, midtunit_state )
/* AM_RANGE(0x01c00060, 0x01c0007f) AM_WRITE(midtunit_cmos_enable_w) */
AM_RANGE(0x01d00000, 0x01d0001f) AM_READ(midtunit_sound_state_r)
AM_RANGE(0x01d01020, 0x01d0103f) AM_READWRITE(midtunit_sound_r, midtunit_sound_w)
- AM_RANGE(0x01d81060, 0x01d8107f) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x01d81060, 0x01d8107f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x01f00000, 0x01f0001f) AM_WRITE(midtunit_control_w)
AM_RANGE(0x02000000, 0x07ffffff) AM_READ(midtunit_gfxrom_r) AM_SHARE("gfxrom")
AM_RANGE(0x1f800000, 0x1fffffff) AM_ROM AM_REGION("maincpu", 0) /* mirror used by MK */
@@ -601,6 +602,8 @@ static MACHINE_CONFIG_START( tunit_core, midtunit_state )
MCFG_MACHINE_RESET_OVERRIDE(midtunit_state,midtunit)
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_PALETTE_ADD("palette", 32768)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
diff --git a/src/mame/drivers/midvunit.cpp b/src/mame/drivers/midvunit.cpp
index 74470fbe667..33f3df88f68 100644
--- a/src/mame/drivers/midvunit.cpp
+++ b/src/mame/drivers/midvunit.cpp
@@ -192,7 +192,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_control_w)
/* bit 3 is the watchdog */
if ((olddata ^ m_control_data) & 0x0008)
- watchdog_reset_w(space, 0, 0);
+ m_watchdog->reset_w(space, 0, 0);
/* bit 1 is the DCS sound reset */
m_dcs->reset_w((~m_control_data >> 1) & 1);
@@ -213,7 +213,7 @@ WRITE32_MEMBER(midvunit_state::crusnwld_control_w)
/* bit 9 is the watchdog */
if ((olddata ^ m_control_data) & 0x0200)
- watchdog_reset_w(space, 0, 0);
+ m_watchdog->reset_w(space, 0, 0);
/* bit 8 is the LED */
@@ -417,7 +417,7 @@ WRITE32_MEMBER(midvunit_state::midvplus_misc_w)
/* bit 0x10 resets watchdog */
if ((olddata ^ m_midvplus_misc[offset]) & 0x0010)
{
- watchdog_reset_w(space, 0, 0);
+ m_watchdog->reset_w(space, 0, 0);
logit = 0;
}
break;
@@ -1011,6 +1011,8 @@ static MACHINE_CONFIG_START( midvcommon, midvunit_state )
MCFG_TIMER_ADD_NONE("timer0")
MCFG_TIMER_ADD_NONE("timer1")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_PALETTE_ADD("palette", 32768)
diff --git a/src/mame/drivers/mikie.cpp b/src/mame/drivers/mikie.cpp
index fb6cc53262a..4083f7fb398 100644
--- a/src/mame/drivers/mikie.cpp
+++ b/src/mame/drivers/mikie.cpp
@@ -41,6 +41,7 @@ Stephh's notes (based on the games M6809 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "includes/konamipt.h"
#include "includes/mikie.h"
@@ -99,7 +100,7 @@ static ADDRESS_MAP_START( mikie_map, AS_PROGRAM, 8, mikie_state )
AM_RANGE(0x2002, 0x2002) AM_WRITE(mikie_sh_irqtrigger_w)
AM_RANGE(0x2006, 0x2006) AM_WRITE(mikie_flipscreen_w)
AM_RANGE(0x2007, 0x2007) AM_WRITE(irq_mask_w)
- AM_RANGE(0x2100, 0x2100) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2100, 0x2100) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2200, 0x2200) AM_WRITE(mikie_palettebank_w)
AM_RANGE(0x2300, 0x2300) AM_WRITENOP // ???
AM_RANGE(0x2400, 0x2400) AM_READ_PORT("SYSTEM") AM_WRITE(soundlatch_byte_w)
@@ -258,6 +259,7 @@ static MACHINE_CONFIG_START( mikie, mikie_state )
MCFG_CPU_ADD("audiocpu", Z80, CLK)
MCFG_CPU_PROGRAM_MAP(sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/missile.cpp b/src/mame/drivers/missile.cpp
index e4557039e0f..c83947bcf8a 100644
--- a/src/mame/drivers/missile.cpp
+++ b/src/mame/drivers/missile.cpp
@@ -351,6 +351,7 @@ Super Missile Attack Board Layout
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/pokey.h"
@@ -361,6 +362,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
m_videoram(*this, "videoram"),
+ m_watchdog(*this, "watchdog"),
m_pokey(*this, "pokey"),
m_in0(*this, "IN0"),
m_in1(*this, "IN1"),
@@ -376,6 +378,7 @@ public:
required_device<m6502_device> m_maincpu;
required_shared_ptr<UINT8> m_videoram;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<pokey_device> m_pokey;
required_ioport m_in0;
required_ioport m_in1;
@@ -742,7 +745,7 @@ WRITE8_MEMBER(missile_state::missile_w)
/* watchdog */
else if (offset >= 0x4c00 && offset < 0x4d00)
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
/* interrupt ack */
else if (offset >= 0x4d00 && offset < 0x4e00)
@@ -1015,7 +1018,8 @@ static MACHINE_CONFIG_START( missile, missile_state )
MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8)
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_PALETTE_ADD("palette", 8)
diff --git a/src/mame/drivers/momoko.cpp b/src/mame/drivers/momoko.cpp
index 8b8526095cd..b4b23ec7aa9 100644
--- a/src/mame/drivers/momoko.cpp
+++ b/src/mame/drivers/momoko.cpp
@@ -47,6 +47,7 @@ Stephh's notes (based on the game Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/momoko.h"
@@ -64,7 +65,7 @@ static ADDRESS_MAP_START( momoko_map, AS_PROGRAM, 8, momoko_state )
AM_RANGE(0xd064, 0xd0ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xd400, 0xd400) AM_READ_PORT("IN0") AM_WRITENOP /* interrupt ack? */
AM_RANGE(0xd402, 0xd402) AM_READ_PORT("IN1") AM_WRITE(momoko_flipscreen_w)
- AM_RANGE(0xd404, 0xd404) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xd404, 0xd404) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd406, 0xd406) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xd407, 0xd407) AM_READ_PORT("DSW1")
AM_RANGE(0xd800, 0xdbff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@@ -258,6 +259,8 @@ static MACHINE_CONFIG_START( momoko, momoko_state )
MCFG_CPU_ADD("audiocpu", Z80, 2500000) /* 2.5MHz */
MCFG_CPU_PROGRAM_MAP(momoko_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/multfish.cpp b/src/mame/drivers/multfish.cpp
index 57ad3603e9f..f5890778055 100644
--- a/src/mame/drivers/multfish.cpp
+++ b/src/mame/drivers/multfish.cpp
@@ -940,7 +940,7 @@ static ADDRESS_MAP_START( igrosoft_gamble_portmap, AS_IO, 8, igrosoft_gamble_sta
AM_RANGE(0x34, 0x34) AM_WRITE(igrosoft_gamble_lamps2_w)
AM_RANGE(0x35, 0x35) AM_WRITE(igrosoft_gamble_lamps3_w)
// AM_RANGE(0x36, 0x36) AM_WRITE(igrosoft_gamble_port36_w)
- AM_RANGE(0x37, 0x37) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x37, 0x37) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x38, 0x38) AM_DEVWRITE("aysnd", ay8910_device, address_w)
AM_RANGE(0x39, 0x39) AM_DEVWRITE("aysnd", ay8910_device, data_w)
AM_RANGE(0x3a, 0x3a) AM_DEVREAD("aysnd", ay8910_device, data_r)
@@ -1040,6 +1040,7 @@ MACHINE_CONFIG_START( igrosoft_gamble, igrosoft_gamble_state )
MCFG_CPU_IO_MAP(igrosoft_gamble_portmap)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igrosoft_gamble_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/mw18w.cpp b/src/mame/drivers/mw18w.cpp
index 896db055fb5..7cf8e087138 100644
--- a/src/mame/drivers/mw18w.cpp
+++ b/src/mame/drivers/mw18w.cpp
@@ -18,6 +18,7 @@ To diagnose game, turn on service mode and:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "18w.lh"
@@ -171,7 +172,7 @@ static ADDRESS_MAP_START( mw18w_portmap, AS_IO, 8, mw18w_state )
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mw18w_lamps_w)
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(mw18w_led_display_w)
AM_RANGE(0x04, 0x04) AM_READ_PORT("IN4")
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_WRITE(mw18w_irq0_clear_w)
ADDRESS_MAP_END
@@ -272,6 +273,8 @@ static MACHINE_CONFIG_START( mw18w, mw18w_state )
MCFG_CPU_PROGRAM_MAP(mw18w_map)
MCFG_CPU_IO_MAP(mw18w_portmap)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* no video! */
/* sound hardware */
diff --git a/src/mame/drivers/mw8080bw.cpp b/src/mame/drivers/mw8080bw.cpp
index cc447c58aa1..0432644c43e 100644
--- a/src/mame/drivers/mw8080bw.cpp
+++ b/src/mame/drivers/mw8080bw.cpp
@@ -765,7 +765,7 @@ static ADDRESS_MAP_START( zzzap_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x03, 0x03) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x05, 0x05) AM_WRITE(zzzap_audio_2_w)
- AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x07, 0x07) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -843,6 +843,8 @@ static MACHINE_CONFIG_DERIVED( zzzap, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(zzzap_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_M(1), CAP_U(1))) /* 1.1s */
/* add shifter */
@@ -905,7 +907,7 @@ WRITE8_MEMBER(mw8080bw_state::maze_io_w)
{
if (offset & 0x01) maze_coin_counter_w(space, 0, data);
- if (offset & 0x02) watchdog_reset_w(space, 0, data);
+ if (offset & 0x02) m_watchdog->reset_w(space, 0, data);
}
@@ -953,6 +955,8 @@ static MACHINE_CONFIG_DERIVED( maze, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(maze_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,maze)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))) /* 2.97s */
/* audio hardware */
@@ -987,7 +991,7 @@ static ADDRESS_MAP_START( boothill_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(boothill_audio_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
ADDRESS_MAP_END
@@ -1043,6 +1047,8 @@ static MACHINE_CONFIG_DERIVED( boothill, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(boothill_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,boothill)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))) /* 2.97s */
/* add shifter */
@@ -1065,7 +1071,7 @@ WRITE8_MEMBER(mw8080bw_state::checkmat_io_w)
{
if (offset & 0x01) checkmat_audio_w(space, 0, data);
- if (offset & 0x02) watchdog_reset_w(space, 0, data);
+ if (offset & 0x02) m_watchdog->reset_w(space, 0, data);
}
@@ -1147,6 +1153,8 @@ static MACHINE_CONFIG_DERIVED( checkmat, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(checkmat_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))) /* 2.97s */
/* audio hardware */
@@ -1211,7 +1219,7 @@ static ADDRESS_MAP_START( desertgu_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(desertgu_audio_1_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
AM_RANGE(0x07, 0x07) AM_WRITE(desertgu_audio_2_w)
@@ -1273,6 +1281,8 @@ static MACHINE_CONFIG_DERIVED( desertgu, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(desertgu_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,desertgu)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -1333,7 +1343,7 @@ static ADDRESS_MAP_START( dplay_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(dplay_audio_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
ADDRESS_MAP_END
@@ -1472,6 +1482,8 @@ static MACHINE_CONFIG_DERIVED( dplay, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(dplay_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -1509,7 +1521,7 @@ static ADDRESS_MAP_START( gmissile_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(gmissile_audio_1_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(gmissile_audio_2_w)
/* also writes 0x00 to 0x06, but it is not connected */
AM_RANGE(0x07, 0x07) AM_WRITE(gmissile_audio_3_w)
@@ -1566,6 +1578,8 @@ static MACHINE_CONFIG_DERIVED( gmissile, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(gmissile_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,gmissile)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -1603,7 +1617,7 @@ static ADDRESS_MAP_START( m4_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(m4_audio_1_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(m4_audio_2_w)
ADDRESS_MAP_END
@@ -1658,6 +1672,8 @@ static MACHINE_CONFIG_DERIVED( m4, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(m4_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,m4)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -1716,7 +1732,7 @@ static ADDRESS_MAP_START( clowns_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(clowns_audio_1_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
AM_RANGE(0x07, 0x07) AM_WRITE(clowns_audio_2_w)
@@ -1825,6 +1841,8 @@ static MACHINE_CONFIG_DERIVED( clowns, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(clowns_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,clowns)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -1854,7 +1872,7 @@ static ADDRESS_MAP_START( spacwalk_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(spacwalk_audio_1_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
AM_RANGE(0x07, 0x07) AM_WRITE(spacwalk_audio_2_w)
@@ -1919,6 +1937,8 @@ static MACHINE_CONFIG_DERIVED( spacwalk, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(spacwalk_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,clowns)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -1948,7 +1968,7 @@ static ADDRESS_MAP_START( shuffle_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_MIRROR(0x08) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_MIRROR(0x08) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
- AM_RANGE(0x04, 0x04) AM_MIRROR(0x08) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_MIRROR(0x08) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_1_w)
AM_RANGE(0x06, 0x06) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_2_w)
ADDRESS_MAP_END
@@ -1999,6 +2019,8 @@ static MACHINE_CONFIG_DERIVED( shuffle, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(shuffle_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -2027,7 +2049,7 @@ static ADDRESS_MAP_START( dogpatch_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(dogpatch_audio_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
ADDRESS_MAP_END
@@ -2084,6 +2106,8 @@ static MACHINE_CONFIG_DERIVED( dogpatch, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(dogpatch_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -2146,7 +2170,7 @@ WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w)
{ /* A7 A6 A5 A4 A3 A2 A1 A0 */
if ((offset & 0x07) == 0x02)
- watchdog_reset_w(space, 0, data); /* - - - - - 0 1 0 */
+ m_watchdog->reset_w(space, 0, data); /* - - - - - 0 1 0 */
else if ((offset & 0x5f) == 0x01)
spcenctr_audio_1_w(space, 0, data); /* - 0 - 0 0 0 0 1 */
@@ -2241,6 +2265,8 @@ static MACHINE_CONFIG_DERIVED( spcenctr, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(spcenctr_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,spcenctr)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* timers */
@@ -2287,7 +2313,7 @@ static ADDRESS_MAP_START( phantom2_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(phantom2_audio_1_w)
AM_RANGE(0x06, 0x06) AM_WRITE(phantom2_audio_2_w)
ADDRESS_MAP_END
@@ -2335,6 +2361,8 @@ static MACHINE_CONFIG_DERIVED( phantom2, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(phantom2_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,phantom2)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* video hardware */
@@ -2414,7 +2442,7 @@ static ADDRESS_MAP_START( bowler_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x05, 0x05) AM_WRITE(bowler_audio_1_w)
AM_RANGE(0x06, 0x06) AM_WRITE(bowler_audio_2_w)
AM_RANGE(0x07, 0x07) AM_WRITE(bowler_lights_1_w)
@@ -2473,6 +2501,8 @@ static MACHINE_CONFIG_DERIVED( bowler, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(bowler_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -2598,7 +2628,7 @@ static ADDRESS_MAP_START( invaders_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x03, 0x03) AM_WRITE(invaders_audio_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(invaders_audio_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -2683,6 +2713,8 @@ MACHINE_CONFIG_DERIVED( invaders, mw8080bw_root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(invaders_io_map)
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,invaders)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* video hardware */
@@ -2728,7 +2760,7 @@ static ADDRESS_MAP_START( blueshrk_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(blueshrk_audio_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -2765,6 +2797,8 @@ static MACHINE_CONFIG_DERIVED( blueshrk, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(blueshrk_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
@@ -2810,7 +2844,7 @@ static ADDRESS_MAP_START( invad2ct_io_map, AS_IO, 8, mw8080bw_state )
AM_RANGE(0x03, 0x03) AM_WRITE(invad2ct_audio_1_w)
AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
AM_RANGE(0x05, 0x05) AM_WRITE(invad2ct_audio_2_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_WRITE(invad2ct_audio_4_w)
ADDRESS_MAP_END
@@ -2865,6 +2899,8 @@ static MACHINE_CONFIG_DERIVED( invad2ct, mw8080bw_root )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(invad2ct_io_map)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
/* add shifter */
diff --git a/src/mame/drivers/mwsub.cpp b/src/mame/drivers/mwsub.cpp
index 348572cda82..5cfa56271db 100644
--- a/src/mame/drivers/mwsub.cpp
+++ b/src/mame/drivers/mwsub.cpp
@@ -13,6 +13,7 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "submar.lh"
@@ -134,7 +135,7 @@ static ADDRESS_MAP_START( submar_portmap, AS_IO, 8, submar_state )
AM_RANGE(0x02, 0x02) AM_WRITE(submar_solenoid_w)
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(submar_sound_w)
AM_RANGE(0x04, 0x05) AM_WRITE(submar_led_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x07, 0x07) AM_WRITE(submar_irq_clear_w)
ADDRESS_MAP_END
@@ -203,6 +204,8 @@ static MACHINE_CONFIG_START( submar, submar_state )
MCFG_CPU_PROGRAM_MAP(submar_map)
MCFG_CPU_IO_MAP(submar_portmap)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* no video! */
/* sound hardware */
diff --git a/src/mame/drivers/namcos86.cpp b/src/mame/drivers/namcos86.cpp
index 5dab4c43cd2..094fd5a4138 100644
--- a/src/mame/drivers/namcos86.cpp
+++ b/src/mame/drivers/namcos86.cpp
@@ -256,7 +256,7 @@ WRITE8_MEMBER(namcos86_state::watchdog1_w)
if (m_wdog == 3)
{
m_wdog = 0;
- watchdog_reset_w(space,0,0);
+ m_watchdog->reset_w(space,0,0);
}
}
@@ -266,7 +266,7 @@ WRITE8_MEMBER(namcos86_state::watchdog2_w)
if (m_wdog == 3)
{
m_wdog = 0;
- watchdog_reset_w(space,0,0);
+ m_watchdog->reset_w(space,0,0);
}
}
@@ -1061,6 +1061,7 @@ static MACHINE_CONFIG_START( hopmappy, namcos86_state )
MCFG_QUANTUM_TIME(attotime::from_hz(48000)) /* heavy interleaving needed to avoid hangs in rthunder */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp
index 90954e866a4..22de66cda54 100644
--- a/src/mame/drivers/nemesis.cpp
+++ b/src/mame/drivers/nemesis.cpp
@@ -51,6 +51,7 @@ So this is the correct behavior of real hardware, not an emulation bug.
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/2151intf.h"
#include "sound/3812intf.h"
@@ -277,7 +278,7 @@ static ADDRESS_MAP_START( nemesis_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x05c000, 0x05c001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")
- AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x05c800, 0x05c801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
@@ -312,7 +313,7 @@ static ADDRESS_MAP_START( gx400_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")
AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")
AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")
- AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x05c800, 0x05c801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
@@ -343,7 +344,7 @@ static ADDRESS_MAP_START( konamigt_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x05c000, 0x05c001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")
- AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x05c800, 0x05c801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
@@ -378,7 +379,7 @@ static ADDRESS_MAP_START( rf2_gx400_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")
AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")
AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")
- AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x05c800, 0x05c801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
@@ -440,7 +441,7 @@ static ADDRESS_MAP_START( salamand_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
- AM_RANGE(0x0c0004, 0x0c0005) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x0c0004, 0x0c0005) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1")
AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2")
@@ -465,7 +466,7 @@ static ADDRESS_MAP_START( blkpnthr_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x0a0000, 0x0a0001) AM_RAM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
- AM_RANGE(0x0c0004, 0x0c0005) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x0c0004, 0x0c0005) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1")
AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2")
@@ -493,7 +494,7 @@ static ADDRESS_MAP_START( citybomb_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x0f0006, 0x0f0007) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW0")
AM_RANGE(0x0f0010, 0x0f0011) AM_WRITE8(soundlatch_byte_w, 0x00ff)
- AM_RANGE(0x0f0018, 0x0f0019) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x0f0018, 0x0f0019) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x0f0020, 0x0f0021) AM_READ(selected_ip_word_r) AM_WRITENOP /* WEC Le Mans 24 control? */
AM_RANGE(0x0f8000, 0x0f8001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x100000, 0x1bffff) AM_ROM
@@ -520,7 +521,7 @@ static ADDRESS_MAP_START( nyanpani_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x070006, 0x070007) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
AM_RANGE(0x070008, 0x070009) AM_READ_PORT("DSW0")
AM_RANGE(0x070010, 0x070011) AM_WRITE8(soundlatch_byte_w, 0x00ff)
- AM_RANGE(0x070018, 0x070019) AM_WRITE(watchdog_reset16_w) /* probably */
+ AM_RANGE(0x070018, 0x070019) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* probably */
AM_RANGE(0x078000, 0x078001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x100000, 0x13ffff) AM_ROM
AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_SHARE("videoram1") /* VRAM */
@@ -588,7 +589,7 @@ static ADDRESS_MAP_START( hcrash_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("DSW1")
AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("TEST")
- AM_RANGE(0x0c0008, 0x0c0009) AM_WRITE(watchdog_reset16_w) /* watchdog probably */
+ AM_RANGE(0x0c0008, 0x0c0009) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* watchdog probably */
AM_RANGE(0x0c000a, 0x0c000b) AM_READ_PORT("IN0")
AM_RANGE(0x0c2000, 0x0c2001) AM_READ(konamigt_input_word_r) /* Konami GT control */
AM_RANGE(0x0c2800, 0x0c2801) AM_WRITENOP
@@ -1480,6 +1481,7 @@ static MACHINE_CONFIG_START( nemesis, nemesis_state )
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* From schematics, should be accurate */
MCFG_CPU_PROGRAM_MAP(sound_map) /* fixed */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1534,6 +1536,7 @@ static MACHINE_CONFIG_START( gx400, nemesis_state )
MCFG_CPU_PROGRAM_MAP(gx400_sound_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", nemesis_state, nmi_line_pulse) /* interrupts are triggered by the main CPU */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1590,6 +1593,7 @@ static MACHINE_CONFIG_START( konamigt, nemesis_state )
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1644,6 +1648,7 @@ static MACHINE_CONFIG_START( rf2_gx400, nemesis_state )
MCFG_CPU_PROGRAM_MAP(gx400_sound_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", nemesis_state, nmi_line_pulse) /* interrupts are triggered by the main CPU */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1700,6 +1705,7 @@ static MACHINE_CONFIG_START( salamand, nemesis_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(sal_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1747,6 +1753,7 @@ static MACHINE_CONFIG_START( blkpnthr, nemesis_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(blkpnthr_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1790,6 +1797,7 @@ static MACHINE_CONFIG_START( citybomb, nemesis_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(city_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1837,6 +1845,7 @@ static MACHINE_CONFIG_START( nyanpani, nemesis_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(city_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1884,6 +1893,7 @@ static MACHINE_CONFIG_START( hcrash, nemesis_state )
MCFG_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(sal_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2638,6 +2648,7 @@ static MACHINE_CONFIG_START( bubsys, nemesis_state )
MCFG_CPU_PROGRAM_MAP(gx400_sound_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", nemesis_state, nmi_line_pulse) /* interrupts are triggered by the main CPU */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp
index 6c8fbc79eaa..c1d7503c321 100644
--- a/src/mame/drivers/neogeo.cpp
+++ b/src/mame/drivers/neogeo.cpp
@@ -464,6 +464,7 @@
#include "emu.h"
#include "includes/neogeo.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "softlist.h"
#include "neogeo.lh"
@@ -1444,7 +1445,7 @@ ADDRESS_MAP_START( neogeo_main_map, AS_PROGRAM, 16, neogeo_state )
AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x0f0000) AM_RAM
/* some games have protection devices in the 0x200000 region, it appears to map to cart space, not surprising, the ROM is read here too */
AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("TEST")
- AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01fffe) AM_WRITE8(watchdog_reset_w, 0x00ff)
+ AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01fffe) AM_DEVWRITE8("watchdog", watchdog_timer_device, reset_w, 0x00ff)
AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("AUDIO/COIN") AM_WRITE8(audio_command_w, 0xff00)
AM_RANGE(0x360000, 0x37ffff) AM_READ(unmapped_r)
AM_RANGE(0x380000, 0x380001) AM_MIRROR(0x01fffe) AM_READ_PORT("SYSTEM")
@@ -1643,6 +1644,8 @@ MACHINE_CONFIG_START( neogeo_base, neogeo_state )
MCFG_CPU_PROGRAM_MAP(audio_map)
MCFG_CPU_IO_MAP(audio_io_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_DEFAULT_LAYOUT(layout_neogeo)
@@ -1672,6 +1675,7 @@ MACHINE_CONFIG_DERIVED( neogeo_arcade, neogeo_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(main_map_slot)
+ MCFG_WATCHDOG_MODIFY("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_ticks(3244030, NEOGEO_MASTER_CLOCK))
MCFG_UPD4990A_ADD("upd4990a", XTAL_32_768kHz, NOOP, NOOP)
diff --git a/src/mame/drivers/nitedrvr.cpp b/src/mame/drivers/nitedrvr.cpp
index 34409ac6c1b..85d07411d48 100644
--- a/src/mame/drivers/nitedrvr.cpp
+++ b/src/mame/drivers/nitedrvr.cpp
@@ -39,6 +39,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "machine/rescap.h"
+#include "machine/watchdog.h"
#include "sound/discrete.h"
#include "includes/nitedrvr.h"
@@ -48,7 +49,7 @@ static ADDRESS_MAP_START( nitedrvr_map, AS_PROGRAM, 8, nitedrvr_state )
AM_RANGE(0x0000, 0x00ff) AM_RAM AM_MIRROR(0x100) // SCRAM
AM_RANGE(0x0200, 0x027f) AM_READNOP AM_WRITE(nitedrvr_videoram_w) AM_MIRROR(0x180) AM_SHARE("videoram") // PFW
AM_RANGE(0x0400, 0x042f) AM_READNOP AM_WRITEONLY AM_MIRROR(0x1c0) AM_SHARE("hvc") // POSH, POSV, CHAR
- AM_RANGE(0x0430, 0x043f) AM_WRITE(watchdog_reset_w) AM_MIRROR(0x1c0)
+ AM_RANGE(0x0430, 0x043f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) AM_MIRROR(0x1c0)
AM_RANGE(0x0600, 0x07ff) AM_READ(nitedrvr_in0_r)
AM_RANGE(0x0800, 0x09ff) AM_READ(nitedrvr_in1_r)
AM_RANGE(0x0a00, 0x0bff) AM_WRITE(nitedrvr_out0_w)
@@ -141,7 +142,9 @@ static MACHINE_CONFIG_START( nitedrvr, nitedrvr_state )
MCFG_CPU_ADD("maincpu", M6502, XTAL_12_096MHz/12) // 1 MHz
MCFG_CPU_PROGRAM_MAP(nitedrvr_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", nitedrvr_state, irq0_line_hold)
- MCFG_WATCHDOG_VBLANK_INIT(3)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 3)
MCFG_TIMER_DRIVER_ADD_PERIODIC("crash_timer", nitedrvr_state, nitedrvr_crash_toggle_callback, PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)))
diff --git a/src/mame/drivers/nova2001.cpp b/src/mame/drivers/nova2001.cpp
index c80030d6e40..4c8f3f174d9 100644
--- a/src/mame/drivers/nova2001.cpp
+++ b/src/mame/drivers/nova2001.cpp
@@ -123,6 +123,7 @@ e000 - e7ff R/W Work RAM
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/nova2001.h"
@@ -185,7 +186,7 @@ static ADDRESS_MAP_START( nova2001_map, AS_PROGRAM, 8, nova2001_state )
AM_RANGE(0xc001, 0xc001) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
AM_RANGE(0xc002, 0xc002) AM_DEVWRITE("ay1", ay8910_device, address_w)
AM_RANGE(0xc003, 0xc003) AM_DEVWRITE("ay2", ay8910_device, address_w)
- AM_RANGE(0xc004, 0xc004) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xc004, 0xc004) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xc006, 0xc006) AM_READ_PORT("IN0")
AM_RANGE(0xc007, 0xc007) AM_READ_PORT("IN1")
AM_RANGE(0xc00e, 0xc00e) AM_READ_PORT("IN2")
@@ -640,6 +641,8 @@ static MACHINE_CONFIG_START( nova2001, nova2001_state )
MCFG_CPU_PROGRAM_MAP(nova2001_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", nova2001_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/offtwall.cpp b/src/mame/drivers/offtwall.cpp
index bc5d0c0b015..bf366889bfd 100644
--- a/src/mame/drivers/offtwall.cpp
+++ b/src/mame/drivers/offtwall.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "includes/offtwall.h"
@@ -246,7 +247,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, offtwall_state )
AM_RANGE(0x260040, 0x260041) AM_DEVWRITE8("jsa", atari_jsa_iii_device, main_command_w, 0x00ff)
AM_RANGE(0x260050, 0x260051) AM_WRITE(io_latch_w)
AM_RANGE(0x260060, 0x260061) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
- AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2a0000, 0x2a0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x3effc0, 0x3effff) AM_DEVREADWRITE("vad", atari_vad_device, control_read, control_write)
AM_RANGE(0x3f4000, 0x3f5eff) AM_RAM_DEVWRITE("vad", atari_vad_device, playfield_latched_msb_w) AM_SHARE("vad:playfield")
@@ -367,6 +368,8 @@ static MACHINE_CONFIG_START( offtwall, offtwall_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", offtwall)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/ohmygod.cpp b/src/mame/drivers/ohmygod.cpp
index 22bd57f4f5f..6eeae4c9b52 100644
--- a/src/mame/drivers/ohmygod.cpp
+++ b/src/mame/drivers/ohmygod.cpp
@@ -15,6 +15,7 @@ Notes:
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "includes/ohmygod.h"
@@ -56,7 +57,7 @@ static ADDRESS_MAP_START( ohmygod_map, AS_PROGRAM, 16, ohmygod_state )
AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("DSW1")
AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW2")
AM_RANGE(0xb00000, 0xb00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
- AM_RANGE(0xc00000, 0xc00001) AM_READ(watchdog_reset16_r)
+ AM_RANGE(0xc00000, 0xc00001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0xd00000, 0xd00001) AM_WRITE(ohmygod_spritebank_w)
ADDRESS_MAP_END
@@ -321,6 +322,7 @@ static MACHINE_CONFIG_START( ohmygod, ohmygod_state )
MCFG_CPU_PROGRAM_MAP(ohmygod_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", ohmygod_state, irq1_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
diff --git a/src/mame/drivers/omegrace.cpp b/src/mame/drivers/omegrace.cpp
index 59de28612f6..500607e78ef 100644
--- a/src/mame/drivers/omegrace.cpp
+++ b/src/mame/drivers/omegrace.cpp
@@ -221,6 +221,7 @@
#include "video/avgdvg.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "omegrace.lh"
@@ -361,7 +362,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( port_map, AS_IO, 8, omegrace_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x08, 0x08) AM_READ(omegrace_vg_go_r)
- AM_RANGE(0x09, 0x09) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x09, 0x09) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x0a, 0x0a) AM_DEVWRITE("dvg", dvg_device, reset_w)
AM_RANGE(0x0b, 0x0b) AM_READ_PORT("AVGDVG") /* vg_halt */
AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP SW C4 */
@@ -513,6 +514,8 @@ static MACHINE_CONFIG_START( omegrace, omegrace_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/onetwo.cpp b/src/mame/drivers/onetwo.cpp
index 35b54cbd5b8..363b98e85c7 100644
--- a/src/mame/drivers/onetwo.cpp
+++ b/src/mame/drivers/onetwo.cpp
@@ -43,6 +43,7 @@ Note: this is quite clearly a 'Korean bootleg' of Shisensho - Joshiryo-Hen / Mat
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "sound/3812intf.h"
@@ -58,6 +59,7 @@ public:
m_fgram(*this, "fgram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
+ m_watchdog(*this, "watchdog"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
@@ -72,6 +74,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -136,7 +139,7 @@ WRITE8_MEMBER(onetwo_state::onetwo_cpubank_w)
WRITE8_MEMBER(onetwo_state::onetwo_coin_counters_w)
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
machine().bookkeeping().coin_counter_w(0, BIT(data, 1));
machine().bookkeeping().coin_counter_w(1, BIT(data, 2));
}
@@ -359,6 +362,7 @@ static MACHINE_CONFIG_START( onetwo, onetwo_state )
MCFG_CPU_PROGRAM_MAP(sound_cpu)
MCFG_CPU_IO_MAP(sound_cpu_io)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/orbit.cpp b/src/mame/drivers/orbit.cpp
index 94796573917..e21c7c9b8b8 100644
--- a/src/mame/drivers/orbit.cpp
+++ b/src/mame/drivers/orbit.cpp
@@ -22,6 +22,7 @@ Atari Orbit Driver
#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "includes/orbit.h"
+#include "machine/watchdog.h"
#include "sound/discrete.h"
@@ -117,7 +118,7 @@ static ADDRESS_MAP_START( orbit_map, AS_PROGRAM, 8, orbit_state )
AM_RANGE(0x3a00, 0x3a00) AM_MIRROR(0x00ff) AM_WRITE(orbit_note_amp_w)
AM_RANGE(0x3c00, 0x3c0f) AM_MIRROR(0x00f0) AM_WRITE(orbit_misc_w)
AM_RANGE(0x3e00, 0x3e00) AM_MIRROR(0x00ff) AM_WRITE(orbit_noise_rst_w)
- AM_RANGE(0x3f00, 0x3f00) AM_MIRROR(0x00ff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3f00, 0x3f00) AM_MIRROR(0x00ff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x6000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -297,6 +298,7 @@ static MACHINE_CONFIG_START( orbit, orbit_state )
MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", orbit_state, nmi_32v, "screen", 0, 32)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/pacland.cpp b/src/mame/drivers/pacland.cpp
index 697ec5bb9da..f7b7eaca34f 100644
--- a/src/mame/drivers/pacland.cpp
+++ b/src/mame/drivers/pacland.cpp
@@ -193,6 +193,7 @@ Notes:
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "includes/pacland.h"
@@ -267,7 +268,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, pacland_state )
AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("bank1")
AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
AM_RANGE(0x7000, 0x7fff) AM_WRITE(irq_1_ctrl_w)
- AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7800, 0x7fff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8000, 0xffff) AM_ROM
AM_RANGE(0x8000, 0x8fff) AM_WRITE(subreset_w)
AM_RANGE(0x9000, 0x9fff) AM_WRITE(flipscreen_w)
@@ -277,7 +278,7 @@ static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, pacland_state )
AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE("mcu", hd63701_cpu_device, m6801_io_r, m6801_io_w)
AM_RANGE(0x0080, 0x00ff) AM_RAM
AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
- AM_RANGE(0x2000, 0x3fff) AM_WRITE(watchdog_reset_w) /* watchdog? */
+ AM_RANGE(0x2000, 0x3fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog? */
AM_RANGE(0x4000, 0x7fff) AM_WRITE(irq_2_ctrl_w)
AM_RANGE(0x8000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM
@@ -437,6 +438,8 @@ static MACHINE_CONFIG_START( pacland, pacland_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* we need heavy synching between the MCU and the CPU */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_49_152MHz/8, 384, 3*8, 39*8, 264, 2*8, 30*8)
diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp
index 6081658ef7e..ddf0a4f1753 100644
--- a/src/mame/drivers/pacman.cpp
+++ b/src/mame/drivers/pacman.cpp
@@ -342,6 +342,7 @@ Boards:
#include "includes/pacman.h"
#include "cpu/s2650/s2650.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/sn76496.h"
@@ -976,7 +977,7 @@ static ADDRESS_MAP_START( pacman_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1008,7 +1009,7 @@ static ADDRESS_MAP_START( birdiy_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x50a0, 0x50af) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
// AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
// AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1033,7 +1034,7 @@ static ADDRESS_MAP_START( mspacman_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1073,7 +1074,7 @@ static ADDRESS_MAP_START( woodpek_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1119,7 +1120,7 @@ static ADDRESS_MAP_START( numcrash_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_WRITEONLY AM_SHARE("spriteram2")
// AM_RANGE(0x5070, 0x507f) AM_WRITENOP
// AM_RANGE(0x5080, 0x5080) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_READ_PORT("DSW1")
@@ -1135,7 +1136,7 @@ static ADDRESS_MAP_START( alibaba_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x4c00, 0x4eef) AM_MIRROR(0xa000) AM_RAM
AM_RANGE(0x4ef0, 0x4eff) AM_MIRROR(0xa000) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x4f00, 0x4fff) AM_MIRROR(0xa000) AM_RAM
- AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf38) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf38) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITE(pacman_leds_w)
AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_lockout_global_w)
AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w)
@@ -1176,7 +1177,7 @@ static ADDRESS_MAP_START( dremshpr_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1207,7 +1208,7 @@ static ADDRESS_MAP_START( epos_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1231,7 +1232,7 @@ static ADDRESS_MAP_START( s2650games_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x1560, 0x156f) AM_MIRROR(0xe000) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x1570, 0x157f) AM_MIRROR(0xe000) AM_WRITEONLY
AM_RANGE(0x1586, 0x1587) AM_MIRROR(0xe000) AM_WRITENOP
- AM_RANGE(0x15c0, 0x15c0) AM_MIRROR(0xe000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x15c0, 0x15c0) AM_MIRROR(0xe000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x15c7, 0x15c7) AM_MIRROR(0xe000) AM_WRITE(porky_banking_w)
AM_RANGE(0x1500, 0x1500) AM_MIRROR(0xe000) AM_READ_PORT("IN0")
AM_RANGE(0x1540, 0x1540) AM_MIRROR(0xe000) AM_READ_PORT("IN1")
@@ -1255,7 +1256,7 @@ static ADDRESS_MAP_START( rocktrv2_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5003, 0x5003) AM_WRITE(pacman_flipscreen_w)
AM_RANGE(0x5007, 0x5007) AM_WRITE(pacman_coin_counter_w)
AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
- AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5fe0, 0x5fe3) AM_WRITE(rocktrv2_prot_data_w) AM_SHARE("rocktrv2_prot")
AM_RANGE(0x5ff0, 0x5ff0) AM_WRITE(rocktrv2_question_bank_w)
AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0")
@@ -1282,7 +1283,7 @@ static ADDRESS_MAP_START( bigbucks_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5003, 0x5003) AM_WRITE(pacman_flipscreen_w)
AM_RANGE(0x5007, 0x5007) AM_WRITENOP /*?*/
AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
- AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x503f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x507f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x50bf) AM_READ_PORT("DSW1")
@@ -1311,7 +1312,7 @@ static ADDRESS_MAP_START( mschamp_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1336,7 +1337,7 @@ static ADDRESS_MAP_START( superabc_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("DSW1")
@@ -1364,7 +1365,7 @@ static ADDRESS_MAP_START( crushs_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
- AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xaf3f) AM_READ_PORT("IN0")
AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ_PORT("IN1")
ADDRESS_MAP_END
@@ -1393,7 +1394,7 @@ static ADDRESS_MAP_START( pengojpm_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x9060, 0x906f) AM_WRITEONLY AM_SHARE("spriteram2")
AM_RANGE(0x9070, 0x907f) AM_WRITENOP
AM_RANGE(0x9080, 0x9080) AM_WRITENOP
- AM_RANGE(0x90c0, 0x90c0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x90c0, 0x90c0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x9000, 0x9000) AM_READ_PORT("IN0")
AM_RANGE(0x9040, 0x9040) AM_READ_PORT("IN1")
AM_RANGE(0x9080, 0x9080) AM_READ_PORT("DSW1")
@@ -3601,7 +3602,9 @@ static MACHINE_CONFIG_START( pacman, pacman_state )
MCFG_CPU_PROGRAM_MAP(pacman_map)
MCFG_CPU_IO_MAP(writeport)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pacman_state, vblank_irq)
- MCFG_WATCHDOG_VBLANK_INIT(16)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 16)
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", pacman)
diff --git a/src/mame/drivers/pandoras.cpp b/src/mame/drivers/pandoras.cpp
index 2a424001b12..aa286568be0 100644
--- a/src/mame/drivers/pandoras.cpp
+++ b/src/mame/drivers/pandoras.cpp
@@ -27,6 +27,7 @@ Boards:
#include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "includes/konamipt.h"
@@ -132,7 +133,7 @@ static ADDRESS_MAP_START( pandoras_master_map, AS_PROGRAM, 8, pandoras_state )
AM_RANGE(0x1c00, 0x1c00) AM_WRITE(pandoras_z80_irqtrigger_w) /* cause INT on the Z80 */
AM_RANGE(0x1e00, 0x1e00) AM_WRITE(soundlatch_byte_w) /* sound command to the Z80 */
AM_RANGE(0x2000, 0x2000) AM_WRITE(pandoras_cpub_irqtrigger_w) /* cause FIRQ on CPU B */
- AM_RANGE(0x2001, 0x2001) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x2001, 0x2001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog reset */
AM_RANGE(0x4000, 0x5fff) AM_ROM /* space for diagnostic ROM */
AM_RANGE(0x6000, 0x67ff) AM_RAM AM_SHARE("share4") /* Shared RAM with CPU B */
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */
@@ -150,7 +151,7 @@ static ADDRESS_MAP_START( pandoras_slave_map, AS_PROGRAM, 8, pandoras_state )
AM_RANGE(0x1a03, 0x1a03) AM_READ_PORT("DSW3")
AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW2")
// AM_RANGE(0x1e00, 0x1e00) AM_READNOP /* ??? seems to be important */
- AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog reset */
AM_RANGE(0xa000, 0xa000) AM_WRITE(pandoras_cpua_irqtrigger_w) /* cause FIRQ on CPU A */
AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("share4") /* Shared RAM with the CPU A */
AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */
@@ -337,6 +338,7 @@ static MACHINE_CONFIG_START( pandoras, pandoras_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - needed for correct synchronization of the sound CPUs */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/parodius.cpp b/src/mame/drivers/parodius.cpp
index ad9a6ec7c61..1706aaf53ea 100644
--- a/src/mame/drivers/parodius.cpp
+++ b/src/mame/drivers/parodius.cpp
@@ -11,7 +11,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
-
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "sound/k053260.h"
#include "includes/konamipt.h"
@@ -99,7 +99,7 @@ static ADDRESS_MAP_START( parodius_map, AS_PROGRAM, 8, parodius_state )
AM_RANGE(0x3f90, 0x3f90) AM_READ_PORT("DSW2")
AM_RANGE(0x3fa0, 0x3faf) AM_DEVREADWRITE("k053245", k05324x_device, k053244_r, k053244_w)
AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE("k053251", k053251_device, write)
- AM_RANGE(0x3fc0, 0x3fc0) AM_READ(watchdog_reset_r) AM_WRITE(parodius_3fc0_w)
+ AM_RANGE(0x3fc0, 0x3fc0) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(parodius_3fc0_w)
AM_RANGE(0x3fc4, 0x3fc4) AM_WRITE(parodius_videobank_w)
AM_RANGE(0x3fc8, 0x3fc8) AM_WRITE(parodius_sh_irqtrigger_w)
AM_RANGE(0x3fcc, 0x3fcd) AM_DEVREADWRITE("k053260", k053260_device, main_read, main_write)
@@ -247,6 +247,8 @@ static MACHINE_CONFIG_START( parodius, parodius_state )
MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(12)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x0800)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/pingpong.cpp b/src/mame/drivers/pingpong.cpp
index 5231f76cd78..7af2d70aa73 100644
--- a/src/mame/drivers/pingpong.cpp
+++ b/src/mame/drivers/pingpong.cpp
@@ -10,6 +10,7 @@ Ping Pong (c) 1985 Konami
#include "cpu/z80/z80.h"
#include "sound/sn76496.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/pingpong.h"
@@ -99,7 +100,7 @@ static ADDRESS_MAP_START( pingpong_map, AS_PROGRAM, 8, pingpong_state )
AM_RANGE(0xa000, 0xa000) AM_WRITE(coin_w) /* coin counters + irq enables */
AM_RANGE(0xa200, 0xa200) AM_WRITENOP /* SN76496 data latch */
AM_RANGE(0xa400, 0xa400) AM_DEVWRITE("snsnd", sn76496_device, write) /* trigger read */
- AM_RANGE(0xa600, 0xa600) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa600, 0xa600) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( merlinmm_map, AS_PROGRAM, 8, pingpong_state )
@@ -120,7 +121,7 @@ static ADDRESS_MAP_START( merlinmm_map, AS_PROGRAM, 8, pingpong_state )
AM_RANGE(0xa180, 0xa180) AM_READ_PORT("IN3")
AM_RANGE(0xa200, 0xa200) AM_WRITENOP /* SN76496 data latch */
AM_RANGE(0xa400, 0xa400) AM_DEVWRITE("snsnd", sn76496_device, write) /* trigger read */
- AM_RANGE(0xa600, 0xa600) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa600, 0xa600) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -448,6 +449,7 @@ static MACHINE_CONFIG_START( pingpong, pingpong_state )
MCFG_CPU_ADD("maincpu",Z80,18432000/6) /* 3.072 MHz (probably) */
MCFG_CPU_PROGRAM_MAP(pingpong_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pingpong_state, pingpong_interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/pitnrun.cpp b/src/mame/drivers/pitnrun.cpp
index 71c67b999c2..0ce750d583c 100644
--- a/src/mame/drivers/pitnrun.cpp
+++ b/src/mame/drivers/pitnrun.cpp
@@ -68,6 +68,7 @@ K1000233A
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/pitnrun.h"
@@ -115,7 +116,7 @@ static ADDRESS_MAP_START( pitnrun_map, AS_PROGRAM, 8, pitnrun_state )
AM_RANGE(0xc807, 0xc807) AM_WRITE(ha_w)
AM_RANGE(0xd000, 0xd000) AM_READ(mcu_data_r)
AM_RANGE(0xd800, 0xd800) AM_READ(mcu_status_r)
- AM_RANGE(0xf000, 0xf000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf000, 0xf000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pitnrun_sound_map, AS_PROGRAM, 8, pitnrun_state )
@@ -232,6 +233,7 @@ static MACHINE_CONFIG_START( pitnrun, pitnrun_state )
MCFG_CPU_ADD("mcu", M68705,XTAL_18_432MHz/6) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(pitnrun_mcu_map)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
diff --git a/src/mame/drivers/plygonet.cpp b/src/mame/drivers/plygonet.cpp
index 83574fc000b..913efc2ccfc 100644
--- a/src/mame/drivers/plygonet.cpp
+++ b/src/mame/drivers/plygonet.cpp
@@ -70,6 +70,7 @@
#include "cpu/dsp56k/dsp56k.h"
#include "sound/k054539.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "includes/plygonet.h"
enum { BANK_GROUP_A, BANK_GROUP_B, INVALID_BANK_GROUP };
@@ -480,7 +481,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, polygonet_state )
AM_RANGE(0x600000, 0x600007) AM_WRITE8(sound_comms_w, 0xffffffff)
AM_RANGE(0x600008, 0x60000b) AM_READ8(sound_comms_r, 0xffffffff)
AM_RANGE(0x640000, 0x640003) AM_WRITE(sound_irq_w)
- AM_RANGE(0x680000, 0x680003) AM_WRITE(watchdog_reset32_w)
+ AM_RANGE(0x680000, 0x680003) AM_DEVWRITE("watchdog", watchdog_timer_device, reset32_w)
AM_RANGE(0x700000, 0x73ffff) AM_ROM AM_REGION("gfx2", 0)
AM_RANGE(0x780000, 0x79ffff) AM_ROM AM_REGION("gfx1", 0)
AM_RANGE(0xff8000, 0xffffff) AM_RAM
@@ -618,6 +619,8 @@ static MACHINE_CONFIG_START( plygonet, polygonet_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", plygonet)
/* video hardware */
diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp
index 614aca0c890..a56d51b4d34 100644
--- a/src/mame/drivers/polepos.cpp
+++ b/src/mame/drivers/polepos.cpp
@@ -229,6 +229,7 @@ Todo:
#include "includes/polepos.h"
#include "sound/tms5220.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "polepos.lh"
#include "topracer.lh"
@@ -458,7 +459,7 @@ static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, polepos_state )
AM_RANGE(0x9100, 0x9100) AM_MIRROR(0x0eff) AM_DEVREADWRITE("06xx", namco_06xx_device, ctrl_r, ctrl_w)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0cff) AM_READ(polepos_ready_r) /* READY */
AM_RANGE(0xa000, 0xa007) AM_MIRROR(0x0cf8) AM_WRITE(polepos_latch_w) /* misc latches */
- AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w) /* Watchdog */
+ AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x0cff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xa200, 0xa200) AM_MIRROR(0x0cff) AM_DEVWRITE("polepos", polepos_sound_device, polepos_engine_sound_lsb_w) /* Car Sound ( Lower Nibble ) */
AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x0cff) AM_DEVWRITE("polepos", polepos_sound_device, polepos_engine_sound_msb_w) /* Car Sound ( Upper Nibble ) */
ADDRESS_MAP_END
@@ -875,7 +876,8 @@ static MACHINE_CONFIG_START( polepos, polepos_state )
MCFG_NAMCO_06XX_WRITE_2_CB(DEVWRITE8("52xx", namco_52xx_device, write))
MCFG_NAMCO_06XX_WRITE_3_CB(DEVWRITE8("54xx", namco_54xx_device, write))
- MCFG_WATCHDOG_VBLANK_INIT(16) // 128V clocks the same as VBLANK
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 16) // 128V clocks the same as VBLANK
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* some interleaving */
@@ -944,7 +946,8 @@ static MACHINE_CONFIG_START( topracern, polepos_state )
MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
- MCFG_WATCHDOG_VBLANK_INIT(16) // 128V clocks the same as VBLANK
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 16) // 128V clocks the same as VBLANK
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* some interleaving */
diff --git a/src/mame/drivers/poolshrk.cpp b/src/mame/drivers/poolshrk.cpp
index 195de4b9b35..5e68c623bb4 100644
--- a/src/mame/drivers/poolshrk.cpp
+++ b/src/mame/drivers/poolshrk.cpp
@@ -65,7 +65,7 @@ WRITE8_MEMBER(poolshrk_state::watchdog_w)
{
if ((offset & 3) == 3)
{
- watchdog_reset_w(space, 0, 0);
+ m_watchdog->reset_w(space, 0, 0);
}
}
@@ -83,7 +83,7 @@ READ8_MEMBER(poolshrk_state::input_r)
if ((offset & 3) == 3)
{
- watchdog_reset_r(space, 0);
+ m_watchdog->reset_r(space, 0);
}
return val;
@@ -219,6 +219,8 @@ static MACHINE_CONFIG_START( poolshrk, poolshrk_state )
MCFG_CPU_PROGRAM_MAP(poolshrk_cpu_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", poolshrk_state, irq0_line_assert)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/pooyan.cpp b/src/mame/drivers/pooyan.cpp
index 074a514be71..5b02066e949 100644
--- a/src/mame/drivers/pooyan.cpp
+++ b/src/mame/drivers/pooyan.cpp
@@ -12,6 +12,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "audio/timeplt.h"
#include "includes/pooyan.h"
#include "includes/konamipt.h"
@@ -59,7 +60,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, pooyan_state )
AM_RANGE(0xa0a0, 0xa0a0) AM_MIRROR(0x5e1f) AM_READ_PORT("IN1")
AM_RANGE(0xa0c0, 0xa0c0) AM_MIRROR(0x5e1f) AM_READ_PORT("IN2")
AM_RANGE(0xa0e0, 0xa0e0) AM_MIRROR(0x5e1f) AM_READ_PORT("DSW0")
- AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x5e7f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x5e7f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x5e7f) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa180, 0xa180) AM_MIRROR(0x5e78) AM_WRITE(irq_enable_w)
AM_RANGE(0xa181, 0xa181) AM_MIRROR(0x5e78) AM_DEVWRITE("timeplt_audio", timeplt_audio_device, sh_irqtrigger_w)
@@ -191,6 +192,7 @@ static MACHINE_CONFIG_START( pooyan, pooyan_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pooyan_state, interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/psikyosh.cpp b/src/mame/drivers/psikyosh.cpp
index a0c29f3bec8..a1cb2882935 100644
--- a/src/mame/drivers/psikyosh.cpp
+++ b/src/mame/drivers/psikyosh.cpp
@@ -277,6 +277,7 @@ Notes:
#include "cpu/sh2/sh2.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/ymf278b.h"
#include "includes/psikyosh.h"
@@ -494,7 +495,7 @@ static ADDRESS_MAP_START( ps3v1_map, AS_PROGRAM, 32, psikyosh_state )
AM_RANGE(0x03004000, 0x0300ffff) AM_RAM AM_SHARE("bgram") // video banks 7-0x1f (backgrounds and other effects)
AM_RANGE(0x03040000, 0x03044fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // palette..
AM_RANGE(0x03050000, 0x030501ff) AM_RAM AM_SHARE("zoomram") // sprite zoom lookup table
- AM_RANGE(0x0305ffdc, 0x0305ffdf) AM_READ(watchdog_reset32_r) AM_WRITE(psikyosh_irqctrl_w) // also writes to this address - might be vblank reads?
+ AM_RANGE(0x0305ffdc, 0x0305ffdf) AM_DEVREAD("watchdog", watchdog_timer_device, reset32_r) AM_WRITE(psikyosh_irqctrl_w) // also writes to this address - might be vblank reads?
AM_RANGE(0x0305ffe0, 0x0305ffff) AM_RAM_WRITE(psikyosh_vidregs_w) AM_SHARE("vidregs") // video registers
AM_RANGE(0x03060000, 0x0307ffff) AM_ROMBANK("gfxbank") // data for rom tests (gfx), data is controlled by vidreg
// rom mapping
@@ -770,6 +771,7 @@ static MACHINE_CONFIG_START( psikyo3v1, psikyosh_state )
MCFG_CPU_PROGRAM_MAP(ps3v1_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", psikyosh_state, psikyosh_interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_EEPROM_SERIAL_93C56_8BIT_ADD("eeprom")
MCFG_EEPROM_SERIAL_DEFAULT_VALUE(0)
diff --git a/src/mame/drivers/quantum.cpp b/src/mame/drivers/quantum.cpp
index c62de3a88e6..bcf7502206c 100644
--- a/src/mame/drivers/quantum.cpp
+++ b/src/mame/drivers/quantum.cpp
@@ -55,6 +55,7 @@ NOTE: The Atari 136002-125 PROM in the sets below wasn't dumped from an actual
#include "sound/pokey.h"
#include "sound/discrete.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
class quantum_state : public driver_device
@@ -151,7 +152,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, quantum_state )
AM_RANGE(0x960000, 0x960001) AM_WRITENOP
AM_RANGE(0x968000, 0x968001) AM_DEVWRITE("avg", avg_quantum_device, reset_word_w)
AM_RANGE(0x970000, 0x970001) AM_DEVWRITE("avg", avg_quantum_device, go_word_w)
- AM_RANGE(0x978000, 0x978001) AM_READNOP AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x978000, 0x978001) AM_READNOP AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
ADDRESS_MAP_END
@@ -270,6 +271,8 @@ static MACHINE_CONFIG_START( quantum, quantum_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
diff --git a/src/mame/drivers/rallyx.cpp b/src/mame/drivers/rallyx.cpp
index dcce5a906fe..04984b62d05 100644
--- a/src/mame/drivers/rallyx.cpp
+++ b/src/mame/drivers/rallyx.cpp
@@ -192,6 +192,7 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/samples.h"
#include "includes/rallyx.h"
@@ -317,7 +318,7 @@ static ADDRESS_MAP_START( rallyx_map, AS_PROGRAM, 8, rallyx_state )
AM_RANGE(0xa080, 0xa080) AM_READ_PORT("P2")
AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW")
AM_RANGE(0xa000, 0xa00f) AM_WRITEONLY AM_SHARE("radarattr")
- AM_RANGE(0xa080, 0xa080) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa080, 0xa080) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xa100, 0xa11f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
AM_RANGE(0xa130, 0xa130) AM_WRITE(rallyx_scrollx_w)
AM_RANGE(0xa140, 0xa140) AM_WRITE(rallyx_scrolly_w)
@@ -340,7 +341,7 @@ static ADDRESS_MAP_START( jungler_map, AS_PROGRAM, 8, rallyx_state )
AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW1")
AM_RANGE(0xa180, 0xa180) AM_READ_PORT("DSW2")
AM_RANGE(0xa000, 0xa00f) AM_MIRROR(0x00f0) AM_WRITEONLY AM_SHARE("radarattr") // jungler writes to a03x
- AM_RANGE(0xa080, 0xa080) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xa080, 0xa080) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xa100, 0xa100) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa130, 0xa130) AM_WRITE(rallyx_scrollx_w) /* only jungler and tactcian */
AM_RANGE(0xa140, 0xa140) AM_WRITE(rallyx_scrolly_w) /* only jungler and tactcian */
@@ -844,6 +845,8 @@ static MACHINE_CONFIG_START( rallyx, rallyx_state )
MCFG_CPU_IO_MAP(io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", rallyx_state, rallyx_vblank_irq)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_START_OVERRIDE(rallyx_state,rallyx)
MCFG_MACHINE_RESET_OVERRIDE(rallyx_state,rallyx)
@@ -885,6 +888,8 @@ static MACHINE_CONFIG_START( jungler, rallyx_state )
MCFG_CPU_PROGRAM_MAP(jungler_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", rallyx_state, jungler_vblank_irq)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_START_OVERRIDE(rallyx_state,rallyx)
MCFG_MACHINE_RESET_OVERRIDE(rallyx_state,rallyx)
diff --git a/src/mame/drivers/rampart.cpp b/src/mame/drivers/rampart.cpp
index 9c0827a39bc..ef851b8d323 100644
--- a/src/mame/drivers/rampart.cpp
+++ b/src/mame/drivers/rampart.cpp
@@ -26,6 +26,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "sound/2413intf.h"
#include "includes/rampart.h"
@@ -145,7 +146,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, rampart_state )
AM_RANGE(0x6c0002, 0x6c0003) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK1")
AM_RANGE(0x6c0004, 0x6c0005) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK2")
AM_RANGE(0x6c0006, 0x6c0007) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK3")
- AM_RANGE(0x726000, 0x726001) AM_MIRROR(0x019ffe) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x726000, 0x726001) AM_MIRROR(0x019ffe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x7e6000, 0x7e6001) AM_MIRROR(0x019ffe) AM_WRITE(scanline_int_ack_w)
ADDRESS_MAP_END
@@ -345,7 +346,8 @@ static MACHINE_CONFIG_START( rampart, rampart_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rampart)
diff --git a/src/mame/drivers/rastan.cpp b/src/mame/drivers/rastan.cpp
index 8ee49dd6992..ad62a646ebe 100644
--- a/src/mame/drivers/rastan.cpp
+++ b/src/mame/drivers/rastan.cpp
@@ -156,6 +156,7 @@ Note: The 'rastsagaa' set's rom numbers were named as RSxx_37 through RSxx_42
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "includes/taitoipt.h"
#include "audio/taitosnd.h"
#include "sound/2151intf.h"
@@ -213,7 +214,7 @@ static ADDRESS_MAP_START( rastan_map, AS_PROGRAM, 16, rastan_state )
AM_RANGE(0x390006, 0x390007) AM_READ_PORT("SYSTEM")
AM_RANGE(0x390008, 0x390009) AM_READ_PORT("DSWA")
AM_RANGE(0x39000a, 0x39000b) AM_READ_PORT("DSWB")
- AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x3c0000, 0x3c0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("pc080sn", pc080sn_device, word_r, word_w)
@@ -367,6 +368,7 @@ static MACHINE_CONFIG_START( rastan, rastan_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/relief.cpp b/src/mame/drivers/relief.cpp
index 82915064d71..04c2a9cfae2 100644
--- a/src/mame/drivers/relief.cpp
+++ b/src/mame/drivers/relief.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "machine/atarigen.h"
#include "sound/okim6295.h"
#include "sound/2413intf.h"
@@ -130,7 +131,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, relief_state )
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("260002")
AM_RANGE(0x260010, 0x260011) AM_READ(special_port2_r)
AM_RANGE(0x260012, 0x260013) AM_READ_PORT("260012")
- AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2a0000, 0x2a0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x3effc0, 0x3effff) AM_DEVREADWRITE("vad", atari_vad_device, control_read, control_write)
AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_DEVWRITE("vad", atari_vad_device, playfield2_latched_msb_w) AM_SHARE("vad:playfield2")
@@ -274,6 +275,8 @@ static MACHINE_CONFIG_START( relief, relief_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", relief)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/retofinv.cpp b/src/mame/drivers/retofinv.cpp
index 7814b7707e3..ae14e05be51 100644
--- a/src/mame/drivers/retofinv.cpp
+++ b/src/mame/drivers/retofinv.cpp
@@ -33,6 +33,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "includes/retofinv.h"
@@ -142,7 +143,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, retofinv_state )
AM_RANGE(0xc803, 0xc803) AM_WRITE(mcu_reset_w)
// AM_RANGE(0xc804, 0xc804) AM_WRITE(irq1_ack_w) // presumably (meaning memory map is shared with cpu 1)
AM_RANGE(0xc805, 0xc805) AM_WRITE(cpu1_reset_w)
- AM_RANGE(0xd000, 0xd000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd800, 0xd800) AM_WRITE(soundcommand_w)
AM_RANGE(0xe000, 0xe000) AM_READ(mcu_r)
AM_RANGE(0xe800, 0xe800) AM_WRITE(mcu_w)
@@ -386,6 +387,8 @@ static MACHINE_CONFIG_START( retofinv, retofinv_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - enough for the sound CPU to read all commands */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/rockrage.cpp b/src/mame/drivers/rockrage.cpp
index f691a23c579..ef7260d82e9 100644
--- a/src/mame/drivers/rockrage.cpp
+++ b/src/mame/drivers/rockrage.cpp
@@ -52,6 +52,7 @@ Notes:
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6809/hd6309.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/rockrage.h"
#include "includes/konamipt.h"
@@ -105,7 +106,7 @@ static ADDRESS_MAP_START( rockrage_map, AS_PROGRAM, 8, rockrage_state )
AM_RANGE(0x2e03, 0x2e03) AM_READ_PORT("DSW2")
AM_RANGE(0x2e40, 0x2e40) AM_READ_PORT("DSW1")
AM_RANGE(0x2e80, 0x2e80) AM_WRITE(rockrage_sh_irqtrigger_w) /* cause interrupt on audio CPU */
- AM_RANGE(0x2ec0, 0x2ec0) AM_WRITE(watchdog_reset_w) /* watchdog reset */
+ AM_RANGE(0x2ec0, 0x2ec0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2f00, 0x2f00) AM_WRITE(rockrage_vreg_w) /* ??? */
AM_RANGE(0x2f40, 0x2f40) AM_WRITE(rockrage_bankswitch_w) /* bankswitch control */
AM_RANGE(0x4000, 0x5fff) AM_RAM /* RAM */
@@ -246,6 +247,7 @@ static MACHINE_CONFIG_START( rockrage, rockrage_state )
MCFG_CPU_ADD("audiocpu", M6809, 1500000) /* 24MHz/16 */
MCFG_CPU_PROGRAM_MAP(rockrage_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/rocnrope.cpp b/src/mame/drivers/rocnrope.cpp
index 4823bc6d7fb..e950bea570a 100644
--- a/src/mame/drivers/rocnrope.cpp
+++ b/src/mame/drivers/rocnrope.cpp
@@ -11,6 +11,7 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "machine/konami1.h"
+#include "machine/watchdog.h"
#include "audio/timeplt.h"
#include "includes/konamipt.h"
#include "includes/rocnrope.h"
@@ -58,7 +59,7 @@ static ADDRESS_MAP_START( rocnrope_map, AS_PROGRAM, 8, rocnrope_state )
AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(rocnrope_colorram_w) AM_SHARE("colorram")
AM_RANGE(0x4c00, 0x4fff) AM_RAM_WRITE(rocnrope_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x5000, 0x5fff) AM_RAM
- AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x8080, 0x8080) AM_WRITE(rocnrope_flipscreen_w)
AM_RANGE(0x8081, 0x8081) AM_DEVWRITE("timeplt_audio", timeplt_audio_device, sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x8082, 0x8082) AM_WRITENOP /* ??? */
@@ -203,6 +204,8 @@ static MACHINE_CONFIG_START( rocnrope, rocnrope_state )
MCFG_CPU_PROGRAM_MAP(rocnrope_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", rocnrope_state, vblank_irq)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/rollerg.cpp b/src/mame/drivers/rollerg.cpp
index ec5e0c07bea..2e6353a0f4b 100644
--- a/src/mame/drivers/rollerg.cpp
+++ b/src/mame/drivers/rollerg.cpp
@@ -15,6 +15,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
+#include "machine/watchdog.h"
#include "sound/3812intf.h"
#include "sound/k053260.h"
#include "includes/rollerg.h"
@@ -74,7 +75,7 @@ READ8_MEMBER(rollerg_state::pip_r)
static ADDRESS_MAP_START( rollerg_map, AS_PROGRAM, 8, rollerg_state )
AM_RANGE(0x0010, 0x0010) AM_WRITE(rollerg_0010_w)
- AM_RANGE(0x0020, 0x0020) AM_READWRITE(watchdog_reset_r,watchdog_reset_w)
+ AM_RANGE(0x0020, 0x0020) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset_r, reset_w)
AM_RANGE(0x0030, 0x0031) AM_DEVREADWRITE("k053260", k053260_device, main_read, main_write)
AM_RANGE(0x0040, 0x0040) AM_WRITE(soundirq_w)
AM_RANGE(0x0050, 0x0050) AM_READ_PORT("P1")
@@ -247,6 +248,8 @@ static MACHINE_CONFIG_START( rollerg, rollerg_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545)
MCFG_CPU_PROGRAM_MAP(rollerg_sound_map) /* NMIs are generated by the 053260 */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/sandscrp.cpp b/src/mame/drivers/sandscrp.cpp
index f42ccc583b9..49ad0c212f0 100644
--- a/src/mame/drivers/sandscrp.cpp
+++ b/src/mame/drivers/sandscrp.cpp
@@ -75,6 +75,7 @@ Is there another alt program rom set labeled 9 & 10?
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
@@ -279,7 +280,7 @@ static ADDRESS_MAP_START( sandscrp, AS_PROGRAM, 16, sandscrp_state )
AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2")
AM_RANGE(0xb00004, 0xb00005) AM_READ_PORT("SYSTEM")
AM_RANGE(0xb00006, 0xb00007) AM_READ_PORT("UNK")
- AM_RANGE(0xec0000, 0xec0001) AM_READ(watchdog_reset16_r) //
+ AM_RANGE(0xec0000, 0xec0001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x800000, 0x800001) AM_READ(irq_cause_r) // IRQ Cause
AM_RANGE(0xe00000, 0xe00001) AM_READWRITE(soundlatch_word_r, soundlatch_word_w) // From/To Sound CPU
AM_RANGE(0xe40000, 0xe40001) AM_READWRITE(latchstatus_word_r, latchstatus_word_w) //
@@ -473,6 +474,7 @@ static MACHINE_CONFIG_START( sandscrp, sandscrp_state )
MCFG_CPU_PROGRAM_MAP(sandscrp_soundmem)
MCFG_CPU_IO_MAP(sandscrp_soundport)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3)) /* a guess, and certainly wrong */
/* video hardware */
diff --git a/src/mame/drivers/sauro.cpp b/src/mame/drivers/sauro.cpp
index 6a243455319..025bb01e388 100644
--- a/src/mame/drivers/sauro.cpp
+++ b/src/mame/drivers/sauro.cpp
@@ -127,6 +127,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "sound/3812intf.h"
#include "includes/sauro.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
WRITE8_MEMBER(sauro_state::sauro_sound_command_w)
@@ -196,7 +197,7 @@ static ADDRESS_MAP_START( sauro_io_map, AS_IO, 8, sauro_state )
AM_RANGE(0xcc, 0xcc) AM_WRITENOP /* same as 0xca */
AM_RANGE(0xcd, 0xcd) AM_WRITENOP /* same as 0xcb */
AM_RANGE(0xce, 0xce) AM_WRITENOP /* only written at startup */
- AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xe0, 0xe0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sauro_sound_map, AS_PROGRAM, 8, sauro_state )
@@ -221,13 +222,13 @@ static ADDRESS_MAP_START( trckydoc_map, AS_PROGRAM, 8, sauro_state )
AM_RANGE(0xf810, 0xf810) AM_READ_PORT("P1")
AM_RANGE(0xf818, 0xf818) AM_READ_PORT("P2")
AM_RANGE(0xf820, 0xf821) AM_DEVWRITE("ymsnd", ym3812_device, write)
- AM_RANGE(0xf828, 0xf828) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf828, 0xf828) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xf830, 0xf830) AM_WRITE(scroll_bg_w)
AM_RANGE(0xf838, 0xf838) AM_WRITENOP /* only written at startup */
AM_RANGE(0xf839, 0xf839) AM_WRITE(flip_screen_w)
AM_RANGE(0xf83a, 0xf83a) AM_WRITE(coin1_w)
AM_RANGE(0xf83b, 0xf83b) AM_WRITE(coin2_w)
- AM_RANGE(0xf83c, 0xf83c) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xf83c, 0xf83c) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xf83f, 0xf83f) AM_WRITENOP /* only written at startup */
ADDRESS_MAP_END
@@ -370,6 +371,8 @@ static MACHINE_CONFIG_START( tecfri, sauro_state )
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(55.72) /* verified on pcb */
diff --git a/src/mame/drivers/sbasketb.cpp b/src/mame/drivers/sbasketb.cpp
index 3a80a242f7e..5561fe8dabe 100644
--- a/src/mame/drivers/sbasketb.cpp
+++ b/src/mame/drivers/sbasketb.cpp
@@ -45,6 +45,7 @@ CPU/Video Board Parts:
#include "cpu/m6809/m6809.h"
#include "sound/dac.h"
#include "machine/konami1.h"
+#include "machine/watchdog.h"
#include "includes/konamipt.h"
#include "audio/trackfld.h"
#include "includes/sbasketb.h"
@@ -71,7 +72,7 @@ static ADDRESS_MAP_START( sbasketb_map, AS_PROGRAM, 8, sbasketb_state )
AM_RANGE(0x3400, 0x37ff) AM_RAM_WRITE(sbasketb_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x3800, 0x39ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x3a00, 0x3bff) AM_RAM /* Probably unused, but initialized */
- AM_RANGE(0x3c00, 0x3c00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3c00, 0x3c00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3c10, 0x3c10) AM_READNOP /* ???? */
AM_RANGE(0x3c20, 0x3c20) AM_WRITEONLY AM_SHARE("palettebank")
AM_RANGE(0x3c80, 0x3c80) AM_WRITE(sbasketb_flipscreen_w)
@@ -191,6 +192,8 @@ static MACHINE_CONFIG_START( sbasketb, sbasketb_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz / 4) /* 3.5795 MHz */
MCFG_CPU_PROGRAM_MAP(sbasketb_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/sbowling.cpp b/src/mame/drivers/sbowling.cpp
index 189639a051d..0f23ede98ed 100644
--- a/src/mame/drivers/sbowling.cpp
+++ b/src/mame/drivers/sbowling.cpp
@@ -42,6 +42,7 @@ PROMs : NEC B406 (1kx4) x2
#include "emu.h"
#include "cpu/i8085/i8085.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/watchdog.h"
#include "video/resnet.h"
#include "sound/ay8910.h"
@@ -250,7 +251,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( port_map, AS_IO, 8, sbowling_state )
- AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x01, 0x01) AM_READWRITE(controls_r, pix_data_w)
AM_RANGE(0x02, 0x02) AM_READWRITE(pix_data_r, pix_shift_w)
AM_RANGE(0x03, 0x03) AM_READ_PORT("IN1") AM_WRITENOP
@@ -404,6 +405,8 @@ static MACHINE_CONFIG_START( sbowling, sbowling_state )
MCFG_CPU_IO_MAP(port_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/sbrkout.cpp b/src/mame/drivers/sbrkout.cpp
index 69dd21dcbea..83a94d47560 100644
--- a/src/mame/drivers/sbrkout.cpp
+++ b/src/mame/drivers/sbrkout.cpp
@@ -36,6 +36,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "sbrkout.lh"
@@ -407,7 +408,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbrkout_state )
AM_RANGE(0x0c50, 0x0c51) AM_MIRROR(0x000e) AM_WRITE(pot_mask1_w)
AM_RANGE(0x0c60, 0x0c61) AM_MIRROR(0x000e) AM_WRITE(pot_mask2_w)
AM_RANGE(0x0c70, 0x0c71) AM_MIRROR(0x000e) AM_WRITE(coincount_w)
- AM_RANGE(0x0c80, 0x0c80) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0c80, 0x0c80) AM_MIRROR(0x007f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0e00, 0x0e00) AM_MIRROR(0x007f) AM_WRITE(irq_ack_w)
AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x03ff) AM_READ(sync2_r)
AM_RANGE(0x2800, 0x3fff) AM_ROM
@@ -429,7 +430,7 @@ static ADDRESS_MAP_START( sbrkoutct_main_map, AS_PROGRAM, 8, sbrkout_state )
AM_RANGE(0x0c50, 0x0c51) AM_MIRROR(0x000e) AM_WRITE(pot_mask1_w)
AM_RANGE(0x0c60, 0x0c61) AM_MIRROR(0x000e) AM_WRITE(pot_mask2_w)
AM_RANGE(0x0c70, 0x0c71) AM_MIRROR(0x000e) AM_WRITE(coincount_w)
- AM_RANGE(0x0c80, 0x0c80) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0c80, 0x0c80) AM_MIRROR(0x007f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0e00, 0x0e00) AM_MIRROR(0x007f) AM_WRITE(irq_ack_w)
AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x03ff) AM_READ(sync2_r)
AM_RANGE(0x2800, 0x3fff) AM_ROM
@@ -584,7 +585,8 @@ static MACHINE_CONFIG_START( sbrkout, sbrkout_state )
MCFG_CPU_ADD("maincpu", M6502,MAIN_CLOCK/16) /* 375 KHz? Should be 750KHz? */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", sbrkout)
diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp
index 08c51b55cef..5cf4d5d7115 100644
--- a/src/mame/drivers/scobra.cpp
+++ b/src/mame/drivers/scobra.cpp
@@ -38,6 +38,7 @@ Notes/Tidbits:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/scramble.h"
@@ -122,7 +123,7 @@ static ADDRESS_MAP_START( type1_map, AS_PROGRAM, 8, scobra_state )
AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( type2_map, AS_PROGRAM, 8, scobra_state )
@@ -134,7 +135,7 @@ static ADDRESS_MAP_START( type2_map, AS_PROGRAM, 8, scobra_state )
AM_RANGE(0x8880, 0x88ff) AM_RAM
AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x9400, 0x97ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) /* mirror */
- AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x9800, 0x9800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xa000, 0xa00f) AM_READWRITE(scobra_type2_ppi8255_0_r, scobra_type2_ppi8255_0_w)
AM_RANGE(0xa800, 0xa80f) AM_READWRITE(scobra_type2_ppi8255_1_r, scobra_type2_ppi8255_1_w)
AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_stars_enable_w)
@@ -157,7 +158,7 @@ static ADDRESS_MAP_START( hustler_map, AS_PROGRAM, 8, scobra_state )
AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_nmi_enable_w)
AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
AM_RANGE(0xa80e, 0xa80e) AM_WRITENOP /* coin counters */
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xd000, 0xd01f) AM_READWRITE(hustler_ppi8255_0_r, hustler_ppi8255_0_w)
AM_RANGE(0xe000, 0xe01f) AM_READWRITE(hustler_ppi8255_1_r, hustler_ppi8255_1_w)
ADDRESS_MAP_END
@@ -174,7 +175,7 @@ static ADDRESS_MAP_START( hustlerb_map, AS_PROGRAM, 8, scobra_state )
AM_RANGE(0xa802, 0xa802) AM_WRITENOP /* coin counters */
AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_x_w)
- AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xc100, 0xc103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
AM_RANGE(0xc200, 0xc203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
ADDRESS_MAP_END
@@ -195,7 +196,7 @@ static ADDRESS_MAP_START( mimonkey_map, AS_PROGRAM, 8, scobra_state )
AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxold_gfxbank_w)
AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -232,7 +233,7 @@ static ADDRESS_MAP_START( rescuefe_map, AS_PROGRAM, 8, scobra_state )
// addresses below are WRONG, just moved to keep things out the way while the rom mapping is figured out
// AM_RANGE(0xf802, 0xf802) AM_WRITE(galaxold_coin_counter_w)
-// AM_RANGE(0xf000, 0xf000) AM_READ(watchdog_reset_r)
+// AM_RANGE(0xf000, 0xf000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( minefldfe_map, AS_PROGRAM, 8, scobra_state )
@@ -260,7 +261,7 @@ static ADDRESS_MAP_START( minefldfe_map, AS_PROGRAM, 8, scobra_state )
- AM_RANGE(0x1D98, 0x1D98) AM_READ(watchdog_reset_r) // 0xb000
+ AM_RANGE(0x1D98, 0x1D98) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) // 0xb000
// addresses below are WRONG, just moved to keep things out the way while the rom mapping is figured out
@@ -791,6 +792,8 @@ static MACHINE_CONFIG_START( type1, scobra_state )
MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(16000.0/132/2)
@@ -940,6 +943,8 @@ static MACHINE_CONFIG_START( hustler, scobra_state )
MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
diff --git a/src/mame/drivers/scotrsht.cpp b/src/mame/drivers/scotrsht.cpp
index 56a8c98d332..37d18fbf8a2 100644
--- a/src/mame/drivers/scotrsht.cpp
+++ b/src/mame/drivers/scotrsht.cpp
@@ -37,6 +37,7 @@ Stephh's notes (based on the game M6502 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/konamipt.h"
#include "includes/scotrsht.h"
@@ -79,7 +80,7 @@ static ADDRESS_MAP_START( scotrsht_map, AS_PROGRAM, 8, scotrsht_state )
AM_RANGE(0x3301, 0x3301) AM_READ_PORT("P1")
AM_RANGE(0x3302, 0x3302) AM_READ_PORT("P2")
AM_RANGE(0x3303, 0x3303) AM_READ_PORT("DSW1")
- AM_RANGE(0x3300, 0x3300) AM_WRITE(watchdog_reset_w) /* watchdog */
+ AM_RANGE(0x3300, 0x3300) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -190,6 +191,8 @@ static MACHINE_CONFIG_START( scotrsht, scotrsht_state )
MCFG_CPU_PROGRAM_MAP(scotrsht_sound_map)
MCFG_CPU_IO_MAP(scotrsht_sound_port)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/scramble.cpp b/src/mame/drivers/scramble.cpp
index 0367935ca77..c3c1766c022 100644
--- a/src/mame/drivers/scramble.cpp
+++ b/src/mame/drivers/scramble.cpp
@@ -34,6 +34,7 @@ Notes:
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "machine/i8255.h"
+#include "machine/watchdog.h"
#include "includes/scramble.h"
@@ -52,8 +53,8 @@ static ADDRESS_MAP_START( scramble_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
- AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
+ AM_RANGE(0x7800, 0x7800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
AM_RANGE(0x8110, 0x8113) AM_DEVREAD("ppi8255_0", i8255_device, read) /* mirror for Frog */
AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
@@ -109,7 +110,7 @@ static ADDRESS_MAP_START( turpins_map, AS_PROGRAM, 8, scramble_state )
// AM_RANGE(0x8100, 0x8103) AM_WRITE("ppi8255_0", i8255_device, write)
// AM_RANGE(0x8200, 0x8203) AM_WRITE("ppi8255_1", i8255_device, write)
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
// AM_RANGE(0x8100, 0x8103) AM_READ("ppi8255_0", i8255_device, read)
// AM_RANGE(0x8200, 0x8203) AM_READ("ppi8255_1", i8255_device, read)
@@ -132,7 +133,7 @@ static ADDRESS_MAP_START( ckongs_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w)
AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
@@ -172,7 +173,7 @@ static ADDRESS_MAP_START( mars_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x7000, 0x7000) AM_READNOP
AM_RANGE(0x8100, 0x810f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w)
AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w)
@@ -195,7 +196,7 @@ static ADDRESS_MAP_START( newsin7_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w)
AM_RANGE(0xa000, 0xafff) AM_ROM
AM_RANGE(0xc100, 0xc10f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w)
@@ -217,7 +218,7 @@ static ADDRESS_MAP_START( mrkougar_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8100, 0x810f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w)
AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w)
ADDRESS_MAP_END
@@ -239,7 +240,7 @@ static ADDRESS_MAP_START( hotshock_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6005, 0x6005) AM_WRITE(galaxold_coin_counter_0_w)
AM_RANGE(0x6006, 0x6006) AM_WRITE(galaxold_gfxbank_w)
AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
- AM_RANGE(0x7000, 0x7000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x7000, 0x7000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0") AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1")
AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2")
@@ -259,8 +260,8 @@ static ADDRESS_MAP_START( hunchbks_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x1500, 0x1503) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
AM_RANGE(0x1606, 0x1606) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x1607, 0x1607) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x1680, 0x1680) AM_READ(watchdog_reset_r)
- AM_RANGE(0x1780, 0x1780) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x1680, 0x1680) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
+ AM_RANGE(0x1780, 0x1780) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(galaxold_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x1c00, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2fff) AM_ROM
@@ -286,7 +287,7 @@ static ADDRESS_MAP_START( mimonscr_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxold_gfxbank_w)
AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
AM_RANGE(0xc000, 0xffff) AM_ROM
@@ -311,7 +312,7 @@ static ADDRESS_MAP_START( ad2083_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6807, 0x6807) AM_WRITE(scrambold_background_green_w)
AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w)
- AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0")
AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1")
AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2")
@@ -337,7 +338,7 @@ static ADDRESS_MAP_START( triplep_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
- AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
ADDRESS_MAP_END
@@ -389,7 +390,7 @@ static ADDRESS_MAP_START( harem_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) // mirror address
AM_RANGE(0x5000, 0x5000) AM_RAM_WRITE(racknrol_tiles_bank_w) AM_SHARE("racknrol_tbank") // high bits of tiles, 1 bit every 4 columns
- AM_RANGE(0x5800, 0x5800) AM_READ(watchdog_reset_r) AM_WRITE(galaxold_nmi_enable_w)
+ AM_RANGE(0x5800, 0x5800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(galaxold_nmi_enable_w)
AM_RANGE(0x5801, 0x5801) AM_WRITE(harem_decrypt_clk_w) // run-time bitswap selection
AM_RANGE(0x5802, 0x5802) AM_WRITE(harem_decrypt_bit_w)
@@ -1388,6 +1389,8 @@ static MACHINE_CONFIG_START( scramble, scramble_state )
MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_RESET_OVERRIDE(scramble_state,scramble)
MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
@@ -1656,6 +1659,8 @@ static MACHINE_CONFIG_START( ad2083, scramble_state )
MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_RESET_OVERRIDE(scramble_state,galaxold)
/* video hardware */
diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp
index cd7e3cd31af..a07de247de8 100644
--- a/src/mame/drivers/segaorun.cpp
+++ b/src/mame/drivers/segaorun.cpp
@@ -700,7 +700,7 @@ READ16_MEMBER( segaorun_state::outrun_custom_io_r )
}
case 0x60/2:
- return watchdog_reset_r(space, 0);
+ return m_watchdog->reset_r(space, 0);
default:
break;
@@ -747,7 +747,7 @@ WRITE16_MEMBER( segaorun_state::outrun_custom_io_w )
return;
case 0x60/2:
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
return;
case 0x70/2:
@@ -830,7 +830,7 @@ WRITE16_MEMBER( segaorun_state::shangon_custom_io_w )
return;
case 0x3000/2:
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
return;
case 0x3020/2:
@@ -1169,6 +1169,8 @@ static MACHINE_CONFIG_START( outrun_base, segaorun_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_DEVICE_ADD("i8255", I8255, 0)
MCFG_I8255_IN_PORTA_CB(READ8(segaorun_state, bankmotor_limit_r))
MCFG_I8255_OUT_PORTA_CB(WRITE8(segaorun_state, unknown_porta_w))
diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp
index 9240b10d3bf..caed5dd589b 100644
--- a/src/mame/drivers/segas16a.cpp
+++ b/src/mame/drivers/segas16a.cpp
@@ -533,7 +533,7 @@ READ8_MEMBER( segas16a_state::mcu_io_r )
case 0:
// access watchdog? (unsure about this one)
if ( offset < 0x3fff)
- return watchdog_reset_r(space, 0);
+ return m_watchdog->reset_r(space, 0);
// access main work RAM
else if (offset >= 0x4000 && offset < 0x8000)
@@ -957,7 +957,7 @@ static ADDRESS_MAP_START( system16a_map, AS_PROGRAM, 16, segas16a_state )
AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_SHARE("sprites")
AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w)
- AM_RANGE(0xc60000, 0xc6ffff) AM_READ(watchdog_reset16_r)
+ AM_RANGE(0xc60000, 0xc6ffff) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0xc70000, 0xc73fff) AM_MIRROR(0x38c000) AM_RAM AM_SHARE("nvram")
ADDRESS_MAP_END
@@ -1908,6 +1908,8 @@ static MACHINE_CONFIG_START( system16a, segas16a_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_DEVICE_ADD("i8255", I8255, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(driver_device, soundlatch_byte_w))
MCFG_I8255_OUT_PORTB_CB(WRITE8(segas16a_state, misc_control_w))
diff --git a/src/mame/drivers/segaxbd.cpp b/src/mame/drivers/segaxbd.cpp
index 8366d3b10b2..56e906d0938 100644
--- a/src/mame/drivers/segaxbd.cpp
+++ b/src/mame/drivers/segaxbd.cpp
@@ -279,6 +279,7 @@ segaxbd_state::segaxbd_state(const machine_config &mconfig, const char *tag, dev
m_soundcpu(*this, "soundcpu"),
m_soundcpu2(*this, "soundcpu2"),
m_mcu(*this, "mcu"),
+ m_watchdog(*this, "watchdog"),
m_cmptimer_1(*this, "cmptimer_main"),
m_sprites(*this, "sprites"),
m_segaic16vid(*this, "segaic16vid"),
@@ -593,7 +594,7 @@ WRITE16_MEMBER( segaxbd_state::iochip_0_w )
// D1: (CONT) - affects sprite hardware
// D0: Sound section reset (1= normal operation, 0= reset)
if (((oldval ^ data) & 0x40) && !(data & 0x40))
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
m_segaic16vid->set_display_enable(data & 0x20);
@@ -1824,6 +1825,8 @@ static MACHINE_CONFIG_FRAGMENT( xboard )
MCFG_NVRAM_ADD_0FILL("backup2")
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_SEGA_315_5248_MULTIPLIER_ADD("multiplier_main")
MCFG_SEGA_315_5248_MULTIPLIER_ADD("multiplier_subx")
MCFG_SEGA_315_5249_DIVIDER_ADD("divider_main")
diff --git a/src/mame/drivers/segaybd.cpp b/src/mame/drivers/segaybd.cpp
index 534d5d5a164..ad60759a7d4 100644
--- a/src/mame/drivers/segaybd.cpp
+++ b/src/mame/drivers/segaybd.cpp
@@ -209,7 +209,7 @@ WRITE16_MEMBER( segaybd_state::io_chip_w )
//
m_segaic16vid->set_display_enable(data & 0x80);
if (((old ^ data) & 0x20) && !(data & 0x20))
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
m_subx->set_input_line(INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
m_suby->set_input_line(INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
@@ -1380,6 +1380,8 @@ static MACHINE_CONFIG_START( yboard, segaybd_state )
MCFG_NVRAM_ADD_0FILL("backupram")
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_SEGA_315_5248_MULTIPLIER_ADD("multiplier_main")
MCFG_SEGA_315_5248_MULTIPLIER_ADD("multiplier_subx")
MCFG_SEGA_315_5248_MULTIPLIER_ADD("multiplier_suby")
diff --git a/src/mame/drivers/seicross.cpp b/src/mame/drivers/seicross.cpp
index 41d6b9ea23c..ab912c70ae8 100644
--- a/src/mame/drivers/seicross.cpp
+++ b/src/mame/drivers/seicross.cpp
@@ -47,6 +47,7 @@ This info came from http://www.ne.jp/asahi/cc-sakura/akkun/old/fryski.html
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "includes/seicross.h"
@@ -113,7 +114,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, seicross_state )
AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") /* IN0 */
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") /* IN1 */
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("TEST") /* test */
- AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( main_portmap, AS_IO, 8, seicross_state )
@@ -396,6 +397,8 @@ static MACHINE_CONFIG_START( no_nvram, seicross_state )
MCFG_QUANTUM_TIME(attotime::from_hz(1200)) /* 20 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp
index 5374875f519..a40c080e356 100644
--- a/src/mame/drivers/seta.cpp
+++ b/src/mame/drivers/seta.cpp
@@ -1374,6 +1374,7 @@ Note: on screen copyright is (c)1998 Coinmaster.
#include "sound/okim6295.h"
#include "sound/2151intf.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#if __uPD71054_TIMER
// this mess should be replaced with pit8254, see madshark
@@ -1720,7 +1721,7 @@ static ADDRESS_MAP_START( calibr50_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x200000, 0x200fff) AM_RAM // NVRAM
AM_RANGE(0x300000, 0x300001) AM_READNOP // ? (value's read but not used)
AM_RANGE(0x300000, 0x300001) AM_WRITENOP // ? (random value)
- AM_RANGE(0x400000, 0x400001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x400000, 0x400001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x500000, 0x500001) AM_WRITENOP // ?
AM_RANGE(0x600000, 0x600003) AM_READ(seta_dsw_r) // DSW
AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_SHARE("paletteram") // Palette
@@ -1810,7 +1811,7 @@ static ADDRESS_MAP_START( usclssic_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0xb40010, 0xb40011) AM_READ_PORT("COINS") // Coins
AM_RANGE(0xb40010, 0xb40011) AM_WRITE(calibr50_soundlatch_w) // To Sub CPU
AM_RANGE(0xb40018, 0xb4001f) AM_READ(usclssic_dsw_r) // 2 DSWs
- AM_RANGE(0xb40018, 0xb40019) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0xb40018, 0xb40019) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xb80000, 0xb80001) AM_READNOP // Watchdog (value is discarded)?
AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spritecode_r16, spritecode_w16) // Sprites Code + X + Attr
AM_RANGE(0xd00000, 0xd03fff) AM_RAM_WRITE(seta_vram_0_w) AM_SHARE("vram_0") // VRAM
@@ -1997,7 +1998,7 @@ static ADDRESS_MAP_START( wrofaero_map, AS_PROGRAM, 16, seta_state )
#else
AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP // ?
#endif
- AM_RANGE(0xe00000, 0xe00001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xf00000, 0xf00001) AM_WRITENOP // ? Sound IRQ Ack
ADDRESS_MAP_END
@@ -2410,7 +2411,7 @@ static ADDRESS_MAP_START( extdwnhl_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2
AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins
AM_RANGE(0x400008, 0x40000b) AM_READ(seta_dsw_r) // DSW
- AM_RANGE(0x40000c, 0x40000d) AM_READWRITE(watchdog_reset16_r,watchdog_reset16_w) // Watchdog (extdwnhl (R) & sokonuke (W) MUST RETURN $FFFF)
+ AM_RANGE(0x40000c, 0x40000d) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w) // Watchdog (extdwnhl (R) & sokonuke (W) MUST RETURN $FFFF)
AM_RANGE(0x500000, 0x500003) AM_RAM_WRITE(seta_vregs_w) AM_SHARE("vregs") // Coin Lockout + Video Registers
AM_RANGE(0x500004, 0x500007) AM_NOP // IRQ Ack (extdwnhl (R) & sokonuke (W))
AM_RANGE(0x600400, 0x600fff) AM_RAM AM_SHARE("paletteram") // Palette
@@ -2441,7 +2442,7 @@ static ADDRESS_MAP_START( kamenrid_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2
AM_RANGE(0x500004, 0x500007) AM_READ(seta_dsw_r) // DSW
AM_RANGE(0x500008, 0x500009) AM_READ_PORT("COINS") // Coins
- AM_RANGE(0x50000c, 0x50000d) AM_READWRITE(watchdog_reset16_r,watchdog_reset16_w) // xx Watchdog? (sokonuke)
+ AM_RANGE(0x50000c, 0x50000d) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w) // xx Watchdog? (sokonuke)
AM_RANGE(0x600000, 0x600005) AM_RAM_WRITE(seta_vregs_w) AM_SHARE("vregs") // ? Coin Lockout + Video Registers
AM_RANGE(0x600006, 0x600007) AM_WRITENOP // ?
AM_RANGE(0x700000, 0x7003ff) AM_RAM // Palette RAM (tested)
@@ -2474,7 +2475,7 @@ static ADDRESS_MAP_START( madshark_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins
AM_RANGE(0x500008, 0x50000b) AM_READ(seta_dsw_r) // DSW
- AM_RANGE(0x50000c, 0x50000d) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x50000c, 0x50000d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x600000, 0x600005) AM_RAM_WRITE(seta_vregs_w) AM_SHARE("vregs") // ? Coin Lockout + Video Registers
AM_RANGE(0x600006, 0x600007) AM_WRITENOP // ?
AM_RANGE(0x700400, 0x700fff) AM_RAM AM_SHARE("paletteram") // Palette
@@ -2510,7 +2511,7 @@ static ADDRESS_MAP_START( magspeed_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins
AM_RANGE(0x500008, 0x50000b) AM_READ(seta_dsw_r) // DSW
- AM_RANGE(0x50000c, 0x50000d) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x50000c, 0x50000d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x500010, 0x500015) AM_RAM_WRITE(msgundam_vregs_w) AM_SHARE("vregs") // ? Coin Lockout + Video Registers
AM_RANGE(0x500018, 0x500019) AM_WRITENOP // lev 2 irq ack?
AM_RANGE(0x50001c, 0x50001d) AM_WRITENOP // lev 4 irq ack?
@@ -3021,7 +3022,7 @@ static ADDRESS_MAP_START( inttoote_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x200002, 0x200003) AM_READ_PORT("P1")
AM_RANGE(0x200010, 0x200011) AM_READ_PORT("P2") AM_WRITENOP
- AM_RANGE(0x300000, 0x300001) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x300010, 0x300011) AM_WRITENOP // lev1 ack
AM_RANGE(0x300020, 0x300021) AM_WRITENOP // lev2 ack
@@ -3082,7 +3083,7 @@ static ADDRESS_MAP_START( jockeyc_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x200002, 0x200003) AM_READ_PORT("P1")
AM_RANGE(0x200010, 0x200011) AM_READ_PORT("P2") AM_WRITENOP
- AM_RANGE(0x300000, 0x300001) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x300002, 0x300003) AM_WRITENOP
@@ -7849,6 +7850,7 @@ static MACHINE_CONFIG_START( usclssic, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */
MCFG_CPU_PROGRAM_MAP(usclssic_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, calibr50_interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_CPU_ADD("sub", M65C02, 16000000/8) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
@@ -7901,6 +7903,7 @@ static MACHINE_CONFIG_START( calibr50, seta_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(calibr50_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, calibr50_interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_CPU_ADD("sub", M65C02, XTAL_16MHz/8) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
@@ -8389,6 +8392,7 @@ static MACHINE_CONFIG_START( eightfrc, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(wrofaero_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
@@ -8431,6 +8435,7 @@ static MACHINE_CONFIG_START( extdwnhl, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(extdwnhl_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
@@ -8493,6 +8498,8 @@ static MACHINE_CONFIG_START( gundhara, seta_state )
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
#endif // __uPD71054_TIMER
+ MCFG_WATCHDOG_ADD("watchdog")
+
#if __uPD71054_TIMER
MCFG_MACHINE_START_OVERRIDE(seta_state, wrofaero )
#endif // __uPD71054_TIMER
@@ -8540,6 +8547,7 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(wrofaero_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
@@ -8615,6 +8623,7 @@ static MACHINE_CONFIG_START( kamenrid, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(kamenrid_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state, wrofaero_interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
#if __uPD71054_TIMER
MCFG_MACHINE_START_OVERRIDE(seta_state, wrofaero )
@@ -8787,6 +8796,8 @@ static MACHINE_CONFIG_START( madshark, seta_state )
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -8823,6 +8834,8 @@ static MACHINE_CONFIG_START( magspeed, seta_state )
MCFG_CPU_PROGRAM_MAP(magspeed_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state, wrofaero_interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
+
#if __uPD71054_TIMER
MCFG_MACHINE_START_OVERRIDE(seta_state, wrofaero )
#endif // __uPD71054_TIMER
@@ -9030,6 +9043,7 @@ static MACHINE_CONFIG_START( rezon, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(wrofaero_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
@@ -9304,6 +9318,8 @@ static MACHINE_CONFIG_START( wrofaero, seta_state )
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
#endif // __uPD71054_TIMER
+ MCFG_WATCHDOG_ADD("watchdog")
+
#if __uPD71054_TIMER
MCFG_MACHINE_START_OVERRIDE(seta_state, wrofaero )
#endif // __uPD71054_TIMER
@@ -9356,6 +9372,8 @@ static MACHINE_CONFIG_START( zingzip, seta_state )
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(57.42) // taken from other games but seems to better match PCB videos
@@ -9516,6 +9534,7 @@ static MACHINE_CONFIG_START( inttoote, seta_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(inttoote_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, inttoote_interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_DEVICE_ADD("pia0", PIA6821, 0)
MCFG_DEVICE_ADD("pia1", PIA6821, 0)
diff --git a/src/mame/drivers/seta2.cpp b/src/mame/drivers/seta2.cpp
index 15ddc8f6622..6a46702c3fe 100644
--- a/src/mame/drivers/seta2.cpp
+++ b/src/mame/drivers/seta2.cpp
@@ -115,6 +115,7 @@ reelquak:
#include "machine/eepromser.h"
#include "machine/nvram.h"
#include "machine/ticket.h"
+#include "machine/watchdog.h"
#include "machine/mcf5206e.h"
@@ -166,7 +167,7 @@ static ADDRESS_MAP_START( grdians_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("P1") // P1
AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P2") // P2
AM_RANGE(0x700004, 0x700005) AM_READ_PORT("SYSTEM") // Coins
- AM_RANGE(0x70000c, 0x70000d) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x70000c, 0x70000d) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x800000, 0x800001) AM_WRITE(grdians_lockout_w)
AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound
AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites
@@ -204,7 +205,7 @@ static ADDRESS_MAP_START( gundamex_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x700004, 0x700005) AM_READ_PORT("SYSTEM") // Coins
AM_RANGE(0x700008, 0x700009) AM_READ_PORT("IN0") // P1
AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN1") // P2
- AM_RANGE(0x70000c, 0x70000d) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x70000c, 0x70000d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x800000, 0x800001) AM_WRITE(grdians_lockout_w)
AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound
AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites
@@ -263,7 +264,7 @@ static ADDRESS_MAP_START( mj4simai_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x600000, 0x600001) AM_READ(mj4simai_p1_r) // P1
AM_RANGE(0x600002, 0x600003) AM_READ(mj4simai_p2_r) // P2
AM_RANGE(0x600004, 0x600005) AM_WRITE(mj4simai_keyboard_w) // select keyboard row to read
- AM_RANGE(0x600006, 0x600007) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x600006, 0x600007) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x600100, 0x600101) AM_READ_PORT("SYSTEM") //
AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins?
AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1
@@ -287,7 +288,7 @@ static ADDRESS_MAP_START( myangel_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("P1") // P1
AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P2") // P2
AM_RANGE(0x700004, 0x700005) AM_READ_PORT("SYSTEM") // Coins
- AM_RANGE(0x700006, 0x700007) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x700006, 0x700007) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x700200, 0x700201) AM_WRITENOP // Leds? Coins?
AM_RANGE(0x700300, 0x700301) AM_READ_PORT("DSW1") // DSW 1
AM_RANGE(0x700302, 0x700303) AM_READ_PORT("DSW2") // DSW 2
@@ -310,7 +311,7 @@ static ADDRESS_MAP_START( myangel2_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") // P1
AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2") // P2
AM_RANGE(0x600004, 0x600005) AM_READ_PORT("SYSTEM") // Coins
- AM_RANGE(0x600006, 0x600007) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x600006, 0x600007) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins?
AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1
AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2") // DSW 2
@@ -358,7 +359,7 @@ static ADDRESS_MAP_START( pzlbowl_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2
AM_RANGE(0x500004, 0x500005) AM_READWRITE(pzlbowl_coins_r,pzlbowl_coin_counter_w) // Coins + Protection?
- AM_RANGE(0x500006, 0x500007) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x500006, 0x500007) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x700000, 0x700001) AM_READ(pzlbowl_protection_r) // Protection
AM_RANGE(0x800000, 0x83ffff) AM_RAM AM_SHARE("spriteram") // Sprites
AM_RANGE(0x840000, 0x84ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
@@ -384,7 +385,7 @@ static ADDRESS_MAP_START( penbros_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2") // P2
AM_RANGE(0x600004, 0x600005) AM_READ_PORT("SYSTEM") // Coins
AM_RANGE(0x600004, 0x600005) AM_WRITE(pzlbowl_coin_counter_w) // Coins Counter
- AM_RANGE(0x600006, 0x600007) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x600006, 0x600007) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
//AM_RANGE(0x700000, 0x700001) AM_READ(pzlbowl_protection_r) // Protection
AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_SHARE("spriteram") // Sprites
AM_RANGE(0xb40000, 0xb4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
@@ -439,7 +440,7 @@ static ADDRESS_MAP_START( reelquak_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P1") // P1
AM_RANGE(0x400002, 0x400003) AM_READ_PORT("TICKET") // Tickets
AM_RANGE(0x400004, 0x400005) AM_READ_PORT("SYSTEM") // Coins
- AM_RANGE(0x400006, 0x400007) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x400006, 0x400007) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0x400200, 0x400201) AM_WRITE(reelquak_coin_w) // Coin Counters / IRQ Ack
AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1
AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2
@@ -499,7 +500,7 @@ static ADDRESS_MAP_START( samshoot_map, AS_PROGRAM, 16, seta2_state )
AM_RANGE( 0x700000, 0x700001 ) AM_READ_PORT("TRIGGER") // Trigger
AM_RANGE( 0x700002, 0x700003 ) AM_READ_PORT("PUMP") // Pump
AM_RANGE( 0x700004, 0x700005 ) AM_READ_PORT("COIN") AM_WRITE(samshoot_coin_w ) // Coins
- AM_RANGE( 0x700006, 0x700007 ) AM_READ(watchdog_reset16_r ) // Watchdog?
+ AM_RANGE( 0x700006, 0x700007 ) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r ) // Watchdog?
AM_RANGE( 0x800000, 0x83ffff ) AM_RAM AM_SHARE("spriteram") // Sprites
AM_RANGE( 0x840000, 0x84ffff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
@@ -700,7 +701,7 @@ static ADDRESS_MAP_START( funcube_map, AS_PROGRAM, 32, seta2_state )
AM_RANGE( 0x00200000, 0x0020ffff ) AM_RAM
AM_RANGE( 0x00400000, 0x00400003 ) AM_READ(funcube_debug_r)
- AM_RANGE( 0x00400004, 0x00400007 ) AM_READ(watchdog_reset32_r ) AM_WRITENOP
+ AM_RANGE( 0x00400004, 0x00400007 ) AM_DEVREAD("watchdog", watchdog_timer_device, reset32_r) AM_WRITENOP
AM_RANGE( 0x00500000, 0x00500003 ) AM_READWRITE(oki_read, oki_write)
@@ -719,7 +720,7 @@ static ADDRESS_MAP_START( funcube2_map, AS_PROGRAM, 32, seta2_state )
AM_RANGE( 0x00200000, 0x0020ffff ) AM_RAM
AM_RANGE( 0x00500000, 0x00500003 ) AM_READ(funcube_debug_r )
- AM_RANGE( 0x00500004, 0x00500007 ) AM_READ(watchdog_reset32_r ) AM_WRITENOP
+ AM_RANGE( 0x00500004, 0x00500007 ) AM_DEVREAD("watchdog", watchdog_timer_device, reset32_r) AM_WRITENOP
AM_RANGE( 0x00600000, 0x00600003 ) AM_READWRITE(oki_read, oki_write)
@@ -2108,6 +2109,8 @@ static MACHINE_CONFIG_START( seta2, seta2_state )
MCFG_DEVICE_ADD("tmp68301", TMP68301, 0)
+ MCFG_WATCHDOG_ADD("watchdog")
+
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -2284,6 +2287,8 @@ static MACHINE_CONFIG_START( funcube, seta2_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_MACHINE_START_OVERRIDE(seta2_state, funcube)
MCFG_MACHINE_RESET_OVERRIDE(seta2_state, funcube)
diff --git a/src/mame/drivers/shadfrce.cpp b/src/mame/drivers/shadfrce.cpp
index ba08627823d..59757c5f073 100644
--- a/src/mame/drivers/shadfrce.cpp
+++ b/src/mame/drivers/shadfrce.cpp
@@ -142,6 +142,7 @@ lev 7 : 0x7c : 0000 11d0 - just rte
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/shadfrce.h"
@@ -378,7 +379,7 @@ static ADDRESS_MAP_START( shadfrce_map, AS_PROGRAM, 16, shadfrce_state )
AM_RANGE(0x1d0010, 0x1d0011) AM_WRITENOP /* ?? */
AM_RANGE(0x1d0012, 0x1d0013) AM_WRITENOP /* ?? */
AM_RANGE(0x1d0014, 0x1d0015) AM_WRITENOP /* ?? */
- AM_RANGE(0x1d0016, 0x1d0017) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x1d0016, 0x1d0017) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x1d0020, 0x1d0027) AM_READ(input_ports_r)
AM_RANGE(0x1f0000, 0x1fffff) AM_RAM
ADDRESS_MAP_END
@@ -546,6 +547,8 @@ static MACHINE_CONFIG_START( shadfrce, shadfrce_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(shadfrce_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_28MHz / 4, 448, 0, 320, 272, 8, 248) /* HTOTAL and VTOTAL are guessed */
MCFG_SCREEN_UPDATE_DRIVER(shadfrce_state, screen_update)
diff --git a/src/mame/drivers/shaolins.cpp b/src/mame/drivers/shaolins.cpp
index 6774578e98b..613cf9e3620 100644
--- a/src/mame/drivers/shaolins.cpp
+++ b/src/mame/drivers/shaolins.cpp
@@ -10,6 +10,7 @@ driver by Allard van der Bas
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "includes/shaolins.h"
@@ -30,7 +31,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(shaolins_state::interrupt)
static ADDRESS_MAP_START( shaolins_map, AS_PROGRAM, 8, shaolins_state )
AM_RANGE(0x0000, 0x0000) AM_WRITE(nmi_w) /* bit 0 = flip screen, bit 1 = nmi enable, bit 2 = ? */
/* bit 3, bit 4 = coin counters */
- AM_RANGE(0x0100, 0x0100) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0100, 0x0100) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0300, 0x0300) AM_DEVWRITE("sn1", sn76489a_device, write) /* trigger chip to read from latch. The program always */
AM_RANGE(0x0400, 0x0400) AM_DEVWRITE("sn2", sn76489a_device, write) /* writes the same number as the latch, so we don't */
/* bother emulating them. */
@@ -193,6 +194,7 @@ static MACHINE_CONFIG_START( shaolins, shaolins_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/12) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(shaolins_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", shaolins_state, interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/shougi.cpp b/src/mame/drivers/shougi.cpp
index 528f062fdef..41f9c547922 100644
--- a/src/mame/drivers/shougi.cpp
+++ b/src/mame/drivers/shougi.cpp
@@ -79,6 +79,7 @@ PROM : Type MB7051
#include "emu.h"
#include "machine/alpha8201.h"
+#include "machine/watchdog.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "video/resnet.h"
@@ -281,7 +282,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, shougi_state )
AM_RANGE(0x4800, 0x480f) AM_WRITE(control_w)
AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW")
AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1")
- AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_WRITE(watchdog_reset_w) /* game won't boot if watchdog doesn't work */
+ AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* game won't boot if watchdog doesn't work */
AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
AM_RANGE(0x6800, 0x6800) AM_DEVWRITE("aysnd", ay8910_device, data_w)
AM_RANGE(0x7000, 0x73ff) AM_DEVREADWRITE("alpha_8201", alpha_8201_device, ext_ram_r, ext_ram_w)
@@ -409,7 +410,9 @@ static MACHINE_CONFIG_START( shougi, shougi_state )
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_10MHz/4/8)
MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_WATCHDOG_VBLANK_INIT(0x10) // assuming it's the same as champbas
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 0x10) // assuming it's the same as champbas
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/shuuz.cpp b/src/mame/drivers/shuuz.cpp
index 96098b00046..27ca1d95ac1 100644
--- a/src/mame/drivers/shuuz.cpp
+++ b/src/mame/drivers/shuuz.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "includes/shuuz.h"
@@ -110,7 +111,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, shuuz_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
AM_RANGE(0x101000, 0x101fff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
- AM_RANGE(0x102000, 0x102001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x102000, 0x102001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x103000, 0x103003) AM_READ(leta_r)
AM_RANGE(0x105000, 0x105001) AM_READWRITE(special_port0_r, latch_w)
AM_RANGE(0x105002, 0x105003) AM_READ_PORT("BUTTONS")
@@ -235,6 +236,8 @@ static MACHINE_CONFIG_START( shuuz, shuuz_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", shuuz)
MCFG_PALETTE_ADD("palette", 1024)
diff --git a/src/mame/drivers/sidearms.cpp b/src/mame/drivers/sidearms.cpp
index 69190b22147..0fa756b6688 100644
--- a/src/mame/drivers/sidearms.cpp
+++ b/src/mame/drivers/sidearms.cpp
@@ -46,6 +46,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "sound/2151intf.h"
#include "includes/sidearms.h"
@@ -81,7 +82,7 @@ static ADDRESS_MAP_START( sidearms_map, AS_PROGRAM, 8, sidearms_state )
AM_RANGE(0xc400, 0xc7ff) AM_RAM_DEVWRITE("palette", palette_device, write_ext) AM_SHARE("palette_ext")
AM_RANGE(0xc800, 0xc800) AM_READ_PORT("SYSTEM") AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xc801, 0xc801) AM_READ_PORT("P1") AM_WRITE(bankswitch_w)
- AM_RANGE(0xc802, 0xc802) AM_READ_PORT("P2") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc802, 0xc802) AM_READ_PORT("P2") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xc803, 0xc803) AM_READ_PORT("DSW0")
AM_RANGE(0xc804, 0xc804) AM_READ_PORT("DSW1") AM_WRITE(c804_w)
AM_RANGE(0xc805, 0xc805) AM_READ_PORT("DSW2") AM_WRITE(star_scrollx_w)
@@ -105,7 +106,7 @@ static ADDRESS_MAP_START( turtship_map, AS_PROGRAM, 8, sidearms_state )
AM_RANGE(0xe800, 0xe807) AM_READ(turtship_ports_r)
AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xe801, 0xe801) AM_WRITE(bankswitch_w)
- AM_RANGE(0xe802, 0xe802) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xe802, 0xe802) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xe804, 0xe804) AM_WRITE(c804_w)
AM_RANGE(0xe805, 0xe805) AM_WRITE(star_scrollx_w)
AM_RANGE(0xe806, 0xe806) AM_WRITE(star_scrolly_w)
@@ -146,7 +147,7 @@ static ADDRESS_MAP_START( whizz_map, AS_PROGRAM, 8, sidearms_state )
AM_RANGE(0xc400, 0xc7ff) AM_RAM_DEVWRITE("palette", palette_device, write_ext) AM_SHARE("palette_ext")
AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xc801, 0xc801) AM_READ_PORT("DSW1") AM_WRITE(whizz_bankswitch_w)
- AM_RANGE(0xc802, 0xc802) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc802, 0xc802) AM_READ_PORT("DSW2") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xc803, 0xc803) AM_READ_PORT("IN0") AM_WRITENOP
AM_RANGE(0xc804, 0xc804) AM_READ_PORT("IN1") AM_WRITE(c804_w)
AM_RANGE(0xc805, 0xc805) AM_READ_PORT("IN2") AM_WRITENOP
@@ -600,6 +601,8 @@ static MACHINE_CONFIG_START( sidearms, sidearms_state )
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz (?) */
MCFG_CPU_PROGRAM_MAP(sidearms_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
@@ -645,6 +648,8 @@ static MACHINE_CONFIG_START( turtship, sidearms_state )
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz (?) */
MCFG_CPU_PROGRAM_MAP(sidearms_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
@@ -693,6 +698,8 @@ static MACHINE_CONFIG_START( whizz, sidearms_state )
MCFG_QUANTUM_TIME(attotime::from_hz(60000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
diff --git a/src/mame/drivers/sigmab98.cpp b/src/mame/drivers/sigmab98.cpp
index e0cdabeedaf..6449a12804c 100644
--- a/src/mame/drivers/sigmab98.cpp
+++ b/src/mame/drivers/sigmab98.cpp
@@ -117,6 +117,7 @@ Notes:
#include "machine/eepromser.h"
#include "machine/nvram.h"
#include "machine/ticket.h"
+#include "machine/watchdog.h"
class sigmab98_state : public driver_device
{
@@ -1235,7 +1236,7 @@ static ADDRESS_MAP_START( animalc_io, AS_IO, 8, sigmab98_state )
AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE("oki", okim9810_device, write_TMP_register )
AM_RANGE( 0x92, 0x92 ) AM_DEVREAD("oki", okim9810_device, read )
AM_RANGE( 0xb0, 0xb0 ) AM_WRITE(sammymdl_hopper_w )
- AM_RANGE( 0xc0, 0xc0 ) AM_WRITE(watchdog_reset_w ) // 1
+ AM_RANGE( 0xc0, 0xc0 ) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w ) // 1
ADDRESS_MAP_END
/***************************************************************************
@@ -1479,7 +1480,7 @@ static ADDRESS_MAP_START( haekaka_io, AS_IO, 8, sigmab98_state )
AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE("oki", okim9810_device, write_TMP_register )
AM_RANGE( 0x92, 0x92 ) AM_DEVREAD("oki", okim9810_device, read )
AM_RANGE( 0xb0, 0xb0 ) AM_WRITE(sammymdl_hopper_w )
- AM_RANGE( 0xc0, 0xc0 ) AM_WRITE(watchdog_reset_w ) // 1
+ AM_RANGE( 0xc0, 0xc0 ) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w ) // 1
ADDRESS_MAP_END
/***************************************************************************
@@ -1726,7 +1727,7 @@ static ADDRESS_MAP_START( itazuram_io, AS_IO, 8, sigmab98_state )
AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE("oki", okim9810_device, write_TMP_register )
AM_RANGE( 0x92, 0x92 ) AM_DEVREAD("oki", okim9810_device, read )
AM_RANGE( 0xb0, 0xb0 ) AM_WRITE(sammymdl_hopper_w )
- AM_RANGE( 0xc0, 0xc0 ) AM_WRITE(watchdog_reset_w ) // 1
+ AM_RANGE( 0xc0, 0xc0 ) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w ) // 1
ADDRESS_MAP_END
/***************************************************************************
@@ -1955,7 +1956,7 @@ static ADDRESS_MAP_START( tdoboon_io, AS_IO, 8, sigmab98_state )
AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE("oki", okim9810_device, write_TMP_register )
AM_RANGE( 0x92, 0x92 ) AM_DEVREAD("oki", okim9810_device, read )
AM_RANGE( 0xb0, 0xb0 ) AM_WRITE(sammymdl_hopper_w )
- AM_RANGE( 0xc0, 0xc0 ) AM_WRITE(watchdog_reset_w ) // 1
+ AM_RANGE( 0xc0, 0xc0 ) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w ) // 1
ADDRESS_MAP_END
@@ -2237,6 +2238,8 @@ static MACHINE_CONFIG_START( sammymdl, sigmab98_state )
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW )
+ MCFG_WATCHDOG_ADD("watchdog")
+
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60) // ?
diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp
index 20e01f6306c..cf2aca9ebdf 100644
--- a/src/mame/drivers/simpsons.cpp
+++ b/src/mame/drivers/simpsons.cpp
@@ -101,6 +101,7 @@ Notes:
#include "cpu/z80/z80.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "sound/k053260.h"
#include "includes/simpsons.h"
@@ -128,7 +129,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, simpsons_state )
AM_RANGE(0x1fc4, 0x1fc4) AM_READ(simpsons_sound_interrupt_r)
AM_RANGE(0x1fc6, 0x1fc7) AM_DEVREADWRITE("k053260", k053260_device, main_read, main_write)
AM_RANGE(0x1fc8, 0x1fc9) AM_DEVREAD("k053246", k053247_device, k053246_r)
- AM_RANGE(0x1fca, 0x1fca) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x1fca, 0x1fca) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE("k052109", k052109_device, read, write)
AM_RANGE(0x2000, 0x3fff) AM_DEVICE("bank2000", address_map_bank_device, amap8)
AM_RANGE(0x4000, 0x5fff) AM_RAM
@@ -342,6 +343,8 @@ static MACHINE_CONFIG_START( simpsons, simpsons_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
diff --git a/src/mame/drivers/skullxbo.cpp b/src/mame/drivers/skullxbo.cpp
index faef66d7ab4..6377da1f7b3 100644
--- a/src/mame/drivers/skullxbo.cpp
+++ b/src/mame/drivers/skullxbo.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "includes/skullxbo.h"
@@ -106,11 +107,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, skullxbo_state )
AM_RANGE(0xff1c00, 0xff1c7f) AM_WRITE(playfield_latch_w)
AM_RANGE(0xff1c80, 0xff1cff) AM_WRITE(skullxbo_xscroll_w) AM_SHARE("xscroll")
AM_RANGE(0xff1d00, 0xff1d7f) AM_WRITE(scanline_int_ack_w)
- AM_RANGE(0xff1d80, 0xff1dff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xff1d80, 0xff1dff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xff1e00, 0xff1e7f) AM_WRITE(playfield_latch_w)
AM_RANGE(0xff1e80, 0xff1eff) AM_WRITE(skullxbo_xscroll_w)
AM_RANGE(0xff1f00, 0xff1f7f) AM_WRITE(scanline_int_ack_w)
- AM_RANGE(0xff1f80, 0xff1fff) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xff1f80, 0xff1fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xff2000, 0xff2fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xff4000, 0xff47ff) AM_WRITE(skullxbo_yscroll_w) AM_SHARE("yscroll")
AM_RANGE(0xff4800, 0xff4fff) AM_WRITE(skullxbo_mobwr_w)
@@ -233,6 +234,8 @@ static MACHINE_CONFIG_START( skullxbo, skullxbo_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", skullxbo)
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/skydiver.cpp b/src/mame/drivers/skydiver.cpp
index 7da03aefadd..4e1de7de558 100644
--- a/src/mame/drivers/skydiver.cpp
+++ b/src/mame/drivers/skydiver.cpp
@@ -219,7 +219,7 @@ static ADDRESS_MAP_START( skydiver_map, AS_PROGRAM, 8, skydiver_state )
AM_RANGE(0x180b, 0x180b) AM_MIRROR(0x47e4) AM_READ_PORT("IN11")
AM_RANGE(0x1810, 0x1810) AM_MIRROR(0x47e4) AM_READ_PORT("IN12")
AM_RANGE(0x1811, 0x1811) AM_MIRROR(0x47e4) AM_READ_PORT("IN13")
- AM_RANGE(0x2000, 0x201f) AM_MIRROR(0x47e0) AM_READ(watchdog_reset_r) AM_WRITE(_2000_201F_w)
+ AM_RANGE(0x2000, 0x201f) AM_MIRROR(0x47e0) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(_2000_201F_w)
AM_RANGE(0x2800, 0x2fff) AM_MIRROR(0x4000) AM_ROM
AM_RANGE(0x3000, 0x37ff) AM_MIRROR(0x4000) AM_ROM
AM_RANGE(0x3800, 0x3fff) AM_ROM
@@ -378,7 +378,9 @@ static MACHINE_CONFIG_START( skydiver, skydiver_state )
MCFG_CPU_ADD("maincpu", M6800,MASTER_CLOCK/16) /* ???? */
MCFG_CPU_PROGRAM_MAP(skydiver_map)
MCFG_CPU_PERIODIC_INT_DRIVER(skydiver_state, interrupt, 5*60)
- MCFG_WATCHDOG_VBLANK_INIT(8) // 128V clocks the same as VBLANK
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8) // 128V clocks the same as VBLANK
/* video hardware */
diff --git a/src/mame/drivers/skykid.cpp b/src/mame/drivers/skykid.cpp
index 15106bd8243..75fe1fa2e49 100644
--- a/src/mame/drivers/skykid.cpp
+++ b/src/mame/drivers/skykid.cpp
@@ -18,6 +18,7 @@ Notes:
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6800/m6800.h"
+#include "machine/watchdog.h"
#include "sound/namco.h"
#include "includes/skykid.h"
@@ -109,7 +110,7 @@ static ADDRESS_MAP_START( skykid_map, AS_PROGRAM, 8, skykid_state )
AM_RANGE(0x6200, 0x63ff) AM_WRITE(skykid_scroll_x_w) /* X scroll register map */
AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
AM_RANGE(0x7000, 0x7fff) AM_WRITE(skykid_irq_1_ctrl_w) /* IRQ control */
- AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r) /* watchdog reset */
+ AM_RANGE(0x7800, 0x7fff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */
AM_RANGE(0x8000, 0x8fff) AM_WRITE(skykid_subreset_w) /* MCU control */
AM_RANGE(0x9000, 0x9fff) AM_WRITE(skykid_bankswitch_w) /* Bankswitch control */
@@ -120,7 +121,7 @@ static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, skykid_state )
AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE("mcu", hd63701_cpu_device, m6801_io_r, m6801_io_w)
AM_RANGE(0x0080, 0x00ff) AM_RAM
AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
- AM_RANGE(0x2000, 0x3fff) AM_WRITE(watchdog_reset_w) /* watchdog? */
+ AM_RANGE(0x2000, 0x3fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog? */
AM_RANGE(0x4000, 0x7fff) AM_WRITE(skykid_irq_2_ctrl_w)
AM_RANGE(0x8000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM
@@ -445,6 +446,7 @@ static MACHINE_CONFIG_START( skykid, skykid_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* we need heavy synch */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/skyraid.cpp b/src/mame/drivers/skyraid.cpp
index 9dd8b6765fb..ad5d255ce13 100644
--- a/src/mame/drivers/skyraid.cpp
+++ b/src/mame/drivers/skyraid.cpp
@@ -8,6 +8,7 @@ Atari Sky Raider driver
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "includes/skyraid.h"
@@ -79,7 +80,7 @@ static ADDRESS_MAP_START( skyraid_map, AS_PROGRAM, 8, skyraid_state )
AM_RANGE(0x4000, 0x4000) AM_WRITE(skyraid_scroll_w)
AM_RANGE(0x4400, 0x4400) AM_WRITE(skyraid_sound_w)
AM_RANGE(0x4800, 0x4800) AM_WRITE(skyraid_range_w)
- AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5000, 0x5000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5800, 0x5800) AM_WRITE(skyraid_offset_w)
AM_RANGE(0x7000, 0x7fff) AM_ROM
AM_RANGE(0xf000, 0xffff) AM_ROM
@@ -220,7 +221,9 @@ static MACHINE_CONFIG_START( skyraid, skyraid_state )
MCFG_CPU_ADD("maincpu", M6502, 12096000 / 12)
MCFG_CPU_PROGRAM_MAP(skyraid_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", skyraid_state, irq0_line_hold)
- MCFG_WATCHDOG_VBLANK_INIT(4)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 4)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp
index 095946efcdc..0133c266302 100644
--- a/src/mame/drivers/snowbros.cpp
+++ b/src/mame/drivers/snowbros.cpp
@@ -82,6 +82,7 @@ a joystick. This is not an emulation bug.
#include "sound/3812intf.h"
#include "sound/okim6295.h"
#include "cpu/mcs51/mcs51.h" // for semicom mcu
+#include "machine/watchdog.h"
WRITE16_MEMBER(snowbros_state::snowbros_flipscreen_w)
@@ -208,7 +209,7 @@ READ16_MEMBER(snowbros_state::toto_read)
static ADDRESS_MAP_START( snowbros_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM
- AM_RANGE(0x200000, 0x200001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,snowbros_68000_sound_w)
AM_RANGE(0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
@@ -290,7 +291,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( wintbob_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM
- AM_RANGE(0x200000, 0x200001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,snowbros_68000_sound_w)
AM_RANGE(0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
@@ -347,7 +348,7 @@ WRITE16_MEMBER(snowbros_state::twinadv_68000_sound_w)
static ADDRESS_MAP_START( twinadv_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_RAM
- AM_RANGE(0x200000, 0x200001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,twinadv_68000_sound_w)
AM_RANGE(0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
@@ -523,7 +524,7 @@ WRITE16_MEMBER(snowbros_state::sb3_sound_w)
static ADDRESS_MAP_START( snowbros3_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE( 0x000000, 0x03ffff) AM_ROM
AM_RANGE( 0x100000, 0x103fff) AM_RAM
- AM_RANGE( 0x200000, 0x200001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE( 0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE( 0x300000, 0x300001) AM_READ(sb3_sound_r) // ?
AM_RANGE( 0x300000, 0x300001) AM_WRITE(sb3_sound_w) // ?
AM_RANGE( 0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
@@ -1657,6 +1658,7 @@ static MACHINE_CONFIG_START( snowbros, snowbros_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* 8 Mhz - confirmed */
MCFG_CPU_PROGRAM_MAP(snowbros_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_CPU_ADD("soundcpu", Z80, XTAL_12MHz/2) /* 6 MHz - confirmed */
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -1789,6 +1791,7 @@ static MACHINE_CONFIG_START( twinadv, snowbros_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* 12MHz like Honey Dolls ? */
MCFG_CPU_PROGRAM_MAP(twinadv_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_CPU_ADD("soundcpu", Z80, XTAL_16MHz/4) /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -1868,6 +1871,7 @@ static MACHINE_CONFIG_START( snowbro3, snowbros_state ) /* PCB has 16MHz & 12MHz
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* MC68000P10 CPU @ 12mhz or 8MHz (16MHz/2) ? */
MCFG_CPU_PROGRAM_MAP(snowbros3_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros3_irq, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/speedatk.cpp b/src/mame/drivers/speedatk.cpp
index ddd38cf4ab1..0bf07e6cb04 100644
--- a/src/mame/drivers/speedatk.cpp
+++ b/src/mame/drivers/speedatk.cpp
@@ -77,6 +77,7 @@ PS / PD : key matrix
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/speedatk.h"
@@ -189,7 +190,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( speedatk_io, AS_IO, 8, speedatk_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_WRITE(m6845_w) //h46505 address / data routing
- AM_RANGE(0x24, 0x24) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x24, 0x24) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x40, 0x40) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
//what's 60-6f for? Seems used only in attract mode and read back when a 2p play ends ...
@@ -306,7 +307,8 @@ static MACHINE_CONFIG_START( speedatk, speedatk_state )
MCFG_CPU_IO_MAP(speedatk_io)
MCFG_CPU_VBLANK_INT_DRIVER("screen", speedatk_state, irq0_line_hold)
- MCFG_WATCHDOG_VBLANK_INIT(8) // timing is unknown
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8) // timing is unknown
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/sprint2.cpp b/src/mame/drivers/sprint2.cpp
index 90aa56c3d74..ea26f6f0e5d 100644
--- a/src/mame/drivers/sprint2.cpp
+++ b/src/mame/drivers/sprint2.cpp
@@ -112,7 +112,7 @@ INTERRUPT_GEN_MEMBER(sprint2_state::sprint2)
/* interrupts and watchdog are disabled during service mode */
- machine().watchdog_enable(!service_mode());
+ m_watchdog->watchdog_enable(!service_mode());
if (!service_mode())
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
@@ -272,7 +272,7 @@ static ADDRESS_MAP_START( sprint2_map, AS_PROGRAM, 8, sprint2_state )
AM_RANGE(0x0c30, 0x0c3f) AM_WRITE(sprint2_lamp1_w)
AM_RANGE(0x0c40, 0x0c4f) AM_WRITE(sprint2_lamp2_w)
AM_RANGE(0x0c60, 0x0c6f) AM_WRITENOP /* SPARE */
- AM_RANGE(0x0c80, 0x0cff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0c80, 0x0cff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0d00, 0x0d7f) AM_WRITE(sprint2_collision_reset1_w)
AM_RANGE(0x0d80, 0x0dff) AM_WRITE(sprint2_collision_reset2_w)
AM_RANGE(0x0e00, 0x0e7f) AM_WRITE(sprint2_steering_reset1_w)
@@ -533,7 +533,9 @@ static MACHINE_CONFIG_START( sprint2, sprint2_state )
MCFG_CPU_ADD("maincpu", M6502, XTAL_12_096MHz / 16)
MCFG_CPU_PROGRAM_MAP(sprint2_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", sprint2_state, sprint2)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp
index 083fe721afa..87a54f7daed 100644
--- a/src/mame/drivers/sprint4.cpp
+++ b/src/mame/drivers/sprint4.cpp
@@ -113,7 +113,7 @@ TIMER_CALLBACK_MEMBER(sprint4_state::nmi_callback)
/* NMI and watchdog are disabled during service mode */
- machine().watchdog_enable(ioport("IN0")->read() & 0x40);
+ m_watchdog->watchdog_enable(ioport("IN0")->read() & 0x40);
if (ioport("IN0")->read() & 0x40)
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
@@ -252,7 +252,7 @@ static ADDRESS_MAP_START( sprint4_cpu_map, AS_PROGRAM, 8, sprint4_state )
AM_RANGE(0x0020, 0x0027) AM_MIRROR(0x718) AM_WRITE(sprint4_collision_reset_w)
AM_RANGE(0x0040, 0x0041) AM_MIRROR(0x718) AM_WRITE(sprint4_da_latch_w)
AM_RANGE(0x0042, 0x0043) AM_MIRROR(0x718) AM_WRITE(sprint4_bang_w)
- AM_RANGE(0x0044, 0x0045) AM_MIRROR(0x718) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0044, 0x0045) AM_MIRROR(0x718) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0060, 0x0067) AM_MIRROR(0x710) AM_WRITE(sprint4_lamp_w)
AM_RANGE(0x0068, 0x0069) AM_MIRROR(0x710) AM_WRITE(sprint4_screech_1_w)
AM_RANGE(0x006a, 0x006b) AM_MIRROR(0x710) AM_WRITE(sprint4_screech_2_w)
@@ -404,7 +404,8 @@ static MACHINE_CONFIG_START( sprint4, sprint4_state )
MCFG_CPU_ADD("maincpu", M6502, PIXEL_CLOCK / 8)
MCFG_CPU_PROGRAM_MAP(sprint4_cpu_map)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/spy.cpp b/src/mame/drivers/spy.cpp
index 07bc4ed9c23..9f924626d7d 100644
--- a/src/mame/drivers/spy.cpp
+++ b/src/mame/drivers/spy.cpp
@@ -22,7 +22,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
-
+#include "machine/watchdog.h"
#include "sound/3812intf.h"
#include "includes/konamipt.h"
#include "includes/spy.h"
@@ -375,7 +375,7 @@ static ADDRESS_MAP_START( spy_map, AS_PROGRAM, 8, spy_state )
AM_RANGE(0x0800, 0x1aff) AM_RAM
AM_RANGE(0x3f80, 0x3f80) AM_WRITE(bankswitch_w)
AM_RANGE(0x3f90, 0x3f90) AM_WRITE(spy_3f90_w)
- AM_RANGE(0x3fa0, 0x3fa0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x3fa0, 0x3fa0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x3fb0, 0x3fb0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x3fc0, 0x3fc0) AM_WRITE(spy_sh_irqtrigger_w)
AM_RANGE(0x3fd0, 0x3fd0) AM_READ_PORT("SYSTEM")
@@ -498,6 +498,8 @@ static MACHINE_CONFIG_START( spy, spy_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545)
MCFG_CPU_PROGRAM_MAP(spy_sound_map) /* nmi by the sound chip */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/sspeedr.cpp b/src/mame/drivers/sspeedr.cpp
index e6d2ef9f85a..c4aa2e021cb 100644
--- a/src/mame/drivers/sspeedr.cpp
+++ b/src/mame/drivers/sspeedr.cpp
@@ -8,6 +8,7 @@ Taito Super Speed Race driver
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sspeedr.lh"
#include "includes/sspeedr.h"
@@ -93,7 +94,7 @@ static ADDRESS_MAP_START( sspeedr_io_map, AS_IO, 8, sspeedr_state )
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW")
AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2")
AM_RANGE(0x04, 0x05) AM_WRITE(sspeedr_time_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x10, 0x10) AM_WRITE(sspeedr_driver_horz_w)
AM_RANGE(0x11, 0x11) AM_WRITE(sspeedr_driver_pic_w)
AM_RANGE(0x12, 0x12) AM_WRITE(sspeedr_driver_horz_2_w)
@@ -194,6 +195,8 @@ static MACHINE_CONFIG_START( sspeedr, sspeedr_state )
MCFG_CPU_IO_MAP(sspeedr_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", sspeedr_state, irq0_line_assert)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.39)
diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp
index 3b2419b8a3d..f0c8a4f1b64 100644
--- a/src/mame/drivers/ssv.cpp
+++ b/src/mame/drivers/ssv.cpp
@@ -165,6 +165,7 @@ Notes:
#include "cpu/v810/v810.h"
#include "cpu/v60/v60.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/ssv.h"
/***************************************************************************
@@ -514,7 +515,7 @@ READ16_MEMBER(ssv_state::hypreact_input_r)
}
static ADDRESS_MAP_START( hypreact_map, AS_PROGRAM, 16, ssv_state )
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 5 at the start
AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w) // Inverted lockout lines
// AM_RANGE(0x280000, 0x280001) AM_READNOP // ? read at the start, value not used
@@ -530,7 +531,7 @@ ADDRESS_MAP_END
***************************************************************************/
static ADDRESS_MAP_START( hypreac2_map, AS_PROGRAM, 16, ssv_state )
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 5 at the start
AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w) // Inverted lockout lines
// AM_RANGE(0x280000, 0x280001) AM_READNOP // ? read at the start, value not used
@@ -576,7 +577,7 @@ ADDRESS_MAP_END
***************************************************************************/
static ADDRESS_MAP_START( meosism_map, AS_PROGRAM, 16, ssv_state )
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r ) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 5 at the start
// AM_RANGE(0x280000, 0x280001) AM_READNOP // ? read once, value not used
// AM_RANGE(0x500004, 0x500005) AM_WRITENOP // ? 0,58,18
@@ -614,7 +615,7 @@ ADDRESS_MAP_END
***************************************************************************/
static ADDRESS_MAP_START( ryorioh_map, AS_PROGRAM, 16, ssv_state )
- AM_RANGE(0x210000, 0x210001) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 1 at the start
SSV_MAP( 0xc00000 )
ADDRESS_MAP_END
@@ -637,7 +638,7 @@ READ16_MEMBER(ssv_state::srmp4_input_r)
}
static ADDRESS_MAP_START( srmp4_map, AS_PROGRAM, 16, ssv_state )
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 1,5 at the start
AM_RANGE(0xc0000a, 0xc0000b) AM_READ(srmp4_input_r) // Inputs
AM_RANGE(0xc0000e, 0xc0000f) AM_WRITEONLY AM_SHARE("input_sel") // Inputs
@@ -685,7 +686,7 @@ READ16_MEMBER(ssv_state::srmp7_input_r)
static ADDRESS_MAP_START( srmp7_map, AS_PROGRAM, 16, ssv_state )
AM_RANGE(0x010000, 0x050faf) AM_RAM // More RAM
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 0,4 at the start
AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w) // Coin Counters / Lockouts
AM_RANGE(0x300076, 0x300077) AM_READ(srmp7_irqv_r) // Sound
@@ -702,7 +703,7 @@ ADDRESS_MAP_END
***************************************************************************/
static ADDRESS_MAP_START( survarts_map, AS_PROGRAM, 16, ssv_state )
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 0,4 at the start
// AM_RANGE(0x290000, 0x290001) AM_READNOP // ?
// AM_RANGE(0x2a0000, 0x2a0001) AM_READNOP // ?
@@ -755,7 +756,7 @@ WRITE16_MEMBER(ssv_state::sxyreact_motor_w)
static ADDRESS_MAP_START( sxyreact_map, AS_PROGRAM, 16, ssv_state )
// AM_RANGE(0x020000, 0x03ffff) AM_READWRITE(mainram_r, mainram_w) // sxyreac2 reads / writes here, why?
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 1 at the start
AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w) // Inverted lockout lines
AM_RANGE(0x500002, 0x500003) AM_READ(sxyreact_ballswitch_r) // ?
@@ -774,7 +775,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( twineag2_map, AS_PROGRAM, 16, ssv_state )
AM_RANGE(0x010000, 0x03ffff) AM_RAM // More RAM
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog (also value is cmp.b with mem 8)
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog (also value is cmp.b with mem 8)
AM_RANGE(0x480000, 0x480001) AM_READWRITE(dsp_dr_r, dsp_dr_w)
AM_RANGE(0x482000, 0x482fff) AM_READWRITE(dsp_r, dsp_w)
SSV_MAP( 0xe00000 )
@@ -789,7 +790,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( ultrax_map, AS_PROGRAM, 16, ssv_state )
AM_RANGE(0x010000, 0x03ffff) AM_RAM // More RAM
- AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r) // Watchdog (also value is cmp.b with memory address 8)
+ AM_RANGE(0x210000, 0x210001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog (also value is cmp.b with memory address 8)
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 2,6 at the start
SSV_MAP( 0xe00000 )
ADDRESS_MAP_END
@@ -832,7 +833,7 @@ WRITE16_MEMBER(ssv_state::latch16_w)
static ADDRESS_MAP_START( jsk_map, AS_PROGRAM, 16, ssv_state )
AM_RANGE(0x050000, 0x05ffff) AM_READWRITE(mainram_r, mainram_w) // RAM Mirror?
- AM_RANGE(0x210000, 0x210001) AM_WRITE(watchdog_reset16_w) // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x400000, 0x47ffff) AM_RAM // RAM?
AM_RANGE(0x900000, 0x900007) AM_READWRITE(latch16_r, latch16_w)
SSV_MAP( 0xf00000 )
@@ -899,7 +900,7 @@ WRITE16_MEMBER(ssv_state::eaglshot_gfxram_w)
static ADDRESS_MAP_START( eaglshot_map, AS_PROGRAM, 16, ssv_state )
AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(eaglshot_gfxram_r, eaglshot_gfxram_w)
- AM_RANGE(0x210000, 0x210001) AM_READNOP /*AM_READ(watchdog_reset16_r)*/ // Watchdog
+ AM_RANGE(0x210000, 0x210001) AM_READNOP /*AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)*/ // Watchdog
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 0,4 at the start
AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w) // Inverted lockout lines
AM_RANGE(0x800000, 0x800001) AM_WRITE(eaglshot_gfxrom_bank_w)
@@ -2650,6 +2651,8 @@ static MACHINE_CONFIG_DERIVED( hypreact, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(hypreact_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xcb-0x22)*2-1, 0, (0xfe - 0x0e)-1)
@@ -2662,6 +2665,8 @@ static MACHINE_CONFIG_DERIVED( hypreac2, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(hypreac2_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xcb-0x22)*2-1, 0, (0xfe - 0x0e)-1)
@@ -2700,6 +2705,8 @@ static MACHINE_CONFIG_DERIVED( meosism, ssv )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xd5-0x2c)*2-1, 0, (0xfe - 0x12)-1)
@@ -2724,6 +2731,8 @@ static MACHINE_CONFIG_DERIVED( ryorioh, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(ryorioh_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xcb-0x23)*2-1, 0, (0xfe - 0x0e)-1)
@@ -2735,6 +2744,8 @@ static MACHINE_CONFIG_DERIVED( vasara, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(ryorioh_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xcc-0x24)*2-1, 0,(0xfe - 0x0e)-1)
@@ -2746,6 +2757,8 @@ static MACHINE_CONFIG_DERIVED( srmp4, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(srmp4_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1)
@@ -2758,6 +2771,8 @@ static MACHINE_CONFIG_DERIVED( srmp7, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(srmp7_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xd4-0x2c)*2-1, 0, (0xfd - 0x0e)-1)
@@ -2790,6 +2805,8 @@ static MACHINE_CONFIG_DERIVED( survarts, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(survarts_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1)
@@ -2813,6 +2830,8 @@ static MACHINE_CONFIG_DERIVED( eaglshot, ssv )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xca - 0x2a)*2-1, 0, (0xf6 - 0x16)-1)
@@ -2831,6 +2850,8 @@ static MACHINE_CONFIG_DERIVED( sxyreact, ssv )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xcb - 0x22)*2-1, 0, (0xfe - 0x0e)-1)
@@ -2844,6 +2865,8 @@ static MACHINE_CONFIG_DERIVED( sxyreac2, ssv )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xcb - 0x23)*2-1, 0, (0xfe - 0x0e)-1)
@@ -2857,6 +2880,8 @@ static MACHINE_CONFIG_DERIVED( cairblad, ssv )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xcb - 0x22)*2-1, 0, (0xfe - 0x0e)-1)
@@ -2874,6 +2899,8 @@ static MACHINE_CONFIG_DERIVED( twineag2, ssv )
MCFG_QUANTUM_PERFECT_CPU("maincpu")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xd4 - 0x2c)*2-1, 0, (0x102 - 0x12)-1)
@@ -2886,6 +2913,8 @@ static MACHINE_CONFIG_DERIVED( ultrax, ssv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(ultrax_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xd4 - 0x2c)*2-1, 0, (0x102 - 0x12)-1)
@@ -2900,6 +2929,8 @@ static MACHINE_CONFIG_DERIVED( jsk, ssv )
MCFG_CPU_ADD("sub", V810,25000000)
MCFG_CPU_PROGRAM_MAP(jsk_v810_mem)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, (0xca - 0x22)*2-1, 0, (0xfe - 0x0e)-1)
diff --git a/src/mame/drivers/starwars.cpp b/src/mame/drivers/starwars.cpp
index 0cb2206cd2f..1b3b0ac35b1 100644
--- a/src/mame/drivers/starwars.cpp
+++ b/src/mame/drivers/starwars.cpp
@@ -26,6 +26,7 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "video/vector.h"
#include "video/avgdvg.h"
#include "sound/tms5220.h"
@@ -175,7 +176,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, starwars_state )
AM_RANGE(0x4500, 0x45ff) AM_DEVREADWRITE("x2212", x2212_device, read, write)
AM_RANGE(0x4600, 0x461f) AM_DEVWRITE("avg", avg_starwars_device, go_w)
AM_RANGE(0x4620, 0x463f) AM_DEVWRITE("avg", avg_starwars_device, reset_w)
- AM_RANGE(0x4640, 0x465f) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x4640, 0x465f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x4660, 0x467f) AM_WRITE(irq_ack_w)
AM_RANGE(0x4680, 0x469f) AM_READNOP AM_WRITE(starwars_out_w)
AM_RANGE(0x46a0, 0x46bf) AM_WRITE(starwars_nstore_w)
@@ -331,6 +332,8 @@ static MACHINE_CONFIG_START( starwars, starwars_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK / 8)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_PERIODIC_INT_DRIVER(starwars_state, irq0_line_assert, CLOCK_3KHZ / 12)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_hz(CLOCK_3KHZ / 128))
MCFG_CPU_ADD("audiocpu", M6809, MASTER_CLOCK / 8)
diff --git a/src/mame/drivers/suna8.cpp b/src/mame/drivers/suna8.cpp
index a6a6d91293f..02db5b88c25 100644
--- a/src/mame/drivers/suna8.cpp
+++ b/src/mame/drivers/suna8.cpp
@@ -37,6 +37,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/2203intf.h"
#include "sound/3812intf.h"
@@ -624,7 +625,7 @@ WRITE8_MEMBER(suna8_state::sranger_prot_w)
static ADDRESS_MAP_START( rranger_map, AS_PROGRAM, 8, suna8_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // Banked ROM
- AM_RANGE(0xc000, 0xc000) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) // To Sound CPU
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(soundlatch_byte_w) // To Sound CPU
AM_RANGE(0xc002, 0xc002) AM_WRITE(rranger_bankswitch_w ) // ROM Banking
AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P1") // P1 (Inputs)
AM_RANGE(0xc003, 0xc003) AM_READ_PORT("P2") // P2
@@ -1935,6 +1936,8 @@ static MACHINE_CONFIG_START( rranger, suna8_state )
MCFG_CPU_PROGRAM_MAP(rranger_sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(suna8_state, irq0_line_hold, 4*60) /* NMI = retn */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.1)
diff --git a/src/mame/drivers/supdrapo.cpp b/src/mame/drivers/supdrapo.cpp
index 447e0736208..63d95aead34 100644
--- a/src/mame/drivers/supdrapo.cpp
+++ b/src/mame/drivers/supdrapo.cpp
@@ -66,6 +66,7 @@
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
class supdrapo_state : public driver_device
{
@@ -73,6 +74,7 @@ public:
supdrapo_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_watchdog(*this, "watchdog"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_col_line(*this, "col_line"),
@@ -80,6 +82,7 @@ public:
m_char_bank(*this, "char_bank") { }
required_device<cpu_device> m_maincpu;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -212,7 +215,7 @@ WRITE8_MEMBER(supdrapo_state::wdog8000_w)
if (m_wdog == data)
{
- watchdog_reset_w(space, 0, 0); /* Reset */
+ m_watchdog->reset_w(space, 0, 0); /* Reset */
}
m_wdog = data;
@@ -450,6 +453,7 @@ static MACHINE_CONFIG_START( supdrapo, supdrapo_state )
MCFG_CPU_PROGRAM_MAP(sdpoker_mem)
MCFG_CPU_VBLANK_INT_DRIVER("screen", supdrapo_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_NVRAM_ADD_0FILL("nvram")
diff --git a/src/mame/drivers/superchs.cpp b/src/mame/drivers/superchs.cpp
index 9aacce21f5e..dc66a92d9ae 100644
--- a/src/mame/drivers/superchs.cpp
+++ b/src/mame/drivers/superchs.cpp
@@ -127,7 +127,7 @@ WRITE32_MEMBER(superchs_state::superchs_input_w)
{
if (ACCESSING_BITS_24_31) /* $300000 is watchdog */
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
if (ACCESSING_BITS_0_7)
@@ -317,6 +317,8 @@ static MACHINE_CONFIG_START( superchs, superchs_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/supertnk.cpp b/src/mame/drivers/supertnk.cpp
index 938ab46a2fc..c399e38dccd 100644
--- a/src/mame/drivers/supertnk.cpp
+++ b/src/mame/drivers/supertnk.cpp
@@ -99,6 +99,7 @@ CRU lines:
#include "emu.h"
#include "cpu/tms9900/tms9980a.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
@@ -327,7 +328,7 @@ static ADDRESS_MAP_START( supertnk_io_map, AS_IO, 8, supertnk_state )
AM_RANGE(0x0402, 0x0402) AM_WRITE(supertnk_bankswitch_0_w)
AM_RANGE(0x0404, 0x0404) AM_WRITE(supertnk_bankswitch_1_w)
AM_RANGE(0x0406, 0x0406) AM_WRITE(supertnk_interrupt_ack_w)
- AM_RANGE(0x0407, 0x0407) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0407, 0x0407) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
@@ -425,6 +426,8 @@ static MACHINE_CONFIG_START( supertnk, supertnk_state )
MCFG_TMS99xx_ADD("maincpu", TMS9980A, 2598750, supertnk_map, supertnk_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", supertnk_state, supertnk_interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/suprridr.cpp b/src/mame/drivers/suprridr.cpp
index 65101096158..6940aae0ff6 100644
--- a/src/mame/drivers/suprridr.cpp
+++ b/src/mame/drivers/suprridr.cpp
@@ -86,6 +86,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "includes/suprridr.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
@@ -191,7 +192,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( main_portmap, AS_IO, 8, suprridr_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
@@ -353,6 +354,8 @@ static MACHINE_CONFIG_START( suprridr, suprridr_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_portmap)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/surpratk.cpp b/src/mame/drivers/surpratk.cpp
index 84ce10061a7..180ee2f0e4e 100644
--- a/src/mame/drivers/surpratk.cpp
+++ b/src/mame/drivers/surpratk.cpp
@@ -12,6 +12,7 @@
#include "emu.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/konamipt.h"
#include "includes/surpratk.h"
@@ -65,7 +66,7 @@ static ADDRESS_MAP_START( surpratk_map, AS_PROGRAM, 8, surpratk_state )
AM_RANGE(0x5f90, 0x5f90) AM_READ_PORT("DSW2")
AM_RANGE(0x5fa0, 0x5faf) AM_DEVREADWRITE("k053244", k05324x_device, k053244_r, k053244_w)
AM_RANGE(0x5fb0, 0x5fbf) AM_DEVWRITE("k053251", k053251_device, write)
- AM_RANGE(0x5fc0, 0x5fc0) AM_READ(watchdog_reset_r) AM_WRITE(surpratk_5fc0_w)
+ AM_RANGE(0x5fc0, 0x5fc0) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(surpratk_5fc0_w)
AM_RANGE(0x5fd0, 0x5fd1) AM_DEVWRITE("ymsnd", ym2151_device, write)
AM_RANGE(0x5fc4, 0x5fc4) AM_WRITE(surpratk_videobank_w)
AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("k052109", k052109_device, read, write)
@@ -177,6 +178,8 @@ static MACHINE_CONFIG_START( surpratk, surpratk_state )
MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(13)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x800)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp
index d323e47ac41..4a5104d364f 100644
--- a/src/mame/drivers/taito_f2.cpp
+++ b/src/mame/drivers/taito_f2.cpp
@@ -268,6 +268,7 @@ Notes:
#include "cpu/z80/z80.h"
#include "includes/taitoipt.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "audio/taitosnd.h"
#include "includes/taito_f2.h"
#include "sound/2203intf.h"
@@ -795,7 +796,7 @@ static ADDRESS_MAP_START( quizhq_map, AS_PROGRAM, 16, taitof2_state )
AM_RANGE(0x500004, 0x500005) AM_WRITE(growl_coin_word_w)
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSWB")
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("IN0")
- AM_RANGE(0x580000, 0x580001) AM_WRITE(watchdog_reset16_w) /* ??? */
+ AM_RANGE(0x580000, 0x580001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* ??? */
AM_RANGE(0x580006, 0x580007) AM_WRITENOP /* ??? */
AM_RANGE(0x580000, 0x580001) AM_READ_PORT("DSWA")
AM_RANGE(0x580002, 0x580003) AM_READ_PORT("IN1")
@@ -846,7 +847,7 @@ static ADDRESS_MAP_START( growl_map, AS_PROGRAM, 16, taitof2_state )
AM_RANGE(0x320000, 0x320001) AM_READ_PORT("IN0")
AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
- AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x340000, 0x340001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
@@ -894,7 +895,7 @@ static ADDRESS_MAP_START( footchmp_map, AS_PROGRAM, 16, taitof2_state )
AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
AM_RANGE(0x70000e, 0x70000f) AM_READ_PORT("IN3")
AM_RANGE(0x700010, 0x700011) AM_READ_PORT("IN4")
- AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w) /* ??? */
+ AM_RANGE(0x800000, 0x800001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* ??? */
AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
ADDRESS_MAP_END
@@ -933,7 +934,7 @@ static ADDRESS_MAP_START( ninjak_map, AS_PROGRAM, 16, taitof2_state )
AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x300000, 0x30000f) AM_READ(ninjak_input_r)
AM_RANGE(0x30000e, 0x30000f) AM_WRITE(ninjak_coin_word_w)
- AM_RANGE(0x380000, 0x380001) AM_WRITE(watchdog_reset16_w) /* ??? */
+ AM_RANGE(0x380000, 0x380001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* ??? */
AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
AM_RANGE(0x600000, 0x60000f) AM_WRITE(taitof2_spritebank_w)
@@ -953,7 +954,7 @@ static ADDRESS_MAP_START( solfigtr_map, AS_PROGRAM, 16, taitof2_state )
AM_RANGE(0x320000, 0x320001) AM_READ_PORT("IN0")
AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
- AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w) /* NOT VERIFIED */
+ AM_RANGE(0x340000, 0x340001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* NOT VERIFIED */
AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
@@ -1055,7 +1056,7 @@ static ADDRESS_MAP_START( deadconx_map, AS_PROGRAM, 16, taitof2_state )
AM_RANGE(0x700006, 0x700007) AM_WRITE(taitof2_4p_coin_word_w)
AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN0")
AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
- AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w) /* ??? */
+ AM_RANGE(0x800000, 0x800001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* ??? */
AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
ADDRESS_MAP_END
@@ -2864,6 +2865,8 @@ static MACHINE_CONFIG_START( taito_f2, taitof2_state )
MCFG_MACHINE_START_OVERRIDE(taitof2_state,f2)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -2898,7 +2901,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( taito_f2_tc0220ioc, taito_f2 )
/* basic machine hardware */
-
+ MCFG_DEVICE_REMOVE("watchdog")
MCFG_DEVICE_ADD("tc0220ioc", TC0220IOC, 0)
MCFG_TC0220IOC_READ_0_CB(IOPORT("DSWA"))
MCFG_TC0220IOC_READ_1_CB(IOPORT("DSWB"))
@@ -2910,7 +2913,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( taito_f2_tc0510nio, taito_f2 )
/* basic machine hardware */
-
+ MCFG_DEVICE_REMOVE("watchdog")
MCFG_DEVICE_ADD("tc0510nio", TC0510NIO, 0)
MCFG_TC0510NIO_READ_0_CB(IOPORT("DSWA"))
MCFG_TC0510NIO_READ_1_CB(IOPORT("DSWB"))
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp
index 1ffaa7df135..d5f282b6e91 100644
--- a/src/mame/drivers/taito_f3.cpp
+++ b/src/mame/drivers/taito_f3.cpp
@@ -71,7 +71,7 @@ WRITE32_MEMBER(taito_f3_state::f3_control_w)
switch (offset)
{
case 0x00: /* Watchdog */
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
return;
case 0x01: /* Coin counters & lockouts */
@@ -446,6 +446,8 @@ static MACHINE_CONFIG_START( f3, taito_f3_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58.97)
diff --git a/src/mame/drivers/taito_o.cpp b/src/mame/drivers/taito_o.cpp
index 2b9761750a4..642a677a191 100644
--- a/src/mame/drivers/taito_o.cpp
+++ b/src/mame/drivers/taito_o.cpp
@@ -42,7 +42,7 @@ WRITE16_MEMBER(taitoo_state::io_w)
{
switch(offset)
{
- case 2: machine().watchdog_reset(); break;
+ case 2: m_watchdog->watchdog_reset(); break;
default: logerror("IO W %x %x %x\n", offset, data, mem_mask);
}
@@ -234,6 +234,7 @@ static MACHINE_CONFIG_START( parentj, taitoo_state )
MCFG_CPU_PROGRAM_MAP(parentj_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitoo_state, parentj_interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp
index 116e011b352..409722d8c45 100644
--- a/src/mame/drivers/taitosj.cpp
+++ b/src/mame/drivers/taitosj.cpp
@@ -168,6 +168,7 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "includes/taitosj.h"
@@ -329,7 +330,7 @@ static ADDRESS_MAP_START( kikstart_main_map, AS_PROGRAM, 8, taitosj_state )
AM_RANGE(0xd508, 0xd508) AM_WRITE(taitosj_collision_reg_clear_w)
AM_RANGE(0xd509, 0xd50a) AM_WRITEONLY AM_SHARE("gfxpointer")
AM_RANGE(0xd50b, 0xd50b) AM_WRITE(taitosj_soundcommand_w)
- AM_RANGE(0xd50d, 0xd50d) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xd50d, 0xd50d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd50e, 0xd50e) AM_WRITE(taitosj_bankswitch_w)
AM_RANGE(0xd600, 0xd600) AM_WRITEONLY AM_SHARE("video_mode")
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE("kikstart_scroll")// scroll ram + ???
@@ -1818,6 +1819,8 @@ static MACHINE_CONFIG_DERIVED( kikstart, mcu )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(kikstart_main_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(taitosj_state, screen_update_kikstart)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tecmo.cpp b/src/mame/drivers/tecmo.cpp
index c5ad0dcde06..199423116b5 100644
--- a/src/mame/drivers/tecmo.cpp
+++ b/src/mame/drivers/tecmo.cpp
@@ -52,6 +52,7 @@ f80b ????
***************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/3812intf.h"
#include "includes/tecmo.h"
@@ -162,7 +163,7 @@ static ADDRESS_MAP_START( rygar_map, AS_PROGRAM, 8, tecmo_state )
AM_RANGE(0xf806, 0xf806) AM_WRITE(sound_command_w)
AM_RANGE(0xf807, 0xf807) AM_WRITE(flipscreen_w)
AM_RANGE(0xf808, 0xf808) AM_WRITE(bankswitch_w)
- AM_RANGE(0xf80b, 0xf80b) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xf80b, 0xf80b) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( gemini_map, AS_PROGRAM, 8, tecmo_state )
@@ -190,7 +191,7 @@ static ADDRESS_MAP_START( gemini_map, AS_PROGRAM, 8, tecmo_state )
AM_RANGE(0xf806, 0xf806) AM_WRITE(sound_command_w)
AM_RANGE(0xf807, 0xf807) AM_WRITE(flipscreen_w)
AM_RANGE(0xf808, 0xf808) AM_WRITE(bankswitch_w)
- AM_RANGE(0xf80b, 0xf80b) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xf80b, 0xf80b) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( silkworm_map, AS_PROGRAM, 8, tecmo_state )
@@ -622,6 +623,8 @@ static MACHINE_CONFIG_START( rygar, tecmo_state )
MCFG_CPU_ADD("soundcpu", Z80, XTAL_4MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(rygar_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/tecmosys.cpp b/src/mame/drivers/tecmosys.cpp
index 063dfa796c9..c6d687469a2 100644
--- a/src/mame/drivers/tecmosys.cpp
+++ b/src/mame/drivers/tecmosys.cpp
@@ -240,7 +240,7 @@ WRITE16_MEMBER(tecmosys_state::unk880000_w)
break;
case 0x22/2:
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
//logerror( "watchdog_w( %06x, %04x ) @ %06x\n", (offset * 2)+0x880000, data, space.device().safe_pc() );
break;
@@ -453,7 +453,9 @@ static MACHINE_CONFIG_START( deroon, tecmosys_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tecmosys_state, irq1_line_hold)
- MCFG_WATCHDOG_VBLANK_INIT(400) // guess
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 400) // guess
MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/2 )
MCFG_CPU_PROGRAM_MAP(sound_map)
diff --git a/src/mame/drivers/tehkanwc.cpp b/src/mame/drivers/tehkanwc.cpp
index ca761fcd478..9bf4a47e329 100644
--- a/src/mame/drivers/tehkanwc.cpp
+++ b/src/mame/drivers/tehkanwc.cpp
@@ -92,6 +92,7 @@ TO DO :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "gridiron.lh"
#include "includes/tehkanwc.h"
@@ -246,7 +247,7 @@ static ADDRESS_MAP_START( main_mem, AS_PROGRAM, 8, tehkanwc_state )
AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_byte_r) AM_WRITE(sound_command_w) /* answer from the sound CPU */
AM_RANGE(0xf840, 0xf840) AM_READ_PORT("DSW1") AM_WRITE(sub_cpu_halt_w)
AM_RANGE(0xf850, 0xf850) AM_READ_PORT("DSW2") AM_WRITENOP /* ?? writes 0x00 or 0xff */
- AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r) AM_WRITE(flipscreen_x_w)
+ AM_RANGE(0xf860, 0xf860) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(flipscreen_x_w)
AM_RANGE(0xf870, 0xf870) AM_READ_PORT("DSW3") AM_WRITE(flipscreen_y_w)
ADDRESS_MAP_END
@@ -262,7 +263,7 @@ static ADDRESS_MAP_START( sub_mem, AS_PROGRAM, 8, tehkanwc_state )
AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("spriteram") /* sprites */
AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(scroll_x_w)
AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(scroll_y_w)
- AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf860, 0xf860) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_mem, AS_PROGRAM, 8, tehkanwc_state )
@@ -642,6 +643,8 @@ static MACHINE_CONFIG_START( tehkanwc, tehkanwc_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - seems enough to keep the CPUs in sync */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/tempest.cpp b/src/mame/drivers/tempest.cpp
index 81677742291..f7f8d416b6f 100644
--- a/src/mame/drivers/tempest.cpp
+++ b/src/mame/drivers/tempest.cpp
@@ -278,6 +278,7 @@ Note: Roms for Tempest Analog Vector-Generator PCB Assembly A037383-03 or A03738
#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "machine/mathbox.h"
+#include "machine/watchdog.h"
#include "video/avgdvg.h"
#include "video/vector.h"
#include "machine/atari_vg.h"
@@ -299,6 +300,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_mathbox(*this, "mathbox"),
+ m_watchdog(*this, "watchdog"),
m_avg(*this, "avg"),
m_rom(*this, "maincpu"),
m_knob_p1(*this, TEMPEST_KNOB_P1_TAG),
@@ -311,6 +313,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<mathbox_device> m_mathbox;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<avg_tempest_device> m_avg;
required_region_ptr<UINT8> m_rom;
@@ -351,7 +354,7 @@ void tempest_state::machine_start()
WRITE8_MEMBER(tempest_state::wdclr_w)
{
m_maincpu->set_input_line(0, CLEAR_LINE);
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
/*************************************
@@ -589,8 +592,9 @@ static MACHINE_CONFIG_START( tempest, tempest_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 8)
MCFG_CPU_PROGRAM_MAP(main_map)
-
MCFG_CPU_PERIODIC_INT_DRIVER(tempest_state, irq0_line_assert, CLOCK_3KHZ / 12)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_hz(CLOCK_3KHZ / 256))
MCFG_ATARIVGEAROM_ADD("earom")
diff --git a/src/mame/drivers/tetrisp2.cpp b/src/mame/drivers/tetrisp2.cpp
index 7bbdbeeae12..b7e7f1beb70 100644
--- a/src/mame/drivers/tetrisp2.cpp
+++ b/src/mame/drivers/tetrisp2.cpp
@@ -56,6 +56,7 @@ stepstag:
#include "stepstag.lh"
#include "includes/tetrisp2.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
/***************************************************************************
@@ -323,7 +324,7 @@ static ADDRESS_MAP_START( tetrisp2_map, AS_PROGRAM, 16, tetrisp2_state )
AM_RANGE(0xbe0002, 0xbe0003) AM_READ_PORT("PLAYERS") // Inputs
AM_RANGE(0xbe0004, 0xbe0005) AM_READ(tetrisp2_ip_1_word_r) // Inputs & protection
AM_RANGE(0xbe0008, 0xbe0009) AM_READ_PORT("DSW") // Inputs
- AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0xbe000a, 0xbe000b) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog
ADDRESS_MAP_END
@@ -392,7 +393,7 @@ static ADDRESS_MAP_START( nndmseal_map, AS_PROGRAM, 16, tetrisp2_state )
AM_RANGE(0xbe0006, 0xbe0007) AM_READ_PORT("PRINT" ) // ""
AM_RANGE(0xbe0008, 0xbe0009) AM_READ_PORT("DSW" ) // ""
- AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r ) // Watchdog
+ AM_RANGE(0xbe000a, 0xbe000b) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
ADDRESS_MAP_END
@@ -426,7 +427,7 @@ static ADDRESS_MAP_START( rockn1_map, AS_PROGRAM, 16, tetrisp2_state )
AM_RANGE(0xbe0002, 0xbe0003) AM_READ_PORT("PLAYERS") // Inputs
AM_RANGE(0xbe0004, 0xbe0005) AM_READ_PORT("SYSTEM") // Inputs
AM_RANGE(0xbe0008, 0xbe0009) AM_READ_PORT("DSW") // Inputs
- AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0xbe000a, 0xbe000b) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog
ADDRESS_MAP_END
@@ -460,7 +461,7 @@ static ADDRESS_MAP_START( rockn2_map, AS_PROGRAM, 16, tetrisp2_state )
AM_RANGE(0xbe0002, 0xbe0003) AM_READ_PORT("PLAYERS") // Inputs
AM_RANGE(0xbe0004, 0xbe0005) AM_READ_PORT("SYSTEM") // Inputs
AM_RANGE(0xbe0008, 0xbe0009) AM_READ_PORT("DSW") // Inputs
- AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0xbe000a, 0xbe000b) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog
ADDRESS_MAP_END
@@ -495,7 +496,7 @@ static ADDRESS_MAP_START( rocknms_main_map, AS_PROGRAM, 16, tetrisp2_state )
AM_RANGE(0xbe0002, 0xbe0003) AM_READ_PORT("PLAYERS")
AM_RANGE(0xbe0004, 0xbe0005) AM_READ_PORT("SYSTEM") // Inputs
AM_RANGE(0xbe0008, 0xbe0009) AM_READ_PORT("DSW") // Inputs
- AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r) // Watchdog
+ AM_RANGE(0xbe000a, 0xbe000b) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog
ADDRESS_MAP_END
@@ -527,7 +528,7 @@ static ADDRESS_MAP_START( rocknms_sub_map, AS_PROGRAM, 16, tetrisp2_state )
AM_RANGE(0xba001e, 0xba001f) AM_WRITENOP // Lev 2 irq ack
// AM_RANGE(0xbe0000, 0xbe0001) AM_READNOP // INT-level1 dummy read
AM_RANGE(0xbe0002, 0xbe0003) AM_READWRITE(rocknms_main2sub_r, rocknms_sub2main_w) // MAIN <-> SUB Communication
- AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r ) // Watchdog
+ AM_RANGE(0xbe000a, 0xbe000b) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) // Watchdog
ADDRESS_MAP_END
@@ -1327,7 +1328,9 @@ static MACHINE_CONFIG_START( tetrisp2, tetrisp2_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", tetrisp2_state, irq2_line_hold)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_WATCHDOG_VBLANK_INIT(8) /* guess */
+
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8) /* guess */
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1361,6 +1364,8 @@ static MACHINE_CONFIG_START( nndmseal, tetrisp2_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1392,6 +1397,8 @@ static MACHINE_CONFIG_START( rockn, tetrisp2_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1424,6 +1431,8 @@ static MACHINE_CONFIG_START( rockn2, tetrisp2_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1460,6 +1469,8 @@ static MACHINE_CONFIG_START( rocknms, tetrisp2_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", tetrisp2)
diff --git a/src/mame/drivers/thedealr.cpp b/src/mame/drivers/thedealr.cpp
index 96a765dfda1..9649c0b27b9 100644
--- a/src/mame/drivers/thedealr.cpp
+++ b/src/mame/drivers/thedealr.cpp
@@ -33,6 +33,7 @@
#include "video/seta001.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
class thedealr_state : public driver_device
{
@@ -289,7 +290,7 @@ static ADDRESS_MAP_START( thedealr, AS_PROGRAM, 8, thedealr_state )
AM_RANGE(0x3c00, 0x3c00) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, address_w)
AM_RANGE(0x3c01, 0x3c01) AM_DEVWRITE ("aysnd", ay8910_device, data_w)
- AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("maincpu", 0)
ADDRESS_MAP_END
@@ -532,6 +533,8 @@ static MACHINE_CONFIG_START( thedealr, thedealr_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
diff --git a/src/mame/drivers/thepit.cpp b/src/mame/drivers/thepit.cpp
index d1416cbd947..9e73f41bfb5 100644
--- a/src/mame/drivers/thepit.cpp
+++ b/src/mame/drivers/thepit.cpp
@@ -154,6 +154,7 @@ Player 2 and Player 1 share the same controls !
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/thepit.h"
@@ -210,7 +211,7 @@ static ADDRESS_MAP_START( thepit_main_map, AS_PROGRAM, 8, thepit_state )
AM_RANGE(0xb004, 0xb005) AM_WRITENOP // Unused, but initialized
AM_RANGE(0xb006, 0xb006) AM_WRITE(flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(soundlatch_byte_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( desertdan_main_map, AS_PROGRAM, 8, thepit_state )
@@ -230,7 +231,7 @@ static ADDRESS_MAP_START( desertdan_main_map, AS_PROGRAM, 8, thepit_state )
AM_RANGE(0xb004, 0xb005) AM_WRITENOP // Unused, but initialized
AM_RANGE(0xb006, 0xb006) AM_WRITE(flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(soundlatch_byte_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( intrepid_main_map, AS_PROGRAM, 8, thepit_state )
@@ -252,7 +253,7 @@ static ADDRESS_MAP_START( intrepid_main_map, AS_PROGRAM, 8, thepit_state )
AM_RANGE(0xb005, 0xb005) AM_WRITE(intrepid_graphics_bank_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(flip_screen_x_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(flip_screen_y_w)
- AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w)
+ AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(soundlatch_byte_w)
ADDRESS_MAP_END
@@ -716,6 +717,8 @@ static MACHINE_CONFIG_START( thepit, thepit_state )
MCFG_CPU_IO_MAP(audio_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", thepit_state, irq0_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", thepit)
MCFG_PALETTE_ADD("palette", 32+8)
diff --git a/src/mame/drivers/thoop2.cpp b/src/mame/drivers/thoop2.cpp
index c8a95bd63ad..dff9d269dc4 100644
--- a/src/mame/drivers/thoop2.cpp
+++ b/src/mame/drivers/thoop2.cpp
@@ -17,6 +17,7 @@ pf: but some gameplay bugs - sprite positioning is incorrect, no enemies, jump a
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "includes/thoop2.h"
@@ -63,7 +64,7 @@ static ADDRESS_MAP_START( thoop2_map, AS_PROGRAM, 16, thoop2_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(vram_w) AM_SHARE("videoram") /* Video RAM */
AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_SHARE("vregs") /* Video Registers */
- AM_RANGE(0x10800c, 0x10800d) AM_WRITE(watchdog_reset16_w) /* INT 6 ACK/Watchdog timer */
+ AM_RANGE(0x10800c, 0x10800d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* INT 6 ACK/Watchdog timer */
AM_RANGE(0x200000, 0x2007ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")/* Palette */
AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("spriteram") /* Sprite RAM */
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2")
@@ -205,6 +206,8 @@ static MACHINE_CONFIG_START( thoop2, thoop2_state )
MCFG_CPU_PROGRAM_MAP(thoop2_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", thoop2_state, irq6_line_hold)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/thunderj.cpp b/src/mame/drivers/thunderj.cpp
index cc8733ed986..2521c4e20f1 100644
--- a/src/mame/drivers/thunderj.cpp
+++ b/src/mame/drivers/thunderj.cpp
@@ -38,6 +38,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "machine/atarigen.h"
#include "includes/thunderj.h"
@@ -123,7 +124,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, thunderj_state )
AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("jsa", atari_jsa_ii_device, main_response_r, 0x00ff)
- AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2e0000, 0x2e0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_DEVWRITE8("jsa", atari_jsa_ii_device, main_command_w, 0x00ff)
@@ -259,6 +260,8 @@ static MACHINE_CONFIG_START( thunderj, thunderj_state )
MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* perfect synchronization due to shared RAM */
MCFG_QUANTUM_PERFECT_CPU("maincpu")
diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp
index 37dee298876..7c34f74d280 100644
--- a/src/mame/drivers/thunderx.cpp
+++ b/src/mame/drivers/thunderx.cpp
@@ -35,7 +35,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
-
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "includes/konamipt.h"
#include "includes/thunderx.h"
@@ -403,7 +403,7 @@ static ADDRESS_MAP_START( scontra_map, AS_PROGRAM, 8, thunderx_state )
AM_RANGE(0x1f80, 0x1f80) AM_WRITE(scontra_bankswitch_w) /* bankswitch control + coin counters */
AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x1f88, 0x1f88) AM_WRITE(sh_irqtrigger_w) /* cause interrupt on audio CPU */
- AM_RANGE(0x1f8c, 0x1f8c) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1f8c, 0x1f8c) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1f90, 0x1f90) AM_READ_PORT("SYSTEM")
AM_RANGE(0x1f91, 0x1f91) AM_READ_PORT("P1")
AM_RANGE(0x1f92, 0x1f92) AM_READ_PORT("P2")
@@ -644,6 +644,8 @@ static MACHINE_CONFIG_START( scontra, thunderx_state )
MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(12)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x0800)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
diff --git a/src/mame/drivers/tickee.cpp b/src/mame/drivers/tickee.cpp
index 3d1f78faa9d..d519b8e4899 100644
--- a/src/mame/drivers/tickee.cpp
+++ b/src/mame/drivers/tickee.cpp
@@ -28,6 +28,7 @@
#include "sound/ay8910.h"
#include "sound/okim6295.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
class tickee_state : public driver_device
@@ -493,7 +494,7 @@ static ADDRESS_MAP_START( rapidfir_map, AS_PROGRAM, 16, tickee_state )
AM_RANGE(0xfc000a00, 0xfc000a0f) AM_READ_PORT("IN2")
AM_RANGE(0xfc000b00, 0xfc000b0f) AM_READ_PORT("DSW0")
AM_RANGE(0xfc000c00, 0xfc000c1f) AM_READ_PORT("DSW1")
- AM_RANGE(0xfc000e00, 0xfc000e1f) AM_READ(watchdog_reset16_r)
+ AM_RANGE(0xfc000e00, 0xfc000e1f) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)
AM_RANGE(0xfc100000, 0xfc1000ff) AM_MIRROR(0x80000) AM_DEVREADWRITE8("tlc34076", tlc34076_device, read, write, 0x00ff)
AM_RANGE(0xfc200000, 0xfc207fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0xfc300000, 0xfc30000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
@@ -802,6 +803,8 @@ static MACHINE_CONFIG_START( rapidfir, tickee_state )
MCFG_MACHINE_RESET_OVERRIDE(tickee_state,rapidfir)
MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT)
diff --git a/src/mame/drivers/timelimt.cpp b/src/mame/drivers/timelimt.cpp
index 6ab4f08e538..41c8b140247 100644
--- a/src/mame/drivers/timelimt.cpp
+++ b/src/mame/drivers/timelimt.cpp
@@ -15,6 +15,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/timelimt.h"
@@ -66,7 +67,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( main_io_map, AS_IO, 8, timelimt_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, timelimt_state )
@@ -230,6 +231,7 @@ static MACHINE_CONFIG_START( timelimt, timelimt_state )
MCFG_QUANTUM_TIME(attotime::from_hz(3000))
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/timeplt.cpp b/src/mame/drivers/timeplt.cpp
index 85e620327b9..13116e7a807 100644
--- a/src/mame/drivers/timeplt.cpp
+++ b/src/mame/drivers/timeplt.cpp
@@ -49,6 +49,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "includes/konamipt.h"
#include "audio/timeplt.h"
#include "sound/ay8910.h"
@@ -131,7 +132,7 @@ static ADDRESS_MAP_START( common_main_map, AS_PROGRAM, 8, timeplt_state )
AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_SHARE("spriteram2")
AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_READ(scanline_r) AM_WRITE(soundlatch_byte_w)
- AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_READ_PORT("DSW1") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0c9f) AM_READ_PORT("IN0")
AM_RANGE(0xc302, 0xc302) AM_MIRROR(0x0cf1) AM_WRITE(flipscreen_w)
AM_RANGE(0xc304, 0xc304) AM_MIRROR(0x0cf1) AM_DEVWRITE("timeplt_audio", timeplt_audio_device, sh_irqtrigger_w)
@@ -428,6 +429,8 @@ static MACHINE_CONFIG_START( timeplt, timeplt_state )
MCFG_CPU_PROGRAM_MAP(timeplt_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", timeplt_state, interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
diff --git a/src/mame/drivers/tmaster.cpp b/src/mame/drivers/tmaster.cpp
index 40858fa6df1..1f8e0a2ca42 100644
--- a/src/mame/drivers/tmaster.cpp
+++ b/src/mame/drivers/tmaster.cpp
@@ -111,6 +111,7 @@ To Do:
#include "machine/mc68681.h"
#include "machine/nvram.h"
#include "machine/ds1204.h"
+#include "machine/watchdog.h"
/***************************************************************************
@@ -744,7 +745,7 @@ static ADDRESS_MAP_START( galgames_map, AS_PROGRAM, 16, tmaster_state )
AM_RANGE( 0x600000, 0x600001 ) AM_READ(dummy_read_01 ) AM_WRITENOP
AM_RANGE( 0x700000, 0x700001 ) AM_READ(dummy_read_01 ) AM_WRITENOP
AM_RANGE( 0x800020, 0x80003f ) AM_NOP // ?
- AM_RANGE( 0x900000, 0x900001 ) AM_WRITE(watchdog_reset16_w )
+ AM_RANGE( 0x900000, 0x900001 ) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE( 0xa00000, 0xa00001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff )
AM_RANGE( 0xb00000, 0xb7ffff ) AM_READWRITE(galgames_okiram_r, galgames_okiram_w ) // (only low bytes tested) 4x N341024SJ-15
@@ -955,6 +956,7 @@ static MACHINE_CONFIG_START( galgames, tmaster_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2)
MCFG_CPU_PROGRAM_MAP(galgames_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tmaster_state, tm3k_interrupt, "screen", 0, 1)
+ MCFG_WATCHDOG_ADD("watchdog")
// 5 EEPROMs on the motherboard (for BIOS + 4 Carts)
MCFG_EEPROM_SERIAL_93C76_8BIT_ADD(GALGAMES_EEPROM_BIOS)
diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp
index 0d7c1c1ede7..935b44e335a 100644
--- a/src/mame/drivers/tmnt.cpp
+++ b/src/mame/drivers/tmnt.cpp
@@ -63,6 +63,7 @@ Updates:
#include "sound/samples.h"
#include "sound/k054539.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/tmnt.h"
#include "includes/konamipt.h"
@@ -473,7 +474,7 @@ static ADDRESS_MAP_START( cuebrick_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("COINS") AM_WRITE(tmnt_0a0000_w)
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
- AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0b0000, 0x0b03ff) AM_RAMBANK("nvrambank")
@@ -494,7 +495,7 @@ static ADDRESS_MAP_START( mia_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
- AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW1") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW2")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
#if 0
@@ -516,7 +517,7 @@ static ADDRESS_MAP_START( tmnt_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0006, 0x0a0007) AM_READ_PORT("P3")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
- AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW1") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW2")
AM_RANGE(0x0a0014, 0x0a0015) AM_READ_PORT("P4")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
@@ -539,7 +540,7 @@ static ADDRESS_MAP_START( punkshot_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0020, 0x0a0021) AM_WRITE(punkshot_0a0020_w)
AM_RANGE(0x0a0040, 0x0a0043) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x0a0060, 0x0a007f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
- AM_RANGE(0x0a0080, 0x0a0081) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0a0080, 0x0a0081) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x100000, 0x107fff) AM_READWRITE(k052109_word_noA12_r, punkshot_k052109_word_noA12_w)
AM_RANGE(0x110000, 0x110007) AM_DEVREADWRITE8("k051960", k051960_device, k051937_r, k051937_w, 0xffff)
AM_RANGE(0x110400, 0x1107ff) AM_DEVREADWRITE8("k051960", k051960_device, k051960_r, k051960_w, 0xffff)
@@ -559,7 +560,7 @@ static ADDRESS_MAP_START( lgtnfght_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW3")
AM_RANGE(0x0a0018, 0x0a0019) AM_WRITE(lgtnfght_0a0018_w)
AM_RANGE(0x0a0020, 0x0a0023) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
- AM_RANGE(0x0a0028, 0x0a0029) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0a0028, 0x0a0029) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0b0000, 0x0b3fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_SHARE("spriteram")
AM_RANGE(0x0c0000, 0x0c001f) AM_READWRITE(k053244_word_noA1_r, k053244_word_noA1_w)
AM_RANGE(0x0e0000, 0x0e001f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
@@ -587,7 +588,7 @@ static ADDRESS_MAP_START( blswhstl_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x700006, 0x700007) AM_READ_PORT("EEPROM")
AM_RANGE(0x700200, 0x700201) AM_WRITE(blswhstl_eeprom_w)
AM_RANGE(0x700300, 0x700301) AM_WRITE(blswhstl_700300_w)
- AM_RANGE(0x700400, 0x700401) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w)
+ AM_RANGE(0x700400, 0x700401) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0x780600, 0x780603) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x780604, 0x780605) AM_WRITE(ssriders_soundkludge_w)
AM_RANGE(0x780700, 0x78071f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
@@ -632,7 +633,7 @@ static ADDRESS_MAP_START( glfgreat_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x120006, 0x120007) AM_READ_PORT("DSW1/DSW2")
AM_RANGE(0x121000, 0x121001) AM_READ(glfgreat_ball_r) /* returns the color of the center pixel of the roz layer */
AM_RANGE(0x122000, 0x122001) AM_WRITE(glfgreat_122000_w)
- AM_RANGE(0x124000, 0x124001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x124000, 0x124001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x125000, 0x125003) AM_DEVREAD8("k053260", k053260_device, main_read, 0xff00) AM_WRITE8(glfgreat_sound_w, 0xff00)
AM_RANGE(0x200000, 0x207fff) AM_READWRITE(k052109_word_noA12_r, k052109_word_noA12_w)
AM_RANGE(0x300000, 0x3fffff) AM_READ(glfgreat_rom_r)
@@ -658,7 +659,7 @@ static ADDRESS_MAP_START( prmrsocr_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x122000, 0x122001) AM_WRITE(prmrsocr_eeprom_w) /* EEPROM + video control */
AM_RANGE(0x123000, 0x123001) AM_WRITE(prmrsocr_sound_irq_w)
AM_RANGE(0x200000, 0x207fff) AM_READWRITE(k052109_word_noA12_r, k052109_word_noA12_w)
- AM_RANGE(0x280000, 0x280001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x280000, 0x280001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x300000, 0x33ffff) AM_READ(prmrsocr_rom_r)
ADDRESS_MAP_END
@@ -912,7 +913,7 @@ static ADDRESS_MAP_START( tmnt2_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x1c0102, 0x1c0103) AM_READ(ssriders_eeprom_r)
AM_RANGE(0x1c0200, 0x1c0201) AM_WRITE(ssriders_eeprom_w) /* EEPROM and gfx control */
AM_RANGE(0x1c0300, 0x1c0301) AM_WRITE(ssriders_1c0300_w)
- AM_RANGE(0x1c0400, 0x1c0401) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w)
+ AM_RANGE(0x1c0400, 0x1c0401) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0x1c0500, 0x1c057f) AM_RAM /* TMNT2 only (1J) unknown, mostly MCU blit offsets */
// AM_RANGE(0x1c0800, 0x1c0801) AM_READ(ssriders_protection_r) /* protection device */
AM_RANGE(0x1c0800, 0x1c081f) AM_WRITE(tmnt2_1c0800_w) AM_SHARE("tmnt2_1c0800") /* protection device */
@@ -937,7 +938,7 @@ static ADDRESS_MAP_START( ssriders_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x1c0102, 0x1c0103) AM_READ(ssriders_eeprom_r)
AM_RANGE(0x1c0200, 0x1c0201) AM_WRITE(ssriders_eeprom_w) /* EEPROM and gfx control */
AM_RANGE(0x1c0300, 0x1c0301) AM_WRITE(ssriders_1c0300_w)
- AM_RANGE(0x1c0400, 0x1c0401) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w)
+ AM_RANGE(0x1c0400, 0x1c0401) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0x1c0500, 0x1c057f) AM_RAM /* TMNT2 only (1J) unknown */
AM_RANGE(0x1c0800, 0x1c0801) AM_READ(ssriders_protection_r)
AM_RANGE(0x1c0800, 0x1c0803) AM_WRITE(ssriders_protection_w)
@@ -1966,6 +1967,8 @@ static MACHINE_CONFIG_START( cuebrick, tmnt_state )
MCFG_MACHINE_START_OVERRIDE(tmnt_state,common)
MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2019,6 +2022,8 @@ static MACHINE_CONFIG_START( mia, tmnt_state )
MCFG_MACHINE_START_OVERRIDE(tmnt_state,common)
MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -2080,6 +2085,8 @@ static MACHINE_CONFIG_START( tmnt, tmnt_state )
MCFG_MACHINE_START_OVERRIDE(tmnt_state,common)
MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,tmnt)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -2145,6 +2152,8 @@ static MACHINE_CONFIG_START( punkshot, tmnt_state )
MCFG_MACHINE_START_OVERRIDE(tmnt_state,common)
MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2196,6 +2205,8 @@ static MACHINE_CONFIG_START( lgtnfght, tmnt_state )
MCFG_MACHINE_START_OVERRIDE(tmnt_state,common)
MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2253,6 +2264,8 @@ static MACHINE_CONFIG_START( blswhstl, tmnt_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2327,6 +2340,8 @@ static MACHINE_CONFIG_START( glfgreat, tmnt_state )
MCFG_MACHINE_START_OVERRIDE(tmnt_state,common)
MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2393,6 +2408,8 @@ static MACHINE_CONFIG_START( prmrsocr, tmnt_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2456,6 +2473,8 @@ static MACHINE_CONFIG_START( tmnt2, tmnt_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2513,6 +2532,8 @@ static MACHINE_CONFIG_START( ssriders, tmnt_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
diff --git a/src/mame/drivers/toki.cpp b/src/mame/drivers/toki.cpp
index 46d0ef11f0f..0feb9b2a13e 100644
--- a/src/mame/drivers/toki.cpp
+++ b/src/mame/drivers/toki.cpp
@@ -95,6 +95,7 @@ Notes:
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/3812intf.h"
#include "sound/msm5205.h"
#include "sound/3812intf.h"
@@ -166,7 +167,7 @@ static ADDRESS_MAP_START( tokib_map, AS_PROGRAM, 16, toki_state )
/* gets written the same value as 75000a (bg2 scrollx) */
AM_RANGE(0x071804, 0x071807) AM_WRITENOP /* sprite related, always 01be0100 */
AM_RANGE(0x07180e, 0x071e45) AM_WRITEONLY AM_SHARE("spriteram")
- AM_RANGE(0x072000, 0x072001) AM_READ(watchdog_reset16_r) /* probably */
+ AM_RANGE(0x072000, 0x072001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) /* probably */
AM_RANGE(0x075000, 0x075001) AM_WRITE(tokib_soundcommand_w)
AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram")
AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW")
@@ -477,6 +478,8 @@ static MACHINE_CONFIG_START( tokib, toki_state )
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* verified with PCB */
MCFG_CPU_PROGRAM_MAP(tokib_audio_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
diff --git a/src/mame/drivers/tomcat.cpp b/src/mame/drivers/tomcat.cpp
index 2d31a2271d0..48b2769c333 100644
--- a/src/mame/drivers/tomcat.cpp
+++ b/src/mame/drivers/tomcat.cpp
@@ -32,6 +32,7 @@
#include "video/avgdvg.h"
#include "machine/timekpr.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "machine/6532riot.h"
#include "sound/pokey.h"
#include "sound/tms5220.h"
@@ -288,7 +289,7 @@ static ADDRESS_MAP_START( tomcat_map, AS_PROGRAM, 16, tomcat_state )
AM_RANGE(0x402000, 0x402001) AM_READ(tomcat_adcread_r) AM_WRITE(tomcat_adcon_w)
AM_RANGE(0x404000, 0x404001) AM_READ(tomcat_inputs_r) AM_DEVWRITE("avg", avg_tomcat_device, go_word_w)
AM_RANGE(0x406000, 0x406001) AM_DEVWRITE("avg", avg_tomcat_device, reset_word_w)
- AM_RANGE(0x408000, 0x408001) AM_READWRITE(tomcat_inputs2_r, watchdog_reset16_w)
+ AM_RANGE(0x408000, 0x408001) AM_READ(tomcat_inputs2_r) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x40a000, 0x40a001) AM_READWRITE(tomcat_320bio_r, tomcat_irqclr_w)
AM_RANGE(0x40e000, 0x40e001) AM_WRITE(tomcat_led1on_w)
AM_RANGE(0x40e002, 0x40e003) AM_WRITE(tomcat_led2on_w)
@@ -416,6 +417,8 @@ static MACHINE_CONFIG_START( tomcat, tomcat_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_M48T02_ADD( "m48t02" )
MCFG_VECTOR_ADD("vector")
diff --git a/src/mame/drivers/toobin.cpp b/src/mame/drivers/toobin.cpp
index 8a3bc6d3872..23e884287e5 100644
--- a/src/mame/drivers/toobin.cpp
+++ b/src/mame/drivers/toobin.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "machine/atarigen.h"
#include "includes/toobin.h"
@@ -86,7 +87,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, toobin_state )
AM_RANGE(0xc09800, 0xc09fff) AM_MIRROR(0x046000) AM_RAM AM_SHARE("mob")
AM_RANGE(0xc10000, 0xc107ff) AM_MIRROR(0x047800) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
AM_RANGE(0xff6000, 0xff6001) AM_READNOP /* who knows? read at controls time */
- AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x4500fe) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x4500fe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_DEVWRITE8("jsa", atari_jsa_i_device, main_command_w, 0x00ff)
AM_RANGE(0xff8300, 0xff8301) AM_MIRROR(0x45003e) AM_WRITE(intensity_w)
AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_SHARE("interrupt_scan")
@@ -203,7 +204,8 @@ static MACHINE_CONFIG_START( toobin, toobin_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 4, toobin_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 128,64)
diff --git a/src/mame/drivers/tourtabl.cpp b/src/mame/drivers/tourtabl.cpp
index c2b2fa57696..a826ebacafe 100644
--- a/src/mame/drivers/tourtabl.cpp
+++ b/src/mame/drivers/tourtabl.cpp
@@ -11,6 +11,7 @@
#include "emu.h"
#include "machine/6532riot.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "sound/tiaintf.h"
#include "video/tia.h"
@@ -27,7 +28,6 @@ public:
DECLARE_WRITE8_MEMBER(tourtabl_led_w);
DECLARE_READ16_MEMBER(tourtabl_read_input_port);
DECLARE_READ8_MEMBER(tourtabl_get_databus_contents);
- DECLARE_WRITE8_MEMBER(watchdog_w);
};
@@ -69,11 +69,6 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tourtabl_state )
ADDRESS_MAP_END
-WRITE8_MEMBER(tourtabl_state::watchdog_w)
-{
- machine().watchdog_reset();
-}
-
static INPUT_PORTS_START( tourtabl )
PORT_START("PADDLE4")
@@ -157,13 +152,15 @@ static MACHINE_CONFIG_START( tourtabl, tourtabl_state )
MCFG_DEVICE_ADD("riot1", RIOT6532, MASTER_CLOCK / 3)
MCFG_RIOT6532_IN_PA_CB(IOPORT("RIOT0_SWA"))
MCFG_RIOT6532_IN_PB_CB(IOPORT("RIOT0_SWB"))
- MCFG_RIOT6532_OUT_PB_CB(WRITE8(tourtabl_state, watchdog_w))
+ MCFG_RIOT6532_OUT_PB_CB(DEVWRITE8("watchdog", watchdog_timer_device, reset_w))
MCFG_DEVICE_ADD("riot2", RIOT6532, MASTER_CLOCK / 3)
MCFG_RIOT6532_IN_PA_CB(IOPORT("RIOT1_SWA"))
MCFG_RIOT6532_IN_PB_CB(IOPORT("RIOT1_SWB"))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(tourtabl_state, tourtabl_led_w))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_DEVICE_ADD("tia_video", TIA_NTSC_VIDEO, 0)
MCFG_TIA_READ_INPUT_PORT_CB(READ16(tourtabl_state, tourtabl_read_input_port))
diff --git a/src/mame/drivers/tp84.cpp b/src/mame/drivers/tp84.cpp
index 93aab1e92f5..06464035fc4 100644
--- a/src/mame/drivers/tp84.cpp
+++ b/src/mame/drivers/tp84.cpp
@@ -66,6 +66,7 @@ C004 76489 #4 trigger
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "sound/flt_rc.h"
#include "includes/konamipt.h"
@@ -123,7 +124,7 @@ WRITE8_MEMBER(tp84_state::tp84_sh_irqtrigger_w)
static ADDRESS_MAP_START( tp84_cpu1_map, AS_PROGRAM, 8, tp84_state )
- AM_RANGE(0x2000, 0x2000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2800, 0x2800) AM_READ_PORT("SYSTEM") AM_WRITEONLY AM_SHARE("palette_bank")
AM_RANGE(0x2820, 0x2820) AM_READ_PORT("P1")
AM_RANGE(0x2840, 0x2840) AM_READ_PORT("P2")
@@ -149,7 +150,7 @@ static ADDRESS_MAP_START( tp84b_cpu1_map, AS_PROGRAM, 8, tp84_state )
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("bg_colorram")
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("fg_colorram")
AM_RANGE(0x1000, 0x17ff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1800, 0x1800) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1800, 0x1800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("SYSTEM") AM_WRITEONLY AM_SHARE("palette_bank")
AM_RANGE(0x1a20, 0x1a20) AM_READ_PORT("P1")
AM_RANGE(0x1a40, 0x1a40) AM_READ_PORT("P2")
@@ -299,6 +300,7 @@ static MACHINE_CONFIG_START( tp84, tp84_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/trackfld.cpp b/src/mame/drivers/trackfld.cpp
index 4f8a41ef80a..9395956077b 100644
--- a/src/mame/drivers/trackfld.cpp
+++ b/src/mame/drivers/trackfld.cpp
@@ -191,6 +191,7 @@ MAIN BOARD:
#include "includes/trackfld.h"
#include "includes/konamipt.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#define MASTER_CLOCK XTAL_18_432MHz
#define SOUND_CLOCK XTAL_14_31818MHz
@@ -222,7 +223,7 @@ WRITE8_MEMBER(trackfld_state::irq_mask_w)
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, trackfld_state )
- AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w) /* AFE */
+ AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x007f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* AFE */
AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x0078) AM_WRITE(trackfld_flipscreen_w) /* FLIP */
AM_RANGE(0x1081, 0x1081) AM_MIRROR(0x0078) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, konami_sh_irqtrigger_w) /* 26 */ /* cause interrupt on audio CPU */
AM_RANGE(0x1082, 0x1082) AM_MIRROR(0x0078) AM_WRITENOP /* 25 */
@@ -275,7 +276,7 @@ static ADDRESS_MAP_START( yieartf_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x0001, 0x0001) AM_WRITE(konami_SN76496_w)
AM_RANGE(0x0002, 0x0002) AM_WRITE(trackfld_VLM5030_control_w)
AM_RANGE(0x0003, 0x0003) AM_DEVWRITE("vlm", vlm5030_device, data_w)
- AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w) /* AFE */
+ AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x007f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* AFE */
AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x0078) AM_WRITE(trackfld_flipscreen_w) /* FLIP */
AM_RANGE(0x1081, 0x1081) AM_MIRROR(0x0078) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, konami_sh_irqtrigger_w) /* 26 */ /* cause interrupt on audio CPU */
AM_RANGE(0x1082, 0x1082) AM_MIRROR(0x0078) AM_WRITE(yieartf_nmi_mask_w) /* 25 */
@@ -305,7 +306,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( reaktor_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
/* all usual addresses +0x8000 */
- AM_RANGE(0x9000, 0x9000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x9000, 0x9000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x9080, 0x9080) AM_WRITE(trackfld_flipscreen_w)
AM_RANGE(0x9081, 0x9081) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x9083, 0x9084) AM_WRITE(coin_w)
@@ -338,7 +339,7 @@ static ADDRESS_MAP_START( reaktor_io_map, AS_IO, 8, trackfld_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( mastkin_map, AS_PROGRAM, 8, trackfld_state )
- AM_RANGE(0x1000, 0x1000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x1000, 0x1000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x10b0, 0x10b0) AM_WRITE(trackfld_flipscreen_w)
AM_RANGE(0x10b1, 0x10b1) AM_READNOP AM_DEVWRITE("trackfld_audio", trackfld_audio_device, konami_sh_irqtrigger_w)
AM_RANGE(0x10b3, 0x10b4) AM_WRITE(coin_w) // actually not used
@@ -365,7 +366,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( wizzquiz_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x0000, 0x007f) AM_RAM
- AM_RANGE(0x1000, 0x1000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w)
+ AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset_r, reset_w)
AM_RANGE(0x1080, 0x1080) AM_WRITE(trackfld_flipscreen_w)
AM_RANGE(0x1081, 0x1081) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x1083, 0x1084) AM_WRITE(coin_w)
@@ -903,6 +904,8 @@ static MACHINE_CONFIG_START( trackfld, trackfld_state )
MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld)
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -956,6 +959,8 @@ static MACHINE_CONFIG_START( yieartf, trackfld_state )
MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld)
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/triplhnt.cpp b/src/mame/drivers/triplhnt.cpp
index 0602cd192a2..858542aee23 100644
--- a/src/mame/drivers/triplhnt.cpp
+++ b/src/mame/drivers/triplhnt.cpp
@@ -100,7 +100,7 @@ READ8_MEMBER(triplhnt_state::triplhnt_cmos_r)
READ8_MEMBER(triplhnt_state::triplhnt_input_port_4_r)
{
- watchdog_reset_w(space, 0, 0);
+ m_watchdog->watchdog_reset();
return ioport("0C0B")->read();
}
@@ -309,6 +309,8 @@ static MACHINE_CONFIG_START( triplhnt, triplhnt_state )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/truco.cpp b/src/mame/drivers/truco.cpp
index 602bb01d2dd..bf8f120f853 100644
--- a/src/mame/drivers/truco.cpp
+++ b/src/mame/drivers/truco.cpp
@@ -232,7 +232,7 @@ WRITE_LINE_MEMBER(truco_state::pia_ca2_w)
Legs 07 [OSC IN] and 08 [OSC SEL] aren't connected,
setting 1.6 seconds as WD timeout.
*/
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
WRITE8_MEMBER(truco_state::portb_w)
@@ -421,6 +421,8 @@ static MACHINE_CONFIG_START( truco, truco_state )
MCFG_CPU_ADD("maincpu", M6809, CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", truco_state, interrupt)
+
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(1.6)) /* 1.6 seconds */
MCFG_DEVICE_ADD("pia0", PIA6821, 0)
diff --git a/src/mame/drivers/trucocl.cpp b/src/mame/drivers/trucocl.cpp
index 3c0bfb376cc..75ed2f7bdca 100644
--- a/src/mame/drivers/trucocl.cpp
+++ b/src/mame/drivers/trucocl.cpp
@@ -36,6 +36,7 @@ Daughterboard: Custom made, plugged in the 2 roms and Z80 mainboard sockets.
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
#include "includes/trucocl.h"
@@ -95,7 +96,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, trucocl_state )
AM_RANGE(0x5000, 0x5000) AM_WRITE(irq_enable_w)
AM_RANGE(0x5000, 0x503f) AM_READ_PORT("IN0")
AM_RANGE(0x5080, 0x5080) AM_WRITE(audio_dac_w)
- AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x50c0, 0x50c0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -143,6 +144,8 @@ static MACHINE_CONFIG_START( trucocl, trucocl_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", trucocl_state, trucocl_interrupt)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/tutankhm.cpp b/src/mame/drivers/tutankhm.cpp
index e1cf1a85242..b4df2b49c6c 100644
--- a/src/mame/drivers/tutankhm.cpp
+++ b/src/mame/drivers/tutankhm.cpp
@@ -52,6 +52,7 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "includes/konamipt.h"
#include "audio/timeplt.h"
#include "includes/tutankhm.h"
@@ -120,7 +121,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tutankhm_state )
AM_RANGE(0x0000, 0x7fff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0x8000, 0x800f) AM_MIRROR(0x00f0) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x8100, 0x8100) AM_MIRROR(0x000f) AM_RAM AM_SHARE("scroll")
- AM_RANGE(0x8120, 0x8120) AM_MIRROR(0x000f) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x8120, 0x8120) AM_MIRROR(0x000f) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8160, 0x8160) AM_MIRROR(0x000f) AM_READ_PORT("DSW2") /* DSW2 (inverted bits) */
AM_RANGE(0x8180, 0x8180) AM_MIRROR(0x000f) AM_READ_PORT("IN0") /* IN0 I/O: Coin slots, service, 1P/2P buttons */
AM_RANGE(0x81a0, 0x81a0) AM_MIRROR(0x000f) AM_READ_PORT("IN1") /* IN1: Player 1 I/O */
@@ -229,6 +230,8 @@ static MACHINE_CONFIG_START( tutankhm, tutankhm_state )
MCFG_MACHINE_START_OVERRIDE(tutankhm_state,tutankhm)
MCFG_MACHINE_RESET_OVERRIDE(tutankhm_state,tutankhm)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/twin16.cpp b/src/mame/drivers/twin16.cpp
index d05c6371ccb..e25c719d8d5 100644
--- a/src/mame/drivers/twin16.cpp
+++ b/src/mame/drivers/twin16.cpp
@@ -50,6 +50,7 @@ Known Issues:
#include "cpu/z80/z80.h"
#include "sound/2151intf.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "includes/twin16.h"
#include "includes/konamipt.h"
@@ -185,7 +186,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, twin16_state )
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0006, 0x0a0007) AM_READ_PORT("P3")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
- AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(video_register_w)
@@ -222,7 +223,7 @@ static ADDRESS_MAP_START( fround_map, AS_PROGRAM, 16, fround_state )
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
- AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(video_register_w)
@@ -673,6 +674,8 @@ static MACHINE_CONFIG_START( twin16, twin16_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
// video hardware
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
@@ -723,6 +726,8 @@ static MACHINE_CONFIG_START( fround, fround_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
diff --git a/src/mame/drivers/twinkle.cpp b/src/mame/drivers/twinkle.cpp
index 5b38a3dd019..9f2223a15f8 100644
--- a/src/mame/drivers/twinkle.cpp
+++ b/src/mame/drivers/twinkle.cpp
@@ -239,6 +239,7 @@ Notes:
#include "machine/fdc37c665gt.h"
#include "machine/i2cmem.h"
#include "machine/rtc65271.h"
+#include "machine/watchdog.h"
#include "machine/x76f041.h"
#include "sound/spu.h"
#include "sound/cdda.h"
@@ -697,7 +698,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, twinkle_state )
AM_RANGE(0x1f200000, 0x1f20001f) AM_DEVREADWRITE8("am53cf96", am53cf96_device, read, write, 0x00ff00ff)
AM_RANGE(0x1f20a01c, 0x1f20a01f) AM_WRITENOP /* scsi? */
AM_RANGE(0x1f210000, 0x1f2107ff) AM_DEVREADWRITE8("fdc37c665gt", fdc37c665gt_device, read, write, 0x00ff00ff)
- AM_RANGE(0x1f218000, 0x1f218003) AM_WRITE8(watchdog_reset_w, 0x000000ff) /* LTC1232 */
+ AM_RANGE(0x1f218000, 0x1f218003) AM_DEVWRITE8("watchdog", watchdog_timer_device, reset_w, 0x000000ff) /* LTC1232 */
AM_RANGE(0x1f220000, 0x1f220003) AM_WRITE8(twinkle_io_w, 0x00ff00ff)
AM_RANGE(0x1f220004, 0x1f220007) AM_READ8(twinkle_io_r, 0x00ff00ff)
AM_RANGE(0x1f230000, 0x1f230003) AM_WRITENOP
@@ -946,6 +947,7 @@ static MACHINE_CONFIG_START( twinkle, twinkle_state )
MCFG_CPU_PERIODIC_INT_DRIVER(twinkle_state, irq1_line_assert, 60)
MCFG_CPU_PERIODIC_INT_DRIVER(twinkle_state, irq2_line_assert, 60)
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) /* check TD pin on LTC1232 */
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
diff --git a/src/mame/drivers/tx1.cpp b/src/mame/drivers/tx1.cpp
index 18b1c55e79c..98260c40b8f 100644
--- a/src/mame/drivers/tx1.cpp
+++ b/src/mame/drivers/tx1.cpp
@@ -48,6 +48,7 @@
#include "rendlay.h"
#include "includes/tx1.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "tx1.lh"
#include "buggyboy.lh"
@@ -485,7 +486,7 @@ static ADDRESS_MAP_START( tx1_main, AS_PROGRAM, 16, tx1_state )
AM_RANGE(0x0c000, 0x0c001) AM_WRITE(tx1_scolst_w)
AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w)
AM_RANGE(0x0e000, 0x0e001) AM_WRITE(tx1_slock_w)
- AM_RANGE(0x0f000, 0x0f001) AM_READ(watchdog_reset16_r) AM_WRITE(resume_math_w)
+ AM_RANGE(0x0f000, 0x0f001) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) AM_WRITE(resume_math_w)
AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(z80_shared_r, z80_shared_w)
AM_RANGE(0x20000, 0x2ffff) AM_MIRROR(0xd0000) AM_ROM
ADDRESS_MAP_END
@@ -534,7 +535,7 @@ static ADDRESS_MAP_START( buggyboy_main, AS_PROGRAM, 16, tx1_state )
AM_RANGE(0x0c000, 0x0c001) AM_WRITE(buggyboy_scolst_w)
AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w)
AM_RANGE(0x0e000, 0x0e001) AM_WRITE(buggyboy_sky_w)
- AM_RANGE(0x0f000, 0x0f003) AM_READ(watchdog_reset16_r) AM_WRITE(resume_math_w)
+ AM_RANGE(0x0f000, 0x0f003) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) AM_WRITE(resume_math_w)
AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(z80_shared_r, z80_shared_w)
AM_RANGE(0x20000, 0x2ffff) AM_ROM
AM_RANGE(0xf0000, 0xfffff) AM_ROM
@@ -549,7 +550,7 @@ static ADDRESS_MAP_START( buggybjr_main, AS_PROGRAM, 16, tx1_state )
AM_RANGE(0x0c000, 0x0c001) AM_WRITE(buggyboy_scolst_w)
AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w)
AM_RANGE(0x0e000, 0x0e001) AM_WRITE(buggyboy_sky_w)
- AM_RANGE(0x0f000, 0x0f003) AM_READ(watchdog_reset16_r) AM_WRITE(resume_math_w)
+ AM_RANGE(0x0f000, 0x0f003) AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r) AM_WRITE(resume_math_w)
AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(z80_shared_r, z80_shared_w)
AM_RANGE(0x20000, 0x2ffff) AM_ROM
AM_RANGE(0xf0000, 0xfffff) AM_ROM
@@ -605,6 +606,8 @@ ADDRESS_MAP_END
static MACHINE_CONFIG_START( tx1, tx1_state )
MCFG_CPU_ADD("main_cpu", I8086, CPU_MASTER_CLOCK / 3)
MCFG_CPU_PROGRAM_MAP(tx1_main)
+
+ MCFG_WATCHDOG_ADD("watchdog")
// MCFG_WATCHDOG_TIME_INIT(5)
MCFG_CPU_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3)
@@ -666,6 +669,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( buggyboy, tx1_state )
MCFG_CPU_ADD("main_cpu", I8086, CPU_MASTER_CLOCK / 3)
MCFG_CPU_PROGRAM_MAP(buggyboy_main)
+
+ MCFG_WATCHDOG_ADD("watchdog")
// MCFG_WATCHDOG_TIME_INIT(5)
MCFG_CPU_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3)
@@ -728,6 +733,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( buggybjr, tx1_state )
MCFG_CPU_ADD("main_cpu", I8086, CPU_MASTER_CLOCK / 3)
MCFG_CPU_PROGRAM_MAP(buggybjr_main)
+
+ MCFG_WATCHDOG_ADD("watchdog")
// MCFG_WATCHDOG_TIME_INIT(5)
MCFG_CPU_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3)
diff --git a/src/mame/drivers/ultraman.cpp b/src/mame/drivers/ultraman.cpp
index 93c6c67f7c6..86c7507d5d9 100644
--- a/src/mame/drivers/ultraman.cpp
+++ b/src/mame/drivers/ultraman.cpp
@@ -14,6 +14,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
#include "includes/ultraman.h"
@@ -43,7 +44,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, ultraman_state )
AM_RANGE(0x1c0018, 0x1c0019) AM_WRITE(ultraman_gfxctrl_w) /* counters + gfx ctrl */
AM_RANGE(0x1c0020, 0x1c0021) AM_WRITE(sound_cmd_w)
AM_RANGE(0x1c0028, 0x1c0029) AM_WRITE(sound_irq_trigger_w)
- AM_RANGE(0x1c0030, 0x1c0031) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x1c0030, 0x1c0031) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x204000, 0x204fff) AM_DEVREADWRITE8("k051316_1", k051316_device, read, write, 0x00ff) /* K051316 #0 RAM */
AM_RANGE(0x205000, 0x205fff) AM_DEVREADWRITE8("k051316_2", k051316_device, read, write, 0x00ff) /* K051316 #1 RAM */
AM_RANGE(0x206000, 0x206fff) AM_DEVREADWRITE8("k051316_3", k051316_device, read, write, 0x00ff) /* K051316 #2 RAM */
@@ -185,6 +186,8 @@ static MACHINE_CONFIG_START( ultraman, ultraman_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600))
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp
index 50cc6adc43e..50d0904e836 100644
--- a/src/mame/drivers/ultratnk.cpp
+++ b/src/mame/drivers/ultratnk.cpp
@@ -65,7 +65,7 @@ TIMER_CALLBACK_MEMBER(ultratnk_state::nmi_callback)
/* NMI and watchdog are disabled during service mode */
- machine().watchdog_enable(ioport("IN0")->read() & 0x40);
+ m_watchdog->watchdog_enable(ioport("IN0")->read() & 0x40);
if (ioport("IN0")->read() & 0x40)
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
@@ -180,7 +180,7 @@ static ADDRESS_MAP_START( ultratnk_cpu_map, AS_PROGRAM, 8, ultratnk_state )
AM_RANGE(0x2020, 0x2027) AM_MIRROR(0x718) AM_WRITE(ultratnk_collision_reset_w)
AM_RANGE(0x2040, 0x2041) AM_MIRROR(0x718) AM_WRITE(ultratnk_da_latch_w)
AM_RANGE(0x2042, 0x2043) AM_MIRROR(0x718) AM_WRITE(ultratnk_explosion_w)
- AM_RANGE(0x2044, 0x2045) AM_MIRROR(0x718) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x2044, 0x2045) AM_MIRROR(0x718) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x2066, 0x2067) AM_MIRROR(0x710) AM_WRITE(ultratnk_lockout_w)
AM_RANGE(0x2068, 0x2069) AM_MIRROR(0x710) AM_WRITE(ultratnk_led_1_w)
AM_RANGE(0x206a, 0x206b) AM_MIRROR(0x710) AM_WRITE(ultratnk_led_2_w)
@@ -307,7 +307,8 @@ static MACHINE_CONFIG_START( ultratnk, ultratnk_state )
MCFG_CPU_ADD("maincpu", M6502, PIXEL_CLOCK / 8)
MCFG_CPU_PROGRAM_MAP(ultratnk_cpu_map)
- MCFG_WATCHDOG_VBLANK_INIT(8)
+ MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/undrfire.cpp b/src/mame/drivers/undrfire.cpp
index 5b17aea9d9f..32885d3d16a 100644
--- a/src/mame/drivers/undrfire.cpp
+++ b/src/mame/drivers/undrfire.cpp
@@ -191,6 +191,7 @@ Board contains only 29 ROMs and not much else.
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/es5506.h"
#include "audio/taito_en.h"
#include "includes/undrfire.h"
@@ -250,7 +251,7 @@ WRITE32_MEMBER(undrfire_state::undrfire_input_w)
{
if (ACCESSING_BITS_24_31) /* $500000 is watchdog */
{
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
}
if (ACCESSING_BITS_0_7)
@@ -682,6 +683,8 @@ static MACHINE_CONFIG_START( undrfire, undrfire_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -729,6 +732,8 @@ static MACHINE_CONFIG_START( cbombers, undrfire_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/vastar.cpp b/src/mame/drivers/vastar.cpp
index fb8a8cb8b8e..aab81092505 100644
--- a/src/mame/drivers/vastar.cpp
+++ b/src/mame/drivers/vastar.cpp
@@ -104,6 +104,7 @@ Vsync : 60.58hz
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/vastar.h"
@@ -150,7 +151,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, vastar_state )
AM_RANGE(0x9000, 0x9fff) AM_RAM_WRITE(bg1videoram_w) AM_SHARE("bg1videoram") AM_MIRROR(0x2000)
AM_RANGE(0xc000, 0xc000) AM_WRITEONLY AM_SHARE("sprite_priority") /* sprite/BG priority */
AM_RANGE(0xc400, 0xcfff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram") // fg videoram + sprites
- AM_RANGE(0xe000, 0xe000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w)
+ AM_RANGE(0xe000, 0xe000) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset_r, reset_w)
AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("sharedram")
ADDRESS_MAP_END
@@ -434,6 +435,8 @@ static MACHINE_CONFIG_START( vastar, vastar_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - seems enough to ensure proper synchronization of the CPUs */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60.58)
diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp
index 8bd74706d79..be350529af5 100644
--- a/src/mame/drivers/vendetta.cpp
+++ b/src/mame/drivers/vendetta.cpp
@@ -93,6 +93,7 @@
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/2151intf.h"
#include "sound/k053260.h"
#include "includes/konamipt.h"
@@ -230,7 +231,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, vendetta_state )
AM_RANGE(0x5fe4, 0x5fe4) AM_READWRITE(z80_irq_r, z80_irq_w)
AM_RANGE(0x5fe6, 0x5fe7) AM_DEVREADWRITE("k053260", k053260_device, main_read, main_write)
AM_RANGE(0x5fe8, 0x5fe9) AM_DEVREAD("k053246", k053247_device, k053246_r)
- AM_RANGE(0x5fea, 0x5fea) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x5fea, 0x5fea) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
/* what is the desired effect of overlapping these memory regions anyway? */
AM_RANGE(0x4000, 0x4fff) AM_RAMBANK("bank3")
AM_RANGE(0x6000, 0x6fff) AM_RAMBANK("bank2")
@@ -447,6 +448,8 @@ static MACHINE_CONFIG_START( vendetta, vendetta_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.17) /* measured on PCB */
diff --git a/src/mame/drivers/videopin.cpp b/src/mame/drivers/videopin.cpp
index 38b0603cd79..ac3a1a0717d 100644
--- a/src/mame/drivers/videopin.cpp
+++ b/src/mame/drivers/videopin.cpp
@@ -19,6 +19,7 @@ solarwar
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "includes/videopin.h"
#include "videopin.lh"
#include "sound/discrete.h"
@@ -219,7 +220,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, videopin_state )
AM_RANGE(0x0200, 0x07ff) AM_RAM_WRITE(video_ram_w) AM_SHARE("video_ram")
AM_RANGE(0x0800, 0x0800) AM_READ(misc_r) AM_WRITE(note_dvsr_w)
AM_RANGE(0x0801, 0x0801) AM_WRITE(led_w)
- AM_RANGE(0x0802, 0x0802) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x0802, 0x0802) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0804, 0x0804) AM_WRITE(ball_w)
AM_RANGE(0x0805, 0x0805) AM_WRITE(out1_w)
AM_RANGE(0x0806, 0x0806) AM_WRITE(out2_w)
@@ -360,6 +361,7 @@ static MACHINE_CONFIG_START( videopin, videopin_state )
MCFG_CPU_ADD("maincpu", M6502, 12096000 / 16)
MCFG_CPU_PROGRAM_MAP(main_map)
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/vindictr.cpp b/src/mame/drivers/vindictr.cpp
index be840d5bd59..a7b07ff57ab 100644
--- a/src/mame/drivers/vindictr.cpp
+++ b/src/mame/drivers/vindictr.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "includes/vindictr.h"
@@ -77,7 +78,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, vindictr_state )
AM_RANGE(0x260010, 0x26001f) AM_READ(port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ_PORT("260020")
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("jsa", atari_jsa_i_device, main_response_r, 0x00ff)
- AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x2e0000, 0x2e0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0x360010, 0x360011) AM_WRITENOP
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("jsa", atari_jsa_i_device, sound_reset_w)
@@ -188,6 +189,8 @@ static MACHINE_CONFIG_START( vindictr, vindictr_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", vindictr)
MCFG_PALETTE_ADD("palette", 2048*8)
diff --git a/src/mame/drivers/vlc.cpp b/src/mame/drivers/vlc.cpp
index ea1e406b6fe..bb221960019 100644
--- a/src/mame/drivers/vlc.cpp
+++ b/src/mame/drivers/vlc.cpp
@@ -135,6 +135,7 @@ nevada TYPE2 : 64 45 51 06 32 02 31 31
#include "cpu/m68000/m68000.h"
#include "machine/mc68681.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "video/mc6845.h"
#include "sound/ay8910.h"
#include "machine/msm6242.h"
@@ -513,7 +514,7 @@ static ADDRESS_MAP_START( nevada_map, AS_PROGRAM, 16,nevada_state )
AM_RANGE(0x00908000, 0x00908001) AM_DEVWRITE8("crtc",mc6845_device,register_w,0x00ff )
AM_RANGE(0x00a00000, 0x00a00001) AM_READWRITE(io_board_r,io_board_w)
AM_RANGE(0x00a08000, 0x00a08001) AM_WRITE(io_board_x)
- AM_RANGE(0x00a10000, 0x00a10001) AM_WRITE(watchdog_reset16_w )
+ AM_RANGE(0x00a10000, 0x00a10001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x00a20000, 0x00a20001) AM_DEVWRITE8("aysnd", ay8910_device, address_w, 0x00ff)
AM_RANGE(0x00a28000, 0x00a28001) AM_DEVWRITE8("aysnd", ay8910_device, data_w, 0x00ff)
AM_RANGE(0x00a30000, 0x00A300ff) AM_DEVREADWRITE8("rtc",msm6242_device, read, write, 0x00ff)
@@ -595,6 +596,7 @@ static MACHINE_CONFIG_START( nevada, nevada_state )
MCFG_CPU_PROGRAM_MAP(nevada_map)
MCFG_CPU_IO_MAP(nevada_iomap) //0x10000 0x20000
+ MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(150)) /* 150ms Ds1232 TD to Ground */
MCFG_MACHINE_START_OVERRIDE(nevada_state, nevada)
diff --git a/src/mame/drivers/warpwarp.cpp b/src/mame/drivers/warpwarp.cpp
index ff1aa869416..7bff85217f4 100644
--- a/src/mame/drivers/warpwarp.cpp
+++ b/src/mame/drivers/warpwarp.cpp
@@ -274,7 +274,7 @@ WRITE8_MEMBER(warpwarp_state::warpwarp_out0_w)
m_warpwarp_sound->sound_w(space,0,data);
break;
case 3:
- watchdog_reset_w(space,0,data);
+ m_watchdog->reset_w(space,0,data);
break;
}
}
@@ -774,6 +774,8 @@ static MACHINE_CONFIG_START( bombbee, warpwarp_state )
MCFG_CPU_PROGRAM_MAP(bombbee_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", warpwarp_state, vblank_irq)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224)
diff --git a/src/mame/drivers/wc90.cpp b/src/mame/drivers/wc90.cpp
index 84a7162aedf..3459467fd8e 100644
--- a/src/mame/drivers/wc90.cpp
+++ b/src/mame/drivers/wc90.cpp
@@ -55,6 +55,7 @@ Press one of the start buttons to exit.
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/2608intf.h"
#include "includes/wc90.h"
@@ -105,7 +106,7 @@ static ADDRESS_MAP_START( wc90_map_1, AS_PROGRAM, 8, wc90_state )
AM_RANGE(0xfc46, 0xfc46) AM_WRITEONLY AM_SHARE("scroll2xlo")
AM_RANGE(0xfc47, 0xfc47) AM_WRITEONLY AM_SHARE("scroll2xhi")
AM_RANGE(0xfcc0, 0xfcc0) AM_WRITE(sound_command_w)
- AM_RANGE(0xfcd0, 0xfcd0) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xfcd0, 0xfcd0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xfce0, 0xfce0) AM_WRITE(bankswitch_w)
ADDRESS_MAP_END
@@ -118,7 +119,7 @@ static ADDRESS_MAP_START( wc90_map_2, AS_PROGRAM, 8, wc90_state )
AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("subbank")
AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE("share1")
AM_RANGE(0xfc00, 0xfc00) AM_WRITE(bankswitch1_w)
- AM_RANGE(0xfc01, 0xfc01) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xfc01, 0xfc01) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, wc90_state )
@@ -360,6 +361,8 @@ static MACHINE_CONFIG_START( wc90, wc90_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
/* NMIs are triggered by the main CPU */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp
index 42617e7cc86..0fbc1ae352e 100644
--- a/src/mame/drivers/williams.cpp
+++ b/src/mame/drivers/williams.cpp
@@ -501,11 +501,6 @@ Reference video: https://www.youtube.com/watch?v=R5OeC6Wc_yI
***************************************************************************/
#include "emu.h"
-#include "cpu/m6809/m6809.h"
-#include "cpu/m6800/m6800.h"
-#include "sound/dac.h"
-#include "sound/hc55516.h"
-#include "machine/ticket.h"
#include "includes/williams.h"
#include "machine/nvram.h"
@@ -1453,6 +1448,8 @@ static MACHINE_CONFIG_START( williams, williams_state )
MCFG_TIMER_DRIVER_ADD("scan_timer", williams_state, williams_va11_callback)
MCFG_TIMER_DRIVER_ADD("240_timer", williams_state, williams_count240_callback)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE)
@@ -1667,6 +1664,8 @@ static MACHINE_CONFIG_START( williams2, williams2_state )
MCFG_TIMER_DRIVER_ADD("scan_timer", williams2_state, williams2_va11_callback)
MCFG_TIMER_DRIVER_ADD("254_timer", williams2_state, williams2_endscreen_callback)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_PALETTE_ADD("palette", 1024)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", williams2)
diff --git a/src/mame/drivers/wiping.cpp b/src/mame/drivers/wiping.cpp
index f8ff06d2573..e246b6e0df4 100644
--- a/src/mame/drivers/wiping.cpp
+++ b/src/mame/drivers/wiping.cpp
@@ -37,6 +37,7 @@ dip: 6.7 7.7
***************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "audio/wiping.h"
#include "includes/wiping.h"
@@ -89,7 +90,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, wiping_state )
AM_RANGE(0xa003, 0xa003) AM_WRITE(subcpu_reset_w)
AM_RANGE(0xa800, 0xa807) AM_READ(ports_r)
AM_RANGE(0xb000, 0xb7ff) AM_RAM
- AM_RANGE(0xb800, 0xb800) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0xb800, 0xb800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, wiping_state )
@@ -294,6 +295,8 @@ static MACHINE_CONFIG_START( wiping, wiping_state )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(wiping_state, sound_timer_irq, 120) /* periodic interrupt, don't know about the frequency */
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/wiz.cpp b/src/mame/drivers/wiz.cpp
index d6d04e677b8..82909dfc4c2 100644
--- a/src/mame/drivers/wiz.cpp
+++ b/src/mame/drivers/wiz.cpp
@@ -178,6 +178,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/wiz.h"
@@ -341,7 +342,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( stinger_main_map, AS_PROGRAM, 8, wiz_state )
// AM_RANGE(0xf008, 0xf00f) AM_WRITENOP // ?
- AM_RANGE(0xf800, 0xf800) AM_READ(watchdog_reset_r)
+ AM_RANGE(0xf800, 0xf800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0xf808, 0xf808) AM_WRITE(stinger_explosion_w)
AM_RANGE(0xf80a, 0xf80a) AM_WRITE(stinger_shot_w)
AM_IMPORT_FROM( kungfut_main_map )
@@ -840,6 +841,8 @@ static MACHINE_CONFIG_DERIVED( stinger, kungfut )
MCFG_CPU_MODIFY("audiocpu")
MCFG_CPU_PROGRAM_MAP(stinger_sound_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(wiz_state, screen_update_stinger)
diff --git a/src/mame/drivers/wmg.cpp b/src/mame/drivers/wmg.cpp
index 53084fc46f8..7c1264a3ac6 100644
--- a/src/mame/drivers/wmg.cpp
+++ b/src/mame/drivers/wmg.cpp
@@ -465,6 +465,8 @@ static MACHINE_CONFIG_START( wmg, wmg_state )
MCFG_TIMER_DRIVER_ADD("scan_timer", williams_state, williams_va11_callback)
MCFG_TIMER_DRIVER_ADD("240_timer", williams_state, williams_count240_callback)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE)
diff --git a/src/mame/drivers/wolfpack.cpp b/src/mame/drivers/wolfpack.cpp
index 6d8514d7fa5..549628162ae 100644
--- a/src/mame/drivers/wolfpack.cpp
+++ b/src/mame/drivers/wolfpack.cpp
@@ -8,6 +8,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
+#include "machine/watchdog.h"
#include "includes/wolfpack.h"
@@ -153,7 +154,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, wolfpack_state )
AM_RANGE(0x4004, 0x4004) AM_WRITE(wolfpack_ship_pic_w)
AM_RANGE(0x4005, 0x4005) AM_WRITE(wolfpack_torpedo_h_w)
AM_RANGE(0x4006, 0x4006) AM_WRITE(wolfpack_torpedo_v_w)
- AM_RANGE(0x5000, 0x5fff) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x7000, 0x7fff) AM_ROM
AM_RANGE(0x9000, 0x9000) AM_READNOP /* debugger ROM location? */
AM_RANGE(0xf000, 0xffff) AM_ROM
@@ -303,6 +304,8 @@ static MACHINE_CONFIG_START( wolfpack, wolfpack_state )
MCFG_CPU_ADD("maincpu", M6502, 12096000 / 16)
MCFG_CPU_PROGRAM_MAP(main_map)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/xmen.cpp b/src/mame/drivers/xmen.cpp
index 12b3d81446a..efc12b2d547 100644
--- a/src/mame/drivers/xmen.cpp
+++ b/src/mame/drivers/xmen.cpp
@@ -19,6 +19,7 @@ likewise be a 2 screen game
#include "cpu/m68000/m68000.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "cpu/z80/z80.h"
#include "sound/2151intf.h"
#include "sound/k054539.h"
@@ -101,7 +102,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xmen_state )
AM_RANGE(0x10804e, 0x10804f) AM_WRITE(sound_irq_w)
AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r)
AM_RANGE(0x108060, 0x10807f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
- AM_RANGE(0x10a000, 0x10a001) AM_READ_PORT("P2_P4") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x10a000, 0x10a001) AM_READ_PORT("P2_P4") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x10a002, 0x10a003) AM_READ_PORT("P1_P3")
AM_RANGE(0x10a004, 0x10a005) AM_READ_PORT("EEPROM")
AM_RANGE(0x10a00c, 0x10a00d) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
@@ -136,7 +137,7 @@ static ADDRESS_MAP_START( 6p_main_map, AS_PROGRAM, 16, xmen_state )
AM_RANGE(0x10804e, 0x10804f) AM_WRITE(sound_irq_w)
AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r)
AM_RANGE(0x108060, 0x10807f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
- AM_RANGE(0x10a000, 0x10a001) AM_READ_PORT("P2_P4") AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0x10a000, 0x10a001) AM_READ_PORT("P2_P4") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x10a002, 0x10a003) AM_READ_PORT("P1_P3")
AM_RANGE(0x10a004, 0x10a005) AM_READ_PORT("EEPROM")
AM_RANGE(0x10a006, 0x10a007) AM_READ_PORT("P5_P6")
@@ -323,6 +324,8 @@ static MACHINE_CONFIG_START( xmen, xmen_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
@@ -371,6 +374,8 @@ static MACHINE_CONFIG_START( xmen6p, xmen_state )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_ENABLE_SHADOWS()
diff --git a/src/mame/drivers/xtheball.cpp b/src/mame/drivers/xtheball.cpp
index f08785b3726..c1d22bcd585 100644
--- a/src/mame/drivers/xtheball.cpp
+++ b/src/mame/drivers/xtheball.cpp
@@ -13,6 +13,7 @@
#include "video/tlc34076.h"
#include "machine/ticket.h"
#include "machine/nvram.h"
+#include "machine/watchdog.h"
#include "sound/dac.h"
@@ -22,6 +23,7 @@ public:
xtheball_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_watchdog(*this, "watchdog"),
m_tlc34076(*this, "tlc34076"),
m_vram_bg(*this, "vrabg"),
m_vram_fg(*this, "vrafg"),
@@ -29,6 +31,7 @@ public:
m_analog_y(*this, "ANALOGY") { }
required_device<cpu_device> m_maincpu;
+ required_device<watchdog_timer_device> m_watchdog;
required_device<tlc34076_device> m_tlc34076;
required_shared_ptr<UINT16> m_vram_bg;
@@ -218,7 +221,7 @@ READ16_MEMBER(xtheball_state::analogx_r)
READ16_MEMBER(xtheball_state::analogy_watchdog_r)
{
/* doubles as a watchdog address */
- watchdog_reset_w(space,0,0);
+ m_watchdog->reset_w(space,0,0);
return (m_analog_y->read() << 8) | 0x00ff;
}
@@ -347,6 +350,8 @@ static MACHINE_CONFIG_START( xtheball, xtheball_state )
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT)
diff --git a/src/mame/drivers/xybots.cpp b/src/mame/drivers/xybots.cpp
index 59641033576..6c265b59611 100644
--- a/src/mame/drivers/xybots.cpp
+++ b/src/mame/drivers/xybots.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/watchdog.h"
#include "machine/atarigen.h"
#include "includes/xybots.h"
@@ -84,7 +85,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xybots_state )
AM_RANGE(0xffe200, 0xffe2ff) AM_MIRROR(0x7f8000) AM_READ(special_port1_r)
AM_RANGE(0xffe800, 0xffe8ff) AM_MIRROR(0x7f8000) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_DEVWRITE8("jsa", atari_jsa_i_device, main_command_w, 0x00ff)
- AM_RANGE(0xffea00, 0xffeaff) AM_MIRROR(0x7f8000) AM_WRITE(watchdog_reset16_w)
+ AM_RANGE(0xffea00, 0xffeaff) AM_MIRROR(0x7f8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xffeb00, 0xffebff) AM_MIRROR(0x7f8000) AM_WRITE(video_int_ack_w)
AM_RANGE(0xffee00, 0xffeeff) AM_MIRROR(0x7f8000) AM_DEVWRITE("jsa", atari_jsa_i_device, sound_reset_w)
ADDRESS_MAP_END
@@ -190,6 +191,8 @@ static MACHINE_CONFIG_START( xybots, xybots_state )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", xybots)
diff --git a/src/mame/drivers/yiear.cpp b/src/mame/drivers/yiear.cpp
index 77eed58f69b..5455b206a16 100644
--- a/src/mame/drivers/yiear.cpp
+++ b/src/mame/drivers/yiear.cpp
@@ -98,6 +98,7 @@ Sound: VLM5030 at 7B
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/watchdog.h"
#include "sound/sn76496.h"
#include "includes/konamipt.h"
#include "audio/trackfld.h"
@@ -147,7 +148,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, yiear_state )
AM_RANGE(0x4e01, 0x4e01) AM_READ_PORT("P1")
AM_RANGE(0x4e02, 0x4e02) AM_READ_PORT("P2")
AM_RANGE(0x4e03, 0x4e03) AM_READ_PORT("DSW1")
- AM_RANGE(0x4f00, 0x4f00) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x4f00, 0x4f00) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x5000, 0x502f) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x5400, 0x542f) AM_RAM AM_SHARE("spriteram2")
AM_RANGE(0x5800, 0x5fff) AM_WRITE(yiear_videoram_w) AM_SHARE("videoram")
@@ -276,6 +277,7 @@ static MACHINE_CONFIG_START( yiear, yiear_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", yiear_state, yiear_vblank_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(yiear_state, yiear_nmi_interrupt, 480) /* music tempo (correct frequency unknown) */
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/zaccaria.cpp b/src/mame/drivers/zaccaria.cpp
index 328c9614af7..71aa07c5471 100644
--- a/src/mame/drivers/zaccaria.cpp
+++ b/src/mame/drivers/zaccaria.cpp
@@ -42,6 +42,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
+#include "machine/watchdog.h"
#include "includes/zaccaria.h"
@@ -156,7 +157,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, zaccaria_state )
AM_RANGE(0x6e00, 0x6e00) AM_MIRROR(0x81f8) AM_READ(dsw_r) AM_DEVWRITE("audiopcb", zac1b11142_audio_device, hs_w)
AM_RANGE(0x7000, 0x77ff) AM_RAM
AM_RANGE(0x7800, 0x7803) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
- AM_RANGE(0x7c00, 0x7c00) AM_READ(watchdog_reset_r)
+ AM_RANGE(0x7c00, 0x7c00) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x8000, 0xdfff) AM_ROM
ADDRESS_MAP_END
@@ -342,6 +343,8 @@ static MACHINE_CONFIG_START( zaccaria, zaccaria_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", zaccaria_state, vblank_irq)
// MCFG_QUANTUM_TIME(attotime::from_hz(1000000))
+ MCFG_WATCHDOG_ADD("watchdog")
+
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
MCFG_I8255_IN_PORTB_CB(IOPORT("P2"))
diff --git a/src/mame/drivers/zodiack.cpp b/src/mame/drivers/zodiack.cpp
index 64692f27fb8..b2d0cba7791 100644
--- a/src/mame/drivers/zodiack.cpp
+++ b/src/mame/drivers/zodiack.cpp
@@ -90,6 +90,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/zodiack.h"
@@ -150,7 +151,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, zodiack_state )
AM_RANGE(0x6083, 0x6083) AM_READ_PORT("IN0")
AM_RANGE(0x6084, 0x6084) AM_READ_PORT("IN1")
AM_RANGE(0x6090, 0x6090) AM_READWRITE(soundlatch_byte_r, master_soundlatch_w)
- AM_RANGE(0x7000, 0x7000) AM_READNOP AM_WRITE(watchdog_reset_w) /* NOP??? */
+ AM_RANGE(0x7000, 0x7000) AM_READNOP AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* NOP??? */
AM_RANGE(0x7100, 0x7100) AM_WRITE(nmi_mask_w)
AM_RANGE(0x7200, 0x7200) AM_WRITE(flipscreen_w)
AM_RANGE(0x9000, 0x903f) AM_RAM_WRITE(attributes_w) AM_SHARE("attributeram")
@@ -571,6 +572,8 @@ static MACHINE_CONFIG_START( zodiack, zodiack_state )
MCFG_CPU_IO_MAP(io_map)
MCFG_CPU_PERIODIC_INT_DRIVER(zodiack_state, zodiack_sound_nmi_gen, 8*60) // sound tempo - unknown source, timing is guessed
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
diff --git a/src/mame/drivers/zr107.cpp b/src/mame/drivers/zr107.cpp
index 202c0f102f9..8f82b41b10e 100644
--- a/src/mame/drivers/zr107.cpp
+++ b/src/mame/drivers/zr107.cpp
@@ -173,6 +173,7 @@ Check gticlub.c for details on the bottom board.
#include "machine/adc083x.h"
#include "machine/k056230.h"
#include "machine/eepromser.h"
+#include "machine/watchdog.h"
#include "sound/k056800.h"
#include "sound/k054539.h"
#include "video/k001604.h"
@@ -190,6 +191,7 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_dsp(*this, "dsp"),
+ m_watchdog(*this, "watchdog"),
m_k001604(*this, "k001604"),
m_k056800(*this, "k056800"),
m_k056832(*this, "k056832"),
@@ -215,6 +217,7 @@ public:
required_device<ppc_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_dsp;
+ required_device<watchdog_timer_device> m_watchdog;
optional_device<k001604_device> m_k001604;
required_device<k056800_device> m_k056800;
optional_device<k056832_device> m_k056832;
@@ -419,7 +422,7 @@ WRITE8_MEMBER(zr107_state::sysreg_w)
0x01 = AFE
*/
if (data & 0x01)
- machine().watchdog_reset();
+ m_watchdog->watchdog_reset();
break;
}
@@ -773,6 +776,8 @@ static MACHINE_CONFIG_START( zr107, zr107_state )
MCFG_DEVICE_ADD("k056230", K056230, 0)
MCFG_K056230_CPU("maincpu")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -842,6 +847,8 @@ static MACHINE_CONFIG_START( jetwave, zr107_state )
MCFG_DEVICE_ADD("k056230", K056230, 0)
MCFG_K056230_CPU("maincpu")
+ MCFG_WATCHDOG_ADD("watchdog")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/includes/airbustr.h b/src/mame/includes/airbustr.h
index ae570085a3e..0a47efd19d0 100644
--- a/src/mame/includes/airbustr.h
+++ b/src/mame/includes/airbustr.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/watchdog.h"
#include "video/kan_pand.h"
class airbustr_state : public driver_device
@@ -24,7 +25,8 @@ public:
m_pandora(*this, "pandora"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_watchdog(*this, "watchdog")
{ }
/* memory pointers */
@@ -56,6 +58,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_device<watchdog_timer_device> m_watchdog;
DECLARE_READ8_MEMBER(devram_r);
DECLARE_WRITE8_MEMBER(master_nmi_trigger_w);
diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h
index 3f633044eae..29c40f86c1c 100644
--- a/src/mame/includes/ajax.h
+++ b/src/mame/includes/ajax.h
@@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Manuel Abadia
+#include "machine/watchdog.h"
#include "sound/k007232.h"
#include "video/k052109.h"