From 65f8a15555ffecb57a65e447e428a4212ec33e4c Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 7 Jul 2010 19:27:01 +0000 Subject: [PATCH] Time to kill off some deadwood. First to go is devtag_get_device() (what a stupid name). Use machine->device() instead. This was strictly a bulk replace: Search: devtag_get_device([ \t]*)\(([ \t]*)([^,]+),[ \t]* Replace: \3->device\1\(\2 --- src/emu/devintrf.h | 1 - src/emu/sound/mos6560.c | 2 +- src/mame/audio/blockade.c | 2 +- src/mame/audio/carnival.c | 4 +- src/mame/audio/cchasm.c | 6 +- src/mame/audio/cclimber.c | 2 +- src/mame/audio/cinemat.c | 32 +++---- src/mame/audio/cyberbal.c | 2 +- src/mame/audio/depthch.c | 2 +- src/mame/audio/exidy.c | 26 +++--- src/mame/audio/gorf.c | 4 +- src/mame/audio/gottlieb.c | 14 +-- src/mame/audio/gridlee.c | 2 +- src/mame/audio/invinco.c | 2 +- src/mame/audio/irem.c | 8 +- src/mame/audio/jaguar.c | 8 +- src/mame/audio/jedi.c | 4 +- src/mame/audio/leland.c | 6 +- src/mame/audio/mario.c | 4 +- src/mame/audio/mcr.c | 40 ++++----- src/mame/audio/meadows.c | 12 +-- src/mame/audio/micro3d.c | 6 +- src/mame/audio/n8080.c | 18 ++-- src/mame/audio/namco52.c | 2 +- src/mame/audio/namco54.c | 2 +- src/mame/audio/namcoc7x.c | 2 +- src/mame/audio/phoenix.c | 2 +- src/mame/audio/pleiads.c | 2 +- src/mame/audio/polyplay.c | 4 +- src/mame/audio/pulsar.c | 4 +- src/mame/audio/redalert.c | 8 +- src/mame/audio/scramble.c | 28 +++--- src/mame/audio/segag80r.c | 10 +-- src/mame/audio/segag80v.c | 12 +-- src/mame/audio/segasnd.c | 2 +- src/mame/audio/seibu.c | 2 +- src/mame/audio/senjyo.c | 2 +- src/mame/audio/snk6502.c | 14 +-- src/mame/audio/spacefb.c | 2 +- src/mame/audio/starwars.c | 4 +- src/mame/audio/t5182.c | 2 +- src/mame/audio/taito_en.c | 4 +- src/mame/audio/taitosnd.c | 4 +- src/mame/audio/targ.c | 10 +-- src/mame/audio/timeplt.c | 12 +-- src/mame/audio/turbo.c | 16 ++-- src/mame/audio/tx1.c | 4 +- src/mame/audio/vicdual.c | 10 +-- src/mame/audio/williams.c | 14 +-- src/mame/audio/wow.c | 4 +- src/mame/audio/zaxxon.c | 10 +-- src/mame/drivers/1942.c | 2 +- src/mame/drivers/20pacgal.c | 4 +- src/mame/drivers/2mindril.c | 2 +- src/mame/drivers/40love.c | 4 +- src/mame/drivers/5clown.c | 2 +- src/mame/drivers/86lions.c | 4 +- src/mame/drivers/88games.c | 14 +-- src/mame/drivers/acommand.c | 8 +- src/mame/drivers/actfancr.c | 4 +- src/mame/drivers/adp.c | 8 +- src/mame/drivers/aerofgt.c | 2 +- src/mame/drivers/airbustr.c | 8 +- src/mame/drivers/alg.c | 2 +- src/mame/drivers/aliens.c | 12 +-- src/mame/drivers/alpha68k.c | 2 +- src/mame/drivers/amspdwy.c | 2 +- src/mame/drivers/angelkds.c | 2 +- src/mame/drivers/appoooh.c | 2 +- src/mame/drivers/aquarium.c | 2 +- src/mame/drivers/arcadecl.c | 2 +- src/mame/drivers/aristmk4.c | 18 ++-- src/mame/drivers/aristmk5.c | 2 +- src/mame/drivers/arkanoid.c | 2 +- src/mame/drivers/artmagic.c | 4 +- src/mame/drivers/ashnojoe.c | 2 +- src/mame/drivers/asterix.c | 12 +-- src/mame/drivers/astinvad.c | 12 +-- src/mame/drivers/astrocde.c | 8 +- src/mame/drivers/astrocorp.c | 4 +- src/mame/drivers/astrof.c | 10 +-- src/mame/drivers/asuka.c | 8 +- src/mame/drivers/atarifb.c | 2 +- src/mame/drivers/atarig1.c | 2 +- src/mame/drivers/atarigt.c | 2 +- src/mame/drivers/atarisy1.c | 26 +++--- src/mame/drivers/atarisy2.c | 20 ++--- src/mame/drivers/aztarac.c | 2 +- src/mame/drivers/backfire.c | 12 +-- src/mame/drivers/badlands.c | 8 +- src/mame/drivers/battlane.c | 4 +- src/mame/drivers/battlnts.c | 6 +- src/mame/drivers/beaminv.c | 2 +- src/mame/drivers/berzerk.c | 6 +- src/mame/drivers/bfm_sc1.c | 4 +- src/mame/drivers/bfm_sc2.c | 14 +-- src/mame/drivers/bfmsys85.c | 2 +- src/mame/drivers/bigevglf.c | 4 +- src/mame/drivers/bishi.c | 8 +- src/mame/drivers/bking.c | 4 +- src/mame/drivers/bladestl.c | 6 +- src/mame/drivers/blktiger.c | 4 +- src/mame/drivers/blockhl.c | 10 +-- src/mame/drivers/blockout.c | 2 +- src/mame/drivers/blueprnt.c | 2 +- src/mame/drivers/bmcbowl.c | 4 +- src/mame/drivers/bnstars.c | 6 +- src/mame/drivers/bogeyman.c | 4 +- src/mame/drivers/bottom9.c | 14 +-- src/mame/drivers/boxer.c | 2 +- src/mame/drivers/brkthru.c | 4 +- src/mame/drivers/btime.c | 6 +- src/mame/drivers/btoads.c | 2 +- src/mame/drivers/bublbobl.c | 8 +- src/mame/drivers/buggychl.c | 4 +- src/mame/drivers/bwing.c | 6 +- src/mame/drivers/calchase.c | 12 +-- src/mame/drivers/capbowl.c | 4 +- src/mame/drivers/cave.c | 4 +- src/mame/drivers/cball.c | 2 +- src/mame/drivers/cbuster.c | 6 +- src/mame/drivers/ccastles.c | 2 +- src/mame/drivers/cclimber.c | 2 +- src/mame/drivers/cdi.c | 42 ++++----- src/mame/drivers/centiped.c | 4 +- src/mame/drivers/cham24.c | 8 +- src/mame/drivers/champbas.c | 6 +- src/mame/drivers/chanbara.c | 2 +- src/mame/drivers/changela.c | 2 +- src/mame/drivers/cheekyms.c | 4 +- src/mame/drivers/chinagat.c | 6 +- src/mame/drivers/chqflag.c | 14 +-- src/mame/drivers/cidelsa.c | 2 +- src/mame/drivers/cinemat.c | 2 +- src/mame/drivers/circus.c | 6 +- src/mame/drivers/circusc.c | 8 +- src/mame/drivers/citycon.c | 2 +- src/mame/drivers/cliffhgr.c | 2 +- src/mame/drivers/cloud9.c | 2 +- src/mame/drivers/cntsteer.c | 6 +- src/mame/drivers/cojag.c | 16 ++-- src/mame/drivers/combatsc.c | 4 +- src/mame/drivers/commando.c | 2 +- src/mame/drivers/contra.c | 6 +- src/mame/drivers/cosmic.c | 6 +- src/mame/drivers/cps1.c | 4 +- src/mame/drivers/cps2.c | 8 +- src/mame/drivers/cps3.c | 2 +- src/mame/drivers/crbaloon.c | 8 +- src/mame/drivers/crgolf.c | 6 +- src/mame/drivers/crimfght.c | 12 +-- src/mame/drivers/crospang.c | 2 +- src/mame/drivers/crshrace.c | 4 +- src/mame/drivers/crystal.c | 12 +-- src/mame/drivers/cubeqst.c | 20 ++--- src/mame/drivers/cubocd32.c | 30 +++---- src/mame/drivers/cvs.c | 16 ++-- src/mame/drivers/cyberbal.c | 6 +- src/mame/drivers/dacholer.c | 2 +- src/mame/drivers/darius.c | 54 ++++++------ src/mame/drivers/dblewing.c | 6 +- src/mame/drivers/dbz.c | 14 +-- src/mame/drivers/dcheese.c | 8 +- src/mame/drivers/dday.c | 2 +- src/mame/drivers/ddayjlc.c | 2 +- src/mame/drivers/ddenlovr.c | 4 +- src/mame/drivers/ddragon.c | 10 +-- src/mame/drivers/ddragon3.c | 4 +- src/mame/drivers/ddribble.c | 6 +- src/mame/drivers/dec8.c | 8 +- src/mame/drivers/deco32.c | 4 +- src/mame/drivers/deco_ld.c | 2 +- src/mame/drivers/deco_mlc.c | 8 +- src/mame/drivers/deniam.c | 2 +- src/mame/drivers/destroyr.c | 2 +- src/mame/drivers/dietgo.c | 6 +- src/mame/drivers/discoboy.c | 2 +- src/mame/drivers/diverboy.c | 2 +- src/mame/drivers/djboy.c | 8 +- src/mame/drivers/djmain.c | 12 +-- src/mame/drivers/dkong.c | 8 +- src/mame/drivers/dogfgt.c | 6 +- src/mame/drivers/dorachan.c | 2 +- src/mame/drivers/dragrace.c | 2 +- src/mame/drivers/drgnmst.c | 2 +- src/mame/drivers/dribling.c | 6 +- src/mame/drivers/drmicro.c | 2 +- src/mame/drivers/drw80pkr.c | 4 +- src/mame/drivers/dynax.c | 16 ++-- src/mame/drivers/egghunt.c | 2 +- src/mame/drivers/enigma2.c | 4 +- src/mame/drivers/eprom.c | 4 +- src/mame/drivers/equites.c | 10 +-- src/mame/drivers/esd16.c | 4 +- src/mame/drivers/esh.c | 2 +- src/mame/drivers/espial.c | 4 +- src/mame/drivers/esripsys.c | 8 +- src/mame/drivers/ettrivia.c | 18 ++-- src/mame/drivers/exerion.c | 2 +- src/mame/drivers/exprraid.c | 4 +- src/mame/drivers/exterm.c | 4 +- src/mame/drivers/f1gp.c | 4 +- src/mame/drivers/fantland.c | 18 ++-- src/mame/drivers/fastlane.c | 4 +- src/mame/drivers/fcombat.c | 2 +- src/mame/drivers/fcrash.c | 12 +-- src/mame/drivers/fgoal.c | 4 +- src/mame/drivers/finalizr.c | 2 +- src/mame/drivers/firebeat.c | 10 +-- src/mame/drivers/firefox.c | 10 +-- src/mame/drivers/firetrap.c | 6 +- src/mame/drivers/firetrk.c | 14 +-- src/mame/drivers/flkatck.c | 6 +- src/mame/drivers/flstory.c | 6 +- src/mame/drivers/flyball.c | 2 +- src/mame/drivers/foodf.c | 2 +- src/mame/drivers/fromanc2.c | 10 +-- src/mame/drivers/fromance.c | 2 +- src/mame/drivers/funkyjet.c | 6 +- src/mame/drivers/funybubl.c | 2 +- src/mame/drivers/fuukifg2.c | 4 +- src/mame/drivers/fuukifg3.c | 4 +- src/mame/drivers/gaelco.c | 2 +- src/mame/drivers/gaiden.c | 2 +- src/mame/drivers/galaga.c | 8 +- src/mame/drivers/galastrm.c | 2 +- src/mame/drivers/galaxia.c | 6 +- src/mame/drivers/galaxian.c | 88 +++++++++---------- src/mame/drivers/galpani2.c | 2 +- src/mame/drivers/galpanic.c | 6 +- src/mame/drivers/galspnbl.c | 2 +- src/mame/drivers/gamecstl.c | 12 +-- src/mame/drivers/gameplan.c | 12 +-- src/mame/drivers/gaplus.c | 22 ++--- src/mame/drivers/gauntlet.c | 12 +-- src/mame/drivers/gbusters.c | 12 +-- src/mame/drivers/gei.c | 6 +- src/mame/drivers/gijoe.c | 12 +-- src/mame/drivers/ginganin.c | 2 +- src/mame/drivers/go2000.c | 2 +- src/mame/drivers/goal92.c | 2 +- src/mame/drivers/gotcha.c | 2 +- src/mame/drivers/gotya.c | 2 +- src/mame/drivers/gpworld.c | 2 +- src/mame/drivers/gradius3.c | 12 +-- src/mame/drivers/grchamp.c | 2 +- src/mame/drivers/gticlub.c | 32 +++---- src/mame/drivers/guab.c | 2 +- src/mame/drivers/gunbustr.c | 2 +- src/mame/drivers/hcastle.c | 6 +- src/mame/drivers/himesiki.c | 2 +- src/mame/drivers/hnayayoi.c | 2 +- src/mame/drivers/hng64.c | 8 +- src/mame/drivers/homedata.c | 10 +-- src/mame/drivers/hornet.c | 56 ++++++------ src/mame/drivers/hvyunit.c | 4 +- src/mame/drivers/hyperspt.c | 2 +- src/mame/drivers/hyprduel.c | 4 +- src/mame/drivers/imolagp.c | 2 +- src/mame/drivers/inufuku.c | 2 +- src/mame/drivers/ironhors.c | 2 +- src/mame/drivers/istellar.c | 2 +- src/mame/drivers/itech32.c | 6 +- src/mame/drivers/itech8.c | 4 +- src/mame/drivers/jackal.c | 6 +- src/mame/drivers/jackpool.c | 20 ++--- src/mame/drivers/jangou.c | 8 +- src/mame/drivers/jpmimpct.c | 4 +- src/mame/drivers/jrpacman.c | 2 +- src/mame/drivers/junofrst.c | 8 +- src/mame/drivers/kaneko16.c | 2 +- src/mame/drivers/karnov.c | 4 +- src/mame/drivers/kchamp.c | 2 +- src/mame/drivers/kingobox.c | 6 +- src/mame/drivers/kinst.c | 10 +-- src/mame/drivers/klax.c | 2 +- src/mame/drivers/kncljoe.c | 2 +- src/mame/drivers/konamigq.c | 8 +- src/mame/drivers/konamigv.c | 2 +- src/mame/drivers/konamigx.c | 22 ++--- src/mame/drivers/konamim2.c | 2 +- src/mame/drivers/kongambl.c | 4 +- src/mame/drivers/kopunch.c | 2 +- src/mame/drivers/ksys573.c | 6 +- src/mame/drivers/kungfur.c | 12 +-- src/mame/drivers/kyugo.c | 6 +- src/mame/drivers/labyrunr.c | 2 +- src/mame/drivers/ladybug.c | 4 +- src/mame/drivers/ladyfrog.c | 2 +- src/mame/drivers/laserbat.c | 20 ++--- src/mame/drivers/lasso.c | 8 +- src/mame/drivers/lastduel.c | 2 +- src/mame/drivers/lastfght.c | 2 +- src/mame/drivers/lazercmd.c | 2 +- src/mame/drivers/lemmings.c | 2 +- src/mame/drivers/lethal.c | 12 +-- src/mame/drivers/lethalj.c | 6 +- src/mame/drivers/lgp.c | 2 +- src/mame/drivers/liberate.c | 4 +- src/mame/drivers/limenko.c | 2 +- src/mame/drivers/lkage.c | 6 +- src/mame/drivers/lockon.c | 20 ++--- src/mame/drivers/lordgun.c | 4 +- src/mame/drivers/lsasquad.c | 6 +- src/mame/drivers/m10.c | 8 +- src/mame/drivers/m107.c | 4 +- src/mame/drivers/m14.c | 2 +- src/mame/drivers/m63.c | 8 +- src/mame/drivers/m72.c | 4 +- src/mame/drivers/m92.c | 6 +- src/mame/drivers/macrossp.c | 4 +- src/mame/drivers/madmotor.c | 4 +- src/mame/drivers/magicfly.c | 2 +- src/mame/drivers/magmax.c | 6 +- src/mame/drivers/mainevt.c | 12 +-- src/mame/drivers/malzak.c | 8 +- src/mame/drivers/mappy.c | 66 +++++++------- src/mame/drivers/marineb.c | 2 +- src/mame/drivers/mastboy.c | 6 +- src/mame/drivers/matmania.c | 6 +- src/mame/drivers/maxaflex.c | 4 +- src/mame/drivers/maygay1b.c | 2 +- src/mame/drivers/maygayv1.c | 6 +- src/mame/drivers/mazerbla.c | 6 +- src/mame/drivers/mcatadv.c | 4 +- src/mame/drivers/mcr.c | 4 +- src/mame/drivers/mediagx.c | 2 +- src/mame/drivers/megadriv.c | 28 +++--- src/mame/drivers/megasys1.c | 4 +- src/mame/drivers/megatech.c | 4 +- src/mame/drivers/megazone.c | 2 +- src/mame/drivers/merit.c | 2 +- src/mame/drivers/meritm.c | 4 +- src/mame/drivers/mermaid.c | 6 +- src/mame/drivers/metalmx.c | 10 +-- src/mame/drivers/metlclsh.c | 4 +- src/mame/drivers/metro.c | 2 +- src/mame/drivers/mexico86.c | 10 +-- src/mame/drivers/mgolf.c | 2 +- src/mame/drivers/mhavoc.c | 8 +- src/mame/drivers/midas.c | 6 +- src/mame/drivers/mirax.c | 2 +- src/mame/drivers/missb2.c | 6 +- src/mame/drivers/missile.c | 4 +- src/mame/drivers/mitchell.c | 2 +- src/mame/drivers/mjsister.c | 4 +- src/mame/drivers/mlanding.c | 4 +- src/mame/drivers/model1.c | 4 +- src/mame/drivers/model2.c | 34 ++++---- src/mame/drivers/model3.c | 10 +-- src/mame/drivers/mogura.c | 6 +- src/mame/drivers/moo.c | 14 +-- src/mame/drivers/mouser.c | 4 +- src/mame/drivers/mpoker.c | 2 +- src/mame/drivers/mpu4.c | 36 ++++---- src/mame/drivers/mpu4drvr.c | 12 +-- src/mame/drivers/mquake.c | 2 +- src/mame/drivers/mrflea.c | 4 +- src/mame/drivers/ms32.c | 2 +- src/mame/drivers/msisaac.c | 4 +- src/mame/drivers/mugsmash.c | 4 +- src/mame/drivers/multigam.c | 38 ++++---- src/mame/drivers/munchmo.c | 4 +- src/mame/drivers/mw8080bw.c | 4 +- src/mame/drivers/mystston.c | 4 +- src/mame/drivers/mystwarr.c | 16 ++-- src/mame/drivers/n8080.c | 2 +- src/mame/drivers/namcona1.c | 2 +- src/mame/drivers/namcos1.c | 2 +- src/mame/drivers/namcos2.c | 2 +- src/mame/drivers/namcos21.c | 2 +- src/mame/drivers/namcos22.c | 2 +- src/mame/drivers/namcos86.c | 2 +- src/mame/drivers/naomi.c | 2 +- src/mame/drivers/nbmj9195.c | 10 +-- src/mame/drivers/nemesis.c | 2 +- src/mame/drivers/neogeo.c | 8 +- src/mame/drivers/nightgal.c | 4 +- src/mame/drivers/ninjakd2.c | 2 +- src/mame/drivers/ninjaw.c | 28 +++--- src/mame/drivers/niyanpai.c | 4 +- src/mame/drivers/nmg5.c | 4 +- src/mame/drivers/norautp.c | 6 +- src/mame/drivers/nwk-tr.c | 16 ++-- src/mame/drivers/nycaptor.c | 8 +- src/mame/drivers/nyny.c | 14 +-- src/mame/drivers/ojankohs.c | 4 +- src/mame/drivers/oneshot.c | 4 +- src/mame/drivers/onetwo.c | 4 +- src/mame/drivers/opwolf.c | 12 +-- src/mame/drivers/orbit.c | 4 +- src/mame/drivers/othello.c | 10 +-- src/mame/drivers/othunder.c | 26 +++--- src/mame/drivers/overdriv.c | 18 ++-- src/mame/drivers/pacland.c | 4 +- src/mame/drivers/pacman.c | 10 +-- src/mame/drivers/parodius.c | 14 +-- src/mame/drivers/pbaction.c | 4 +- src/mame/drivers/pcat_dyn.c | 12 +-- src/mame/drivers/pcat_nit.c | 2 +- src/mame/drivers/pcxt.c | 16 ++-- src/mame/drivers/pgm.c | 2 +- src/mame/drivers/photon.c | 4 +- src/mame/drivers/photon2.c | 2 +- src/mame/drivers/photoply.c | 12 +-- src/mame/drivers/pipedrm.c | 2 +- src/mame/drivers/pirates.c | 2 +- src/mame/drivers/pktgaldx.c | 4 +- src/mame/drivers/playch10.c | 2 +- src/mame/drivers/playmark.c | 6 +- src/mame/drivers/plygonet.c | 4 +- src/mame/drivers/polepos.c | 8 +- src/mame/drivers/policetr.c | 4 +- src/mame/drivers/popper.c | 2 +- src/mame/drivers/ppmast93.c | 4 +- src/mame/drivers/psikyo.c | 2 +- src/mame/drivers/psikyo4.c | 2 +- src/mame/drivers/psikyosh.c | 22 ++--- src/mame/drivers/punchout.c | 2 +- src/mame/drivers/pushman.c | 6 +- src/mame/drivers/qdrmfgp.c | 16 ++-- src/mame/drivers/quakeat.c | 6 +- src/mame/drivers/r2dtank.c | 18 ++-- src/mame/drivers/rainbow.c | 8 +- src/mame/drivers/rallyx.c | 4 +- src/mame/drivers/rampart.c | 4 +- src/mame/drivers/rastan.c | 8 +- src/mame/drivers/rbmk.c | 4 +- src/mame/drivers/redclash.c | 2 +- src/mame/drivers/retofinv.c | 6 +- src/mame/drivers/rockrage.c | 6 +- src/mame/drivers/rollerg.c | 12 +-- src/mame/drivers/royalmah.c | 16 ++-- src/mame/drivers/rungun.c | 16 ++-- src/mame/drivers/safarir.c | 2 +- src/mame/drivers/sandscrp.c | 2 +- src/mame/drivers/sbasketb.c | 2 +- src/mame/drivers/sbrkout.c | 2 +- src/mame/drivers/scregg.c | 2 +- src/mame/drivers/seattle.c | 76 ++++++++-------- src/mame/drivers/segac2.c | 8 +- src/mame/drivers/segae.c | 4 +- src/mame/drivers/segag80v.c | 2 +- src/mame/drivers/segahang.c | 14 +-- src/mame/drivers/segald.c | 2 +- src/mame/drivers/segamsys.c | 2 +- src/mame/drivers/segaorun.c | 14 +-- src/mame/drivers/segas16a.c | 14 +-- src/mame/drivers/segas16b.c | 18 ++-- src/mame/drivers/segas18.c | 10 +-- src/mame/drivers/segas24.c | 4 +- src/mame/drivers/segaxbd.c | 12 +-- src/mame/drivers/segaybd.c | 8 +- src/mame/drivers/seibuspi.c | 8 +- src/mame/drivers/seicross.c | 2 +- src/mame/drivers/sf.c | 4 +- src/mame/drivers/shanghai.c | 2 +- src/mame/drivers/sigmab52.c | 8 +- src/mame/drivers/sigmab98.c | 2 +- src/mame/drivers/skeetsht.c | 4 +- src/mame/drivers/skimaxx.c | 6 +- src/mame/drivers/skullxbo.c | 2 +- src/mame/drivers/skydiver.c | 2 +- src/mame/drivers/skyfox.c | 2 +- src/mame/drivers/skykid.c | 4 +- src/mame/drivers/slapshot.c | 12 +-- src/mame/drivers/slotcarn.c | 2 +- src/mame/drivers/snowbros.c | 6 +- src/mame/drivers/sonson.c | 2 +- src/mame/drivers/spcforce.c | 12 +-- src/mame/drivers/spdodgeb.c | 2 +- src/mame/drivers/spiders.c | 14 +-- src/mame/drivers/spool99.c | 8 +- src/mame/drivers/sprint2.c | 2 +- src/mame/drivers/spy.c | 12 +-- src/mame/drivers/ssfindo.c | 4 +- src/mame/drivers/ssingles.c | 2 +- src/mame/drivers/sslam.c | 4 +- src/mame/drivers/ssv.c | 4 +- src/mame/drivers/statriv2.c | 2 +- src/mame/drivers/stv.c | 12 +-- src/mame/drivers/stvinit.c | 162 +++++++++++++++++------------------ src/mame/drivers/suna8.c | 2 +- src/mame/drivers/supbtime.c | 6 +- src/mame/drivers/superchs.c | 2 +- src/mame/drivers/superdq.c | 2 +- src/mame/drivers/superqix.c | 2 +- src/mame/drivers/suprnova.c | 6 +- src/mame/drivers/suprslam.c | 4 +- src/mame/drivers/surpratk.c | 10 +-- src/mame/drivers/system1.c | 6 +- src/mame/drivers/system16.c | 4 +- src/mame/drivers/tail2nos.c | 6 +- src/mame/drivers/taito_b.c | 14 +-- src/mame/drivers/taito_f2.c | 18 ++-- src/mame/drivers/taito_f3.c | 2 +- src/mame/drivers/taito_h.c | 6 +- src/mame/drivers/taito_l.c | 4 +- src/mame/drivers/taito_o.c | 4 +- src/mame/drivers/taito_z.c | 20 ++--- src/mame/drivers/taitoair.c | 6 +- src/mame/drivers/taitogn.c | 12 +-- src/mame/drivers/taitowlf.c | 12 +-- src/mame/drivers/tankbatt.c | 8 +- src/mame/drivers/tatsumi.c | 2 +- src/mame/drivers/tbowl.c | 4 +- src/mame/drivers/thayers.c | 2 +- src/mame/drivers/thunderx.c | 12 +-- src/mame/drivers/tickee.c | 4 +- src/mame/drivers/tmaster.c | 12 +-- src/mame/drivers/tmmjprd.c | 4 +- src/mame/drivers/tmnt.c | 26 +++--- src/mame/drivers/toaplan2.c | 32 +++---- src/mame/drivers/tomcat.c | 4 +- src/mame/drivers/topspeed.c | 12 +-- src/mame/drivers/toratora.c | 8 +- src/mame/drivers/toypop.c | 26 +++--- src/mame/drivers/tp84.c | 8 +- src/mame/drivers/trackfld.c | 2 +- src/mame/drivers/triplhnt.c | 4 +- src/mame/drivers/trvquest.c | 8 +- src/mame/drivers/tumbleb.c | 8 +- src/mame/drivers/tumblep.c | 6 +- src/mame/drivers/turbo.c | 4 +- src/mame/drivers/twinkle.c | 4 +- src/mame/drivers/ultraman.c | 12 +-- src/mame/drivers/ultrsprt.c | 12 +-- src/mame/drivers/undrfire.c | 2 +- src/mame/drivers/vaportra.c | 6 +- src/mame/drivers/vcombat.c | 22 ++--- src/mame/drivers/vegas.c | 46 +++++----- src/mame/drivers/vendetta.c | 16 ++-- src/mame/drivers/videopin.c | 2 +- src/mame/drivers/viper.c | 8 +- src/mame/drivers/volfied.c | 6 +- src/mame/drivers/vsnes.c | 4 +- src/mame/drivers/warpwarp.c | 2 +- src/mame/drivers/warriorb.c | 22 ++--- src/mame/drivers/wecleman.c | 8 +- src/mame/drivers/wgp.c | 10 +-- src/mame/drivers/williams.c | 6 +- src/mame/drivers/wiz.c | 2 +- src/mame/drivers/wolfpack.c | 2 +- src/mame/drivers/xain.c | 6 +- src/mame/drivers/xexex.c | 28 +++--- src/mame/drivers/xmen.c | 16 ++-- src/mame/drivers/xtheball.c | 2 +- src/mame/drivers/xybots.c | 2 +- src/mame/drivers/yiear.c | 2 +- src/mame/drivers/yunsun16.c | 2 +- src/mame/drivers/yunsung8.c | 2 +- src/mame/drivers/zaccaria.c | 14 +-- src/mame/drivers/zerozone.c | 2 +- src/mame/drivers/zn.c | 12 +-- src/mame/drivers/zr107.c | 22 ++--- src/mame/machine/ajax.c | 16 ++-- src/mame/machine/amiga.c | 20 ++--- src/mame/machine/archimds.c | 6 +- src/mame/machine/asic65.c | 2 +- src/mame/machine/atari.c | 6 +- src/mame/machine/atarifb.c | 12 +-- src/mame/machine/atarigen.c | 6 +- src/mame/machine/beezer.c | 2 +- src/mame/machine/carpolo.c | 28 +++--- src/mame/machine/cps2crpt.c | 2 +- src/mame/machine/cubocd32.c | 4 +- src/mame/machine/dc.c | 18 ++-- src/mame/machine/deco102.c | 2 +- src/mame/machine/decocass.c | 8 +- src/mame/machine/decoprot.c | 4 +- src/mame/machine/galaxold.c | 10 +-- src/mame/machine/gaplus.c | 2 +- src/mame/machine/konppc.c | 20 ++--- src/mame/machine/leland.c | 12 +-- src/mame/machine/mcr.c | 8 +- src/mame/machine/mhavoc.c | 6 +- src/mame/machine/micro3d.c | 12 +-- src/mame/machine/midwayic.c | 10 +-- src/mame/machine/model1.c | 2 +- src/mame/machine/mw8080bw.c | 20 ++--- src/mame/machine/n64.c | 12 +-- src/mame/machine/namco06.c | 8 +- src/mame/machine/namcos1.c | 6 +- src/mame/machine/namcos2.c | 18 ++-- src/mame/machine/nitedrvr.c | 4 +- src/mame/machine/nmk004.c | 6 +- src/mame/machine/playch10.c | 20 ++--- src/mame/machine/qix.c | 6 +- src/mame/machine/s16fd.c | 10 +-- src/mame/machine/s24fd.c | 12 +-- src/mame/machine/scramble.c | 12 +-- src/mame/machine/simpsons.c | 14 +-- src/mame/machine/slikshot.c | 2 +- src/mame/machine/snes.c | 2 +- src/mame/machine/starwars.c | 2 +- src/mame/machine/stvcd.c | 2 +- src/mame/machine/taitosj.c | 2 +- src/mame/machine/tnzs.c | 8 +- src/mame/machine/tx1.c | 2 +- src/mame/machine/vertigo.c | 2 +- src/mame/machine/vsnes.c | 20 ++--- src/mame/video/antic.c | 4 +- src/mame/video/astrocde.c | 2 +- src/mame/video/atari.c | 2 +- src/mame/video/atarisy1.c | 2 +- src/mame/video/beezer.c | 2 +- src/mame/video/blstroid.c | 2 +- src/mame/video/cidelsa.c | 2 +- src/mame/video/cinemat.c | 2 +- src/mame/video/cyberbal.c | 4 +- src/mame/video/djmain.c | 8 +- src/mame/video/exterm.c | 2 +- src/mame/video/gaelco2.c | 4 +- src/mame/video/galastrm.c | 4 +- src/mame/video/galpanic.c | 2 +- src/mame/video/genesis.c | 2 +- src/mame/video/groundfx.c | 4 +- src/mame/video/gticlub.c | 16 ++-- src/mame/video/gunbustr.c | 2 +- src/mame/video/jaguar.c | 4 +- src/mame/video/kaneko16.c | 2 +- src/mame/video/konamigx.c | 8 +- src/mame/video/konicdev.c | 12 +-- src/mame/video/megasys1.c | 2 +- src/mame/video/nbmj8688.c | 6 +- src/mame/video/playch10.c | 4 +- src/mame/video/plygonet.c | 2 +- src/mame/video/psikyo4.c | 4 +- src/mame/video/punchout.c | 8 +- src/mame/video/qdrmfgp.c | 6 +- src/mame/video/qix.c | 2 +- src/mame/video/sega16sp.c | 20 ++--- src/mame/video/segas32.c | 2 +- src/mame/video/seta.c | 2 +- src/mame/video/skydiver.c | 2 +- src/mame/video/sprint4.c | 2 +- src/mame/video/starcrus.c | 8 +- src/mame/video/subs.c | 6 +- src/mame/video/superchs.c | 2 +- src/mame/video/tbowl.c | 4 +- src/mame/video/tceptor.c | 6 +- src/mame/video/tetrisp2.c | 4 +- src/mame/video/thief.c | 2 +- src/mame/video/tia.c | 2 +- src/mame/video/toaplan2.c | 2 +- src/mame/video/triplhnt.c | 2 +- src/mame/video/tx1.c | 12 +-- src/mame/video/ultratnk.c | 2 +- src/mame/video/undrfire.c | 8 +- src/mame/video/vindictr.c | 2 +- src/mame/video/vrender0.c | 2 +- src/mame/video/vsnes.c | 10 +-- src/mame/video/wecleman.c | 4 +- 653 files changed, 2451 insertions(+), 2452 deletions(-) diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h index bad67836d9f..62989994c9e 100644 --- a/src/emu/devintrf.h +++ b/src/emu/devintrf.h @@ -56,7 +56,6 @@ #define DERIVED_CLOCK(num, den) (0xff000000 | ((num) << 12) | ((den) << 0)) // shorthand for accessing devices by machine/type/tag -#define devtag_get_device(mach,tag) (mach)->device(tag) #define devtag_reset(mach,tag) (mach)->device(tag)->reset() diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c index ed50d20ed30..67c742fb269 100644 --- a/src/emu/sound/mos6560.c +++ b/src/emu/sound/mos6560.c @@ -803,7 +803,7 @@ static DEVICE_START( mos6560 ) const mos6560_interface *intf = (mos6560_interface *)device->baseconfig().static_config(); int width, height; - mos6560->screen = downcast(devtag_get_device(device->machine, intf->screen)); + mos6560->screen = downcast(device->machine->device(intf->screen)); width = mos6560->screen->width(); height = mos6560->screen->height(); diff --git a/src/mame/audio/blockade.c b/src/mame/audio/blockade.c index 4dffa55f1eb..b2133bd434c 100644 --- a/src/mame/audio/blockade.c +++ b/src/mame/audio/blockade.c @@ -44,7 +44,7 @@ WRITE8_DEVICE_HANDLER( blockade_sound_freq_w ) WRITE8_HANDLER( blockade_env_on_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n"); sample_start(samples, 0,0,0); return; diff --git a/src/mame/audio/carnival.c b/src/mame/audio/carnival.c index 8a2790123ae..89df81e2c9e 100644 --- a/src/mame/audio/carnival.c +++ b/src/mame/audio/carnival.c @@ -127,7 +127,7 @@ static int psgData = 0; WRITE8_HANDLER( carnival_audio_1_w ) { static int port1State = 0; - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int bitsChanged; int bitsGoneHigh; int bitsGoneLow; @@ -206,7 +206,7 @@ WRITE8_HANDLER( carnival_audio_1_w ) WRITE8_HANDLER( carnival_audio_2_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int bitsChanged; int bitsGoneHigh; int bitsGoneLow; diff --git a/src/mame/audio/cchasm.c b/src/mame/audio/cchasm.c index be49d90a6d8..885e2d07117 100644 --- a/src/mame/audio/cchasm.c +++ b/src/mame/audio/cchasm.c @@ -108,7 +108,7 @@ static WRITE_LINE_DEVICE_HANDLER( ctc_timer_1_w ) { output[0] ^= 0x7f; channel_active[0] = 1; - dac_data_w(devtag_get_device(device->machine, "dac1"), output[0]); + dac_data_w(device->machine->device("dac1"), output[0]); } } @@ -118,7 +118,7 @@ static WRITE_LINE_DEVICE_HANDLER( ctc_timer_2_w ) { output[1] ^= 0x7f; channel_active[1] = 1; - dac_data_w(devtag_get_device(device->machine, "dac2"), output[0]); + dac_data_w(device->machine->device("dac2"), output[0]); } } @@ -137,5 +137,5 @@ SOUND_START( cchasm ) sound_flags = 0; output[0] = 0; output[1] = 0; - ctc = devtag_get_device(machine, "ctc"); + ctc = machine->device("ctc"); } diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c index 17268988b00..14029b40b0d 100644 --- a/src/mame/audio/cclimber.c +++ b/src/mame/audio/cclimber.c @@ -27,7 +27,7 @@ static void cclimber_play_sample(running_machine *machine, int start,int freq,in int len; int romlen = memory_region_length(machine, "samples"); const UINT8 *rom = memory_region(machine, "samples"); - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); if (!rom) return; diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c index 4fdbc6e00da..84e8fd7dc15 100644 --- a/src/mame/audio/cinemat.c +++ b/src/mame/audio/cinemat.c @@ -165,7 +165,7 @@ static const samples_interface spacewar_samples_interface = static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* Explosion - rising edge */ if (SOUNDVAL_RISING_EDGE(0x01)) @@ -245,7 +245,7 @@ static const samples_interface barrier_samples_interface = static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* Player die - rising edge */ if (SOUNDVAL_RISING_EDGE(0x01)) @@ -299,7 +299,7 @@ static const samples_interface speedfrk_samples_interface = static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */ if (SOUNDVAL_FALLING_EDGE(0x08)) @@ -365,7 +365,7 @@ static const samples_interface starhawk_samples_interface = static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* explosion - falling edge */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -442,7 +442,7 @@ static const samples_interface sundance_samples_interface = static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* bong - falling edge */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -516,7 +516,7 @@ static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_ /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */ if (SOUNDVAL_FALLING_EDGE(0x10)) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* update the shift register (actually just a simple mux) */ current_shift = (current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7)); @@ -602,7 +602,7 @@ static const samples_interface warrior_samples_interface = static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* normal level - 0=on, 1=off */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -674,7 +674,7 @@ static const samples_interface armora_samples_interface = static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -776,7 +776,7 @@ static const samples_interface ripoff_samples_interface = static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x02)) @@ -864,7 +864,7 @@ static const samples_interface starcas_samples_interface = static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); UINT32 target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ @@ -978,7 +978,7 @@ static const samples_interface solarq_samples_interface = static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); static float target_volume, current_volume; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ @@ -1119,7 +1119,7 @@ static const samples_interface boxingb_samples_interface = static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -1251,7 +1251,7 @@ static const samples_interface wotw_samples_interface = static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); UINT32 target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ @@ -1365,7 +1365,7 @@ static const samples_interface wotwc_samples_interface = static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); UINT32 target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ @@ -1554,7 +1554,7 @@ static MACHINE_RESET( demon_sound ) last_portb_write = 0xff; /* turn off channel A on AY8910 #0 because it is used as a low-pass filter */ - ay8910_set_volume(devtag_get_device(machine, "ay1"), 0, 0); + ay8910_set_volume(machine->device("ay1"), 0, 0); } @@ -1623,7 +1623,7 @@ MACHINE_DRIVER_END static WRITE8_HANDLER( qb3_sound_w ) { - UINT16 rega = cpu_get_reg(devtag_get_device(space->machine, "maincpu"), CCPU_A); + UINT16 rega = cpu_get_reg(space->machine->device("maincpu"), CCPU_A); demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10); } diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c index 8792f400fed..526d2138abf 100644 --- a/src/mame/audio/cyberbal.c +++ b/src/mame/audio/cyberbal.c @@ -154,7 +154,7 @@ WRITE16_HANDLER( cyberbal_sound_68k_w ) WRITE16_HANDLER( cyberbal_sound_68k_dac_w ) { cyberbal_state *state = (cyberbal_state *)space->machine->driver_data; - running_device *dac = devtag_get_device(space->machine, (offset & 8) ? "dac2" : "dac1"); + running_device *dac = space->machine->device((offset & 8) ? "dac2" : "dac1"); dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4); if (state->fast_68k_int) diff --git a/src/mame/audio/depthch.c b/src/mame/audio/depthch.c index d8c2e35faca..9227c832f07 100644 --- a/src/mame/audio/depthch.c +++ b/src/mame/audio/depthch.c @@ -56,7 +56,7 @@ enum WRITE8_HANDLER( depthch_audio_w ) { static int port1State = 0; - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int bitsChanged; int bitsGoneHigh; int bitsGoneLow; diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index 52bd31b16fe..55c8b5d0973 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -114,7 +114,7 @@ static double freq_to_step; static WRITE_LINE_DEVICE_HANDLER( update_irq_state ) { - running_device *pia = devtag_get_device(device->machine, "pia1"); + running_device *pia = device->machine->device("pia1"); cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(pia) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE); } @@ -462,7 +462,7 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w ) if (has_tms5220) { - running_device *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = device->machine->device("tms"); logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot)); tms5220_data_w(tms, 0, data); } @@ -472,7 +472,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r ) { if (has_tms5220) { - running_device *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = device->machine->device("tms"); logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(tms, 0)); return tms5220_status_r(tms, 0); } @@ -484,7 +484,7 @@ static WRITE8_DEVICE_HANDLER( r6532_portb_w ) { if (has_tms5220) { - running_device *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = device->machine->device("tms"); tms5220_rsq_w(tms, data & 0x01); tms5220_wsq_w(tms, (data >> 1) & 0x01); @@ -497,7 +497,7 @@ static READ8_DEVICE_HANDLER( r6532_portb_r ) UINT8 newdata = riot6532_portb_in_get(device); if (has_tms5220) { - running_device *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = device->machine->device("tms"); newdata &= ~0x0c; if (tms5220_readyq_r(tms)) newdata |= 0x04; if (tms5220_intq_r(tms)) newdata |= 0x08; @@ -764,13 +764,13 @@ static DEVICE_START( venture_common_sh_start ) DEVICE_START_CALL(common_sh_start); - riot = devtag_get_device(machine, "riot"); + riot = machine->device("riot"); has_sh8253 = TRUE; has_tms5220 = FALSE; /* determine which sound hardware is installed */ - has_mc3417 = (devtag_get_device(device->machine, "cvsd") != NULL); + has_mc3417 = (device->machine->device("cvsd") != NULL); /* 8253 */ freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK; @@ -860,7 +860,7 @@ MACHINE_DRIVER_END static WRITE8_HANDLER( mtrap_voiceio_w ) { if (!(offset & 0x10)) - hc55516_digit_w(devtag_get_device(space->machine, "cvsd"), data & 1); + hc55516_digit_w(space->machine->device("cvsd"), data & 1); if (!(offset & 0x20)) riot6532_portb_in_set(riot, data & 1, 0xff); @@ -879,7 +879,7 @@ static READ8_HANDLER( mtrap_voiceio_r ) } if (!(offset & 0x40)) - return hc55516_clock_state_r(devtag_get_device(space->machine, "cvsd")) << 7; + return hc55516_clock_state_r(space->machine->device("cvsd")) << 7; return 0; } @@ -925,7 +925,7 @@ static UINT8 victory_sound_response_ack_clk; /* 7474 @ F4 */ READ8_HANDLER( victory_sound_response_r ) { - running_device *pia1 = devtag_get_device(space->machine, "pia1"); + running_device *pia1 = space->machine->device("pia1"); UINT8 ret = pia6821_get_output_b(pia1); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(space->cpu), ret); @@ -938,7 +938,7 @@ READ8_HANDLER( victory_sound_response_r ) READ8_HANDLER( victory_sound_status_r ) { - running_device *pia1 = devtag_get_device(space->machine, "pia1"); + running_device *pia1 = space->machine->device("pia1"); UINT8 ret = (pia6821_ca1_r(pia1, 0) << 7) | (pia6821_cb1_r(pia1, 0) << 6); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(space->cpu), ret); @@ -949,7 +949,7 @@ READ8_HANDLER( victory_sound_status_r ) static TIMER_CALLBACK( delayed_command_w ) { - running_device *pia1 = devtag_get_device(machine, "pia1"); + running_device *pia1 = machine->device("pia1"); pia6821_set_input_a(pia1, param, 0); pia6821_ca1_w(pia1, 0, 0); } @@ -1010,7 +1010,7 @@ static DEVICE_START( victory_sound ) static DEVICE_RESET( victory_sound ) { - running_device *pia1 = devtag_get_device(device->machine, "pia1"); + running_device *pia1 = device->machine->device("pia1"); DEVICE_RESET_CALL(common_sh_reset); pia1->reset(); diff --git a/src/mame/audio/gorf.c b/src/mame/audio/gorf.c index 96ef520400e..48720c12af4 100644 --- a/src/mame/audio/gorf.c +++ b/src/mame/audio/gorf.c @@ -116,7 +116,7 @@ static int plural = 0; READ8_HANDLER( gorf_speech_r ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int Phoneme,Intonation; int i = 0; @@ -182,6 +182,6 @@ READ8_HANDLER( gorf_speech_r ) CUSTOM_INPUT( gorf_speech_status_r ) { - running_device *samples = devtag_get_device(field->port->machine, "samples"); + running_device *samples = field->port->machine->device("samples"); return !sample_playing(samples, 0); } diff --git a/src/mame/audio/gottlieb.c b/src/mame/audio/gottlieb.c index 0b860c75b05..6ad4624a221 100644 --- a/src/mame/audio/gottlieb.c +++ b/src/mame/audio/gottlieb.c @@ -55,7 +55,7 @@ static void trigger_sample(running_device *samples, UINT8 data); WRITE8_HANDLER( gottlieb_sh_w ) { - running_device *riot = devtag_get_device(space->machine, "riot"); + running_device *riot = space->machine->device("riot"); /* identify rev1 boards by the presence of a 6532 RIOT device */ if (riot != NULL) @@ -74,7 +74,7 @@ WRITE8_HANDLER( gottlieb_sh_w ) static void gottlieb1_sh_w(running_device *riot, UINT8 data) { - running_device *samples = devtag_get_device(riot->machine, "samples"); + running_device *samples = riot->machine->device("samples"); int pa7 = (data & 0x0f) != 0xf; int pa0_5 = ~data & 0x3f; @@ -196,7 +196,7 @@ static void trigger_sample(running_device *samples, UINT8 data) #ifdef UNUSED_FUNCTION void gottlieb_knocker(running_machine *machine) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */ { } @@ -244,7 +244,7 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem { if (votrax_queuepos > 1) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int last = -1; int i; char phonemes[200]; @@ -469,7 +469,7 @@ static WRITE8_HANDLER( nmi_rate_w ) static CUSTOM_INPUT( speech_drq_custom_r ) { - return sp0250_drq_r(devtag_get_device(field->port->machine, "spsnd")); + return sp0250_drq_r(field->port->machine->device("spsnd")); } @@ -497,7 +497,7 @@ static WRITE8_HANDLER( speech_control_w ) { /* bit 3 selects which of the two 8913 to enable */ /* bit 4 goes to the 8913 BC1 pin */ - running_device *ay = devtag_get_device(space->machine, (data & 0x08) ? "ay1" : "ay2"); + running_device *ay = space->machine->device((data & 0x08) ? "ay1" : "ay2"); ay8910_data_address_w(ay, data >> 4, *psg_latch); } @@ -506,7 +506,7 @@ static WRITE8_HANDLER( speech_control_w ) /* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */ if ((previous & 0x40) == 0 && (data & 0x40) != 0) { - running_device *sp = devtag_get_device(space->machine, "spsnd"); + running_device *sp = space->machine->device("spsnd"); sp0250_w(sp, 0, *sp0250_latch); } diff --git a/src/mame/audio/gridlee.c b/src/mame/audio/gridlee.c index 33a1f0a87e5..d7c6f5cde48 100644 --- a/src/mame/audio/gridlee.c +++ b/src/mame/audio/gridlee.c @@ -91,7 +91,7 @@ DEVICE_GET_INFO( gridlee_sound ) WRITE8_HANDLER( gridlee_sound_w ) { static UINT8 sound_data[24]; - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); stream_update(gridlee_stream); diff --git a/src/mame/audio/invinco.c b/src/mame/audio/invinco.c index ecaf12d1159..01f2c378e93 100644 --- a/src/mame/audio/invinco.c +++ b/src/mame/audio/invinco.c @@ -66,7 +66,7 @@ enum WRITE8_HANDLER( invinco_audio_w ) { static int port2State = 0; - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int bitsChanged; //int bitsGoneHigh; int bitsGoneLow; diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c index 803e33c6926..61ff3366126 100644 --- a/src/mame/audio/irem.c +++ b/src/mame/audio/irem.c @@ -22,10 +22,10 @@ static SOUND_START( irem_audio ) { irem_z80_state *state = (irem_z80_state *)machine->driver_data; - state->adpcm1 = devtag_get_device(machine, "msm1"); - state->adpcm2 = devtag_get_device(machine, "msm2"); - state->ay1 = devtag_get_device(machine, "ay1"); - state->ay2 = devtag_get_device(machine, "ay2"); + state->adpcm1 = machine->device("msm1"); + state->adpcm2 = machine->device("msm2"); + state->ay1 = machine->device("ay1"); + state->ay2 = machine->device("ay2"); state_save_register_global(machine, state->port1); state_save_register_global(machine, state->port2); diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c index 806c517e96d..a70cc4236f2 100644 --- a/src/mame/audio/jaguar.c +++ b/src/mame/audio/jaguar.c @@ -339,11 +339,11 @@ WRITE32_HANDLER( jaguar_jerry_regs32_w ) static WRITE32_HANDLER( dsp_flags_w ) { /* write the data through */ - jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), offset, data, mem_mask); + jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask); /* if they were clearing the A2S interrupt, see if we are headed for the spin */ /* loop with R22 != 0; if we are, just start spinning again */ - if (space->cpu == devtag_get_device(space->machine, "audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400)) + if (space->cpu == space->machine->device("audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400)) { /* see if we're going back to the spin loop */ if (!(data & 0x04000) && cpu_get_reg(space->cpu, JAGUAR_R22) != 0) @@ -416,12 +416,12 @@ WRITE32_HANDLER( jaguar_serial_w ) { /* right DAC */ case 2: - dac_signed_data_16_w(devtag_get_device(space->machine, "dac2"), (data & 0xffff) ^ 0x8000); + dac_signed_data_16_w(space->machine->device("dac2"), (data & 0xffff) ^ 0x8000); break; /* left DAC */ case 3: - dac_signed_data_16_w(devtag_get_device(space->machine, "dac1"), (data & 0xffff) ^ 0x8000); + dac_signed_data_16_w(space->machine->device("dac1"), (data & 0xffff) ^ 0x8000); break; /* frequency register */ diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c index cd256a63b40..43f37a881f8 100644 --- a/src/mame/audio/jedi.c +++ b/src/mame/audio/jedi.c @@ -147,7 +147,7 @@ static WRITE8_HANDLER( speech_strobe_w ) if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state) { - running_device *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = space->machine->device("tms"); tms5220_data_w(tms, 0, *state->speech_data); } state->speech_strobe_state = new_speech_strobe_state; @@ -156,7 +156,7 @@ static WRITE8_HANDLER( speech_strobe_w ) static READ8_HANDLER( speech_ready_r ) { - return (tms5220_readyq_r(devtag_get_device(space->machine, "tms"))) << 7; + return (tms5220_readyq_r(space->machine->device("tms"))) << 7; } diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c index 450ceb298fa..b1cf37e0b56 100644 --- a/src/mame/audio/leland.c +++ b/src/mame/audio/leland.c @@ -518,7 +518,7 @@ static DEVICE_START( common_sh_start ) int i; /* determine which sound hardware is installed */ - has_ym2151 = (devtag_get_device(device->machine, "ymsnd") != NULL); + has_ym2151 = (device->machine->device("ymsnd") != NULL); /* allocate separate streams for the DMA and non-DMA DACs */ dma_stream = stream_create(device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update); @@ -2049,7 +2049,7 @@ static READ16_HANDLER( peripheral_r ) if (!has_ym2151) return pit8254_r(space, offset | 0x40, mem_mask); else - return ym2151_r(devtag_get_device(space->machine, "ymsnd"), offset); + return ym2151_r(space->machine->device("ymsnd"), offset); case 4: if (is_redline) @@ -2085,7 +2085,7 @@ static WRITE16_HANDLER( peripheral_w ) if (!has_ym2151) pit8254_w(space, offset | 0x40, data, mem_mask); else - ym2151_w(devtag_get_device(space->machine, "ymsnd"), offset, data); + ym2151_w(space->machine->device("ymsnd"), offset, data); break; case 4: diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c index c9d61eb9c88..c04647fe446 100644 --- a/src/mame/audio/mario.c +++ b/src/mame/audio/mario.c @@ -466,7 +466,7 @@ static void set_ea(const address_space *space, int ea) static SOUND_START( mario ) { mario_state *state = (mario_state *)machine->driver_data; - running_device *audiocpu = devtag_get_device(machine, "audiocpu"); + running_device *audiocpu = machine->device("audiocpu"); #if USE_8039 UINT8 *SND = memory_region(machine, "audiocpu"); @@ -629,7 +629,7 @@ WRITE8_HANDLER( mario_sh3_w ) I8035_P1_W_AH(space,3,data & 1); break; case 7: /* skid */ - discrete_sound_w(devtag_get_device(space->machine, "discrete"),DS_SOUND7_INP,data & 1); + discrete_sound_w(space->machine->device("discrete"),DS_SOUND7_INP,data & 1); break; } } diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c index 066053e43e0..4fb238366be 100644 --- a/src/mame/audio/mcr.c +++ b/src/mame/audio/mcr.c @@ -108,7 +108,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config) /* SSIO */ if (mcr_sound_config & MCR_SSIO) { - ssio_sound_cpu = devtag_get_device(machine, "ssiocpu"); + ssio_sound_cpu = machine->device("ssiocpu"); ssio_compute_ay8910_modulation(machine); state_save_register_global_array(machine, ssio_data); state_save_register_global(machine, ssio_status); @@ -121,28 +121,28 @@ void mcr_sound_init(running_machine *machine, UINT8 config) /* Turbo Chip Squeak */ if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK) { - turbocs_sound_cpu = devtag_get_device(machine, "tcscpu"); + turbocs_sound_cpu = machine->device("tcscpu"); state_save_register_global(machine, turbocs_status); } /* Chip Squeak Deluxe */ if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE) { - csdeluxe_sound_cpu = devtag_get_device(machine, "csdcpu"); + csdeluxe_sound_cpu = machine->device("csdcpu"); state_save_register_global(machine, csdeluxe_status); } /* Sounds Good */ if (mcr_sound_config & MCR_SOUNDS_GOOD) { - soundsgood_sound_cpu = devtag_get_device(machine, "sgcpu"); + soundsgood_sound_cpu = machine->device("sgcpu"); state_save_register_global(machine, soundsgood_status); } /* Squawk n Talk */ if (mcr_sound_config & MCR_SQUAWK_N_TALK) { - squawkntalk_sound_cpu = devtag_get_device(machine, "sntcpu"); + squawkntalk_sound_cpu = machine->device("sntcpu"); state_save_register_global(machine, squawkntalk_tms_command); state_save_register_global(machine, squawkntalk_tms_strobes); } @@ -316,8 +316,8 @@ static TIMER_CALLBACK( ssio_delayed_data_w ) static void ssio_update_volumes(running_machine *machine) { - running_device *ay0 = devtag_get_device(machine, "ssio.1"); - running_device *ay1 = devtag_get_device(machine, "ssio.2"); + running_device *ay0 = machine->device("ssio.1"); + running_device *ay1 = machine->device("ssio.2"); ay8910_set_volume(ay0, 0, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][0]]); ay8910_set_volume(ay0, 1, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][1]]); ay8910_set_volume(ay0, 2, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][2]]); @@ -491,7 +491,7 @@ MACHINE_DRIVER_END static WRITE8_DEVICE_HANDLER( csdeluxe_porta_w ) { dacval = (dacval & ~0x3fc) | (data << 2); - dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6); + dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6); } static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w ) @@ -499,7 +499,7 @@ static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w ) UINT8 z_mask = pia6821_get_port_b_z_mask(device); dacval = (dacval & ~0x003) | (data >> 6); - dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6); + dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6); if (~z_mask & 0x10) csdeluxe_status = (csdeluxe_status & ~1) | ((data >> 4) & 1); if (~z_mask & 0x20) csdeluxe_status = (csdeluxe_status & ~2) | ((data >> 4) & 2); @@ -514,7 +514,7 @@ static WRITE_LINE_DEVICE_HANDLER( csdeluxe_irq ) static TIMER_CALLBACK( csdeluxe_delayed_data_w ) { - running_device *pia = devtag_get_device(machine, "csdpia"); + running_device *pia = machine->device("csdpia"); pia6821_portb_w(pia, 0, param & 0x0f); pia6821_ca1_w(pia, 0, ~param & 0x10); @@ -629,7 +629,7 @@ MACHINE_DRIVER_END static WRITE8_DEVICE_HANDLER( soundsgood_porta_w ) { dacval = (dacval & ~0x3fc) | (data << 2); - dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6); + dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6); } static WRITE8_DEVICE_HANDLER( soundsgood_portb_w ) @@ -637,7 +637,7 @@ static WRITE8_DEVICE_HANDLER( soundsgood_portb_w ) UINT8 z_mask = pia6821_get_port_b_z_mask(device); dacval = (dacval & ~0x003) | (data >> 6); - dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6); + dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6); if (~z_mask & 0x10) soundsgood_status = (soundsgood_status & ~1) | ((data >> 4) & 1); if (~z_mask & 0x20) soundsgood_status = (soundsgood_status & ~2) | ((data >> 4) & 2); @@ -652,7 +652,7 @@ static WRITE_LINE_DEVICE_HANDLER( soundsgood_irq ) static TIMER_CALLBACK( soundsgood_delayed_data_w ) { - running_device *pia = devtag_get_device(machine, "sgpia"); + running_device *pia = machine->device("sgpia"); pia6821_portb_w(pia, 0, (param >> 1) & 0x0f); pia6821_ca1_w(pia, 0, ~param & 0x01); @@ -737,13 +737,13 @@ MACHINE_DRIVER_END static WRITE8_DEVICE_HANDLER( turbocs_porta_w ) { dacval = (dacval & ~0x3fc) | (data << 2); - dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6); + dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6); } static WRITE8_DEVICE_HANDLER( turbocs_portb_w ) { dacval = (dacval & ~0x003) | (data >> 6); - dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6); + dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6); turbocs_status = (data >> 4) & 3; } @@ -756,7 +756,7 @@ static WRITE_LINE_DEVICE_HANDLER( turbocs_irq ) static TIMER_CALLBACK( turbocs_delayed_data_w ) { - running_device *pia = devtag_get_device(machine, "tcspia"); + running_device *pia = machine->device("tcspia"); pia6821_portb_w(pia, 0, (param >> 1) & 0x0f); pia6821_ca1_w(pia, 0, ~param & 0x01); @@ -853,7 +853,7 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_porta2_w ) static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w ) { - running_device *tms = devtag_get_device(device->machine, "sntspeech"); + running_device *tms = device->machine->device("sntspeech"); /* bits 0-1 select read/write strobes on the TMS5200 */ data &= 0x03; @@ -884,8 +884,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w ) static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq ) { - running_device *pia0 = devtag_get_device(device->machine, "sntpia0"); - running_device *pia1 = devtag_get_device(device->machine, "sntpia1"); + running_device *pia0 = device->machine->device("sntpia0"); + running_device *pia1 = device->machine->device("sntpia1"); int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1); cpu_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); @@ -893,7 +893,7 @@ static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq ) static TIMER_CALLBACK( squawkntalk_delayed_data_w ) { - running_device *pia0 = devtag_get_device(machine, "sntpia0"); + running_device *pia0 = machine->device("sntpia0"); pia6821_porta_w(pia0, 0, ~param & 0x0f); pia6821_cb1_w(pia0, 0, ~param & 0x10); diff --git a/src/mame/audio/meadows.c b/src/mame/audio/meadows.c index 1df49538c19..102a86b6536 100644 --- a/src/mame/audio/meadows.c +++ b/src/mame/audio/meadows.c @@ -60,7 +60,7 @@ SAMPLES_START( meadows_sh_start ) /************************************/ void meadows_sh_update(running_machine *machine) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); int preset, amp; if (latched_0c01 != meadows_0c01 || latched_0c03 != meadows_0c03) @@ -68,7 +68,7 @@ void meadows_sh_update(running_machine *machine) /* amplitude is a combination of the upper 4 bits of 0c01 */ /* and bit 4 merged from S2650's flag output */ amp = ((meadows_0c03 & ENABLE_CTR1) == 0) ? 0 : (meadows_0c01 & 0xf0) >> 1; - if( cpu_get_reg(devtag_get_device(machine, "maincpu"), S2650_FO) ) + if( cpu_get_reg(machine->device("maincpu"), S2650_FO) ) amp += 0x80; /* calculate frequency for counter #1 */ /* bit 0..3 of 0c01 are ctr preset */ @@ -104,9 +104,9 @@ void meadows_sh_update(running_machine *machine) dac_enable = meadows_0c03 & ENABLE_DAC; if (dac_enable) - dac_data_w(devtag_get_device(machine, "dac"), meadows_dac); + dac_data_w(machine->device("dac"), meadows_dac); else - dac_data_w(devtag_get_device(machine, "dac"), 0); + dac_data_w(machine->device("dac"), 0); } latched_0c01 = meadows_0c01; @@ -121,9 +121,9 @@ void meadows_sh_dac_w(running_machine *machine, int data) { meadows_dac = data; if (dac_enable) - dac_data_w(devtag_get_device(machine, "dac"), meadows_dac); + dac_data_w(machine->device("dac"), meadows_dac); else - dac_data_w(devtag_get_device(machine, "dac"), 0); + dac_data_w(machine->device("dac"), 0); } diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c index 103a88ecbd5..f788ac9500d 100644 --- a/src/mame/audio/micro3d.c +++ b/src/mame/audio/micro3d.c @@ -185,7 +185,7 @@ void micro3d_noise_sh_w(running_machine *machine, UINT8 data) if (~data & 8) { - running_device *device = devtag_get_device(machine, data & 4 ? "noise_2" : "noise_1"); + running_device *device = machine->device(data & 4 ? "noise_2" : "noise_1"); noise_state *nstate = (noise_state *)downcast(device)->token(); if (state->dac_data != nstate->dac[data & 3]) @@ -397,7 +397,7 @@ WRITE8_HANDLER( micro3d_sound_io_w ) } case 0x03: { - running_device *upd = devtag_get_device(space->machine, "upd7759"); + running_device *upd = space->machine->device("upd7759"); upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0); upd7759_reset_w(upd, (data & 0x10) ? 0 : 1); break; @@ -412,7 +412,7 @@ READ8_HANDLER( micro3d_sound_io_r ) switch (offset) { case 0x01: return (state->sound_port_latch[offset] & 0x7f) | input_port_read(space->machine, "SOUND_SW"); - case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(devtag_get_device(space->machine, "upd7759")) ? 0x08 : 0); + case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine->device("upd7759")) ? 0x08 : 0); default: return 0; } } diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c index 2987f36d370..903c0d2f002 100644 --- a/src/mame/audio/n8080.c +++ b/src/mame/audio/n8080.c @@ -159,13 +159,13 @@ static void stop_mono_flop( running_device *sn, int n ) static TIMER_CALLBACK( stop_mono_flop_callback ) { - stop_mono_flop(devtag_get_device(machine, "snsnd"), param); + stop_mono_flop(machine->device("snsnd"), param); } static void spacefev_sound_pins_changed( running_machine *machine ) { - running_device *sn = devtag_get_device(machine, "snsnd"); + running_device *sn = machine->device("snsnd"); n8080_state *state = (n8080_state *)machine->driver_data; UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins; @@ -191,14 +191,14 @@ static void spacefev_sound_pins_changed( running_machine *machine ) } if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5))) { - generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0); + generic_pulse_irq_line(machine->device("audiocpu"), 0); } } static void sheriff_sound_pins_changed( running_machine *machine ) { - running_device *sn = devtag_get_device(machine, "snsnd"); + running_device *sn = machine->device("snsnd"); n8080_state *state = (n8080_state *)machine->driver_data; UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins; @@ -216,7 +216,7 @@ static void sheriff_sound_pins_changed( running_machine *machine ) } if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5))) { - generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0); + generic_pulse_irq_line(machine->device("audiocpu"), 0); } } @@ -232,7 +232,7 @@ static void helifire_sound_pins_changed( running_machine *machine ) if (changes & (1 << 6)) { - generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0); + generic_pulse_irq_line(machine->device("audiocpu"), 0); } } @@ -403,14 +403,14 @@ static READ8_HANDLER( helifire_8035_p2_r ) static WRITE8_HANDLER( n8080_dac_w ) { - dac_data_w(devtag_get_device(space->machine, "dac"), data & 0x80); + dac_data_w(space->machine->device("dac"), data & 0x80); } static WRITE8_HANDLER( helifire_dac_w ) { n8080_state *state = (n8080_state *)space->machine->driver_data; - dac_data_w(devtag_get_device(space->machine, "dac"), data * state->helifire_dac_volume); + dac_data_w(space->machine->device("dac"), data * state->helifire_dac_volume); } @@ -437,7 +437,7 @@ static WRITE8_HANDLER( helifire_sound_ctrl_w ) static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer ) { - running_device *sn = devtag_get_device(timer.machine, "snsnd"); + running_device *sn = timer.machine->device("snsnd"); n8080_state *state = (n8080_state *)timer.machine->driver_data; double voltage = 0; diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c index 21f2dde38f7..56919988acb 100644 --- a/src/mame/audio/namco52.c +++ b/src/mame/audio/namco52.c @@ -210,7 +210,7 @@ static DEVICE_START( namco_52xx ) /* find the attached discrete sound device */ assert(intf->discrete != NULL); - state->discrete = devtag_get_device(device->machine, intf->discrete); + state->discrete = device->machine->device(intf->discrete); assert(state->discrete != NULL); state->basenode = intf->firstnode; diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c index d26e9e354c1..b62527a4fa9 100644 --- a/src/mame/audio/namco54.c +++ b/src/mame/audio/namco54.c @@ -174,7 +174,7 @@ static DEVICE_START( namco_54xx ) /* find the attached discrete sound device */ assert(config->discrete != NULL); - state->discrete = devtag_get_device(device->machine, config->discrete); + state->discrete = device->machine->device(config->discrete); assert(state->discrete != NULL); state->basenode = config->firstnode; } diff --git a/src/mame/audio/namcoc7x.c b/src/mame/audio/namcoc7x.c index 47f19a42a42..7536b9eda1f 100644 --- a/src/mame/audio/namcoc7x.c +++ b/src/mame/audio/namcoc7x.c @@ -88,7 +88,7 @@ void namcoc7x_on_driver_init(running_machine *machine) memset(pROM, 0, 4); // install speedup cheat - for (cpu = devtag_get_device(machine, "maincpu"); cpu != NULL; cpu = cpu->typenext()) + for (cpu = machine->device("maincpu"); cpu != NULL; cpu = cpu->typenext()) if (cpu->type() == M37702) memory_install_readwrite16_handler(cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w); } diff --git a/src/mame/audio/phoenix.c b/src/mame/audio/phoenix.c index fbeb4e8dd41..cfc39c837f9 100644 --- a/src/mame/audio/phoenix.c +++ b/src/mame/audio/phoenix.c @@ -511,7 +511,7 @@ WRITE8_DEVICE_HANDLER( phoenix_sound_control_b_w ) discrete_sound_w(device, PHOENIX_EFFECT_1_FREQ, data & 0x10); /* update the tune that the MM6221AA is playing */ - mm6221aa_tune_w(devtag_get_device(device->machine, "tms"), data >> 6); + mm6221aa_tune_w(device->machine->device("tms"), data >> 6); } static DEVICE_START( phoenix_sound ) diff --git a/src/mame/audio/pleiads.c b/src/mame/audio/pleiads.c index e4e5e861ec4..46fcb18c93c 100644 --- a/src/mame/audio/pleiads.c +++ b/src/mame/audio/pleiads.c @@ -436,7 +436,7 @@ WRITE8_HANDLER( pleiads_sound_control_b_w ) if (pitch == 3) pitch = 2; /* 2 and 3 are the same */ - tms36xx_note_w(devtag_get_device(space->machine, "tms"), pitch, note); + tms36xx_note_w(space->machine->device("tms"), pitch, note); stream_update(channel); sound_latch_b = data; diff --git a/src/mame/audio/polyplay.c b/src/mame/audio/polyplay.c index 8a26617defb..0d7d0270564 100644 --- a/src/mame/audio/polyplay.c +++ b/src/mame/audio/polyplay.c @@ -48,7 +48,7 @@ void polyplay_set_channel2(int active) void polyplay_play_channel1(running_machine *machine, int data) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); if (data) { freq1 = 2457600 / 16 / data / 8; sample_set_volume(samples, 0, channel_playing1 * 1.0); @@ -62,7 +62,7 @@ void polyplay_play_channel1(running_machine *machine, int data) void polyplay_play_channel2(running_machine *machine, int data) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); if (data) { freq2 = 2457600 / 16 / data / 8; sample_set_volume(samples, 1, channel_playing2 * 1.0); diff --git a/src/mame/audio/pulsar.c b/src/mame/audio/pulsar.c index 0a9ac0e8400..d1379113584 100644 --- a/src/mame/audio/pulsar.c +++ b/src/mame/audio/pulsar.c @@ -88,7 +88,7 @@ static int port1State = 0; WRITE8_HANDLER( pulsar_audio_1_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int bitsChanged; //int bitsGoneHigh; int bitsGoneLow; @@ -139,7 +139,7 @@ WRITE8_HANDLER( pulsar_audio_1_w ) WRITE8_HANDLER( pulsar_audio_2_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); static int port2State = 0; int bitsChanged; int bitsGoneHigh; diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c index 7da21179b93..60a9418ab15 100644 --- a/src/mame/audio/redalert.c +++ b/src/mame/audio/redalert.c @@ -170,13 +170,13 @@ WRITE8_HANDLER( redalert_voice_command_w ) static WRITE_LINE_DEVICE_HANDLER( sod_callback ) { - hc55516_digit_w(devtag_get_device(device->machine, "cvsd"), state); + hc55516_digit_w(device->machine->device("cvsd"), state); } static READ_LINE_DEVICE_HANDLER( sid_callback ) { - return hc55516_clock_state_r(devtag_get_device(device->machine, "cvsd")); + return hc55516_clock_state_r(device->machine->device("cvsd")); } @@ -309,8 +309,8 @@ static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r ) static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w ) { - running_device *ay1 = devtag_get_device(device->machine, "ay1"); - running_device *ay2 = devtag_get_device(device->machine, "ay2"); + running_device *ay1 = device->machine->device("ay1"); + running_device *ay2 = device->machine->device("ay2"); switch (ay8910_latch_1 & 0x03) { diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c index 15ec62d96b4..f1c4b09825a 100644 --- a/src/mame/audio/scramble.c +++ b/src/mame/audio/scramble.c @@ -79,7 +79,7 @@ READ8_DEVICE_HANDLER( frogger_portB_r ) WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w ) { - running_device *target = devtag_get_device(device->machine, "konami_7474"); + running_device *target = device->machine->device("konami_7474"); /* the complement of bit 3 is connected to the flip-flop's clock */ ttl7474_clock_w(target, (~data & 0x08) >> 3); @@ -90,7 +90,7 @@ WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w ) WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w ) { - running_device *target = devtag_get_device(device->machine, "konami_7474"); + running_device *target = device->machine->device("konami_7474"); /* the complement of bit 3 is connected to the flip-flop's clock */ ttl7474_clock_w(target, (~data & 0x08) >> 3); @@ -98,7 +98,7 @@ WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w ) static IRQ_CALLBACK(scramble_sh_irq_callback) { - running_device *target = devtag_get_device(device->machine, "konami_7474"); + running_device *target = device->machine->device("konami_7474"); /* interrupt acknowledge clears the flip-flop -- we need to pulse the CLR line because MAME's core never clears this @@ -144,27 +144,27 @@ static void filter_w(running_device *device, int data) WRITE8_HANDLER( scramble_filter_w ) { - filter_w(devtag_get_device(space->machine, "filter.1.0"), (offset >> 0) & 3); - filter_w(devtag_get_device(space->machine, "filter.1.1"), (offset >> 2) & 3); - filter_w(devtag_get_device(space->machine, "filter.1.2"), (offset >> 4) & 3); - filter_w(devtag_get_device(space->machine, "filter.0.0"), (offset >> 6) & 3); - filter_w(devtag_get_device(space->machine, "filter.0.1"), (offset >> 8) & 3); - filter_w(devtag_get_device(space->machine, "filter.0.2"), (offset >> 10) & 3); + filter_w(space->machine->device("filter.1.0"), (offset >> 0) & 3); + filter_w(space->machine->device("filter.1.1"), (offset >> 2) & 3); + filter_w(space->machine->device("filter.1.2"), (offset >> 4) & 3); + filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3); + filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3); + filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3); } WRITE8_HANDLER( frogger_filter_w ) { - filter_w(devtag_get_device(space->machine, "filter.0.0"), (offset >> 6) & 3); - filter_w(devtag_get_device(space->machine, "filter.0.1"), (offset >> 8) & 3); - filter_w(devtag_get_device(space->machine, "filter.0.2"), (offset >> 10) & 3); + filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3); + filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3); + filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3); } void scramble_sh_init(running_machine *machine) { - cpu_set_irq_callback(devtag_get_device(machine, "audiocpu"), scramble_sh_irq_callback); + cpu_set_irq_callback(machine->device("audiocpu"), scramble_sh_irq_callback); /* PR is always 0, D is always 1 */ - ttl7474_d_w(devtag_get_device(machine, "konami_7474"), 1); + ttl7474_d_w(machine->device("konami_7474"), 1); } diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c index 892c17f556d..01047395fa5 100644 --- a/src/mame/audio/segag80r.c +++ b/src/mame/audio/segag80r.c @@ -246,7 +246,7 @@ WRITE8_HANDLER( astrob_sound_w ) { 120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f }; - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); float freq_factor; UINT8 diff = data ^ sound_state[offset]; @@ -478,7 +478,7 @@ static SOUND_START( 005 ) static WRITE8_DEVICE_HANDLER( sega005_sound_a_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); UINT8 diff = data ^ sound_state[0]; sound_state[0] = data; @@ -706,7 +706,7 @@ static SOUND_START( spaceod ) WRITE8_HANDLER( spaceod_sound_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); UINT8 diff = data ^ sound_state[offset]; sound_state[offset] = data; @@ -891,7 +891,7 @@ static SOUND_START( monsterb ) static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w ) { - running_device *tms = devtag_get_device(device->machine, "music"); + running_device *tms = device->machine->device("music"); int enable_val; /* Lower four data lines get decoded into 13 control lines */ @@ -912,7 +912,7 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w ) static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); UINT8 diff = data ^ sound_state[1]; sound_state[1] = data; diff --git a/src/mame/audio/segag80v.c b/src/mame/audio/segag80v.c index 14c7f1a6fef..fb568f860ae 100644 --- a/src/mame/audio/segag80v.c +++ b/src/mame/audio/segag80v.c @@ -137,7 +137,7 @@ d0 crafts joining WRITE8_HANDLER( elim1_sh_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); data ^= 0xff; /* Play fireball sample */ @@ -171,7 +171,7 @@ WRITE8_HANDLER( elim1_sh_w ) WRITE8_HANDLER( elim2_sh_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); data ^= 0xff; /* Play thrust sample */ @@ -198,7 +198,7 @@ WRITE8_HANDLER( elim2_sh_w ) WRITE8_HANDLER( zektor1_sh_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); data ^= 0xff; @@ -233,7 +233,7 @@ WRITE8_HANDLER( zektor1_sh_w ) WRITE8_HANDLER( zektor2_sh_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); data ^= 0xff; /* Play thrust sample */ @@ -261,7 +261,7 @@ WRITE8_HANDLER( zektor2_sh_w ) WRITE8_HANDLER( spacfury1_sh_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); data ^= 0xff; /* craft growing */ @@ -298,7 +298,7 @@ WRITE8_HANDLER( spacfury1_sh_w ) WRITE8_HANDLER( spacfury2_sh_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); data ^= 0xff; /* craft joining */ diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c index c109568d060..c811df36ae5 100644 --- a/src/mame/audio/segasnd.c +++ b/src/mame/audio/segasnd.c @@ -645,7 +645,7 @@ static DEVICE_START( usb_sound ) int tchan, tgroup; /* find the CPU we are associated with */ - usb.cpu = devtag_get_device(machine, "usbcpu"); + usb.cpu = machine->device("usbcpu"); assert(usb.cpu != NULL); /* allocate work RAM */ diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c index 100d6d01056..d3cab0bd2c4 100644 --- a/src/mame/audio/seibu.c +++ b/src/mame/audio/seibu.c @@ -334,7 +334,7 @@ MACHINE_RESET( seibu_sound ) int romlength = memory_region_length(machine, "audiocpu"); UINT8 *rom = memory_region(machine, "audiocpu"); - sound_cpu = devtag_get_device(machine, "audiocpu"); + sound_cpu = machine->device("audiocpu"); update_irq_lines(machine, VECTOR_INIT); if (romlength > 0x10000) memory_configure_bank(machine, "bank1", 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000); diff --git a/src/mame/audio/senjyo.c b/src/mame/audio/senjyo.c index 4f1934261e7..6ff7d1d709b 100644 --- a/src/mame/audio/senjyo.c +++ b/src/mame/audio/senjyo.c @@ -59,7 +59,7 @@ WRITE8_HANDLER( senjyo_volume_w ) static TIMER_CALLBACK( senjyo_sh_update ) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); /* ctc2 timer single tone generator frequency */ z80ctc_device *ctc = machine->device("z80ctc"); diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c index 8ddbec56b25..845ed00772e 100644 --- a/src/mame/audio/snk6502.c +++ b/src/mame/audio/snk6502.c @@ -652,7 +652,7 @@ int snk6502_music0_playing(void) WRITE8_HANDLER( sasuke_sound_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); switch (offset) { case 0: @@ -718,7 +718,7 @@ WRITE8_HANDLER( sasuke_sound_w ) WRITE8_HANDLER( satansat_sound_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); switch (offset) { case 0: @@ -781,7 +781,7 @@ WRITE8_HANDLER( satansat_sound_w ) WRITE8_HANDLER( vanguard_sound_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); switch (offset) { case 0: @@ -827,7 +827,7 @@ WRITE8_HANDLER( vanguard_sound_w ) } /* SHOT B */ - sn76477_enable_w(devtag_get_device(space->machine, "sn76477.2"), (data & 0x40) ? 0 : 1); + sn76477_enable_w(space->machine->device("sn76477.2"), (data & 0x40) ? 0 : 1); LastPort1 = data; break; @@ -917,7 +917,7 @@ WRITE8_HANDLER( fantasy_sound_w ) } /* BOMB */ - discrete_sound_w(devtag_get_device(space->machine, "discrete"), FANTASY_BOMB_EN, data & 0x80); + discrete_sound_w(space->machine->device("discrete"), FANTASY_BOMB_EN, data & 0x80); LastPort1 = data; break; @@ -1034,7 +1034,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16 if ((data & HD38880_CTP) && (data & HD38880_CMV)) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); data &= HD68880_SYBS; switch (hd38880_cmd) @@ -1053,7 +1053,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16 { if (table[i] && table[i] == hd38880_addr) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); sample_start(samples, 0, start + i, 0); break; } diff --git a/src/mame/audio/spacefb.c b/src/mame/audio/spacefb.c index e32b943a353..0a12b7b8c52 100644 --- a/src/mame/audio/spacefb.c +++ b/src/mame/audio/spacefb.c @@ -36,7 +36,7 @@ READ8_HANDLER( spacefb_audio_t1_r ) WRITE8_HANDLER( spacefb_port_1_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/audio/starwars.c b/src/mame/audio/starwars.c index c56a3f62da6..042c0e6700d 100644 --- a/src/mame/audio/starwars.c +++ b/src/mame/audio/starwars.c @@ -21,7 +21,7 @@ static running_device *riot; SOUND_START( starwars ) { - riot = devtag_get_device(machine, "riot"); + riot = machine->device("riot"); } @@ -46,7 +46,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r ) /* Note: bit 4 is always set to avoid sound self test */ UINT8 olddata = riot6532_porta_in_get(device); - return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(devtag_get_device(device->machine, "tms")) << 2); + return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine->device("tms")) << 2); } diff --git a/src/mame/audio/t5182.c b/src/mame/audio/t5182.c index f3400ea590f..6ae283d17c6 100644 --- a/src/mame/audio/t5182.c +++ b/src/mame/audio/t5182.c @@ -191,7 +191,7 @@ static TIMER_CALLBACK( setirq_callback ) break; } - cpu = devtag_get_device(machine, CPUTAG_T5182); + cpu = machine->device(CPUTAG_T5182); if (cpu == NULL) return; diff --git a/src/mame/audio/taito_en.c b/src/mame/audio/taito_en.c index c6abeb55430..e2890421f4c 100644 --- a/src/mame/audio/taito_en.c +++ b/src/mame/audio/taito_en.c @@ -48,7 +48,7 @@ static WRITE16_HANDLER( f3_es5505_bank_w ) /* mask out unused bits */ data &= max_banks_this_game; - es5505_voice_bank_w(devtag_get_device(space->machine, "ensoniq"),offset,data<<20); + es5505_voice_bank_w(space->machine->device("ensoniq"),offset,data<<20); } static WRITE16_HANDLER( f3_volume_w ) @@ -74,7 +74,7 @@ static TIMER_DEVICE_CALLBACK( taito_en_timer_callback ) /* Only cause IRQ if the mask is set to allow it */ if (m68681_imr & 0x08) { - cpu_set_input_line_vector(devtag_get_device(timer.machine, "audiocpu"), 6, vector_reg); + cpu_set_input_line_vector(timer.machine->device("audiocpu"), 6, vector_reg); cputag_set_input_line(timer.machine, "audiocpu", 6, ASSERT_LINE); imr_status |= 0x08; } diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c index a69e6b9698e..b6e7924c20f 100644 --- a/src/mame/audio/taitosnd.c +++ b/src/mame/audio/taitosnd.c @@ -290,8 +290,8 @@ static DEVICE_START( tc0140syt ) const tc0140syt_interface *intf = get_interface(device); /* use the given gfx set */ - tc0140syt->mastercpu = devtag_get_device(device->machine, intf->master); - tc0140syt->slavecpu = devtag_get_device(device->machine, intf->slave); + tc0140syt->mastercpu = device->machine->device(intf->master); + tc0140syt->slavecpu = device->machine->device(intf->slave); state_save_register_device_item(device, 0, tc0140syt->mainmode); state_save_register_device_item(device, 0, tc0140syt->submode); diff --git a/src/mame/audio/targ.c b/src/mame/audio/targ.c index 846f299b507..fecd46b1179 100644 --- a/src/mame/audio/targ.c +++ b/src/mame/audio/targ.c @@ -61,11 +61,11 @@ static void adjust_sample(running_device *samples, UINT8 freq) WRITE8_HANDLER( targ_audio_1_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); /* CPU music */ if ((data & 0x01) != (port_1_last & 0x01)) - dac_data_w(devtag_get_device(space->machine, "dac"),(data & 0x01) * 0xff); + dac_data_w(space->machine->device("dac"),(data & 0x01) * 0xff); /* shot */ if (FALLING_EDGE(0x02) && !sample_playing(samples, 0)) sample_start(samples, 0,1,0); @@ -114,7 +114,7 @@ WRITE8_HANDLER( targ_audio_2_w ) { if ((data & 0x01) && !(port_2_last & 0x01)) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); UINT8 *prom = memory_region(space->machine, "targ"); tone_pointer = (tone_pointer + 1) & 0x0f; @@ -128,7 +128,7 @@ WRITE8_HANDLER( targ_audio_2_w ) WRITE8_HANDLER( spectar_audio_2_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); adjust_sample(samples, data); } @@ -147,7 +147,7 @@ static const char *const sample_names[] = static void common_audio_start(running_machine *machine, int freq) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); max_freq = freq; tone_freq = 0; diff --git a/src/mame/audio/timeplt.c b/src/mame/audio/timeplt.c index 35d49476c86..917f623a423 100644 --- a/src/mame/audio/timeplt.c +++ b/src/mame/audio/timeplt.c @@ -31,12 +31,12 @@ static SOUND_START( timeplt ) timeplt_state *state = (timeplt_state *)machine->driver_data; state->soundcpu = machine->device("tpsound"); - state->filter_0_0 = devtag_get_device(machine, "filter.0.0"); - state->filter_0_1 = devtag_get_device(machine, "filter.0.1"); - state->filter_0_2 = devtag_get_device(machine, "filter.0.2"); - state->filter_1_0 = devtag_get_device(machine, "filter.1.0"); - state->filter_1_1 = devtag_get_device(machine, "filter.1.1"); - state->filter_1_2 = devtag_get_device(machine, "filter.1.2"); + state->filter_0_0 = machine->device("filter.0.0"); + state->filter_0_1 = machine->device("filter.0.1"); + state->filter_0_2 = machine->device("filter.0.2"); + state->filter_1_0 = machine->device("filter.1.0"); + state->filter_1_1 = machine->device("filter.1.1"); + state->filter_1_2 = machine->device("filter.1.2"); state->last_irq_state = 0; state_save_register_global(machine, state->last_irq_state); diff --git a/src/mame/audio/turbo.c b/src/mame/audio/turbo.c index 50115650659..7fe9e42bb81 100644 --- a/src/mame/audio/turbo.c +++ b/src/mame/audio/turbo.c @@ -40,7 +40,7 @@ static int last_sound_a; static TIMER_CALLBACK( update_sound_a ) { - running_device *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = machine->device("discrete"); int data = param; /* missing short crash sample, but I've never seen it triggered */ @@ -73,7 +73,7 @@ if (!((data >> 4) & 1)) mame_printf_debug("/TRIG4\n"); WRITE8_DEVICE_HANDLER( turbo_sound_a_w ) { #if (!DISCRETE_TEST) - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); #endif turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[0]; @@ -123,7 +123,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w ) WRITE8_DEVICE_HANDLER( turbo_sound_b_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -146,7 +146,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w ) WRITE8_DEVICE_HANDLER( turbo_sound_c_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; /* OSEL1-2 */ @@ -327,7 +327,7 @@ INLINE void subroc3d_update_volume(running_device *samples, int leftchan, UINT8 WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -383,7 +383,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w ) WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[2]; state->sound_state[2] = data; @@ -508,7 +508,7 @@ static void buckrog_update_samples(turbo_state *state, running_device *samples) WRITE8_DEVICE_HANDLER( buckrog_sound_a_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[0]; state->sound_state[0] = data; @@ -534,7 +534,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w ) WRITE8_DEVICE_HANDLER( buckrog_sound_b_w ) { - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c index 60a9fc5740d..bd3954935f0 100644 --- a/src/mame/audio/tx1.c +++ b/src/mame/audio/tx1.c @@ -412,8 +412,8 @@ WRITE8_DEVICE_HANDLER( bb_ym2_a_w ) WRITE8_DEVICE_HANDLER( bb_ym2_b_w ) { - running_device *ym1 = devtag_get_device(device->machine, "ym1"); - running_device *ym2 = devtag_get_device(device->machine, "ym2"); + running_device *ym1 = device->machine->device("ym1"); + running_device *ym2 = device->machine->device("ym2"); double gain; stream_update(stream); diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c index e44fe4cedb3..227e3aadca6 100644 --- a/src/mame/audio/vicdual.c +++ b/src/mame/audio/vicdual.c @@ -132,7 +132,7 @@ MACHINE_DRIVER_END static TIMER_CALLBACK( frogs_croak_callback ) { - running_device *samples = devtag_get_device(machine, "samples"); + running_device *samples = machine->device("samples"); sample_stop(samples, 2); } @@ -145,8 +145,8 @@ MACHINE_START( frogs_audio ) WRITE8_HANDLER( frogs_audio_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *samples = space->machine->device("samples"); + running_device *discrete = space->machine->device("discrete"); static int last_croak = 0; static int last_buzzz = 0; int new_croak = data & 0x08; @@ -462,7 +462,7 @@ MACHINE_DRIVER_END WRITE8_HANDLER( headon_audio_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); if (discrete == NULL) return; discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01); @@ -477,7 +477,7 @@ WRITE8_HANDLER( headon_audio_w ) WRITE8_HANDLER( invho2_audio_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); if (discrete == NULL) return; discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10); diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c index f543fd1b6ea..d8ce2e468c0 100644 --- a/src/mame/audio/williams.c +++ b/src/mame/audio/williams.c @@ -270,7 +270,7 @@ void williams_cvsd_init(running_machine *machine) int bank; /* configure the CPU */ - sound_cpu = devtag_get_device(machine, "cvsdcpu"); + sound_cpu = machine->device("cvsdcpu"); soundalt_cpu = NULL; /* configure master CPU banks */ @@ -288,7 +288,7 @@ void williams_cvsd_init(running_machine *machine) memory_set_bank(machine, "bank5", 0); /* reset the IRQ state */ - pia6821_ca1_w(devtag_get_device(machine, "cvsdpia"), 0, 1); + pia6821_ca1_w(machine->device("cvsdpia"), 0, 1); /* register for save states */ state_save_register_global(machine, williams_sound_int_state); @@ -302,8 +302,8 @@ void williams_narc_init(running_machine *machine) int bank; /* configure the CPU */ - sound_cpu = devtag_get_device(machine, "narc1cpu"); - soundalt_cpu = devtag_get_device(machine, "narc2cpu"); + sound_cpu = machine->device("narc1cpu"); + soundalt_cpu = machine->device("narc2cpu"); /* configure master CPU banks */ ROM = memory_region(machine, "narc1cpu"); @@ -345,7 +345,7 @@ void williams_adpcm_init(running_machine *machine) UINT8 *ROM; /* configure the CPU */ - sound_cpu = devtag_get_device(machine, "adpcm"); + sound_cpu = machine->device("adpcm"); soundalt_cpu = NULL; /* configure banks */ @@ -407,7 +407,7 @@ static void init_audio_state(running_machine *machine) static void cvsd_ym2151_irq(running_device *device, int state) { - pia6821_ca1_w(devtag_get_device(device->machine, "cvsdpia"), 0, !state); + pia6821_ca1_w(device->machine->device("cvsdpia"), 0, !state); } @@ -471,7 +471,7 @@ static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w ) static TIMER_CALLBACK( williams_cvsd_delayed_data_w ) { - running_device *pia = devtag_get_device(machine, "cvsdpia"); + running_device *pia = machine->device("cvsdpia"); pia6821_portb_w(pia, 0, param & 0xff); pia6821_cb1_w(pia, 0, (param >> 8) & 1); pia6821_cb2_w(pia, 0, (param >> 9) & 1); diff --git a/src/mame/audio/wow.c b/src/mame/audio/wow.c index 319b3a4224c..e48bbe9b697 100644 --- a/src/mame/audio/wow.c +++ b/src/mame/audio/wow.c @@ -108,7 +108,7 @@ static int plural; READ8_HANDLER( wow_speech_r ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int Phoneme/*, Intonation*/; int i = 0; @@ -177,6 +177,6 @@ READ8_HANDLER( wow_speech_r ) CUSTOM_INPUT( wow_speech_status_r ) { - running_device *samples = devtag_get_device(field->port->machine, "samples"); + running_device *samples = field->port->machine->device("samples"); return !sample_playing(samples, 0); } diff --git a/src/mame/audio/zaxxon.c b/src/mame/audio/zaxxon.c index 7d233fae338..5064aeed964 100644 --- a/src/mame/audio/zaxxon.c +++ b/src/mame/audio/zaxxon.c @@ -114,7 +114,7 @@ MACHINE_DRIVER_END WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); UINT8 diff = data ^ state->sound_state[0]; state->sound_state[0] = data; @@ -150,7 +150,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w ) WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -168,7 +168,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w ) WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); UINT8 diff = data ^ state->sound_state[2]; state->sound_state[2] = data; @@ -226,7 +226,7 @@ MACHINE_DRIVER_END WRITE8_DEVICE_HANDLER( congo_sound_b_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -240,7 +240,7 @@ WRITE8_DEVICE_HANDLER( congo_sound_b_w ) WRITE8_DEVICE_HANDLER( congo_sound_c_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - running_device *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = device->machine->device("samples"); UINT8 diff = data ^ state->sound_state[2]; state->sound_state[2] = data; diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c index 861043e866d..751d3557144 100644 --- a/src/mame/drivers/1942.c +++ b/src/mame/drivers/1942.c @@ -238,7 +238,7 @@ static MACHINE_START( 1942 ) { _1942_state *state = (_1942_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->palette_bank); state_save_register_global_array(machine, state->scroll); diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c index b7f50b35791..372177e59cf 100644 --- a/src/mame/drivers/20pacgal.c +++ b/src/mame/drivers/20pacgal.c @@ -280,8 +280,8 @@ static MACHINE_START( 20pacgal ) { _20pacgal_state *state = (_20pacgal_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->eeprom = devtag_get_device(machine, "eeprom"); + state->maincpu = machine->device("maincpu"); + state->eeprom = machine->device("eeprom"); state_save_register_global(machine, state->game_selected); state_save_register_global_pointer(machine, state->ram_48000, 0x2000); diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c index 16efec1f04c..5a7daeca0df 100644 --- a/src/mame/drivers/2mindril.c +++ b/src/mame/drivers/2mindril.c @@ -429,7 +429,7 @@ static MACHINE_START( drill ) { _2mindril_state *state = (_2mindril_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->defender_sensor); state_save_register_global(machine, state->shutter_sensor); diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c index e32c41dbb08..2914fb8f98f 100644 --- a/src/mame/drivers/40love.c +++ b/src/mame/drivers/40love.c @@ -999,8 +999,8 @@ static MACHINE_START( common ) { buggychl_state *state = (buggychl_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); /* video */ state_save_register_global(machine, state->pix1); diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c index 27deabd8d72..052fa9897a0 100644 --- a/src/mame/drivers/5clown.c +++ b/src/mame/drivers/5clown.c @@ -1228,7 +1228,7 @@ static DRIVER_INIT( fclown ) /* Assigning AY-3-8910 sound device */ - ay8910 = devtag_get_device(machine, "ay8910"); + ay8910 = machine->device("ay8910"); } diff --git a/src/mame/drivers/86lions.c b/src/mame/drivers/86lions.c index 9bc3fd4a91a..b6471b143d8 100644 --- a/src/mame/drivers/86lions.c +++ b/src/mame/drivers/86lions.c @@ -76,13 +76,13 @@ static READ8_HANDLER( test_r ) static READ8_HANDLER(lions_via_r) { - running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = space->machine->device("via6522_0"); return via_r(via_0, offset); } static WRITE8_HANDLER(lions_via_w) { - running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = space->machine->device("via6522_0"); via_w(via_0, offset, data); } diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c index ce10fbe9113..941eb0d6fcd 100644 --- a/src/mame/drivers/88games.c +++ b/src/mame/drivers/88games.c @@ -317,12 +317,12 @@ static MACHINE_START( 88games ) { _88games_state *state = (_88games_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k051316 = devtag_get_device(machine, "k051316"); - state->upd_1 = devtag_get_device(machine, "upd1"); - state->upd_2 = devtag_get_device(machine, "upd2"); + state->audiocpu = machine->device("audiocpu"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); + state->k051316 = machine->device("k051316"); + state->upd_1 = machine->device("upd1"); + state->upd_2 = machine->device("upd2"); state_save_register_global(machine, state->videobank); state_save_register_global(machine, state->zoomreadroms); @@ -337,7 +337,7 @@ static MACHINE_RESET( 88games ) { _88games_state *state = (_88games_state *)machine->driver_data; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), k88games_banking); + konami_configure_set_lines(machine->device("maincpu"), k88games_banking); machine->generic.paletteram.u8 = &memory_region(machine, "maincpu")[0x20000]; state->videobank = 0; diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c index c3ba6bd2865..c28d2ef4cbe 100644 --- a/src/mame/drivers/acommand.c +++ b/src/mame/drivers/acommand.c @@ -293,10 +293,10 @@ static READ16_HANDLER(ac_devices_r) return input_port_read(space->machine, "IN0"); case 0x0014/2: case 0x0016/2: - return okim6295_r(devtag_get_device(space->machine, "oki1"),0); + return okim6295_r(space->machine->device("oki1"),0); case 0x0018/2: case 0x001a/2: - return okim6295_r(devtag_get_device(space->machine, "oki2"),0); + return okim6295_r(space->machine->device("oki2"),0); case 0x0040/2: /* "Upper switch / Under Switch" @@ -385,12 +385,12 @@ static WRITE16_HANDLER(ac_devices_w) case 0x14/2: case 0x16/2: if(ACCESSING_BITS_0_7) - okim6295_w(devtag_get_device(space->machine, "oki1"),0,data); + okim6295_w(space->machine->device("oki1"),0,data); break; case 0x18/2: case 0x1a/2: if(ACCESSING_BITS_0_7) - okim6295_w(devtag_get_device(space->machine, "oki2"),0,data); + okim6295_w(space->machine->device("oki2"),0,data); break; case 0x1c/2: /*IRQ mask?*/ diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c index 8caeb9ec022..44f93e567c5 100644 --- a/src/mame/drivers/actfancr.c +++ b/src/mame/drivers/actfancr.c @@ -280,8 +280,8 @@ static MACHINE_START( actfancr ) { actfancr_state *state = (actfancr_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_START( triothep ) diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c index cd4cfd1d61f..8185cd87b5c 100644 --- a/src/mame/drivers/adp.c +++ b/src/mame/drivers/adp.c @@ -206,9 +206,9 @@ static MACHINE_START( skattv ) adp_state *state = (adp_state *)machine->driver_data; microtouch_init(machine, microtouch_tx, 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->duart = devtag_get_device(machine, "duart68681"); - state->hd63484 = devtag_get_device(machine, "hd63484"); + state->maincpu = machine->device("maincpu"); + state->duart = machine->device("duart68681"); + state->hd63484 = machine->device("hd63484"); state_save_register_global(machine, state->mux_data); state_save_register_global(machine, state->register_active); @@ -227,7 +227,7 @@ static MACHINE_START( skattv ) UINT16 *rom = (UINT16*)memory_region(machine, "gfx1"); int i; - running_device *hd63484 = devtag_get_device(machine, "hd63484"); + running_device *hd63484 = machine->device("hd63484"); for(i = 0; i < 0x40000/2; ++i) { diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c index d50d07f4fbe..0d52e89129e 100644 --- a/src/mame/drivers/aerofgt.c +++ b/src/mame/drivers/aerofgt.c @@ -1301,7 +1301,7 @@ static MACHINE_START( common ) { aerofgt_state *state = (aerofgt_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->pending_command); } diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c index 22665d69e63..f514be6a289 100644 --- a/src/mame/drivers/airbustr.c +++ b/src/mame/drivers/airbustr.c @@ -587,10 +587,10 @@ static MACHINE_START( airbustr ) memory_configure_bank(machine, "bank3", 0, 3, &AUDIO[0x00000], 0x4000); memory_configure_bank(machine, "bank3", 3, 5, &AUDIO[0x10000], 0x4000); - state->master = devtag_get_device(machine, "master"); - state->slave = devtag_get_device(machine, "slave"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->pandora = devtag_get_device(machine, "pandora"); + state->master = machine->device("master"); + state->slave = machine->device("slave"); + state->audiocpu = machine->device("audiocpu"); + state->pandora = machine->device("pandora"); state_save_register_global(machine, state->soundlatch_status); state_save_register_global(machine, state->soundlatch2_status); diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c index 46482ae3b43..431f31b7073 100644 --- a/src/mame/drivers/alg.c +++ b/src/mame/drivers/alg.c @@ -86,7 +86,7 @@ static VIDEO_START( alg ) static MACHINE_START( alg ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); serial_timer = timer_alloc(machine, response_timer, NULL); serial_timer_active = FALSE; diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c index e0cf7bc6336..a49d7a79018 100644 --- a/src/mame/drivers/aliens.c +++ b/src/mame/drivers/aliens.c @@ -243,11 +243,11 @@ static MACHINE_START( aliens ) memory_configure_bank(machine, "bank1", 0, 20, &ROM[0x10000], 0x2000); memory_set_bank(machine, "bank1", 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007232 = devtag_get_device(machine, "k007232"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k007232 = machine->device("k007232"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); state_save_register_global(machine, state->palette_selected); } @@ -256,7 +256,7 @@ static MACHINE_RESET( aliens ) { aliens_state *state = (aliens_state *)machine->driver_data; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), aliens_banking); + konami_configure_set_lines(machine->device("maincpu"), aliens_banking); state->palette_selected = 0; } diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c index b20518c0820..332426ac809 100644 --- a/src/mame/drivers/alpha68k.c +++ b/src/mame/drivers/alpha68k.c @@ -1854,7 +1854,7 @@ static MACHINE_START( common ) { alpha68k_state *state = (alpha68k_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->trigstate); state_save_register_global(machine, state->deposits1); diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c index cdcdbda091c..968e4a941fb 100644 --- a/src/mame/drivers/amspdwy.c +++ b/src/mame/drivers/amspdwy.c @@ -254,7 +254,7 @@ static MACHINE_START( amspdwy ) { amspdwy_state *state = (amspdwy_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->flipscreen); state_save_register_global_array(machine, state->wheel_old); diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c index 91cf36a662c..4a989400979 100644 --- a/src/mame/drivers/angelkds.c +++ b/src/mame/drivers/angelkds.c @@ -579,7 +579,7 @@ static MACHINE_START( angelkds ) { angelkds_state *state = (angelkds_state *)machine->driver_data; - state->subcpu = devtag_get_device(machine, "sub"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->layer_ctrl); state_save_register_global(machine, state->txbank); diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c index 0d23fae8409..14679ae449f 100644 --- a/src/mame/drivers/appoooh.c +++ b/src/mame/drivers/appoooh.c @@ -404,7 +404,7 @@ static MACHINE_START( appoooh ) { appoooh_state *state = (appoooh_state *)machine->driver_data; - state->adpcm = devtag_get_device(machine, "msm"); + state->adpcm = machine->device("msm"); state_save_register_global(machine, state->adpcm_data); state_save_register_global(machine, state->adpcm_address); diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c index 2018d1d1bf5..69913cbd788 100644 --- a/src/mame/drivers/aquarium.c +++ b/src/mame/drivers/aquarium.c @@ -342,7 +342,7 @@ static MACHINE_START( aquarium ) { aquarium_state *state = (aquarium_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->aquarium_snd_ack); } diff --git a/src/mame/drivers/arcadecl.c b/src/mame/drivers/arcadecl.c index 185b27c60cd..c479748e89c 100644 --- a/src/mame/drivers/arcadecl.c +++ b/src/mame/drivers/arcadecl.c @@ -92,7 +92,7 @@ static void scanline_update(screen_device &screen, int scanline) { /* generate 32V signals */ if ((scanline & 32) == 0) - atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu")); + atarigen_scanline_int_gen(screen.machine->device("maincpu")); } diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c index 7458f799599..e09c93fa833 100644 --- a/src/mame/drivers/aristmk4.c +++ b/src/mame/drivers/aristmk4.c @@ -380,13 +380,13 @@ static READ8_DEVICE_HANDLER(via_a_r) if (ay8910_1&0x03) // SW1 read. { - psg_ret = ay8910_r(devtag_get_device(device->machine, "ay1"), 0); + psg_ret = ay8910_r(device->machine->device("ay1"), 0); //logerror("PSG porta ay1 returned %02X\n",psg_ret); } else if (ay8910_2&0x03) //i don't think we read anything from Port A on ay2, Can be removed once game works ok. { - psg_ret = ay8910_r(devtag_get_device(device->machine, "ay2"), 0); + psg_ret = ay8910_r(device->machine->device("ay2"), 0); //logerror("PSG porta ay2 returned %02X\n",psg_ret); } return psg_ret; @@ -493,14 +493,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w) case 0x06: //WRITE { - ay8910_data_w( devtag_get_device(device->machine, "ay1"), 0 , psg_data ); + ay8910_data_w( device->machine->device("ay1"), 0 , psg_data ); //logerror("VIA Port A write data ay1: %02X\n",psg_data); break; } case 0x07: //LATCH Address (set register) { - ay8910_address_w( devtag_get_device(device->machine, "ay1"), 0 , psg_data ); + ay8910_address_w( device->machine->device("ay1"), 0 , psg_data ); //logerror("VIA Port B write register ay1: %02X\n",psg_data); break; } @@ -526,14 +526,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w) case 0x06: //WRITE { - ay8910_data_w( devtag_get_device(device->machine, "ay2"), 0 , psg_data ); + ay8910_data_w( device->machine->device("ay2"), 0 , psg_data ); //logerror("VIA Port A write data ay2: %02X\n",psg_data); break; } case 0x07: //LATCH Address (set register) { - ay8910_address_w( devtag_get_device(device->machine, "ay2"), 0 , psg_data ); + ay8910_address_w( device->machine->device("ay2"), 0 , psg_data ); //logerror("VIA Port B write register ay2: %02X\n",psg_data); break; } @@ -1142,7 +1142,7 @@ static DRIVER_INIT( aristmk4 ) static MACHINE_START( aristmk4 ) { - samples = devtag_get_device(machine, "samples"); + samples = machine->device("samples"); state_save_register_global_pointer(machine, nvram,0x1000); // nvram } @@ -1153,10 +1153,10 @@ static MACHINE_RESET( aristmk4 ) switch(input_port_read(machine, "LK13")) // cpu speed cotrol.. 3mhz or 1.5mhz { case 0x00: - cpu_set_clock(devtag_get_device(machine, "maincpu"), MAIN_CLOCK/4); // 3 Mhz + cpu_set_clock(machine->device("maincpu"), MAIN_CLOCK/4); // 3 Mhz break; case 0x10: - cpu_set_clock(devtag_get_device(machine, "maincpu"), MAIN_CLOCK/8); // 1.5 Mhz + cpu_set_clock(machine->device("maincpu"), MAIN_CLOCK/8); // 1.5 Mhz break; } diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c index 10920c6bf9b..094ade1f7e6 100644 --- a/src/mame/drivers/aristmk5.c +++ b/src/mame/drivers/aristmk5.c @@ -45,7 +45,7 @@ static MACHINE_START( aristmk5 ) archimedes_init(machine); // reset the DAC to centerline - dac_signed_data_w(devtag_get_device(machine, "dac"), 0x80); + dac_signed_data_w(machine->device("dac"), 0x80); } static MACHINE_RESET( aristmk5 ) diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c index 86fc09e0d01..eccd64ae86b 100644 --- a/src/mame/drivers/arkanoid.c +++ b/src/mame/drivers/arkanoid.c @@ -910,7 +910,7 @@ static MACHINE_START( arkanoid ) { arkanoid_state *state = (arkanoid_state *)machine->driver_data; - state->mcu = devtag_get_device(machine, "mcu"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->bootleg_cmd); diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c index 10336a76c99..62c00e2c2f0 100644 --- a/src/mame/drivers/artmagic.c +++ b/src/mame/drivers/artmagic.c @@ -106,13 +106,13 @@ static MACHINE_RESET( artmagic ) static READ16_HANDLER( tms_host_r ) { - return tms34010_host_r(devtag_get_device(space->machine, "tms"), offset); + return tms34010_host_r(space->machine->device("tms"), offset); } static WRITE16_HANDLER( tms_host_w ) { - tms34010_host_w(devtag_get_device(space->machine, "tms"), offset, data); + tms34010_host_w(space->machine->device("tms"), offset, data); } diff --git a/src/mame/drivers/ashnojoe.c b/src/mame/drivers/ashnojoe.c index 1f83a5f5139..5839a7f53c9 100644 --- a/src/mame/drivers/ashnojoe.c +++ b/src/mame/drivers/ashnojoe.c @@ -334,7 +334,7 @@ static MACHINE_START( ashnojoe ) { ashnojoe_state *state = (ashnojoe_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->adpcm_byte); state_save_register_global(machine, state->soundlatch_status); diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c index eaba6bad17d..d77ff3b20e8 100644 --- a/src/mame/drivers/asterix.c +++ b/src/mame/drivers/asterix.c @@ -253,12 +253,12 @@ static MACHINE_START( asterix ) { asterix_state *state = (asterix_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053260 = devtag_get_device(machine, "k053260"); - state->k056832 = devtag_get_device(machine, "k056832"); - state->k053244 = devtag_get_device(machine, "k053244"); - state->k053251 = devtag_get_device(machine, "k053251"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053260 = machine->device("k053260"); + state->k056832 = machine->device("k056832"); + state->k053244 = machine->device("k053244"); + state->k053251 = machine->device("k053251"); state_save_register_global(machine, state->cur_control2); state_save_register_global_array(machine, state->prot); diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c index e681ee29cdb..31acabe2fd6 100644 --- a/src/mame/drivers/astinvad.c +++ b/src/mame/drivers/astinvad.c @@ -228,10 +228,10 @@ static MACHINE_START( kamikaze ) { astinvad_state *state = (astinvad_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->ppi8255_0 = devtag_get_device(machine, "ppi8255_0"); - state->ppi8255_1 = devtag_get_device(machine, "ppi8255_1"); - state->samples = devtag_get_device(machine, "samples"); + state->maincpu = machine->device("maincpu"); + state->ppi8255_0 = machine->device("ppi8255_0"); + state->ppi8255_1 = machine->device("ppi8255_1"); + state->samples = machine->device("samples"); state->int_timer = timer_alloc(machine, kamizake_int_gen, NULL); timer_adjust_oneshot(state->int_timer, machine->primary_screen->time_until_pos(128), 128); @@ -256,8 +256,8 @@ static MACHINE_START( spaceint ) { astinvad_state *state = (astinvad_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->samples = devtag_get_device(machine, "samples"); + state->maincpu = machine->device("maincpu"); + state->samples = machine->device("samples"); state_save_register_global(machine, state->screen_flip); state_save_register_global_array(machine, state->sound_state); diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c index f400948ce03..b5d970171cc 100644 --- a/src/mame/drivers/astrocde.c +++ b/src/mame/drivers/astrocde.c @@ -207,7 +207,7 @@ static WRITE8_HANDLER( seawolf2_lamps_w ) static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40 { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); UINT8 rising_bits = data & ~port_1_last; port_1_last = data; @@ -222,7 +222,7 @@ static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40 static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41 { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); UINT8 rising_bits = data & ~port_2_last; port_2_last = data; @@ -337,8 +337,8 @@ static READ8_HANDLER( gorf_io_1_r ) case 4: astrocade_sparkle[2] = data; break; case 5: astrocade_sparkle[3] = data; break; case 6: - sound_set_output_gain(devtag_get_device(space->machine, "astrocade1"), 0, data ? 0.0 : 1.0); - sound_set_output_gain(devtag_get_device(space->machine, "samples"), 0, data ? 1.0 : 0.0); + sound_set_output_gain(space->machine->device("astrocade1"), 0, data ? 0.0 : 1.0); + sound_set_output_gain(space->machine->device("samples"), 0, data ? 1.0 : 0.0); break; case 7: mame_printf_debug("io_1:%d\n", data); break; } diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c index 5812a7ba154..1deaeb3354e 100644 --- a/src/mame/drivers/astrocorp.c +++ b/src/mame/drivers/astrocorp.c @@ -237,10 +237,10 @@ static WRITE16_HANDLER( skilldrp_outputs_w ) coin_counter_w(space->machine, 0, (data & 0x0001)); // key in | coin_counter_w(space->machine, 0, (data & 0x0002)); // coin in |- manual shows 1 in- and 1 out- counter coin_counter_w(space->machine, 1, (data & 0x0004)); // key out | - ticket_dispenser_w(devtag_get_device(space->machine, "hopper"), 0, (data & 0x0008)<<4); // hopper motor? + ticket_dispenser_w(space->machine->device("hopper"), 0, (data & 0x0008)<<4); // hopper motor? // (data & 0x0010) // hopper? set_led_status(space->machine, 0, (data & 0x0020)); // error lamp (coin/hopper jam: "call attendant") - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, data & 0x0080); // ticket motor? + ticket_dispenser_w(space->machine->device("ticket"), 0, data & 0x0080); // ticket motor? } if (ACCESSING_BITS_8_15) { diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c index 1df7fe125f0..2c145e9ba13 100644 --- a/src/mame/drivers/astrof.c +++ b/src/mame/drivers/astrof.c @@ -500,8 +500,8 @@ static MACHINE_START( astrof ) /* the 74175 outputs all HI's if not otherwise set */ astrof_set_video_control_2(machine, 0xff); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->samples = devtag_get_device(machine, "samples"); + state->maincpu = machine->device("maincpu"); + state->samples = machine->device("samples"); /* register for state saving */ state_save_register_global(machine, state->red_on); @@ -534,7 +534,7 @@ static MACHINE_START( spfghmk2 ) /* the 74175 outputs all HI's if not otherwise set */ spfghmk2_set_video_control_2(machine, 0xff); - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); /* the red background circuit is disabled */ state->red_on = FALSE; @@ -553,8 +553,8 @@ static MACHINE_START( tomahawk ) /* the 74175 outputs all HI's if not otherwise set */ tomahawk_set_video_control_2(machine, 0xff); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->sn = devtag_get_device(machine, "snsnd"); + state->maincpu = machine->device("maincpu"); + state->sn = machine->device("snsnd"); /* register for state saving */ state_save_register_global(machine, state->red_on); diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c index e977b1d26c3..8c8df50dc12 100644 --- a/src/mame/drivers/asuka.c +++ b/src/mame/drivers/asuka.c @@ -837,10 +837,10 @@ static MACHINE_START( asuka ) { asuka_state *state = (asuka_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->pc090oj = devtag_get_device(machine, "pc090oj"); - state->tc0100scn = devtag_get_device(machine, "tc0100scn"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->pc090oj = machine->device("pc090oj"); + state->tc0100scn = machine->device("tc0100scn"); /* configure the banks */ memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, "audiocpu"), 0); diff --git a/src/mame/drivers/atarifb.c b/src/mame/drivers/atarifb.c index ba3759de0cb..3e80779c3f9 100644 --- a/src/mame/drivers/atarifb.c +++ b/src/mame/drivers/atarifb.c @@ -509,7 +509,7 @@ static MACHINE_START( atarifb ) { atarifb_state *state = (atarifb_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->CTRLD); state_save_register_global(machine, state->sign_x_1); diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c index d7e65b1a031..a7680683c6c 100644 --- a/src/mame/drivers/atarig1.c +++ b/src/mame/drivers/atarig1.c @@ -1180,7 +1180,7 @@ static void init_g1_common(running_machine *machine, offs_t slapstic_base, int s state_save_register_postload(machine, pitfightb_state_postload, NULL); } else if (slapstic != 0) - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), slapstic_base, 0, slapstic); + atarigen_slapstic_init(machine->device("maincpu"), slapstic_base, 0, slapstic); atarijsa_init(machine, "IN0", 0x4000); state->is_pitfight = is_pitfight; diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c index 9551e62317e..cd37ce948fd 100644 --- a/src/mame/drivers/atarigt.c +++ b/src/mame/drivers/atarigt.c @@ -84,7 +84,7 @@ static void cage_irq_callback(running_machine *machine, int reason) const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); if (reason) - atarigen_sound_int_gen(devtag_get_device(machine, "maincpu")); + atarigen_sound_int_gen(machine->device("maincpu")); else atarigen_sound_int_ack_w(space,0,0,0xffff); } diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c index 592d54de095..a88c3b59a22 100644 --- a/src/mame/drivers/atarisy1.c +++ b/src/mame/drivers/atarisy1.c @@ -215,7 +215,7 @@ static MACHINE_RESET( atarisy1 ) atarigen_eeprom_reset(&state->atarigen); atarigen_slapstic_reset(&state->atarigen); atarigen_interrupt_reset(&state->atarigen, update_interrupts); - atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu")); + atarigen_sound_io_reset(machine->device("audiocpu")); /* reset the joystick parameters */ state->joystick_value = 0; @@ -388,33 +388,33 @@ static READ8_HANDLER( switch_6502_r ) static WRITE8_DEVICE_HANDLER( via_pa_w ) { - tms5220_data_w(devtag_get_device(device->machine, "tms"), 0, data); + tms5220_data_w(device->machine->device("tms"), 0, data); } static READ8_DEVICE_HANDLER( via_pa_r ) { - return tms5220_status_r(devtag_get_device(device->machine, "tms"), 0); + return tms5220_status_r(device->machine->device("tms"), 0); } static WRITE8_DEVICE_HANDLER( via_pb_w ) { /* write strobe */ - tms5220_wsq_w(devtag_get_device(device->machine, "tms"), data & 1); + tms5220_wsq_w(device->machine->device("tms"), data & 1); /* read strobe */ - tms5220_rsq_w(devtag_get_device(device->machine, "tms"), (data & 2)>>1); + tms5220_rsq_w(device->machine->device("tms"), (data & 2)>>1); /* bit 4 is connected to an up-counter, clocked by SYCLKB */ data = 5 | ((data >> 3) & 2); - tms5220_set_frequency(devtag_get_device(device->machine, "tms"), ATARI_CLOCK_14MHz/2 / (16 - data)); + tms5220_set_frequency(device->machine->device("tms"), ATARI_CLOCK_14MHz/2 / (16 - data)); } static READ8_DEVICE_HANDLER( via_pb_r ) { - return (tms5220_readyq_r(devtag_get_device(device->machine, "tms")) << 2) | (tms5220_intq_r(devtag_get_device(device->machine, "tms")) << 3); + return (tms5220_readyq_r(device->machine->device("tms")) << 2) | (tms5220_intq_r(device->machine->device("tms")) << 3); } @@ -2327,7 +2327,7 @@ static DRIVER_INIT( marble ) { atarisy1_state *state = (atarisy1_state *)machine->driver_data; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 103); + atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 103); state->joystick_type = 0; /* none */ state->trackball_type = 1; /* rotated */ @@ -2338,7 +2338,7 @@ static DRIVER_INIT( peterpak ) { atarisy1_state *state = (atarisy1_state *)machine->driver_data; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 107); + atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 107); state->joystick_type = 1; /* digital */ state->trackball_type = 0; /* none */ @@ -2349,7 +2349,7 @@ static DRIVER_INIT( indytemp ) { atarisy1_state *state = (atarisy1_state *)machine->driver_data; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 105); + atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 105); state->joystick_type = 1; /* digital */ state->trackball_type = 0; /* none */ @@ -2360,7 +2360,7 @@ static DRIVER_INIT( roadrunn ) { atarisy1_state *state = (atarisy1_state *)machine->driver_data; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 108); + atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 108); state->joystick_type = 2; /* analog */ state->trackball_type = 0; /* none */ @@ -2371,7 +2371,7 @@ static DRIVER_INIT( roadb109 ) { atarisy1_state *state = (atarisy1_state *)machine->driver_data; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 109); + atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 109); state->joystick_type = 3; /* pedal */ state->trackball_type = 2; /* steering wheel */ @@ -2382,7 +2382,7 @@ static DRIVER_INIT( roadb110 ) { atarisy1_state *state = (atarisy1_state *)machine->driver_data; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 110); + atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 110); state->joystick_type = 3; /* pedal */ state->trackball_type = 2; /* steering wheel */ diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c index 2cd19b1d403..26af184172d 100644 --- a/src/mame/drivers/atarisy2.c +++ b/src/mame/drivers/atarisy2.c @@ -196,7 +196,7 @@ static void scanline_update(screen_device &screen, int scanline) /* generate the 32V interrupt (IRQ 2) */ if ((scanline % 64) == 0) if (state->interrupt_enable & 4) - atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu")); + atarigen_scanline_int_gen(screen.machine->device("maincpu")); } } @@ -243,7 +243,7 @@ static MACHINE_RESET( atarisy2 ) atarigen_eeprom_reset(&state->atarigen); slapstic_reset(); atarigen_interrupt_reset(&state->atarigen, update_interrupts); - atarigen_sound_io_reset(devtag_get_device(machine, "soundcpu")); + atarigen_sound_io_reset(machine->device("soundcpu")); atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 64); memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), atarisy2_direct_handler); @@ -379,7 +379,7 @@ static READ8_HANDLER( switch_6502_r ) if (state->atarigen.cpu_to_sound_ready) result |= 0x01; if (state->atarigen.sound_to_cpu_ready) result |= 0x02; - if ((state->has_tms5220) && (tms5220_readyq_r(devtag_get_device(space->machine, "tms")) == 0)) + if ((state->has_tms5220) && (tms5220_readyq_r(space->machine->device("tms")) == 0)) result &= ~0x04; if (!(input_port_read(space->machine, "1801") & 0x80)) result |= 0x10; @@ -394,7 +394,7 @@ static WRITE8_HANDLER( switch_6502_w ) if (state->has_tms5220) { data = 12 | ((data >> 5) & 1); - tms5220_set_frequency(devtag_get_device(space->machine, "tms"), MASTER_CLOCK/4 / (16 - data) / 2); + tms5220_set_frequency(space->machine->device("tms"), MASTER_CLOCK/4 / (16 - data) / 2); } } @@ -623,7 +623,7 @@ static WRITE8_HANDLER( sound_reset_w ) return; /* a large number of signals are reset when this happens */ - atarigen_sound_io_reset(devtag_get_device(space->machine, "soundcpu")); + atarigen_sound_io_reset(space->machine->device("soundcpu")); devtag_reset(space->machine, "ymsnd"); if (state->has_tms5220) { @@ -684,7 +684,7 @@ static WRITE8_HANDLER( tms5220_w ) atarisy2_state *state = (atarisy2_state *)space->machine->driver_data; if (state->has_tms5220) { - tms5220_data_w(devtag_get_device(space->machine, "tms"), 0, data); + tms5220_data_w(space->machine->device("tms"), 0, data); } } @@ -693,7 +693,7 @@ static WRITE8_HANDLER( tms5220_strobe_w ) atarisy2_state *state = (atarisy2_state *)space->machine->driver_data; if (state->has_tms5220) { - tms5220_wsq_w(devtag_get_device(space->machine, "tms"), 1-(offset & 1)); + tms5220_wsq_w(space->machine->device("tms"), 1-(offset & 1)); } } @@ -3053,7 +3053,7 @@ static DRIVER_INIT( paperboy ) state->pedal_count = 0; state->has_tms5220 = 1; - tms5220_rsq_w(devtag_get_device(machine, "tms"), 1); // /RS is tied high on sys2 hw + tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw } @@ -3094,7 +3094,7 @@ static DRIVER_INIT( 720 ) state->pedal_count = -1; state->has_tms5220 = 1; - tms5220_rsq_w(devtag_get_device(machine, "tms"), 1); // /RS is tied high on sys2 hw + tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw } @@ -3250,7 +3250,7 @@ static DRIVER_INIT( apb ) state->pedal_count = 2; state->has_tms5220 = 1; - tms5220_rsq_w(devtag_get_device(machine, "tms"), 1); // /RS is tied high on sys2 hw + tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw } diff --git a/src/mame/drivers/aztarac.c b/src/mame/drivers/aztarac.c index 08704ac31ab..55f9b34a7c8 100644 --- a/src/mame/drivers/aztarac.c +++ b/src/mame/drivers/aztarac.c @@ -36,7 +36,7 @@ static IRQ_CALLBACK(aztarac_irq_callback) static MACHINE_RESET( aztarac ) { - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), aztarac_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), aztarac_irq_callback); } diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index aaf4a198f14..bd81424d547 100644 --- a/src/mame/drivers/backfire.c +++ b/src/mame/drivers/backfire.c @@ -471,11 +471,11 @@ static MACHINE_START( backfire ) { backfire_state *state = (backfire_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); - state->lscreen = devtag_get_device(machine, "lscreen"); - state->rscreen = devtag_get_device(machine, "rscreen"); - state->eeprom = devtag_get_device(machine, "eeprom"); + state->maincpu = machine->device("maincpu"); + state->deco16ic = machine->device("deco_custom"); + state->lscreen = machine->device("lscreen"); + state->rscreen = machine->device("rscreen"); + state->eeprom = machine->device("eeprom"); } static MACHINE_DRIVER_START( backfire ) @@ -691,7 +691,7 @@ static DRIVER_INIT( backfire ) deco56_decrypt_gfx(machine, "gfx1"); /* 141 */ deco56_decrypt_gfx(machine, "gfx2"); /* 141 */ deco156_decrypt(machine); - cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 4.0f); /* core timings aren't accurate */ + cpu_set_clockscale(machine->device("maincpu"), 4.0f); /* core timings aren't accurate */ descramble_sound(machine); memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0170018, 0x017001b, 0, 0, backfire_speedup_r ); } diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c index 84e1146e7ed..210463e7cd7 100644 --- a/src/mame/drivers/badlands.c +++ b/src/mame/drivers/badlands.c @@ -192,7 +192,7 @@ static void scanline_update(screen_device &screen, int scanline) if (scanline & 32) atarigen_6502_irq_ack_r(space, 0); else if (!(input_port_read(screen.machine, "FE4000") & 0x40)) - atarigen_6502_irq_gen(devtag_get_device(screen.machine, "audiocpu")); + atarigen_6502_irq_gen(screen.machine->device("audiocpu")); } @@ -216,7 +216,7 @@ static MACHINE_RESET( badlands ) atarigen_interrupt_reset(&state->atarigen, update_interrupts); atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32); - atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu")); + atarigen_sound_io_reset(machine->device("audiocpu")); memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000); } @@ -695,7 +695,7 @@ static void scanline_update_bootleg(screen_device &screen, int scanline) // if (scanline & 32) // atarigen_6502_irq_ack_r(screen->machine, 0); // else if (!(input_port_read(machine, "FE4000") & 0x40)) -// atarigen_6502_irq_gen(devtag_get_device(screen->machine, "audiocpu")); +// atarigen_6502_irq_gen(screen->machine->device("audiocpu")); } @@ -709,7 +709,7 @@ static MACHINE_RESET( badlandsb ) atarigen_interrupt_reset(&state->atarigen, update_interrupts_bootleg); atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update_bootleg, 32); -// atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu")); +// atarigen_sound_io_reset(machine->device("audiocpu")); // memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000); } diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c index f7a33d30f5f..285d567afa3 100644 --- a/src/mame/drivers/battlane.c +++ b/src/mame/drivers/battlane.c @@ -278,8 +278,8 @@ static MACHINE_START( battlane ) { battlane_state *state = (battlane_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->video_ctrl); state_save_register_global(machine, state->cpu_control); diff --git a/src/mame/drivers/battlnts.c b/src/mame/drivers/battlnts.c index ea1fa541a43..0ebb0f26732 100644 --- a/src/mame/drivers/battlnts.c +++ b/src/mame/drivers/battlnts.c @@ -225,9 +225,9 @@ static MACHINE_START( battlnts ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007342 = devtag_get_device(machine, "k007342"); - state->k007420 = devtag_get_device(machine, "k007420"); + state->audiocpu = machine->device("audiocpu"); + state->k007342 = machine->device("k007342"); + state->k007420 = machine->device("k007420"); state_save_register_global(machine, state->spritebank); state_save_register_global_array(machine, state->layer_colorbase); diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c index e5104b58ad7..a66abfbd41c 100644 --- a/src/mame/drivers/beaminv.c +++ b/src/mame/drivers/beaminv.c @@ -135,7 +135,7 @@ static MACHINE_START( beaminv ) beaminv_state *state = (beaminv_state *)machine->driver_data; create_interrupt_timer(machine); - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); /* setup for save states */ state_save_register_global(machine, state->controller_select); diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c index f5271cb248d..8756e2f91cf 100644 --- a/src/mame/drivers/berzerk.c +++ b/src/mame/drivers/berzerk.c @@ -474,7 +474,7 @@ static WRITE8_HANDLER( berzerk_audio_w ) { /* offset 4 writes to the S14001A */ case 4: - device = devtag_get_device(space->machine, "speech"); + device = space->machine->device("speech"); switch (data >> 6) { /* write data to the S14001 */ @@ -492,7 +492,7 @@ static WRITE8_HANDLER( berzerk_audio_w ) break; case 1: - device = devtag_get_device(space->machine, "speech"); + device = space->machine->device("speech"); /* volume */ s14001a_set_volume(device, ((data & 0x38) >> 3) + 1); @@ -524,7 +524,7 @@ static WRITE8_HANDLER( berzerk_audio_w ) static READ8_HANDLER( berzerk_audio_r ) { - running_device *device = devtag_get_device(space->machine, "speech"); + running_device *device = space->machine->device("speech"); switch (offset) { /* offset 4 reads from the S14001A */ diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c index d9f34e6f8a8..b66e990a73d 100644 --- a/src/mame/drivers/bfm_sc1.c +++ b/src/mame/drivers/bfm_sc1.c @@ -180,7 +180,7 @@ static INTERRUPT_GEN( timer_irq ) sc1_Inputs[2] = input_port_read(device->machine,"STROBE0"); - generic_pulse_irq_line(devtag_get_device(device->machine, "maincpu"), M6809_IRQ_LINE); + generic_pulse_irq_line(device->machine->device("maincpu"), M6809_IRQ_LINE); } } @@ -277,7 +277,7 @@ static WRITE8_HANDLER( mmtr_w ) if ( changed & (1 << i) ) { Mechmtr_update(i, cycles, data & (1 << i) ); - generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE); + generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE); } } } diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c index 6148bcdde2b..f155b45f065 100644 --- a/src/mame/drivers/bfm_sc2.c +++ b/src/mame/drivers/bfm_sc2.c @@ -698,8 +698,8 @@ static WRITE8_HANDLER( volume_override_w ) if ( old != volume_override ) { - running_device *ym = devtag_get_device(space->machine, "ymsnd"); - running_device *upd = devtag_get_device(space->machine, "upd"); + running_device *ym = space->machine->device("ymsnd"); + running_device *upd = space->machine->device("upd"); float percent = volume_override? 1.0f : (32-global_volume)/32.0f; sound_set_output_gain(ym, 0, percent); @@ -776,7 +776,7 @@ static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are co } } - if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80; // update sound busy input + if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80; // update sound busy input return result; } @@ -812,8 +812,8 @@ static WRITE8_HANDLER( expansion_latch_w ) } { - running_device *ym = devtag_get_device(space->machine, "ymsnd"); - running_device *upd = devtag_get_device(space->machine, "upd"); + running_device *ym = space->machine->device("ymsnd"); + running_device *upd = space->machine->device("upd"); float percent = volume_override ? 1.0f : (32-global_volume)/32.0f; sound_set_output_gain(ym, 0, percent); @@ -2666,7 +2666,7 @@ static READ8_HANDLER( vfd_status_r ) int result = optic_pattern; - if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80; + if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80; return result; } @@ -2680,7 +2680,7 @@ static READ8_HANDLER( vfd_status_dm01_r ) int result = optic_pattern; - if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80; + if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80; if ( BFM_dm01_busy() ) result |= 0x40; diff --git a/src/mame/drivers/bfmsys85.c b/src/mame/drivers/bfmsys85.c index a9c672de704..624c46962f0 100644 --- a/src/mame/drivers/bfmsys85.c +++ b/src/mame/drivers/bfmsys85.c @@ -226,7 +226,7 @@ static WRITE8_HANDLER( mmtr_w ) for (i=0; i<8; i++) if ( changed & (1 << i) ) Mechmtr_update(i, cycles, data & (1 << i) ); - if ( data ) generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE); + if ( data ) generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE); } /////////////////////////////////////////////////////////////////////////// diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c index f2b118d9cbb..a1504096b0f 100644 --- a/src/mame/drivers/bigevglf.c +++ b/src/mame/drivers/bigevglf.c @@ -434,8 +434,8 @@ static MACHINE_START( bigevglf ) { bigevglf_state *state = (bigevglf_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->vidram_bank); state_save_register_global(machine, state->plane_selected); diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c index add7b38304f..7167e3fcfe0 100644 --- a/src/mame/drivers/bishi.c +++ b/src/mame/drivers/bishi.c @@ -402,10 +402,10 @@ static MACHINE_START( bishi ) { bishi_state *state = (bishi_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->k056832 = devtag_get_device(machine, "k056832"); - state->k054338 = devtag_get_device(machine, "k054338"); - state->k055555 = devtag_get_device(machine, "k055555"); + state->maincpu = machine->device("maincpu"); + state->k056832 = machine->device("k056832"); + state->k054338 = machine->device("k054338"); + state->k055555 = machine->device("k055555"); state_save_register_global(machine, state->cur_control); state_save_register_global(machine, state->cur_control2); diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c index a72aaf50813..e9f9f11e7c1 100644 --- a/src/mame/drivers/bking.c +++ b/src/mame/drivers/bking.c @@ -413,7 +413,7 @@ static MACHINE_START( bking ) { buggychl_state *state = (buggychl_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); /* video */ state_save_register_global_array(machine, state->pc3259_output); @@ -439,7 +439,7 @@ static MACHINE_START( bking3 ) { buggychl_state *state = (buggychl_state *)machine->driver_data; - state->mcu = devtag_get_device(machine, "mcu"); + state->mcu = machine->device("mcu"); MACHINE_START_CALL(bking); diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c index d8e4f5141d4..d879eaaa7b8 100644 --- a/src/mame/drivers/bladestl.c +++ b/src/mame/drivers/bladestl.c @@ -311,9 +311,9 @@ static MACHINE_START( bladestl ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007342 = devtag_get_device(machine, "k007342"); - state->k007420 = devtag_get_device(machine, "k007420"); + state->audiocpu = machine->device("audiocpu"); + state->k007342 = machine->device("k007342"); + state->k007420 = machine->device("k007420"); state_save_register_global(machine, state->spritebank); state_save_register_global_array(machine, state->layer_colorbase); diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c index 114a016482e..bdb5bf0e9c1 100644 --- a/src/mame/drivers/blktiger.c +++ b/src/mame/drivers/blktiger.c @@ -283,8 +283,8 @@ static MACHINE_START( blktiger ) { blktiger_state *state = (blktiger_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); /* configure bankswitching */ memory_configure_bank(machine, "bank1", 0, 16, memory_region(machine, "maincpu") + 0x10000, 0x4000); diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c index b030ce74b4b..5f1ea70362e 100644 --- a/src/mame/drivers/blockhl.c +++ b/src/mame/drivers/blockhl.c @@ -198,10 +198,10 @@ static MACHINE_START( blockhl ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); state_save_register_global(machine, state->palette_selected); state_save_register_global(machine, state->rombank); @@ -211,7 +211,7 @@ static MACHINE_RESET( blockhl ) { blockhl_state *state = (blockhl_state *)machine->driver_data; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), blockhl_banking); + konami_configure_set_lines(machine->device("maincpu"), blockhl_banking); state->palette_selected = 0; state->rombank = 0; diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c index c4ba95b78e6..98f39b7c211 100644 --- a/src/mame/drivers/blockout.c +++ b/src/mame/drivers/blockout.c @@ -257,7 +257,7 @@ static MACHINE_START( blockout ) { blockout_state *state = (blockout_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->color); } diff --git a/src/mame/drivers/blueprnt.c b/src/mame/drivers/blueprnt.c index 8c15b65b8a4..29133ea5bfd 100644 --- a/src/mame/drivers/blueprnt.c +++ b/src/mame/drivers/blueprnt.c @@ -289,7 +289,7 @@ static MACHINE_START( blueprnt ) { blueprnt_state *state = (blueprnt_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->dipsw); } diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c index 68b25c77640..b322fa97e21 100644 --- a/src/mame/drivers/bmcbowl.c +++ b/src/mame/drivers/bmcbowl.c @@ -216,13 +216,13 @@ static WRITE16_HANDLER( scroll_w ) static READ16_HANDLER(bmcbowl_via_r) { - running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = space->machine->device("via6522_0"); return via_r(via_0, offset); } static WRITE16_HANDLER(bmcbowl_via_w) { - running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = space->machine->device("via6522_0"); via_w(via_0, offset, data); } diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c index 3cb305a9a72..7404d1ff703 100644 --- a/src/mame/drivers/bnstars.c +++ b/src/mame/drivers/bnstars.c @@ -489,8 +489,8 @@ static VIDEO_START(bnstars) static VIDEO_UPDATE(bnstars) { - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *right_screen = screen->machine->device("rscreen"); bitmap_fill(screen->machine->priority_bitmap,cliprect,0); @@ -1293,7 +1293,7 @@ static void irq_init(running_machine *machine) { irqreq = 0; cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); } static void irq_raise(running_machine *machine, int level) diff --git a/src/mame/drivers/bogeyman.c b/src/mame/drivers/bogeyman.c index 5ad1f43f251..a6073c56fcd 100644 --- a/src/mame/drivers/bogeyman.c +++ b/src/mame/drivers/bogeyman.c @@ -37,11 +37,11 @@ static WRITE8_HANDLER( bogeyman_8910_control_w ) // bit 5 goes to 8910 #0 BDIR pin if ((state->last_write & 0x20) == 0x20 && (data & 0x20) == 0x00) - ay8910_data_address_w(devtag_get_device(space->machine, "ay1"), state->last_write >> 4, state->psg_latch); + ay8910_data_address_w(space->machine->device("ay1"), state->last_write >> 4, state->psg_latch); // bit 7 goes to 8910 #1 BDIR pin if ((state->last_write & 0x80) == 0x80 && (data & 0x80) == 0x00) - ay8910_data_address_w(devtag_get_device(space->machine, "ay2"), state->last_write >> 6, state->psg_latch); + ay8910_data_address_w(space->machine->device("ay2"), state->last_write >> 6, state->psg_latch); state->last_write = data; } diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c index 5ffa71f8c99..8efc52b987e 100644 --- a/src/mame/drivers/bottom9.c +++ b/src/mame/drivers/bottom9.c @@ -337,13 +337,13 @@ static MACHINE_START( bottom9 ) memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k051316 = devtag_get_device(machine, "k051316"); - state->k007232_1 = devtag_get_device(machine, "k007232_1"); - state->k007232_2 = devtag_get_device(machine, "k007232_2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); + state->k051316 = machine->device("k051316"); + state->k007232_1 = machine->device("k007232_1"); + state->k007232_2 = machine->device("k007232_2"); state_save_register_global(machine, state->video_enable); state_save_register_global(machine, state->zoomreadroms); diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c index da5770245c8..c4a42bc0d21 100644 --- a/src/mame/drivers/boxer.c +++ b/src/mame/drivers/boxer.c @@ -420,7 +420,7 @@ static MACHINE_START( boxer ) { boxer_state *state = (boxer_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->pot_state); state_save_register_global(machine, state->pot_latch); diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c index d8642ac3049..c8cf1f46d3f 100644 --- a/src/mame/drivers/brkthru.c +++ b/src/mame/drivers/brkthru.c @@ -367,8 +367,8 @@ static MACHINE_START( brkthru ) { brkthru_state *state = (brkthru_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->bgscroll); state_save_register_global(machine, state->bgbasecolor); diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c index bf59effe49c..07e3695f72c 100644 --- a/src/mame/drivers/btime.c +++ b/src/mame/drivers/btime.c @@ -1427,8 +1427,8 @@ static MACHINE_START( btime ) { btime_state *state = (btime_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->btime_palette); state_save_register_global(machine, state->bnj_scroll1); @@ -2088,7 +2088,7 @@ static void decrypt_C10707_cpu(running_machine *machine, const char *cputag) for (addr = 0; addr < 0x10000; addr++) decrypt[addr] = swap_bits_5_6(rom[addr]); - if (space->cpu == devtag_get_device(machine, "maincpu")) + if (space->cpu == machine->device("maincpu")) decrypted = decrypt; } diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c index e25d33f12f7..56919d8376e 100644 --- a/src/mame/drivers/btoads.c +++ b/src/mame/drivers/btoads.c @@ -68,7 +68,7 @@ static TIMER_CALLBACK( delayed_sound_w ) { main_to_sound_data = param; main_to_sound_ready = 1; - cpu_triggerint(devtag_get_device(machine, "audiocpu")); + cpu_triggerint(machine->device("audiocpu")); /* use a timer to make long transfers faster */ timer_set(machine, ATTOTIME_IN_USEC(50), NULL, 0, 0); diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c index 109f7e0395b..4f66c258e39 100644 --- a/src/mame/drivers/bublbobl.c +++ b/src/mame/drivers/bublbobl.c @@ -725,10 +725,10 @@ static MACHINE_START( common ) { bublbobl_state *state = (bublbobl_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->mcu = devtag_get_device(machine, "mcu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->slave = devtag_get_device(machine, "slave"); + state->maincpu = machine->device("maincpu"); + state->mcu = machine->device("mcu"); + state->audiocpu = machine->device("audiocpu"); + state->slave = machine->device("slave"); state_save_register_global(machine, state->sound_nmi_enable); state_save_register_global(machine, state->pending_nmi); diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c index ee24b5b6040..e0844916c49 100644 --- a/src/mame/drivers/buggychl.c +++ b/src/mame/drivers/buggychl.c @@ -377,8 +377,8 @@ static MACHINE_START( buggychl ) memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x2000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->sound_nmi_enable); state_save_register_global(machine, state->pending_nmi); diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c index 37c4203f3e8..34397ab78e5 100644 --- a/src/mame/drivers/bwing.c +++ b/src/mame/drivers/bwing.c @@ -376,9 +376,9 @@ static MACHINE_START( bwing ) { bwing_state *state = (bwing_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->coin); state_save_register_global(machine, state->palatch); diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c index a3b56a7c8ba..48dcab77d10 100644 --- a/src/mame/drivers/calchase.c +++ b/src/mame/drivers/calchase.c @@ -558,13 +558,13 @@ static IRQ_CALLBACK(irq_callback) static MACHINE_START(calchase) { - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); - calchase_devices.pit8254 = devtag_get_device( machine, "pit8254" ); - calchase_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" ); - calchase_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" ); - calchase_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" ); - calchase_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" ); + calchase_devices.pit8254 = machine->device( "pit8254" ); + calchase_devices.pic8259_1 = machine->device( "pic8259_1" ); + calchase_devices.pic8259_2 = machine->device( "pic8259_2" ); + calchase_devices.dma8237_1 = machine->device( "dma8237_1" ); + calchase_devices.dma8237_2 = machine->device( "dma8237_2" ); } /************************************************************* diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c index d9625e05a49..01400f59d45 100644 --- a/src/mame/drivers/capbowl.c +++ b/src/mame/drivers/capbowl.c @@ -349,8 +349,8 @@ static MACHINE_START( capbowl ) { capbowl_state *state = (capbowl_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->blitter_addr); state_save_register_global(machine, state->last_trackball_val[0]); diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c index 9a796a00e01..d919bfd3a70 100644 --- a/src/mame/drivers/cave.c +++ b/src/mame/drivers/cave.c @@ -1712,8 +1712,8 @@ static MACHINE_START( cave ) { cave_state *state = (cave_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->soundbuf_len); state_save_register_global_array(machine, state->soundbuf_data); diff --git a/src/mame/drivers/cball.c b/src/mame/drivers/cball.c index 6928ecafcec..9f9e1fe4de0 100644 --- a/src/mame/drivers/cball.c +++ b/src/mame/drivers/cball.c @@ -88,7 +88,7 @@ static TIMER_CALLBACK( interrupt_callback ) static MACHINE_START( cball ) { cball_state *state = (cball_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); } static MACHINE_RESET( cball ) diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c index fad69a73b89..607623e7bd3 100644 --- a/src/mame/drivers/cbuster.c +++ b/src/mame/drivers/cbuster.c @@ -297,9 +297,9 @@ static MACHINE_START( cbuster ) { cbuster_state *state = (cbuster_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->deco16ic = machine->device("deco_custom"); state_save_register_global(machine, state->prot); state_save_register_global(machine, state->pri); diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c index 0fb2f0104d1..1b1264b1b35 100644 --- a/src/mame/drivers/ccastles.c +++ b/src/mame/drivers/ccastles.c @@ -201,7 +201,7 @@ static MACHINE_START( ccastles ) rectangle visarea; /* initialize globals */ - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state->syncprom = memory_region(machine, "proms") + 0x000; /* find the start of VBLANK in the SYNC PROM */ diff --git a/src/mame/drivers/cclimber.c b/src/mame/drivers/cclimber.c index 4d1c21fe894..83642bd0667 100644 --- a/src/mame/drivers/cclimber.c +++ b/src/mame/drivers/cclimber.c @@ -257,7 +257,7 @@ static WRITE8_HANDLER(toprollr_rombank_w) static TIMER_CALLBACK( disable_interrupts ) { - cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0); + cpu_interrupt_enable(machine->device("maincpu"), 0); } diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c index bd022a131e5..b22bfc8513c 100644 --- a/src/mame/drivers/cdi.c +++ b/src/mame/drivers/cdi.c @@ -49,7 +49,7 @@ INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%08x: %s", cpu_get_pc(devtag_get_device(machine, "maincpu")), buf ); + logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf ); } } #else @@ -607,7 +607,7 @@ static TIMER_CALLBACK( scc68070_timer0_callback ) { UINT8 interrupt = scc68070->picr1 & 7; scc68070->timers.timer_status_register |= TSR_OV0; - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE); } scc68070_set_timer_callback(&state->scc68070_regs, 0); @@ -1704,7 +1704,7 @@ static TIMER_CALLBACK( audio_sample_trigger ) // Set the CDIC interrupt line verboselog(machine, 0, "Setting CDIC interrupt line for soundmap decode\n" ); - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128); cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); } else @@ -1930,7 +1930,7 @@ static TIMER_CALLBACK( cdic_trigger_readback_int ) //printf( "Setting CDIC interrupt line\n" ); verboselog(machine, 0, "Setting CDIC interrupt line for audio sector\n" ); - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128); cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); } } @@ -1950,7 +1950,7 @@ static TIMER_CALLBACK( cdic_trigger_readback_int ) { //printf( "Setting CDIC interrupt line\n" ); verboselog(machine, 0, "Setting CDIC interrupt line for message sector\n" ); - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128); cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); } else @@ -1970,7 +1970,7 @@ static TIMER_CALLBACK( cdic_trigger_readback_int ) //printf( "Setting CDIC interrupt line\n" ); verboselog(machine, 0, "Setting CDIC interrupt line for data sector\n" ); - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128); cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); } } @@ -2033,7 +2033,7 @@ static TIMER_CALLBACK( cdic_trigger_readback_int ) verboselog(machine, 0, "Playing CDDA sector from MSF location %06x\n", cdic->time | 2 ); - cdda_start_audio(devtag_get_device(machine, "cdda"), lba, rounded_next_msf); + cdda_start_audio(machine->device("cdda"), lba, rounded_next_msf); } @@ -2063,7 +2063,7 @@ static TIMER_CALLBACK( cdic_trigger_readback_int ) } verboselog(machine, 0, "Setting CDIC interrupt line for CDDA sector\n" ); - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128); cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); break; } @@ -2114,7 +2114,7 @@ static TIMER_CALLBACK( cdic_trigger_readback_int ) cdic->time = next_msf << 8; verboselog(machine, 0, "Setting CDIC interrupt line for Seek sector\n" ); - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128); cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); break; } @@ -2338,7 +2338,7 @@ static WRITE16_HANDLER( cdic_w ) break; } case 0x2b: // Stop CDDA - cdda_stop_audio(devtag_get_device(space->machine, "cdda")); + cdda_stop_audio(space->machine->device("cdda")); timer_adjust_oneshot(cdic->interrupt_timer, attotime_never, 0); break; case 0x23: // Reset Mode 1 @@ -2420,7 +2420,7 @@ static TIMER_CALLBACK( slave_trigger_readback_int ) slave_regs_t *slave = &state->slave_regs; verboselog(machine, 0, "Asserting IRQ2\n" ); - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_2, 26); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_2, 26); cputag_set_input_line(machine, "maincpu", M68K_IRQ_2, ASSERT_LINE); timer_adjust_oneshot(slave->interrupt_timer, attotime_never, 0); } @@ -3279,7 +3279,7 @@ static void mcd212_process_ica(running_machine *machine, int channel) UINT8 interrupt = (state->scc68070_regs.lir >> 4) & 7; if(interrupt) { - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE); } } @@ -3289,7 +3289,7 @@ static void mcd212_process_ica(running_machine *machine, int channel) UINT8 interrupt = state->scc68070_regs.lir & 7; if(interrupt) { - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt); cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE); } } @@ -3370,7 +3370,7 @@ static void mcd212_process_dca(running_machine *machine, int channel) UINT8 interrupt = (state->scc68070_regs.lir >> 4) & 7; if(interrupt) { - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE); } } @@ -3380,7 +3380,7 @@ static void mcd212_process_dca(running_machine *machine, int channel) UINT8 interrupt = state->scc68070_regs.lir & 7; if(interrupt) { - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt); cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE); } } @@ -4465,8 +4465,8 @@ static VIDEO_START(cdi) static VIDEO_UPDATE(cdi) { cdi_state *state = (cdi_state *)screen->machine->driver_data; - running_device *main_screen = devtag_get_device(screen->machine, "screen"); - running_device *lcd_screen = devtag_get_device(screen->machine, "lcd"); + running_device *main_screen = screen->machine->device("screen"); + running_device *lcd_screen = screen->machine->device("lcd"); if (screen == main_screen) { @@ -4488,7 +4488,7 @@ static TIMER_CALLBACK( test_timer_callback ) if(state->timer_set == 0) { state->timer_set = 1; - cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 60); + cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 60); cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); timer_adjust_oneshot(state->test_timer, ATTOTIME_IN_HZ(10000), 0); } @@ -4616,7 +4616,7 @@ static MACHINE_RESET( cdi ) cdi_state *state = (cdi_state *)machine->driver_data; UINT16 *src = (UINT16*)memory_region(machine, "maincpu"); UINT16 *dst = state->planea; - //running_device *cdrom_dev = devtag_get_device(machine, "cdrom"); + //running_device *cdrom_dev = machine->device("cdrom"); memcpy(dst, src, 0x8); scc68070_init(machine, &state->scc68070_regs); @@ -4624,9 +4624,9 @@ static MACHINE_RESET( cdi ) slave_init(machine, &state->slave_regs); state->cdic_regs.cd = cdrom_open(get_disk_handle(machine, "cdrom")); - cdda_set_cdrom(devtag_get_device(machine, "cdda"), state->cdic_regs.cd); + cdda_set_cdrom(machine->device("cdda"), state->cdic_regs.cd); - devtag_get_device(machine, "maincpu")->reset(); + machine->device("maincpu")->reset(); state->dmadac[0] = machine->device("dac1"); state->dmadac[1] = machine->device("dac2"); diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c index be7b5ad5a4d..710a7d4139d 100644 --- a/src/mame/drivers/centiped.c +++ b/src/mame/drivers/centiped.c @@ -1977,7 +1977,7 @@ ROM_END static DRIVER_INIT( caterplr ) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); - running_device *device = devtag_get_device(machine, "pokey"); + running_device *device = machine->device("pokey"); memory_install_readwrite8_device_handler(space, device, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r, caterplr_AY8910_w); memory_install_read8_device_handler(space, device, 0x1780, 0x1780, 0, 0, caterplr_rand_r); } @@ -1986,7 +1986,7 @@ static DRIVER_INIT( caterplr ) static DRIVER_INIT( magworm ) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); - running_device *device = devtag_get_device(machine, "pokey"); + running_device *device = machine->device("pokey"); memory_install_write8_device_handler(space, device, 0x1001, 0x1001, 0, 0, ay8910_address_w); memory_install_readwrite8_device_handler(space, device, 0x1003, 0x1003, 0, 0, ay8910_r, ay8910_data_w); } diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c index a65a563afce..ed8dbd6698f 100644 --- a/src/mame/drivers/cham24.c +++ b/src/mame/drivers/cham24.c @@ -111,7 +111,7 @@ static READ8_HANDLER( nt_r ) static WRITE8_HANDLER( sprite_dma_w ) { int source = (data & 7); - ppu2c0x_spriteram_dma(space, devtag_get_device(space->machine, "ppu"), source); + ppu2c0x_spriteram_dma(space, space->machine->device("ppu"), source); } static READ8_DEVICE_HANDLER( psg_4015_r ) @@ -272,7 +272,7 @@ static VIDEO_START( cham24 ) static VIDEO_UPDATE( cham24 ) { /* render the ppu */ - ppu2c0x_render(devtag_get_device(screen->machine, "ppu"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen->machine->device("ppu"), bitmap, 0, 0, 0, 0); return 0; } @@ -287,7 +287,7 @@ static MACHINE_START( cham24 ) memcpy(&dst[0xc000], &src[0x0f8000], 0x4000); /* uses 8K swapping, all ROM!*/ - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1"); memory_set_bankptr(machine, "bank1", memory_region(machine, "gfx1")); /* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */ @@ -298,7 +298,7 @@ static MACHINE_START( cham24 ) nt_page[3] = nt_ram + 0xc00; /* and read/write handlers */ - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nt_r, nt_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nt_r, nt_w); } static DRIVER_INIT( cham24 ) diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c index 825839a4c56..2f623413be5 100644 --- a/src/mame/drivers/champbas.c +++ b/src/mame/drivers/champbas.c @@ -568,8 +568,8 @@ static MACHINE_START( champbas ) { champbas_state *state = (champbas_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->mcu = devtag_get_device(machine, CPUTAG_MCU); + state->maincpu = machine->device("maincpu"); + state->mcu = machine->device(CPUTAG_MCU); state_save_register_global(machine, state->watchdog_count); state_save_register_global(machine, state->palette_bank); @@ -579,7 +579,7 @@ static MACHINE_START( champbas ) static MACHINE_START( exctsccr ) { champbas_state *state = (champbas_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); // FIXME timer_pulse(machine, ATTOTIME_IN_HZ(75), NULL, 0, exctsccr_fm_callback); /* updates fm */ diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c index e76c0f6906f..72db57d9188 100644 --- a/src/mame/drivers/chanbara.c +++ b/src/mame/drivers/chanbara.c @@ -369,7 +369,7 @@ static MACHINE_START( chanbara ) { chanbara_state *state = (chanbara_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->scroll); state_save_register_global(machine, state->scrollhi); diff --git a/src/mame/drivers/changela.c b/src/mame/drivers/changela.c index e1f67cddd87..79aa35a0ce4 100644 --- a/src/mame/drivers/changela.c +++ b/src/mame/drivers/changela.c @@ -441,7 +441,7 @@ static MACHINE_START(changela) { changela_state *state = (changela_state *)machine->driver_data; - state->mcu = devtag_get_device(machine, "mcu"); + state->mcu = machine->device("mcu"); /* video */ state_save_register_global(machine, state->slopeROM_bank); diff --git a/src/mame/drivers/cheekyms.c b/src/mame/drivers/cheekyms.c index d62dba109c5..961901c025b 100644 --- a/src/mame/drivers/cheekyms.c +++ b/src/mame/drivers/cheekyms.c @@ -113,8 +113,8 @@ static MACHINE_START( cheekyms ) { cheekyms_state *state = (cheekyms_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->dac = devtag_get_device(machine, "dac"); + state->maincpu = machine->device("maincpu"); + state->dac = machine->device("dac"); } static MACHINE_DRIVER_START( cheekyms ) diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c index 8be06a9136a..caf7d1e34f3 100644 --- a/src/mame/drivers/chinagat.c +++ b/src/mame/drivers/chinagat.c @@ -526,9 +526,9 @@ static MACHINE_START( chinagat ) { ddragon_state *state = (ddragon_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->sub_cpu = devtag_get_device(machine, "sub"); - state->snd_cpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->sub_cpu = machine->device("sub"); + state->snd_cpu = machine->device("audiocpu"); /* configure banks */ memory_configure_bank(machine, "bank1", 0, 8, memory_region(machine, "maincpu") + 0x10000, 0x4000); diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c index 176d660a454..ffa0a138f45 100644 --- a/src/mame/drivers/chqflag.c +++ b/src/mame/drivers/chqflag.c @@ -359,13 +359,13 @@ static MACHINE_START( chqflag ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k051316_1 = devtag_get_device(machine, "k051316_1"); - state->k051316_2 = devtag_get_device(machine, "k051316_2"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k007232_1 = devtag_get_device(machine, "k007232_1"); - state->k007232_2 = devtag_get_device(machine, "k007232_2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k051316_1 = machine->device("k051316_1"); + state->k051316_2 = machine->device("k051316_2"); + state->k051960 = machine->device("k051960"); + state->k007232_1 = machine->device("k007232_1"); + state->k007232_2 = machine->device("k007232_2"); state_save_register_global(machine, state->k051316_readroms); state_save_register_global(machine, state->last_vreg); diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c index 7408232fea9..8a3f9b00f60 100644 --- a/src/mame/drivers/cidelsa.c +++ b/src/mame/drivers/cidelsa.c @@ -475,7 +475,7 @@ static MACHINE_START( cidelsa ) { cidelsa_state *state = (cidelsa_state *)machine->driver_data; - state->cdp1802 = devtag_get_device(machine, CDP1802_TAG); + state->cdp1802 = machine->device(CDP1802_TAG); /* reset the CPU */ state->cdp1802_mode = CDP1802_MODE_RESET; diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c index 73b65e8bc6e..b303cf3c079 100644 --- a/src/mame/drivers/cinemat.c +++ b/src/mame/drivers/cinemat.c @@ -280,7 +280,7 @@ static READ8_HANDLER( qb3_frame_r ) static WRITE8_HANDLER( qb3_ram_bank_w ) { - memory_set_bank(space->machine, "bank1", cpu_get_reg(devtag_get_device(space->machine, "maincpu"), CCPU_P) & 3); + memory_set_bank(space->machine, "bank1", cpu_get_reg(space->machine->device("maincpu"), CCPU_P) & 3); } diff --git a/src/mame/drivers/circus.c b/src/mame/drivers/circus.c index 4fcaeef8cb8..8ccecfd8bda 100644 --- a/src/mame/drivers/circus.c +++ b/src/mame/drivers/circus.c @@ -268,9 +268,9 @@ static MACHINE_START( circus ) { circus_state *state = (circus_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->samples = devtag_get_device(machine, "samples"); - state->discrete = devtag_get_device(machine, "discrete"); + state->maincpu = machine->device("maincpu"); + state->samples = machine->device("samples"); + state->discrete = machine->device("discrete"); state_save_register_global(machine, state->clown_x); state_save_register_global(machine, state->clown_y); diff --git a/src/mame/drivers/circusc.c b/src/mame/drivers/circusc.c index 011d891d88c..b46a8f12219 100644 --- a/src/mame/drivers/circusc.c +++ b/src/mame/drivers/circusc.c @@ -62,10 +62,10 @@ static MACHINE_START( circusc ) circusc_state *state = (circusc_state *)machine->driver_data; state->audiocpu = machine->device("audiocpu"); - state->sn1 = devtag_get_device(machine, "sn1"); - state->sn2 = devtag_get_device(machine, "sn2"); - state->dac = devtag_get_device(machine, "dac"); - state->discrete = devtag_get_device(machine, "fltdisc"); + state->sn1 = machine->device("sn1"); + state->sn2 = machine->device("sn2"); + state->dac = machine->device("dac"); + state->discrete = machine->device("fltdisc"); state_save_register_global(machine, state->sn_latch); } diff --git a/src/mame/drivers/citycon.c b/src/mame/drivers/citycon.c index 3e16abe3034..b6674f302ff 100644 --- a/src/mame/drivers/citycon.c +++ b/src/mame/drivers/citycon.c @@ -191,7 +191,7 @@ static MACHINE_START( citycon ) { citycon_state *state = (citycon_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->bg_image); } diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c index 75a63955852..a1c23499243 100644 --- a/src/mame/drivers/cliffhgr.c +++ b/src/mame/drivers/cliffhgr.c @@ -215,7 +215,7 @@ static void vdp_interrupt(running_machine *machine, int state) static MACHINE_START( cliffhgr ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); irq_timer = timer_alloc(machine, cliff_irq_callback, NULL); } diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c index 3bba3ef235e..d6d2459529f 100644 --- a/src/mame/drivers/cloud9.c +++ b/src/mame/drivers/cloud9.c @@ -170,7 +170,7 @@ static MACHINE_START( cloud9 ) rectangle visarea; /* initialize globals */ - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state->syncprom = memory_region(machine, "proms") + 0x000; /* find the start of VBLANK in the SYNC PROM */ diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c index 226020375ba..3890c6c6814 100644 --- a/src/mame/drivers/cntsteer.c +++ b/src/mame/drivers/cntsteer.c @@ -787,9 +787,9 @@ static MACHINE_START( cntsteer ) { cntsteer_state *state = (cntsteer_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "subcpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("subcpu"); state_save_register_global(machine, state->flipscreen); state_save_register_global(machine, state->bg_bank); diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c index cf7e8785dfb..09b1d937c0d 100644 --- a/src/mame/drivers/cojag.c +++ b/src/mame/drivers/cojag.c @@ -371,8 +371,8 @@ static MACHINE_RESET( cojag ) jaguar_dsp_resume(machine); /* halt the CPUs */ - jaguargpu_ctrl_w(devtag_get_device(machine, "gpu"), G_CTRL, 0, 0xffffffff); - jaguardsp_ctrl_w(devtag_get_device(machine, "audiocpu"), D_CTRL, 0, 0xffffffff); + jaguargpu_ctrl_w(machine->device("gpu"), G_CTRL, 0, 0xffffffff); + jaguardsp_ctrl_w(machine->device("audiocpu"), D_CTRL, 0, 0xffffffff); /* set blitter idle flag */ blitter_status = 1; @@ -418,8 +418,8 @@ static WRITE32_HANDLER( misc_control_w ) jaguar_dsp_resume(space->machine); /* halt the CPUs */ - jaguargpu_ctrl_w(devtag_get_device(space->machine, "gpu"), G_CTRL, 0, 0xffffffff); - jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), D_CTRL, 0, 0xffffffff); + jaguargpu_ctrl_w(space->machine->device("gpu"), G_CTRL, 0, 0xffffffff); + jaguardsp_ctrl_w(space->machine->device("audiocpu"), D_CTRL, 0, 0xffffffff); } /* adjust banking */ @@ -442,13 +442,13 @@ static WRITE32_HANDLER( misc_control_w ) static READ32_HANDLER( gpuctrl_r ) { - return jaguargpu_ctrl_r(devtag_get_device(space->machine, "gpu"), offset); + return jaguargpu_ctrl_r(space->machine->device("gpu"), offset); } static WRITE32_HANDLER( gpuctrl_w ) { - jaguargpu_ctrl_w(devtag_get_device(space->machine, "gpu"), offset, data, mem_mask); + jaguargpu_ctrl_w(space->machine->device("gpu"), offset, data, mem_mask); } @@ -461,13 +461,13 @@ static WRITE32_HANDLER( gpuctrl_w ) static READ32_HANDLER( dspctrl_r ) { - return jaguardsp_ctrl_r(devtag_get_device(space->machine, "audiocpu"), offset); + return jaguardsp_ctrl_r(space->machine->device("audiocpu"), offset); } static WRITE32_HANDLER( dspctrl_w ) { - jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), offset, data, mem_mask); + jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask); } diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c index 925d6caeaa2..e22e0cfcf3f 100644 --- a/src/mame/drivers/combatsc.c +++ b/src/mame/drivers/combatsc.c @@ -678,8 +678,8 @@ static MACHINE_START( combatsc ) state->interleave_timer = timer_alloc(machine, NULL, NULL); state->audiocpu = machine->device("audiocpu"); - state->k007121_1 = devtag_get_device(machine, "k007121_1"); - state->k007121_2 = devtag_get_device(machine, "k007121_2"); + state->k007121_1 = machine->device("k007121_1"); + state->k007121_2 = machine->device("k007121_2"); memory_configure_bank(machine, "bank1", 0, 10, memory_region(machine, "maincpu") + 0x10000, 0x4000); diff --git a/src/mame/drivers/commando.c b/src/mame/drivers/commando.c index 23b24871a28..2a9483582dc 100644 --- a/src/mame/drivers/commando.c +++ b/src/mame/drivers/commando.c @@ -228,7 +228,7 @@ static MACHINE_START( commando ) { commando_state *state = (commando_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global_array(machine, state->scroll_x); state_save_register_global_array(machine, state->scroll_y); diff --git a/src/mame/drivers/contra.c b/src/mame/drivers/contra.c index 5e91ef33278..da18e0bb665 100644 --- a/src/mame/drivers/contra.c +++ b/src/mame/drivers/contra.c @@ -176,9 +176,9 @@ static MACHINE_START( contra ) memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007121_1 = devtag_get_device(machine, "k007121_1"); - state->k007121_2 = devtag_get_device(machine, "k007121_2"); + state->audiocpu = machine->device("audiocpu"); + state->k007121_1 = machine->device("k007121_1"); + state->k007121_2 = machine->device("k007121_2"); } static MACHINE_DRIVER_START( contra ) diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c index 6f6e0b43bbb..e8c507c58df 100644 --- a/src/mame/drivers/cosmic.c +++ b/src/mame/drivers/cosmic.c @@ -1024,8 +1024,8 @@ static MACHINE_START( cosmic ) { cosmic_state *state = (cosmic_state *)machine->driver_data; - state->samples = devtag_get_device(machine, "samples"); - state->dac = devtag_get_device(machine, "dac"); + state->samples = machine->device("samples"); + state->dac = machine->device("dac"); state_save_register_global(machine, state->sound_enabled); state_save_register_global(machine, state->march_select); @@ -1618,7 +1618,7 @@ static DRIVER_INIT( devzone ) static DRIVER_INIT( nomnlnd ) { - running_device *dac = devtag_get_device(machine, "dac"); + running_device *dac = machine->device("dac"); memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r); memory_nop_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4800, 0x4800, 0, 0); memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4807, 0x4807, 0, 0, cosmic_background_enable_w); diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index a268d2a2c4f..3deeb1fe2db 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -2945,8 +2945,8 @@ static MACHINE_START( common ) { cps_state *state = (cps_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_START( cps1 ) diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c index bb4c7088932..3c65d286652 100644 --- a/src/mame/drivers/cps2.c +++ b/src/mame/drivers/cps2.c @@ -1195,8 +1195,8 @@ static MACHINE_START( cps2 ) { cps_state *state = (cps_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->scancount); @@ -7831,7 +7831,7 @@ static DRIVER_INIT( cps2 ) state->scancount = 0; state->cps2networkpresent = 0; - cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */ + cpu_set_clockscale(machine->device("maincpu"), 0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */ } static DRIVER_INIT( ssf2tb ) @@ -7887,7 +7887,7 @@ static DRIVER_INIT( gigamn2 ) memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x618000, 0x619fff, 0, 0, gigamn2_dummyqsound_r, gigamn2_dummyqsound_w); // no qsound.. memory_set_decrypted_region(space, 0x000000, (length) - 1, &rom[length/4]); - m68k_set_encrypted_opcode_range(devtag_get_device(machine, "maincpu"), 0, length); + m68k_set_encrypted_opcode_range(machine->device("maincpu"), 0, length); } diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index d763a5aeacd..ae69bc3df62 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -694,7 +694,7 @@ static DRIVER_INIT( cps3 ) if (!cps3_user5region) cps3_user5region = auto_alloc_array(machine, UINT8, USER5REGION_LENGTH); // set strict verify - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_STRICT_VERIFY); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_STRICT_VERIFY); cps3_decrypt_bios(machine); decrypted_gamerom = auto_alloc_array(machine, UINT32, 0x1000000/4); diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c index cedda6e1003..c59faa170fe 100644 --- a/src/mame/drivers/crbaloon.c +++ b/src/mame/drivers/crbaloon.c @@ -159,11 +159,11 @@ static READ8_HANDLER( pc3259_r ) static WRITE8_HANDLER( port_sound_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); - running_device *sn = devtag_get_device(space->machine, "snsnd"); + running_device *discrete = space->machine->device("discrete"); + running_device *sn = space->machine->device("snsnd"); /* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */ - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), (data & 0x01) ? TRUE : FALSE); + cpu_interrupt_enable(space->machine->device("maincpu"), (data & 0x01) ? TRUE : FALSE); crbaloon_set_clear_collision_address((data & 0x01) ? TRUE : FALSE); /* D1 - SOUND STOP */ @@ -343,7 +343,7 @@ GFXDECODE_END static MACHINE_RESET( crballoon ) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); - running_device *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = machine->device("discrete"); pc3092_reset(); port_sound_w(space, 0, 0); diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c index e29fb7edf4b..7328bfa7252 100644 --- a/src/mame/drivers/crgolf.c +++ b/src/mame/drivers/crgolf.c @@ -52,8 +52,8 @@ static MACHINE_START( crgolf ) { crgolf_state *state = (crgolf_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); /* configure the banking */ memory_configure_bank(machine, "bank1", 0, 16, memory_region(machine, "maincpu") + 0x10000, 0x2000); @@ -603,7 +603,7 @@ ROM_END static DRIVER_INIT( crgolfhi ) { - running_device *msm = devtag_get_device(machine, "msm"); + running_device *msm = machine->device("msm"); memory_install_write8_device_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), msm, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w); } diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c index 398ec9e58e2..02debd0d2ee 100644 --- a/src/mame/drivers/crimfght.c +++ b/src/mame/drivers/crimfght.c @@ -263,16 +263,16 @@ static MACHINE_START( crimfght ) memory_configure_bank(machine, "bank2", 0, 12, &ROM[0x10000], 0x2000); memory_set_bank(machine, "bank2", 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k007232 = devtag_get_device(machine, "k007232"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); + state->k007232 = machine->device("k007232"); } static MACHINE_RESET( crimfght ) { - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), crimfght_banking); + konami_configure_set_lines(machine->device("maincpu"), crimfght_banking); } static MACHINE_DRIVER_START( crimfght ) diff --git a/src/mame/drivers/crospang.c b/src/mame/drivers/crospang.c index fc243b68f3b..ee075458c80 100644 --- a/src/mame/drivers/crospang.c +++ b/src/mame/drivers/crospang.c @@ -289,7 +289,7 @@ static MACHINE_START( crospang ) { crospang_state *state = (crospang_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->bestri_tilebank); state_save_register_global(machine, state->xsproff); diff --git a/src/mame/drivers/crshrace.c b/src/mame/drivers/crshrace.c index 19a66f64a21..cf253f3c508 100644 --- a/src/mame/drivers/crshrace.c +++ b/src/mame/drivers/crshrace.c @@ -449,8 +449,8 @@ static MACHINE_START( crshrace ) { crshrace_state *state = (crshrace_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053936 = devtag_get_device(machine, "k053936"); + state->audiocpu = machine->device("audiocpu"); + state->k053936 = machine->device("k053936"); state_save_register_global(machine, state->roz_bank); state_save_register_global(machine, state->gfxctrl); diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c index 2ca628be2c1..1a1ebe65dc1 100644 --- a/src/mame/drivers/crystal.c +++ b/src/mame/drivers/crystal.c @@ -563,11 +563,11 @@ static MACHINE_START( crystal ) crystal_state *state = (crystal_state *)machine->driver_data; int i; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->ds1302 = devtag_get_device(machine, "rtc"); - state->vr0video = devtag_get_device(machine, "vr0"); + state->maincpu = machine->device("maincpu"); + state->ds1302 = machine->device("rtc"); + state->vr0video = machine->device("vr0"); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback); + cpu_set_irq_callback(machine->device("maincpu"), icallback); for (i = 0; i < 4; i++) state->Timer[i] = timer_alloc(machine, Timercb, (void*)(FPTR)i); @@ -597,7 +597,7 @@ static MACHINE_RESET( crystal ) memset(state->vidregs, 0, 0x10000); state->FlipCount = 0; state->IntHigh = 0; - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback); + cpu_set_irq_callback(machine->device("maincpu"), icallback); state->Bank = 0; memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + 0); state->FlashCmd = 0xff; @@ -612,7 +612,7 @@ static MACHINE_RESET( crystal ) timer_adjust_oneshot(state->Timer[i], attotime_never, 0); } - vr0_snd_set_areas(devtag_get_device(machine, "vrender"), state->textureram, state->frameram); + vr0_snd_set_areas(machine->device("vrender"), state->textureram, state->frameram); #ifdef IDLE_LOOP_SPEEDUP state->FlipCntRead = 0; #endif diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c index 0aa3df60df5..b5e316187dc 100644 --- a/src/mame/drivers/cubeqst.c +++ b/src/mame/drivers/cubeqst.c @@ -110,8 +110,8 @@ static VIDEO_UPDATE( cubeqst ) for (y = cliprect->min_y; y <= cliprect->max_y; ++y) { int i; - int num_entries = cubeqcpu_get_ptr_ram_val(devtag_get_device(screen->machine, "line_cpu"), y); - UINT32 *stk_ram = cubeqcpu_get_stack_ram(devtag_get_device(screen->machine, "line_cpu")); + int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine->device("line_cpu"), y); + UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine->device("line_cpu")); UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0); UINT32 pen; @@ -240,10 +240,10 @@ static WRITE16_HANDLER( control_w ) static TIMER_CALLBACK( delayed_bank_swap ) { - cubeqcpu_swap_line_banks(devtag_get_device(machine, "line_cpu")); + cubeqcpu_swap_line_banks(machine->device("line_cpu")); /* TODO: This is a little dubious */ - cubeqcpu_clear_stack(devtag_get_device(machine, "line_cpu")); + cubeqcpu_clear_stack(machine->device("line_cpu")); } @@ -375,22 +375,22 @@ INPUT_PORTS_END static READ16_HANDLER( read_rotram ) { - return cubeqcpu_rotram_r(devtag_get_device(space->machine, "rotate_cpu"), offset, mem_mask); + return cubeqcpu_rotram_r(space->machine->device("rotate_cpu"), offset, mem_mask); } static WRITE16_HANDLER( write_rotram ) { - cubeqcpu_rotram_w(devtag_get_device(space->machine, "rotate_cpu"), offset, data, mem_mask); + cubeqcpu_rotram_w(space->machine->device("rotate_cpu"), offset, data, mem_mask); } static READ16_HANDLER( read_sndram ) { - return cubeqcpu_sndram_r(devtag_get_device(space->machine, "sound_cpu"), offset, mem_mask); + return cubeqcpu_sndram_r(space->machine->device("sound_cpu"), offset, mem_mask); } static WRITE16_HANDLER( write_sndram ) { - cubeqcpu_sndram_w(devtag_get_device(space->machine, "sound_cpu"), offset, data, mem_mask); + cubeqcpu_sndram_w(space->machine->device("sound_cpu"), offset, data, mem_mask); } static ADDRESS_MAP_START( m68k_program_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -427,7 +427,7 @@ ADDRESS_MAP_END static MACHINE_START( cubeqst ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); } static MACHINE_RESET( cubeqst ) @@ -467,7 +467,7 @@ static void sound_dac_w(running_device *device, UINT16 data) "rdac6", "ldac6", "rdac7", "ldac7" }; - dac_signed_data_16_w(devtag_get_device(device->machine, dacs[data & 15]), (data & 0xfff0) ^ 0x8000); + dac_signed_data_16_w(device->machine->device(dacs[data & 15]), (data & 0xfff0) ^ 0x8000); } static const cubeqst_snd_config snd_config = diff --git a/src/mame/drivers/cubocd32.c b/src/mame/drivers/cubocd32.c index d49e1cfb3f2..4967610fc87 100644 --- a/src/mame/drivers/cubocd32.c +++ b/src/mame/drivers/cubocd32.c @@ -377,7 +377,7 @@ static WRITE32_HANDLER( aga_overlay_w ) static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w ) { /* bit 1 = cd audio mute */ - sound_set_output_gain(devtag_get_device(device->machine, "cdda"), 0, ( data & 1 ) ? 0.0 : 1.0 ); + sound_set_output_gain(device->machine->device("cdda"), 0, ( data & 1 ) ? 0.0 : 1.0 ); /* bit 2 = Power Led on Amiga */ set_led_status(device->machine, 0, (data & 2) ? 0 : 1); @@ -1190,11 +1190,11 @@ static DRIVER_INIT( cd32 ) static void cndypuzl_input_hack(running_machine *machine) { - if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size) + if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size) { // amiga_chip_ram_w(0x051c02, 0x0000); - UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5); + UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5); amiga_chip_ram_w(r_A5 - 0x7ebe, 0x0000); } } @@ -1207,11 +1207,11 @@ static DRIVER_INIT(cndypuzl) static void haremchl_input_hack(running_machine *machine) { - if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size) + if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size) { // amiga_chip_ram_w8(0x002907, 0x00); - UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5); + UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5); UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7f00 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7f00 + 2)); amiga_chip_ram_w8(r_A2 + 0x1f, 0x00); } @@ -1225,11 +1225,11 @@ static DRIVER_INIT(haremchl) static void lsrquiz_input_hack(running_machine *machine) { - if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size) + if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size) { // amiga_chip_ram_w8(0x001e1b, 0x00); - UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5); + UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5); UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fe0 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fe0 + 2)); amiga_chip_ram_w8(r_A2 + 0x13, 0x00); } @@ -1244,11 +1244,11 @@ static DRIVER_INIT(lsrquiz) /* The hack isn't working if you exit the test mode with P1 button 2 ! */ static void lsrquiz2_input_hack(running_machine *machine) { - if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size) + if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size) { // amiga_chip_ram_w8(0x046107, 0x00); - UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5); + UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5); UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fdc + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fdc + 2)); amiga_chip_ram_w8(r_A2 + 0x17, 0x00); } @@ -1262,11 +1262,11 @@ static DRIVER_INIT(lsrquiz2) static void lasstixx_input_hack(running_machine *machine) { - if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size) + if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size) { // amiga_chip_ram_w8(0x00281c, 0x00); - UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5); + UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5); UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fa2 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fa2 + 2)); amiga_chip_ram_w8(r_A2 + 0x24, 0x00); } @@ -1280,11 +1280,11 @@ static DRIVER_INIT(lasstixx) static void mgnumber_input_hack(running_machine *machine) { - if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size) + if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size) { // amiga_chip_ram_w(0x04bfa0, 0x0000); - UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5); + UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5); amiga_chip_ram_w(r_A5 - 0x7ed8, 0x0000); } } @@ -1297,11 +1297,11 @@ static DRIVER_INIT(mgnumber) static void mgprem11_input_hack(running_machine *machine) { - if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size) + if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size) { // amiga_chip_ram_w8(0x044f7e, 0x00); - UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5); + UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5); amiga_chip_ram_w8(r_A5 - 0x7eca, 0x00); } } diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c index c57b6cd465a..51644c8af9f 100644 --- a/src/mame/drivers/cvs.c +++ b/src/mame/drivers/cvs.c @@ -1019,14 +1019,14 @@ MACHINE_START( cvs ) start_393hz_timer(machine); /* set devices */ - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->speech = devtag_get_device(machine, "speech"); - state->dac3 = devtag_get_device(machine, "dac3"); - state->tms = devtag_get_device(machine, "tms"); - state->s2636_0 = devtag_get_device(machine, "s2636_0"); - state->s2636_1 = devtag_get_device(machine, "s2636_1"); - state->s2636_2 = devtag_get_device(machine, "s2636_2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->speech = machine->device("speech"); + state->dac3 = machine->device("dac3"); + state->tms = machine->device("tms"); + state->s2636_0 = machine->device("s2636_0"); + state->s2636_1 = machine->device("s2636_1"); + state->s2636_2 = machine->device("s2636_2"); /* register state save */ state_save_register_global_pointer(machine, state->color_ram, 0x400); diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c index f7df17cba10..ed917db9ee9 100644 --- a/src/mame/drivers/cyberbal.c +++ b/src/mame/drivers/cyberbal.c @@ -65,7 +65,7 @@ static MACHINE_RESET( cyberbal ) atarigen_slapstic_reset(&state->atarigen); atarigen_interrupt_reset(&state->atarigen, update_interrupts); atarigen_scanline_timer_reset(*machine->primary_screen, cyberbal_scanline_update, 8); - atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu")); + atarigen_sound_io_reset(machine->device("audiocpu")); cyberbal_sound_reset(machine); @@ -999,7 +999,7 @@ static DRIVER_INIT( cyberbal ) { cyberbal_state *state = (cyberbal_state *)machine->driver_data; state->atarigen.eeprom_default = default_eeprom; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x018000, 0, 0); + atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 0); } @@ -1007,7 +1007,7 @@ static DRIVER_INIT( cyberbalt ) { cyberbal_state *state = (cyberbal_state *)machine->driver_data; state->atarigen.eeprom_default = default_eeprom; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x018000, 0, 116); + atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 116); } diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c index ffb8973e4a9..6e02345fcaf 100644 --- a/src/mame/drivers/dacholer.c +++ b/src/mame/drivers/dacholer.c @@ -438,7 +438,7 @@ static MACHINE_START( dacholer ) { dacholer_state *state = (dacholer_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->bg_bank); state_save_register_global(machine, state->msm_data); diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c index 510a0131a29..3beb50eac30 100644 --- a/src/mame/drivers/darius.c +++ b/src/mame/drivers/darius.c @@ -859,37 +859,37 @@ static MACHINE_START( darius ) memory_configure_bank(machine, "bank1", 4, 1, memory_region(machine, "audiocpu"), 0x8000); memory_set_bank(machine, "bank1", 4); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->cpub = devtag_get_device(machine, "cpub"); - state->adpcm = devtag_get_device(machine, "adpcm"); - state->pc080sn = devtag_get_device(machine, "pc080sn"); - state->tc0140syt = devtag_get_device(machine, "tc0140syt"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->cpub = machine->device("cpub"); + state->adpcm = machine->device("adpcm"); + state->pc080sn = machine->device("pc080sn"); + state->tc0140syt = machine->device("tc0140syt"); - state->lscreen = devtag_get_device(machine, "lscreen"); - state->mscreen = devtag_get_device(machine, "mscreen"); - state->rscreen = devtag_get_device(machine, "rscreen"); + state->lscreen = machine->device("lscreen"); + state->mscreen = machine->device("mscreen"); + state->rscreen = machine->device("rscreen"); - state->filter0_0l = devtag_get_device(machine, "filter0.0l"); - state->filter0_0r = devtag_get_device(machine, "filter0.0r"); - state->filter0_1l = devtag_get_device(machine, "filter0.1l"); - state->filter0_1r = devtag_get_device(machine, "filter0.1r"); - state->filter0_2l = devtag_get_device(machine, "filter0.2l"); - state->filter0_2r = devtag_get_device(machine, "filter0.2r"); - state->filter0_3l = devtag_get_device(machine, "filter0.3l"); - state->filter0_3r = devtag_get_device(machine, "filter0.3r"); + state->filter0_0l = machine->device("filter0.0l"); + state->filter0_0r = machine->device("filter0.0r"); + state->filter0_1l = machine->device("filter0.1l"); + state->filter0_1r = machine->device("filter0.1r"); + state->filter0_2l = machine->device("filter0.2l"); + state->filter0_2r = machine->device("filter0.2r"); + state->filter0_3l = machine->device("filter0.3l"); + state->filter0_3r = machine->device("filter0.3r"); - state->filter1_0l = devtag_get_device(machine, "filter1.0l"); - state->filter1_0r = devtag_get_device(machine, "filter1.0r"); - state->filter1_1l = devtag_get_device(machine, "filter1.1l"); - state->filter1_1r = devtag_get_device(machine, "filter1.1r"); - state->filter1_2l = devtag_get_device(machine, "filter1.2l"); - state->filter1_2r = devtag_get_device(machine, "filter1.2r"); - state->filter1_3l = devtag_get_device(machine, "filter1.3l"); - state->filter1_3r = devtag_get_device(machine, "filter1.3r"); + state->filter1_0l = machine->device("filter1.0l"); + state->filter1_0r = machine->device("filter1.0r"); + state->filter1_1l = machine->device("filter1.1l"); + state->filter1_1r = machine->device("filter1.1r"); + state->filter1_2l = machine->device("filter1.2l"); + state->filter1_2r = machine->device("filter1.2r"); + state->filter1_3l = machine->device("filter1.3l"); + state->filter1_3r = machine->device("filter1.3r"); - state->msm5205_l = devtag_get_device(machine, "msm5205.l"); - state->msm5205_r = devtag_get_device(machine, "msm5205.r"); + state->msm5205_l = machine->device("msm5205.l"); + state->msm5205_r = machine->device("msm5205.r"); state_save_register_global(machine, state->cpua_ctrl); state_save_register_global(machine, state->coin_word); diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c index ab1f57fc51b..3a0ec2b2429 100644 --- a/src/mame/drivers/dblewing.c +++ b/src/mame/drivers/dblewing.c @@ -661,9 +661,9 @@ static MACHINE_START( dblewing ) { dblewing_state *state = (dblewing_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->deco16ic = machine->device("deco_custom"); state_save_register_global(machine, state->_008_data); state_save_register_global(machine, state->_104_data); diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c index cbb02f1aeb3..f3bd39630d8 100644 --- a/src/mame/drivers/dbz.c +++ b/src/mame/drivers/dbz.c @@ -340,13 +340,13 @@ static MACHINE_START( dbz ) { dbz_state *state = (dbz_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053936_1 = devtag_get_device(machine, "k053936_1"); - state->k053936_2 = devtag_get_device(machine, "k053936_2"); - state->k056832 = devtag_get_device(machine, "k056832"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053251 = devtag_get_device(machine, "k053251"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053936_1 = machine->device("k053936_1"); + state->k053936_2 = machine->device("k053936_2"); + state->k056832 = machine->device("k056832"); + state->k053246 = machine->device("k053246"); + state->k053251 = machine->device("k053251"); state_save_register_global(machine, state->control); state_save_register_global(machine, state->sprite_colorbase); diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c index 676ded1eb88..597130e6da5 100644 --- a/src/mame/drivers/dcheese.c +++ b/src/mame/drivers/dcheese.c @@ -97,9 +97,9 @@ static MACHINE_START( dcheese ) { dcheese_state *state = (dcheese_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->bsmt = devtag_get_device(machine, "bsmt"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->bsmt = machine->device("bsmt"); cpu_set_irq_callback(state->maincpu, irq_callback); @@ -131,7 +131,7 @@ static WRITE16_HANDLER( eeprom_control_w ) if (ACCESSING_BITS_0_7) { input_port_write(space->machine, "EEPROMOUT", data, 0xff); - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, (data & 1) << 7); + ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 1) << 7); } } diff --git a/src/mame/drivers/dday.c b/src/mame/drivers/dday.c index 68144bb8540..a9f7ebe7bb9 100644 --- a/src/mame/drivers/dday.c +++ b/src/mame/drivers/dday.c @@ -224,7 +224,7 @@ static MACHINE_START( dday ) { dday_state *state = (dday_state *)machine->driver_data; - state->ay1 = devtag_get_device(machine, "ay1"); + state->ay1 = machine->device("ay1"); state_save_register_global(machine, state->control); state_save_register_global(machine, state->sl_enable); diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c index 5693da3e84b..044a7ff4319 100644 --- a/src/mame/drivers/ddayjlc.c +++ b/src/mame/drivers/ddayjlc.c @@ -447,7 +447,7 @@ static MACHINE_START( ddayjlc ) { ddayjlc_state *state = (ddayjlc_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->char_bank); state_save_register_global(machine, state->bgadr); diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index 6f962e678e9..de045fea58d 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -7576,8 +7576,8 @@ static MACHINE_START( ddenlovr ) { dynax_state *state = (dynax_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); state->oki = machine->device("oki"); state_save_register_global(machine, state->input_sel); diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c index e2b54d9e366..a024fa94bb4 100644 --- a/src/mame/drivers/ddragon.c +++ b/src/mame/drivers/ddragon.c @@ -152,11 +152,11 @@ static MACHINE_START( ddragon ) /* configure banks */ memory_configure_bank(machine, "bank1", 0, 8, memory_region(machine, "maincpu") + 0x10000, 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->sub_cpu = devtag_get_device(machine, "sub"); - state->snd_cpu = devtag_get_device(machine, "soundcpu"); - state->adpcm_1 = devtag_get_device(machine, "adpcm1"); - state->adpcm_2 = devtag_get_device(machine, "adpcm2"); + state->maincpu = machine->device("maincpu"); + state->sub_cpu = machine->device("sub"); + state->snd_cpu = machine->device("soundcpu"); + state->adpcm_1 = machine->device("adpcm1"); + state->adpcm_2 = machine->device("adpcm2"); /* register for save states */ state_save_register_global(machine, state->dd_sub_cpu_busy); diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c index fb300b0d815..b0ee0c3338b 100644 --- a/src/mame/drivers/ddragon3.c +++ b/src/mame/drivers/ddragon3.c @@ -562,8 +562,8 @@ static MACHINE_START( ddragon3 ) { ddragon3_state *state = (ddragon3_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->vreg); state_save_register_global(machine, state->bg_scrollx); diff --git a/src/mame/drivers/ddribble.c b/src/mame/drivers/ddribble.c index 2f64178984c..bb732ae7bba 100644 --- a/src/mame/drivers/ddribble.c +++ b/src/mame/drivers/ddribble.c @@ -254,9 +254,9 @@ static MACHINE_START( ddribble ) UINT8 *ROM = memory_region(machine, "maincpu"); memory_configure_bank(machine, "bank1", 0, 5, &ROM[0x10000], 0x2000); - state->filter1 = devtag_get_device(machine, "filter1"); - state->filter2 = devtag_get_device(machine, "filter2"); - state->filter3 = devtag_get_device(machine, "filter3"); + state->filter1 = machine->device("filter1"); + state->filter2 = machine->device("filter2"); + state->filter3 = machine->device("filter3"); state_save_register_global(machine, state->int_enable_0); state_save_register_global(machine, state->int_enable_1); diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c index d0559a2df96..68d3a31be8b 100644 --- a/src/mame/drivers/dec8.c +++ b/src/mame/drivers/dec8.c @@ -1931,10 +1931,10 @@ static MACHINE_START( dec8 ) { dec8_state *state = (dec8_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->latch); state_save_register_global(machine, state->nmi_enable); diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c index 9a97253c3be..8df52e6610c 100644 --- a/src/mame/drivers/deco32.c +++ b/src/mame/drivers/deco32.c @@ -363,7 +363,7 @@ static READ32_HANDLER( fghthist_control_r ) switch (offset) { case 0: return 0xffff0000 | input_port_read(space->machine, "IN0"); case 1: return 0xffff0000 | input_port_read(space->machine, "IN1"); //check top bits?? - case 2: return 0xfffffffe | eeprom_read_bit(devtag_get_device(space->machine, "eeprom")); + case 2: return 0xfffffffe | eeprom_read_bit(space->machine->device("eeprom")); } return 0xffffffff; @@ -631,7 +631,7 @@ static READ32_HANDLER( nslasher_prot_r ) switch (offset<<1) { case 0x280: return input_port_read(space->machine, "IN0") << 16| 0xffff; /* IN0 */ case 0x4c4: return input_port_read(space->machine, "IN1") << 16| 0xffff; /* IN1 */ - case 0x35a: return (eeprom_read_bit(devtag_get_device(space->machine, "eeprom"))<< 16) | 0xffff; // Debug switch in low word?? + case 0x35a: return (eeprom_read_bit(space->machine->device("eeprom"))<< 16) | 0xffff; // Debug switch in low word?? } //logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask); diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c index dadc2aedc7d..365e4646d25 100644 --- a/src/mame/drivers/deco_ld.c +++ b/src/mame/drivers/deco_ld.c @@ -484,7 +484,7 @@ GFXDECODE_END static MACHINE_START( rblaster ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); } static MACHINE_DRIVER_START( rblaster ) diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c index 83e0197f941..4e4454b57b1 100644 --- a/src/mame/drivers/deco_mlc.c +++ b/src/mame/drivers/deco_mlc.c @@ -742,11 +742,11 @@ static READ32_HANDLER( avengrgs_speedup_r ) static DRIVER_INIT( avengrgs ) { // init options - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); // set up speed cheat - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x3234); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x32dc); + sh2drc_add_pcflush(machine->device("maincpu"), 0x3234); + sh2drc_add_pcflush(machine->device("maincpu"), 0x32dc); mainCpuIsArm = 0; memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r ); @@ -758,7 +758,7 @@ static DRIVER_INIT( mlc ) /* The timing in the ARM core isn't as accurate as it should be, so bump up the effective clock rate here to compensate otherwise we have slowdowns in Skull Fung where there probably shouldn't be. */ - cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 2.0f); + cpu_set_clockscale(machine->device("maincpu"), 2.0f); mainCpuIsArm = 1; deco156_decrypt(machine); descramble_sound(machine); diff --git a/src/mame/drivers/deniam.c b/src/mame/drivers/deniam.c index 5e6b8242aed..25c9eed5e7f 100644 --- a/src/mame/drivers/deniam.c +++ b/src/mame/drivers/deniam.c @@ -243,7 +243,7 @@ static MACHINE_START( deniam ) { deniam_state *state = (deniam_state *)machine->driver_data; - state->audio_cpu = devtag_get_device(machine, "audiocpu"); + state->audio_cpu = machine->device("audiocpu"); state_save_register_global(machine, state->display_enable); state_save_register_global(machine, state->coinctrl); diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c index 063717c49c7..c3f567118fa 100644 --- a/src/mame/drivers/destroyr.c +++ b/src/mame/drivers/destroyr.c @@ -436,7 +436,7 @@ static MACHINE_START( destroyr ) { destroyr_state *state = (destroyr_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->cursor); state_save_register_global(machine, state->wavemod); diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c index 93947f3a6db..0da20ad6b00 100644 --- a/src/mame/drivers/dietgo.c +++ b/src/mame/drivers/dietgo.c @@ -194,9 +194,9 @@ static MACHINE_START( dietgo ) { dietgo_state *state = (dietgo_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->deco16ic = machine->device("deco_custom"); } static MACHINE_DRIVER_START( dietgo ) diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c index b15ed82a4f6..f7377206294 100644 --- a/src/mame/drivers/discoboy.c +++ b/src/mame/drivers/discoboy.c @@ -445,7 +445,7 @@ static MACHINE_START( discoboy ) { discoboy_state *state = (discoboy_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->ram_bank); state_save_register_global(machine, state->port_00); diff --git a/src/mame/drivers/diverboy.c b/src/mame/drivers/diverboy.c index d1897e20bf7..33228bb0671 100644 --- a/src/mame/drivers/diverboy.c +++ b/src/mame/drivers/diverboy.c @@ -247,7 +247,7 @@ static MACHINE_START( diverboy ) { diverboy_state *state = (diverboy_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_DRIVER_START( diverboy ) diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c index 9e2927db6e9..d745dcc9dc7 100644 --- a/src/mame/drivers/djboy.c +++ b/src/mame/drivers/djboy.c @@ -860,10 +860,10 @@ static MACHINE_START( djboy ) memory_configure_bank(machine, "bank3", 3, 5, &CPU2[0x10000], 0x4000); memory_configure_bank(machine, "bank4", 0, 1, &MAIN[0x10000], 0x3000); /* unsure if/how this area is banked */ - state->maincpu = devtag_get_device(machine, "maincpu"); - state->cpu1 = devtag_get_device(machine, "cpu1"); - state->cpu2 = devtag_get_device(machine, "cpu2"); - state->pandora = devtag_get_device(machine, "pandora"); + state->maincpu = machine->device("maincpu"); + state->cpu1 = machine->device("cpu1"); + state->cpu2 = machine->device("cpu2"); + state->pandora = machine->device("pandora"); state_save_register_global(machine, state->videoreg); state_save_register_global(machine, state->scrollx); diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c index 02d298f4620..c47722726cf 100644 --- a/src/mame/drivers/djmain.c +++ b/src/mame/drivers/djmain.c @@ -175,9 +175,9 @@ static READ16_HANDLER( dual539_r ) UINT16 ret = 0; if (ACCESSING_BITS_0_7) - ret |= k054539_r(devtag_get_device(space->machine, "konami2"), offset); + ret |= k054539_r(space->machine->device("konami2"), offset); if (ACCESSING_BITS_8_15) - ret |= k054539_r(devtag_get_device(space->machine, "konami1"), offset)<<8; + ret |= k054539_r(space->machine->device("konami1"), offset)<<8; return ret; } @@ -185,9 +185,9 @@ static READ16_HANDLER( dual539_r ) static WRITE16_HANDLER( dual539_w ) { if (ACCESSING_BITS_0_7) - k054539_w(devtag_get_device(space->machine, "konami2"), offset, data); + k054539_w(space->machine->device("konami2"), offset, data); if (ACCESSING_BITS_8_15) - k054539_w(devtag_get_device(space->machine, "konami1"), offset, data>>8); + k054539_w(space->machine->device("konami1"), offset, data>>8); } @@ -246,7 +246,7 @@ static WRITE32_HANDLER( v_ctrl_w ) static READ32_HANDLER( v_rom_r ) { - running_device *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = space->machine->device("k056832"); UINT8 *mem8 = memory_region(space->machine, "gfx2"); int bank = k056832_word_r(k056832, 0x34/2, 0xffff); @@ -1437,7 +1437,7 @@ static STATE_POSTLOAD( djmain_postload ) static MACHINE_START( djmain ) { - running_device *ide = devtag_get_device(machine, "ide"); + running_device *ide = machine->device("ide"); if (ide != NULL && ide_master_password != NULL) ide_set_master_password(ide, ide_master_password); diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c index 471ee52c372..b5e8dd40cc9 100644 --- a/src/mame/drivers/dkong.c +++ b/src/mame/drivers/dkong.c @@ -389,10 +389,10 @@ static void dkong_init_device_driver_data( running_machine *machine ) { dkong_state *state = (dkong_state *)machine->driver_data; - state->dev_n2a03a = devtag_get_device(machine, "n2a03a"); - state->dev_n2a03b = devtag_get_device(machine, "n2a03b"); - state->dev_6h = devtag_get_device(machine, "ls259.6h"); - state->dev_vp2 = devtag_get_device(machine, "virtual_p2"); + state->dev_n2a03a = machine->device("n2a03a"); + state->dev_n2a03b = machine->device("n2a03b"); + state->dev_6h = machine->device("ls259.6h"); + state->dev_vp2 = machine->device("virtual_p2"); } static MACHINE_START( dkong2b ) diff --git a/src/mame/drivers/dogfgt.c b/src/mame/drivers/dogfgt.c index d3b7f6b6fd5..d2be35e04d9 100644 --- a/src/mame/drivers/dogfgt.c +++ b/src/mame/drivers/dogfgt.c @@ -53,11 +53,11 @@ static WRITE8_HANDLER( dogfgt_soundcontrol_w ) /* bit 5 goes to 8910 #0 BDIR pin */ if ((state->last_snd_ctrl & 0x20) == 0x20 && (data & 0x20) == 0x00) - ay8910_data_address_w(devtag_get_device(space->machine, "ay1"), state->last_snd_ctrl >> 4, state->soundlatch); + ay8910_data_address_w(space->machine->device("ay1"), state->last_snd_ctrl >> 4, state->soundlatch); /* bit 7 goes to 8910 #1 BDIR pin */ if ((state->last_snd_ctrl & 0x80) == 0x80 && (data & 0x80) == 0x00) - ay8910_data_address_w(devtag_get_device(space->machine, "ay2"), state->last_snd_ctrl >> 6, state->soundlatch); + ay8910_data_address_w(space->machine->device("ay2"), state->last_snd_ctrl >> 6, state->soundlatch); state->last_snd_ctrl = data; } @@ -217,7 +217,7 @@ static MACHINE_START( dogfgt ) { dogfgt_state *state = (dogfgt_state *)machine->driver_data; - state->subcpu = devtag_get_device(machine, "sub"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->bm_plane); state_save_register_global(machine, state->lastflip); diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c index 27662062686..85d31d9fc34 100644 --- a/src/mame/drivers/dorachan.c +++ b/src/mame/drivers/dorachan.c @@ -227,7 +227,7 @@ static MACHINE_START( dorachan ) { dorachan_state *state = (dorachan_state *)machine->driver_data; - state->main_cpu = devtag_get_device(machine, "maincpu"); + state->main_cpu = machine->device("maincpu"); state_save_register_global(machine, state->flip_screen); } diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c index 7ad510c3fda..13ee2172e94 100644 --- a/src/mame/drivers/dragrace.c +++ b/src/mame/drivers/dragrace.c @@ -318,7 +318,7 @@ static MACHINE_START( dragrace ) { dragrace_state *state = (dragrace_state *)machine->driver_data; - state->discrete = devtag_get_device(machine, "discrete"); + state->discrete = machine->device("discrete"); state_save_register_global(machine, state->misc_flags); state_save_register_global_array(machine, state->gear); diff --git a/src/mame/drivers/drgnmst.c b/src/mame/drivers/drgnmst.c index d09412fb467..a151bbc2ac1 100644 --- a/src/mame/drivers/drgnmst.c +++ b/src/mame/drivers/drgnmst.c @@ -564,7 +564,7 @@ static DRIVER_INIT( drgnmst ) data_lo = drgnmst_asciitohex((drgnmst_PICROM_HEX[src_pos + 3])); data |= (data_hi << 12) | (data_lo << 8); - pic16c5x_set_config(devtag_get_device(machine, "audiocpu"), data); + pic16c5x_set_config(machine->device("audiocpu"), data); src_pos = 0x7fff; /* Force Exit */ } diff --git a/src/mame/drivers/dribling.c b/src/mame/drivers/dribling.c index 59fa78bd8f8..1d25d294020 100644 --- a/src/mame/drivers/dribling.c +++ b/src/mame/drivers/dribling.c @@ -287,9 +287,9 @@ static MACHINE_START( dribling ) { dribling_state *state = (dribling_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->ppi_0 = devtag_get_device(machine, "ppi8255_0"); - state->ppi_1 = devtag_get_device(machine, "ppi8255_1"); + state->maincpu = machine->device("maincpu"); + state->ppi_0 = machine->device("ppi8255_0"); + state->ppi_1 = machine->device("ppi8255_1"); state_save_register_global(machine, state->abca); state_save_register_global(machine, state->di); diff --git a/src/mame/drivers/drmicro.c b/src/mame/drivers/drmicro.c index 6f75dc6b424..e39b34e9639 100644 --- a/src/mame/drivers/drmicro.c +++ b/src/mame/drivers/drmicro.c @@ -230,7 +230,7 @@ static MACHINE_START( drmicro ) { drmicro_state *state = (drmicro_state *)machine->driver_data; - state->msm = devtag_get_device(machine, "msm"); + state->msm = machine->device("msm"); state_save_register_global(machine, state->nmi_enable); state_save_register_global(machine, state->pcm_adr); diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c index 2581b33c638..f2a894cef72 100644 --- a/src/mame/drivers/drw80pkr.c +++ b/src/mame/drivers/drw80pkr.c @@ -179,11 +179,11 @@ static WRITE8_HANDLER( drw80pkr_io_w ) // ay8910 control port if (p1 == 0xfc) - ay8910_address_w(devtag_get_device(space->machine, "aysnd"), 0, data); + ay8910_address_w(space->machine->device("aysnd"), 0, data); // ay8910_write_port_0_w if (p1 == 0xfe) - ay8910_data_w(devtag_get_device(space->machine, "aysnd"), 0, data); + ay8910_data_w(space->machine->device("aysnd"), 0, data); } } diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 7778784ea12..c30f8547c16 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -456,7 +456,7 @@ static MACHINE_RESET( adpcm ) dynax_state *state = (dynax_state *)machine->driver_data; /* start with the MSM5205 reset */ state->resetkludge = 0; - msm5205_reset_w(devtag_get_device(machine, "msm"), 1); + msm5205_reset_w(machine->device("msm"), 1); } static WRITE8_HANDLER( yarunara_layer_half_w ) @@ -4204,10 +4204,10 @@ static MACHINE_START( dynax ) { dynax_state *state = (dynax_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->rtc = devtag_get_device(machine, "rtc"); - state->ymsnd = devtag_get_device(machine, "ymsnd"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->rtc = machine->device("rtc"); + state->ymsnd = machine->device("ymsnd"); state_save_register_global(machine, state->sound_irq); state_save_register_global(machine, state->vblank_irq); @@ -4244,7 +4244,7 @@ static MACHINE_RESET( dynax ) { dynax_state *state = (dynax_state *)machine->driver_data; - if (devtag_get_device(machine, "msm") != NULL) + if (machine->device("msm") != NULL) MACHINE_RESET_CALL(adpcm); state->sound_irq = 0; @@ -4701,8 +4701,8 @@ static MACHINE_START( jantouki ) memory_configure_bank(machine, "bank1", 0, 0x10, &MAIN[0x8000], 0x8000); memory_configure_bank(machine, "bank2", 0, 12, &SOUND[0x8000], 0x8000); - state->top_scr = devtag_get_device(machine, "top"); - state->bot_scr = devtag_get_device(machine, "bottom"); + state->top_scr = machine->device("top"); + state->bot_scr = machine->device("bottom"); MACHINE_START_CALL(dynax); } diff --git a/src/mame/drivers/egghunt.c b/src/mame/drivers/egghunt.c index a5d56b1268a..f34ba20009a 100644 --- a/src/mame/drivers/egghunt.c +++ b/src/mame/drivers/egghunt.c @@ -394,7 +394,7 @@ static MACHINE_START( egghunt ) { egghunt_state *state = (egghunt_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->gfx_banking); state_save_register_global(machine, state->okibanking); diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c index 8afb0865faa..b87030959bc 100644 --- a/src/mame/drivers/enigma2.c +++ b/src/mame/drivers/enigma2.c @@ -155,8 +155,8 @@ static MACHINE_START( enigma2 ) enigma2_state *state = (enigma2_state *)machine->driver_data; create_interrupt_timers(machine); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->blink_count); state_save_register_global(machine, state->sound_latch); diff --git a/src/mame/drivers/eprom.c b/src/mame/drivers/eprom.c index b72b0d0d1c3..c4b8e36b0b8 100644 --- a/src/mame/drivers/eprom.c +++ b/src/mame/drivers/eprom.c @@ -42,7 +42,7 @@ static void update_interrupts(running_machine *machine) cputag_set_input_line(machine, "maincpu", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE); - if (devtag_get_device(machine, "extra") != NULL) + if (machine->device("extra") != NULL) cputag_set_input_line(machine, "extra", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE); cputag_set_input_line(machine, "maincpu", 6, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE); @@ -108,7 +108,7 @@ static WRITE16_HANDLER( eprom_latch_w ) { eprom_state *state = (eprom_state *)space->machine->driver_data; - if (ACCESSING_BITS_0_7 && (devtag_get_device(space->machine, "extra") != NULL)) + if (ACCESSING_BITS_0_7 && (space->machine->device("extra") != NULL)) { /* bit 0: reset extra CPU */ if (data & 1) diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c index 2bc48c65361..e07bf07f48b 100644 --- a/src/mame/drivers/equites.c +++ b/src/mame/drivers/equites.c @@ -1185,11 +1185,11 @@ static MACHINE_START( equites ) { equites_state *state = (equites_state *)machine->driver_data; - state->mcu = devtag_get_device(machine, "mcu"); - state->audio_cpu = devtag_get_device(machine, "audiocpu"); - state->msm = devtag_get_device(machine, "msm"); - state->dac_1 = devtag_get_device(machine, "dac1"); - state->dac_2 = devtag_get_device(machine, "dac2"); + state->mcu = machine->device("mcu"); + state->audio_cpu = machine->device("audiocpu"); + state->msm = machine->device("msm"); + state->dac_1 = machine->device("dac1"); + state->dac_2 = machine->device("dac2"); state_save_register_global(machine, state->fg_char_bank); state_save_register_global(machine, state->bgcolor); diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c index 46f4af255b8..58e8d2a6507 100644 --- a/src/mame/drivers/esd16.c +++ b/src/mame/drivers/esd16.c @@ -523,8 +523,8 @@ static MACHINE_START( esd16 ) memory_configure_bank(machine, "bank1", 0, 17, &AUDIO[0x0000], 0x4000); - state->audio_cpu = devtag_get_device(machine, "audiocpu"); - state->eeprom = devtag_get_device(machine, "eeprom"); + state->audio_cpu = machine->device("audiocpu"); + state->eeprom = machine->device("eeprom"); state_save_register_global(machine, state->tilemap0_color); } diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c index 17b591b0704..359c78ba0f1 100644 --- a/src/mame/drivers/esh.c +++ b/src/mame/drivers/esh.c @@ -272,7 +272,7 @@ static INTERRUPT_GEN( vblank_callback_esh ) static MACHINE_START( esh ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); } diff --git a/src/mame/drivers/espial.c b/src/mame/drivers/espial.c index eff6f117fcc..3990cb09731 100644 --- a/src/mame/drivers/espial.c +++ b/src/mame/drivers/espial.c @@ -63,8 +63,8 @@ MACHINE_START( espial ) { espial_state *state = (espial_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); //state_save_register_global_array(machine, mcu_out[1]); state_save_register_global(machine, state->sound_nmi_enabled); diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c index 363bfe22598..dd6d24301de 100644 --- a/src/mame/drivers/esripsys.c +++ b/src/mame/drivers/esripsys.c @@ -130,7 +130,7 @@ static READ8_HANDLER( uart_r ) static READ8_HANDLER( g_status_r ) { - int bank4 = BIT(get_rip_status(devtag_get_device(space->machine, "video_cpu")), 2); + int bank4 = BIT(get_rip_status(space->machine->device("video_cpu")), 2); int vblank = space->machine->primary_screen->vblank(); return (!vblank << 7) | (bank4 << 6) | (f_status & 0x2f); @@ -179,7 +179,7 @@ static WRITE8_HANDLER( g_status_w ) static READ8_HANDLER( f_status_r ) { int vblank = space->machine->primary_screen->vblank(); - UINT8 rip_status = get_rip_status(devtag_get_device(space->machine, "video_cpu")); + UINT8 rip_status = get_rip_status(space->machine->device("video_cpu")); rip_status = (rip_status & 0x18) | (BIT(rip_status, 6) << 1) | BIT(rip_status, 7); @@ -554,7 +554,7 @@ static READ8_HANDLER( tms5220_r ) if (offset == 0) { /* TMS5220 core returns status bits in D7-D6 */ - running_device *tms = devtag_get_device(space->machine, "tms5220nl"); + running_device *tms = space->machine->device("tms5220nl"); UINT8 status = tms5220_status_r(tms, 0); status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5); @@ -567,7 +567,7 @@ static READ8_HANDLER( tms5220_r ) /* TODO: Implement correctly using the state PROM */ static WRITE8_HANDLER( tms5220_w ) { - running_device *tms = devtag_get_device(space->machine, "tms5220nl"); + running_device *tms = space->machine->device("tms5220nl"); if (offset == 0) { tms_data = data; diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c index 954cc790ce8..5de4cb5f121 100644 --- a/src/mame/drivers/ettrivia.c +++ b/src/mame/drivers/ettrivia.c @@ -94,20 +94,20 @@ static WRITE8_HANDLER( b800_w ) /* special case to return the value written to 0xb000 */ /* does it reset the chips too ? */ case 0: break; - case 0xc4: b000_ret = ay8910_r(devtag_get_device(space->machine, "ay1"), 0); break; - case 0x94: b000_ret = ay8910_r(devtag_get_device(space->machine, "ay2"), 0); break; - case 0x86: b000_ret = ay8910_r(devtag_get_device(space->machine, "ay3"), 0); break; + case 0xc4: b000_ret = ay8910_r(space->machine->device("ay1"), 0); break; + case 0x94: b000_ret = ay8910_r(space->machine->device("ay2"), 0); break; + case 0x86: b000_ret = ay8910_r(space->machine->device("ay3"), 0); break; case 0x80: switch(b800_prev) { - case 0xe0: ay8910_address_w(devtag_get_device(space->machine, "ay1"),0,b000_val); break; - case 0x98: ay8910_address_w(devtag_get_device(space->machine, "ay2"),0,b000_val); break; - case 0x83: ay8910_address_w(devtag_get_device(space->machine, "ay3"),0,b000_val); break; + case 0xe0: ay8910_address_w(space->machine->device("ay1"),0,b000_val); break; + case 0x98: ay8910_address_w(space->machine->device("ay2"),0,b000_val); break; + case 0x83: ay8910_address_w(space->machine->device("ay3"),0,b000_val); break; - case 0xa0: ay8910_data_w(devtag_get_device(space->machine, "ay1"),0,b000_val); break; - case 0x88: ay8910_data_w(devtag_get_device(space->machine, "ay2"),0,b000_val); break; - case 0x81: ay8910_data_w(devtag_get_device(space->machine, "ay3"),0,b000_val); break; + case 0xa0: ay8910_data_w(space->machine->device("ay1"),0,b000_val); break; + case 0x88: ay8910_data_w(space->machine->device("ay2"),0,b000_val); break; + case 0x81: ay8910_data_w(space->machine->device("ay3"),0,b000_val); break; } break; diff --git a/src/mame/drivers/exerion.c b/src/mame/drivers/exerion.c index fd8db27cb95..fe1dc45e155 100644 --- a/src/mame/drivers/exerion.c +++ b/src/mame/drivers/exerion.c @@ -386,7 +386,7 @@ static MACHINE_START( exerion ) { exerion_state *state = (exerion_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->porta); state_save_register_global(machine, state->portb); diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c index 2ed79a29a3d..37be5df6e32 100644 --- a/src/mame/drivers/exprraid.c +++ b/src/mame/drivers/exprraid.c @@ -477,8 +477,8 @@ static MACHINE_START( exprraid ) { exprraid_state *state = (exprraid_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->slave = devtag_get_device(machine, "slave"); + state->maincpu = machine->device("maincpu"); + state->slave = machine->device("slave"); state_save_register_global_array(machine, state->bg_index); } diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c index 5cfcb49cadb..363db4ffb16 100644 --- a/src/mame/drivers/exterm.c +++ b/src/mame/drivers/exterm.c @@ -93,13 +93,13 @@ static UINT8 dac_value[2]; static WRITE16_HANDLER( exterm_host_data_w ) { - tms34010_host_w(devtag_get_device(space->machine, "slave"), offset / TOWORD(0x00100000), data); + tms34010_host_w(space->machine->device("slave"), offset / TOWORD(0x00100000), data); } static READ16_HANDLER( exterm_host_data_r ) { - return tms34010_host_r(devtag_get_device(space->machine, "slave"), offset / TOWORD(0x00100000)); + return tms34010_host_r(space->machine->device("slave"), offset / TOWORD(0x00100000)); } diff --git a/src/mame/drivers/f1gp.c b/src/mame/drivers/f1gp.c index 69356c378ff..53d3bc8501a 100644 --- a/src/mame/drivers/f1gp.c +++ b/src/mame/drivers/f1gp.c @@ -449,8 +449,8 @@ static MACHINE_START( f1gp ) memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x8000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053936 = devtag_get_device(machine, "k053936"); + state->audiocpu = machine->device("audiocpu"); + state->k053936 = machine->device("k053936"); MACHINE_START_CALL(f1gpb); } diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c index 3402efde6a7..0ac9e1c358c 100644 --- a/src/mame/drivers/fantland.c +++ b/src/mame/drivers/fantland.c @@ -829,7 +829,7 @@ static MACHINE_START( fantland ) { fantland_state *state = (fantland_state *)machine->driver_data; - state->audio_cpu = devtag_get_device(machine, "audiocpu"); + state->audio_cpu = machine->device("audiocpu"); state_save_register_global(machine, state->nmi_enable); } @@ -978,10 +978,10 @@ static MACHINE_START( borntofi ) MACHINE_START_CALL(fantland); - state->msm1 = devtag_get_device(machine, "msm1"); - state->msm2 = devtag_get_device(machine, "msm2"); - state->msm3 = devtag_get_device(machine, "msm3"); - state->msm4 = devtag_get_device(machine, "msm4"); + state->msm1 = machine->device("msm1"); + state->msm2 = machine->device("msm2"); + state->msm3 = machine->device("msm3"); + state->msm4 = machine->device("msm4"); state_save_register_global_array(machine, state->old_x); state_save_register_global_array(machine, state->old_y); @@ -1016,10 +1016,10 @@ static MACHINE_RESET( borntofi ) state->adpcm_nibble[i] = 0; } - borntofi_adpcm_stop(devtag_get_device(machine, "msm1"), 0); - borntofi_adpcm_stop(devtag_get_device(machine, "msm2"), 1); - borntofi_adpcm_stop(devtag_get_device(machine, "msm3"), 2); - borntofi_adpcm_stop(devtag_get_device(machine, "msm4"), 3); + borntofi_adpcm_stop(machine->device("msm1"), 0); + borntofi_adpcm_stop(machine->device("msm2"), 1); + borntofi_adpcm_stop(machine->device("msm3"), 2); + borntofi_adpcm_stop(machine->device("msm4"), 3); } static MACHINE_DRIVER_START( borntofi ) diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c index 3d4c9ab8fd6..f22bf030f09 100644 --- a/src/mame/drivers/fastlane.c +++ b/src/mame/drivers/fastlane.c @@ -205,8 +205,8 @@ static MACHINE_START( fastlane ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000); - state->konami2 = devtag_get_device(machine, "konami2"); - state->k007121 = devtag_get_device(machine, "k007121"); + state->konami2 = machine->device("konami2"); + state->k007121 = machine->device("k007121"); } static MACHINE_DRIVER_START( fastlane ) diff --git a/src/mame/drivers/fcombat.c b/src/mame/drivers/fcombat.c index 40d01b7fa3e..70feb0ab7e8 100644 --- a/src/mame/drivers/fcombat.c +++ b/src/mame/drivers/fcombat.c @@ -269,7 +269,7 @@ static MACHINE_START( fcombat ) { fcombat_state *state = (fcombat_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->cocktail_flip); state_save_register_global(machine, state->char_palette); diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c index 3da63165022..5f51c5472c0 100644 --- a/src/mame/drivers/fcrash.c +++ b/src/mame/drivers/fcrash.c @@ -696,10 +696,10 @@ static MACHINE_START( fcrash ) memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "soundcpu"); - state->msm_1 = devtag_get_device(machine, "msm1"); - state->msm_2 = devtag_get_device(machine, "msm2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("soundcpu"); + state->msm_1 = machine->device("msm1"); + state->msm_2 = machine->device("msm2"); state_save_register_global(machine, state->sample_buffer1); state_save_register_global(machine, state->sample_buffer2); @@ -711,8 +711,8 @@ static MACHINE_START( kodb ) { cps_state *state = (cps_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "soundcpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("soundcpu"); } static MACHINE_RESET( fcrash ) diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c index 39220a1fb28..7cc9697ac10 100644 --- a/src/mame/drivers/fgoal.c +++ b/src/mame/drivers/fgoal.c @@ -340,8 +340,8 @@ static MACHINE_START( fgoal ) { fgoal_state *state = (fgoal_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->mb14241 = devtag_get_device(machine, "mb14241"); + state->maincpu = machine->device("maincpu"); + state->mb14241 = machine->device("mb14241"); state_save_register_global(machine, state->xpos); state_save_register_global(machine, state->ypos); diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c index 2a126b176c8..27e85d87686 100644 --- a/src/mame/drivers/finalizr.c +++ b/src/mame/drivers/finalizr.c @@ -247,7 +247,7 @@ static MACHINE_START( finalizr ) { finalizr_state *state = (finalizr_state *)machine->driver_data; - state->audio_cpu = devtag_get_device(machine, "audiocpu"); + state->audio_cpu = machine->device("audiocpu"); state_save_register_global(machine, state->spriterambank); state_save_register_global(machine, state->charbank); diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index e5082206c3e..5ae15a5ea17 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -1683,10 +1683,10 @@ static UINT32 *work_ram; static MACHINE_START( firebeat ) { /* set conservative DRC options */ - ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS); + ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x01ffffff, FALSE, work_ram); + ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x01ffffff, FALSE, work_ram); } static ADDRESS_MAP_START( firebeat_map, ADDRESS_SPACE_PROGRAM, 32 ) @@ -1909,7 +1909,7 @@ static MACHINE_RESET( firebeat ) } SCSIGetDevice( atapi_device_data[1], &cd ); - cdda_set_cdrom(devtag_get_device(machine, "cdda"), cd); + cdda_set_cdrom(machine->device("cdda"), cd); } static MACHINE_DRIVER_START(firebeat) @@ -2157,7 +2157,7 @@ static void security_w(running_device *device, UINT8 data) { int r = ibutton_w(data); if (r >= 0) - ppc4xx_spu_receive_byte(devtag_get_device(device->machine, "maincpu"), r); + ppc4xx_spu_receive_byte(device->machine->device("maincpu"), r); } /*****************************************************************************/ @@ -2190,7 +2190,7 @@ static void init_firebeat(running_machine *machine) cur_cab_data = cab_data; - ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), security_w); + ppc4xx_spu_set_tx_handler(machine->device("maincpu"), security_w); set_ibutton(rom); diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c index 9128378b7d2..014fda6c2cf 100644 --- a/src/mame/drivers/firefox.c +++ b/src/mame/drivers/firefox.c @@ -100,7 +100,7 @@ static WRITE8_HANDLER( firefox_disc_lock_w ) static WRITE8_HANDLER( audio_enable_w ) { - sound_set_output_gain(devtag_get_device(space->machine, "ldsound"), ~offset & 1, (data & 0x80) ? 1.0 : 0.0); + sound_set_output_gain(space->machine->device("ldsound"), ~offset & 1, (data & 0x80) ? 1.0 : 0.0); } static WRITE8_HANDLER( firefox_disc_reset_w ) @@ -304,7 +304,7 @@ static READ8_DEVICE_HANDLER( riot_porta_r ) static WRITE8_DEVICE_HANDLER( riot_porta_w ) { - running_device *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = device->machine->device("tms"); /* handle 5220 read */ tms5220_rsq_w(tms, (data>>1) & 1); @@ -430,10 +430,10 @@ static void firq_gen(running_device *device, int state) static MACHINE_START( firefox ) { memory_configure_bank(machine, "bank1", 0, 32, memory_region(machine, "maincpu") + 0x10000, 0x1000); - nvram_1c = devtag_get_device(machine, "nvram_1c"); - nvram_1d = devtag_get_device(machine, "nvram_1d"); + nvram_1c = machine->device("nvram_1c"); + nvram_1d = machine->device("nvram_1d"); - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); vp931_set_data_ready_callback(laserdisc, firq_gen); control_num = 0; diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c index 20585d1d56a..d3e129afd80 100644 --- a/src/mame/drivers/firetrap.c +++ b/src/mame/drivers/firetrap.c @@ -620,9 +620,9 @@ static MACHINE_START( firetrap ) UINT8 *MAIN = memory_region(machine, "maincpu"); UINT8 *SOUND = memory_region(machine, "audiocpu"); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->msm = devtag_get_device(machine, "msm"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->msm = machine->device("msm"); memory_configure_bank(machine, "bank1", 0, 4, &MAIN[0x10000], 0x4000); memory_configure_bank(machine, "bank2", 0, 2, &SOUND[0x10000], 0x4000); diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c index 3635a8d75e1..958d4f07033 100644 --- a/src/mame/drivers/firetrk.c +++ b/src/mame/drivers/firetrk.c @@ -39,7 +39,7 @@ static INPUT_CHANGED( service_mode_switch_changed ) static INPUT_CHANGED( firetrk_horn_changed ) { - running_device *discrete = devtag_get_device(field->port->machine, "discrete"); + running_device *discrete = field->port->machine->device("discrete"); discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval); } @@ -54,7 +54,7 @@ static INPUT_CHANGED( gear_changed ) static INTERRUPT_GEN( firetrk_interrupt ) { /* Super Bug - ASR - when is this used and what is an ASR? */ -// discrete_sound_w(devtag_get_device(machine, "discrete"), SUPERBUG_ASR_EN, 0); +// discrete_sound_w(machine->device("discrete"), SUPERBUG_ASR_EN, 0); /* NMI interrupts are disabled during service mode in firetrk and montecar */ if (!in_service_mode) @@ -66,7 +66,7 @@ static TIMER_CALLBACK( periodic_callback ) { int scanline = param; - generic_pulse_irq_line(devtag_get_device(machine, "maincpu"), 0); + generic_pulse_irq_line(machine->device("maincpu"), 0); /* IRQs are generated by inverse 16V signal */ scanline += 32; @@ -80,7 +80,7 @@ static TIMER_CALLBACK( periodic_callback ) static WRITE8_HANDLER( firetrk_output_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); /* BIT0 => START1 LAMP */ set_led_status(space->machine, 0, !(data & 0x01)); @@ -111,7 +111,7 @@ static WRITE8_HANDLER( firetrk_output_w ) static WRITE8_HANDLER( superbug_output_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); /* BIT0 => START LAMP */ set_led_status(space->machine, 0, offset & 0x01); @@ -131,7 +131,7 @@ static WRITE8_HANDLER( superbug_output_w ) static WRITE8_HANDLER( montecar_output_1_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); /* BIT0 => START LAMP */ set_led_status(space->machine, 0, !(data & 0x01)); @@ -158,7 +158,7 @@ static WRITE8_HANDLER( montecar_output_1_w ) static WRITE8_HANDLER( montecar_output_2_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); firetrk_flash = data & 0x80; diff --git a/src/mame/drivers/flkatck.c b/src/mame/drivers/flkatck.c index 1e74acb3e9d..19ef016c24a 100644 --- a/src/mame/drivers/flkatck.c +++ b/src/mame/drivers/flkatck.c @@ -202,8 +202,8 @@ static MACHINE_START( flkatck ) memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x2000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007121 = devtag_get_device(machine, "k007121"); + state->audiocpu = machine->device("audiocpu"); + state->k007121 = machine->device("k007121"); state_save_register_global(machine, state->irq_enabled); state_save_register_global_array(machine, state->multiply_reg); @@ -214,7 +214,7 @@ static MACHINE_RESET( flkatck ) { flkatck_state *state = (flkatck_state *)machine->driver_data; - k007232_set_bank(devtag_get_device(machine, "konami"), 0, 1); + k007232_set_bank(machine->device("konami"), 0, 1); state->irq_enabled = 0; state->multiply_reg[0] = 0; diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c index 388062783ff..d6731b59007 100644 --- a/src/mame/drivers/flstory.c +++ b/src/mame/drivers/flstory.c @@ -658,9 +658,9 @@ static MACHINE_START( flstory ) { flstory_state *state = (flstory_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); /* video */ state_save_register_global(machine, state->char_bank); diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c index 959da53d024..5527d2fb4bf 100644 --- a/src/mame/drivers/flyball.c +++ b/src/mame/drivers/flyball.c @@ -364,7 +364,7 @@ static MACHINE_START( flyball ) { flyball_state *state = (flyball_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->pitcher_vert); state_save_register_global(machine, state->pitcher_horz); diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c index 5f5a687670d..601a3bfed6a 100644 --- a/src/mame/drivers/foodf.c +++ b/src/mame/drivers/foodf.c @@ -121,7 +121,7 @@ static TIMER_DEVICE_CALLBACK( scanline_update ) mystery yet */ /* INT 1 is on 32V */ - atarigen_scanline_int_gen(devtag_get_device(timer.machine, "maincpu")); + atarigen_scanline_int_gen(timer.machine->device("maincpu")); /* advance to the next interrupt */ scanline += 64; diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c index 2d71376347c..eeb4fa4d3cd 100644 --- a/src/mame/drivers/fromanc2.c +++ b/src/mame/drivers/fromanc2.c @@ -517,11 +517,11 @@ static MACHINE_START( fromanc4 ) { fromanc2_state *state = (fromanc2_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->eeprom = devtag_get_device(machine, "eeprom"); - state->left_screen = devtag_get_device(machine, "lscreen"); - state->right_screen = devtag_get_device(machine, "rscreen"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->eeprom = machine->device("eeprom"); + state->left_screen = machine->device("lscreen"); + state->right_screen = machine->device("rscreen"); state_save_register_global(machine, state->portselect); state_save_register_global(machine, state->sndcpu_nmi_flag); diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c index 7d7fcd20085..d4338f64be0 100644 --- a/src/mame/drivers/fromance.c +++ b/src/mame/drivers/fromance.c @@ -965,7 +965,7 @@ static MACHINE_START( fromance ) memory_configure_bank(machine, "bank1", 0, 0x100, &ROM[0x10000], 0x4000); - state->subcpu = devtag_get_device(machine, "sub"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->directionflag); state_save_register_global(machine, state->commanddata); diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c index a02b0ed1df4..7536f9e8b35 100644 --- a/src/mame/drivers/funkyjet.c +++ b/src/mame/drivers/funkyjet.c @@ -300,9 +300,9 @@ static MACHINE_START( funkyjet ) { funkyjet_state *state = (funkyjet_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->deco16ic = machine->device("deco_custom"); } static MACHINE_DRIVER_START( funkyjet ) diff --git a/src/mame/drivers/funybubl.c b/src/mame/drivers/funybubl.c index 7b2d81a8a29..e842ab301d3 100644 --- a/src/mame/drivers/funybubl.c +++ b/src/mame/drivers/funybubl.c @@ -205,7 +205,7 @@ static MACHINE_START( funybubl ) funybubl_state *state = (funybubl_state *)machine->driver_data; UINT8 *ROM = memory_region(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state->banked_vram = auto_alloc_array(machine, UINT8, 0x2000); state_save_register_global_pointer(machine, state->banked_vram, 0x2000); diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c index f54563ce97f..f1f34db1fec 100644 --- a/src/mame/drivers/fuukifg2.c +++ b/src/mame/drivers/fuukifg2.c @@ -429,8 +429,8 @@ static MACHINE_START( fuuki16 ) memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x8000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state->raster_interrupt_timer = timer_alloc(machine, raster_interrupt_callback, NULL); } diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c index b8b9f19fb75..50767c66007 100644 --- a/src/mame/drivers/fuukifg3.c +++ b/src/mame/drivers/fuukifg3.c @@ -515,8 +515,8 @@ static MACHINE_START( fuuki32 ) memory_configure_bank(machine, "bank1", 0, 0x3e, &ROM[0x10000], 0x8000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "soundcpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("soundcpu"); state->raster_interrupt_timer = timer_alloc(machine, raster_interrupt_callback, NULL); diff --git a/src/mame/drivers/gaelco.c b/src/mame/drivers/gaelco.c index ef160e8847b..241a2e26027 100644 --- a/src/mame/drivers/gaelco.c +++ b/src/mame/drivers/gaelco.c @@ -494,7 +494,7 @@ static MACHINE_START( gaelco ) { gaelco_state *state = (gaelco_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_DRIVER_START( bigkarnk ) diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c index 0a6aafc763f..ae58879eabc 100644 --- a/src/mame/drivers/gaiden.c +++ b/src/mame/drivers/gaiden.c @@ -306,7 +306,7 @@ static MACHINE_RESET( raiga ) static MACHINE_START( raiga ) { gaiden_state *state = (gaiden_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->prot); state_save_register_global(machine, state->jumpcode); diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c index 0de04c19bdf..ce7a8eb9651 100644 --- a/src/mame/drivers/galaga.c +++ b/src/mame/drivers/galaga.c @@ -745,19 +745,19 @@ static WRITE8_HANDLER( bosco_latch_w ) switch (offset) { case 0x00: /* IRQ1 */ - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); break; case 0x01: /* IRQ2 */ - cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit); + cpu_interrupt_enable(space->machine->device("sub"), bit); if (!bit) cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); break; case 0x02: /* NMION */ - cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), !bit); + cpu_interrupt_enable(space->machine->device("sub2"), !bit); break; case 0x03: /* RESET */ @@ -866,7 +866,7 @@ static TIMER_CALLBACK( cpu3_interrupt_callback ) { int scanline = param; - nmi_line_pulse(devtag_get_device(machine, "sub2")); + nmi_line_pulse(machine->device("sub2")); scanline = scanline + 128; if (scanline >= 272) diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c index cbc57fb8d71..3cb0f031331 100644 --- a/src/mame/drivers/galastrm.c +++ b/src/mame/drivers/galastrm.c @@ -131,7 +131,7 @@ popmessage(t); if (ACCESSING_BITS_0_7) { - running_device *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = space->machine->device("eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c index 7835488df19..ce649bee544 100644 --- a/src/mame/drivers/galaxia.c +++ b/src/mame/drivers/galaxia.c @@ -38,9 +38,9 @@ static VIDEO_UPDATE( galaxia ) bitmap_t *s2636_1_bitmap; bitmap_t *s2636_2_bitmap; - running_device *s2636_0 = devtag_get_device(screen->machine, "s2636_0"); - running_device *s2636_1 = devtag_get_device(screen->machine, "s2636_1"); - running_device *s2636_2 = devtag_get_device(screen->machine, "s2636_2"); + running_device *s2636_0 = screen->machine->device("s2636_0"); + running_device *s2636_1 = screen->machine->device("s2636_1"); + running_device *s2636_2 = screen->machine->device("s2636_2"); count = 0; diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index 78c6259c7fd..29a4ce30334 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -537,8 +537,8 @@ static READ8_HANDLER( konami_ay8910_r ) { /* the decoding here is very simplistic, and you can address both simultaneously */ UINT8 result = 0xff; - if (offset & 0x20) result &= ay8910_r(devtag_get_device(space->machine, "8910.1"), 0); - if (offset & 0x80) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0); + if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0); + if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0); return result; } @@ -548,14 +548,14 @@ static WRITE8_HANDLER( konami_ay8910_w ) /* AV 4,5 ==> AY8910 #2 */ /* the decoding here is very simplistic, and you can address two simultaneously */ if (offset & 0x10) - ay8910_address_w(devtag_get_device(space->machine, "8910.1"), 0, data); + ay8910_address_w(space->machine->device("8910.1"), 0, data); else if (offset & 0x20) - ay8910_data_w(devtag_get_device(space->machine, "8910.1"), 0, data); + ay8910_data_w(space->machine->device("8910.1"), 0, data); /* AV6,7 ==> AY8910 #1 */ if (offset & 0x40) - ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data); + ay8910_address_w(space->machine->device("8910.0"), 0, data); else if (offset & 0x80) - ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data); + ay8910_data_w(space->machine->device("8910.0"), 0, data); } @@ -611,7 +611,7 @@ static READ8_DEVICE_HANDLER( konami_sound_timer_r ) static WRITE8_HANDLER( konami_sound_filter_w ) { - running_device *discrete = devtag_get_device(space->machine, "konami"); + running_device *discrete = space->machine->device("konami"); static const char *const ayname[2] = { "8910.0", "8910.1" }; int which, chan; @@ -619,7 +619,7 @@ static WRITE8_HANDLER( konami_sound_filter_w ) /* AV0 .. AV5 ==> AY8910 #2 */ /* AV6 .. AV11 ==> AY8910 #1 */ for (which = 0; which < 2; which++) - if (devtag_get_device(space->machine, ayname[which]) != NULL) + if (space->machine->device(ayname[which]) != NULL) for (chan = 0; chan < 3; chan++) { UINT8 bits = (offset >> (2 * chan + 6 * (1 - which))) & 3; @@ -676,8 +676,8 @@ static READ8_HANDLER( theend_ppi8255_r ) { /* the decoding here is very simplistic, and you can address both simultaneously */ UINT8 result = 0xff; - if (offset & 0x0100) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset & 3); - if (offset & 0x0200) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset & 3); + if (offset & 0x0100) result &= ppi8255_r(space->machine->device("ppi8255_0"), offset & 3); + if (offset & 0x0200) result &= ppi8255_r(space->machine->device("ppi8255_1"), offset & 3); return result; } @@ -685,8 +685,8 @@ static READ8_HANDLER( theend_ppi8255_r ) static WRITE8_HANDLER( theend_ppi8255_w ) { /* the decoding here is very simplistic, and you can address both simultaneously */ - if (offset & 0x0100) ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), offset & 3, data); - if (offset & 0x0200) ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data); + if (offset & 0x0100) ppi8255_w(space->machine->device("ppi8255_0"), offset & 3, data); + if (offset & 0x0200) ppi8255_w(space->machine->device("ppi8255_1"), offset & 3, data); } @@ -797,7 +797,7 @@ static READ8_HANDLER( sfx_sample_io_r ) { /* the decoding here is very simplistic, and you can address both simultaneously */ UINT8 result = 0xff; - if (offset & 0x04) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_2"), offset & 3); + if (offset & 0x04) result &= ppi8255_r(space->machine->device("ppi8255_2"), offset & 3); return result; } @@ -805,8 +805,8 @@ static READ8_HANDLER( sfx_sample_io_r ) static WRITE8_HANDLER( sfx_sample_io_w ) { /* the decoding here is very simplistic, and you can address both simultaneously */ - if (offset & 0x04) ppi8255_w(devtag_get_device(space->machine, "ppi8255_2"), offset & 3, data); - if (offset & 0x10) dac_signed_data_w(devtag_get_device(space->machine, "dac"), data); + if (offset & 0x04) ppi8255_w(space->machine->device("ppi8255_2"), offset & 3, data); + if (offset & 0x10) dac_signed_data_w(space->machine->device("dac"), data); } @@ -844,8 +844,8 @@ static READ8_HANDLER( frogger_ppi8255_r ) { /* the decoding here is very simplistic, and you can address both simultaneously */ UINT8 result = 0xff; - if (offset & 0x1000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 1) & 3); - if (offset & 0x2000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 1) & 3); + if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 1) & 3); + if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 1) & 3); return result; } @@ -853,8 +853,8 @@ static READ8_HANDLER( frogger_ppi8255_r ) static WRITE8_HANDLER( frogger_ppi8255_w ) { /* the decoding here is very simplistic, and you can address both simultaneously */ - if (offset & 0x1000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 1) & 3, data); - if (offset & 0x2000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 1) & 3, data); + if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 1) & 3, data); + if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 1) & 3, data); } @@ -862,7 +862,7 @@ static READ8_HANDLER( frogger_ay8910_r ) { /* the decoding here is very simplistic */ UINT8 result = 0xff; - if (offset & 0x40) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0); + if (offset & 0x40) result &= ay8910_r(space->machine->device("8910.0"), 0); return result; } @@ -872,9 +872,9 @@ static WRITE8_HANDLER( frogger_ay8910_w ) /* the decoding here is very simplistic */ /* AV6,7 ==> AY8910 #1 */ if (offset & 0x40) - ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data); + ay8910_data_w(space->machine->device("8910.0"), 0, data); else if (offset & 0x80) - ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data); + ay8910_address_w(space->machine->device("8910.0"), 0, data); } @@ -903,8 +903,8 @@ static READ8_HANDLER( frogf_ppi8255_r ) { /* the decoding here is very simplistic, and you can address both simultaneously */ UINT8 result = 0xff; - if (offset & 0x1000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 3) & 3); - if (offset & 0x2000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 3) & 3); + if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 3) & 3); + if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 3) & 3); return result; } @@ -912,8 +912,8 @@ static READ8_HANDLER( frogf_ppi8255_r ) static WRITE8_HANDLER( frogf_ppi8255_w ) { /* the decoding here is very simplistic, and you can address both simultaneously */ - if (offset & 0x1000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 3) & 3, data); - if (offset & 0x2000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 3) & 3, data); + if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 3) & 3, data); + if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 3) & 3, data); } @@ -924,10 +924,10 @@ static WRITE8_HANDLER( frogf_ppi8255_w ) * *************************************/ -static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 4) & 3); } -static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 4) & 3); } -static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 4) & 3, data); } -static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 4) & 3, data); } +static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 4) & 3); } +static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 4) & 3); } +static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 4) & 3, data); } +static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 4) & 3, data); } @@ -941,9 +941,9 @@ static READ8_HANDLER( scorpion_ay8910_r ) { /* the decoding here is very simplistic, and you can address both simultaneously */ UINT8 result = 0xff; - if (offset & 0x08) result &= ay8910_r(devtag_get_device(space->machine, "8910.2"), 0); - if (offset & 0x20) result &= ay8910_r(devtag_get_device(space->machine, "8910.1"), 0); - if (offset & 0x80) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0); + if (offset & 0x08) result &= ay8910_r(space->machine->device("8910.2"), 0); + if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0); + if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0); return result; } @@ -951,12 +951,12 @@ static READ8_HANDLER( scorpion_ay8910_r ) static WRITE8_HANDLER( scorpion_ay8910_w ) { /* the decoding here is very simplistic, and you can address all six simultaneously */ - if (offset & 0x04) ay8910_address_w(devtag_get_device(space->machine, "8910.2"), 0, data); - if (offset & 0x08) ay8910_data_w(devtag_get_device(space->machine, "8910.2"), 0, data); - if (offset & 0x10) ay8910_address_w(devtag_get_device(space->machine, "8910.1"), 0, data); - if (offset & 0x20) ay8910_data_w(devtag_get_device(space->machine, "8910.1"), 0, data); - if (offset & 0x40) ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data); - if (offset & 0x80) ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data); + if (offset & 0x04) ay8910_address_w(space->machine->device("8910.2"), 0, data); + if (offset & 0x08) ay8910_data_w(space->machine->device("8910.2"), 0, data); + if (offset & 0x10) ay8910_address_w(space->machine->device("8910.1"), 0, data); + if (offset & 0x20) ay8910_data_w(space->machine->device("8910.1"), 0, data); + if (offset & 0x40) ay8910_address_w(space->machine->device("8910.0"), 0, data); + if (offset & 0x80) ay8910_data_w(space->machine->device("8910.0"), 0, data); } @@ -991,7 +991,7 @@ static WRITE8_DEVICE_HANDLER( scorpion_protection_w ) static READ8_HANDLER( scorpion_digitalker_intr_r ) { - running_device *digitalker = devtag_get_device(space->machine, "digitalker"); + running_device *digitalker = space->machine->device("digitalker"); return digitalker_0_intr_r(digitalker); } @@ -1071,7 +1071,7 @@ static WRITE8_HANDLER( zigzag_ay8910_w ) /* bit 0 = WRITE */ /* bit 1 = C/D */ if ((offset & 1) != 0) - ay8910_data_address_w(devtag_get_device(space->machine, "aysnd"), offset >> 1, zigzag_ay8910_latch); + ay8910_data_address_w(space->machine->device("aysnd"), offset >> 1, zigzag_ay8910_latch); break; case 0x100: @@ -1163,21 +1163,21 @@ static WRITE8_HANDLER( mshuttle_ay8910_cs_w ) static WRITE8_HANDLER( mshuttle_ay8910_control_w ) { if (!mshuttle_ay8910_cs) - ay8910_address_w(devtag_get_device(space->machine, "aysnd"), offset, data); + ay8910_address_w(space->machine->device("aysnd"), offset, data); } static WRITE8_HANDLER( mshuttle_ay8910_data_w ) { if (!mshuttle_ay8910_cs) - ay8910_data_w(devtag_get_device(space->machine, "aysnd"), offset, data); + ay8910_data_w(space->machine->device("aysnd"), offset, data); } static READ8_HANDLER( mshuttle_ay8910_data_r ) { if (!mshuttle_ay8910_cs) - return ay8910_r(devtag_get_device(space->machine, "aysnd"), offset); + return ay8910_r(space->machine->device("aysnd"), offset); return 0xff; } diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c index 9ccc103bd42..490321311b4 100644 --- a/src/mame/drivers/galpani2.c +++ b/src/mame/drivers/galpani2.c @@ -229,7 +229,7 @@ static void galpani2_mcu_nmi1(running_machine *machine) static void galpani2_mcu_nmi2(running_machine *machine) { - galpani2_write_kaneko(devtag_get_device(machine, "maincpu")); + galpani2_write_kaneko(machine->device("maincpu")); //logerror("%s : MCU executes CHECKs synchro\n", cpuexec_describe_context(machine)); } diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c index f812829cd85..6afdb3e88b2 100644 --- a/src/mame/drivers/galpanic.c +++ b/src/mame/drivers/galpanic.c @@ -137,7 +137,7 @@ VIDEO_UPDATE( comad ); static VIDEO_EOF( galpanic ) { - running_device *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = machine->device("pandora"); pandora_eof(pandora); } @@ -163,7 +163,7 @@ static INTERRUPT_GEN( galhustl_interrupt ) static WRITE16_HANDLER( galpanic_6295_bankswitch_w ) { - running_device *pandora = devtag_get_device(space->machine, "pandora"); + running_device *pandora = space->machine->device("pandora"); if (ACCESSING_BITS_8_15) { @@ -189,7 +189,7 @@ static WRITE16_HANDLER( galpanica_6295_bankswitch_w ) #ifdef UNUSED_FUNCTION static WRITE16_HANDLER( galpanica_misc_w ) { - running_device *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = machine->device("pandora"); if (ACCESSING_BITS_0_7) { diff --git a/src/mame/drivers/galspnbl.c b/src/mame/drivers/galspnbl.c index 7a7fedb1e5f..2fcd21e5ec3 100644 --- a/src/mame/drivers/galspnbl.c +++ b/src/mame/drivers/galspnbl.c @@ -204,7 +204,7 @@ static MACHINE_START( galspnbl ) { galspnbl_state *state = (galspnbl_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_DRIVER_START( galspnbl ) diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c index 98ae47f7bf2..a8cc61c3dee 100644 --- a/src/mame/drivers/gamecstl.c +++ b/src/mame/drivers/gamecstl.c @@ -594,18 +594,18 @@ static IRQ_CALLBACK(irq_callback) static MACHINE_START(gamecstl) { - gamecstl_devices.pit8254 = devtag_get_device( machine, "pit8254" ); - gamecstl_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" ); - gamecstl_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" ); - gamecstl_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" ); - gamecstl_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" ); + gamecstl_devices.pit8254 = machine->device( "pit8254" ); + gamecstl_devices.pic8259_1 = machine->device( "pic8259_1" ); + gamecstl_devices.pic8259_2 = machine->device( "pic8259_2" ); + gamecstl_devices.dma8237_1 = machine->device( "dma8237_1" ); + gamecstl_devices.dma8237_2 = machine->device( "dma8237_2" ); } static MACHINE_RESET(gamecstl) { memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + 0x30000); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); } diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c index 32b5685b51f..389d59ca9e8 100644 --- a/src/mame/drivers/gameplan.c +++ b/src/mame/drivers/gameplan.c @@ -984,12 +984,12 @@ static MACHINE_START( gameplan ) { gameplan_state *state = (gameplan_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->riot = devtag_get_device(machine, "riot"); - state->via_0 = devtag_get_device(machine, "via6522_0"); - state->via_1 = devtag_get_device(machine, "via6522_1"); - state->via_2 = devtag_get_device(machine, "via6522_2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->riot = machine->device("riot"); + state->via_0 = machine->device("via6522_0"); + state->via_1 = machine->device("via6522_1"); + state->via_2 = machine->device("via6522_2"); /* register for save states */ state_save_register_global(machine, state->current_port); diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c index bb3c9dfaa3e..812b889830d 100644 --- a/src/mame/drivers/gaplus.c +++ b/src/mame/drivers/gaplus.c @@ -184,7 +184,7 @@ static WRITE8_DEVICE_HANDLER( gaplus_snd_sharedram_w ) static WRITE8_HANDLER( gaplus_irq_1_ctrl_w ) { int bit = !BIT(offset, 11); - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } @@ -192,7 +192,7 @@ static WRITE8_HANDLER( gaplus_irq_1_ctrl_w ) static WRITE8_HANDLER( gaplus_irq_3_ctrl_w ) { int bit = !BIT(offset, 13); - cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), bit); + cpu_interrupt_enable(space->machine->device("sub2"), bit); if (!bit) cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE); } @@ -200,7 +200,7 @@ static WRITE8_HANDLER( gaplus_irq_3_ctrl_w ) static WRITE8_HANDLER( gaplus_irq_2_ctrl_w ) { int bit = offset & 1; - cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit); + cpu_interrupt_enable(space->machine->device("sub"), bit); if (!bit) cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); } @@ -210,13 +210,13 @@ static WRITE8_HANDLER( gaplus_sreset_w ) int bit = !BIT(offset, 11); cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); - mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit); + mappy_sound_enable(space->machine->device("namco"), bit); } static WRITE8_HANDLER( gaplus_freset_w ) { - running_device *io58xx = devtag_get_device(space->machine, "58xx"); - running_device *io56xx = devtag_get_device(space->machine, "56xx"); + running_device *io58xx = space->machine->device("58xx"); + running_device *io56xx = space->machine->device("56xx"); int bit = !BIT(offset, 11); logerror("%04x: freset %d\n",cpu_get_pc(space->cpu), bit); @@ -228,14 +228,14 @@ static WRITE8_HANDLER( gaplus_freset_w ) static MACHINE_RESET( gaplus ) { /* on reset, VINTON is reset, while the other flags don't seem to be affected */ - cpu_interrupt_enable(devtag_get_device(machine, "sub"), 0); + cpu_interrupt_enable(machine->device("sub"), 0); cputag_set_input_line(machine, "sub", 0, CLEAR_LINE); } static TIMER_CALLBACK( namcoio_run ) { - running_device *io58xx = devtag_get_device(machine, "58xx"); - running_device *io56xx = devtag_get_device(machine, "56xx"); + running_device *io58xx = machine->device("58xx"); + running_device *io56xx = machine->device("56xx"); switch (param) { @@ -250,8 +250,8 @@ static TIMER_CALLBACK( namcoio_run ) static INTERRUPT_GEN( gaplus_interrupt_1 ) { - running_device *io58xx = devtag_get_device(device->machine, "58xx"); - running_device *io56xx = devtag_get_device(device->machine, "56xx"); + running_device *io58xx = device->machine->device("58xx"); + running_device *io56xx = device->machine->device("56xx"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c index d2e75fbef21..9a477de39f9 100644 --- a/src/mame/drivers/gauntlet.c +++ b/src/mame/drivers/gauntlet.c @@ -148,7 +148,7 @@ static void scanline_update(screen_device &screen, int scanline) /* sound IRQ is on 32V */ if (scanline & 32) - atarigen_6502_irq_gen(devtag_get_device(screen.machine, "audiocpu")); + atarigen_6502_irq_gen(screen.machine->device("audiocpu")); else atarigen_6502_irq_ack_r(space, 0); } @@ -173,7 +173,7 @@ static MACHINE_RESET( gauntlet ) atarigen_slapstic_reset(&state->atarigen); atarigen_interrupt_reset(&state->atarigen, update_interrupts); atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32); - atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu")); + atarigen_sound_io_reset(machine->device("audiocpu")); } @@ -217,7 +217,7 @@ static WRITE16_HANDLER( sound_reset_w ) { devtag_reset(space->machine, "ymsnd"); devtag_reset(space->machine, "tms"); - tms5220_set_frequency(devtag_get_device(space->machine, "tms"), ATARI_CLOCK_14MHz/2 / 11); + tms5220_set_frequency(space->machine->device("tms"), ATARI_CLOCK_14MHz/2 / 11); atarigen_set_ym2151_vol(space->machine, 0); atarigen_set_pokey_vol(space->machine, 0); atarigen_set_tms5220_vol(space->machine, 0); @@ -241,7 +241,7 @@ static READ8_HANDLER( switch_6502_r ) if (state->atarigen.cpu_to_sound_ready) temp ^= 0x80; if (state->atarigen.sound_to_cpu_ready) temp ^= 0x40; - if (!tms5220_readyq_r(devtag_get_device(space->machine, "tms"))) temp ^= 0x20; + if (!tms5220_readyq_r(space->machine->device("tms"))) temp ^= 0x20; if (!(input_port_read(space->machine, "803008") & 0x0008)) temp ^= 0x10; return temp; @@ -256,7 +256,7 @@ static READ8_HANDLER( switch_6502_r ) static WRITE8_HANDLER( sound_ctl_w ) { - running_device *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = space->machine->device("tms"); switch (offset & 7) { case 0: /* music reset, bit D7, low reset */ @@ -1627,7 +1627,7 @@ static void gauntlet_common_init(running_machine *machine, int slapstic, int vin gauntlet_state *state = (gauntlet_state *)machine->driver_data; UINT8 *rom = memory_region(machine, "maincpu"); state->atarigen.eeprom_default = NULL; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x038000, 0, slapstic); + atarigen_slapstic_init(machine->device("maincpu"), 0x038000, 0, slapstic); /* swap the top and bottom halves of the main CPU ROM images */ atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000); diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c index a7538d1275b..4c9faa9f93a 100644 --- a/src/mame/drivers/gbusters.c +++ b/src/mame/drivers/gbusters.c @@ -282,11 +282,11 @@ static MACHINE_START( gbusters ) machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k007232 = devtag_get_device(machine, "k007232"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); + state->k007232 = machine->device("k007232"); state_save_register_global(machine, state->palette_selected); state_save_register_global(machine, state->priority); @@ -298,7 +298,7 @@ static MACHINE_RESET( gbusters ) gbusters_state *state = (gbusters_state *)machine->driver_data; UINT8 *RAM = memory_region(machine, "maincpu"); - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), gbusters_banking); + konami_configure_set_lines(machine->device("maincpu"), gbusters_banking); /* mirror address for banked ROM */ memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000); diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c index 1ba44666ec4..5ca4f914445 100644 --- a/src/mame/drivers/gei.c +++ b/src/mame/drivers/gei.c @@ -150,13 +150,13 @@ static WRITE8_DEVICE_HANDLER( sound_w ) set_led_status(device->machine, 9,data & 0x08); /* bit 5 - ticket out in trivia games */ - ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, (data & 0x20)<< 2); + ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x20)<< 2); /* bit 6 enables NMI */ interrupt_enable_w(space, 0, data & 0x40); /* bit 7 goes directly to the sound amplifier */ - dac_data_w(devtag_get_device(device->machine, "dac"), ((data & 0x80) >> 7) * 255); + dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255); } static WRITE8_DEVICE_HANDLER( sound2_w ) @@ -173,7 +173,7 @@ static WRITE8_DEVICE_HANDLER( sound2_w ) set_led_status(device->machine, 12,data & 0x20); /* bit 7 goes directly to the sound amplifier */ - dac_data_w(devtag_get_device(device->machine, "dac"), ((data & 0x80) >> 7) * 255); + dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255); } static WRITE8_DEVICE_HANDLER( lamps2_w ) diff --git a/src/mame/drivers/gijoe.c b/src/mame/drivers/gijoe.c index f7ba36fc24b..75342aa391c 100644 --- a/src/mame/drivers/gijoe.c +++ b/src/mame/drivers/gijoe.c @@ -278,12 +278,12 @@ static MACHINE_START( gijoe ) { gijoe_state *state = (gijoe_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k054539 = devtag_get_device(machine, "k054539"); - state->k056832 = devtag_get_device(machine, "k056832"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053251 = devtag_get_device(machine, "k053251"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k054539 = machine->device("k054539"); + state->k056832 = machine->device("k056832"); + state->k053246 = machine->device("k053246"); + state->k053251 = machine->device("k053251"); state->dmadelay_timer = timer_alloc(machine, dmaend_callback, NULL); diff --git a/src/mame/drivers/ginganin.c b/src/mame/drivers/ginganin.c index be03b420271..098d8cf5b10 100644 --- a/src/mame/drivers/ginganin.c +++ b/src/mame/drivers/ginganin.c @@ -306,7 +306,7 @@ static MACHINE_START( ginganin ) { ginganin_state *state = (ginganin_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->layers_ctrl); state_save_register_global(machine, state->flipscreen); diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c index 7355582cfbf..6d3501b1de1 100644 --- a/src/mame/drivers/go2000.c +++ b/src/mame/drivers/go2000.c @@ -316,7 +316,7 @@ static MACHINE_START( go2000 ) memory_set_bank(machine, "bank1", 0); - state->soundcpu = devtag_get_device(machine, "soundcpu"); + state->soundcpu = machine->device("soundcpu"); } static MACHINE_DRIVER_START( go2000 ) diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c index 0a81cdc815e..69d42f08604 100644 --- a/src/mame/drivers/goal92.c +++ b/src/mame/drivers/goal92.c @@ -297,7 +297,7 @@ static MACHINE_START( goal92 ) memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->fg_bank); state_save_register_global(machine, state->msm5205next); diff --git a/src/mame/drivers/gotcha.c b/src/mame/drivers/gotcha.c index a6f492da041..6f13e0ad79c 100644 --- a/src/mame/drivers/gotcha.c +++ b/src/mame/drivers/gotcha.c @@ -252,7 +252,7 @@ static MACHINE_START( gotcha ) { gotcha_state *state = (gotcha_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->banksel); state_save_register_global_array(machine, state->gfxbank); diff --git a/src/mame/drivers/gotya.c b/src/mame/drivers/gotya.c index 1403f4fbdb1..bb01c5f7a27 100644 --- a/src/mame/drivers/gotya.c +++ b/src/mame/drivers/gotya.c @@ -178,7 +178,7 @@ static MACHINE_START( gotya ) { gotya_state *state = (gotya_state *)machine->driver_data; - state->samples = devtag_get_device(machine, "samples"); + state->samples = machine->device("samples"); state_save_register_global(machine, state->scroll_bit_8); state_save_register_global(machine, state->theme_playing); diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c index c3a6d6579fd..a2b6f3b9433 100644 --- a/src/mame/drivers/gpworld.c +++ b/src/mame/drivers/gpworld.c @@ -217,7 +217,7 @@ static VIDEO_UPDATE( gpworld ) static MACHINE_START( gpworld ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); } diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c index dcb0adda50d..ae344c226f1 100644 --- a/src/mame/drivers/gradius3.c +++ b/src/mame/drivers/gradius3.c @@ -303,12 +303,12 @@ static MACHINE_START( gradius3 ) { gradius3_state *state = (gradius3_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->k007232 = devtag_get_device(machine, "k007232"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->k007232 = machine->device("k007232"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); state_save_register_global(machine, state->irqAen); state_save_register_global(machine, state->irqBmask); diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c index a6db5520515..bff644e2208 100644 --- a/src/mame/drivers/grchamp.c +++ b/src/mame/drivers/grchamp.c @@ -244,7 +244,7 @@ static WRITE8_HANDLER( led_board_w ) static WRITE8_HANDLER( cpu1_outputs_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); grchamp_state *state = (grchamp_state *)space->machine->driver_data; UINT8 diff = data ^ state->cpu1_out[offset]; state->cpu1_out[offset] = data; diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c index 531a7f81897..3fecded0232 100644 --- a/src/mame/drivers/gticlub.c +++ b/src/mame/drivers/gticlub.c @@ -264,8 +264,8 @@ static VIDEO_UPDATE( hangplt ) if (strcmp(screen->tag(), "lscreen") == 0) { - running_device *k001604 = devtag_get_device(screen->machine, "k001604_1"); - running_device *voodoo = devtag_get_device(screen->machine, "voodoo0"); + running_device *k001604 = screen->machine->device("k001604_1"); + running_device *voodoo = screen->machine->device("voodoo0"); // k001604_draw_back_layer(k001604, bitmap, cliprect); @@ -275,8 +275,8 @@ static VIDEO_UPDATE( hangplt ) } else if (strcmp(screen->tag(), "rscreen") == 0) { - running_device *k001604 = devtag_get_device(screen->machine, "k001604_2"); - running_device *voodoo = devtag_get_device(screen->machine, "voodoo1"); + running_device *k001604 = screen->machine->device("k001604_2"); + running_device *voodoo = screen->machine->device("voodoo1"); // k001604_draw_back_layer(k001604, bitmap, cliprect); @@ -293,38 +293,38 @@ static VIDEO_UPDATE( hangplt ) static READ32_HANDLER( gticlub_k001604_tile_r ) { - running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1"); + running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1"); return k001604_tile_r(k001604, offset, mem_mask); } static WRITE32_HANDLER( gticlub_k001604_tile_w ) { - running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1"); + running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1"); k001604_tile_w(k001604, offset, data, mem_mask); } static READ32_HANDLER( gticlub_k001604_char_r ) { - running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1"); + running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1"); return k001604_char_r(k001604, offset, mem_mask); } static WRITE32_HANDLER( gticlub_k001604_char_w ) { - running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1"); + running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1"); k001604_char_w(k001604, offset, data, mem_mask); } static READ32_HANDLER( gticlub_k001604_reg_r ) { - running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1"); + running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1"); return k001604_reg_r(k001604, offset, mem_mask); } static WRITE32_HANDLER( gticlub_k001604_reg_w ) { - running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1"); + running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1"); k001604_reg_w(k001604, offset, data, mem_mask); } @@ -348,8 +348,8 @@ static const eeprom_interface eeprom_intf = static READ8_HANDLER( sysreg_r ) { static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; - running_device *adc1038 = devtag_get_device(space->machine, "adc1038"); - running_device *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *adc1038 = space->machine->device("adc1038"); + running_device *eeprom = space->machine->device("eeprom"); switch (offset) { @@ -383,8 +383,8 @@ static READ8_HANDLER( sysreg_r ) static WRITE8_HANDLER( sysreg_w ) { - running_device *adc1038 = devtag_get_device(space->machine, "adc1038"); - running_device *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *adc1038 = space->machine->device("adc1038"); + running_device *eeprom = space->machine->device("eeprom"); switch (offset) { @@ -422,10 +422,10 @@ static WRITE8_HANDLER( sysreg_w ) static MACHINE_START( gticlub ) { /* set conservative DRC options */ - ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS); + ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x000fffff, FALSE, work_ram); + ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x000fffff, FALSE, work_ram); } static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c index 80959bfef14..e8e936fb315 100644 --- a/src/mame/drivers/guab.c +++ b/src/mame/drivers/guab.c @@ -623,7 +623,7 @@ static WRITE16_HANDLER( io_w ) } case 0x30: { - sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data & 0xff); + sn76496_w(space->machine->device("snsnd"), 0, data & 0xff); break; } case 0x31: diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c index d8109c86722..c1e29f9f058 100644 --- a/src/mame/drivers/gunbustr.c +++ b/src/mame/drivers/gunbustr.c @@ -114,7 +114,7 @@ popmessage(t); if (ACCESSING_BITS_0_7) { - running_device *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = space->machine->device("eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/hcastle.c b/src/mame/drivers/hcastle.c index 1b5d0429d10..36123f49509 100644 --- a/src/mame/drivers/hcastle.c +++ b/src/mame/drivers/hcastle.c @@ -183,9 +183,9 @@ static MACHINE_START( hcastle ) memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007121_1 = devtag_get_device(machine, "k007121_1"); - state->k007121_2 = devtag_get_device(machine, "k007121_2"); + state->audiocpu = machine->device("audiocpu"); + state->k007121_1 = machine->device("k007121_1"); + state->k007121_2 = machine->device("k007121_2"); state_save_register_global(machine, state->pf2_bankbase); state_save_register_global(machine, state->pf1_bankbase); diff --git a/src/mame/drivers/himesiki.c b/src/mame/drivers/himesiki.c index fe66844319f..920fc9f6158 100644 --- a/src/mame/drivers/himesiki.c +++ b/src/mame/drivers/himesiki.c @@ -274,7 +274,7 @@ static MACHINE_START( himesiki ) memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000); - state->subcpu = devtag_get_device(machine, "sub"); + state->subcpu = machine->device("sub"); state_save_register_global_array(machine, state->scrollx); state_save_register_global(machine, state->flipscreen); diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c index b406fbab91e..7a11b998894 100644 --- a/src/mame/drivers/hnayayoi.c +++ b/src/mame/drivers/hnayayoi.c @@ -543,7 +543,7 @@ static MACHINE_RESET( hnayayoi ) hnayayoi_state *state = (hnayayoi_state *)machine->driver_data; /* start with the MSM5205 reset */ - msm5205_reset_w(devtag_get_device(machine, "msm"), 1); + msm5205_reset_w(machine->device("msm"), 1); state->palbank = 0; state->blit_layer = 0; diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c index 92747a69bc4..c1a0702fb96 100644 --- a/src/mame/drivers/hng64.c +++ b/src/mame/drivers/hng64.c @@ -1648,12 +1648,12 @@ static INTERRUPT_GEN( irq_start ) static MACHINE_START(hyperneo) { /* set the fastest DRC options */ - mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); /* configure fast RAM regions for DRC */ - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x00ffffff, FALSE, hng_mainram); - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x04000000, 0x05ffffff, TRUE, hng_cart); - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); + mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x00ffffff, FALSE, hng_mainram); + mips3drc_add_fastram(machine->device("maincpu"), 0x04000000, 0x05ffffff, TRUE, hng_cart); + mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); } diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c index 380eee3cbb1..f9aa907537a 100644 --- a/src/mame/drivers/homedata.c +++ b/src/mame/drivers/homedata.c @@ -1149,11 +1149,11 @@ static MACHINE_START( homedata ) { homedata_state *state = (homedata_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->ym = devtag_get_device(machine, "ymsnd"); - state->sn = devtag_get_device(machine, "snsnd"); - state->dac = devtag_get_device(machine, "dac"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->ym = machine->device("ymsnd"); + state->sn = machine->device("snsnd"); + state->dac = machine->device("dac"); state_save_register_global(machine, state->visible_page); state_save_register_global(machine, state->flipscreen); diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index 95c2a5051b1..5d30f7af4b0 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -331,38 +331,38 @@ static UINT32 jvs_sdata_ptr = 0; static READ32_HANDLER( hornet_k037122_sram_r ) { - running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1"); + running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1"); return k037122_sram_r(k037122, offset, mem_mask); } static WRITE32_HANDLER( hornet_k037122_sram_w ) { - running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1"); + running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1"); k037122_sram_w(k037122, offset, data, mem_mask); } static READ32_HANDLER( hornet_k037122_char_r ) { - running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1"); + running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1"); return k037122_char_r(k037122, offset, mem_mask); } static WRITE32_HANDLER( hornet_k037122_char_w ) { - running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1"); + running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1"); k037122_char_w(k037122, offset, data, mem_mask); } static READ32_HANDLER( hornet_k037122_reg_r ) { - running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1"); + running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1"); return k037122_reg_r(k037122, offset, mem_mask); } static WRITE32_HANDLER( hornet_k037122_reg_w ) { - running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1"); + running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1"); k037122_reg_w(k037122, offset, data, mem_mask); } @@ -378,8 +378,8 @@ static void voodoo_vblank_1(running_device *device, int param) static VIDEO_UPDATE( hornet ) { - running_device *voodoo = devtag_get_device(screen->machine, "voodoo0"); - running_device *k037122 = devtag_get_device(screen->machine, "k037122_1"); + running_device *voodoo = screen->machine->device("voodoo0"); + running_device *k037122 = screen->machine->device("k037122_1"); voodoo_update(voodoo, bitmap, cliprect); @@ -394,8 +394,8 @@ static VIDEO_UPDATE( hornet_2board ) { if (strcmp(screen->tag(), "lscreen") == 0) { - running_device *k037122 = devtag_get_device(screen->machine, "k037122_1"); - running_device *voodoo = devtag_get_device(screen->machine, "voodoo0"); + running_device *k037122 = screen->machine->device("k037122_1"); + running_device *voodoo = screen->machine->device("voodoo0"); voodoo_update(voodoo, bitmap, cliprect); /* TODO: tilemaps per screen */ @@ -403,8 +403,8 @@ static VIDEO_UPDATE( hornet_2board ) } else if (strcmp(screen->tag(), "rscreen") == 0) { - running_device *k037122 = devtag_get_device(screen->machine, "k037122_2"); - running_device *voodoo = devtag_get_device(screen->machine, "voodoo1"); + running_device *k037122 = screen->machine->device("k037122_2"); + running_device *voodoo = screen->machine->device("voodoo1"); voodoo_update(voodoo, bitmap, cliprect); /* TODO: tilemaps per screen */ @@ -422,8 +422,8 @@ static READ8_HANDLER( sysreg_r ) { UINT8 r = 0; static const char *const portnames[] = { "IN0", "IN1", "IN2" }; - running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); - running_device *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *adc12138 = space->machine->device("adc12138"); + running_device *eeprom = space->machine->device("eeprom"); switch (offset) { @@ -456,7 +456,7 @@ static READ8_HANDLER( sysreg_r ) static WRITE8_HANDLER( sysreg_w ) { - running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); + running_device *adc12138 = space->machine->device("adc12138"); switch (offset) { @@ -836,10 +836,10 @@ static MACHINE_START( hornet ) jvs_sdata = auto_alloc_array_clear(machine, UINT8, 1024); /* set conservative DRC options */ - ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS); + ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x003fffff, FALSE, workram); + ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x003fffff, FALSE, workram); state_save_register_global(machine, led_reg0); state_save_register_global(machine, led_reg1); @@ -1083,19 +1083,19 @@ static int jvs_encode_data(running_machine *machine, UINT8 *in, int length) if (b == 0xe0) { sum += 0xd0 + 0xdf; - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xd0); - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xdf); + ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0); + ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xdf); } else if (b == 0xd0) { sum += 0xd0 + 0xcf; - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xd0); - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xcf); + ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0); + ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xcf); } else { sum += b; - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), b); + ppc4xx_spu_receive_byte(machine->device("maincpu"), b); } } return sum; @@ -1188,11 +1188,11 @@ static void jamma_jvs_cmd_exec(running_machine *machine) // write jvs return data sum = 0x00 + (rdata_ptr+1); - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xe0); // sync - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0x00); // node - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), rdata_ptr + 1); // num of bytes + ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xe0); // sync + ppc4xx_spu_receive_byte(machine->device("maincpu"), 0x00); // node + ppc4xx_spu_receive_byte(machine->device("maincpu"), rdata_ptr + 1); // num of bytes sum += jvs_encode_data(machine, rdata, rdata_ptr); - ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), sum - 1); // checksum + ppc4xx_spu_receive_byte(machine->device("maincpu"), sum - 1); // checksum jvs_sdata_ptr = 0; } @@ -1207,7 +1207,7 @@ static DRIVER_INIT(hornet) led_reg0 = led_reg1 = 0x7f; - ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), jamma_jvs_w); + ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w); } static DRIVER_INIT(hornet_2board) @@ -1218,7 +1218,7 @@ static DRIVER_INIT(hornet_2board) led_reg0 = led_reg1 = 0x7f; - ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), jamma_jvs_w); + ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w); } /*****************************************************************************/ diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c index f8d9f594911..27e37ecdc2c 100644 --- a/src/mame/drivers/hvyunit.c +++ b/src/mame/drivers/hvyunit.c @@ -295,7 +295,7 @@ static VIDEO_START(hvyunit) static VIDEO_UPDATE(hvyunit) { - running_device *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = screen->machine->device("pandora"); tilemap_set_scrollx( bg_tilemap,0, ((port0_data&0x40)<<2)+ hu_scrollx + SX_POS); //TODO tilemap_set_scrolly( bg_tilemap,0, ((port0_data&0x80)<<1)+ hu_scrolly + SY_POS); // TODO @@ -309,7 +309,7 @@ static VIDEO_UPDATE(hvyunit) static VIDEO_EOF(hvyunit) { - running_device *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = machine->device("pandora"); pandora_eof(pandora); } diff --git a/src/mame/drivers/hyperspt.c b/src/mame/drivers/hyperspt.c index 6eb16eaa977..bd8358d0b41 100644 --- a/src/mame/drivers/hyperspt.c +++ b/src/mame/drivers/hyperspt.c @@ -271,7 +271,7 @@ static MACHINE_START( hyperspt ) trackfld_state *state = (trackfld_state *)machine->driver_data; state->audiocpu = machine->device("audiocpu"); - state->vlm = devtag_get_device(machine, "vlm"); + state->vlm = machine->device("vlm"); /* sound */ state_save_register_global(machine, state->SN76496_latch); diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c index ec5dc93dbca..c65534cf5ec 100644 --- a/src/mame/drivers/hyprduel.c +++ b/src/mame/drivers/hyprduel.c @@ -654,8 +654,8 @@ static MACHINE_START( hyprduel ) { hyprduel_state *state = (hyprduel_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->blitter_bit); state_save_register_global(machine, state->requested_int); diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c index be020257eec..ff54728cb60 100644 --- a/src/mame/drivers/imolagp.c +++ b/src/mame/drivers/imolagp.c @@ -518,7 +518,7 @@ static MACHINE_START( imolagp ) { imolagp_state *state = (imolagp_state *)machine->driver_data; - state->slavecpu = devtag_get_device(machine, "slave"); + state->slavecpu = machine->device("slave"); state_save_register_global(machine, state->control); state_save_register_global(machine, state->scroll); diff --git a/src/mame/drivers/inufuku.c b/src/mame/drivers/inufuku.c index 37a5b82725a..2c13ebfa6fc 100644 --- a/src/mame/drivers/inufuku.c +++ b/src/mame/drivers/inufuku.c @@ -322,7 +322,7 @@ static MACHINE_START( inufuku ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000); memory_set_bank(machine, "bank1", 0); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->pending_command); state_save_register_global(machine, state->bg_scrollx); diff --git a/src/mame/drivers/ironhors.c b/src/mame/drivers/ironhors.c index abc154ff9fe..b96d32affdc 100644 --- a/src/mame/drivers/ironhors.c +++ b/src/mame/drivers/ironhors.c @@ -360,7 +360,7 @@ static MACHINE_START( ironhors ) { ironhors_state *state = (ironhors_state *)machine->driver_data; - state->soundcpu = devtag_get_device(machine, "soundcpu"); + state->soundcpu = machine->device("soundcpu"); state_save_register_global(machine, state->palettebank); state_save_register_global(machine, state->charbank); diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c index f21edad8d54..433f18228f4 100644 --- a/src/mame/drivers/istellar.c +++ b/src/mame/drivers/istellar.c @@ -80,7 +80,7 @@ static VIDEO_UPDATE( istellar ) static MACHINE_START( istellar ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); } diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c index d3d6369f8b0..c5c77ce78f1 100644 --- a/src/mame/drivers/itech32.c +++ b/src/mame/drivers/itech32.c @@ -738,7 +738,7 @@ static WRITE8_DEVICE_HANDLER( drivedge_portb_out ) set_led_status(space->machine, 1, data & 0x01); set_led_status(space->machine, 2, data & 0x02); set_led_status(space->machine, 3, data & 0x04); - ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, (data & 0x10) << 3); + ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3); coin_counter_w(space->machine, 0, (data & 0x20) >> 5); } @@ -757,7 +757,7 @@ static WRITE8_DEVICE_HANDLER( pia_portb_out ) /* bit 4 controls the ticket dispenser */ /* bit 5 controls the coin counter */ /* bit 6 controls the diagnostic sound LED */ - ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, (data & 0x10) << 3); + ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3); coin_counter_w(space->machine, 0, (data & 0x20) >> 5); } @@ -4045,7 +4045,7 @@ static DRIVER_INIT( wcbowln ) /* PIC 16C54 labeled as ITBWL-3 */ static void install_timekeeper(running_machine *machine) { - running_device *device = devtag_get_device(machine, "m48t02"); + running_device *device = machine->device("m48t02"); memory_install_readwrite32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), device, 0x681000, 0x6817ff, 0, 0, timekeeper_32be_r, timekeeper_32be_w); } diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c index 21957615439..bd0584fa8c8 100644 --- a/src/mame/drivers/itech8.c +++ b/src/mame/drivers/itech8.c @@ -776,7 +776,7 @@ static WRITE8_HANDLER( pia_portb_out ) /* bit 5 controls the coin counter */ /* bit 6 controls the diagnostic sound LED */ pia_portb_data = data; - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, (data & 0x10) << 3); + ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x10) << 3); coin_counter_w(space->machine, 0, (data & 0x20) >> 5); } @@ -790,7 +790,7 @@ static WRITE8_DEVICE_HANDLER( ym2203_portb_out ) /* bit 6 controls the diagnostic sound LED */ /* bit 7 controls the ticket dispenser */ pia_portb_data = data; - ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, data & 0x80); + ticket_dispenser_w(device->machine->device("ticket"), 0, data & 0x80); coin_counter_w(device->machine, 0, (data & 0x20) >> 5); } diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c index 234a98bfb2d..c20144d2f7e 100644 --- a/src/mame/drivers/jackal.c +++ b/src/mame/drivers/jackal.c @@ -342,8 +342,8 @@ static MACHINE_START( jackal ) memory_configure_bank(machine, "bank1", 1, 1, &ROM[0x14000], 0x8000); memory_set_bank(machine, "bank1", 0); - state->mastercpu = devtag_get_device(machine, "master"); - state->slavecpu = devtag_get_device(machine, "slave"); + state->mastercpu = machine->device("master"); + state->slavecpu = machine->device("slave"); state_save_register_global(machine, state->irq_enable); } @@ -355,7 +355,7 @@ static MACHINE_RESET( jackal ) // HACK: running at the nominal clock rate, music stops working // at the beginning of the game. This fixes it. - cpu_set_clockscale(devtag_get_device(machine, "slave"), 1.2f); + cpu_set_clockscale(machine->device("slave"), 1.2f); state->rambank = rgn; state->spritebank = rgn; diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c index 0fa87651169..4d8a3988f86 100644 --- a/src/mame/drivers/jackpool.c +++ b/src/mame/drivers/jackpool.c @@ -100,8 +100,8 @@ static READ16_HANDLER( jackpool_io_r ) case 0x1c: return input_port_read(space->machine,"BET"); case 0x1e: return 0xff; //ticket motor case 0x20: return 0xff; //hopper motor - case 0x2c: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom")); - case 0x2e: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom")); + case 0x2c: return eeprom_read_bit(space->machine->device("eeprom")); + case 0x2e: return eeprom_read_bit(space->machine->device("eeprom")); // default: printf("R %02x\n",offset*2); break; } @@ -128,11 +128,11 @@ static WRITE16_HANDLER( jackpool_io_w ) case 0x4a: /* ---- ---x Ticket motor */break; case 0x4c: /* ---- ---x Hopper motor */break; case 0x4e: map_vreg = data & 1; break; - case 0x50: eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; - case 0x52: eeprom_set_clock_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break; - case 0x54: eeprom_write_bit(devtag_get_device(space->machine,"eeprom"), data & 1); break; -// case 0x5a: eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; -// case 0x5c: eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; + case 0x50: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; + case 0x52: eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break; + case 0x54: eeprom_write_bit(space->machine->device("eeprom"), data & 1); break; +// case 0x5a: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; +// case 0x5c: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; case 0x60: break; // default: printf("[%02x] <- %02x W\n",offset*2,data); break; } @@ -141,17 +141,17 @@ static WRITE16_HANDLER( jackpool_io_w ) if(offset*2 == 0x54) { printf("Write bit %02x\n",data); - eeprom_write_bit(devtag_get_device(space->machine,"eeprom"), data & 1); + eeprom_write_bit(space->machine->device("eeprom"), data & 1); } if(offset*2 == 0x52) { printf("Clock bit %02x\n",data); - eeprom_set_clock_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); + eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); } if(offset*2 == 0x50) { printf("chip select bit %02x\n",data); - eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); + eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); } #endif } diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c index 55df0291aee..67fe356ad91 100644 --- a/src/mame/drivers/jangou.c +++ b/src/mame/drivers/jangou.c @@ -800,10 +800,10 @@ static MACHINE_START( common ) { jangou_state *state = (jangou_state *)machine->driver_data; - state->cpu_0 = devtag_get_device(machine, "cpu0"); - state->cpu_1 = devtag_get_device(machine, "cpu1"); - state->cvsd = devtag_get_device(machine, "cvsd"); - state->nsc = devtag_get_device(machine, "nsc"); + state->cpu_0 = machine->device("cpu0"); + state->cpu_1 = machine->device("cpu1"); + state->cvsd = machine->device("cvsd"); + state->nsc = machine->device("nsc"); state_save_register_global_array(machine, state->pen_data); state_save_register_global_array(machine, state->blit_data); diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c index 4fad3806f8f..6eca96b6f5e 100644 --- a/src/mame/drivers/jpmimpct.c +++ b/src/mame/drivers/jpmimpct.c @@ -198,12 +198,12 @@ static MACHINE_RESET( jpmimpct ) static WRITE16_HANDLER( m68k_tms_w ) { - tms34010_host_w(devtag_get_device(space->machine, "dsp"), offset, data); + tms34010_host_w(space->machine->device("dsp"), offset, data); } static READ16_HANDLER( m68k_tms_r ) { - return tms34010_host_r(devtag_get_device(space->machine, "dsp"), offset); + return tms34010_host_r(space->machine->device("dsp"), offset); } diff --git a/src/mame/drivers/jrpacman.c b/src/mame/drivers/jrpacman.c index 1ce0d37299f..bff3609ae1e 100644 --- a/src/mame/drivers/jrpacman.c +++ b/src/mame/drivers/jrpacman.c @@ -106,7 +106,7 @@ static WRITE8_HANDLER( jrpacman_interrupt_vector_w ) { - cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data); + cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data); cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c index d2e01b606b4..e20cb43058f 100644 --- a/src/mame/drivers/junofrst.c +++ b/src/mame/drivers/junofrst.c @@ -283,11 +283,11 @@ static MACHINE_START( junofrst ) timeplt_state *state = (timeplt_state *)machine->driver_data; state->maincpu = machine->device("maincpu"); - state->i8039 = devtag_get_device(machine, "mcu"); + state->i8039 = machine->device("mcu"); state->soundcpu = machine->device("audiocpu"); - state->filter_0_0 = devtag_get_device(machine, "filter.0.0"); - state->filter_0_1 = devtag_get_device(machine, "filter.0.1"); - state->filter_0_2 = devtag_get_device(machine, "filter.0.2"); + state->filter_0_0 = machine->device("filter.0.0"); + state->filter_0_1 = machine->device("filter.0.1"); + state->filter_0_2 = machine->device("filter.0.2"); state_save_register_global(machine, state->i8039_status); state_save_register_global(machine, state->last_irq); diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c index 4472c7ee2f1..eca1967a1cc 100644 --- a/src/mame/drivers/kaneko16.c +++ b/src/mame/drivers/kaneko16.c @@ -1770,7 +1770,7 @@ static WRITE8_DEVICE_HANDLER( kaneko16_eeprom_reset_w ) { // FIXME: the device line cannot be directly put in the interface due to inverse value! // we might want to define a "reversed" set_cs_line handler - running_device *eeprom = devtag_get_device(device->machine, "eeprom"); + running_device *eeprom = device->machine->device("eeprom"); // reset line asserted: reset. eeprom_set_cs_line(eeprom, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE ); } diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c index 6982260ec3c..899bc80b965 100644 --- a/src/mame/drivers/karnov.c +++ b/src/mame/drivers/karnov.c @@ -764,8 +764,8 @@ static MACHINE_START( karnov ) { karnov_state *state = (karnov_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->flipscreen); state_save_register_global_array(machine, state->scroll); diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c index 1e8e654484e..e2ff7e11bba 100644 --- a/src/mame/drivers/kchamp.c +++ b/src/mame/drivers/kchamp.c @@ -393,7 +393,7 @@ static MACHINE_START( kchamp ) { kchamp_state *state = (kchamp_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->nmi_enable); state_save_register_global(machine, state->sound_nmi_enable); diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c index 054fcb987e8..4f2fbe3a714 100644 --- a/src/mame/drivers/kingobox.c +++ b/src/mame/drivers/kingobox.c @@ -458,9 +458,9 @@ static MACHINE_START( kingofb ) { kingofb_state *state = (kingofb_state *)machine->driver_data; - state->video_cpu = devtag_get_device(machine, "video"); - state->sprite_cpu = devtag_get_device(machine, "sprite"); - state->audio_cpu = devtag_get_device(machine, "audiocpu"); + state->video_cpu = machine->device("video"); + state->sprite_cpu = machine->device("sprite"); + state->audio_cpu = machine->device("audiocpu"); state_save_register_global(machine, state->nmi_enable); state_save_register_global(machine, state->palette_bank); diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c index d0a5cd84228..59b3b8ecbc2 100644 --- a/src/mame/drivers/kinst.c +++ b/src/mame/drivers/kinst.c @@ -157,7 +157,7 @@ static const UINT8 *control_map; static MACHINE_START( kinst ) { - running_device *ide = devtag_get_device(machine, "ide"); + running_device *ide = machine->device("ide"); UINT8 *features = ide_get_features(ide); if (strncmp(machine->gamedrv->name, "kinst2", 6) != 0) @@ -190,12 +190,12 @@ static MACHINE_START( kinst ) } /* set the fastest DRC options */ - mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS); + mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS); /* configure fast RAM regions for DRC */ - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x08000000, 0x087fffff, FALSE, rambase2); - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x0007ffff, FALSE, rambase); - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); + mips3drc_add_fastram(machine->device("maincpu"), 0x08000000, 0x087fffff, FALSE, rambase2); + mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x0007ffff, FALSE, rambase); + mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); } diff --git a/src/mame/drivers/klax.c b/src/mame/drivers/klax.c index 6e9ce11d2c9..3b6a99d66cc 100644 --- a/src/mame/drivers/klax.c +++ b/src/mame/drivers/klax.c @@ -41,7 +41,7 @@ static void scanline_update(screen_device &screen, int scanline) { /* generate 32V signals */ if ((scanline & 32) == 0 && !(input_port_read(screen.machine, "P1") & 0x800)) - atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu")); + atarigen_scanline_int_gen(screen.machine->device("maincpu")); } diff --git a/src/mame/drivers/kncljoe.c b/src/mame/drivers/kncljoe.c index 0053757e6b5..c6a71b67cef 100644 --- a/src/mame/drivers/kncljoe.c +++ b/src/mame/drivers/kncljoe.c @@ -252,7 +252,7 @@ static MACHINE_START( kncljoe ) { kncljoe_state *state = (kncljoe_state *)machine->driver_data; - state->soundcpu = devtag_get_device(machine, "soundcpu"); + state->soundcpu = machine->device("soundcpu"); state_save_register_global(machine, state->port1); state_save_register_global(machine, state->port2); diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c index 12592137240..09fb2c505f3 100644 --- a/src/mame/drivers/konamigq.c +++ b/src/mame/drivers/konamigq.c @@ -199,11 +199,11 @@ static READ16_HANDLER( dual539_r ) data = 0; if( ACCESSING_BITS_0_7 ) { - data |= k054539_r( devtag_get_device(space->machine, "konami2"), offset ); + data |= k054539_r( space->machine->device("konami2"), offset ); } if( ACCESSING_BITS_8_15 ) { - data |= k054539_r( devtag_get_device(space->machine, "konami1"), offset ) << 8; + data |= k054539_r( space->machine->device("konami1"), offset ) << 8; } return data; } @@ -212,11 +212,11 @@ static WRITE16_HANDLER( dual539_w ) { if( ACCESSING_BITS_0_7 ) { - k054539_w( devtag_get_device(space->machine, "konami2"), offset, data ); + k054539_w( space->machine->device("konami2"), offset, data ); } if( ACCESSING_BITS_8_15 ) { - k054539_w( devtag_get_device(space->machine, "konami1"), offset, data >> 8 ); + k054539_w( space->machine->device("konami1"), offset, data >> 8 ); } } diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c index c74e7535392..dde730ca60c 100644 --- a/src/mame/drivers/konamigv.c +++ b/src/mame/drivers/konamigv.c @@ -311,7 +311,7 @@ static MACHINE_RESET( konamigv ) psx_machine_init(machine); /* also hook up CDDA audio to the CD-ROM drive */ - cdda_set_cdrom(devtag_get_device(machine, "cdda"), am53cf96_get_device(SCSI_ID_4)); + cdda_set_cdrom(machine->device("cdda"), am53cf96_get_device(SCSI_ID_4)); } static void spu_irq(running_device *device, UINT32 data) diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c index e1a1323254e..2a730c21fa9 100644 --- a/src/mame/drivers/konamigx.c +++ b/src/mame/drivers/konamigx.c @@ -1254,9 +1254,9 @@ static READ16_HANDLER( dual539_r ) UINT16 ret = 0; if (ACCESSING_BITS_0_7) - ret |= k054539_r(devtag_get_device(space->machine, "konami2"), offset); + ret |= k054539_r(space->machine->device("konami2"), offset); if (ACCESSING_BITS_8_15) - ret |= k054539_r(devtag_get_device(space->machine, "konami1"), offset)<<8; + ret |= k054539_r(space->machine->device("konami1"), offset)<<8; return ret; } @@ -1264,9 +1264,9 @@ static READ16_HANDLER( dual539_r ) static WRITE16_HANDLER( dual539_w ) { if (ACCESSING_BITS_0_7) - k054539_w(devtag_get_device(space->machine, "konami2"), offset, data); + k054539_w(space->machine->device("konami2"), offset, data); if (ACCESSING_BITS_8_15) - k054539_w(devtag_get_device(space->machine, "konami1"), offset, data>>8); + k054539_w(space->machine->device("konami1"), offset, data>>8); } static READ16_HANDLER( sndcomm68k_r ) @@ -1287,27 +1287,27 @@ static INTERRUPT_GEN(tms_sync) static READ16_HANDLER(tms57002_data_word_r) { - return tms57002_data_r(devtag_get_device(space->machine, "dasp"), 0); + return tms57002_data_r(space->machine->device("dasp"), 0); } static WRITE16_HANDLER(tms57002_data_word_w) { if (ACCESSING_BITS_0_7) - tms57002_data_w(devtag_get_device(space->machine, "dasp"), 0, data); + tms57002_data_w(space->machine->device("dasp"), 0, data); } static READ16_HANDLER(tms57002_status_word_r) { - return (tms57002_dready_r(devtag_get_device(space->machine, "dasp"), 0) ? 4 : 0) | - (tms57002_empty_r(devtag_get_device(space->machine, "dasp"), 0) ? 1 : 0); + return (tms57002_dready_r(space->machine->device("dasp"), 0) ? 4 : 0) | + (tms57002_empty_r(space->machine->device("dasp"), 0) ? 1 : 0); } static WRITE16_HANDLER(tms57002_control_word_w) { if (ACCESSING_BITS_0_7) { - tms57002_pload_w(devtag_get_device(space->machine, "dasp"), 0, data & 4); - tms57002_cload_w(devtag_get_device(space->machine, "dasp"), 0, data & 8); + tms57002_pload_w(space->machine->device("dasp"), 0, data & 4); + tms57002_cload_w(space->machine->device("dasp"), 0, data & 8); cputag_set_input_line(space->machine, "dasp", INPUT_LINE_RESET, !(data & 16) ? ASSERT_LINE : CLEAR_LINE); } } @@ -3631,7 +3631,7 @@ static MACHINE_START( konamigx ) static MACHINE_RESET(konamigx) { - running_device *k054539_2 = devtag_get_device(machine, "konami2"); + running_device *k054539_2 = machine->device("konami2"); int i; konamigx_wrport1_0 = konamigx_wrport1_1 = 0; diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c index 35ab7cb754e..f4336aaf889 100644 --- a/src/mame/drivers/konamim2.c +++ b/src/mame/drivers/konamim2.c @@ -1075,7 +1075,7 @@ static READ64_HANDLER(cpu_r) if (ACCESSING_BITS_32_63) { - r = (UINT64)((space->cpu != devtag_get_device(space->machine, "maincpu")) ? 0x80000000 : 0); + r = (UINT64)((space->cpu != space->machine->device("maincpu")) ? 0x80000000 : 0); //r |= 0x40000000; // sets Video-LowRes !? return r << 32; } diff --git a/src/mame/drivers/kongambl.c b/src/mame/drivers/kongambl.c index 59769a6ba21..c6df27f6052 100644 --- a/src/mame/drivers/kongambl.c +++ b/src/mame/drivers/kongambl.c @@ -20,7 +20,7 @@ static VIDEO_START(kongambl) { - running_device *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = machine->device("k056832"); k056832_set_layer_association(k056832, 0); k056832_set_layer_offs(k056832, 0, -2, 0); @@ -31,7 +31,7 @@ static VIDEO_START(kongambl) static VIDEO_UPDATE(kongambl) { - running_device *k056832 = devtag_get_device(screen->machine, "k056832"); + running_device *k056832 = screen->machine->device("k056832"); bitmap_fill(bitmap, cliprect, 0); bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); diff --git a/src/mame/drivers/kopunch.c b/src/mame/drivers/kopunch.c index 5915dfb5c46..ed2240ba863 100644 --- a/src/mame/drivers/kopunch.c +++ b/src/mame/drivers/kopunch.c @@ -175,7 +175,7 @@ static MACHINE_START( kopunch ) { kopunch_state *state = (kopunch_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->gfxbank); } diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c index a6d972b8b14..df0feb0018f 100644 --- a/src/mame/drivers/ksys573.c +++ b/src/mame/drivers/ksys573.c @@ -1626,7 +1626,7 @@ static void update_mode( running_machine *machine ) if( inserted_cdrom != new_cdrom ) { inserted_cdrom = new_cdrom; - cdda_set_cdrom(devtag_get_device(machine, "cdda"), atapi_get_device()); + cdda_set_cdrom(machine->device("cdda"), atapi_get_device()); } } @@ -1661,7 +1661,7 @@ todo: static READ32_HANDLER( ge765pwbba_r ) { - running_device *upd4701 = devtag_get_device(space->machine, "upd4701"); + running_device *upd4701 = space->machine->device("upd4701"); UINT32 data = 0; switch (offset) @@ -1699,7 +1699,7 @@ static READ32_HANDLER( ge765pwbba_r ) static WRITE32_HANDLER( ge765pwbba_w ) { - running_device *upd4701 = devtag_get_device(space->machine, "upd4701"); + running_device *upd4701 = space->machine->device("upd4701"); switch (offset) { case 0x04: diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c index 1a51f3bb66c..c277666d872 100644 --- a/src/mame/drivers/kungfur.c +++ b/src/mame/drivers/kungfur.c @@ -160,14 +160,14 @@ static WRITE8_DEVICE_HANDLER( kungfur_adpcm1_w ) { adpcm_pos[0] = 0x40000+(data & 0xff) * 0x100; adpcm_idle[0] = 0; - msm5205_reset_w(devtag_get_device(device->machine, "adpcm1"),0); + msm5205_reset_w(device->machine->device("adpcm1"),0); } static WRITE8_DEVICE_HANDLER( kungfur_adpcm2_w ) { adpcm_pos[1] = (data & 0xff) * 0x400; adpcm_idle[1] = 0; - msm5205_reset_w(devtag_get_device(device->machine, "adpcm2"),0); + msm5205_reset_w(device->machine->device("adpcm2"),0); } /* @@ -262,7 +262,7 @@ static void kfr_adpcm1_int(running_device *device) if (adpcm_pos[0] >= 0x40000 || adpcm_idle[0]) { - msm5205_reset_w(devtag_get_device(device->machine, "adpcm1"),1); + msm5205_reset_w(device->machine->device("adpcm1"),1); trigger = 0; } else @@ -270,7 +270,7 @@ static void kfr_adpcm1_int(running_device *device) UINT8 *ROM = memory_region(device->machine, "adpcm1"); adpcm_data = ((trigger ? (ROM[adpcm_pos[0]] & 0x0f) : (ROM[adpcm_pos[0]] & 0xf0)>>4) ); - msm5205_data_w(devtag_get_device(device->machine, "adpcm1"),adpcm_data & 0xf); + msm5205_data_w(device->machine->device("adpcm1"),adpcm_data & 0xf); trigger^=1; if(trigger == 0) { @@ -288,7 +288,7 @@ static void kfr_adpcm2_int(running_device *device) if (adpcm_pos[1] >= 0x10000 || adpcm_idle[1]) { - msm5205_reset_w(devtag_get_device(device->machine, "adpcm2"),1); + msm5205_reset_w(device->machine->device("adpcm2"),1); trigger = 0; } else @@ -296,7 +296,7 @@ static void kfr_adpcm2_int(running_device *device) UINT8 *ROM = memory_region(device->machine, "adpcm2"); adpcm_data = ((trigger ? (ROM[adpcm_pos[1]] & 0x0f) : (ROM[adpcm_pos[1]] & 0xf0)>>4) ); - msm5205_data_w(devtag_get_device(device->machine, "adpcm2"),adpcm_data & 0xf); + msm5205_data_w(device->machine->device("adpcm2"),adpcm_data & 0xf); trigger^=1; if(trigger == 0) { diff --git a/src/mame/drivers/kyugo.c b/src/mame/drivers/kyugo.c index e5a0ec8f4b4..93a52b0898f 100644 --- a/src/mame/drivers/kyugo.c +++ b/src/mame/drivers/kyugo.c @@ -451,8 +451,8 @@ static MACHINE_START( kyugo ) { kyugo_state *state = (kyugo_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->scroll_x_lo); state_save_register_global(machine, state->scroll_x_hi); @@ -467,7 +467,7 @@ static MACHINE_RESET( kyugo ) kyugo_state *state = (kyugo_state *)machine->driver_data; const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); // must start with interrupts and sub CPU disabled - cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0); + cpu_interrupt_enable(machine->device("maincpu"), 0); kyugo_sub_cpu_control_w(space, 0, 0); state->scroll_x_lo = 0; diff --git a/src/mame/drivers/labyrunr.c b/src/mame/drivers/labyrunr.c index 8d2f9ba39ea..95eaf4fa6a5 100644 --- a/src/mame/drivers/labyrunr.c +++ b/src/mame/drivers/labyrunr.c @@ -190,7 +190,7 @@ static MACHINE_START( labyrunr ) memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000); - state->k007121 = devtag_get_device(machine, "k007121"); + state->k007121 = machine->device("k007121"); } static MACHINE_DRIVER_START( labyrunr ) diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c index 6cde5b77b27..dcc281e4c05 100644 --- a/src/mame/drivers/ladybug.c +++ b/src/mame/drivers/ladybug.c @@ -725,14 +725,14 @@ GFXDECODE_END static MACHINE_START( ladybug ) { ladybug_state *state = (ladybug_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); } static MACHINE_START( sraider ) { ladybug_state *state = (ladybug_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->grid_color); state_save_register_global(machine, state->sound_low); diff --git a/src/mame/drivers/ladyfrog.c b/src/mame/drivers/ladyfrog.c index b8eaef4c4a8..f2ea944cecd 100644 --- a/src/mame/drivers/ladyfrog.c +++ b/src/mame/drivers/ladyfrog.c @@ -287,7 +287,7 @@ static MACHINE_START( ladyfrog ) { ladyfrog_state *state = (ladyfrog_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->tilebank); state_save_register_global(machine, state->palette_bank); diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c index 71089d6fc6a..56630fea2e9 100644 --- a/src/mame/drivers/laserbat.c +++ b/src/mame/drivers/laserbat.c @@ -706,16 +706,16 @@ static MACHINE_START( laserbat ) { laserbat_state *state = (laserbat_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->s2636_1 = devtag_get_device(machine, "s2636_1"); - state->s2636_2 = devtag_get_device(machine, "s2636_2"); - state->s2636_3 = devtag_get_device(machine, "s2636_3"); - state->pia = devtag_get_device(machine, "pia"); - state->sn = devtag_get_device(machine, "snsnd"); - state->tms1 = devtag_get_device(machine, "tms1"); - state->tms2 = devtag_get_device(machine, "tms2"); - state->ay1 = devtag_get_device(machine, "ay1"); - state->ay2 = devtag_get_device(machine, "ay2"); + state->audiocpu = machine->device("audiocpu"); + state->s2636_1 = machine->device("s2636_1"); + state->s2636_2 = machine->device("s2636_2"); + state->s2636_3 = machine->device("s2636_3"); + state->pia = machine->device("pia"); + state->sn = machine->device("snsnd"); + state->tms1 = machine->device("tms1"); + state->tms2 = machine->device("tms2"); + state->ay1 = machine->device("ay1"); + state->ay2 = machine->device("ay2"); state_save_register_global(machine, state->video_page); state_save_register_global(machine, state->input_mux); diff --git a/src/mame/drivers/lasso.c b/src/mame/drivers/lasso.c index b9836ada5b5..9d8f1b55de3 100644 --- a/src/mame/drivers/lasso.c +++ b/src/mame/drivers/lasso.c @@ -466,10 +466,10 @@ static MACHINE_START( lasso ) { lasso_state *state = (lasso_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->sn_1 = devtag_get_device(machine, "sn76489.1"); - state->sn_2 = devtag_get_device(machine, "sn76489.2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->sn_1 = machine->device("sn76489.1"); + state->sn_2 = machine->device("sn76489.2"); state_save_register_global(machine, state->gfxbank); } diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c index 1c90207ecf8..3d8f27bc392 100644 --- a/src/mame/drivers/lastduel.c +++ b/src/mame/drivers/lastduel.c @@ -476,7 +476,7 @@ static MACHINE_START( lastduel ) { lastduel_state *state = (lastduel_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->tilemap_priority); state_save_register_global_array(machine, state->scroll); diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c index 25325527d02..f5c97224cf0 100644 --- a/src/mame/drivers/lastfght.c +++ b/src/mame/drivers/lastfght.c @@ -527,7 +527,7 @@ static MACHINE_START( lastfght ) { lastfght_state *state = (lastfght_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->clr_offset); state_save_register_global(machine, state->dest); diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c index 8a336e0269b..c8280e90db5 100644 --- a/src/mame/drivers/lazercmd.c +++ b/src/mame/drivers/lazercmd.c @@ -603,7 +603,7 @@ static MACHINE_START( lazercmd ) { lazercmd_state *state = (lazercmd_state *)machine->driver_data; - state->dac = devtag_get_device(machine, "dac"); + state->dac = machine->device("dac"); state_save_register_global(machine, state->marker_x); state_save_register_global(machine, state->marker_y); diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c index 0271a8ebf3e..b84d79978f1 100644 --- a/src/mame/drivers/lemmings.c +++ b/src/mame/drivers/lemmings.c @@ -259,7 +259,7 @@ static MACHINE_START( lemmings ) { lemmings_state *state = (lemmings_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_DRIVER_START( lemmings ) diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c index f1a3bf8c6b4..6a4f4a85bc4 100644 --- a/src/mame/drivers/lethal.c +++ b/src/mame/drivers/lethal.c @@ -587,12 +587,12 @@ static MACHINE_START( lethalen ) machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3800 + 0x02); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "soundcpu"); - state->k054539 = devtag_get_device(machine, "k054539"); - state->k053244 = devtag_get_device(machine, "k053244"); - state->k056832 = devtag_get_device(machine, "k056832"); - state->k054000 = devtag_get_device(machine, "k054000"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("soundcpu"); + state->k054539 = machine->device("k054539"); + state->k053244 = machine->device("k053244"); + state->k056832 = machine->device("k056832"); + state->k054000 = machine->device("k054000"); state_save_register_global(machine, state->cur_control2); state_save_register_global(machine, state->sprite_colorbase); diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c index 158d376fd3e..c4026409840 100644 --- a/src/mame/drivers/lethalj.c +++ b/src/mame/drivers/lethalj.c @@ -176,14 +176,14 @@ static CUSTOM_INPUT( cclownz_paddle ) static WRITE16_HANDLER( ripribit_control_w ) { coin_counter_w(space->machine, 0, data & 1); - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, ((data >> 1) & 1) << 7); + ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 1) & 1) << 7); output_set_lamp_value(0, (data >> 2) & 1); } static WRITE16_HANDLER( cfarm_control_w ) { - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, ((data >> 0) & 1) << 7); + ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7); output_set_lamp_value(0, (data >> 2) & 1); output_set_lamp_value(1, (data >> 3) & 1); output_set_lamp_value(2, (data >> 4) & 1); @@ -193,7 +193,7 @@ static WRITE16_HANDLER( cfarm_control_w ) static WRITE16_HANDLER( cclownz_control_w ) { - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, ((data >> 0) & 1) << 7); + ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7); output_set_lamp_value(0, (data >> 2) & 1); output_set_lamp_value(1, (data >> 4) & 1); output_set_lamp_value(2, (data >> 5) & 1); diff --git a/src/mame/drivers/lgp.c b/src/mame/drivers/lgp.c index 3c6250e58af..225edbb8c59 100644 --- a/src/mame/drivers/lgp.c +++ b/src/mame/drivers/lgp.c @@ -333,7 +333,7 @@ static INTERRUPT_GEN( vblank_callback_lgp ) static MACHINE_START( lgp ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); } diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c index 0f018d12f55..d6dead3c57b 100644 --- a/src/mame/drivers/liberate.c +++ b/src/mame/drivers/liberate.c @@ -801,8 +801,8 @@ static MACHINE_START( liberate ) { liberate_state *state = (liberate_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->background_disable); state_save_register_global(machine, state->background_color); diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c index bdd8f2cb600..81278a38dd7 100644 --- a/src/mame/drivers/limenko.c +++ b/src/mame/drivers/limenko.c @@ -199,7 +199,7 @@ static READ8_HANDLER( spotty_sound_r ) if(spotty_sound_cmd == 0xf7) return soundlatch_r(space,0); else - return okim6295_r(devtag_get_device(space->machine, "oki"),0); + return okim6295_r(space->machine->device("oki"),0); } static ADDRESS_MAP_START( spotty_sound_io_map, ADDRESS_SPACE_IO, 8 ) diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c index b80465ebb1a..d56cfc6ed9b 100644 --- a/src/mame/drivers/lkage.c +++ b/src/mame/drivers/lkage.c @@ -360,9 +360,9 @@ static MACHINE_START( lkage ) { lkage_state *state = (lkage_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->bg_tile_bank); state_save_register_global(machine, state->fg_tile_bank); diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c index 3458b8123ad..89139718eb5 100644 --- a/src/mame/drivers/lockon.c +++ b/src/mame/drivers/lockon.c @@ -466,16 +466,16 @@ static MACHINE_START( lockon ) { lockon_state *state = (lockon_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->ground = devtag_get_device(machine, "ground"); - state->object = devtag_get_device(machine, "object"); - state->f2203_1l = devtag_get_device(machine, "f2203.1l"); - state->f2203_2l = devtag_get_device(machine, "f2203.2l"); - state->f2203_3l = devtag_get_device(machine, "f2203.3l"); - state->f2203_1r = devtag_get_device(machine, "f2203.1r"); - state->f2203_2r = devtag_get_device(machine, "f2203.2r"); - state->f2203_3r = devtag_get_device(machine, "f2203.3r"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->ground = machine->device("ground"); + state->object = machine->device("object"); + state->f2203_1l = machine->device("f2203.1l"); + state->f2203_2l = machine->device("f2203.2l"); + state->f2203_3l = machine->device("f2203.3l"); + state->f2203_1r = machine->device("f2203.1r"); + state->f2203_2r = machine->device("f2203.2r"); + state->f2203_3r = machine->device("f2203.3r"); state_save_register_global(machine, state->ground_ctrl); state_save_register_global(machine, state->scroll_h); diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c index 86846aaca66..bde8c27f04c 100644 --- a/src/mame/drivers/lordgun.c +++ b/src/mame/drivers/lordgun.c @@ -144,7 +144,7 @@ static WRITE8_DEVICE_HANDLER(fake2_w) static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w ) { - running_device *eeprom = devtag_get_device(device->machine, "eeprom"); + running_device *eeprom = device->machine->device("eeprom"); static UINT8 old; int i; @@ -177,7 +177,7 @@ static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w ) static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w ) { - running_device *eeprom = devtag_get_device(device->machine, "eeprom"); + running_device *eeprom = device->machine->device("eeprom"); if (~data & ~0xf8) { diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c index be5bc192b2b..bd240cdafd6 100644 --- a/src/mame/drivers/lsasquad.c +++ b/src/mame/drivers/lsasquad.c @@ -571,9 +571,9 @@ static MACHINE_START( lsasquad ) memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->port_a_in); state_save_register_global(machine, state->port_a_out); diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c index bac5351cc17..59b793d8e33 100644 --- a/src/mame/drivers/m10.c +++ b/src/mame/drivers/m10.c @@ -196,10 +196,10 @@ static MACHINE_START( m10 ) { m10_state *state = (m10_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->ic8j1 = devtag_get_device(machine, "ic8j1"); - state->ic8j2 = devtag_get_device(machine, "ic8j2"); - state->samples = devtag_get_device(machine, "samples"); + state->maincpu = machine->device("maincpu"); + state->ic8j1 = machine->device("ic8j1"); + state->ic8j2 = machine->device("ic8j2"); + state->samples = machine->device("samples"); state_save_register_global(machine, state->bottomline); state_save_register_global(machine, state->flip); diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c index 88b2effd6ee..ce26c16e3b2 100644 --- a/src/mame/drivers/m107.c +++ b/src/mame/drivers/m107.c @@ -119,9 +119,9 @@ static TIMER_CALLBACK( setvector_callback ) } if (irqvector & 0x2) /* YM2151 has precedence */ - cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x18); + cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x18); else if (irqvector & 0x1) /* V30 */ - cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x19); + cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x19); if (irqvector == 0) /* no IRQs pending */ cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE); diff --git a/src/mame/drivers/m14.c b/src/mame/drivers/m14.c index 19b09ea6e5b..15ec21aa2f8 100644 --- a/src/mame/drivers/m14.c +++ b/src/mame/drivers/m14.c @@ -317,7 +317,7 @@ static MACHINE_START( m14 ) { m14_state *state = (m14_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->hop_mux); } diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c index 0e6f670fc0e..3f7ad588845 100644 --- a/src/mame/drivers/m63.c +++ b/src/mame/drivers/m63.c @@ -703,10 +703,10 @@ static MACHINE_START( m63 ) { m63_state *state = (m63_state *)machine->driver_data; - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->ay1 = devtag_get_device(machine, "ay1"); - state->ay2 = devtag_get_device(machine, "ay2"); - state->samples = devtag_get_device(machine, "samples"); + state->soundcpu = machine->device("soundcpu"); + state->ay1 = machine->device("ay1"); + state->ay2 = machine->device("ay2"); + state->samples = machine->device("samples"); state_save_register_global(machine, state->pal_bank); state_save_register_global(machine, state->fg_flag); diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c index 0715b9ab788..99412ca90da 100644 --- a/src/mame/drivers/m72.c +++ b/src/mame/drivers/m72.c @@ -322,7 +322,7 @@ INLINE DRIVER_INIT( m72_8751 ) const address_space *program = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); const address_space *io = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); const address_space *sndio = cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_IO); - running_device *dac = devtag_get_device(machine, "dac"); + running_device *dac = machine->device("dac"); protection_ram = auto_alloc_array(machine, UINT16, 0x10000/2); memory_install_read_bank(program, 0xb0000, 0xbffff, 0, 0, "bank1"); @@ -406,7 +406,7 @@ static INTERRUPT_GEN(fake_nmi) const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); int sample = m72_sample_r(space,0); if (sample) - m72_sample_w(devtag_get_device(device->machine, "dac"),0,sample); + m72_sample_w(device->machine->device("dac"),0,sample); } diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c index 2d8684a268d..5e20ba24e4b 100644 --- a/src/mame/drivers/m92.c +++ b/src/mame/drivers/m92.c @@ -320,7 +320,7 @@ enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, V30_ASSERT, V30_CLEAR }; static TIMER_CALLBACK( setvector_callback ) { - if (!devtag_get_device(machine, "soundcpu")) + if (!machine->device("soundcpu")) return; switch(param) @@ -333,9 +333,9 @@ static TIMER_CALLBACK( setvector_callback ) } if (irqvector & 0x2) /* YM2151 has precedence */ - cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x18); + cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x18); else if (irqvector & 0x1) /* V30 */ - cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x19); + cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x19); if (irqvector == 0) /* no IRQs pending */ cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE); diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c index 8992ff0b586..18fc0fd193b 100644 --- a/src/mame/drivers/macrossp.c +++ b/src/mame/drivers/macrossp.c @@ -606,8 +606,8 @@ static MACHINE_START( macrossp ) { macrossp_state *state = (macrossp_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->sndpending); state_save_register_global(machine, state->snd_toggle); diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c index 0298f89aad8..bcad0addc05 100644 --- a/src/mame/drivers/madmotor.c +++ b/src/mame/drivers/madmotor.c @@ -227,8 +227,8 @@ static MACHINE_START( madmotor ) { madmotor_state *state = (madmotor_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->flipscreen); } diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c index 2f4dfc166ed..3b2fb86a919 100644 --- a/src/mame/drivers/magicfly.c +++ b/src/mame/drivers/magicfly.c @@ -542,7 +542,7 @@ static WRITE8_HANDLER( mux_port_w ) */ input_selector = data & 0x0f; /* Input Selector */ - dac_data_w(devtag_get_device(space->machine, "dac"), data & 0x80); /* Sound DAC */ + dac_data_w(space->machine->device("dac"), data & 0x80); /* Sound DAC */ coin_counter_w(space->machine, 0, data & 0x40); /* Coin1 */ coin_counter_w(space->machine, 1, data & 0x10); /* Coin2 */ diff --git a/src/mame/drivers/magmax.c b/src/mame/drivers/magmax.c index b4be2c58ab3..0777fd26609 100644 --- a/src/mame/drivers/magmax.c +++ b/src/mame/drivers/magmax.c @@ -116,9 +116,9 @@ static MACHINE_RESET( magmax ) static WRITE8_DEVICE_HANDLER( ay8910_portA_0_w ) { -running_device *ay1 = devtag_get_device(device->machine, "ay1"); -running_device *ay2 = devtag_get_device(device->machine, "ay2"); -running_device *ay3 = devtag_get_device(device->machine, "ay3"); +running_device *ay1 = device->machine->device("ay1"); +running_device *ay2 = device->machine->device("ay2"); +running_device *ay3 = device->machine->device("ay3"); float percent; /*There are three AY8910 chips and four(!) separate amplifiers on the board diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c index 844ee6403bb..62a8ee23863 100644 --- a/src/mame/drivers/mainevt.c +++ b/src/mame/drivers/mainevt.c @@ -422,12 +422,12 @@ static MACHINE_START( mainevt ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->upd = devtag_get_device(machine, "upd"); - state->k007232 = devtag_get_device(machine, "k007232"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->upd = machine->device("upd"); + state->k007232 = machine->device("k007232"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); state_save_register_global(machine, state->nmi_enable); } diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c index 0e25b847b37..eded005c28d 100644 --- a/src/mame/drivers/malzak.c +++ b/src/mame/drivers/malzak.c @@ -151,7 +151,7 @@ static WRITE8_HANDLER( port40_w ) // Bits 1-3 are all set high upon death, until the game continues // Bit 6 is used only in Malzak II, and is set high after checking // the selected version -// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(devtag_get_device(space->machine, "maincpu")), data); +// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(space->machine->device("maincpu")), data); memory_set_bank(space->machine, "bank1", (data & 0x40) >> 6); } @@ -372,9 +372,9 @@ static MACHINE_START( malzak ) memory_configure_bank(machine, "bank1", 0, 2, memory_region(machine, "user2"), 0x400); - state->s2636_0 = devtag_get_device(machine, "s2636_0"); - state->s2636_1 = devtag_get_device(machine, "s2636_1"); - state->saa5050 = devtag_get_device(machine, "saa5050"); + state->s2636_0 = machine->device("s2636_0"); + state->s2636_1 = machine->device("s2636_1"); + state->saa5050 = machine->device("saa5050"); state_save_register_global_array(machine, state->playfield_code); state_save_register_global(machine, state->malzak_x); diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c index dd15ea9f76a..c5ce1ffb034 100644 --- a/src/mame/drivers/mappy.c +++ b/src/mame/drivers/mappy.c @@ -587,20 +587,20 @@ static WRITE8_DEVICE_HANDLER( mappy_snd_sharedram_w ) static WRITE8_HANDLER( superpac_latch_w ) { - running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); - running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); + running_device *namcoio_1 = space->machine->device("namcoio_1"); + running_device *namcoio_2 = space->machine->device("namcoio_2"); int bit = offset & 1; switch (offset & 0x0e) { case 0x00: /* INT ON 2 */ - cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit); + cpu_interrupt_enable(space->machine->device("sub"), bit); if (!bit) cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); break; case 0x02: /* INT ON */ - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); break; @@ -609,7 +609,7 @@ static WRITE8_HANDLER( superpac_latch_w ) break; case 0x06: /* SOUND ON */ - mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit); + mappy_sound_enable(space->machine->device("namco"), bit); break; case 0x08: /* 4 RESET */ @@ -631,32 +631,32 @@ static WRITE8_HANDLER( superpac_latch_w ) static WRITE8_HANDLER( phozon_latch_w ) { - running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); - running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); + running_device *namcoio_1 = space->machine->device("namcoio_1"); + running_device *namcoio_2 = space->machine->device("namcoio_2"); int bit = offset & 1; switch (offset & 0x0e) { case 0x00: - cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit); + cpu_interrupt_enable(space->machine->device("sub"), bit); if (!bit) cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); break; case 0x02: - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); break; case 0x04: - cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), bit); + cpu_interrupt_enable(space->machine->device("sub2"), bit); if (!bit) cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE); break; case 0x06: - mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit); + mappy_sound_enable(space->machine->device("namco"), bit); break; case 0x08: @@ -679,20 +679,20 @@ static WRITE8_HANDLER( phozon_latch_w ) static WRITE8_HANDLER( mappy_latch_w ) { - running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); - running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); + running_device *namcoio_1 = space->machine->device("namcoio_1"); + running_device *namcoio_2 = space->machine->device("namcoio_2"); int bit = offset & 1; switch (offset & 0x0e) { case 0x00: /* INT ON 2 */ - cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit); + cpu_interrupt_enable(space->machine->device("sub"), bit); if (!bit) cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); break; case 0x02: /* INT ON */ - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); break; @@ -702,7 +702,7 @@ static WRITE8_HANDLER( mappy_latch_w ) break; case 0x06: /* SOUND ON */ - mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit); + mappy_sound_enable(space->machine->device("namco"), bit); break; case 0x08: /* 4 RESET */ @@ -757,8 +757,8 @@ static MACHINE_RESET( mappy ) static TIMER_CALLBACK( superpac_io_run ) { - running_device *io56xx_1 = devtag_get_device(machine, "namcoio_1"); - running_device *io56xx_2 = devtag_get_device(machine, "namcoio_2"); + running_device *io56xx_1 = machine->device("namcoio_1"); + running_device *io56xx_2 = machine->device("namcoio_2"); switch (param) { @@ -773,8 +773,8 @@ static TIMER_CALLBACK( superpac_io_run ) static INTERRUPT_GEN( superpac_interrupt_1 ) { - running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = device->machine->device("namcoio_1"); + running_device *namcoio_2 = device->machine->device("namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -788,8 +788,8 @@ static INTERRUPT_GEN( superpac_interrupt_1 ) static TIMER_CALLBACK( pacnpal_io_run ) { - running_device *io56xx = devtag_get_device(machine, "namcoio_1"); - running_device *io59xx = devtag_get_device(machine, "namcoio_2"); + running_device *io56xx = machine->device("namcoio_1"); + running_device *io59xx = machine->device("namcoio_2"); switch (param) { @@ -804,8 +804,8 @@ static TIMER_CALLBACK( pacnpal_io_run ) static INTERRUPT_GEN( pacnpal_interrupt_1 ) { - running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = device->machine->device("namcoio_1"); + running_device *namcoio_2 = device->machine->device("namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -819,8 +819,8 @@ static INTERRUPT_GEN( pacnpal_interrupt_1 ) static TIMER_CALLBACK( phozon_io_run ) { - running_device *io58xx = devtag_get_device(machine, "namcoio_1"); - running_device *io56xx = devtag_get_device(machine, "namcoio_2"); + running_device *io58xx = machine->device("namcoio_1"); + running_device *io56xx = machine->device("namcoio_2"); switch (param) { @@ -835,8 +835,8 @@ static TIMER_CALLBACK( phozon_io_run ) static INTERRUPT_GEN( phozon_interrupt_1 ) { - running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = device->machine->device("namcoio_1"); + running_device *namcoio_2 = device->machine->device("namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -850,8 +850,8 @@ static INTERRUPT_GEN( phozon_interrupt_1 ) static TIMER_CALLBACK( mappy_io_run ) { - running_device *io58xx_1 = devtag_get_device(machine, "namcoio_1"); - running_device *io58xx_2 = devtag_get_device(machine, "namcoio_2"); + running_device *io58xx_1 = machine->device("namcoio_1"); + running_device *io58xx_2 = machine->device("namcoio_2"); switch (param) { @@ -866,8 +866,8 @@ static TIMER_CALLBACK( mappy_io_run ) static INTERRUPT_GEN( mappy_interrupt_1 ) { - running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = device->machine->device("namcoio_1"); + running_device *namcoio_2 = device->machine->device("namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -2258,7 +2258,7 @@ static DRIVER_INIT( grobda ) However, removing the 15XX from the board causes sound to disappear completely, so the DAC might be built-in after all. */ - running_device *dac = devtag_get_device(machine, "dac"); + running_device *dac = machine->device("dac"); memory_install_write8_device_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), dac, 0x0002, 0x0002, 0, 0, grobda_DAC_w ); } diff --git a/src/mame/drivers/marineb.c b/src/mame/drivers/marineb.c index 0761cb150ce..ebc27c53ab3 100644 --- a/src/mame/drivers/marineb.c +++ b/src/mame/drivers/marineb.c @@ -69,7 +69,7 @@ static MACHINE_START( marineb ) { espial_state *state = (espial_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state->audiocpu = NULL; state_save_register_global(machine, state->marineb_active_low_flipscreen); diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c index 107a8d6a2aa..256a986b17d 100644 --- a/src/mame/drivers/mastboy.c +++ b/src/mame/drivers/mastboy.c @@ -609,7 +609,7 @@ static WRITE8_HANDLER( backupram_enable_w ) static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w ) { - running_device *adpcm = devtag_get_device(space->machine, "msm"); + running_device *adpcm = space->machine->device("msm"); mastboy_m5205_sambit0 = data & 1; msm5205_playmode_w(adpcm, (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) ); @@ -619,7 +619,7 @@ static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w ) static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit1_w ) { - running_device *adpcm = devtag_get_device(space->machine, "msm"); + running_device *adpcm = space->machine->device("msm"); mastboy_m5205_sambit1 = data & 1; @@ -849,7 +849,7 @@ static MACHINE_RESET( mastboy ) memset( mastboy_vram, 0x00, 0x10000); mastboy_m5205_part = 0; - msm5205_reset_w(devtag_get_device(machine, "msm"),1); + msm5205_reset_w(machine->device("msm"),1); mastboy_irq0_ack = 0; } diff --git a/src/mame/drivers/matmania.c b/src/mame/drivers/matmania.c index 4d0a43700e7..69e3b300100 100644 --- a/src/mame/drivers/matmania.c +++ b/src/mame/drivers/matmania.c @@ -303,9 +303,9 @@ static MACHINE_START( matmania ) { matmania_state *state = (matmania_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); } static MACHINE_DRIVER_START( matmania ) diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c index 16cf0727e9a..67f84c56e65 100644 --- a/src/mame/drivers/maxaflex.c +++ b/src/mame/drivers/maxaflex.c @@ -53,7 +53,7 @@ static READ8_HANDLER( mcu_portA_r ) static WRITE8_HANDLER( mcu_portA_w ) { portA_out = data; - speaker_level_w(devtag_get_device(space->machine, "speaker"), data >> 7); + speaker_level_w(space->machine->device("speaker"), data >> 7); } /* Port B: @@ -154,7 +154,7 @@ static TIMER_DEVICE_CALLBACK( mcu_timer_proc ) if ( (tcr & 0x40) == 0 ) { //timer interrupt! - generic_pulse_irq_line(devtag_get_device(timer.machine, "mcu"), M68705_INT_TIMER); + generic_pulse_irq_line(timer.machine->device("mcu"), M68705_INT_TIMER); } } } diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c index e4abb676cff..2971600baf6 100644 --- a/src/mame/drivers/maygay1b.c +++ b/src/mame/drivers/maygay1b.c @@ -455,7 +455,7 @@ static void m1_stepper_reset(void) static MACHINE_RESET( m1 ) { ROC10937_reset(0); // reset display1 - maygaym1_devices.duart68681 = devtag_get_device( machine, "duart68681" ); + maygaym1_devices.duart68681 = machine->device( "duart68681" ); m1_stepper_reset(); } diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c index 657e17d2932..eed40d3e1bf 100644 --- a/src/mame/drivers/maygayv1.c +++ b/src/mame/drivers/maygayv1.c @@ -969,14 +969,14 @@ static MACHINE_START( maygayv1 ) // duart_68681_init(DUART_CLOCK, duart_irq_handler, duart_tx); - i8051_set_serial_tx_callback(devtag_get_device(machine, "soundcpu"), data_from_i8031); - i8051_set_serial_rx_callback(devtag_get_device(machine, "soundcpu"), data_to_i8031); + i8051_set_serial_tx_callback(machine->device("soundcpu"), data_from_i8031); + i8051_set_serial_rx_callback(machine->device("soundcpu"), data_to_i8031); } static MACHINE_RESET( maygayv1 ) { // ? - maygayv1_devices.duart68681 = devtag_get_device( machine, "duart68681" ); + maygayv1_devices.duart68681 = machine->device( "duart68681" ); memset(i82716.dram, 0, 0x40000); i82716.r[RWBA] = 0x0200; } diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c index 94d8cb6922a..a5098387817 100644 --- a/src/mame/drivers/mazerbla.c +++ b/src/mame/drivers/mazerbla.c @@ -1403,8 +1403,8 @@ static MACHINE_START( mazerbla ) { mazerbla_state *state = (mazerbla_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); state_save_register_global_array(machine, state->vcu_video_reg); state_save_register_global(machine, state->vcu_gfx_addr); @@ -1470,7 +1470,7 @@ static MACHINE_RESET( mazerbla ) memset(state->lookup_ram, 0, ARRAY_LENGTH(state->lookup_ram)); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); } diff --git a/src/mame/drivers/mcatadv.c b/src/mame/drivers/mcatadv.c index ae9ca80e723..412ab5ae1aa 100644 --- a/src/mame/drivers/mcatadv.c +++ b/src/mame/drivers/mcatadv.c @@ -434,8 +434,8 @@ static MACHINE_START( mcatadv ) memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000); memory_set_bank(machine, "bank1", 1); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); state_save_register_global(machine, state->palette_bank1); state_save_register_global(machine, state->palette_bank2); diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c index 1a6db608895..6a3972bccd3 100644 --- a/src/mame/drivers/mcr.c +++ b/src/mame/drivers/mcr.c @@ -413,7 +413,7 @@ static WRITE8_HANDLER( kroozr_op4_w ) static WRITE8_HANDLER( journey_op4_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); /* if we're not playing the sample yet, start it */ if (!sample_playing(samples, 0)) @@ -534,7 +534,7 @@ static READ8_HANDLER( nflfoot_ip2_r ) static WRITE8_HANDLER( nflfoot_op4_w ) { - running_device *sio = devtag_get_device(space->machine, "ipu_sio"); + running_device *sio = space->machine->device("ipu_sio"); /* bit 7 = J3-7 on IPU board = /RXDA on SIO */ logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(space->cpu), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1); diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c index a6b8bc9d26f..3acbc4ccca6 100644 --- a/src/mame/drivers/mediagx.c +++ b/src/mame/drivers/mediagx.c @@ -973,7 +973,7 @@ static MACHINE_RESET(mediagx) { UINT8 *rom = memory_region(machine, "bios"); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); memcpy(bios_ram, rom, 0x40000); machine->device("maincpu")->reset(); diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c index 2e016ecec4f..33e49dddf99 100644 --- a/src/mame/drivers/megadriv.c +++ b/src/mame/drivers/megadriv.c @@ -698,7 +698,7 @@ static void megadrive_do_insta_68k_to_vram_dma(running_machine *machine, UINT32 if (length==0x00) length = 0xffff; /* This is a hack until real DMA timings are implemented */ - cpu_spinuntil_time(devtag_get_device(machine, "maincpu"), ATTOTIME_IN_NSEC(length * 1000 / 3500)); + cpu_spinuntil_time(machine->device("maincpu"), ATTOTIME_IN_NSEC(length * 1000 / 3500)); for (count = 0;count<(length>>1);count++) { @@ -983,8 +983,8 @@ WRITE16_HANDLER( megadriv_vdp_w ) case 0x12: case 0x14: case 0x16: - if (ACCESSING_BITS_0_7) sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data & 0xff); - //if (ACCESSING_BITS_8_15) sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, (data >>8) & 0xff); + if (ACCESSING_BITS_0_7) sn76496_w(space->machine->device("snsnd"), 0, data & 0xff); + //if (ACCESSING_BITS_8_15) sn76496_w(space->machine->device("snsnd"), 0, (data >>8) & 0xff); break; default: @@ -2374,7 +2374,7 @@ static WRITE8_HANDLER( megadriv_z80_vdp_write ) case 0x13: case 0x15: case 0x17: - sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data); + sn76496_w(space->machine->device("snsnd"), 0, data); break; default: @@ -2405,7 +2405,7 @@ static WRITE8_HANDLER( z80_write_68k_banked_data ) else if (fulladdress == 0xc00011) { /* quite a few early games write here, most of the later ones don't */ - sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data); + sn76496_w(space->machine->device("snsnd"), 0, data); } else { @@ -5884,7 +5884,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback ) - if (devtag_get_device(timer.machine, "genesis_snd_z80") != NULL) + if (timer.machine->device("genesis_snd_z80") != NULL) { if (genesis_scanline_counter == megadrive_z80irq_scanline) { @@ -5972,7 +5972,7 @@ MACHINE_RESET( megadriv ) break; } - if (devtag_get_device(machine, "genesis_snd_z80") != NULL) + if (machine->device("genesis_snd_z80") != NULL) { genz80.z80_is_reset = 1; genz80.z80_has_bus = 1; @@ -5998,8 +5998,8 @@ MACHINE_RESET( megadriv ) if (genesis_other_hacks) { // set_refresh_rate(megadriv_framerate); - cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.9950f); /* Fatal Rewind is very fussy... */ - // cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.3800f); /* Fatal Rewind is very fussy... */ + cpu_set_clockscale(machine->device("maincpu"), 0.9950f); /* Fatal Rewind is very fussy... */ + // cpu_set_clockscale(machine->device("maincpu"), 0.3800f); /* Fatal Rewind is very fussy... */ memset(megadrive_ram,0x00,0x10000); } @@ -6410,13 +6410,13 @@ static void megadriv_init_common(running_machine *machine) } - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), genesis_int_callback); + cpu_set_irq_callback(machine->device("maincpu"), genesis_int_callback); megadriv_backupram = NULL; megadriv_backupram_length = 0; vdp_get_word_from_68k_mem = vdp_get_word_from_68k_mem_default; - m68k_set_tas_callback(devtag_get_device(machine, "maincpu"), megadriv_tas_callback); + m68k_set_tas_callback(machine->device("maincpu"), megadriv_tas_callback); if ((ipt == INPUT_PORTS_NAME(megadri6)) || (ipt == INPUT_PORTS_NAME(ssf2ghw)) || (ipt == INPUT_PORTS_NAME(mk3ghw))) { @@ -6543,7 +6543,7 @@ static WRITE8_HANDLER( z80_unmapped_w ) /* sets the megadrive z80 to it's normal ports / map */ void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const char* tag) { - running_device *ym = devtag_get_device(machine, "ymsnd"); + running_device *ym = machine->device("ymsnd"); /* INIT THE PORTS *********************************************************************************************/ memory_install_readwrite8_handler(cputag_get_address_space(machine, tag, ADDRESS_SPACE_IO), 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w); @@ -6634,8 +6634,8 @@ DRIVER_INIT( _32x ) _32x_240mode = 0; // checking if these help brutal, they don't. - sh2drc_set_options(devtag_get_device(machine, "32x_master_sh2"), SH2DRC_COMPATIBLE_OPTIONS); - sh2drc_set_options(devtag_get_device(machine, "32x_slave_sh2"), SH2DRC_COMPATIBLE_OPTIONS); + sh2drc_set_options(machine->device("32x_master_sh2"), SH2DRC_COMPATIBLE_OPTIONS); + sh2drc_set_options(machine->device("32x_slave_sh2"), SH2DRC_COMPATIBLE_OPTIONS); DRIVER_INIT_CALL(megadriv); } diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c index 7bc27c13d0a..6cf265e9816 100644 --- a/src/mame/drivers/megasys1.c +++ b/src/mame/drivers/megasys1.c @@ -3853,8 +3853,8 @@ static WRITE16_DEVICE_HANDLER( okim6295_both_w ) static DRIVER_INIT( jitsupro ) { - running_device *oki1 = devtag_get_device(machine, "oki1"); - running_device *oki2 = devtag_get_device(machine, "oki2"); + running_device *oki1 = machine->device("oki1"); + running_device *oki2 = machine->device("oki2"); UINT16 *RAM = (UINT16 *) memory_region(machine, "maincpu"); astyanax_rom_decode(machine, "maincpu"); // Code diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c index 1119de0de91..2cab8765609 100644 --- a/src/mame/drivers/megatech.c +++ b/src/mame/drivers/megatech.c @@ -489,8 +489,8 @@ static VIDEO_START(mtnew) //attotime_never static VIDEO_UPDATE(mtnew) { - running_device *megadriv_screen = devtag_get_device(screen->machine, "megadriv"); - running_device *menu_screen = devtag_get_device(screen->machine, "menu"); + running_device *megadriv_screen = screen->machine->device("megadriv"); + running_device *menu_screen = screen->machine->device("menu"); if (screen == megadriv_screen) { diff --git a/src/mame/drivers/megazone.c b/src/mame/drivers/megazone.c index edd24a1ad25..5be425ea2a8 100644 --- a/src/mame/drivers/megazone.c +++ b/src/mame/drivers/megazone.c @@ -52,7 +52,7 @@ static WRITE8_DEVICE_HANDLER( megazone_port_b_w ) C += 220000; /* 220000pF = 0.22uF */ data >>= 2; - filter_rc_set_RC(devtag_get_device(device->machine, fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C)); + filter_rc_set_RC(device->machine->device(fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C)); } } diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c index 9f56eb5f0b1..3fa43458263 100644 --- a/src/mame/drivers/merit.c +++ b/src/mame/drivers/merit.c @@ -1095,7 +1095,7 @@ INPUT_PORTS_END static VIDEO_UPDATE( merit ) { - running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = screen->machine->device("crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index cfc4826e156..d30dfb1fa9c 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -963,8 +963,8 @@ static const z80_daisy_config meritm_daisy_chain[] = static MACHINE_START(merit_common) { - meritm_z80pio[0] = devtag_get_device( machine, "z80pio_0" ); - meritm_z80pio[1] = devtag_get_device( machine, "z80pio_1" ); + meritm_z80pio[0] = machine->device( "z80pio_0" ); + meritm_z80pio[1] = machine->device( "z80pio_1" ); z80pio_astb_w(meritm_z80pio[0], 1); z80pio_bstb_w(meritm_z80pio[0], 1); diff --git a/src/mame/drivers/mermaid.c b/src/mame/drivers/mermaid.c index 0de8a526951..5a56d3371d3 100644 --- a/src/mame/drivers/mermaid.c +++ b/src/mame/drivers/mermaid.c @@ -330,9 +330,9 @@ static MACHINE_START( mermaid ) { mermaid_state *state = (mermaid_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->ay1 = devtag_get_device(machine, "ay1"); - state->ay2 = devtag_get_device(machine, "ay2"); + state->maincpu = machine->device("maincpu"); + state->ay1 = machine->device("ay1"); + state->ay2 = machine->device("ay2"); state_save_register_global(machine, state->coll_bit0); state_save_register_global(machine, state->coll_bit1); diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c index fb1e5983312..5bc76089b86 100644 --- a/src/mame/drivers/metalmx.c +++ b/src/mame/drivers/metalmx.c @@ -787,11 +787,11 @@ static DRIVER_INIT( metalmx ) UINT8 *adsp_boot = (UINT8*)memory_region(machine, "adsp"); metalmx_state *state = (metalmx_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->adsp = devtag_get_device(machine, "adsp"); - state->gsp = devtag_get_device(machine, "gsp"); - state->dsp32c_1 = devtag_get_device(machine, "dsp32c_1"); - state->dsp32c_2 = devtag_get_device(machine, "dsp32c_2"); + state->maincpu = machine->device("maincpu"); + state->adsp = machine->device("adsp"); + state->gsp = machine->device("gsp"); + state->dsp32c_1 = machine->device("dsp32c_1"); + state->dsp32c_2 = machine->device("dsp32c_2"); adsp2105_load_boot_data(adsp_boot, state->adsp_internal_program_ram); diff --git a/src/mame/drivers/metlclsh.c b/src/mame/drivers/metlclsh.c index 741c2b63bcb..1c4c01fa0de 100644 --- a/src/mame/drivers/metlclsh.c +++ b/src/mame/drivers/metlclsh.c @@ -277,8 +277,8 @@ static MACHINE_START( metlclsh ) { metlclsh_state *state = (metlclsh_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->write_mask); state_save_register_global(machine, state->gfxbank); diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c index e48abddbbbc..6378d97776a 100644 --- a/src/mame/drivers/metro.c +++ b/src/mame/drivers/metro.c @@ -3599,7 +3599,7 @@ static MACHINE_RESET( metro ) metro_state *state = (metro_state *)machine->driver_data; if (state->irq_line == -1) - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), metro_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), metro_irq_callback); } diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c index c7338f11220..87b55b978e9 100644 --- a/src/mame/drivers/mexico86.c +++ b/src/mame/drivers/mexico86.c @@ -426,10 +426,10 @@ static MACHINE_START( mexico86 ) memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->port_a_in); state_save_register_global(machine, state->port_a_out); @@ -452,7 +452,7 @@ static MACHINE_RESET( mexico86 ) mexico86_state *state = (mexico86_state *)machine->driver_data; /*TODO: check the PCB and see how the halt / reset lines are connected. */ - if (devtag_get_device(machine, "sub") != NULL) + if (machine->device("sub") != NULL) cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE); state->port_a_in = 0; diff --git a/src/mame/drivers/mgolf.c b/src/mame/drivers/mgolf.c index 53a424fec21..a14a728751f 100644 --- a/src/mame/drivers/mgolf.c +++ b/src/mame/drivers/mgolf.c @@ -304,7 +304,7 @@ static MACHINE_START( mgolf ) { mgolf_state *state = (mgolf_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->prev); state_save_register_global(machine, state->mask); diff --git a/src/mame/drivers/mhavoc.c b/src/mame/drivers/mhavoc.c index 2c86e7d882e..7956f0433a3 100644 --- a/src/mame/drivers/mhavoc.c +++ b/src/mame/drivers/mhavoc.c @@ -205,9 +205,9 @@ static READ8_HANDLER( dual_pokey_r ) int pokey_reg = (offset % 8) | control; if (pokey_num == 0) - return pokey_r(devtag_get_device(space->machine, "pokey1"), pokey_reg); + return pokey_r(space->machine->device("pokey1"), pokey_reg); else - return pokey_r(devtag_get_device(space->machine, "pokey2"), pokey_reg); + return pokey_r(space->machine->device("pokey2"), pokey_reg); } @@ -218,9 +218,9 @@ static WRITE8_HANDLER( dual_pokey_w ) int pokey_reg = (offset % 8) | control; if (pokey_num == 0) - pokey_w(devtag_get_device(space->machine, "pokey1"), pokey_reg, data); + pokey_w(space->machine->device("pokey1"), pokey_reg, data); else - pokey_w(devtag_get_device(space->machine, "pokey2"), pokey_reg, data); + pokey_w(space->machine->device("pokey2"), pokey_reg, data); } diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c index 6b0fae4f1bf..84c89bd0ebd 100644 --- a/src/mame/drivers/midas.c +++ b/src/mame/drivers/midas.c @@ -298,9 +298,9 @@ static WRITE16_HANDLER( hammer_motor_w ) { if (ACCESSING_BITS_0_7) { - ticket_dispenser_w(devtag_get_device(space->machine, "prize1"), 0, (data & 0x0001) << 7); - ticket_dispenser_w(devtag_get_device(space->machine, "prize2"), 0, (data & 0x0002) << 6); - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, (data & 0x0010) << 3); + ticket_dispenser_w(space->machine->device("prize1"), 0, (data & 0x0001) << 7); + ticket_dispenser_w(space->machine->device("prize2"), 0, (data & 0x0002) << 6); + ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x0010) << 3); // data & 0x0080 ? } #ifdef MAME_DEBUG diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c index 7b494ceeed6..c17fb4b1801 100644 --- a/src/mame/drivers/mirax.c +++ b/src/mame/drivers/mirax.c @@ -178,7 +178,7 @@ static WRITE8_HANDLER(audio_w) static WRITE8_DEVICE_HANDLER(ay_sel) { - if(cpu_get_previouspc(devtag_get_device(device->machine, "audiocpu"))==0x309) + if(cpu_get_previouspc(device->machine->device("audiocpu"))==0x309) { ay8910_address_w(device,0,nAyCtrl); ay8910_data_w(device,0,nAyData); diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c index b753cf2c24c..00a03123ced 100644 --- a/src/mame/drivers/missb2.c +++ b/src/mame/drivers/missb2.c @@ -359,9 +359,9 @@ static MACHINE_START( missb2 ) { bublbobl_state *state = (bublbobl_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->slave = devtag_get_device(machine, "slave"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->slave = machine->device("slave"); state->mcu = NULL; state_save_register_global(machine, state->sound_nmi_enable); diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c index a35f61eddc2..4af5bd69007 100644 --- a/src/mame/drivers/missile.c +++ b/src/mame/drivers/missile.c @@ -679,7 +679,7 @@ static WRITE8_HANDLER( missile_w ) /* POKEY */ else if (offset < 0x4800) - pokey_w(devtag_get_device(space->machine, "pokey"), offset & 0x0f, data); + pokey_w(space->machine->device("pokey"), offset & 0x0f, data); /* OUT0 */ else if (offset < 0x4900) @@ -738,7 +738,7 @@ static READ8_HANDLER( missile_r ) /* POKEY */ else if (offset < 0x4800) - result = pokey_r(devtag_get_device(space->machine, "pokey"), offset & 0x0f); + result = pokey_r(space->machine->device("pokey"), offset & 0x0f); /* IN0 */ else if (offset < 0x4900) diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c index 63b46bea0a1..cb1662f444e 100644 --- a/src/mame/drivers/mitchell.c +++ b/src/mame/drivers/mitchell.c @@ -115,7 +115,7 @@ static NVRAM_HANDLER( mitchell ) static READ8_HANDLER( pang_port5_r ) { - int bit = eeprom_read_bit(devtag_get_device(space->machine, "eeprom")) << 7; + int bit = eeprom_read_bit(space->machine->device("eeprom")) << 7; /* bits 0 and (sometimes) 3 are checked in the interrupt handler. bit 3 is checked before updating the palette so it really seems to be vblank. diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c index 241ca5e406d..0c5a77388c8 100644 --- a/src/mame/drivers/mjsister.c +++ b/src/mame/drivers/mjsister.c @@ -452,8 +452,8 @@ static MACHINE_START( mjsister ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->dac = devtag_get_device(machine, "dac"); + state->maincpu = machine->device("maincpu"); + state->dac = machine->device("dac"); state_save_register_global(machine, state->dac_busy); state_save_register_global(machine, state->flip_screen); diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c index 5f3eba6e4bd..9e3bcbd3429 100644 --- a/src/mame/drivers/mlanding.c +++ b/src/mame/drivers/mlanding.c @@ -301,7 +301,7 @@ static WRITE16_HANDLER( ml_sub_reset_w ) static WRITE16_HANDLER( ml_to_sound_w ) { - running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = space->machine->device("tc0140syt"); if (offset == 0) tc0140syt_port_w(tc0140syt, 0, data & 0xff); else if (offset == 1) @@ -313,7 +313,7 @@ static WRITE16_HANDLER( ml_to_sound_w ) static WRITE8_HANDLER( ml_sound_to_main_w ) { - running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = space->machine->device("tc0140syt"); if (offset == 0) tc0140syt_slave_port_w(tc0140syt, 0, data & 0xff); else if (offset == 1) diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c index 70afb9fe8e4..07586c2f17c 100644 --- a/src/mame/drivers/model1.c +++ b/src/mame/drivers/model1.c @@ -713,7 +713,7 @@ static IRQ_CALLBACK(irq_callback) static void irq_init(running_machine *machine) { cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); } static INTERRUPT_GEN(model1_interrupt) @@ -838,7 +838,7 @@ static WRITE16_HANDLER(mr2_w) static READ16_HANDLER( snd_68k_ready_r ) { - int sr = cpu_get_reg(devtag_get_device(space->machine, "audiocpu"), M68K_SR); + int sr = cpu_get_reg(space->machine->device("audiocpu"), M68K_SR); if ((sr & 0x0700) > 0x0100) { diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c index d852bb379b4..b900c26f303 100644 --- a/src/mame/drivers/model2.c +++ b/src/mame/drivers/model2.c @@ -230,11 +230,11 @@ static UINT32 copro_fifoout_pop(const address_space *space) { if (copro_fifoout_num == COPRO_FIFOOUT_SIZE) { - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE); } else { - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, CLEAR_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE); } } @@ -497,7 +497,7 @@ static CUSTOM_INPUT( _1c00000_r ) else { ret &= ~0x0030; - return ret | 0x00d0 | (eeprom_read_bit(devtag_get_device(field->port->machine, "eeprom")) << 5); + return ret | 0x00d0 | (eeprom_read_bit(field->port->machine->device("eeprom")) << 5); } } @@ -673,9 +673,9 @@ static WRITE32_HANDLER(copro_function_port_w) //logerror("copro_function_port_w: %08X, %08X, %08X\n", data, offset, mem_mask); if (dsp_type == DSP_TYPE_SHARC) - copro_fifoin_push(devtag_get_device(space->machine, "dsp"), d); + copro_fifoin_push(space->machine->device("dsp"), d); else - copro_fifoin_push(devtag_get_device(space->machine, "tgp"), d); + copro_fifoin_push(space->machine->device("tgp"), d); } static READ32_HANDLER(copro_fifo_r) @@ -690,7 +690,7 @@ static WRITE32_HANDLER(copro_fifo_w) { if (dsp_type == DSP_TYPE_SHARC) { - sharc_external_dma_write(devtag_get_device(space->machine, "dsp"), model2_coprocnt, data & 0xffff); + sharc_external_dma_write(space->machine->device("dsp"), model2_coprocnt, data & 0xffff); } else if (dsp_type == DSP_TYPE_TGP) { @@ -703,9 +703,9 @@ static WRITE32_HANDLER(copro_fifo_w) { //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(space->cpu)); if (dsp_type == DSP_TYPE_SHARC) - copro_fifoin_push(devtag_get_device(space->machine, "dsp"), data); + copro_fifoin_push(space->machine->device("dsp"), data); else - copro_fifoin_push(devtag_get_device(space->machine, "tgp"), data); + copro_fifoin_push(space->machine->device("tgp"), data); } } @@ -724,7 +724,7 @@ static WRITE32_HANDLER(copro_sharc_iop_w) (strcmp(space->machine->gamedrv->name, "vonj" ) == 0) || (strcmp(space->machine->gamedrv->name, "rchase2" ) == 0)) { - sharc_external_iop_write(devtag_get_device(space->machine, "dsp"), offset, data); + sharc_external_iop_write(space->machine->device("dsp"), offset, data); } else { @@ -735,7 +735,7 @@ static WRITE32_HANDLER(copro_sharc_iop_w) else { iop_data |= (data & 0xffff) << 16; - sharc_external_iop_write(devtag_get_device(space->machine, "dsp"), offset, iop_data); + sharc_external_iop_write(space->machine->device("dsp"), offset, iop_data); } iop_write_num++; } @@ -810,7 +810,7 @@ static WRITE32_HANDLER(geo_sharc_fifo_w) { if (model2_geoctl & 0x80000000) { - sharc_external_dma_write(devtag_get_device(space->machine, "dsp2"), model2_geocnt, data & 0xffff); + sharc_external_dma_write(space->machine->device("dsp2"), model2_geocnt, data & 0xffff); model2_geocnt++; } @@ -826,7 +826,7 @@ static WRITE32_HANDLER(geo_sharc_iop_w) { if ((strcmp(space->machine->gamedrv->name, "schamp" ) == 0)) { - sharc_external_iop_write(devtag_get_device(space->machine, "dsp2"), offset, data); + sharc_external_iop_write(space->machine->device("dsp2"), offset, data); } else { @@ -837,7 +837,7 @@ static WRITE32_HANDLER(geo_sharc_iop_w) else { geo_iop_data |= (data & 0xffff) << 16; - sharc_external_iop_write(devtag_get_device(space->machine, "dsp2"), offset, geo_iop_data); + sharc_external_iop_write(space->machine->device("dsp2"), offset, geo_iop_data); } geo_iop_write_num++; } @@ -1014,7 +1014,7 @@ static int to_68k; static int snd_68k_ready_r(const address_space *space) { - int sr = cpu_get_reg(devtag_get_device(space->machine, "audiocpu"), M68K_SR); + int sr = cpu_get_reg(space->machine->device("audiocpu"), M68K_SR); if ((sr & 0x0700) > 0x0100) { @@ -1062,7 +1062,7 @@ static WRITE32_HANDLER( model2_serial_w ) { if (ACCESSING_BITS_0_7 && (offset == 0)) { - scsp_midi_in(devtag_get_device(space->machine, "scsp"), 0, data&0xff, 0); + scsp_midi_in(space->machine->device("scsp"), 0, data&0xff, 0); // give the 68k time to notice cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(40)); @@ -1945,14 +1945,14 @@ static READ32_HANDLER(copro_sharc_input_fifo_r) UINT32 result = 0; //mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(space->cpu)); - copro_fifoin_pop(devtag_get_device(space->machine, "dsp"), &result); + copro_fifoin_pop(space->machine->device("dsp"), &result); return result; } static WRITE32_HANDLER(copro_sharc_output_fifo_w) { //mame_printf_debug("SHARC FIFOOUT push %08X\n", data); - copro_fifoout_push(devtag_get_device(space->machine, "dsp"), data); + copro_fifoout_push(space->machine->device("dsp"), data); } static READ32_HANDLER(copro_sharc_buffer_r) diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c index 551f379d32b..4e4d6650903 100644 --- a/src/mame/drivers/model3.c +++ b/src/mame/drivers/model3.c @@ -1143,7 +1143,7 @@ static void real3d_dma_callback(running_machine *machine, UINT32 src, UINT32 dst case 0x9c: /* Unknown */ break; default: - logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(devtag_get_device(machine, "maincpu"))); + logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(machine->device("maincpu"))); break; } } @@ -1203,10 +1203,10 @@ static void model3_exit(running_machine &machine) static void configure_fast_ram(running_machine *machine) { /* set conservative DRC options */ - ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES); + ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES); /* configure fast RAM regions for DRC */ - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x007fffff, FALSE, work_ram); + ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, work_ram); } static MACHINE_START(model3_10) @@ -1369,7 +1369,7 @@ static WRITE64_HANDLER( model3_ctrl_w ) case 0: if (ACCESSING_BITS_56_63) { - running_device *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = space->machine->device("eeprom"); int reg = (data >> 56) & 0xff; eeprom_write_bit(device, (reg & 0x20) ? 1 : 0); eeprom_set_clock_line(device, (reg & 0x80) ? ASSERT_LINE : CLEAR_LINE); @@ -1620,7 +1620,7 @@ static WRITE64_HANDLER(model3_sound_w) // serial configuration writes if ((mem_mask == U64(0xff00000000000000)) && (offset == 0)) { - scsp_midi_in(devtag_get_device(space->machine, "scsp1"), 0, (data>>56)&0xff, 0); + scsp_midi_in(space->machine->device("scsp1"), 0, (data>>56)&0xff, 0); // give the 68k time to notice cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(40)); diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c index 97ba27285f2..b43c4504ca3 100644 --- a/src/mame/drivers/mogura.c +++ b/src/mame/drivers/mogura.c @@ -195,9 +195,9 @@ static MACHINE_START( mogura ) { mogura_state *state = (mogura_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->dac1 = devtag_get_device(machine, "dac1"); - state->dac2 = devtag_get_device(machine, "dac2"); + state->maincpu = machine->device("maincpu"); + state->dac1 = machine->device("dac1"); + state->dac2 = machine->device("dac2"); } static MACHINE_DRIVER_START( mogura ) diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c index 8c8a9631a30..b41eedb25c6 100644 --- a/src/mame/drivers/moo.c +++ b/src/mame/drivers/moo.c @@ -433,13 +433,13 @@ static MACHINE_START( moo ) { moo_state *state = (moo_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "soundcpu"); - state->k054539 = devtag_get_device(machine, "k054539"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053251 = devtag_get_device(machine, "k053251"); - state->k056832 = devtag_get_device(machine, "k056832"); - state->k054338 = devtag_get_device(machine, "k054338"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("soundcpu"); + state->k054539 = machine->device("k054539"); + state->k053246 = machine->device("k053246"); + state->k053251 = machine->device("k053251"); + state->k056832 = machine->device("k056832"); + state->k054338 = machine->device("k054338"); state_save_register_global(machine, state->cur_control2); state_save_register_global(machine, state->alpha_enabled); diff --git a/src/mame/drivers/mouser.c b/src/mame/drivers/mouser.c index 3aec7a12149..f940ff5a4a0 100644 --- a/src/mame/drivers/mouser.c +++ b/src/mame/drivers/mouser.c @@ -175,8 +175,8 @@ static MACHINE_START( mouser ) { mouser_state *state = (mouser_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->sound_byte); state_save_register_global(machine, state->nmi_enable); diff --git a/src/mame/drivers/mpoker.c b/src/mame/drivers/mpoker.c index 5d0cd74cfb9..59dbfaf19f2 100644 --- a/src/mame/drivers/mpoker.c +++ b/src/mame/drivers/mpoker.c @@ -446,7 +446,7 @@ static WRITE8_HANDLER( outport7_w ) //static WRITE8_HANDLER( sound_w ) //{ -// dac_data_w(devtag_get_device(space->machine, "dac"), data); +// dac_data_w(space->machine->device("dac"), data); //} */ diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index f01843d8ae9..f23eb351f45 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -453,13 +453,13 @@ static MACHINE_RESET( mpu4 ) /* 6809 IRQ handler */ static WRITE_LINE_DEVICE_HANDLER( cpu0_irq ) { - running_device *pia3 = devtag_get_device(device->machine, "pia_ic3"); - running_device *pia4 = devtag_get_device(device->machine, "pia_ic4"); - running_device *pia5 = devtag_get_device(device->machine, "pia_ic5"); - running_device *pia6 = devtag_get_device(device->machine, "pia_ic6"); - running_device *pia7 = devtag_get_device(device->machine, "pia_ic7"); - running_device *pia8 = devtag_get_device(device->machine, "pia_ic8"); - running_device *ptm6840 = devtag_get_device(device->machine, "6840ptm"); + running_device *pia3 = device->machine->device("pia_ic3"); + running_device *pia4 = device->machine->device("pia_ic4"); + running_device *pia5 = device->machine->device("pia_ic5"); + running_device *pia6 = device->machine->device("pia_ic6"); + running_device *pia7 = device->machine->device("pia_ic7"); + running_device *pia8 = device->machine->device("pia_ic8"); + running_device *ptm6840 = device->machine->device("6840ptm"); /* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */ int combined_state = pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3) | @@ -484,7 +484,7 @@ static WRITE_LINE_DEVICE_HANDLER( cpu0_irq ) static WRITE_LINE_DEVICE_HANDLER( cpu0_irq_m6840 ) { - cpu0_irq(devtag_get_device(device->machine, "pia_ic3"), state); + cpu0_irq(device->machine->device("pia_ic3"), state); } @@ -513,7 +513,7 @@ static WRITE8_DEVICE_HANDLER( ic2_o1_callback ) static WRITE8_DEVICE_HANDLER( ic2_o2_callback ) { - running_device *pia = devtag_get_device(device->machine, "pia_ic3"); + running_device *pia = device->machine->device("pia_ic3"); pia6821_ca1_w(pia, 0, data); /* copy output value to IC3 ca1 */ /* the output from timer2 is the input clock for timer3 */ @@ -755,7 +755,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_r ) static READ8_DEVICE_HANDLER( pia_ic5_portb_r ) { - running_device *pia_ic5 = devtag_get_device(device->machine, "pia_ic5"); + running_device *pia_ic5 = device->machine->device("pia_ic5"); LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",cpuexec_describe_context(device->machine))); coin_lockout_w(device->machine, 0, (pia6821_get_output_b(pia_ic5) & 0x01) ); coin_lockout_w(device->machine, 1, (pia6821_get_output_b(pia_ic5) & 0x02) ); @@ -808,14 +808,14 @@ static void update_ay(running_device *device) } case 0x01: { /* CA2 = 1 CB2 = 0? : Read from selected PSG register and make the register data available to Port A */ - running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); + running_device *pia_ic6 = device->machine->device("pia_ic6"); LOG(("AY8913 address = %d \n",pia6821_get_output_a(pia_ic6)&0x0f)); break; } case 0x02: {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */ - running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); - running_device *ay = devtag_get_device(device->machine, "ay8913"); + running_device *pia_ic6 = device->machine->device("pia_ic6"); + running_device *ay = device->machine->device("ay8913"); ay8910_data_w(ay, 0, pia6821_get_output_a(pia_ic6)); LOG(("AY Chip Write \n")); break; @@ -823,8 +823,8 @@ static void update_ay(running_device *device) case 0x03: {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it. The register will remain selected until another is chosen.*/ - running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); - running_device *ay = devtag_get_device(device->machine, "ay8913"); + running_device *pia_ic6 = device->machine->device("pia_ic6"); + running_device *ay = device->machine->device("ay8913"); ay8910_address_w(ay, 0, pia6821_get_output_a(pia_ic6)); LOG(("AY Chip Select \n")); break; @@ -1027,7 +1027,7 @@ static const pia6821_interface pia_ic7_intf = static READ8_DEVICE_HANDLER( pia_ic8_porta_r ) { static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" }; - running_device *pia_ic5 = devtag_get_device(device->machine, "pia_ic5"); + running_device *pia_ic5 = device->machine->device("pia_ic5"); LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", cpuexec_describe_context(device->machine))); /* The orange inputs are polled twice as often as the black ones, for reasons of efficiency. @@ -1088,7 +1088,7 @@ static const pia6821_interface pia_ic8_intf = static WRITE8_DEVICE_HANDLER( pia_gb_porta_w ) { - running_device *msm6376 = devtag_get_device(device->machine, "msm6376"); + running_device *msm6376 = device->machine->device("msm6376"); LOG(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data)); okim6376_w(msm6376, 0, data); @@ -1745,7 +1745,7 @@ static TIMER_DEVICE_CALLBACK( gen_50hz ) oscillating signal.*/ signal_50hz = signal_50hz?0:1; update_lamps(); - pia6821_ca1_w(devtag_get_device(timer.machine, "pia_ic4"), 0, signal_50hz); /* signal is connected to IC4 CA1 */ + pia6821_ca1_w(timer.machine->device("pia_ic4"), 0, signal_50hz); /* signal is connected to IC4 CA1 */ } diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index c62ed894bb0..8ef7aef121a 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -357,8 +357,8 @@ static WRITE8_DEVICE_HANDLER( vid_o1_callback ) if (data) { - running_device *acia_0 = devtag_get_device(device->machine, "acia6850_0"); - running_device *acia_1 = devtag_get_device(device->machine, "acia6850_1"); + running_device *acia_0 = device->machine->device("acia6850_0"); + running_device *acia_1 = device->machine->device("acia6850_1"); acia6850_tx_clock_in(acia_0); acia6850_rx_clock_in(acia_0); acia6850_tx_clock_in(acia_1); @@ -1894,8 +1894,8 @@ static WRITE16_DEVICE_HANDLER( oki_w ) static void video_reset(running_device *device) { - devtag_get_device(device->machine, "6840ptm_68k")->reset(); - devtag_get_device(device->machine, "acia6850_1")->reset(); + device->machine->device("6840ptm_68k")->reset(); + device->machine->device("acia6850_1")->reset(); } /* machine start (called only once) */ @@ -1919,7 +1919,7 @@ static MACHINE_START( mpu4_vid ) ROC10937_init(0, MSC1937, 0); /* Hook the reset line */ - m68k_set_reset_callback(devtag_get_device(machine, "video"), video_reset); + m68k_set_reset_callback(machine->device("video"), video_reset); } static MACHINE_RESET( mpu4_vid ) @@ -2502,7 +2502,7 @@ static DRIVER_INIT (crmaze3a) static DRIVER_INIT (mating) { const address_space *space = cputag_get_address_space(machine, "video", ADDRESS_SPACE_PROGRAM); - running_device *device = devtag_get_device(machine, "oki"); + running_device *device = machine->device("oki"); /* The Mating Game has an extra 256kB RAM on the program card */ memory_install_ram(space, 0x600000, 0x63ffff, 0, 0, NULL); diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c index 19a0a4306d0..8639661df6b 100644 --- a/src/mame/drivers/mquake.c +++ b/src/mame/drivers/mquake.c @@ -319,7 +319,7 @@ static const es5503_interface es5503_intf = static MACHINE_RESET(mquake) { /* set ES5503 wave memory (this is banked in 64k increments) */ - es5503_set_base(devtag_get_device(machine, "ensoniq"), memory_region(machine, "ensoniq")); + es5503_set_base(machine->device("ensoniq"), memory_region(machine, "ensoniq")); MACHINE_RESET_CALL(amiga); } diff --git a/src/mame/drivers/mrflea.c b/src/mame/drivers/mrflea.c index d0da8104895..659d9da54a4 100644 --- a/src/mame/drivers/mrflea.c +++ b/src/mame/drivers/mrflea.c @@ -329,8 +329,8 @@ static MACHINE_START( mrflea ) { mrflea_state *state = (mrflea_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->gfx_bank); state_save_register_global(machine, state->io); diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c index ddd172b695e..e573cb4753f 100644 --- a/src/mame/drivers/ms32.c +++ b/src/mame/drivers/ms32.c @@ -1220,7 +1220,7 @@ static void irq_init(running_machine *machine) { irqreq = 0; cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); } static void irq_raise(running_machine *machine, int level) diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c index ee9bbde4713..c10af8f32a1 100644 --- a/src/mame/drivers/msisaac.c +++ b/src/mame/drivers/msisaac.c @@ -455,7 +455,7 @@ static MACHINE_START( msisaac ) { buggychl_state *state = (buggychl_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); /* video */ state_save_register_global(machine, state->bg2_textbank); @@ -467,7 +467,7 @@ static MACHINE_START( msisaac ) state_save_register_global(machine, state->snd_ctrl1); #ifdef USE_MCU - state->mcu = devtag_get_device(machine, "mcu"); + state->mcu = machine->device("mcu"); /* mcu */ state_save_register_global(machine, state->from_main); diff --git a/src/mame/drivers/mugsmash.c b/src/mame/drivers/mugsmash.c index 56b6653efc0..22f8cee4ec8 100644 --- a/src/mame/drivers/mugsmash.c +++ b/src/mame/drivers/mugsmash.c @@ -404,8 +404,8 @@ static MACHINE_START( mugsmash ) { mugsmash_state *state = (mugsmash_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_DRIVER_START( mugsmash ) diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c index 14a5780996c..0506710d7da 100644 --- a/src/mame/drivers/multigam.c +++ b/src/mame/drivers/multigam.c @@ -161,7 +161,7 @@ static void set_videoram_bank(running_machine* machine, int start, int count, in static WRITE8_HANDLER( sprite_dma_w ) { int source = (data & 7); - ppu2c0x_spriteram_dma(space, devtag_get_device(space->machine, "ppu"), source); + ppu2c0x_spriteram_dma(space, space->machine->device("ppu"), source); } static READ8_DEVICE_HANDLER( psg_4015_r ) @@ -341,14 +341,14 @@ static void multigam3_mmc3_scanline_cb( running_device *device, int scanline, in if (--multigam3_mmc3_scanline_counter == -1) { multigam3_mmc3_scanline_counter = multigam3_mmc3_scanline_latch; - generic_pulse_irq_line(devtag_get_device(device->machine, "maincpu"), 0); + generic_pulse_irq_line(device->machine->device("maincpu"), 0); } } } static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w ) { - running_device *ppu = devtag_get_device(space->machine, "ppu"); + running_device *ppu = space->machine->device("ppu"); /* basically, a MMC3 mapper from the nes */ static int multigam3_mmc3_command; @@ -620,7 +620,7 @@ static void multigam_init_mapper02(running_machine *machine, UINT8* prg_base, in multigam_mapper02_prg_base = prg_base; multigam_mapper02_prg_size = prg_size; - ppu2c0x_set_scanline_callback(devtag_get_device(machine, "ppu"), 0); + ppu2c0x_set_scanline_callback(machine->device("ppu"), 0); } /****************************************************** @@ -785,7 +785,7 @@ static void multigam_init_mmc1(running_machine *machine, UINT8 *prg_base, int pr multigam_mmc1_prg_size = prg_size; multigam_mmc1_chr_bank_base = chr_bank_base; - ppu2c0x_set_scanline_callback(devtag_get_device(machine, "ppu"), 0); + ppu2c0x_set_scanline_callback(machine->device("ppu"), 0); }; @@ -816,7 +816,7 @@ static UINT8 supergm3_chr_bank; static void supergm3_set_bank(running_machine *machine) { - running_device *ppu = devtag_get_device(machine, "ppu"); + running_device *ppu = machine->device("ppu"); UINT8* mem = memory_region(machine, "maincpu"); // video bank @@ -1059,7 +1059,7 @@ static VIDEO_START( multigam ) static VIDEO_UPDATE( multigam ) { /* render the ppu */ - ppu2c0x_render(devtag_get_device(screen->machine, "ppu"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen->machine->device("ppu"), bitmap, 0, 0, 0, 0); return 0; } @@ -1092,8 +1092,8 @@ static MACHINE_START( multigam ) nt_page[2] = nt_ram + 0x800; nt_page[3] = nt_ram + 0xc00; - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1"); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1"); memory_set_bankptr(machine, "bank1", memory_region(machine, "gfx1")); } @@ -1105,16 +1105,16 @@ static MACHINE_START( multigm3 ) nt_page[2] = nt_ram + 0x800; nt_page[3] = nt_ram + 0xc00; - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, "bank2"); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0400, 0x07ff, 0, 0, "bank3"); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0800, 0x0bff, 0, 0, "bank4"); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0c00, 0x0fff, 0, 0, "bank5"); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1000, 0x13ff, 0, 0, "bank6"); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1400, 0x17ff, 0, 0, "bank7"); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1800, 0x1bff, 0, 0, "bank8"); - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1c00, 0x1fff, 0, 0, "bank9"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, "bank2"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0400, 0x07ff, 0, 0, "bank3"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0800, 0x0bff, 0, 0, "bank4"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0c00, 0x0fff, 0, 0, "bank5"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1000, 0x13ff, 0, 0, "bank6"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1400, 0x17ff, 0, 0, "bank7"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1800, 0x1bff, 0, 0, "bank8"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1c00, 0x1fff, 0, 0, "bank9"); set_videorom_bank(machine, 0, 8, 0, 8); }; @@ -1127,7 +1127,7 @@ static MACHINE_START( supergm3 ) nt_page[2] = nt_ram + 0x800; nt_page[3] = nt_ram + 0xc00; - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); vram = auto_alloc_array(machine, UINT8, 0x2000); multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000); diff --git a/src/mame/drivers/munchmo.c b/src/mame/drivers/munchmo.c index 2115dc37dc2..00aa93c5c02 100644 --- a/src/mame/drivers/munchmo.c +++ b/src/mame/drivers/munchmo.c @@ -309,8 +309,8 @@ static MACHINE_START( munchmo ) { munchmo_state *state = (munchmo_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->palette_bank); state_save_register_global(machine, state->flipscreen); diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c index 9ff8b676ea4..1741d06e0fc 100644 --- a/src/mame/drivers/mw8080bw.c +++ b/src/mame/drivers/mw8080bw.c @@ -630,7 +630,7 @@ static WRITE8_HANDLER( tornbase_io_w ) mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data; if (offset & 0x01) - tornbase_audio_w(devtag_get_device(space->machine, "discrete"), 0, data); + tornbase_audio_w(space->machine->device("discrete"), 0, data); if (offset & 0x02) mb14241_shift_count_w(state->mb14241, 0, data); @@ -883,7 +883,7 @@ MACHINE_DRIVER_END static STATE_POSTLOAD( maze_update_discrete ) { mw8080bw_state *state = (mw8080bw_state *)machine->driver_data; - maze_write_discrete(devtag_get_device(machine, "discrete"), state->maze_tone_timing_state); + maze_write_discrete(machine->device("discrete"), state->maze_tone_timing_state); } diff --git a/src/mame/drivers/mystston.c b/src/mame/drivers/mystston.c index 0c6511463f5..d0b6879192b 100644 --- a/src/mame/drivers/mystston.c +++ b/src/mame/drivers/mystston.c @@ -78,14 +78,14 @@ static WRITE8_HANDLER( mystston_ay8910_select_w ) if (((*state->ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00)) { /* bit 4 goes to the 8910 #0 BC1 pin */ - ay8910_data_address_w(devtag_get_device(space->machine, "ay1"), *state->ay8910_select >> 4, *state->ay8910_data); + ay8910_data_address_w(space->machine->device("ay1"), *state->ay8910_select >> 4, *state->ay8910_data); } /* bit 7 goes to 8910 #1 BDIR pin */ if (((*state->ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00)) { /* bit 6 goes to the 8910 #1 BC1 pin */ - ay8910_data_address_w(devtag_get_device(space->machine, "ay2"), *state->ay8910_select >> 6, *state->ay8910_data); + ay8910_data_address_w(space->machine->device("ay2"), *state->ay8910_select >> 6, *state->ay8910_data); } *state->ay8910_select = data; diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c index ed9a0e4bfdd..9ead37f6c1d 100644 --- a/src/mame/drivers/mystwarr.c +++ b/src/mame/drivers/mystwarr.c @@ -888,8 +888,8 @@ static MACHINE_START( mystwarr ) static MACHINE_RESET(mystwarr) { - running_device *k054539_1 = devtag_get_device(machine, "konami1"); - running_device *k054539_2 = devtag_get_device(machine, "konami2"); + running_device *k054539_1 = machine->device("konami1"); + running_device *k054539_2 = machine->device("konami2"); int i; // soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7) @@ -905,7 +905,7 @@ static MACHINE_RESET(mystwarr) static MACHINE_RESET(dadandrn) { - running_device *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = machine->device("konami1"); int i; // boost voice(chip 0 channel 4-7) @@ -914,7 +914,7 @@ static MACHINE_RESET(dadandrn) static MACHINE_RESET(viostorm) { - running_device *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = machine->device("konami1"); int i; // boost voice(chip 0 channel 4-7) @@ -923,8 +923,8 @@ static MACHINE_RESET(viostorm) static MACHINE_RESET(metamrph) { - running_device *k054539_1 = devtag_get_device(machine, "konami1"); - running_device *k054539_2 = devtag_get_device(machine, "konami2"); + running_device *k054539_1 = machine->device("konami1"); + running_device *k054539_2 = machine->device("konami2"); int i; // boost voice(chip 0 channel 4-7) and soften other channels @@ -939,7 +939,7 @@ static MACHINE_RESET(metamrph) static MACHINE_RESET(martchmp) { - running_device *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = machine->device("konami1"); int i; k054539_init_flags(k054539_1, K054539_REVERSE_STEREO); @@ -950,7 +950,7 @@ static MACHINE_RESET(martchmp) static MACHINE_RESET(gaiapols) { - running_device *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = machine->device("konami1"); int i; // boost voice(chip 0 channel 5-7) diff --git a/src/mame/drivers/n8080.c b/src/mame/drivers/n8080.c index bcf5006a4a1..1305091f0c3 100644 --- a/src/mame/drivers/n8080.c +++ b/src/mame/drivers/n8080.c @@ -436,7 +436,7 @@ static MACHINE_START( n8080 ) { n8080_state *state = (n8080_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->shift_data); state_save_register_global(machine, state->shift_bits); diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c index a19250c80a3..ede447d1d4d 100644 --- a/src/mame/drivers/namcona1.c +++ b/src/mame/drivers/namcona1.c @@ -919,7 +919,7 @@ static WRITE8_HANDLER( port8_w ) static MACHINE_START( namcona1 ) { - c140_set_base(devtag_get_device(machine, "c140"), namcona1_workram); + c140_set_base(machine->device("c140"), namcona1_workram); } // for games with the MCU emulated, the MCU boots the 68000. don't allow it before that. diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c index b4ef3556d23..e5cad6c6219 100644 --- a/src/mame/drivers/namcos1.c +++ b/src/mame/drivers/namcos1.c @@ -384,7 +384,7 @@ static WRITE8_HANDLER( namcos1_coin_w ) static void namcos1_update_DACs(running_machine *machine) { - dac_signed_data_16_w(devtag_get_device(machine, "dac"),0x8000 + (dac0_value * dac0_gain) + (dac1_value * dac1_gain)); + dac_signed_data_16_w(machine->device("dac"),0x8000 + (dac0_value * dac0_gain) + (dac1_value * dac1_gain)); } void namcos1_init_DACs(void) diff --git a/src/mame/drivers/namcos2.c b/src/mame/drivers/namcos2.c index 4d06e5a88de..90f9a536573 100644 --- a/src/mame/drivers/namcos2.c +++ b/src/mame/drivers/namcos2.c @@ -4975,7 +4975,7 @@ static DRIVER_INIT( assaultp_hack ){ // // This is used in conjunction with the interleave increase in the // MACHINE_DRIVER - cpu_set_clockscale(devtag_get_device(machine, "mcu"), 4.0f); + cpu_set_clockscale(machine->device("mcu"), 4.0f); DRIVER_INIT_CALL( assaultp ); } diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c index 33e48a8739a..e272aa8ba56 100644 --- a/src/mame/drivers/namcos21.c +++ b/src/mame/drivers/namcos21.c @@ -612,7 +612,7 @@ static WRITE16_HANDLER( dspram16_w ) } else if (namcos2_gametype == NAMCOS21_SOLVALOU && offset == 0x103 && - space->cpu == devtag_get_device(space->machine, "maincpu")) + space->cpu == space->machine->device("maincpu")) { /* hack; synchronization for solvalou */ cpu_yield(space->cpu); } diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c index c378eb891f1..a9f7a80beba 100644 --- a/src/mame/drivers/namcos22.c +++ b/src/mame/drivers/namcos22.c @@ -2644,7 +2644,7 @@ static READ8_HANDLER( propcycle_mcu_adc_r ) int i; for (i = 0; i < 16; i++) { - generic_pulse_irq_line(devtag_get_device(space->machine, "mcu"), M37710_LINE_TIMERA3TICK); + generic_pulse_irq_line(space->machine->device("mcu"), M37710_LINE_TIMERA3TICK); } } diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c index 6b53a7d2bbd..233317d4a26 100644 --- a/src/mame/drivers/namcos86.c +++ b/src/mame/drivers/namcos86.c @@ -327,7 +327,7 @@ static WRITE8_HANDLER( cus115_w ) case 1: case 2: case 3: - namco_63701x_w(devtag_get_device(space->machine, "namco2"), (offset & 0x1e00) >> 9,data); + namco_63701x_w(space->machine->device("namco2"), (offset & 0x1e00) >> 9,data); break; case 4: diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index a9c02fb46e0..d29ae732507 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -1816,7 +1816,7 @@ INPUT_PORTS_END static MACHINE_RESET( naomi ) { MACHINE_RESET_CALL(dc); - aica_set_ram_base(devtag_get_device(machine, "aica"), dc_sound_ram, 8*1024*1024); + aica_set_ram_base(machine->device("aica"), dc_sound_ram, 8*1024*1024); } /* diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c index 818cdf41f65..5b3cc8e5cd4 100644 --- a/src/mame/drivers/nbmj9195.c +++ b/src/mame/drivers/nbmj9195.c @@ -359,10 +359,10 @@ static WRITE8_HANDLER( tmpz84c011_pio_w ) nbmj9195_soundbank_w(space, 0, data); break; case 6: /* PB_1 */ - DAC_WRITE(devtag_get_device(space->machine, "dac2"), 0, data); + DAC_WRITE(space->machine->device("dac2"), 0, data); break; case 7: /* PC_1 */ - DAC_WRITE(devtag_get_device(space->machine, "dac1"), 0, data); + DAC_WRITE(space->machine->device("dac1"), 0, data); break; case 8: /* PD_1 */ break; @@ -397,10 +397,10 @@ static WRITE8_HANDLER( tmpz84c011_pio_w ) nbmj9195_soundbank_w(space, 0, data); break; case 6: /* PB_1 */ - DAC_WRITE(devtag_get_device(space->machine, "dac2"), 0, data); + DAC_WRITE(space->machine->device("dac2"), 0, data); break; case 7: /* PC_1 */ - DAC_WRITE(devtag_get_device(space->machine, "dac1"), 0, data); + DAC_WRITE(space->machine->device("dac1"), 0, data); break; case 8: /* PD_1 */ break; @@ -471,7 +471,7 @@ static WRITE8_HANDLER( tmpz84c011_1_dir_pe_w ) { pio_dir[9] = data; } /* CTC of main cpu, ch0 trigger is vblank */ static INTERRUPT_GEN( ctc0_trg1 ) { - running_device *ctc = devtag_get_device(device->machine, "main_ctc"); + running_device *ctc = device->machine->device("main_ctc"); z80ctc_trg1_w(ctc, 1); z80ctc_trg1_w(ctc, 0); } diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c index 364cffe89b8..87a3d78472f 100644 --- a/src/mame/drivers/nemesis.c +++ b/src/mame/drivers/nemesis.c @@ -1650,7 +1650,7 @@ static MACHINE_START( nemesis ) state->maincpu = machine->device("maincpu"); state->audiocpu = machine->device("audiocpu"); - state->vlm = devtag_get_device(machine, "vlm"); + state->vlm = machine->device("vlm"); state_save_register_global(machine, state->irq_on); state_save_register_global(machine, state->irq1_on); diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index 0981cf30a54..d7e05a86ccd 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -681,7 +681,7 @@ static CUSTOM_INPUT( get_audio_result ) neogeo_state *state = (neogeo_state *)field->port->machine->driver_data; UINT32 ret = state->audio_result; -// if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(devtag_get_device(field->port->machine, "maincpu")), ret); +// if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field->port->machine->device("maincpu")), ret); return ret; } @@ -1076,9 +1076,9 @@ static MACHINE_START( neogeo ) state->irq3_pending = 1; /* get devices */ - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->upd4990a = devtag_get_device(machine, "upd4990a"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->upd4990a = machine->device("upd4990a"); /* register state save */ state_save_register_global(machine, state->display_position_interrupt_control); diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c index 52fb0fa7952..1cfa2e16521 100644 --- a/src/mame/drivers/nightgal.c +++ b/src/mame/drivers/nightgal.c @@ -829,8 +829,8 @@ static MACHINE_START( nightgal ) { nightgal_state *state = (nightgal_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); state_save_register_global(machine, state->nsc_latch); state_save_register_global(machine, state->z80_latch); diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c index 183d855a3a0..294220b4b18 100644 --- a/src/mame/drivers/ninjakd2.c +++ b/src/mame/drivers/ninjakd2.c @@ -227,7 +227,7 @@ static SAMPLES_START( ninjakd2_init_samples ) static WRITE8_HANDLER( ninjakd2_pcm_play_w ) { - running_device *samples = devtag_get_device(space->machine, "pcm"); + running_device *samples = space->machine->device("pcm"); const UINT8* const rom = memory_region(space->machine, "pcm"); // only Ninja Kid II uses this diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c index 6f6239cb5d9..e208f745159 100644 --- a/src/mame/drivers/ninjaw.c +++ b/src/mame/drivers/ninjaw.c @@ -763,22 +763,22 @@ static MACHINE_START( ninjaw ) memory_configure_bank(machine, "bank10", 0, 8, memory_region(machine, "audiocpu") + 0xc000, 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->tc0140syt = devtag_get_device(machine, "tc0140syt"); - state->tc0100scn_1 = devtag_get_device(machine, "tc0100scn_1"); - state->tc0100scn_2 = devtag_get_device(machine, "tc0100scn_2"); - state->tc0100scn_3 = devtag_get_device(machine, "tc0100scn_3"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->tc0140syt = machine->device("tc0140syt"); + state->tc0100scn_1 = machine->device("tc0100scn_1"); + state->tc0100scn_2 = machine->device("tc0100scn_2"); + state->tc0100scn_3 = machine->device("tc0100scn_3"); - state->lscreen = devtag_get_device(machine, "lscreen"); - state->mscreen = devtag_get_device(machine, "mscreen"); - state->rscreen = devtag_get_device(machine, "rscreen"); + state->lscreen = machine->device("lscreen"); + state->mscreen = machine->device("mscreen"); + state->rscreen = machine->device("rscreen"); - state->_2610_1l = devtag_get_device(machine, "2610.1.l"); - state->_2610_1r = devtag_get_device(machine, "2610.1.r"); - state->_2610_2l = devtag_get_device(machine, "2610.2.l"); - state->_2610_2r = devtag_get_device(machine, "2610.2.r"); + state->_2610_1l = machine->device("2610.1.l"); + state->_2610_1r = machine->device("2610.1.r"); + state->_2610_2l = machine->device("2610.2.l"); + state->_2610_2r = machine->device("2610.2.r"); state_save_register_global(machine, state->cpua_ctrl); state_save_register_global(machine, state->banknum); diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c index d9b6b34722f..1b125efbf95 100644 --- a/src/mame/drivers/niyanpai.c +++ b/src/mame/drivers/niyanpai.c @@ -122,10 +122,10 @@ static WRITE8_HANDLER( tmpz84c011_pio_w) niyanpai_soundbank_w(space->machine, data & 0x03); break; case 1: /* PB_0 */ - DAC_WRITE(devtag_get_device(space->machine, "dac2"), 0, data); + DAC_WRITE(space->machine->device("dac2"), 0, data); break; case 2: /* PC_0 */ - DAC_WRITE(devtag_get_device(space->machine, "dac1"), 0, data); + DAC_WRITE(space->machine->device("dac1"), 0, data); break; case 3: /* PD_0 */ break; diff --git a/src/mame/drivers/nmg5.c b/src/mame/drivers/nmg5.c index 44e0e407b02..7852425be1b 100644 --- a/src/mame/drivers/nmg5.c +++ b/src/mame/drivers/nmg5.c @@ -1012,8 +1012,8 @@ static MACHINE_START( nmg5 ) { nmg5_state *state = (nmg5_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); state_save_register_global(machine, state->gfx_bank); state_save_register_global(machine, state->priority_reg); diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c index cc9ec5655d4..7d442dcc8dd 100644 --- a/src/mame/drivers/norautp.c +++ b/src/mame/drivers/norautp.c @@ -651,7 +651,7 @@ static WRITE8_DEVICE_HANDLER( soundlamps_w ) xxxx ---- * Discrete Sound Lines. */ - running_device *discrete = devtag_get_device(device->machine, "discrete"); + running_device *discrete = device->machine->device("discrete"); output_set_lamp_value(8, (data >> 0) & 1); /* DEAL / DRAW lamp */ output_set_lamp_value(9, (data >> 1) & 1); /* BET / COLLECT lamp */ @@ -721,8 +721,8 @@ static WRITE8_HANDLER( vram_data_w ) np_vram[np_addr] = data & 0xff; /* trigger 8255-2 port C bit 7 (/OBF) */ -// i8255a_pc7_w(devtag_get_device(device->machine, "ppi8255_2"), 0); -// i8255a_pc7_w(devtag_get_device(device->machine, "ppi8255_2"), 1); +// i8255a_pc7_w(device->machine->device("ppi8255_2"), 0); +// i8255a_pc7_w(device->machine->device("ppi8255_2"), 1); } diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c index 1505d73f7bd..a48f407af09 100644 --- a/src/mame/drivers/nwk-tr.c +++ b/src/mame/drivers/nwk-tr.c @@ -245,8 +245,8 @@ static void voodoo_vblank_0(running_device *device, int param) static VIDEO_UPDATE( nwktr ) { - running_device *voodoo = devtag_get_device(screen->machine, "voodoo"); - running_device *k001604 = devtag_get_device(screen->machine, "k001604"); + running_device *voodoo = screen->machine->device("voodoo"); + running_device *k001604 = screen->machine->device("k001604"); bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); @@ -263,7 +263,7 @@ static VIDEO_UPDATE( nwktr ) static READ32_HANDLER( sysreg_r ) { - running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); + running_device *adc12138 = space->machine->device("adc12138"); UINT32 r = 0; if (offset == 0) { @@ -296,7 +296,7 @@ static READ32_HANDLER( sysreg_r ) static WRITE32_HANDLER( sysreg_w ) { - running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); + running_device *adc12138 = space->machine->device("adc12138"); if( offset == 0 ) { if (ACCESSING_BITS_24_31) @@ -463,10 +463,10 @@ static WRITE32_HANDLER( lanc2_w ) static MACHINE_START( nwktr ) { /* set conservative DRC options */ - ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS); + ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x003fffff, FALSE, work_ram); + ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x003fffff, FALSE, work_ram); } static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 ) @@ -618,9 +618,9 @@ static const adc12138_interface nwktr_adc_interface = { static void sound_irq_callback(running_machine *machine, int irq) { if (irq == 0) - generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), INPUT_LINE_IRQ1); + generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ1); else - generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), INPUT_LINE_IRQ2); + generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ2); } static const k056800_interface nwktr_k056800_interface = diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c index 9afd80104ae..f4414d6416c 100644 --- a/src/mame/drivers/nycaptor.c +++ b/src/mame/drivers/nycaptor.c @@ -699,10 +699,10 @@ static MACHINE_START( nycaptor ) { nycaptor_state *state = (nycaptor_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->generic_control_reg); state_save_register_global(machine, state->sound_nmi_enable); diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c index a400a246996..7ed47024446 100644 --- a/src/mame/drivers/nyny.c +++ b/src/mame/drivers/nyny.c @@ -681,13 +681,13 @@ static MACHINE_START( nyny ) { nyny_state *state = (nyny_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->audiocpu2 = devtag_get_device(machine, "audio2"); - state->ic48_1 = devtag_get_device(machine, "ic48_1"); - state->mc6845 = devtag_get_device(machine, "crtc"); - state->pia1 = devtag_get_device(machine, "pia1"); - state->pia2 = devtag_get_device(machine, "pia2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->audiocpu2 = machine->device("audio2"); + state->ic48_1 = machine->device("ic48_1"); + state->mc6845 = machine->device("crtc"); + state->pia1 = machine->device("pia1"); + state->pia2 = machine->device("pia2"); /* setup for save states */ state_save_register_global(machine, state->flipscreen); diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c index 819d896e5bc..4cabffeee28 100644 --- a/src/mame/drivers/ojankohs.c +++ b/src/mame/drivers/ojankohs.c @@ -796,8 +796,8 @@ static MACHINE_START( common ) { ojankohs_state *state = (ojankohs_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->msm = devtag_get_device(machine, "msm"); + state->maincpu = machine->device("maincpu"); + state->msm = machine->device("msm"); state_save_register_global(machine, state->gfxreg); state_save_register_global(machine, state->flipscreen); diff --git a/src/mame/drivers/oneshot.c b/src/mame/drivers/oneshot.c index 7b60ccff9a3..f2ee08967de 100644 --- a/src/mame/drivers/oneshot.c +++ b/src/mame/drivers/oneshot.c @@ -345,8 +345,8 @@ static MACHINE_START( oneshot ) { oneshot_state *state = (oneshot_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->gun_x_p1); state_save_register_global(machine, state->gun_y_p1); diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c index fa7ec53fdab..2745e47b617 100644 --- a/src/mame/drivers/onetwo.c +++ b/src/mame/drivers/onetwo.c @@ -348,8 +348,8 @@ static MACHINE_START( onetwo ) memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); } static MACHINE_DRIVER_START( onetwo ) diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c index ec40a0fabfc..82bec52e131 100644 --- a/src/mame/drivers/opwolf.c +++ b/src/mame/drivers/opwolf.c @@ -435,10 +435,10 @@ static MACHINE_START( opwolf ) state->maincpu = machine->device("maincpu"); state->audiocpu = machine->device("audiocpu"); - state->pc080sn = devtag_get_device(machine, "pc080sn"); - state->pc090oj = devtag_get_device(machine, "pc090oj"); - state->msm1 = devtag_get_device(machine, "msm1"); - state->msm2 = devtag_get_device(machine, "msm2"); + state->pc080sn = machine->device("pc080sn"); + state->pc090oj = machine->device("pc090oj"); + state->msm1 = machine->device("msm1"); + state->msm2 = machine->device("msm2"); state_save_register_global(machine, state->sprite_ctrl); state_save_register_global(machine, state->sprites_flipscreen); @@ -462,8 +462,8 @@ static MACHINE_RESET( opwolf ) state->sprite_ctrl = 0; state->sprites_flipscreen = 0; - msm5205_reset_w(devtag_get_device(machine, "msm1"), 1); - msm5205_reset_w(devtag_get_device(machine, "msm2"), 1); + msm5205_reset_w(machine->device("msm1"), 1); + msm5205_reset_w(machine->device("msm2"), 1); } static void opwolf_msm5205_vck( running_device *device ) diff --git a/src/mame/drivers/orbit.c b/src/mame/drivers/orbit.c index 1ca05391b30..7e69e67fb89 100644 --- a/src/mame/drivers/orbit.c +++ b/src/mame/drivers/orbit.c @@ -276,8 +276,8 @@ static MACHINE_START( orbit ) { orbit_state *state = (orbit_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->discrete = devtag_get_device(machine, "discrete"); + state->maincpu = machine->device("maincpu"); + state->discrete = machine->device("discrete"); state_save_register_global(machine, state->misc_flags); state_save_register_global(machine, state->flip_screen); diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c index a380cd7ed6a..5e24a6713b6 100644 --- a/src/mame/drivers/othello.c +++ b/src/mame/drivers/othello.c @@ -383,11 +383,11 @@ static MACHINE_START( othello ) { othello_state *state = (othello_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->mc6845 = devtag_get_device(machine, "crtc"); - state->n7751 = devtag_get_device(machine, "n7751"); - state->ay1 = devtag_get_device(machine, "ay1"); - state->ay2 = devtag_get_device(machine, "ay2"); + state->maincpu = machine->device("maincpu"); + state->mc6845 = machine->device("crtc"); + state->n7751 = machine->device("n7751"); + state->ay1 = machine->device("ay1"); + state->ay2 = machine->device("ay2"); state_save_register_global(machine, state->tile_bank); state_save_register_global(machine, state->ay_select); diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c index 630a0b781ca..b2cc61d1f36 100644 --- a/src/mame/drivers/othunder.c +++ b/src/mame/drivers/othunder.c @@ -688,19 +688,19 @@ static MACHINE_START( othunder ) memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->eeprom = devtag_get_device(machine, "eeprom"); - state->tc0220ioc = devtag_get_device(machine, "tc0220ioc"); - state->tc0100scn = devtag_get_device(machine, "tc0100scn"); - state->tc0110pcr = devtag_get_device(machine, "tc0110pcr"); - state->tc0140syt = devtag_get_device(machine, "tc0140syt"); - state->_2610_0l = devtag_get_device(machine, "2610.0l"); - state->_2610_0r = devtag_get_device(machine, "2610.0r"); - state->_2610_1l = devtag_get_device(machine, "2610.1l"); - state->_2610_1r = devtag_get_device(machine, "2610.1r"); - state->_2610_2l = devtag_get_device(machine, "2610.2l"); - state->_2610_2r = devtag_get_device(machine, "2610.2r"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->eeprom = machine->device("eeprom"); + state->tc0220ioc = machine->device("tc0220ioc"); + state->tc0100scn = machine->device("tc0100scn"); + state->tc0110pcr = machine->device("tc0110pcr"); + state->tc0140syt = machine->device("tc0140syt"); + state->_2610_0l = machine->device("2610.0l"); + state->_2610_0r = machine->device("2610.0r"); + state->_2610_1l = machine->device("2610.1l"); + state->_2610_1r = machine->device("2610.1r"); + state->_2610_2l = machine->device("2610.2l"); + state->_2610_2r = machine->device("2610.2r"); state_save_register_global(machine, state->vblank_irq); state_save_register_global(machine, state->ad_irq); diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c index 54196085aa7..ff14d3dbcfa 100644 --- a/src/mame/drivers/overdriv.c +++ b/src/mame/drivers/overdriv.c @@ -298,15 +298,15 @@ static MACHINE_START( overdriv ) { overdriv_state *state = (overdriv_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->k051316_1 = devtag_get_device(machine, "k051316_1"); - state->k051316_2 = devtag_get_device(machine, "k051316_2"); - state->k053260_1 = devtag_get_device(machine, "k053260_1"); - state->k053260_2 = devtag_get_device(machine, "k053260_2"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053251 = devtag_get_device(machine, "k053251"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->k051316_1 = machine->device("k051316_1"); + state->k051316_2 = machine->device("k051316_2"); + state->k053260_1 = machine->device("k053260_1"); + state->k053260_2 = machine->device("k053260_2"); + state->k053246 = machine->device("k053246"); + state->k053251 = machine->device("k053251"); state_save_register_global(machine, state->cpuB_ctrl); state_save_register_global(machine, state->sprite_colorbase); diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c index 02586bac506..e1f08d9c404 100644 --- a/src/mame/drivers/pacland.c +++ b/src/mame/drivers/pacland.c @@ -233,7 +233,7 @@ static WRITE8_HANDLER( pacland_led_w ) static WRITE8_HANDLER( pacland_irq_1_ctrl_w ) { int bit = !BIT(offset, 11); - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } @@ -241,7 +241,7 @@ static WRITE8_HANDLER( pacland_irq_1_ctrl_w ) static WRITE8_HANDLER( pacland_irq_2_ctrl_w ) { int bit = !BIT(offset, 13); - cpu_interrupt_enable(devtag_get_device(space->machine, "mcu"), bit); + cpu_interrupt_enable(space->machine->device("mcu"), bit); if (!bit) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); } diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c index cf6207d907b..d0fb39917c6 100644 --- a/src/mame/drivers/pacman.c +++ b/src/mame/drivers/pacman.c @@ -397,7 +397,7 @@ static MACHINE_RESET( mschamp ) static WRITE8_HANDLER( pacman_interrupt_vector_w ) { - cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data); + cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data); cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } @@ -479,7 +479,7 @@ static WRITE8_HANDLER( piranha_interrupt_vector_w) { if (data == 0xfa) data = 0x78; if (data == 0xfc) data = 0xfc; - cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data ); + cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data ); } @@ -488,7 +488,7 @@ static WRITE8_HANDLER( nmouse_interrupt_vector_w) if (data == 0xbf) data = 0x3c; if (data == 0xc6) data = 0x40; if (data == 0xfc) data = 0xfc; - cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data ); + cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data ); } @@ -528,11 +528,11 @@ static WRITE8_HANDLER( alibaba_sound_w ) /* since the sound region in Ali Baba is not contiguous, translate the offset into the 0-0x1f range */ if (offset < 0x10) - pacman_sound_w(devtag_get_device(space->machine, "namco"), offset, data); + pacman_sound_w(space->machine->device("namco"), offset, data); else if (offset < 0x20) space->machine->generic.spriteram2.u8[offset - 0x10] = data; else - pacman_sound_w(devtag_get_device(space->machine, "namco"), offset - 0x10, data); + pacman_sound_w(space->machine->device("namco"), offset - 0x10, data); } diff --git a/src/mame/drivers/parodius.c b/src/mame/drivers/parodius.c index 7917afb23be..b84f4ff3b35 100644 --- a/src/mame/drivers/parodius.c +++ b/src/mame/drivers/parodius.c @@ -266,12 +266,12 @@ static MACHINE_START( parodius ) machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053260 = devtag_get_device(machine, "k053260"); - state->k053245 = devtag_get_device(machine, "k053245"); - state->k053251 = devtag_get_device(machine, "k053251"); - state->k052109 = devtag_get_device(machine, "k052109"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053260 = machine->device("k053260"); + state->k053245 = machine->device("k053245"); + state->k053251 = machine->device("k053251"); + state->k052109 = machine->device("k052109"); state_save_register_global(machine, state->videobank); state_save_register_global(machine, state->sprite_colorbase); @@ -285,7 +285,7 @@ static MACHINE_RESET( parodius ) parodius_state *state = (parodius_state *)machine->driver_data; int i; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), parodius_banking); + konami_configure_set_lines(machine->device("maincpu"), parodius_banking); for (i = 0; i < 3; i++) { diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c index bddfa930287..195589085aa 100644 --- a/src/mame/drivers/pbaction.c +++ b/src/mame/drivers/pbaction.c @@ -256,8 +256,8 @@ static MACHINE_START( pbaction ) { pbaction_state *state = (pbaction_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->scroll); } diff --git a/src/mame/drivers/pcat_dyn.c b/src/mame/drivers/pcat_dyn.c index 30bdc7c6c42..32601915224 100644 --- a/src/mame/drivers/pcat_dyn.c +++ b/src/mame/drivers/pcat_dyn.c @@ -483,12 +483,12 @@ static MACHINE_START( pcat_dyn ) // bank = -1; // lastvalue = -1; // hv_blank = 0; - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); - pcat_dyn_devices.pit8253 = devtag_get_device( machine, "pit8254" ); - pcat_dyn_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" ); - pcat_dyn_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" ); - pcat_dyn_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" ); - pcat_dyn_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" ); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); + pcat_dyn_devices.pit8253 = machine->device( "pit8254" ); + pcat_dyn_devices.pic8259_1 = machine->device( "pic8259_1" ); + pcat_dyn_devices.pic8259_2 = machine->device( "pic8259_2" ); + pcat_dyn_devices.dma8237_1 = machine->device( "dma8237_1" ); + pcat_dyn_devices.dma8237_2 = machine->device( "dma8237_2" ); init_pc_common(machine, PCCOMMON_KEYBOARD_AT, pcat_dyn_set_keyb_int); mc146818_init(machine, MC146818_STANDARD); diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c index f578d303b4d..a90a8a82992 100644 --- a/src/mame/drivers/pcat_nit.c +++ b/src/mame/drivers/pcat_nit.c @@ -213,7 +213,7 @@ static const struct pc_vga_interface vga_interface = static MACHINE_START( streetg2 ) { - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), pcat_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), pcat_irq_callback); init_pc_common(machine, PCCOMMON_KEYBOARD_AT, streetg2_set_keyb_int); mc146818_init(machine, MC146818_STANDARD); diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c index 471a441b346..96cad4c88a2 100644 --- a/src/mame/drivers/pcxt.c +++ b/src/mame/drivers/pcxt.c @@ -454,8 +454,8 @@ static READ8_DEVICE_HANDLER( port_c_r ) static WRITE8_DEVICE_HANDLER( port_b_w ) { port_b_data = data; -// running_device *beep = devtag_get_device(device->machine, "beep"); -// running_device *cvsd = devtag_get_device(device->machine, "cvsd"); +// running_device *beep = device->machine->device("beep"); +// running_device *cvsd = device->machine->device("cvsd"); // hc55516_digit_w(cvsd, data); // popmessage("%02x\n",data); // beep_set_state(beep, 0); @@ -909,12 +909,12 @@ static MACHINE_RESET( filetto ) bank = -1; lastvalue = -1; hv_blank = 0; - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); - filetto_devices.pit8253 = devtag_get_device( machine, "pit8253" ); - filetto_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" ); - filetto_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" ); - filetto_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" ); - filetto_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" ); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); + filetto_devices.pit8253 = machine->device( "pit8253" ); + filetto_devices.pic8259_1 = machine->device( "pic8259_1" ); + filetto_devices.pic8259_2 = machine->device( "pic8259_2" ); + filetto_devices.dma8237_1 = machine->device( "dma8237_1" ); + filetto_devices.dma8237_2 = machine->device( "dma8237_2" ); } static MACHINE_DRIVER_START( filetto ) diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c index 060feed66c5..b7e69455036 100644 --- a/src/mame/drivers/pgm.c +++ b/src/mame/drivers/pgm.c @@ -1346,7 +1346,7 @@ static MACHINE_START( pgm ) state->soundcpu = machine->device("soundcpu"); state->prot = machine->device("prot"); - state->ics = devtag_get_device(machine, "ics"); + state->ics = machine->device("ics"); state_save_register_global(machine, state->cal_val); state_save_register_global(machine, state->cal_mask); diff --git a/src/mame/drivers/photon.c b/src/mame/drivers/photon.c index 824af2004e6..c386b380ef3 100644 --- a/src/mame/drivers/photon.c +++ b/src/mame/drivers/photon.c @@ -92,7 +92,7 @@ static READ8_DEVICE_HANDLER(pk8000_80_portb_r) static WRITE8_DEVICE_HANDLER(pk8000_80_portc_w) { - speaker_level_w(devtag_get_device(device->machine, "speaker"), BIT(data,7)); + speaker_level_w(device->machine->device("speaker"), BIT(data,7)); } static I8255A_INTERFACE( pk8000_ppi8255_interface_1 ) @@ -180,7 +180,7 @@ static IRQ_CALLBACK(pk8000_irq_callback) static MACHINE_RESET(pk8000) { pk8000_set_bank(machine,0); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), pk8000_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), pk8000_irq_callback); } static VIDEO_START( photon ) diff --git a/src/mame/drivers/photon2.c b/src/mame/drivers/photon2.c index 1275ac891d8..caf5ad61af8 100644 --- a/src/mame/drivers/photon2.c +++ b/src/mame/drivers/photon2.c @@ -192,7 +192,7 @@ static READ8_HANDLER(photon2_fe_r) static WRITE8_HANDLER(photon2_fe_w) { - running_device *speaker = devtag_get_device(space->machine, "speaker"); + running_device *speaker = space->machine->device("speaker"); spectrum_port_fe = data; speaker_level_w(speaker, BIT(data,4)); diff --git a/src/mame/drivers/photoply.c b/src/mame/drivers/photoply.c index 912ef4f0d63..3fb4d9b6a42 100644 --- a/src/mame/drivers/photoply.c +++ b/src/mame/drivers/photoply.c @@ -467,12 +467,12 @@ static MACHINE_START( photoply ) // bank = -1; // lastvalue = -1; // hv_blank = 0; - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); - photoply_devices.pit8253 = devtag_get_device( machine, "pit8254" ); - photoply_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" ); - photoply_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" ); - photoply_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" ); - photoply_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" ); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); + photoply_devices.pit8253 = machine->device( "pit8254" ); + photoply_devices.pic8259_1 = machine->device( "pic8259_1" ); + photoply_devices.pic8259_2 = machine->device( "pic8259_2" ); + photoply_devices.dma8237_1 = machine->device( "dma8237_1" ); + photoply_devices.dma8237_2 = machine->device( "dma8237_2" ); init_pc_common(machine, PCCOMMON_KEYBOARD_AT, photoply_set_keyb_int); mc146818_init(machine, MC146818_STANDARD); diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c index 74e153b6cc4..60c4fa5d19d 100644 --- a/src/mame/drivers/pipedrm.c +++ b/src/mame/drivers/pipedrm.c @@ -591,7 +591,7 @@ static MACHINE_START( pipedrm ) { fromance_state *state = (fromance_state *)machine->driver_data; - state->subcpu = devtag_get_device(machine, "sub"); + state->subcpu = machine->device("sub"); /* initialize main Z80 bank */ memory_configure_bank(machine, "bank1", 0, 8, memory_region(machine, "maincpu") + 0x10000, 0x2000); diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c index 261d4e2f717..95f0e2daebb 100644 --- a/src/mame/drivers/pirates.c +++ b/src/mame/drivers/pirates.c @@ -149,7 +149,7 @@ static CUSTOM_INPUT( prot_r ) 602e and 62a6 */ /* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */ - pc = cpu_get_pc(devtag_get_device(field->port->machine, "main")); + pc = cpu_get_pc(field->port->machine->device("main")); if (pc == 0x6134) { bit = prot & 1; diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c index 6ff664815de..46cb6fceb63 100644 --- a/src/mame/drivers/pktgaldx.c +++ b/src/mame/drivers/pktgaldx.c @@ -314,8 +314,8 @@ static MACHINE_START( pktgaldx ) { pktgaldx_state *state = (pktgaldx_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->deco16ic = machine->device("deco_custom"); } static MACHINE_DRIVER_START( pktgaldx ) diff --git a/src/mame/drivers/playch10.c b/src/mame/drivers/playch10.c index e93b190d0ed..e7d708c8e32 100644 --- a/src/mame/drivers/playch10.c +++ b/src/mame/drivers/playch10.c @@ -333,7 +333,7 @@ static WRITE8_HANDLER( ram_8w_w ) static WRITE8_HANDLER( sprite_dma_w ) { int source = ( data & 7 ); - ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu"), source ); + ppu2c0x_spriteram_dma( space, space->machine->device("ppu"), source ); } static NVRAM_HANDLER( playch10 ) diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c index 01a07fe2c0f..c01cfa60e2a 100644 --- a/src/mame/drivers/playmark.c +++ b/src/mame/drivers/playmark.c @@ -909,8 +909,8 @@ static MACHINE_START( playmark ) { playmark_state *state = (playmark_state *)machine->driver_data; - state->oki = devtag_get_device(machine, "oki"); - state->eeprom = devtag_get_device(machine, "eeprom"); + state->oki = machine->device("oki"); + state->eeprom = machine->device("eeprom"); state_save_register_global(machine, state->bgscrollx); state_save_register_global(machine, state->bgscrolly); @@ -1518,7 +1518,7 @@ static DRIVER_INIT( bigtwin ) data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 3])); data |= (data_hi << 12) | (data_lo << 8); - pic16c5x_set_config(devtag_get_device(machine, "audiocpu"), data); + pic16c5x_set_config(machine->device("audiocpu"), data); src_pos = 0x7fff; /* Force Exit */ } diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c index 7b205d7ca24..1ddf99ada2a 100644 --- a/src/mame/drivers/plygonet.c +++ b/src/mame/drivers/plygonet.c @@ -211,7 +211,7 @@ static READ32_HANDLER( dsp_host_interface_r ) if (mem_mask == 0x0000ff00) { hi_addr++; } /* Low byte */ if (mem_mask == 0xff000000) {} /* High byte */ - value = dsp56k_host_interface_read(devtag_get_device(space->machine, "dsp"), hi_addr); + value = dsp56k_host_interface_read(space->machine->device("dsp"), hi_addr); if (mem_mask == 0x0000ff00) { value <<= 8; } if (mem_mask == 0xff000000) { value <<= 24; } @@ -295,7 +295,7 @@ static WRITE32_HANDLER( dsp_host_interface_w ) if (mem_mask == 0xff000000) { hi_data = (data & 0xff000000) >> 24; } logerror("write (host-side) %08x %08x %08x (HI %04x)\n", offset, mem_mask, data, hi_addr); - dsp56k_host_interface_write(devtag_get_device(space->machine, "dsp"), hi_addr, hi_data); + dsp56k_host_interface_write(space->machine->device("dsp"), hi_addr, hi_data); } diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c index 69ae171c554..80f588b1e92 100644 --- a/src/mame/drivers/polepos.c +++ b/src/mame/drivers/polepos.c @@ -304,7 +304,7 @@ static WRITE8_HANDLER( polepos_latch_w ) switch (offset) { case 0x00: /* IRQON */ - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); break; @@ -314,7 +314,7 @@ static WRITE8_HANDLER( polepos_latch_w ) break; case 0x02: /* CLSON */ - polepos_sound_enable(devtag_get_device(space->machine, "namco"),bit); + polepos_sound_enable(space->machine->device("namco"),bit); if (!bit) { polepos_engine_sound_lsb_w(space, 0, 0); @@ -468,8 +468,8 @@ static MACHINE_RESET( polepos ) polepos_latch_w(space, i, 0); /* set the interrupt vectors (this shouldn't be needed) */ - cpu_set_input_line_vector(devtag_get_device(machine, "sub"), 0, Z8000_NVI); - cpu_set_input_line_vector(devtag_get_device(machine, "sub2"), 0, Z8000_NVI); + cpu_set_input_line_vector(machine->device("sub"), 0, Z8000_NVI); + cpu_set_input_line_vector(machine->device("sub2"), 0, Z8000_NVI); } diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c index 8319b12c0eb..c63e8082b03 100644 --- a/src/mame/drivers/policetr.c +++ b/src/mame/drivers/policetr.c @@ -155,7 +155,7 @@ static WRITE32_HANDLER( control_w ) /* handle EEPROM I/O */ if (ACCESSING_BITS_16_23) { - running_device *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = space->machine->device("eeprom"); eeprom_write_bit(device, data & 0x00800000); eeprom_set_cs_line(device, (data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE); eeprom_set_clock_line(device, (data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE); @@ -164,7 +164,7 @@ static WRITE32_HANDLER( control_w ) /* toggling BSMT off then on causes a reset */ if (!(old & 0x80000000) && (control_data & 0x80000000)) { - running_device *device = devtag_get_device(space->machine, "bsmt"); + running_device *device = space->machine->device("bsmt"); bsmt2000_data_w(device, bsmt_data_bank, 0, 0xffff); device->reset(); } diff --git a/src/mame/drivers/popper.c b/src/mame/drivers/popper.c index e28661428dc..dc25ac84cd0 100644 --- a/src/mame/drivers/popper.c +++ b/src/mame/drivers/popper.c @@ -309,7 +309,7 @@ static MACHINE_START( popper ) { popper_state *state = (popper_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->flipscreen); state_save_register_global(machine, state->e002); diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c index 212bdccf8c5..f0fdbfa78e0 100644 --- a/src/mame/drivers/ppmast93.c +++ b/src/mame/drivers/ppmast93.c @@ -196,8 +196,8 @@ static WRITE8_HANDLER(ppmast_sound_w) switch(offset&0xff) { case 0: - case 1: ym2413_w(devtag_get_device(space->machine, "ymsnd"),offset,data); break; - case 2: dac_data_w(devtag_get_device(space->machine, "dac"),data);break; + case 1: ym2413_w(space->machine->device("ymsnd"),offset,data); break; + case 2: dac_data_w(space->machine->device("dac"),data);break; default: logerror("%x %x - %x\n",offset,data,cpu_get_previouspc(space->cpu)); } } diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c index 76a19dd6ac3..01acf4ccc0d 100644 --- a/src/mame/drivers/psikyo.c +++ b/src/mame/drivers/psikyo.c @@ -1028,7 +1028,7 @@ static MACHINE_START( psikyo ) { psikyo_state *state = (psikyo_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->soundlatch); state_save_register_global(machine, state->z80_nmi); diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c index ad98b85e78b..9ed2328c304 100644 --- a/src/mame/drivers/psikyo4.c +++ b/src/mame/drivers/psikyo4.c @@ -701,7 +701,7 @@ static MACHINE_START( psikyo4 ) { psikyo4_state *state = (psikyo4_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); #if ROMTEST // FIXME: Too many banks! it cannot be handled in this way, currently diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c index a16d0f72e31..4ca253744e8 100644 --- a/src/mame/drivers/psikyosh.c +++ b/src/mame/drivers/psikyosh.c @@ -802,7 +802,7 @@ static MACHINE_START( psikyosh ) { psikyosh_state *state = (psikyosh_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); memory_configure_bank(machine, "bank2", 0, 0x1000, memory_region(machine, "gfx1"), 0x20000); @@ -1196,58 +1196,58 @@ ROM_END static DRIVER_INIT( soldivid ) { - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( s1945ii ) { - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( daraku ) { UINT8 *RAM = memory_region(machine, "maincpu"); memory_set_bankptr(machine, "bank1", &RAM[0x100000]); - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( sbomberb ) { - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( gunbird2 ) { UINT8 *RAM = memory_region(machine, "maincpu"); memory_set_bankptr(machine, "bank1", &RAM[0x100000]); - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( s1945iii ) { UINT8 *RAM = memory_region(machine, "maincpu"); memory_set_bankptr(machine, "bank1", &RAM[0x100000]); - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( dragnblz ) { - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( gnbarich ) { - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( tgm2 ) { - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); } static DRIVER_INIT( mjgtaste ) { - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); /* needs to install mahjong controls too (can select joystick in test mode tho) */ memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x03000000, 0x03000003, 0, 0, mjgtaste_input_r); } diff --git a/src/mame/drivers/punchout.c b/src/mame/drivers/punchout.c index c54764c8abb..67e74429307 100644 --- a/src/mame/drivers/punchout.c +++ b/src/mame/drivers/punchout.c @@ -145,7 +145,7 @@ DRIVER_INIT( armwrest ); static CUSTOM_INPUT( punchout_vlm5030_busy_r ) { /* bit 4 of DSW1 is busy pin level */ - return (vlm5030_bsy(devtag_get_device(field->port->machine, "vlm"))) ? 0x00 : 0x01; + return (vlm5030_bsy(field->port->machine->device("vlm"))) ? 0x00 : 0x01; } static WRITE8_DEVICE_HANDLER( punchout_speech_reset_w ) diff --git a/src/mame/drivers/pushman.c b/src/mame/drivers/pushman.c index a024472c14d..71bea2d9213 100644 --- a/src/mame/drivers/pushman.c +++ b/src/mame/drivers/pushman.c @@ -422,9 +422,9 @@ static MACHINE_START( pushman ) { pushman_state *state = (pushman_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); state_save_register_global_array(machine, state->control); state_save_register_global_array(machine, state->shared_ram); diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c index 45e1683a0bf..97adb552036 100644 --- a/src/mame/drivers/qdrmfgp.c +++ b/src/mame/drivers/qdrmfgp.c @@ -87,7 +87,7 @@ static WRITE16_HANDLER( gp_control_w ) int vol = space->machine->generic.nvram.u16[0x10] & 0xff; if (vol) { - running_device *k054539 = devtag_get_device(space->machine, "konami"); + running_device *k054539 = space->machine->device("konami"); int i; double gain = vol / 90.0; @@ -117,7 +117,7 @@ static WRITE16_HANDLER( gp2_control_w ) int vol = space->machine->generic.nvram.u16[0x8] & 0xff; if (vol) { - running_device *k054539 = devtag_get_device(space->machine, "konami"); + running_device *k054539 = space->machine->device("konami"); int i; double gain = vol / 90.0; @@ -130,7 +130,7 @@ static WRITE16_HANDLER( gp2_control_w ) static READ16_HANDLER( v_rom_r ) { - running_device *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = space->machine->device("k056832"); UINT8 *mem8 = memory_region(space->machine, "gfx1"); int bank = k056832_word_r(k056832, 0x34/2, 0xffff); @@ -145,7 +145,7 @@ static READ16_HANDLER( v_rom_r ) static READ16_HANDLER( gp2_vram_r ) { - running_device *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = space->machine->device("k056832"); if (offset < 0x1000 / 2) return k056832_ram_word_r(k056832, offset * 2 + 1, mem_mask); @@ -155,7 +155,7 @@ static READ16_HANDLER( gp2_vram_r ) static READ16_HANDLER( gp2_vram_mirror_r ) { - running_device *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = space->machine->device("k056832"); if (offset < 0x1000 / 2) return k056832_ram_word_r(k056832, offset * 2, mem_mask); @@ -165,7 +165,7 @@ static READ16_HANDLER( gp2_vram_mirror_r ) static WRITE16_HANDLER( gp2_vram_w ) { - running_device *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = space->machine->device("k056832"); if (offset < 0x1000 / 2) k056832_ram_word_w(k056832, offset * 2 + 1, data, mem_mask); @@ -175,7 +175,7 @@ static WRITE16_HANDLER( gp2_vram_w ) static WRITE16_HANDLER( gp2_vram_mirror_w ) { - running_device *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = space->machine->device("k056832"); if (offset < 0x1000 / 2) k056832_ram_word_w(k056832, offset * 2, data, mem_mask); @@ -242,7 +242,7 @@ static WRITE16_DEVICE_HANDLER( ide_alt_w ) static READ16_HANDLER( gp2_ide_std_r ) { - running_device *device = devtag_get_device(space->machine, "ide"); + running_device *device = space->machine->device("ide"); if (offset & 0x01) { if (offset == 0x07) diff --git a/src/mame/drivers/quakeat.c b/src/mame/drivers/quakeat.c index 454f9424d8d..8c973970f02 100644 --- a/src/mame/drivers/quakeat.c +++ b/src/mame/drivers/quakeat.c @@ -140,10 +140,10 @@ static IRQ_CALLBACK(irq_callback) static MACHINE_START(quakeat) { - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); - quakeat_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" ); - quakeat_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" ); + quakeat_devices.pic8259_1 = machine->device( "pic8259_1" ); + quakeat_devices.pic8259_2 = machine->device( "pic8259_2" ); } /*************************************************************/ diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c index 9f5fafccb59..c1bc32e5041 100644 --- a/src/mame/drivers/r2dtank.c +++ b/src/mame/drivers/r2dtank.c @@ -73,8 +73,8 @@ static WRITE_LINE_DEVICE_HANDLER( flipscreen_w ); static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq ) { - running_device *pia0 = devtag_get_device(device->machine, "pia_main"); - running_device *pia1 = devtag_get_device(device->machine, "pia_audio"); + running_device *pia0 = device->machine->device("pia_main"); + running_device *pia1 = device->machine->device("pia_audio"); int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1); @@ -150,10 +150,10 @@ static READ8_DEVICE_HANDLER( AY8910_port_r ) UINT8 ret = 0; if (AY8910_selected & 0x08) - ret = ay8910_r(devtag_get_device(device->machine, "ay1"), 0); + ret = ay8910_r(device->machine->device("ay1"), 0); if (AY8910_selected & 0x10) - ret = ay8910_r(devtag_get_device(device->machine, "ay2"), 0); + ret = ay8910_r(device->machine->device("ay2"), 0); return ret; } @@ -162,10 +162,10 @@ static READ8_DEVICE_HANDLER( AY8910_port_r ) static WRITE8_DEVICE_HANDLER( AY8910_port_w ) { if (AY8910_selected & 0x08) - ay8910_data_address_w(devtag_get_device(device->machine, "ay1"), AY8910_selected >> 2, data); + ay8910_data_address_w(device->machine->device("ay1"), AY8910_selected >> 2, data); if (AY8910_selected & 0x10) - ay8910_data_address_w(devtag_get_device(device->machine, "ay2"), AY8910_selected >> 2, data); + ay8910_data_address_w(device->machine->device("ay2"), AY8910_selected >> 2, data); } @@ -206,7 +206,7 @@ static const ay8910_interface ay8910_2_interface = static WRITE8_DEVICE_HANDLER( ttl74123_output_changed ) { - running_device *pia = devtag_get_device(device->machine, "pia_main"); + running_device *pia = device->machine->device("pia_main"); pia6821_ca1_w(pia, 0, data); ttl74123_output = data; } @@ -362,7 +362,7 @@ static MC6845_UPDATE_ROW( update_row ) static WRITE_LINE_DEVICE_HANDLER( display_enable_changed ) { - ttl74123_a_w(devtag_get_device(device->machine, "74123"), 0, state); + ttl74123_a_w(device->machine->device("74123"), 0, state); } @@ -383,7 +383,7 @@ static const mc6845_interface mc6845_intf = static VIDEO_UPDATE( r2dtank ) { - running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = screen->machine->device("crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c index 1f4791ef207..cc19f377e2a 100644 --- a/src/mame/drivers/rainbow.c +++ b/src/mame/drivers/rainbow.c @@ -668,10 +668,10 @@ static MACHINE_START( rainbow ) { rainbow_state *state = (rainbow_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->pc080sn = devtag_get_device(machine, "pc080sn"); - state->pc090oj = devtag_get_device(machine, "pc090oj"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->pc080sn = machine->device("pc080sn"); + state->pc090oj = machine->device("pc090oj"); } static MACHINE_DRIVER_START( rainbow ) diff --git a/src/mame/drivers/rallyx.c b/src/mame/drivers/rallyx.c index 8d705c9c1c0..630265c9c70 100644 --- a/src/mame/drivers/rallyx.c +++ b/src/mame/drivers/rallyx.c @@ -241,7 +241,7 @@ static WRITE8_HANDLER( rallyx_latch_w ) case 0x02: /* SOUND ON */ /* this doesn't work in New Rally X so I'm not supporting it */ -// pacman_sound_enable_w(devtag_get_device(space->machine, "namco"), bit); +// pacman_sound_enable_w(space->machine->device("namco"), bit); break; case 0x03: /* FLIP */ @@ -877,7 +877,7 @@ static MACHINE_START( rallyx ) timeplt_state *state = (timeplt_state *)machine->driver_data; state->maincpu = machine->device("maincpu"); - state->samples = devtag_get_device(machine, "samples"); + state->samples = machine->device("samples"); state_save_register_global(machine, state->last_bang); state_save_register_global(machine, state->stars_enable); diff --git a/src/mame/drivers/rampart.c b/src/mame/drivers/rampart.c index 0ab022b7946..28cd33c7805 100644 --- a/src/mame/drivers/rampart.c +++ b/src/mame/drivers/rampart.c @@ -49,7 +49,7 @@ static void scanline_update(screen_device &screen, int scanline) { /* generate 32V signals */ if ((scanline & 32) == 0) - atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu")); + atarigen_scanline_int_gen(screen.machine->device("maincpu")); } @@ -500,7 +500,7 @@ static DRIVER_INIT( rampart ) state->atarigen.eeprom_default = compressed_default_eeprom; memcpy(&rom[0x140000], &rom[0x40000], 0x8000); - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x140000, 0x438000, 118); + atarigen_slapstic_init(machine->device("maincpu"), 0x140000, 0x438000, 118); } diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c index 9dbf250d29c..79bfa836d58 100644 --- a/src/mame/drivers/rastan.c +++ b/src/mame/drivers/rastan.c @@ -370,10 +370,10 @@ static MACHINE_START( rastan ) memory_configure_bank(machine, "bank1", 0, 1, &ROM[0x00000], 0x4000); memory_configure_bank(machine, "bank1", 1, 3, &ROM[0x10000], 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->pc080sn = devtag_get_device(machine, "pc080sn"); - state->pc090oj = devtag_get_device(machine, "pc090oj"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->pc080sn = machine->device("pc080sn"); + state->pc090oj = machine->device("pc090oj"); state_save_register_global(machine, state->sprite_ctrl); state_save_register_global(machine, state->sprites_flipscreen); diff --git a/src/mame/drivers/rbmk.c b/src/mame/drivers/rbmk.c index 7ddfeea0928..0e333032d43 100644 --- a/src/mame/drivers/rbmk.c +++ b/src/mame/drivers/rbmk.c @@ -122,7 +122,7 @@ static READ8_HANDLER( rbmk_mcu_io_r ) { if(mux_data & 8) { - return ym2151_r(devtag_get_device(space->machine, "ymsnd"), offset & 1); + return ym2151_r(space->machine->device("ymsnd"), offset & 1); } else if(mux_data & 4) { @@ -138,7 +138,7 @@ static READ8_HANDLER( rbmk_mcu_io_r ) static WRITE8_HANDLER( rbmk_mcu_io_w ) { - if(mux_data & 8) { ym2151_w(devtag_get_device(space->machine, "ymsnd"), offset & 1, data); } + if(mux_data & 8) { ym2151_w(space->machine->device("ymsnd"), offset & 1, data); } else if(mux_data & 4) { //printf("%02x %02x W\n",offset,data); diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c index bb7decccbd8..3e56ffb611e 100644 --- a/src/mame/drivers/redclash.c +++ b/src/mame/drivers/redclash.c @@ -330,7 +330,7 @@ static MACHINE_START( redclash ) { ladybug_state *state = (ladybug_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->star_speed); state_save_register_global(machine, state->gfxbank); diff --git a/src/mame/drivers/retofinv.c b/src/mame/drivers/retofinv.c index f4ec0a60662..3059c1a3dbc 100644 --- a/src/mame/drivers/retofinv.c +++ b/src/mame/drivers/retofinv.c @@ -51,7 +51,7 @@ static WRITE8_HANDLER( cpu2_reset_w ) static WRITE8_HANDLER( mcu_reset_w ) { /* the bootlegs don't have a MCU, so make sure it's there before trying to reset it */ - if (devtag_get_device(space->machine, "68705") != NULL) + if (space->machine->device("68705") != NULL) cputag_set_input_line(space->machine, "68705", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); } @@ -75,7 +75,7 @@ static WRITE8_HANDLER( irq0_ack_w ) { int bit = data & 1; - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } @@ -84,7 +84,7 @@ static WRITE8_HANDLER( irq1_ack_w ) { int bit = data & 1; - cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit); + cpu_interrupt_enable(space->machine->device("sub"), bit); if (!bit) cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); } diff --git a/src/mame/drivers/rockrage.c b/src/mame/drivers/rockrage.c index 520554b292e..211e3513517 100644 --- a/src/mame/drivers/rockrage.c +++ b/src/mame/drivers/rockrage.c @@ -278,9 +278,9 @@ static MACHINE_START( rockrage ) memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007342 = devtag_get_device(machine, "k007342"); - state->k007420 = devtag_get_device(machine, "k007420"); + state->audiocpu = machine->device("audiocpu"); + state->k007342 = machine->device("k007342"); + state->k007420 = machine->device("k007420"); state_save_register_global(machine, state->vreg); state_save_register_global_array(machine, state->layer_colorbase); diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c index 1389a9f9310..23ef91843e9 100644 --- a/src/mame/drivers/rollerg.c +++ b/src/mame/drivers/rollerg.c @@ -243,11 +243,11 @@ static MACHINE_START( rollerg ) memory_configure_bank(machine, "bank1", 6, 2, &ROM[0x10000], 0x4000); memory_set_bank(machine, "bank1", 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053244 = devtag_get_device(machine, "k053244"); - state->k051316 = devtag_get_device(machine, "k051316"); - state->k053260 = devtag_get_device(machine, "k053260"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053244 = machine->device("k053244"); + state->k051316 = machine->device("k051316"); + state->k053260 = machine->device("k053260"); state_save_register_global(machine, state->readzoomroms); } @@ -256,7 +256,7 @@ static MACHINE_RESET( rollerg ) { rollerg_state *state = (rollerg_state *)machine->driver_data; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), rollerg_banking); + konami_configure_set_lines(machine->device("maincpu"), rollerg_banking); state->readzoomroms = 0; } diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c index 55add6ce9d1..b9ec1ae133f 100644 --- a/src/mame/drivers/royalmah.c +++ b/src/mame/drivers/royalmah.c @@ -798,7 +798,7 @@ static READ8_HANDLER( mjifb_rom_io_r ) { case 0x8000: return input_port_read(space->machine, "DSW4"); // dsw 4 case 0x8200: return input_port_read(space->machine, "DSW3"); // dsw 3 - case 0x9001: return ay8910_r(devtag_get_device(space->machine,"aysnd"), 0); // inputs + case 0x9001: return ay8910_r(space->machine->device("aysnd"), 0); // inputs case 0x9011: return input_port_read(space->machine, "SYSTEM"); } @@ -819,8 +819,8 @@ static WRITE8_HANDLER( mjifb_rom_io_w ) switch(offset) { case 0x8e00: palette_base = data & 0x1f; return; - case 0x9002: ay8910_data_w(devtag_get_device(space->machine,"aysnd"),0,data); return; - case 0x9003: ay8910_address_w(devtag_get_device(space->machine,"aysnd"),0,data); return; + case 0x9002: ay8910_data_w(space->machine->device("aysnd"),0,data); return; + case 0x9003: ay8910_address_w(space->machine->device("aysnd"),0,data); return; case 0x9010: mjifb_coin_counter_w(space,0,data); return; @@ -905,7 +905,7 @@ static READ8_HANDLER( mjdejavu_rom_io_r ) { case 0x8000: return input_port_read(space->machine, "DSW2"); // dsw 2 case 0x8001: return input_port_read(space->machine, "DSW1"); // dsw 1 - case 0x9001: return ay8910_r(devtag_get_device(space->machine,"aysnd"), 0); // inputs + case 0x9001: return ay8910_r(space->machine->device("aysnd"), 0); // inputs case 0x9011: return input_port_read(space->machine, "SYSTEM"); } @@ -925,8 +925,8 @@ static WRITE8_HANDLER( mjdejavu_rom_io_w ) switch(offset) { case 0x8802: palette_base = data & 0x1f; return; - case 0x9002: ay8910_data_w(devtag_get_device(space->machine,"aysnd"),0,data); return; - case 0x9003: ay8910_address_w(devtag_get_device(space->machine,"aysnd"),0,data); return; + case 0x9002: ay8910_data_w(space->machine->device("aysnd"),0,data); return; + case 0x9003: ay8910_address_w(space->machine->device("aysnd"),0,data); return; case 0x9010: mjifb_coin_counter_w(space,0,data); return; case 0x9011: input_port_select_w(space,0,data); return; case 0x9013: @@ -1105,7 +1105,7 @@ static READ8_HANDLER( mjvegasa_rom_io_r ) case 0x800e: case 0x800f: { - running_device *rtc = devtag_get_device(space->machine, "rtc"); + running_device *rtc = space->machine->device("rtc"); return msm6242_r(rtc, offset-0x8000); } } @@ -1142,7 +1142,7 @@ static WRITE8_HANDLER( mjvegasa_rom_io_w ) case 0x800e: case 0x800f: { - running_device *rtc = devtag_get_device(space->machine, "rtc"); + running_device *rtc = space->machine->device("rtc"); msm6242_w(rtc, offset-0x8000, data); return; } diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c index 2713137b432..2131a8b7906 100644 --- a/src/mame/drivers/rungun.c +++ b/src/mame/drivers/rungun.c @@ -366,13 +366,13 @@ static MACHINE_START( rng ) memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x10000], 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "soundcpu"); - state->k053936 = devtag_get_device(machine, "k053936"); - state->k055673 = devtag_get_device(machine, "k055673"); - state->k053252 = devtag_get_device(machine, "k053252"); - state->k054539_1 = devtag_get_device(machine, "k054539_1"); - state->k054539_2 = devtag_get_device(machine, "k054539_2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("soundcpu"); + state->k053936 = machine->device("k053936"); + state->k055673 = machine->device("k055673"); + state->k053252 = machine->device("k053252"); + state->k054539_1 = machine->device("k054539_1"); + state->k054539_2 = machine->device("k054539_2"); state_save_register_global(machine, state->z80_control); state_save_register_global(machine, state->sound_status); @@ -384,7 +384,7 @@ static MACHINE_RESET( rng ) { rungun_state *state = (rungun_state *)machine->driver_data; - k054539_init_flags(devtag_get_device(machine, "k054539_1"), K054539_REVERSE_STEREO); + k054539_init_flags(machine->device("k054539_1"), K054539_REVERSE_STEREO); memset(state->sysreg, 0, 0x20); memset(state->ttl_vram, 0, 0x1000); diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c index 3075ccd8fcd..9ab93cb431a 100644 --- a/src/mame/drivers/safarir.c +++ b/src/mame/drivers/safarir.c @@ -318,7 +318,7 @@ static MACHINE_START( safarir ) state->ram_2 = auto_alloc_array(machine, UINT8, state->ram_size); state->port_last = 0; state->port_last2 = 0; - state->samples = devtag_get_device(machine, "samples"); + state->samples = machine->device("samples"); /* setup for save states */ state_save_register_global_pointer(machine, state->ram_1, state->ram_size); diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c index 1014896e115..8a6b335dac2 100644 --- a/src/mame/drivers/sandscrp.c +++ b/src/mame/drivers/sandscrp.c @@ -121,7 +121,7 @@ static INTERRUPT_GEN( sandscrp_interrupt ) static VIDEO_EOF( sandscrp ) { - running_device *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = machine->device("pandora"); sprite_irq = 1; update_irq_state(machine); pandora_eof(pandora); diff --git a/src/mame/drivers/sbasketb.c b/src/mame/drivers/sbasketb.c index a9ceab39b82..12503501629 100644 --- a/src/mame/drivers/sbasketb.c +++ b/src/mame/drivers/sbasketb.c @@ -177,7 +177,7 @@ static MACHINE_START( sbasketb ) trackfld_state *state = (trackfld_state *)machine->driver_data; state->audiocpu = machine->device("audiocpu"); - state->vlm = devtag_get_device(machine, "vlm"); + state->vlm = machine->device("vlm"); /* sound */ state_save_register_global(machine, state->SN76496_latch); diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c index 589b44f465d..ab09d5bf78a 100644 --- a/src/mame/drivers/sbrkout.c +++ b/src/mame/drivers/sbrkout.c @@ -120,7 +120,7 @@ static TIMER_CALLBACK( scanline_callback ) cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); /* update the DAC state */ - dac_data_w(devtag_get_device(machine, "dac"), (machine->generic.videoram.u8[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0); + dac_data_w(machine->device("dac"), (machine->generic.videoram.u8[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0); /* on the VBLANK, read the pot and schedule an interrupt time for it */ if (scanline == machine->primary_screen->visible_area().max_y + 1) diff --git a/src/mame/drivers/scregg.c b/src/mame/drivers/scregg.c index 51fe4aaff5a..0fd6bc5f34b 100644 --- a/src/mame/drivers/scregg.c +++ b/src/mame/drivers/scregg.c @@ -204,7 +204,7 @@ static MACHINE_START( scregg ) { btime_state *state = (btime_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state->audiocpu = NULL; state_save_register_global(machine, state->btime_palette); diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c index f2770253ad0..4fd116cf36f 100644 --- a/src/mame/drivers/seattle.c +++ b/src/mame/drivers/seattle.c @@ -500,7 +500,7 @@ static MACHINE_START( seattle ) { int index; - voodoo = devtag_get_device(machine, "voodoo"); + voodoo = machine->device("voodoo"); /* allocate timers for the galileo */ galileo.timer[0].timer = timer_alloc(machine, galileo_timer_callback, NULL); @@ -509,11 +509,11 @@ static MACHINE_START( seattle ) galileo.timer[3].timer = timer_alloc(machine, galileo_timer_callback, NULL); /* set the fastest DRC options, but strict verification */ - mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); /* configure fast RAM regions for DRC */ - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x007fffff, FALSE, rambase); - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); + mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, rambase); + mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); /* register for save states */ state_save_register_global_array(machine, galileo.reg); @@ -556,12 +556,12 @@ static MACHINE_RESET( seattle ) cpu_stalled_on_voodoo = FALSE; /* reset either the DCS2 board or the CAGE board */ - if (devtag_get_device(machine, "dcs2") != NULL) + if (machine->device("dcs2") != NULL) { dcs_reset_w(1); dcs_reset_w(0); } - else if (devtag_get_device(machine, "cage") != NULL) + else if (machine->device("cage") != NULL) { cage_control_w(machine, 0); cage_control_w(machine, 3); @@ -1333,8 +1333,8 @@ static void voodoo_stall(running_device *device, int stall) } else { - if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(devtag_get_device(device->machine, "maincpu"))); - cpu_spinuntil_trigger(devtag_get_device(device->machine, "maincpu"), 45678); + if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(device->machine->device("maincpu"))); + cpu_spinuntil_trigger(device->machine->device("maincpu"), 45678); } } @@ -1720,7 +1720,7 @@ static READ32_DEVICE_HANDLER( seattle_ide_r ) { /* note that blitz times out if we don't have this cycle stealing */ if (offset == 0x3f6/4) - cpu_eat_cycles(devtag_get_device(device->machine, "maincpu"), 100); + cpu_eat_cycles(device->machine->device("maincpu"), 100); return ide_controller32_r(device, offset, mem_mask); } @@ -2795,7 +2795,7 @@ static void init_common(running_machine *machine, int ioasic, int serialnum, int case SEATTLE_WIDGET_CONFIG: /* set up the widget board */ - device = devtag_get_device(machine, "ethernet"); + device = machine->device("ethernet"); memory_install_readwrite32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), device, 0x16c00000, 0x16c0001f, 0, 0, widget_r, widget_w); break; @@ -2804,7 +2804,7 @@ static void init_common(running_machine *machine, int ioasic, int serialnum, int memory_install_readwrite32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x14000000, 0x14000003, 0, 0, analog_port_r, analog_port_w); /* set up the ethernet controller */ - device = devtag_get_device(machine, "ethernet"); + device = machine->device("ethernet"); memory_install_readwrite32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), device, 0x16c00000, 0x16c0003f, 0, 0, ethernet_r, ethernet_w); break; } @@ -2817,9 +2817,9 @@ static DRIVER_INIT( wg3dh ) init_common(machine, MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8004413C, 0x0C0054B4, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80094930, 0x00A2102B, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80092984, 0x3C028011, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8004413C, 0x0C0054B4, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80094930, 0x00A2102B, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80092984, 0x3C028011, 250); /* confirmed */ } @@ -2829,7 +2829,7 @@ static DRIVER_INIT( mace ) init_common(machine, MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800108F8, 0x8C420000, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800108F8, 0x8C420000, 250); /* confirmed */ } @@ -2839,9 +2839,9 @@ static DRIVER_INIT( sfrush ) init_common(machine, MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80059F34, 0x3C028012, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800A5AF4, 0x8E300010, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8004C260, 0x3C028012, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80059F34, 0x3C028012, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800A5AF4, 0x8E300010, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8004C260, 0x3C028012, 250); /* confirmed */ } @@ -2851,10 +2851,10 @@ static DRIVER_INIT( sfrushrk ) init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800343E8, 0x3C028012, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8008F4F0, 0x3C028012, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800A365C, 0x8E300014, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80051DAC, 0x3C028012, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800343E8, 0x3C028012, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8008F4F0, 0x3C028012, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800A365C, 0x8E300014, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80051DAC, 0x3C028012, 250); /* confirmed */ } @@ -2865,8 +2865,8 @@ static DRIVER_INIT( calspeed ) midway_ioasic_set_auto_ack(1); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80032534, 0x02221024, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800B1BE4, 0x8E110014, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80032534, 0x02221024, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800B1BE4, 0x8E110014, 250); /* confirmed */ } @@ -2876,9 +2876,9 @@ static DRIVER_INIT( vaportrx ) init_common(machine, MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80049F14, 0x3C028020, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8004859C, 0x3C028020, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8005922C, 0x8E020014, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80049F14, 0x3C028020, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8004859C, 0x3C028020, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8005922C, 0x8E020014, 250); /* confirmed */ } @@ -2900,8 +2900,8 @@ static DRIVER_INIT( blitz ) rombase[0x934/4] += 4; /* main CPU speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80135510, 0x3C028024, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800087DC, 0x8E820010, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80135510, 0x3C028024, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800087DC, 0x8E820010, 250); /* confirmed */ } @@ -2911,8 +2911,8 @@ static DRIVER_INIT( blitz99 ) init_common(machine, MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8014E41C, 0x3C038025, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80011F10, 0x8E020018, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8014E41C, 0x3C038025, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80011F10, 0x8E020018, 250); /* confirmed */ } @@ -2922,8 +2922,8 @@ static DRIVER_INIT( blitz2k ) init_common(machine, MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8015773C, 0x3C038025, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80012CA8, 0x8E020018, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8015773C, 0x3C038025, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80012CA8, 0x8E020018, 250); /* confirmed */ } @@ -2936,8 +2936,8 @@ static DRIVER_INIT( carnevil ) memory_install_readwrite32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x16800000, 0x1680001f, 0, 0, carnevil_gun_r, carnevil_gun_w); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8015176C, 0x3C03801A, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80011FBC, 0x8E020018, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8015176C, 0x3C03801A, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80011FBC, 0x8E020018, 250); /* confirmed */ } @@ -2947,9 +2947,9 @@ static DRIVER_INIT( hyprdriv ) init_common(machine, MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x801643BC, 0x3C03801B, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80011FB8, 0x8E020018, 250); /* confirmed */ - //mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80136A80, 0x3C02801D, 250); /* potential */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x801643BC, 0x3C03801B, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80011FB8, 0x8E020018, 250); /* confirmed */ + //mips3drc_add_hotspot(machine->device("maincpu"), 0x80136A80, 0x3C02801D, 250); /* potential */ } diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c index dcde26cd8b3..ceae0be3800 100644 --- a/src/mame/drivers/segac2.c +++ b/src/mame/drivers/segac2.c @@ -341,7 +341,7 @@ static READ16_HANDLER( io_chip_r ) /* otherwise, return an input port */ if (offset == 0x04/2 && sound_banks) - return (input_port_read(space->machine, portnames[offset]) & 0xbf) | (upd7759_busy_r(devtag_get_device(space->machine, "upd")) << 6); + return (input_port_read(space->machine, portnames[offset]) & 0xbf) | (upd7759_busy_r(space->machine->device("upd")) << 6); return input_port_read(space->machine, portnames[offset]); /* 'SEGA' protection */ @@ -428,7 +428,7 @@ static WRITE16_HANDLER( io_chip_w ) } if (sound_banks > 1) { - running_device *upd = devtag_get_device(space->machine, "upd"); + running_device *upd = space->machine->device("upd"); newbank = (data >> 2) & (sound_banks - 1); upd7759_set_bank_base(upd, newbank * 0x20000); } @@ -438,7 +438,7 @@ static WRITE16_HANDLER( io_chip_w ) case 0x1c/2: if (sound_banks > 1) { - running_device *upd = devtag_get_device(space->machine, "upd"); + running_device *upd = space->machine->device("upd"); upd7759_reset_w(upd, (data >> 1) & 1); } break; @@ -1821,7 +1821,7 @@ it should be, otherwise I don't see how the formula could be computed. static void segac2_common_init(running_machine* machine, int (*func)(int in)) { - running_device *upd = devtag_get_device(machine, "upd"); + running_device *upd = machine->device("upd"); DRIVER_INIT_CALL( megadriv_c2 ); diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c index d846b0e6270..09cbe244d62 100644 --- a/src/mame/drivers/segae.c +++ b/src/mame/drivers/segae.c @@ -364,8 +364,8 @@ static void init_ports_systeme(running_machine *machine) /* INIT THE PORTS *********************************************************************************************/ const address_space *io = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); - running_device *sn1 = devtag_get_device(machine, "sn1"); - running_device *sn2 = devtag_get_device(machine, "sn2"); + running_device *sn1 = machine->device("sn1"); + running_device *sn2 = machine->device("sn2"); memory_install_write8_device_handler(io, sn2, 0x7b, 0x7b, 0, 0, sn76496_w); memory_install_write8_device_handler(io, sn1, 0x7e, 0x7f, 0, 0, sn76496_w); diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c index 75a1b85b422..69c4f64f552 100644 --- a/src/mame/drivers/segag80v.c +++ b/src/mame/drivers/segag80v.c @@ -1367,7 +1367,7 @@ static DRIVER_INIT( spacfury ) static DRIVER_INIT( zektor ) { const address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); - running_device *ay = devtag_get_device(machine, "aysnd"); + running_device *ay = machine->device("aysnd"); /* configure security */ sega_security(82); diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c index d86fc1bae15..0ad870f84b2 100644 --- a/src/mame/drivers/segahang.c +++ b/src/mame/drivers/segahang.c @@ -97,12 +97,12 @@ static void hangon_generic_init( running_machine *machine ) /* reset the custom handlers and other pointers */ state->i8751_vblank_hook = NULL; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->mcu = devtag_get_device(machine, "mcu"); - state->ppi8255_1 = devtag_get_device(machine, "ppi8255_1"); - state->ppi8255_2 = devtag_get_device(machine, "ppi8255_2"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->subcpu = machine->device("sub"); + state->mcu = machine->device("mcu"); + state->ppi8255_1 = machine->device("ppi8255_1"); + state->ppi8255_2 = machine->device("ppi8255_2"); state_save_register_global(machine, state->adc_select); } @@ -126,7 +126,7 @@ static MACHINE_RESET( hangon ) { segas1x_state *state = (segas1x_state *)machine->driver_data; - fd1094_machine_init(devtag_get_device(machine, "sub")); + fd1094_machine_init(machine->device("sub")); /* reset misc components */ segaic16_tilemap_reset(machine, 0); diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c index f170910a15d..2c728c1438f 100644 --- a/src/mame/drivers/segald.c +++ b/src/mame/drivers/segald.c @@ -329,7 +329,7 @@ GFXDECODE_END static MACHINE_START( astron ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); } diff --git a/src/mame/drivers/segamsys.c b/src/mame/drivers/segamsys.c index e2a05d11b8e..091b16ceb3d 100644 --- a/src/mame/drivers/segamsys.c +++ b/src/mame/drivers/segamsys.c @@ -1644,7 +1644,7 @@ static void megatech_set_genz80_as_sms_standard_ports(running_machine *machine, /* INIT THE PORTS *********************************************************************************************/ const address_space *io = cputag_get_address_space(machine, tag, ADDRESS_SPACE_IO); - running_device *sn = devtag_get_device(machine, "snsnd"); + running_device *sn = machine->device("snsnd"); memory_install_readwrite8_handler(io, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w); diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c index 13ddc688559..2f2fadbbb4b 100644 --- a/src/mame/drivers/segaorun.c +++ b/src/mame/drivers/segaorun.c @@ -400,7 +400,7 @@ static void outrun_generic_init(running_machine *machine) workram = auto_alloc_array(machine, UINT16, 0x08000/2); /* init the memory mapper */ - segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), outrun_info, sound_data_w, NULL); + segaic16_memory_mapper_init(machine->device("maincpu"), outrun_info, sound_data_w, NULL); /* init the FD1094 */ fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted); @@ -410,10 +410,10 @@ static void outrun_generic_init(running_machine *machine) state->custom_io_w = NULL; state->custom_map = NULL; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->ppi8255 = devtag_get_device(machine, "ppi8255"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->subcpu = machine->device("sub"); + state->ppi8255 = machine->device("ppi8255"); state_save_register_global(machine, state->adc_select); state_save_register_global(machine, state->vblank_irq_state); @@ -521,7 +521,7 @@ static void outrun_reset(running_device *device) static MACHINE_RESET( outrun ) { segas1x_state *state = (segas1x_state *)machine->driver_data; - fd1094_machine_init(devtag_get_device(machine, "maincpu")); + fd1094_machine_init(machine->device("maincpu")); /* reset misc components */ segaic16_memory_mapper_reset(machine); @@ -530,7 +530,7 @@ static MACHINE_RESET( outrun ) segaic16_tilemap_reset(machine, 0); /* hook the RESET line, which resets CPU #1 */ - m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), outrun_reset); + m68k_set_reset_callback(machine->device("maincpu"), outrun_reset); /* start timers to track interrupts */ timer_set(machine, machine->primary_screen->time_until_pos(223), NULL, 223, scanline_callback); diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c index 26a56c6c416..677fbbc1526 100644 --- a/src/mame/drivers/segas16a.c +++ b/src/mame/drivers/segas16a.c @@ -218,12 +218,12 @@ static void system16a_generic_init(running_machine *machine) state->lamp_changed_w = NULL; state->i8751_vblank_hook = NULL; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->mcu = devtag_get_device(machine, "mcu"); - state->ymsnd = devtag_get_device(machine, "ymsnd"); - state->ppi8255 = devtag_get_device(machine, "ppi8255"); - state->n7751 = devtag_get_device(machine, "n7751"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->mcu = machine->device("mcu"); + state->ymsnd = machine->device("ymsnd"); + state->ppi8255 = machine->device("ppi8255"); + state->n7751 = machine->device("n7751"); } @@ -260,7 +260,7 @@ static MACHINE_RESET( system16a ) { segas1x_state *state = (segas1x_state *)machine->driver_data; - fd1094_machine_init(devtag_get_device(machine, "maincpu")); + fd1094_machine_init(machine->device("maincpu")); /* if we have a fake i8751 handler, disable the actual 8751 */ if (state->i8751_vblank_hook != NULL) diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c index 04ce5d5429b..a23d27d3754 100644 --- a/src/mame/drivers/segas16b.c +++ b/src/mame/drivers/segas16b.c @@ -1047,7 +1047,7 @@ static void system16b_generic_init(running_machine *machine, int _rom_board) workram = auto_alloc_array(machine, UINT16, 0x04000 / 2); /* init the memory mapper */ - segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[state->rom_board], sound_w, NULL); + segaic16_memory_mapper_init(machine->device("maincpu"), region_info_list[state->rom_board], sound_w, NULL); /* init the FD1094 */ fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted); @@ -1059,13 +1059,13 @@ static void system16b_generic_init(running_machine *machine, int _rom_board) state->i8751_initial_config = NULL; state->disable_screen_blanking = 0; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->mcu = devtag_get_device(machine, "mcu"); - state->ymsnd = devtag_get_device(machine, "ymsnd"); - state->_315_5248_1 = devtag_get_device(machine, "315_5248"); - state->_315_5250_1 = devtag_get_device(machine, "315_5250_1"); - state->_315_5250_2 = devtag_get_device(machine, "315_5250_2"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->mcu = machine->device("mcu"); + state->ymsnd = machine->device("ymsnd"); + state->_315_5248_1 = machine->device("315_5248"); + state->_315_5250_1 = machine->device("315_5250_1"); + state->_315_5250_2 = machine->device("315_5250_2"); state_save_register_global(machine, state->disable_screen_blanking); state_save_register_global(machine, state->mj_input_num); @@ -1112,7 +1112,7 @@ static MACHINE_RESET( system16b ) segaic16_memory_mapper_config(machine, state->i8751_initial_config); segaic16_tilemap_reset(machine, 0); - fd1094_machine_init(devtag_get_device(machine, "maincpu")); + fd1094_machine_init(machine->device("maincpu")); /* if we have a fake i8751 handler, disable the actual 8751, otherwise crank the interleave */ if (state->i8751_vblank_hook != NULL) diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c index 6e5a20bf399..31126e828a2 100644 --- a/src/mame/drivers/segas18.c +++ b/src/mame/drivers/segas18.c @@ -166,7 +166,7 @@ static void system18_generic_init(running_machine *machine, int _rom_board) workram = auto_alloc_array(machine, UINT16, 0x04000/2); /* init the memory mapper */ - segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[state->rom_board], sound_w, sound_r); + segaic16_memory_mapper_init(machine->device("maincpu"), region_info_list[state->rom_board], sound_w, sound_r); /* init the FD1094 */ fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted); @@ -175,9 +175,9 @@ static void system18_generic_init(running_machine *machine, int _rom_board) state->custom_io_r = NULL; state->custom_io_w = NULL; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->mcu = devtag_get_device(machine, "mcu"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->mcu_data); state_save_register_global(machine, state->lghost_value); @@ -212,7 +212,7 @@ static MACHINE_RESET( system18 ) segaic16_memory_mapper_reset(machine); segaic16_tilemap_reset(machine, 0); - fd1094_machine_init(devtag_get_device(machine, "maincpu")); + fd1094_machine_init(machine->device("maincpu")); /* if we are running with a real live 8751, we need to boost the interleave at startup */ if (state->mcu != NULL && state->mcu->type() == I8751) diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c index ebd1cc26e75..06d7bb91bed 100644 --- a/src/mame/drivers/segas24.c +++ b/src/mame/drivers/segas24.c @@ -591,7 +591,7 @@ static void mahmajn_io_w(running_machine *machine, int port, UINT8 data) cur_input_line = (cur_input_line + 1) & 7; break; case 7: // DAC - dac_signed_data_w(devtag_get_device(machine, "dac"), data); + dac_signed_data_w(machine->device("dac"), data); break; default: fprintf(stderr, "Port %d : %02x\n", port, data & 0xff); @@ -605,7 +605,7 @@ static void hotrod_io_w(running_machine *machine, int port, UINT8 data) case 3: // Lamps break; case 7: // DAC - dac_signed_data_w(devtag_get_device(machine, "dac"), data); + dac_signed_data_w(machine->device("dac"), data); break; default: fprintf(stderr, "Port %d : %02x\n", port, data & 0xff); diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c index dd466c7b08e..ea8b8d93a97 100644 --- a/src/mame/drivers/segaxbd.c +++ b/src/mame/drivers/segaxbd.c @@ -277,10 +277,10 @@ static void xboard_generic_init(running_machine *machine) state->gprider_hack = 0; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->_315_5250_1 = devtag_get_device(machine, "5250_main"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->subcpu = machine->device("sub"); + state->_315_5250_1 = machine->device("5250_main"); state_save_register_global(machine, state->iochip_force_input); state_save_register_global(machine, state->vblank_irq_state); @@ -434,11 +434,11 @@ static void xboard_reset(running_device *device) static MACHINE_RESET( xboard ) { - fd1094_machine_init(devtag_get_device(machine, "maincpu")); + fd1094_machine_init(machine->device("maincpu")); segaic16_tilemap_reset(machine, 0); /* hook the RESET line, which resets CPU #1 */ - m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), xboard_reset); + m68k_set_reset_callback(machine->device("maincpu"), xboard_reset); /* start timers to track interrupts */ timer_set(machine, machine->primary_screen->time_until_pos(1), NULL, 1, scanline_callback); diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index 1ff0255001c..d9a2b510db2 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -195,10 +195,10 @@ static MACHINE_START( yboard ) { segas1x_state *state = (segas1x_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); - state->subx = devtag_get_device(machine, "subx"); - state->suby = devtag_get_device(machine, "suby"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); + state->subx = machine->device("subx"); + state->suby = machine->device("suby"); state_save_register_global(machine, state->vblank_irq_state); state_save_register_global(machine, state->timer_irq_state); diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c index dea33ced6a4..8326b640ada 100644 --- a/src/mame/drivers/seibuspi.c +++ b/src/mame/drivers/seibuspi.c @@ -1837,7 +1837,7 @@ static MACHINE_RESET( spi ) UINT8 flash_data = rombase[0x1ffffc]; cputag_set_input_line(machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE ); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), spi_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), spi_irq_callback); memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000680, 0x00000683, 0, 0, sound_fifo_r); memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000688, 0x0000068b, 0, 0, z80_prg_fifo_w); @@ -1920,10 +1920,10 @@ static MACHINE_RESET( sxx2f ) memcpy(z80_rom, rom, 0x40000); - memory_install_write32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), devtag_get_device(machine, "eeprom"), 0x0000068c, 0x0000068f, 0, 0, eeprom_w); + memory_install_write32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), machine->device("eeprom"), 0x0000068c, 0x0000068f, 0, 0, eeprom_w); memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000680, 0x00000683, 0, 0, sb_coin_r); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), spi_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), spi_irq_callback); sb_coin_latch = 0; } @@ -2195,7 +2195,7 @@ static DRIVER_INIT( rdft22kc ) static MACHINE_RESET( seibu386 ) { - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), spi_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), spi_irq_callback); } static MACHINE_DRIVER_START( seibu386 ) diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c index 66900d9f161..94f80e27504 100644 --- a/src/mame/drivers/seicross.c +++ b/src/mame/drivers/seicross.c @@ -102,7 +102,7 @@ static WRITE8_DEVICE_HANDLER( friskyt_portB_w ) { //logerror("PC %04x: 8910 port B = %02x\n",cpu_get_pc(space->cpu),data); /* bit 0 is IRQ enable */ - cpu_interrupt_enable(devtag_get_device(device->machine, "maincpu"), data & 1); + cpu_interrupt_enable(device->machine->device("maincpu"), data & 1); /* bit 1 flips screen */ diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c index 90120c91ee9..d5702302ee5 100644 --- a/src/mame/drivers/sf.c +++ b/src/mame/drivers/sf.c @@ -809,8 +809,8 @@ static MACHINE_START( sf ) sf_state *state = (sf_state *)machine->driver_data; /* devices */ - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->sf_active); state_save_register_global(machine, state->bgscroll); diff --git a/src/mame/drivers/shanghai.c b/src/mame/drivers/shanghai.c index fc2a5fa3e0b..8c95072d733 100644 --- a/src/mame/drivers/shanghai.c +++ b/src/mame/drivers/shanghai.c @@ -63,7 +63,7 @@ static VIDEO_START( shanghai ) static VIDEO_UPDATE( shanghai ) { - running_device *hd63484 = devtag_get_device(screen->machine, "hd63484"); + running_device *hd63484 = screen->machine->device("hd63484"); int x, y, b, src; b = ((hd63484_regs_r(hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff); diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c index 723348f6f4d..680046fa475 100644 --- a/src/mame/drivers/sigmab52.c +++ b/src/mame/drivers/sigmab52.c @@ -146,7 +146,7 @@ static VIDEO_START( jwildb52 ) static VIDEO_UPDATE( jwildb52 ) { - running_device *hd63484 = devtag_get_device(screen->machine, "hd63484"); + running_device *hd63484 = screen->machine->device("hd63484"); int x, y, b, src; @@ -226,7 +226,7 @@ static WRITE8_HANDLER(acrtc_w) { static int latch=0; static unsigned int acrtc_data=0; - running_device *hd63484 = devtag_get_device(space->machine, "hd63484"); + running_device *hd63484 = space->machine->device("hd63484"); if(!offset) { //address select @@ -257,7 +257,7 @@ static READ8_HANDLER(acrtc_r) { if(offset&1) { - running_device *hd63484 = devtag_get_device(space->machine, "hd63484"); + running_device *hd63484 = space->machine->device("hd63484"); return hd63484_data_r(hd63484, 0, 0xff); } @@ -546,7 +546,7 @@ static MACHINE_START(jwildb52) UINT16 *rom = (UINT16*)memory_region(machine, "gfx1"); int i; - running_device *hd63484 = devtag_get_device(machine, "hd63484"); + running_device *hd63484 = machine->device("hd63484"); for(i = 0; i < 0x40000/2; ++i) { diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c index efe2a32055a..999da03eaf9 100644 --- a/src/mame/drivers/sigmab98.c +++ b/src/mame/drivers/sigmab98.c @@ -313,7 +313,7 @@ static WRITE8_HANDLER( c6_w ) // 02 hopper motor on (active low)? static WRITE8_HANDLER( c8_w ) { - ticket_dispenser_w(devtag_get_device(space->machine, "hopper"), 0, (!(data & 0x02) && (data & 0x01)) ? 0x00 : 0x80); + ticket_dispenser_w(space->machine->device("hopper"), 0, (!(data & 0x02) && (data & 0x01)) ? 0x00 : 0x80); c8 = data; show_outputs(); diff --git a/src/mame/drivers/skeetsht.c b/src/mame/drivers/skeetsht.c index 5594727bb22..2b3c2f2cac9 100644 --- a/src/mame/drivers/skeetsht.c +++ b/src/mame/drivers/skeetsht.c @@ -44,8 +44,8 @@ static MACHINE_RESET( skeetsht ) { skeetsht_state *state = (skeetsht_state *)machine->driver_data; - state->ay = devtag_get_device(machine, "aysnd"); - state->tms = devtag_get_device(machine, "tms"); + state->ay = machine->device("aysnd"); + state->tms = machine->device("tms"); /* Setup the Bt476 VGA RAMDAC palette chip */ tlc34076_reset(6); diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c index c1690b28c87..7fff66c8eb7 100644 --- a/src/mame/drivers/skimaxx.c +++ b/src/mame/drivers/skimaxx.c @@ -212,12 +212,12 @@ static void skimaxx_scanline_update(screen_device &screen, bitmap_t *bitmap, int static WRITE32_HANDLER( m68k_tms_w ) { - tms34010_host_w(devtag_get_device(space->machine, "tms"), offset, data); + tms34010_host_w(space->machine->device("tms"), offset, data); } static READ32_HANDLER( m68k_tms_r ) { - return tms34010_host_r(devtag_get_device(space->machine, "tms"), offset); + return tms34010_host_r(space->machine->device("tms"), offset); } @@ -274,7 +274,7 @@ static WRITE32_HANDLER( skimaxx_sub_ctrl_w ) // 7e/7f at the start. 3f/7f, related to reads from 1018xxxx if (ACCESSING_BITS_0_7) { - running_device *subcpu = devtag_get_device(space->machine, "subcpu"); + running_device *subcpu = space->machine->device("subcpu"); cpu_set_input_line(subcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); cpu_set_input_line(subcpu, INPUT_LINE_HALT, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c index 10de0de5b11..ec4930e2148 100644 --- a/src/mame/drivers/skullxbo.c +++ b/src/mame/drivers/skullxbo.c @@ -41,7 +41,7 @@ static void update_interrupts(running_machine *machine) static TIMER_CALLBACK( irq_gen ) { - atarigen_scanline_int_gen(devtag_get_device(machine, "maincpu")); + atarigen_scanline_int_gen(machine->device("maincpu")); } diff --git a/src/mame/drivers/skydiver.c b/src/mame/drivers/skydiver.c index 92e3ec31326..095aec1f934 100644 --- a/src/mame/drivers/skydiver.c +++ b/src/mame/drivers/skydiver.c @@ -147,7 +147,7 @@ static WRITE8_HANDLER( skydiver_nmion_w ) static INTERRUPT_GEN( skydiver_interrupt ) { - running_device *discrete = devtag_get_device(device->machine, "discrete"); + running_device *discrete = device->machine->device("discrete"); /* Convert range data to divide value and write to sound */ discrete_sound_w(discrete, SKYDIVER_RANGE_DATA, (0x01 << (~skydiver_videoram[0x394] & 0x07)) & 0xff); // Range 0-2 diff --git a/src/mame/drivers/skyfox.c b/src/mame/drivers/skyfox.c index 2141a80f865..d24d4ced473 100644 --- a/src/mame/drivers/skyfox.c +++ b/src/mame/drivers/skyfox.c @@ -224,7 +224,7 @@ static MACHINE_START( skyfox ) { skyfox_state *state = (skyfox_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); + state->maincpu = machine->device("maincpu"); state_save_register_global(machine, state->bg_pos); state_save_register_global(machine, state->bg_ctrl); diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c index cbe213c2426..dc4396a8670 100644 --- a/src/mame/drivers/skykid.c +++ b/src/mame/drivers/skykid.c @@ -90,7 +90,7 @@ static WRITE8_HANDLER( skykid_bankswitch_w ) static WRITE8_HANDLER( skykid_irq_1_ctrl_w ) { int bit = !BIT(offset,11); - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit); + cpu_interrupt_enable(space->machine->device("maincpu"), bit); if (!bit) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } @@ -98,7 +98,7 @@ static WRITE8_HANDLER( skykid_irq_1_ctrl_w ) static WRITE8_HANDLER( skykid_irq_2_ctrl_w ) { int bit = !BIT(offset,13); - cpu_interrupt_enable(devtag_get_device(space->machine, "mcu"), bit); + cpu_interrupt_enable(space->machine->device("mcu"), bit); if (!bit) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); } diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c index b857f6b370a..6e51a54de8d 100644 --- a/src/mame/drivers/slapshot.c +++ b/src/mame/drivers/slapshot.c @@ -538,12 +538,12 @@ static MACHINE_START( slapshot ) memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->tc0140syt = devtag_get_device(machine, "tc0140syt"); - state->tc0480scp = devtag_get_device(machine, "tc0480scp"); - state->tc0360pri = devtag_get_device(machine, "tc0360pri"); - state->tc0640fio = devtag_get_device(machine, "tc0640fio"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->tc0140syt = machine->device("tc0140syt"); + state->tc0480scp = machine->device("tc0480scp"); + state->tc0360pri = machine->device("tc0360pri"); + state->tc0640fio = machine->device("tc0640fio"); state->banknum = 0; state_save_register_global(machine, state->banknum); diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c index e4e6b3247a5..5f7bdf35958 100644 --- a/src/mame/drivers/slotcarn.c +++ b/src/mame/drivers/slotcarn.c @@ -525,7 +525,7 @@ GFXDECODE_END static VIDEO_UPDATE( slotcarn ) { - running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = screen->machine->device("crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c index 26a94687b23..30e77ed9b80 100644 --- a/src/mame/drivers/snowbros.c +++ b/src/mame/drivers/snowbros.c @@ -82,7 +82,7 @@ static WRITE16_HANDLER( snowbros_flipscreen_w ) static VIDEO_UPDATE( snowbros ) { - running_device *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = screen->machine->device("pandora"); /* This clears & redraws the entire screen each pass */ bitmap_fill(bitmap,cliprect,0xf0); @@ -93,7 +93,7 @@ static VIDEO_UPDATE( snowbros ) static VIDEO_EOF( snowbros ) { - running_device *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = machine->device("pandora"); pandora_eof(pandora); } @@ -124,7 +124,7 @@ static INTERRUPT_GEN( snowbros_interrupt ) static INTERRUPT_GEN( snowbro3_interrupt ) { - running_device *adpcm = devtag_get_device(device->machine, "oki"); + running_device *adpcm = device->machine->device("oki"); int status = okim6295_r(adpcm,0); cpu_set_input_line(device, cpu_getiloops(device) + 2, ASSERT_LINE); /* IRQs 4, 3, and 2 */ diff --git a/src/mame/drivers/sonson.c b/src/mame/drivers/sonson.c index 94ca5947846..b911327d7a6 100644 --- a/src/mame/drivers/sonson.c +++ b/src/mame/drivers/sonson.c @@ -231,7 +231,7 @@ static MACHINE_START( sonson ) { sonson_state *state = (sonson_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->last_irq); } diff --git a/src/mame/drivers/spcforce.c b/src/mame/drivers/spcforce.c index 55b1a7415be..dc84ebcaec3 100644 --- a/src/mame/drivers/spcforce.c +++ b/src/mame/drivers/spcforce.c @@ -55,9 +55,9 @@ static WRITE8_HANDLER( spcforce_SN76496_latch_w ) static READ8_HANDLER( spcforce_SN76496_select_r ) { - if (~spcforce_SN76496_select & 0x40) return sn76496_ready_r(devtag_get_device(space->machine, "sn1"), 0 ); - if (~spcforce_SN76496_select & 0x20) return sn76496_ready_r(devtag_get_device(space->machine, "sn2"), 0 ); - if (~spcforce_SN76496_select & 0x10) return sn76496_ready_r(devtag_get_device(space->machine, "sn3"), 0 ); + if (~spcforce_SN76496_select & 0x40) return sn76496_ready_r(space->machine->device("sn1"), 0 ); + if (~spcforce_SN76496_select & 0x20) return sn76496_ready_r(space->machine->device("sn2"), 0 ); + if (~spcforce_SN76496_select & 0x10) return sn76496_ready_r(space->machine->device("sn3"), 0 ); return 0; } @@ -66,9 +66,9 @@ static WRITE8_HANDLER( spcforce_SN76496_select_w ) { spcforce_SN76496_select = data; - if (~data & 0x40) sn76496_w(devtag_get_device(space->machine, "sn1"), 0, spcforce_SN76496_latch); - if (~data & 0x20) sn76496_w(devtag_get_device(space->machine, "sn2"), 0, spcforce_SN76496_latch); - if (~data & 0x10) sn76496_w(devtag_get_device(space->machine, "sn3"), 0, spcforce_SN76496_latch); + if (~data & 0x40) sn76496_w(space->machine->device("sn1"), 0, spcforce_SN76496_latch); + if (~data & 0x20) sn76496_w(space->machine->device("sn2"), 0, spcforce_SN76496_latch); + if (~data & 0x10) sn76496_w(space->machine->device("sn3"), 0, spcforce_SN76496_latch); } static READ8_HANDLER( spcforce_t0_r ) diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c index ef8bb4c7282..b3989b3b22a 100644 --- a/src/mame/drivers/spdodgeb.c +++ b/src/mame/drivers/spdodgeb.c @@ -61,7 +61,7 @@ static WRITE8_HANDLER( sound_command_w ) static WRITE8_HANDLER( spd_adpcm_w ) { int chip = offset & 1; - running_device *adpcm = devtag_get_device(space->machine, (chip == 0) ? "msm1" : "msm2"); + running_device *adpcm = space->machine->device((chip == 0) ? "msm1" : "msm2"); switch (offset/2) { diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c index e74e36edd43..6444aa45e69 100644 --- a/src/mame/drivers/spiders.c +++ b/src/mame/drivers/spiders.c @@ -231,9 +231,9 @@ static READ8_DEVICE_HANDLER( gfx_rom_r ); static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq ) { - running_device *pia1 = devtag_get_device(device->machine, "pia1"); - running_device *pia2 = devtag_get_device(device->machine, "pia2"); - running_device *pia3 = devtag_get_device(device->machine, "pia3"); + running_device *pia1 = device->machine->device("pia1"); + running_device *pia2 = device->machine->device("pia2"); + running_device *pia3 = device->machine->device("pia3"); int combined_state = pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1) | pia6821_get_irq_b(pia2) | pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3); @@ -279,7 +279,7 @@ static const pia6821_interface pia_1_intf = static INTERRUPT_GEN( update_pia_1 ) { - running_device *pia1 = devtag_get_device(device->machine, "pia1"); + running_device *pia1 = device->machine->device("pia1"); /* update the different PIA pins from the input ports */ /* CA1 - copy of PA1 (COIN1) */ @@ -382,7 +382,7 @@ static const pia6821_interface pia_4_intf = static WRITE8_DEVICE_HANDLER( ic60_74123_output_changed) { - running_device *pia2 = devtag_get_device(device->machine, "pia2"); + running_device *pia2 = device->machine->device("pia2"); pia6821_ca1_w(pia2, 0, data); } @@ -509,7 +509,7 @@ static MC6845_UPDATE_ROW( update_row ) static WRITE_LINE_DEVICE_HANDLER( display_enable_changed ) { - ttl74123_a_w(devtag_get_device(device->machine, "ic60"), 0, state); + ttl74123_a_w(device->machine->device("ic60"), 0, state); } @@ -530,7 +530,7 @@ static const mc6845_interface mc6845_intf = static VIDEO_UPDATE( spiders ) { - running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = screen->machine->device("crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c index 5239229dcff..318dd70abb8 100644 --- a/src/mame/drivers/spool99.c +++ b/src/mame/drivers/spool99.c @@ -176,8 +176,8 @@ static READ8_HANDLER( spool99_io_r ) case 0xafe4: return input_port_read(space->machine,"SERVICE2");//attract mode // case 0xafe5: return 1; // case 0xafe6: return 1; - case 0xafe7: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom")); - case 0xaff8: return okim6295_r(devtag_get_device(space->machine, "oki"),0); + case 0xafe7: return eeprom_read_bit(space->machine->device("eeprom")); + case 0xaff8: return okim6295_r(space->machine->device("oki"),0); } } // printf("%04x %d\n",offset+0xaf00,io_switch); @@ -235,13 +235,13 @@ static READ8_HANDLER( vcarn_io_r ) case 0xa725: return input_port_read(space->machine,"HOLD3"); case 0xa726: return input_port_read(space->machine,"HOLD4"); case 0xa727: return input_port_read(space->machine,"HOLD2"); - case 0xa780: return okim6295_r(devtag_get_device(space->machine, "oki"),0); + case 0xa780: return okim6295_r(space->machine->device("oki"),0); case 0xa7a0: return input_port_read(space->machine,"HOLD1"); case 0xa7a1: return input_port_read(space->machine,"HOLD5"); case 0xa7a2: return input_port_read(space->machine,"START"); case 0xa7a3: return input_port_read(space->machine,"BET");//system 2 - case 0xa7a7: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom")); + case 0xa7a7: return eeprom_read_bit(space->machine->device("eeprom")); } } diff --git a/src/mame/drivers/sprint2.c b/src/mame/drivers/sprint2.c index 7abfea96dda..e9ef3033ea2 100644 --- a/src/mame/drivers/sprint2.c +++ b/src/mame/drivers/sprint2.c @@ -71,7 +71,7 @@ static int service_mode(running_machine *machine) static INTERRUPT_GEN( sprint2 ) { - running_device *discrete = devtag_get_device(device->machine, "discrete"); + running_device *discrete = device->machine->device("discrete"); static UINT8 dial[2]; /* handle steering wheels */ diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c index f37cd5a4102..2141692e8ab 100644 --- a/src/mame/drivers/spy.c +++ b/src/mame/drivers/spy.c @@ -516,12 +516,12 @@ static MACHINE_START( spy ) machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800); state->pmcram = auto_alloc_array_clear(machine, UINT8, 0x800); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k007232_1 = devtag_get_device(machine, "k007232_1"); - state->k007232_2 = devtag_get_device(machine, "k007232_2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); + state->k007232_1 = machine->device("k007232_1"); + state->k007232_2 = machine->device("k007232_2"); state_save_register_global(machine, state->rambank); state_save_register_global(machine, state->pmcbank); diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c index 53d240f8b1e..f552f6b50f7 100644 --- a/src/mame/drivers/ssfindo.c +++ b/src/mame/drivers/ssfindo.c @@ -259,7 +259,7 @@ static TIMER_CALLBACK( PS7500_Timer0_callback ) PS7500_IO[IRQSTA]|=0x20; if(PS7500_IO[IRQMSKA]&0x20) { - generic_pulse_irq_line(devtag_get_device(machine, "maincpu"), ARM7_IRQ_LINE); + generic_pulse_irq_line(machine->device("maincpu"), ARM7_IRQ_LINE); } } @@ -278,7 +278,7 @@ static TIMER_CALLBACK( PS7500_Timer1_callback ) PS7500_IO[IRQSTA]|=0x40; if(PS7500_IO[IRQMSKA]&0x40) { - generic_pulse_irq_line(devtag_get_device(machine, "maincpu"), ARM7_IRQ_LINE); + generic_pulse_irq_line(machine->device("maincpu"), ARM7_IRQ_LINE); } } diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c index 7e314c04d75..2a8ce5e3e1c 100644 --- a/src/mame/drivers/ssingles.c +++ b/src/mame/drivers/ssingles.c @@ -257,7 +257,7 @@ static VIDEO_START(ssingles) static VIDEO_UPDATE( ssingles ) { - running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = screen->machine->device("crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/sslam.c b/src/mame/drivers/sslam.c index 54cc75dabda..f2debe63512 100644 --- a/src/mame/drivers/sslam.c +++ b/src/mame/drivers/sslam.c @@ -441,7 +441,7 @@ static READ8_HANDLER( playmark_snd_command_r ) data = soundlatch_r(space,0); } else if ((state->oki_control & 0x38) == 0x28) { - data = (okim6295_r(devtag_get_device(space->machine, "oki"),0) & 0x0f); + data = (okim6295_r(space->machine->device("oki"),0) & 0x0f); } return data; @@ -471,7 +471,7 @@ static WRITE8_HANDLER( playmark_snd_control_w ) if ((data & 0x38) == 0x18) { - okim6295_w(devtag_get_device(space->machine, "oki"), 0, state->oki_command); + okim6295_w(space->machine->device("oki"), 0, state->oki_command); } // !(data & 0x80) -> sound enable diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c index ee7d93e63c6..221be9d59e8 100644 --- a/src/mame/drivers/ssv.c +++ b/src/mame/drivers/ssv.c @@ -339,7 +339,7 @@ static WRITE16_HANDLER( ssv_lockout_inv_w ) static MACHINE_RESET( ssv ) { requested_int = 0; - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), ssv_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), ssv_irq_callback); memory_set_bankptr(machine, "bank1", memory_region(machine, "user1")); } @@ -766,7 +766,7 @@ static WRITE16_HANDLER( srmp7_sound_bank_w ) { if (ACCESSING_BITS_0_7) { - running_device *device = devtag_get_device(space->machine, "ensoniq"); + running_device *device = space->machine->device("ensoniq"); int bank = 0x400000/2 * (data & 1); // UINT16 address int voice; for (voice = 0; voice < 32; voice++) diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c index 26ab35d3f7c..950dc3757b1 100644 --- a/src/mame/drivers/statriv2.c +++ b/src/mame/drivers/statriv2.c @@ -164,7 +164,7 @@ static WRITE8_HANDLER( statriv2_videoram_w ) static VIDEO_UPDATE( statriv2 ) { - if (tms9927_screen_reset(devtag_get_device(screen->machine, "tms"))) + if (tms9927_screen_reset(screen->machine->device("tms"))) bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); else tilemap_draw(bitmap, cliprect, statriv2_tilemap, 0, 0); diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c index 80eea0cfba0..e83bb03cfb3 100644 --- a/src/mame/drivers/stv.c +++ b/src/mame/drivers/stv.c @@ -477,7 +477,7 @@ static UINT8 stv_SMPC_r8 (const address_space *space, int offset) return_data = input_port_read(space->machine, "DSW1"); if (offset == 0x77)//PDR2 read - return_data= (0xfe | eeprom_read_bit(devtag_get_device(space->machine, "eeprom"))); + return_data= (0xfe | eeprom_read_bit(space->machine->device("eeprom"))); // if (offset == 0x33) //country code // return_data = input_port_read(machine, "FAKE"); @@ -1971,14 +1971,14 @@ static WRITE32_HANDLER( minit_w ) logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data); cpuexec_boost_interleave(space->machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost)); cpuexec_trigger(space->machine, 1000); - sh2_set_frt_input(devtag_get_device(space->machine, "slave"), PULSE_LINE); + sh2_set_frt_input(space->machine->device("slave"), PULSE_LINE); } static WRITE32_HANDLER( sinit_w ) { logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data); cpuexec_boost_interleave(space->machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost)); - sh2_set_frt_input(devtag_get_device(space->machine, "maincpu"), PULSE_LINE); + sh2_set_frt_input(space->machine->device("maincpu"), PULSE_LINE); } @@ -2355,8 +2355,8 @@ DRIVER_INIT ( stv ) // do strict overwrite verification - maruchan and rsgun crash after coinup without this. // cottonbm needs strict PCREL // todo: test what games need this and don't turn it on for them... - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); - sh2drc_set_options(devtag_get_device(machine, "slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); + sh2drc_set_options(machine->device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); /* debug .. watch the command buffer rsgun, cottonbm etc. appear to use to communicate between cpus */ memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write ); @@ -2597,7 +2597,7 @@ static MACHINE_START( stv ) stv_slave = machine->device("slave"); stv_audiocpu = machine->device("audiocpu"); - scsp_set_ram_base(devtag_get_device(machine, "scsp"), sound_ram); + scsp_set_ram_base(machine->device("scsp"), sound_ram); // save states state_save_register_global_pointer(machine, smpc_ram, 0x80); diff --git a/src/mame/drivers/stvinit.c b/src/mame/drivers/stvinit.c index 8ae56536e7d..55a375ed20b 100644 --- a/src/mame/drivers/stvinit.c +++ b/src/mame/drivers/stvinit.c @@ -79,19 +79,19 @@ static const UINT8 stv_default_eeprom[128] = { void install_stvbios_speedups(running_machine *machine) { // flushes 0 & 1 on both CPUs are for the BIOS speedups - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60154b2); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013aee); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60154b2); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6013aee); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60154b2); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6013aee); + sh2drc_add_pcflush(machine->device("slave"), 0x60154b2); + sh2drc_add_pcflush(machine->device("slave"), 0x6013aee); } DRIVER_INIT(shienryu) { // master - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60041c6); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60041c6); // slave - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x600440e); + sh2drc_add_pcflush(machine->device("slave"), 0x600440e); DRIVER_INIT_CALL(stv); } @@ -106,9 +106,9 @@ DRIVER_INIT(prikura) (loops for 263473 instructions) */ // master - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6018640); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6018640); // slave - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6018c6e); + sh2drc_add_pcflush(machine->device("slave"), 0x6018c6e); DRIVER_INIT_CALL(stv); @@ -136,7 +136,7 @@ DRIVER_INIT(hanagumi) (loops for 288688 instructions) */ - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6010160); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6010160); DRIVER_INIT_CALL(stv); } @@ -162,9 +162,9 @@ CPU0: Aids Screen DRIVER_INIT(puyosun) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6021cf0); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6021cf0); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60236fe); + sh2drc_add_pcflush(machine->device("slave"), 0x60236fe); DRIVER_INIT_CALL(stv); @@ -184,7 +184,7 @@ CPU0 Data East Logo: DRIVER_INIT(mausuke) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60461A0); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60461A0); DRIVER_INIT_CALL(stv); @@ -194,8 +194,8 @@ DRIVER_INIT(mausuke) DRIVER_INIT(cottonbm) { -// sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6030ee2); -// sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6032b52); +// sh2drc_add_pcflush(machine->device("maincpu"), 0x6030ee2); +// sh2drc_add_pcflush(machine->device("slave"), 0x6032b52); DRIVER_INIT_CALL(stv); @@ -204,8 +204,8 @@ DRIVER_INIT(cottonbm) DRIVER_INIT(cotton2) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6031c7a); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60338ea); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6031c7a); + sh2drc_add_pcflush(machine->device("slave"), 0x60338ea); DRIVER_INIT_CALL(stv); @@ -215,13 +215,13 @@ DRIVER_INIT(cotton2) DRIVER_INIT(dnmtdeka) { // install all 3 speedups on both master and slave - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6027c90); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0xd04); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60051f2); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6027c90); + sh2drc_add_pcflush(machine->device("maincpu"), 0xd04); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60051f2); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6027c90); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0xd04); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60051f2); + sh2drc_add_pcflush(machine->device("slave"), 0x6027c90); + sh2drc_add_pcflush(machine->device("slave"), 0xd04); + sh2drc_add_pcflush(machine->device("slave"), 0x60051f2); DRIVER_INIT_CALL(stv); } @@ -229,33 +229,33 @@ DRIVER_INIT(dnmtdeka) DRIVER_INIT(diehard) { // install all 3 speedups on both master and slave - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6027c98); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0xd04); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60051f2); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6027c98); + sh2drc_add_pcflush(machine->device("maincpu"), 0xd04); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60051f2); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6027c98); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0xd04); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60051f2); + sh2drc_add_pcflush(machine->device("slave"), 0x6027c98); + sh2drc_add_pcflush(machine->device("slave"), 0xd04); + sh2drc_add_pcflush(machine->device("slave"), 0x60051f2); DRIVER_INIT_CALL(stv); } DRIVER_INIT(fhboxers) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60041c2); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x600bb0a); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x600b31e); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60041c2); + sh2drc_add_pcflush(machine->device("maincpu"), 0x600bb0a); + sh2drc_add_pcflush(machine->device("maincpu"), 0x600b31e); DRIVER_INIT_CALL(stv); } DRIVER_INIT( groovef ) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6005e7c); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6005e86); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60a4970); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6005e7c); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6005e86); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60a4970); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60060c2); + sh2drc_add_pcflush(machine->device("slave"), 0x60060c2); DRIVER_INIT_CALL(stv); @@ -265,9 +265,9 @@ DRIVER_INIT( groovef ) DRIVER_INIT( danchih ) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6028b28); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6028c8e); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602ae26); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6028b28); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6028c8e); + sh2drc_add_pcflush(machine->device("slave"), 0x602ae26); DRIVER_INIT_CALL(stv); @@ -307,8 +307,8 @@ static READ32_HANDLER( astrass_hack_r ) DRIVER_INIT( astrass ) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60011b8); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x605b9da); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60011b8); + sh2drc_add_pcflush(machine->device("maincpu"), 0x605b9da); memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x06000770, 0x06000773, 0, 0, astrass_hack_r ); @@ -319,9 +319,9 @@ DRIVER_INIT( astrass ) DRIVER_INIT(thunt) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602A024); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013EEA); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602AAF8); + sh2drc_add_pcflush(machine->device("maincpu"), 0x602A024); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6013EEA); + sh2drc_add_pcflush(machine->device("slave"), 0x602AAF8); DRIVER_INIT_CALL(stv); @@ -330,9 +330,9 @@ DRIVER_INIT(thunt) DRIVER_INIT(sandor) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602a0f8); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013fbe); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602abcc); + sh2drc_add_pcflush(machine->device("maincpu"), 0x602a0f8); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6013fbe); + sh2drc_add_pcflush(machine->device("slave"), 0x602abcc); DRIVER_INIT_CALL(stv); minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1); @@ -341,8 +341,8 @@ DRIVER_INIT(sandor) DRIVER_INIT(grdforce) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6041e32); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6043aa2); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6041e32); + sh2drc_add_pcflush(machine->device("slave"), 0x6043aa2); DRIVER_INIT_CALL(stv); @@ -351,8 +351,8 @@ DRIVER_INIT(grdforce) DRIVER_INIT(batmanfr) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60121c0); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60125bc); + sh2drc_add_pcflush(machine->device("maincpu"), 0x60121c0); + sh2drc_add_pcflush(machine->device("slave"), 0x60125bc); DRIVER_INIT_CALL(stv); @@ -362,7 +362,7 @@ DRIVER_INIT(batmanfr) DRIVER_INIT(colmns97) { - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60298a2); + sh2drc_add_pcflush(machine->device("slave"), 0x60298a2); DRIVER_INIT_CALL(stv); @@ -372,8 +372,8 @@ DRIVER_INIT(colmns97) DRIVER_INIT(winterht) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6098aea); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x609ae4e); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6098aea); + sh2drc_add_pcflush(machine->device("slave"), 0x609ae4e); DRIVER_INIT_CALL(stv); @@ -382,8 +382,8 @@ DRIVER_INIT(winterht) DRIVER_INIT(seabass) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602cbfa); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60321ee); + sh2drc_add_pcflush(machine->device("maincpu"), 0x602cbfa); + sh2drc_add_pcflush(machine->device("slave"), 0x60321ee); DRIVER_INIT_CALL(stv); @@ -392,8 +392,8 @@ DRIVER_INIT(seabass) DRIVER_INIT(vfremix) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602c30c); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x604c332); + sh2drc_add_pcflush(machine->device("maincpu"), 0x602c30c); + sh2drc_add_pcflush(machine->device("slave"), 0x604c332); DRIVER_INIT_CALL(stv); @@ -402,8 +402,8 @@ DRIVER_INIT(vfremix) DRIVER_INIT(sss) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6026398); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6028cd6); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6026398); + sh2drc_add_pcflush(machine->device("slave"), 0x6028cd6); install_sss_protection(machine); @@ -414,8 +414,8 @@ DRIVER_INIT(sss) DRIVER_INIT(othellos) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602bcbe); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602d92e); + sh2drc_add_pcflush(machine->device("maincpu"), 0x602bcbe); + sh2drc_add_pcflush(machine->device("slave"), 0x602d92e); DRIVER_INIT_CALL(stv); @@ -425,7 +425,7 @@ DRIVER_INIT(othellos) DRIVER_INIT(sasissu) { - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60710be); + sh2drc_add_pcflush(machine->device("slave"), 0x60710be); DRIVER_INIT_CALL(stv); @@ -434,14 +434,14 @@ DRIVER_INIT(sasissu) DRIVER_INIT(gaxeduel) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6012ee4); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6012ee4); DRIVER_INIT_CALL(stv); } DRIVER_INIT(suikoenb) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013f7a); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6013f7a); DRIVER_INIT_CALL(stv); } @@ -456,8 +456,8 @@ DRIVER_INIT(sokyugrt) DRIVER_INIT(znpwfv) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6012ec2); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60175a6); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6012ec2); + sh2drc_add_pcflush(machine->device("slave"), 0x60175a6); DRIVER_INIT_CALL(stv); minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_NSEC(500); @@ -465,8 +465,8 @@ DRIVER_INIT(znpwfv) DRIVER_INIT(twcup98) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x605edde); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6062bca); + sh2drc_add_pcflush(machine->device("maincpu"), 0x605edde); + sh2drc_add_pcflush(machine->device("slave"), 0x6062bca); DRIVER_INIT_CALL(stv); install_twcup98_protection(machine); @@ -476,8 +476,8 @@ DRIVER_INIT(twcup98) DRIVER_INIT(smleague) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6063bf4); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6062bca); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6063bf4); + sh2drc_add_pcflush(machine->device("slave"), 0x6062bca); DRIVER_INIT_CALL(stv); @@ -486,7 +486,7 @@ DRIVER_INIT(smleague) DRIVER_INIT(finlarch) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6064d60); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6064d60); DRIVER_INIT_CALL(stv); @@ -494,8 +494,8 @@ DRIVER_INIT(finlarch) DRIVER_INIT(maruchan) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x601ba46); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x601ba46); + sh2drc_add_pcflush(machine->device("maincpu"), 0x601ba46); + sh2drc_add_pcflush(machine->device("slave"), 0x601ba46); DRIVER_INIT_CALL(stv); @@ -504,22 +504,22 @@ DRIVER_INIT(maruchan) DRIVER_INIT(pblbeach) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x605eb78); + sh2drc_add_pcflush(machine->device("maincpu"), 0x605eb78); DRIVER_INIT_CALL(stv); } DRIVER_INIT(shanhigw) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6020c5c); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6020c5c); DRIVER_INIT_CALL(stv); } DRIVER_INIT(elandore) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x604eac0); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x605340a); + sh2drc_add_pcflush(machine->device("maincpu"), 0x604eac0); + sh2drc_add_pcflush(machine->device("slave"), 0x605340a); install_elandore_protection(machine); @@ -530,8 +530,8 @@ DRIVER_INIT(elandore) DRIVER_INIT(rsgun) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6034d04); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6036152); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6034d04); + sh2drc_add_pcflush(machine->device("slave"), 0x6036152); install_rsgun_protection(machine); @@ -555,8 +555,8 @@ DRIVER_INIT(decathlt) DRIVER_INIT(nameclv3) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x601eb4c); - sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602b80e); + sh2drc_add_pcflush(machine->device("maincpu"), 0x601eb4c); + sh2drc_add_pcflush(machine->device("slave"), 0x602b80e); DRIVER_INIT_CALL(stv); } diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c index 8e021ee23cf..f59a25bd42d 100644 --- a/src/mame/drivers/suna8.c +++ b/src/mame/drivers/suna8.c @@ -1022,7 +1022,7 @@ ADDRESS_MAP_END static WRITE8_HANDLER( brickzn_pcm_w ) { static const char *const dacs[] = { "dac1", "dac2", "dac3", "dac4" }; - dac_signed_data_w( devtag_get_device(space->machine, dacs[offset & 3]), (data & 0xf) * 0x11 ); + dac_signed_data_w( space->machine->device(dacs[offset & 3]), (data & 0xf) * 0x11 ); } diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c index 845dffb885c..05bfdaa5219 100644 --- a/src/mame/drivers/supbtime.c +++ b/src/mame/drivers/supbtime.c @@ -334,9 +334,9 @@ static MACHINE_START( supbtime ) { supbtime_state *state = (supbtime_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->deco16ic = machine->device("deco_custom"); } static MACHINE_DRIVER_START( supbtime ) diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c index 92ef0b3c7d0..0837b40e0a5 100644 --- a/src/mame/drivers/superchs.c +++ b/src/mame/drivers/superchs.c @@ -150,7 +150,7 @@ static WRITE32_HANDLER( superchs_input_w ) if (ACCESSING_BITS_0_7) { - running_device *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = space->machine->device("eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c index 3cb060e9c83..c7a4667a55b 100644 --- a/src/mame/drivers/superdq.c +++ b/src/mame/drivers/superdq.c @@ -319,7 +319,7 @@ static MACHINE_START( superdq ) { superdq_state *state = (superdq_state *)machine->driver_data; - state->laserdisc = devtag_get_device(machine, "laserdisc"); + state->laserdisc = machine->device("laserdisc"); } diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c index 97c674a2c5b..591645b0567 100644 --- a/src/mame/drivers/superqix.c +++ b/src/mame/drivers/superqix.c @@ -147,7 +147,7 @@ static SAMPLES_START( pbillian_sh_start ) static WRITE8_HANDLER( pbillian_sample_trigger_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); int start,end; start = data << 7; diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c index 65477bd961f..819b8978bfe 100644 --- a/src/mame/drivers/suprnova.c +++ b/src/mame/drivers/suprnova.c @@ -995,15 +995,15 @@ static READ32_HANDLER( sengekij_speedup_r ) // 60006ee 600308e static void init_skns(running_machine *machine) { // init DRC to fastest options - sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS); + sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS); - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6f8); + sh2drc_add_pcflush(machine->device("maincpu"), 0x6f8); memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000028, 0x600002b, 0, 0, bios_skip_r ); } static void set_drc_pcflush(running_machine *machine, UINT32 addr) { - sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), addr); + sh2drc_add_pcflush(machine->device("maincpu"), addr); } static DRIVER_INIT( galpani4 ) { skns_sprite_kludge(-5,-1); init_skns(machine); } diff --git a/src/mame/drivers/suprslam.c b/src/mame/drivers/suprslam.c index d38f6a1cfe1..e70a154998d 100644 --- a/src/mame/drivers/suprslam.c +++ b/src/mame/drivers/suprslam.c @@ -300,8 +300,8 @@ static MACHINE_START( suprslam ) { suprslam_state *state = (suprslam_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053936 = devtag_get_device(machine, "k053936"); + state->audiocpu = machine->device("audiocpu"); + state->k053936 = machine->device("k053936"); state_save_register_global(machine, state->screen_bank); state_save_register_global(machine, state->bg_bank); diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c index 535851d5b44..e3758fe0110 100644 --- a/src/mame/drivers/surpratk.c +++ b/src/mame/drivers/surpratk.c @@ -209,10 +209,10 @@ static MACHINE_START( surpratk ) machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->k053244 = devtag_get_device(machine, "k053244"); - state->k053251 = devtag_get_device(machine, "k053251"); - state->k052109 = devtag_get_device(machine, "k052109"); + state->maincpu = machine->device("maincpu"); + state->k053244 = machine->device("k053244"); + state->k053251 = machine->device("k053251"); + state->k052109 = machine->device("k052109"); state_save_register_global(machine, state->videobank); state_save_register_global(machine, state->sprite_colorbase); @@ -226,7 +226,7 @@ static MACHINE_RESET( surpratk ) surpratk_state *state = (surpratk_state *)machine->driver_data; int i; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), surpratk_banking); + konami_configure_set_lines(machine->device("maincpu"), surpratk_banking); for (i = 0; i < 3; i++) { diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c index 74983cea8f6..684673ab50c 100644 --- a/src/mame/drivers/system1.c +++ b/src/mame/drivers/system1.c @@ -363,7 +363,7 @@ static MACHINE_START( system1 ) memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, "maincpu") + 0x8000, 0); memory_set_bank(machine, "bank1", 0); - z80_set_cycle_tables(devtag_get_device(machine, "maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex); + z80_set_cycle_tables(machine->device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex); mute_xor = 0x00; @@ -410,7 +410,7 @@ static void bank0c_custom_w(running_machine *machine, UINT8 data, UINT8 prevdata static WRITE8_HANDLER( videomode_w ) { - running_device *i8751 = devtag_get_device(space->machine, "mcu"); + running_device *i8751 = space->machine->device("mcu"); /* bit 6 is connected to the 8751 IRQ */ if (i8751 != NULL) @@ -608,7 +608,7 @@ static TIMER_DEVICE_CALLBACK( mcu_t0_callback ) enough, the MCU will fail; on shtngmst this happens after 3 VBLANKs without a tick */ - running_device *mcu = devtag_get_device(timer.machine, "mcu"); + running_device *mcu = timer.machine->device("mcu"); cpu_set_input_line(mcu, MCS51_T0_LINE, ASSERT_LINE); cpu_set_input_line(mcu, MCS51_T0_LINE, CLEAR_LINE); } diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c index 4349c4abfe2..5addcc83312 100644 --- a/src/mame/drivers/system16.c +++ b/src/mame/drivers/system16.c @@ -3312,8 +3312,8 @@ static DRIVER_INIT( common ) state->beautyb_unkx = 0; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->soundcpu = devtag_get_device(machine, "soundcpu"); + state->maincpu = machine->device("maincpu"); + state->soundcpu = machine->device("soundcpu"); } /* Sys16A */ diff --git a/src/mame/drivers/tail2nos.c b/src/mame/drivers/tail2nos.c index 434cdd625e3..22070f588ed 100644 --- a/src/mame/drivers/tail2nos.c +++ b/src/mame/drivers/tail2nos.c @@ -214,9 +214,9 @@ static MACHINE_START( tail2nos ) memory_configure_bank(machine, "bank3", 0, 2, &ROM[0x10000], 0x8000); memory_set_bank(machine, "bank3", 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k051316 = devtag_get_device(machine, "k051316"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k051316 = machine->device("k051316"); state_save_register_global(machine, state->charbank); state_save_register_global(machine, state->charpalette); diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c index 1807200ce3a..ff5c4cfcf6d 100644 --- a/src/mame/drivers/taito_b.c +++ b/src/mame/drivers/taito_b.c @@ -2194,13 +2194,13 @@ static MACHINE_START( taitob ) { taitob_state *state = (taitob_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mb87078 = devtag_get_device(machine, "mb87078"); - state->ym = devtag_get_device(machine, "ymsnd"); - state->tc0180vcu = devtag_get_device(machine, "tc0180vcu"); - state->tc0640fio = devtag_get_device(machine, "tc0640fio"); - state->tc0220ioc = devtag_get_device(machine, "tc0220ioc"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->mb87078 = machine->device("mb87078"); + state->ym = machine->device("ymsnd"); + state->tc0180vcu = machine->device("tc0180vcu"); + state->tc0640fio = machine->device("tc0640fio"); + state->tc0220ioc = machine->device("tc0220ioc"); state_save_register_global(machine, state->eep_latch); state_save_register_global(machine, state->coin_word); diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c index 3d01a97c4b1..0667f6587db 100644 --- a/src/mame/drivers/taito_f2.c +++ b/src/mame/drivers/taito_f2.c @@ -3379,15 +3379,15 @@ static MACHINE_START( common ) { taitof2_state *state = (taitof2_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu");; - state->tc0100scn = devtag_get_device(machine, "tc0100scn");; - state->tc0100scn_1 = devtag_get_device(machine, "tc0100scn_1");; - state->tc0100scn_2 = devtag_get_device(machine, "tc0100scn_2");; - state->tc0360pri = devtag_get_device(machine, "tc0360pri");; - state->tc0280grd = devtag_get_device(machine, "tc0280grd");; - state->tc0430grw = devtag_get_device(machine, "tc0430grw");; - state->tc0480scp = devtag_get_device(machine, "tc0480scp");; + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu");; + state->tc0100scn = machine->device("tc0100scn");; + state->tc0100scn_1 = machine->device("tc0100scn_1");; + state->tc0100scn_2 = machine->device("tc0100scn_2");; + state->tc0360pri = machine->device("tc0360pri");; + state->tc0280grd = machine->device("tc0280grd");; + state->tc0430grw = machine->device("tc0430grw");; + state->tc0480scp = machine->device("tc0480scp");; } static MACHINE_START( f2 ) diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c index 046f9caedbb..f45ba0b6c28 100644 --- a/src/mame/drivers/taito_f3.c +++ b/src/mame/drivers/taito_f3.c @@ -3673,7 +3673,7 @@ static WRITE32_DEVICE_HANDLER( bubsympb_oki_w ) static DRIVER_INIT( bubsympb ) { - running_device *oki = devtag_get_device(machine, "oki"); + running_device *oki = machine->device("oki"); f3_game=BUBSYMPH; //tile_decode(machine); diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c index d48d1b31aa5..59fc2ff9972 100644 --- a/src/mame/drivers/taito_h.c +++ b/src/mame/drivers/taito_h.c @@ -529,9 +529,9 @@ static MACHINE_START( taitoh ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->tc0220ioc = devtag_get_device(machine, "tc0220ioc"); - state->tc0080vco = devtag_get_device(machine, "tc0080vco"); + state->audiocpu = machine->device("audiocpu"); + state->tc0220ioc = machine->device("tc0220ioc"); + state->tc0080vco = machine->device("tc0080vco"); state_save_register_global(machine, state->banknum); state_save_register_postload(machine, taitoh_postload, NULL); diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c index 546c3869348..57f67a4c043 100644 --- a/src/mame/drivers/taito_l.c +++ b/src/mame/drivers/taito_l.c @@ -143,8 +143,8 @@ static MACHINE_START( taito_l ) { taitol_state *state = (taitol_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); state->rambanks = auto_alloc_array(machine, UINT8, 0x1000 * 12); state->palette_ram = auto_alloc_array(machine, UINT8, 0x1000); diff --git a/src/mame/drivers/taito_o.c b/src/mame/drivers/taito_o.c index e187b650e1a..770155da76f 100644 --- a/src/mame/drivers/taito_o.c +++ b/src/mame/drivers/taito_o.c @@ -242,8 +242,8 @@ static MACHINE_START( taitoo ) { taitoo_state *state = (taitoo_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->tc0080vco = devtag_get_device(machine, "tc0080vco"); + state->maincpu = machine->device("maincpu"); + state->tc0080vco = machine->device("tc0080vco"); } static MACHINE_DRIVER_START( parentj ) diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c index e84dfa55297..e504835ae09 100644 --- a/src/mame/drivers/taito_z.c +++ b/src/mame/drivers/taito_z.c @@ -1508,7 +1508,7 @@ static WRITE8_HANDLER( taitoz_pancontrol ) // state->pandata[offset] = data; // popmessage(" pan %02x %02x %02x %02x", state->pandata[0], state->pandata[1], state->pandata[2], state->pandata[3] ); - flt_volume_set_volume(devtag_get_device(space->machine, fltname[offset & 3]), data / 255.0f); + flt_volume_set_volume(space->machine->device(fltname[offset & 3]), data / 255.0f); } static WRITE16_HANDLER( spacegun_pancontrol ) @@ -2968,15 +2968,15 @@ static MACHINE_START( bshark ) { taitoz_state *state = (taitoz_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->eeprom = devtag_get_device(machine, "eeprom"); - state->tc0100scn = devtag_get_device(machine, "tc0100scn"); - state->tc0150rod = devtag_get_device(machine, "tc0150rod"); - state->tc0480scp = devtag_get_device(machine, "tc0480scp"); - state->tc0220ioc = devtag_get_device(machine, "tc0220ioc"); - state->tc0140syt = devtag_get_device(machine, "tc0140syt"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); + state->audiocpu = machine->device("audiocpu"); + state->eeprom = machine->device("eeprom"); + state->tc0100scn = machine->device("tc0100scn"); + state->tc0150rod = machine->device("tc0150rod"); + state->tc0480scp = machine->device("tc0480scp"); + state->tc0220ioc = machine->device("tc0220ioc"); + state->tc0140syt = machine->device("tc0140syt"); state_save_register_global(machine, state->cpua_ctrl); diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c index 19eade771a8..d1f5b0a0692 100644 --- a/src/mame/drivers/taitoair.c +++ b/src/mame/drivers/taitoair.c @@ -616,9 +616,9 @@ static MACHINE_START( taitoair ) memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->dsp = devtag_get_device(machine, "dsp"); - state->tc0080vco = devtag_get_device(machine, "tc0080vco"); + state->audiocpu = machine->device("audiocpu"); + state->dsp = machine->device("dsp"); + state->tc0080vco = machine->device("tc0080vco"); state_save_register_global(machine, state->banknum); state_save_register_global(machine, state->q.col); diff --git a/src/mame/drivers/taitogn.c b/src/mame/drivers/taitogn.c index 63073f0d695..5288435ff58 100644 --- a/src/mame/drivers/taitogn.c +++ b/src/mame/drivers/taitogn.c @@ -347,7 +347,7 @@ static void rf5c296_reg_w(ATTR_UNUSED running_machine *machine, UINT8 reg, UINT8 { devtag_reset(machine, "card"); locked = 0x1ff; - ide_set_gnet_readlock (devtag_get_device(machine, "card"), 1); + ide_set_gnet_readlock (machine->device("card"), 1); } break; @@ -365,7 +365,7 @@ static UINT8 rf5c296_reg_r(ATTR_UNUSED running_machine *machine, UINT8 reg) static WRITE32_HANDLER(rf5c296_io_w) { if(offset < 2) { - ide_controller32_pcmcia_w(devtag_get_device(space->machine, "card"), offset, data, mem_mask); + ide_controller32_pcmcia_w(space->machine->device("card"), offset, data, mem_mask); return; } @@ -380,7 +380,7 @@ static WRITE32_HANDLER(rf5c296_io_w) static READ32_HANDLER(rf5c296_io_r) { if(offset < 2) - return ide_controller32_pcmcia_r(devtag_get_device(space->machine, "card"), offset, mem_mask); + return ide_controller32_pcmcia_r(space->machine->device("card"), offset, mem_mask); offset *= 4; @@ -430,7 +430,7 @@ static WRITE32_HANDLER(rf5c296_mem_w) else locked |= 1 << pos; if (!locked) { - ide_set_gnet_readlock (devtag_get_device(space->machine, "card"), 0); + ide_set_gnet_readlock (space->machine->device("card"), 0); } } } @@ -548,7 +548,7 @@ static WRITE32_HANDLER(control_w) // selection too, but they're always 0. UINT32 p = control; - running_device *mb3773 = devtag_get_device(space->machine, "mb3773"); + running_device *mb3773 = space->machine->device("mb3773"); COMBINE_DATA(&control); @@ -852,7 +852,7 @@ static MACHINE_RESET( coh3002t ) control = 0; psx_machine_init(machine); devtag_reset(machine, "card"); - ide_set_gnet_readlock(devtag_get_device(machine, "card"), 1); + ide_set_gnet_readlock(machine->device("card"), 1); // halt sound CPU since it has no valid program at start cputag_set_input_line(machine, "mn10200",INPUT_LINE_RESET,ASSERT_LINE); /* MCU */ diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index 322084f144f..e1090c89745 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -535,13 +535,13 @@ static IRQ_CALLBACK(irq_callback) static MACHINE_START(taitowlf) { - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), irq_callback); - taitowlf_devices.pit8254 = devtag_get_device( machine, "pit8254" ); - taitowlf_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" ); - taitowlf_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" ); - taitowlf_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" ); - taitowlf_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" ); + taitowlf_devices.pit8254 = machine->device( "pit8254" ); + taitowlf_devices.pic8259_1 = machine->device( "pic8259_1" ); + taitowlf_devices.pic8259_2 = machine->device( "pic8259_2" ); + taitowlf_devices.dma8237_1 = machine->device( "dma8237_1" ); + taitowlf_devices.dma8237_2 = machine->device( "dma8237_2" ); } static MACHINE_RESET(taitowlf) diff --git a/src/mame/drivers/tankbatt.c b/src/mame/drivers/tankbatt.c index dcaa90835c4..6d10ddacadb 100644 --- a/src/mame/drivers/tankbatt.c +++ b/src/mame/drivers/tankbatt.c @@ -107,7 +107,7 @@ static WRITE8_HANDLER( tankbatt_interrupt_enable_w ) tankbatt_sound_enable = !data; /* hack - turn off the engine noise if the normal game nmi's are disabled */ - if (data) sample_stop (devtag_get_device(space->machine, "samples"), 2); + if (data) sample_stop (space->machine->device("samples"), 2); // interrupt_enable_w (offset, !data); } @@ -121,14 +121,14 @@ static WRITE8_HANDLER( tankbatt_sh_expl_w ) { if (tankbatt_sound_enable) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); sample_start (samples, 1, 3, 0); } } static WRITE8_HANDLER( tankbatt_sh_engine_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); if (tankbatt_sound_enable) { if (data) @@ -143,7 +143,7 @@ static WRITE8_HANDLER( tankbatt_sh_fire_w ) { if (tankbatt_sound_enable) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); sample_start (samples, 0, 0, 0); } } diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c index bb7279c39d5..156fd40f6ed 100644 --- a/src/mame/drivers/tatsumi.c +++ b/src/mame/drivers/tatsumi.c @@ -851,7 +851,7 @@ static MACHINE_RESET( apache3 ) cputag_set_input_line(machine, "sub2", INPUT_LINE_RESET, ASSERT_LINE); // TODO /* Hook the RESET line, which resets the Z80 */ - m68k_set_reset_callback(devtag_get_device(machine, "sub"), apache3_68000_reset); + m68k_set_reset_callback(machine->device("sub"), apache3_68000_reset); } diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c index 539b8674d94..3b21876c511 100644 --- a/src/mame/drivers/tbowl.c +++ b/src/mame/drivers/tbowl.c @@ -163,7 +163,7 @@ ADDRESS_MAP_END static WRITE8_HANDLER( tbowl_adpcm_start_w ) { - running_device *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1"); + running_device *adpcm = space->machine->device((offset & 1) ? "msm2" : "msm1"); adpcm_pos[offset & 1] = data << 8; msm5205_reset_w(adpcm,0); } @@ -175,7 +175,7 @@ static WRITE8_HANDLER( tbowl_adpcm_end_w ) static WRITE8_HANDLER( tbowl_adpcm_vol_w ) { - running_device *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1"); + running_device *adpcm = space->machine->device((offset & 1) ? "msm2" : "msm1"); msm5205_set_volume(adpcm, (data & 0x7f) * 100 / 0x7f); } diff --git a/src/mame/drivers/thayers.c b/src/mame/drivers/thayers.c index 91b707eaca9..a6c2b4f79ee 100644 --- a/src/mame/drivers/thayers.c +++ b/src/mame/drivers/thayers.c @@ -715,7 +715,7 @@ INPUT_PORTS_END static MACHINE_START( thayers ) { - laserdisc = devtag_get_device(machine, "laserdisc"); + laserdisc = machine->device("laserdisc"); memset(&ssi263, 0, sizeof(ssi263)); } diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c index 5fc31a360da..59e59560042 100644 --- a/src/mame/drivers/thunderx.c +++ b/src/mame/drivers/thunderx.c @@ -631,11 +631,11 @@ static MACHINE_START( scontra ) machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007232 = devtag_get_device(machine, "k007232"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k007232 = machine->device("k007232"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); state_save_register_global(machine, state->priority); state_save_register_global(machine, state->_1f98_data); @@ -674,7 +674,7 @@ static MACHINE_RESET( scontra ) static MACHINE_RESET( thunderx ) { - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), thunderx_banking); + konami_configure_set_lines(machine->device("maincpu"), thunderx_banking); MACHINE_RESET_CALL(scontra); } diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c index 6d3b0f1fe84..6ec21152cc1 100644 --- a/src/mame/drivers/tickee.c +++ b/src/mame/drivers/tickee.c @@ -262,8 +262,8 @@ static WRITE16_HANDLER( tickee_control_w ) if (offset == 3) { - ticket_dispenser_w(devtag_get_device(space->machine, "ticket1"), 0, (data & 8) << 4); - ticket_dispenser_w(devtag_get_device(space->machine, "ticket2"), 0, (data & 4) << 5); + ticket_dispenser_w(space->machine->device("ticket1"), 0, (data & 8) << 4); + ticket_dispenser_w(space->machine->device("ticket2"), 0, (data & 4) << 5); } if (olddata != tickee_control[offset]) diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c index b23682f53cc..7641b29d447 100644 --- a/src/mame/drivers/tmaster.c +++ b/src/mame/drivers/tmaster.c @@ -545,7 +545,7 @@ static const char *const galgames_eeprom_names[5] = { GALGAMES_EEPROM_BIOS, GALG static READ16_HANDLER( galgames_eeprom_r ) { - running_device *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]); + running_device *eeprom = space->machine->device(galgames_eeprom_names[galgames_cart]); return eeprom_read_bit(eeprom) ? 0x80 : 0x00; } @@ -557,7 +557,7 @@ static WRITE16_HANDLER( galgames_eeprom_w ) if ( ACCESSING_BITS_0_7 ) { - running_device *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]); + running_device *eeprom = space->machine->device(galgames_eeprom_names[galgames_cart]); // latch the bit eeprom_write_bit(eeprom, data & 0x0001); @@ -633,7 +633,7 @@ static WRITE16_HANDLER( galgames_cart_sel_w ) { case 0x07: // 7 resets the eeprom for (i = 0; i < 5; i++) - eeprom_set_cs_line(devtag_get_device(space->machine, galgames_eeprom_names[i]), ASSERT_LINE); + eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[i]), ASSERT_LINE); break; case 0x00: @@ -641,12 +641,12 @@ static WRITE16_HANDLER( galgames_cart_sel_w ) case 0x02: case 0x03: case 0x04: - eeprom_set_cs_line(devtag_get_device(space->machine, galgames_eeprom_names[data & 0xff]), CLEAR_LINE); + eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[data & 0xff]), CLEAR_LINE); galgames_update_rombank(space->machine, data & 0xff); break; default: - eeprom_set_cs_line(devtag_get_device(space->machine, galgames_eeprom_names[0]), CLEAR_LINE); + eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[0]), CLEAR_LINE); galgames_update_rombank(space->machine, 0); logerror("%06x: unknown cart sel = %04x\n", cpu_get_pc(space->cpu), data); break; @@ -848,7 +848,7 @@ static MACHINE_RESET( tmaster ) tmaster_gfx_offs = 0; tmaster_gfx_size = memory_region_length(machine, "blitter"); - tmaster_devices.duart68681 = devtag_get_device( machine, "duart68681" ); + tmaster_devices.duart68681 = machine->device( "duart68681" ); } static INTERRUPT_GEN( tm3k_interrupt ) diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c index 8c877cd7835..8211e8f33e5 100644 --- a/src/mame/drivers/tmmjprd.c +++ b/src/mame/drivers/tmmjprd.c @@ -265,8 +265,8 @@ static void ttmjprd_draw_tilemap(running_machine *machine, bitmap_t *bitmap, con static VIDEO_UPDATE( tmmjprd ) { UINT8* gfxroms = memory_region(screen->machine,"gfx2"); - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *right_screen = screen->machine->device("rscreen"); bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c index 8e8c327fa5c..bb8e5b987f6 100644 --- a/src/mame/drivers/tmnt.c +++ b/src/mame/drivers/tmnt.c @@ -2237,19 +2237,19 @@ static MACHINE_START( common ) { tmnt_state *state = (tmnt_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k007232 = devtag_get_device(machine, "k007232"); - state->k053260 = devtag_get_device(machine, "k053260"); - state->k054539 = devtag_get_device(machine, "k054539"); - state->upd = devtag_get_device(machine, "upd"); - state->samples = devtag_get_device(machine, "samples"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k053245 = devtag_get_device(machine, "k053245"); - state->k053251 = devtag_get_device(machine, "k053251"); - state->k053936 = devtag_get_device(machine, "k053936"); - state->k054000 = devtag_get_device(machine, "k054000"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k007232 = machine->device("k007232"); + state->k053260 = machine->device("k053260"); + state->k054539 = machine->device("k054539"); + state->upd = machine->device("upd"); + state->samples = machine->device("samples"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); + state->k053245 = machine->device("k053245"); + state->k053251 = machine->device("k053251"); + state->k053936 = machine->device("k053936"); + state->k054000 = machine->device("k054000"); state_save_register_global(machine, state->toggle); state_save_register_global(machine, state->last); diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index 8b297d7af6e..83abb7a6870 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -319,7 +319,7 @@ static MACHINE_RESET( toaplan2 ) This is important for games with common RAM; the RAM test will fail when leaving service mode if the sound CPU is not reset. */ - m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), toaplan2_reset); + m68k_set_reset_callback(machine->device("maincpu"), toaplan2_reset); } static MACHINE_RESET( ghox ) @@ -366,24 +366,24 @@ static void register_state_save(running_machine *machine) static DRIVER_INIT( T2_Z80 ) /* init_t2_Z80(); */ { toaplan2_sub_cpu = CPU_2_Z80; - sub_cpu = devtag_get_device(machine, "audiocpu"); + sub_cpu = machine->device("audiocpu"); register_state_save(machine); } static DRIVER_INIT( T2_Z180 ) { toaplan2_sub_cpu = CPU_2_HD647180; - sub_cpu = devtag_get_device(machine, "mcu"); + sub_cpu = machine->device("mcu"); register_state_save(machine); } static DRIVER_INIT( T2_V25 ) { toaplan2_sub_cpu = CPU_2_V25; - if (devtag_get_device(machine, "mcu") != NULL) - sub_cpu = devtag_get_device(machine, "mcu"); - else if (devtag_get_device(machine, "audiocpu") != NULL) - sub_cpu = devtag_get_device(machine, "audiocpu"); + if (machine->device("mcu") != NULL) + sub_cpu = machine->device("mcu"); + else if (machine->device("audiocpu") != NULL) + sub_cpu = machine->device("audiocpu"); register_state_save(machine); } @@ -395,7 +395,7 @@ static DRIVER_INIT( T2_noZ80 ) static DRIVER_INIT( fixeight ) { - sub_cpu = devtag_get_device(machine, "audiocpu"); + sub_cpu = machine->device("audiocpu"); if (fixeight_sec_cpu_mem) { @@ -494,7 +494,7 @@ static DRIVER_INIT( pipibibi ) } toaplan2_sub_cpu = CPU_2_Z80; - sub_cpu = devtag_get_device(machine, "audiocpu"); + sub_cpu = machine->device("audiocpu"); register_state_save(machine); } @@ -502,7 +502,7 @@ static DRIVER_INIT( batrider ) { raizing_sndirq_line = 4; toaplan2_sub_cpu = CPU_2_Z80; - sub_cpu = devtag_get_device(machine, "audiocpu"); + sub_cpu = machine->device("audiocpu"); register_state_save(machine); } @@ -511,7 +511,7 @@ static DRIVER_INIT( bbakraid ) bbakraid_unlimited_ver = 0; raizing_sndirq_line = 2; toaplan2_sub_cpu = CPU_2_Z80; - sub_cpu = devtag_get_device(machine, "audiocpu"); + sub_cpu = machine->device("audiocpu"); register_state_save(machine); } @@ -520,7 +520,7 @@ static DRIVER_INIT( bbakradu ) bbakraid_unlimited_ver = 1; raizing_sndirq_line = 2; toaplan2_sub_cpu = CPU_2_Z80; - sub_cpu = devtag_get_device(machine, "audiocpu"); + sub_cpu = machine->device("audiocpu"); register_state_save(machine); } @@ -876,7 +876,7 @@ static WRITE16_HANDLER( dogyuun_snd_cpu_w ) if (ACCESSING_BITS_0_7) { mcu_data = data; - dogyuun_okisnd_w(devtag_get_device(space->machine, "oki"), data); + dogyuun_okisnd_w(space->machine->device("oki"), data); } logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",cpu_get_previouspc(space->cpu),mcu_data); } @@ -914,7 +914,7 @@ static WRITE16_HANDLER( fixeight_sec_cpu_w ) if (mcu_data & 0xff00) { mcu_data = (mcu_data & 0xff00) | (data & 0xff); - fixeight_okisnd_w(devtag_get_device(space->machine, "oki"), data); + fixeight_okisnd_w(space->machine->device("oki"), data); } else if (mcu_data == 0xff00) { @@ -957,7 +957,7 @@ static WRITE16_HANDLER( batsugun_snd_cpu_w ) if (ACCESSING_BITS_0_7) { mcu_data = data; - batsugun_okisnd_w(devtag_get_device(space->machine, "oki"), data); + batsugun_okisnd_w(space->machine->device("oki"), data); } logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port %02x\n",cpu_get_previouspc(space->cpu),mcu_data,(offset*2)); } @@ -990,7 +990,7 @@ static WRITE16_HANDLER( kbash_snd_cpu_w ) { if (ACCESSING_BITS_0_7) { - kbash_okisnd_w(devtag_get_device(space->machine, "oki"), data); + kbash_okisnd_w(space->machine->device("oki"), data); } logerror("PC:%06x Writing Sound command (%04x) to the NEC V25+ secondary CPU\n",cpu_get_previouspc(space->cpu),data); } diff --git a/src/mame/drivers/tomcat.c b/src/mame/drivers/tomcat.c index 7cc227f59a7..7c39b69be00 100644 --- a/src/mame/drivers/tomcat.c +++ b/src/mame/drivers/tomcat.c @@ -143,7 +143,7 @@ static WRITE16_HANDLER(tomcat_mresl_w) { // 320 Reset Low (Address Strobe) // Reset TMS320 - cpu_set_input_line(devtag_get_device(space->machine, "dsp"), INPUT_LINE_RESET, ASSERT_LINE); + cpu_set_input_line(space->machine->device("dsp"), INPUT_LINE_RESET, ASSERT_LINE); } static WRITE16_HANDLER(tomcat_mresh_w) @@ -151,7 +151,7 @@ static WRITE16_HANDLER(tomcat_mresh_w) // 320 Reset high (Address Strobe) // Release reset of TMS320 dsp_BIO = 0; - cpu_set_input_line(devtag_get_device(space->machine, "dsp"), INPUT_LINE_RESET, CLEAR_LINE); + cpu_set_input_line(space->machine->device("dsp"), INPUT_LINE_RESET, CLEAR_LINE); } static WRITE16_HANDLER(tomcat_irqclr_w) diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c index ca5506b652e..de80a21ad08 100644 --- a/src/mame/drivers/topspeed.c +++ b/src/mame/drivers/topspeed.c @@ -652,12 +652,12 @@ static MACHINE_START( topspeed ) memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->tc0220ioc = devtag_get_device(machine, "tc0220ioc"); - state->pc080sn_1 = devtag_get_device(machine, "pc080sn_1"); - state->pc080sn_2 = devtag_get_device(machine, "pc080sn_2"); + state->maincpu = machine->device("maincpu"); + state->subcpu = machine->device("sub"); + state->audiocpu = machine->device("audiocpu"); + state->tc0220ioc = machine->device("tc0220ioc"); + state->pc080sn_1 = machine->device("pc080sn_1"); + state->pc080sn_2 = machine->device("pc080sn_2"); state_save_register_global(machine, state->cpua_ctrl); state_save_register_global(machine, state->ioc220_port); diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c index 14ffbf5a578..8f9f310402c 100644 --- a/src/mame/drivers/toratora.c +++ b/src/mame/drivers/toratora.c @@ -376,10 +376,10 @@ static MACHINE_START( toratora ) { toratora_state *state = (toratora_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->pia_u1 = devtag_get_device(machine, "pia_u1"); - state->pia_u2 = devtag_get_device(machine, "pia_u2"); - state->pia_u3 = devtag_get_device(machine, "pia_u3"); + state->maincpu = machine->device("maincpu"); + state->pia_u1 = machine->device("pia_u1"); + state->pia_u2 = machine->device("pia_u2"); + state->pia_u3 = machine->device("pia_u3"); state_save_register_global(machine, state->timer); state_save_register_global(machine, state->last); diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c index 97c1558985a..824ab9b6b20 100644 --- a/src/mame/drivers/toypop.c +++ b/src/mame/drivers/toypop.c @@ -67,37 +67,37 @@ static WRITE16_HANDLER( toypop_m68000_sharedram_w ) static READ8_HANDLER( toypop_main_interrupt_enable_r ) { - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), 1); + cpu_interrupt_enable(space->machine->device("maincpu"), 1); return 0; } static WRITE8_HANDLER( toypop_main_interrupt_enable_w ) { - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), 1); + cpu_interrupt_enable(space->machine->device("maincpu"), 1); cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } static WRITE8_HANDLER( toypop_main_interrupt_disable_w ) { - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), 0); + cpu_interrupt_enable(space->machine->device("maincpu"), 0); } static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w ) { - cpu_interrupt_enable(devtag_get_device(space->machine, "audiocpu"), 1); + cpu_interrupt_enable(space->machine->device("audiocpu"), 1); cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE); } static WRITE8_HANDLER( toypop_sound_interrupt_disable_w ) { - cpu_interrupt_enable(devtag_get_device(space->machine, "audiocpu"), 0); + cpu_interrupt_enable(space->machine->device("audiocpu"), 0); } static TIMER_CALLBACK( namcoio_run ) { - running_device *io58xx = devtag_get_device(machine, "58xx"); - running_device *io56xx_1 = devtag_get_device(machine, "56xx_1"); - running_device *io56xx_2 = devtag_get_device(machine, "56xx_2"); + running_device *io58xx = machine->device("58xx"); + running_device *io56xx_1 = machine->device("56xx_1"); + running_device *io56xx_2 = machine->device("56xx_2"); switch (param) { @@ -115,9 +115,9 @@ static TIMER_CALLBACK( namcoio_run ) static INTERRUPT_GEN( toypop_main_interrupt ) { - running_device *namcoio_0 = devtag_get_device(device->machine, "58xx"); - running_device *namcoio_1 = devtag_get_device(device->machine, "56xx_1"); - running_device *namcoio_2 = devtag_get_device(device->machine, "56xx_2"); + running_device *namcoio_0 = device->machine->device("58xx"); + running_device *namcoio_1 = device->machine->device("56xx_1"); + running_device *namcoio_2 = device->machine->device("56xx_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -156,9 +156,9 @@ static WRITE8_HANDLER( toypop_m68000_assert_w ) static TIMER_CALLBACK( disable_interrupts ) { toypop_state *state = (toypop_state *)machine->driver_data; - cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0); + cpu_interrupt_enable(machine->device("maincpu"), 0); cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); - cpu_interrupt_enable(devtag_get_device(machine, "audiocpu"), 0); + cpu_interrupt_enable(machine->device("audiocpu"), 0); cputag_set_input_line(machine, "audiocpu", 0, CLEAR_LINE); state->interrupt_enable_68k = 0; } diff --git a/src/mame/drivers/tp84.c b/src/mame/drivers/tp84.c index f3402ad58fc..538f0f55d32 100644 --- a/src/mame/drivers/tp84.c +++ b/src/mame/drivers/tp84.c @@ -116,23 +116,23 @@ static WRITE8_HANDLER( tp84_filter_w ) C = 0; if (offset & 0x008) C += 47000; /* 47000pF = 0.047uF */ if (offset & 0x010) C += 470000; /* 470000pF = 0.47uF */ - filter_rc_set_RC(devtag_get_device(space->machine, "filter1"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C)); + filter_rc_set_RC(space->machine->device("filter1"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C)); /* 76489 #1 (optional) */ C = 0; if (offset & 0x020) C += 47000; /* 47000pF = 0.047uF */ if (offset & 0x040) C += 470000; /* 470000pF = 0.47uF */ -// filter_rc_set_RC(devtag_get_device(space->machine, "filter2"),1000,2200,1000,C); +// filter_rc_set_RC(space->machine->device("filter2"),1000,2200,1000,C); /* 76489 #2 */ C = 0; if (offset & 0x080) C += 470000; /* 470000pF = 0.47uF */ - filter_rc_set_RC(devtag_get_device(space->machine, "filter2"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C)); + filter_rc_set_RC(space->machine->device("filter2"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C)); /* 76489 #3 */ C = 0; if (offset & 0x100) C += 470000; /* 470000pF = 0.47uF */ - filter_rc_set_RC(devtag_get_device(space->machine, "filter3"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C)); + filter_rc_set_RC(space->machine->device("filter3"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C)); } static WRITE8_HANDLER( tp84_sh_irqtrigger_w ) diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c index 4790172184d..d7feb72d42b 100644 --- a/src/mame/drivers/trackfld.c +++ b/src/mame/drivers/trackfld.c @@ -858,7 +858,7 @@ static MACHINE_START( trackfld ) trackfld_state *state = (trackfld_state *)machine->driver_data; state->audiocpu = machine->device("audiocpu"); - state->vlm = devtag_get_device(machine, "vlm"); + state->vlm = machine->device("vlm"); /* video */ state_save_register_global(machine, state->bg_bank); diff --git a/src/mame/drivers/triplhnt.c b/src/mame/drivers/triplhnt.c index 9003936d313..79f44fd3176 100644 --- a/src/mame/drivers/triplhnt.c +++ b/src/mame/drivers/triplhnt.c @@ -38,8 +38,8 @@ void triplhnt_set_collision(running_machine *machine, int code) static void triplhnt_update_misc(running_machine *machine, int offset) { - running_device *samples = devtag_get_device(machine, "samples"); - running_device *discrete = devtag_get_device(machine, "discrete"); + running_device *samples = machine->device("samples"); + running_device *discrete = machine->device("discrete"); UINT8 is_witch_hunt; UINT8 bit = offset >> 1; diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c index 3ec48032410..33804547113 100644 --- a/src/mame/drivers/trvquest.c +++ b/src/mame/drivers/trvquest.c @@ -186,10 +186,10 @@ static MACHINE_START( trvquest ) { gameplan_state *state = (gameplan_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->via_0 = devtag_get_device(machine, "via6522_0"); - state->via_1 = devtag_get_device(machine, "via6522_1"); - state->via_2 = devtag_get_device(machine, "via6522_2"); + state->maincpu = machine->device("maincpu"); + state->via_0 = machine->device("via6522_0"); + state->via_1 = machine->device("via6522_1"); + state->via_2 = machine->device("via6522_2"); /* register for save states */ state_save_register_global(machine, state->video_x); diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c index 4d92dbb075c..3ebeef9d7c9 100644 --- a/src/mame/drivers/tumbleb.c +++ b/src/mame/drivers/tumbleb.c @@ -1987,9 +1987,9 @@ static MACHINE_START( tumbleb ) { tumbleb_state *state = (tumbleb_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->oki = devtag_get_device(machine, "oki"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->oki = machine->device("oki"); state_save_register_global(machine, state->music_command); state_save_register_global(machine, state->music_bank); @@ -3348,7 +3348,7 @@ static DRIVER_INIT( tumblepb ) static DRIVER_INIT( tumbleb2 ) { - running_device *oki = devtag_get_device(machine, "oki"); + running_device *oki = machine->device("oki"); tumblepb_gfx1_rearrange(machine); diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c index 016e756b300..830ed523c82 100644 --- a/src/mame/drivers/tumblep.c +++ b/src/mame/drivers/tumblep.c @@ -297,9 +297,9 @@ static MACHINE_START( tumblep ) { tumblep_state *state = (tumblep_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->deco16ic = machine->device("deco_custom"); } static MACHINE_DRIVER_START( tumblep ) diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c index f90d04d2dea..b41c14639d3 100644 --- a/src/mame/drivers/turbo.c +++ b/src/mame/drivers/turbo.c @@ -680,7 +680,7 @@ static READ8_HANDLER( buckrog_cpu2_command_r ) { /* assert ACK */ turbo_state *state = (turbo_state *)space->machine->driver_data; - ppi8255_set_port_c(devtag_get_device(space->machine, "ppi8255_0"), 0x00); + ppi8255_set_port_c(space->machine->device("ppi8255_0"), 0x00); return state->buckrog_command; } @@ -719,7 +719,7 @@ static READ8_HANDLER( buckrog_port_3_r ) static TIMER_CALLBACK( delayed_ppi8255_w ) { - ppi8255_w(devtag_get_device(machine, "ppi8255_0"), param >> 8, param & 0xff); + ppi8255_w(machine->device("ppi8255_0"), param >> 8, param & 0xff); } diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c index d53e902bffb..d1dca5c04e3 100644 --- a/src/mame/drivers/twinkle.c +++ b/src/mame/drivers/twinkle.c @@ -875,7 +875,7 @@ static DRIVER_INIT( twinkle ) psx_dma_install_read_handler(5, scsi_dma_read); psx_dma_install_write_handler(5, scsi_dma_write); - running_device *i2cmem = devtag_get_device(machine, "security"); + running_device *i2cmem = machine->device("security"); i2cmem_e0_write( i2cmem, 0 ); i2cmem_e1_write( i2cmem, 0 ); i2cmem_e2_write( i2cmem, 0 ); @@ -887,7 +887,7 @@ static MACHINE_RESET( twinkle ) psx_machine_init(machine); /* also hook up CDDA audio to the CD-ROM drive */ - cdda_set_cdrom(devtag_get_device(machine, "cdda"), am53cf96_get_device(SCSI_ID_4)); + cdda_set_cdrom(machine->device("cdda"), am53cf96_get_device(SCSI_ID_4)); } static void spu_irq(running_device *device, UINT32 data) diff --git a/src/mame/drivers/ultraman.c b/src/mame/drivers/ultraman.c index c2eb7b35680..c2bd7d76632 100644 --- a/src/mame/drivers/ultraman.c +++ b/src/mame/drivers/ultraman.c @@ -195,12 +195,12 @@ static MACHINE_START( ultraman ) { ultraman_state *state = (ultraman_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k051316_1 = devtag_get_device(machine, "k051316_1"); - state->k051316_2 = devtag_get_device(machine, "k051316_2"); - state->k051316_3 = devtag_get_device(machine, "k051316_3"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k051960 = machine->device("k051960"); + state->k051316_1 = machine->device("k051316_1"); + state->k051316_2 = machine->device("k051316_2"); + state->k051316_3 = machine->device("k051316_3"); state_save_register_global(machine, state->bank0); state_save_register_global(machine, state->bank1); diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c index 48f70e271cd..d03e256c17f 100644 --- a/src/mame/drivers/ultrsprt.c +++ b/src/mame/drivers/ultrsprt.c @@ -83,11 +83,11 @@ static WRITE32_HANDLER( int_ack_w ) static MACHINE_START( ultrsprt ) { /* set conservative DRC options */ - ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS); + ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x80000000, 0x8007ffff, FALSE, vram); - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0xff000000, 0xff01ffff, FALSE, workram); + ppcdrc_add_fastram(machine->device("maincpu"), 0x80000000, 0x8007ffff, FALSE, vram); + ppcdrc_add_fastram(machine->device("maincpu"), 0xff000000, 0xff01ffff, FALSE, workram); } @@ -111,7 +111,7 @@ ADDRESS_MAP_END static READ16_HANDLER( K056800_68k_r ) { - running_device *k056800 = devtag_get_device(space->machine, "k056800"); + running_device *k056800 = space->machine->device("k056800"); UINT16 r = 0; if (ACCESSING_BITS_8_15) @@ -125,7 +125,7 @@ static READ16_HANDLER( K056800_68k_r ) static WRITE16_HANDLER( K056800_68k_w ) { - running_device *k056800 = devtag_get_device(space->machine, "k056800"); + running_device *k056800 = space->machine->device("k056800"); if (ACCESSING_BITS_8_15) k056800_sound_w(k056800, (offset*2)+0, (data >> 8) & 0xff, 0x00ff); @@ -190,7 +190,7 @@ static INTERRUPT_GEN( ultrsprt_vblank ) static void sound_irq_callback(running_machine *machine, int irq) { if (irq == 0) - /*generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), INPUT_LINE_IRQ5)*/; + /*generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ5)*/; else cputag_set_input_line(machine, "audiocpu", INPUT_LINE_IRQ6, HOLD_LINE); } diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c index 9142e3aa2cf..a97227fb3f0 100644 --- a/src/mame/drivers/undrfire.c +++ b/src/mame/drivers/undrfire.c @@ -297,7 +297,7 @@ static WRITE32_HANDLER( undrfire_input_w ) if (ACCESSING_BITS_0_7) { - running_device *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = space->machine->device("eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c index 7f6a34e0e5d..2a5401e21df 100644 --- a/src/mame/drivers/vaportra.c +++ b/src/mame/drivers/vaportra.c @@ -234,9 +234,9 @@ static MACHINE_START( vaportra ) { vaportra_state *state = (vaportra_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->deco16ic = devtag_get_device(machine, "deco_custom"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->deco16ic = machine->device("deco_custom"); state_save_register_global_array(machine, state->priority); } diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c index 6627ef8fb04..8a7bad942b8 100644 --- a/src/mame/drivers/vcombat.c +++ b/src/mame/drivers/vcombat.c @@ -103,7 +103,7 @@ static VIDEO_UPDATE( vcombat ) { int y; const rgb_t *const pens = tlc34076_get_pens(); - running_device *aux = devtag_get_device(screen->machine, "aux"); + running_device *aux = screen->machine->device("aux"); UINT16 *m68k_buf = m68k_framebuffer[(*framebuffer_ctrl & 0x20) ? 1 : 0]; UINT16 *i860_buf = i860_framebuffer[(screen == aux) ? 1 : 0][0]; @@ -217,26 +217,26 @@ static void wiggle_i860_common(running_device *device, UINT16 data) static WRITE16_HANDLER( wiggle_i860p0_pins_w ) { - wiggle_i860_common(devtag_get_device(space->machine, "vid_0"), data); + wiggle_i860_common(space->machine->device("vid_0"), data); } static WRITE16_HANDLER( wiggle_i860p1_pins_w ) { - wiggle_i860_common(devtag_get_device(space->machine, "vid_1"), data); + wiggle_i860_common(space->machine->device("vid_1"), data); } static READ16_HANDLER( main_irqiack_r ) { //fprintf(stderr, "M0: irq iack\n"); - cpu_set_input_line(devtag_get_device(space->machine, "maincpu"), M68K_IRQ_1, CLEAR_LINE); - //cpu_set_input_line(devtag_get_device(space->machine, "maincpu"), INPUT_LINE_RESET, CLEAR_LINE); + cpu_set_input_line(space->machine->device("maincpu"), M68K_IRQ_1, CLEAR_LINE); + //cpu_set_input_line(space->machine->device("maincpu"), INPUT_LINE_RESET, CLEAR_LINE); return 0; } static READ16_HANDLER( sound_resetmain_r ) { //fprintf(stderr, "M1: reset line to M0\n"); - //cpu_set_input_line(devtag_get_device(space->machine, "maincpu"), INPUT_LINE_RESET, PULSE_LINE); + //cpu_set_input_line(space->machine->device("maincpu"), INPUT_LINE_RESET, PULSE_LINE); return 0; } @@ -286,7 +286,7 @@ static WRITE64_HANDLER( v1_fb_w ) static WRITE16_HANDLER( crtc_w ) { - running_device *crtc = devtag_get_device(space->machine, "crtc"); + running_device *crtc = space->machine->device("crtc"); if (crtc == NULL) return; @@ -378,8 +378,8 @@ static MACHINE_RESET( vcombat ) /* Setup the Bt476 VGA RAMDAC palette chip */ tlc34076_reset(6); - i860_set_pin(devtag_get_device(machine, "vid_0"), DEC_PIN_BUS_HOLD, 1); - i860_set_pin(devtag_get_device(machine, "vid_1"), DEC_PIN_BUS_HOLD, 1); + i860_set_pin(machine->device("vid_0"), DEC_PIN_BUS_HOLD, 1); + i860_set_pin(machine->device("vid_1"), DEC_PIN_BUS_HOLD, 1); crtc_select = 0; } @@ -389,7 +389,7 @@ static MACHINE_RESET( shadfgtr ) /* Setup the Bt476 VGA RAMDAC palette chip */ tlc34076_reset(6); - i860_set_pin(devtag_get_device(machine, "vid_0"), DEC_PIN_BUS_HOLD, 1); + i860_set_pin(machine->device("vid_0"), DEC_PIN_BUS_HOLD, 1); crtc_select = 0; } @@ -530,7 +530,7 @@ INPUT_PORTS_END static WRITE_LINE_DEVICE_HANDLER(sound_update) { /* Seems reasonable */ - cpu_set_input_line(devtag_get_device(device->machine, "soundcpu"), M68K_IRQ_1, state ? ASSERT_LINE : CLEAR_LINE); + cpu_set_input_line(device->machine->device("soundcpu"), M68K_IRQ_1, state ? ASSERT_LINE : CLEAR_LINE); } static const mc6845_interface mc6845_intf = diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c index 1c852be54cb..027a49835e5 100644 --- a/src/mame/drivers/vegas.c +++ b/src/mame/drivers/vegas.c @@ -528,7 +528,7 @@ static VIDEO_UPDATE( vegas ) static MACHINE_START( vegas ) { - voodoo = devtag_get_device(machine, "voodoo"); + voodoo = machine->device("voodoo"); /* allocate timers for the NILE */ timer[0] = timer_alloc(machine, NULL, NULL); @@ -537,19 +537,19 @@ static MACHINE_START( vegas ) timer[3] = timer_alloc(machine, nile_timer_callback, NULL); /* identify our sound board */ - if (devtag_get_device(machine, "dsio") != NULL) + if (machine->device("dsio") != NULL) dcs_idma_cs = 6; - else if (devtag_get_device(machine, "denver") != NULL) + else if (machine->device("denver") != NULL) dcs_idma_cs = 7; else dcs_idma_cs = 0; /* set the fastest DRC options, but strict verification */ - mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC); + mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC); /* configure fast RAM regions for DRC */ - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, ramsize - 1, FALSE, rambase); - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); + mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, ramsize - 1, FALSE, rambase); + mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase); /* register for save states */ state_save_register_global(machine, nile_irq_state); @@ -577,7 +577,7 @@ static MACHINE_RESET( vegas ) memset(pci_3dfx_regs, 0, sizeof(pci_3dfx_regs)); /* reset the DCS system if we have one */ - if (devtag_get_device(machine, "dcs2") != NULL || devtag_get_device(machine, "dsio") != NULL || devtag_get_device(machine, "denver") != NULL) + if (machine->device("dcs2") != NULL || machine->device("dsio") != NULL || machine->device("denver") != NULL) { dcs_reset_w(1); dcs_reset_w(0); @@ -767,7 +767,7 @@ static WRITE32_HANDLER( pci_ide_w ) case 0x14: /* interrupt pending */ if (data & 4) - ide_interrupt(devtag_get_device(space->machine, "ide"), 0); + ide_interrupt(space->machine->device("ide"), 0); break; } if (LOG_PCI) @@ -1551,8 +1551,8 @@ INLINE void _add_dynamic_device_address(running_device *device, offs_t start, of static void remap_dynamic_addresses(running_machine *machine) { - running_device *ethernet = devtag_get_device(machine, "ethernet"); - running_device *ide = devtag_get_device(machine, "ide"); + running_device *ethernet = machine->device("ethernet"); + running_device *ide = machine->device("ide"); int voodoo_type = voodoo_get_type(voodoo); offs_t base; int addr; @@ -2491,10 +2491,10 @@ static DRIVER_INIT( gauntleg ) init_common(machine, MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80015430, 0x8CC38060, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80015464, 0x3C09801E, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800C8918, 0x8FA2004C, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800C8890, 0x8FA20024, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80015430, 0x8CC38060, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80015464, 0x3C09801E, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800C8918, 0x8FA2004C, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800C8890, 0x8FA20024, 250); /* confirmed */ } @@ -2504,10 +2504,10 @@ static DRIVER_INIT( gauntdl ) init_common(machine, MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800158B8, 0x8CC3CC40, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800158EC, 0x3C0C8022, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800D40C0, 0x8FA2004C, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800D4038, 0x8FA20024, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800158B8, 0x8CC3CC40, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800158EC, 0x3C0C8022, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800D40C0, 0x8FA2004C, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x800D4038, 0x8FA20024, 250); /* confirmed */ } @@ -2517,7 +2517,7 @@ static DRIVER_INIT( warfa ) init_common(machine, MIDWAY_IOASIC_MACE, 337/* others? */); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8009436C, 0x0C031663, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8009436C, 0x0C031663, 250); /* confirmed */ } @@ -2527,10 +2527,10 @@ static DRIVER_INIT( tenthdeg ) init_common(machine, MIDWAY_IOASIC_GAUNTDL, 330/* others? */); /* speedups */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80051CD8, 0x0C023C15, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8005E674, 0x3C028017, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8002DBCC, 0x8FA2002C, 250); /* confirmed */ - mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80015930, 0x8FC20244, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80051CD8, 0x0C023C15, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8005E674, 0x3C028017, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x8002DBCC, 0x8FA2002C, 250); /* confirmed */ + mips3drc_add_hotspot(machine->device("maincpu"), 0x80015930, 0x8FC20244, 250); /* confirmed */ } diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c index 5e66c757be4..9c900874b30 100644 --- a/src/mame/drivers/vendetta.c +++ b/src/mame/drivers/vendetta.c @@ -462,13 +462,13 @@ static MACHINE_START( vendetta ) machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053251 = devtag_get_device(machine, "k053251"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k054000 = devtag_get_device(machine, "k054000"); - state->k053260 = devtag_get_device(machine, "k053260"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053246 = machine->device("k053246"); + state->k053251 = machine->device("k053251"); + state->k052109 = machine->device("k052109"); + state->k054000 = machine->device("k054000"); + state->k053260 = machine->device("k053260"); state_save_register_global(machine, state->irq_enabled); state_save_register_global(machine, state->sprite_colorbase); @@ -482,7 +482,7 @@ static MACHINE_RESET( vendetta ) vendetta_state *state = (vendetta_state *)machine->driver_data; int i; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), vendetta_banking); + konami_configure_set_lines(machine->device("maincpu"), vendetta_banking); for (i = 0; i < 3; i++) { diff --git a/src/mame/drivers/videopin.c b/src/mame/drivers/videopin.c index 3b25a34b613..77c25d485a8 100644 --- a/src/mame/drivers/videopin.c +++ b/src/mame/drivers/videopin.c @@ -66,7 +66,7 @@ static TIMER_CALLBACK( interrupt_callback ) static MACHINE_RESET( videopin ) { - running_device *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = machine->device("discrete"); timer_set(machine, machine->primary_screen->time_until_pos(32), NULL, 32, interrupt_callback); diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c index bba16fbf501..3bd333099b4 100644 --- a/src/mame/drivers/viper.c +++ b/src/mame/drivers/viper.c @@ -49,7 +49,7 @@ DASM code snippets: static VIDEO_UPDATE(viper) { - running_device *device = devtag_get_device(screen->machine, "voodoo"); + running_device *device = screen->machine->device("voodoo"); return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } @@ -462,7 +462,7 @@ static UINT32 voodoo3_pci_r(running_device *busdevice, running_device *device, i } default: - fatalerror("voodoo3_pci_r: %08X at %08X", reg, cpu_get_pc(devtag_get_device(device->machine, "maincpu"))); + fatalerror("voodoo3_pci_r: %08X at %08X", reg, cpu_get_pc(device->machine->device("maincpu"))); } return 0; } @@ -530,7 +530,7 @@ static void voodoo3_pci_w(running_device *busdevice, running_device *device, int } default: - fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, cpu_get_pc(devtag_get_device(device->machine, "maincpu"))); + fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, cpu_get_pc(device->machine->device("maincpu"))); } } @@ -658,7 +658,7 @@ static DRIVER_INIT(viper) static DRIVER_INIT(vipercf) { - running_device *ide = devtag_get_device(machine, "ide"); + running_device *ide = machine->device("ide"); DRIVER_INIT_CALL(viper); diff --git a/src/mame/drivers/volfied.c b/src/mame/drivers/volfied.c index 783d601c664..bad00fc2768 100644 --- a/src/mame/drivers/volfied.c +++ b/src/mame/drivers/volfied.c @@ -237,9 +237,9 @@ static MACHINE_START( volfied ) volfied_cchip_init(machine); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->pc090oj = devtag_get_device(machine, "pc090oj"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->pc090oj = machine->device("pc090oj"); } static MACHINE_RESET( volfied ) diff --git a/src/mame/drivers/vsnes.c b/src/mame/drivers/vsnes.c index 192a4ac70b3..c8208aa49c8 100644 --- a/src/mame/drivers/vsnes.c +++ b/src/mame/drivers/vsnes.c @@ -155,13 +155,13 @@ static int coin; static WRITE8_HANDLER( sprite_dma_0_w ) { int source = ( data & 7 ); - ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu1"), source ); + ppu2c0x_spriteram_dma( space, space->machine->device("ppu1"), source ); } static WRITE8_HANDLER( sprite_dma_1_w ) { int source = ( data & 7 ); - ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu2"), source ); + ppu2c0x_spriteram_dma( space, space->machine->device("ppu2"), source ); } static WRITE8_HANDLER( vsnes_coin_counter_w ) diff --git a/src/mame/drivers/warpwarp.c b/src/mame/drivers/warpwarp.c index ded959f0ede..d4968e18086 100644 --- a/src/mame/drivers/warpwarp.c +++ b/src/mame/drivers/warpwarp.c @@ -291,7 +291,7 @@ static WRITE8_HANDLER( warpwarp_out3_w ) break; case 6: warpwarp_ball_on = data & 1; - cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), data & 1); + cpu_interrupt_enable(space->machine->device("maincpu"), data & 1); if (~data & 1) cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); break; diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c index 3bf871861ad..81978d5fd63 100644 --- a/src/mame/drivers/warriorb.c +++ b/src/mame/drivers/warriorb.c @@ -542,19 +542,19 @@ static MACHINE_START( warriorb ) memory_configure_bank(machine, "bank10", 0, 8, memory_region(machine, "audiocpu") + 0xc000, 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->tc0140syt = devtag_get_device(machine, "tc0140syt"); - state->tc0100scn_1 = devtag_get_device(machine, "tc0100scn_1"); - state->tc0100scn_2 = devtag_get_device(machine, "tc0100scn_2"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->tc0140syt = machine->device("tc0140syt"); + state->tc0100scn_1 = machine->device("tc0100scn_1"); + state->tc0100scn_2 = machine->device("tc0100scn_2"); - state->lscreen = devtag_get_device(machine, "lscreen"); - state->rscreen = devtag_get_device(machine, "rscreen"); + state->lscreen = machine->device("lscreen"); + state->rscreen = machine->device("rscreen"); - state->_2610_1l = devtag_get_device(machine, "2610.1.l"); - state->_2610_1r = devtag_get_device(machine, "2610.1.r"); - state->_2610_2l = devtag_get_device(machine, "2610.2.l"); - state->_2610_2r = devtag_get_device(machine, "2610.2.r"); + state->_2610_1l = machine->device("2610.1.l"); + state->_2610_1r = machine->device("2610.1.r"); + state->_2610_2l = machine->device("2610.2.l"); + state->_2610_2r = machine->device("2610.2.r"); state_save_register_global(machine, state->banknum); state_save_register_global_array(machine, state->pandata); diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c index 972a34ee991..970eb425926 100644 --- a/src/mame/drivers/wecleman.c +++ b/src/mame/drivers/wecleman.c @@ -697,9 +697,9 @@ static WRITE8_HANDLER( hotchase_sound_control_w ) int reg[8]; - sound[0] = devtag_get_device(space->machine, "konami1"); - sound[1] = devtag_get_device(space->machine, "konami2"); - sound[2] = devtag_get_device(space->machine, "konami3"); + sound[0] = space->machine->device("konami1"); + sound[1] = space->machine->device("konami2"); + sound[2] = space->machine->device("konami3"); reg[offset] = data; @@ -1049,7 +1049,7 @@ static INTERRUPT_GEN( wecleman_interrupt ) static MACHINE_RESET( wecleman ) { - k007232_set_bank( devtag_get_device(machine, "konami"), 0, 1 ); + k007232_set_bank( machine->device("konami"), 0, 1 ); } static MACHINE_DRIVER_START( wecleman ) diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c index 3b45d954da4..6aebb876a14 100644 --- a/src/mame/drivers/wgp.c +++ b/src/mame/drivers/wgp.c @@ -955,11 +955,11 @@ static MACHINE_START( wgp ) memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->tc0140syt = devtag_get_device(machine, "tc0140syt"); - state->tc0100scn = devtag_get_device(machine, "tc0100scn"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->tc0140syt = machine->device("tc0140syt"); + state->tc0100scn = machine->device("tc0100scn"); state_save_register_global(machine, state->cpua_ctrl); state_save_register_global(machine, state->banknum); diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c index f9bcc0ee050..8e8d8639c96 100644 --- a/src/mame/drivers/williams.c +++ b/src/mame/drivers/williams.c @@ -526,8 +526,8 @@ ADDRESS_MAP_END void defender_install_io_space(const address_space *space) { - running_device *pia_0 = devtag_get_device(space->machine, "pia_0"); - running_device *pia_1 = devtag_get_device(space->machine, "pia_1"); + running_device *pia_0 = space->machine->device("pia_0"); + running_device *pia_1 = space->machine->device("pia_1"); /* this routine dynamically installs the memory mapped above from c000-cfff */ memory_install_write_bank (space, 0xc000, 0xc00f, 0, 0x03e0, "bank4"); @@ -2809,7 +2809,7 @@ static DRIVER_INIT( blastkit ) static DRIVER_INIT( spdball ) { - running_device *pia_3 = devtag_get_device(machine, "pia_3"); + running_device *pia_3 = machine->device("pia_3"); CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c index 8284ab2939d..7e0c9c8e14a 100644 --- a/src/mame/drivers/wiz.c +++ b/src/mame/drivers/wiz.c @@ -189,7 +189,7 @@ static int dsc0, dsc1; static WRITE8_HANDLER( sound_command_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); switch (offset) { diff --git a/src/mame/drivers/wolfpack.c b/src/mame/drivers/wolfpack.c index 5b3cffe5d21..faa095d5b02 100644 --- a/src/mame/drivers/wolfpack.c +++ b/src/mame/drivers/wolfpack.c @@ -61,7 +61,7 @@ static CUSTOM_INPUT( wolfpack_dial_r ) static READ8_HANDLER( wolfpack_misc_r ) { - running_device *device = devtag_get_device(space->machine, "speech"); + running_device *device = space->machine->device("speech"); UINT8 val = 0; /* BIT0 => SPEECH BUSY */ diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c index 5eb8363dab5..b9da7452268 100644 --- a/src/mame/drivers/xain.c +++ b/src/mame/drivers/xain.c @@ -288,7 +288,7 @@ static WRITE8_HANDLER( xain_68705_w ) from_main = data; _mcu_accept = 0; - if (devtag_get_device(space->machine, "mcu") != NULL) + if (space->machine->device("mcu") != NULL) cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE); } @@ -378,7 +378,7 @@ static CUSTOM_INPUT( mcu_status_r ) { UINT8 res = 0; - if (devtag_get_device(field->port->machine, "mcu") != NULL) + if (field->port->machine->device("mcu") != NULL) { if (_mcu_ready == 1) res |= 0x01; @@ -398,7 +398,7 @@ READ8_HANDLER( mcu_comm_reset_r ) _mcu_ready = 1; _mcu_accept = 1; - if (devtag_get_device(space->machine, "mcu") != NULL) + if (space->machine->device("mcu") != NULL) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); return 0xff; diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c index 46cf441e8c3..7caab720dc8 100644 --- a/src/mame/drivers/xexex.c +++ b/src/mame/drivers/xexex.c @@ -469,19 +469,19 @@ static MACHINE_START( xexex ) memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x10000], 0x4000); memory_set_bank(machine, "bank2", 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053250 = devtag_get_device(machine, "k053250"); - state->k053251 = devtag_get_device(machine, "k053251"); - state->k053252 = devtag_get_device(machine, "k053252"); - state->k056832 = devtag_get_device(machine, "k056832"); - state->k054338 = devtag_get_device(machine, "k054338"); - state->k054539 = devtag_get_device(machine, "k054539"); - state->filter1l = devtag_get_device(machine, "filter1l"); - state->filter1r = devtag_get_device(machine, "filter1r"); - state->filter2l = devtag_get_device(machine, "filter2l"); - state->filter2r = devtag_get_device(machine, "filter2r"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053246 = machine->device("k053246"); + state->k053250 = machine->device("k053250"); + state->k053251 = machine->device("k053251"); + state->k053252 = machine->device("k053252"); + state->k056832 = machine->device("k056832"); + state->k054338 = machine->device("k054338"); + state->k054539 = machine->device("k054539"); + state->filter1l = machine->device("filter1l"); + state->filter1r = machine->device("filter1r"); + state->filter2l = machine->device("filter2l"); + state->filter2r = machine->device("filter2r"); state_save_register_global(machine, state->cur_alpha); state_save_register_global(machine, state->sprite_colorbase); @@ -516,7 +516,7 @@ static MACHINE_RESET( xexex ) state->suspension_active = 0; state->resume_trigger = 1000; state->frame = -1; - k054539_init_flags(devtag_get_device(machine, "k054539"), K054539_REVERSE_STEREO); + k054539_init_flags(machine->device("k054539"), K054539_REVERSE_STEREO); } static MACHINE_DRIVER_START( xexex ) diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c index 86998486efa..ffe39ceebce 100644 --- a/src/mame/drivers/xmen.c +++ b/src/mame/drivers/xmen.c @@ -317,14 +317,14 @@ static MACHINE_START( xmen ) memory_configure_bank(machine, "bank4", 0, 8, &ROM[0x10000], 0x4000); memory_set_bank(machine, "bank4", 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053251 = devtag_get_device(machine, "k053251"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k054539 = devtag_get_device(machine, "k054539"); - state->lscreen = devtag_get_device(machine, "lscreen"); - state->rscreen = devtag_get_device(machine, "rscreen"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053246 = machine->device("k053246"); + state->k053251 = machine->device("k053251"); + state->k052109 = machine->device("k052109"); + state->k054539 = machine->device("k054539"); + state->lscreen = machine->device("lscreen"); + state->rscreen = machine->device("rscreen"); state_save_register_global(machine, state->sound_curbank); state_save_register_global(machine, state->sprite_colorbase); diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c index 71a566a1b09..d3b1ac554c3 100644 --- a/src/mame/drivers/xtheball.c +++ b/src/mame/drivers/xtheball.c @@ -133,7 +133,7 @@ static WRITE16_HANDLER( bit_controls_w ) switch (offset) { case 7: - ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, data << 7); + ticket_dispenser_w(space->machine->device("ticket"), 0, data << 7); break; case 8: diff --git a/src/mame/drivers/xybots.c b/src/mame/drivers/xybots.c index aab8ecc7cf6..c7a1441fad9 100644 --- a/src/mame/drivers/xybots.c +++ b/src/mame/drivers/xybots.c @@ -395,7 +395,7 @@ static DRIVER_INIT( xybots ) { xybots_state *state = (xybots_state *)machine->driver_data; state->h256 = 0x0400; - atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x008000, 0, 107); + atarigen_slapstic_init(machine->device("maincpu"), 0x008000, 0, 107); atarijsa_init(machine, "FFE200", 0x0100); } diff --git a/src/mame/drivers/yiear.c b/src/mame/drivers/yiear.c index 03751cab9a9..37f4c9f9eaf 100644 --- a/src/mame/drivers/yiear.c +++ b/src/mame/drivers/yiear.c @@ -194,7 +194,7 @@ static MACHINE_START( yiear ) trackfld_state *state = (trackfld_state *)machine->driver_data; state->audiocpu = NULL; - state->vlm = devtag_get_device(machine, "vlm"); + state->vlm = machine->device("vlm"); state_save_register_global(machine, state->yiear_nmi_enable); diff --git a/src/mame/drivers/yunsun16.c b/src/mame/drivers/yunsun16.c index b30fa4e451d..cc7ea0f6138 100644 --- a/src/mame/drivers/yunsun16.c +++ b/src/mame/drivers/yunsun16.c @@ -559,7 +559,7 @@ static MACHINE_START( yunsun16 ) { yunsun16_state *state = (yunsun16_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->sprites_scrolldx); state_save_register_global(machine, state->sprites_scrolldy); diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c index d6f0b6f87de..3535b5b2b12 100644 --- a/src/mame/drivers/yunsung8.c +++ b/src/mame/drivers/yunsung8.c @@ -480,7 +480,7 @@ static MACHINE_START( yunsung8 ) memory_configure_bank(machine, "bank2", 0, 3, &AUDIO[0x00000], 0x4000); memory_configure_bank(machine, "bank2", 3, 5, &AUDIO[0x10000], 0x4000); - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global_pointer(machine, state->videoram, 0x4000); state_save_register_global(machine, state->layers_ctrl); diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c index 73c0cb533d1..4dfce004302 100644 --- a/src/mame/drivers/zaccaria.c +++ b/src/mame/drivers/zaccaria.c @@ -105,7 +105,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_port0a_w ) /* 150 below to scale to volume 100 */ v = (150 * table[ba]) / (4700 + table[ba]); //printf("dac1w %02d %04d\n", ba, v); - ay8910_set_volume(devtag_get_device(device->machine, "ay2"), 1, v); + ay8910_set_volume(device->machine->device("ay2"), 1, v); } @@ -121,7 +121,7 @@ static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0b ) static READ8_DEVICE_HANDLER( zaccaria_port0a_r ) { - return ay8910_r(devtag_get_device(device->machine, (active_8910 == 0) ? "ay1" : "ay2"), 0); + return ay8910_r(device->machine->device((active_8910 == 0) ? "ay1" : "ay2"), 0); } static WRITE8_DEVICE_HANDLER( zaccaria_port0a_w ) @@ -136,7 +136,7 @@ static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w ) if ((last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00) { /* bit 0 goes to the 8910 #0 BC1 pin */ - ay8910_data_address_w(devtag_get_device(device->machine, "ay1"), last_port0b, port0a); + ay8910_data_address_w(device->machine->device("ay1"), last_port0b, port0a); } else if ((last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02) { @@ -148,7 +148,7 @@ static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w ) if ((last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00) { /* bit 2 goes to the 8910 #1 BC1 pin */ - ay8910_data_address_w(devtag_get_device(device->machine, "ay2"), last_port0b >> 2, port0a); + ay8910_data_address_w(device->machine->device("ay2"), last_port0b >> 2, port0a); } else if ((last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08) { @@ -162,7 +162,7 @@ static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w ) static INTERRUPT_GEN( zaccaria_cb1_toggle ) { - running_device *pia0 = devtag_get_device(device->machine, "pia0"); + running_device *pia0 = device->machine->device("pia0"); static int toggle = 0; pia6821_cb1_w(pia0,0, toggle & 1); @@ -171,7 +171,7 @@ static INTERRUPT_GEN( zaccaria_cb1_toggle ) static WRITE8_DEVICE_HANDLER( zaccaria_port1b_w ) { - running_device *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = device->machine->device("tms"); // bit 0 = /RS tms5220_rsq_w(tms, (data >> 0) & 0x01); @@ -194,7 +194,7 @@ static WRITE8_HANDLER( sound_command_w ) static WRITE8_HANDLER( sound1_command_w ) { - running_device *pia0 = devtag_get_device(space->machine, "pia0"); + running_device *pia0 = space->machine->device("pia0"); pia6821_ca1_w(pia0, 0, data & 0x80); soundlatch2_w(space, 0, data); } diff --git a/src/mame/drivers/zerozone.c b/src/mame/drivers/zerozone.c index ceea25b444e..409334aebb9 100644 --- a/src/mame/drivers/zerozone.c +++ b/src/mame/drivers/zerozone.c @@ -173,7 +173,7 @@ static MACHINE_START( zerozone ) { zerozone_state *state = (zerozone_state *)machine->driver_data; - state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->audiocpu = machine->device("audiocpu"); state_save_register_global(machine, state->tilebank); } diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c index 17c23c53b69..b79ad2aa366 100644 --- a/src/mame/drivers/zn.c +++ b/src/mame/drivers/zn.c @@ -1156,7 +1156,7 @@ static UINT8 *taitofx1_eeprom2 = NULL; static WRITE32_HANDLER( bank_coh1000t_w ) { - running_device *mb3773 = devtag_get_device(space->machine, "mb3773"); + running_device *mb3773 = space->machine->device("mb3773"); mb3773_set_ck(mb3773, 0, (data & 0x20) >> 5); verboselog( space->machine, 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); memory_set_bankptr(space->machine, "bank1", memory_region( space->machine, "user2" ) + ( ( data & 3 ) * 0x800000 ) ); @@ -1169,13 +1169,13 @@ static WRITE8_HANDLER( fx1a_sound_bankswitch_w ) static READ32_HANDLER( taitofx1a_ymsound_r ) { - running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = space->machine->device("tc0140syt"); return tc0140syt_comm_r(tc0140syt, 0) << 16; } static WRITE32_HANDLER( taitofx1a_ymsound_w ) { - running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = space->machine->device("tc0140syt"); if (mem_mask == 0x0000ffff) { @@ -1469,7 +1469,7 @@ static void atpsx_interrupt(running_device *device, int state) static void atpsx_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size ) { - running_device *ide = devtag_get_device(machine, "ide"); + running_device *ide = machine->device("ide"); logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address); @@ -1497,7 +1497,7 @@ static void atpsx_dma_write( running_machine *machine, UINT32 n_address, INT32 n static DRIVER_INIT( coh1000w ) { - running_device *ide = devtag_get_device(machine, "ide"); + running_device *ide = machine->device("ide"); memory_install_read_bank ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f000000, 0x1f1fffff, 0, 0, "bank1" ); memory_nop_write ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f000000, 0x1f000003, 0, 0 ); @@ -2170,7 +2170,7 @@ static DRIVER_INIT( coh1000a ) if( ( !strcmp( machine->gamedrv->name, "jdredd" ) ) || ( !strcmp( machine->gamedrv->name, "jdreddb" ) ) ) { - running_device *ide = devtag_get_device(machine, "ide"); + running_device *ide = machine->device("ide"); memory_install_read32_device_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), ide, 0x1fbfff8c, 0x1fbfff8f, 0, 0, jdredd_idestat_r ); memory_nop_write ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1fbfff8c, 0x1fbfff8f, 0, 0 ); diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c index 16e10b4ecb9..e6e1365bbd2 100644 --- a/src/mame/drivers/zr107.c +++ b/src/mame/drivers/zr107.c @@ -189,7 +189,7 @@ static VIDEO_START( jetwave ) static VIDEO_UPDATE( jetwave ) { - running_device *k001604 = devtag_get_device(screen->machine, "k001604"); + running_device *k001604 = screen->machine->device("k001604"); bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); @@ -200,7 +200,7 @@ static VIDEO_UPDATE( jetwave ) draw_7segment_led(bitmap, 3, 3, led_reg0); draw_7segment_led(bitmap, 9, 3, led_reg1); - sharc_set_flag_input(devtag_get_device(screen->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE); return 0; } @@ -224,7 +224,7 @@ static void game_tile_callback(running_machine *machine, int layer, int *code, i static VIDEO_START( zr107 ) { - running_device *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = machine->device("k056832"); k056832_set_layer_offs(k056832, 0, -29, -27); k056832_set_layer_offs(k056832, 1, -29, -27); @@ -241,7 +241,7 @@ static VIDEO_START( zr107 ) static VIDEO_UPDATE( zr107 ) { - running_device *k056832 = devtag_get_device(screen->machine, "k056832"); + running_device *k056832 = screen->machine->device("k056832"); bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0); @@ -251,7 +251,7 @@ static VIDEO_UPDATE( zr107 ) draw_7segment_led(bitmap, 3, 3, led_reg0); draw_7segment_led(bitmap, 9, 3, led_reg1); - sharc_set_flag_input(devtag_get_device(screen->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE); return 0; } @@ -379,10 +379,10 @@ static UINT32 *workram; static MACHINE_START( zr107 ) { /* set conservative DRC options */ - ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS); + ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x000fffff, FALSE, workram); + ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x000fffff, FALSE, workram); } static ADDRESS_MAP_START( zr107_map, ADDRESS_SPACE_PROGRAM, 32 ) @@ -443,9 +443,9 @@ static READ16_HANDLER( dual539_r ) UINT16 ret = 0; if (ACCESSING_BITS_0_7) - ret |= k054539_r(devtag_get_device(space->machine, "konami2"), offset); + ret |= k054539_r(space->machine->device("konami2"), offset); if (ACCESSING_BITS_8_15) - ret |= k054539_r(devtag_get_device(space->machine, "konami1"), offset)<<8; + ret |= k054539_r(space->machine->device("konami1"), offset)<<8; return ret; } @@ -453,9 +453,9 @@ static READ16_HANDLER( dual539_r ) static WRITE16_HANDLER( dual539_w ) { if (ACCESSING_BITS_0_7) - k054539_w(devtag_get_device(space->machine, "konami2"), offset, data); + k054539_w(space->machine->device("konami2"), offset, data); if (ACCESSING_BITS_8_15) - k054539_w(devtag_get_device(space->machine, "konami1"), offset, data>>8); + k054539_w(space->machine->device("konami1"), offset, data>>8); } static ADDRESS_MAP_START( sound_memmap, ADDRESS_SPACE_PROGRAM, 16 ) diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c index 437543e3259..6433cbce62c 100644 --- a/src/mame/machine/ajax.c +++ b/src/mame/machine/ajax.c @@ -209,14 +209,14 @@ MACHINE_START( ajax ) memory_set_bank(machine, "bank1", 0); memory_set_bank(machine, "bank2", 0); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->k007232_1 = devtag_get_device(machine, "k007232_1"); - state->k007232_2 = devtag_get_device(machine, "k007232_2"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k051960 = devtag_get_device(machine, "k051960"); - state->k051316 = devtag_get_device(machine, "k051316"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->k007232_1 = machine->device("k007232_1"); + state->k007232_2 = machine->device("k007232_2"); + state->k052109 = machine->device("k052109"); + state->k051960 = machine->device("k051960"); + state->k051316 = machine->device("k051316"); state_save_register_global(machine, state->priority); state_save_register_global(machine, state->firq_enable); diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index bdb13902e76..557e653c566 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -318,9 +318,9 @@ static void amiga_m68k_reset(running_device *device) MACHINE_RESET( amiga ) { /* set m68k reset function */ - m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), amiga_m68k_reset); + m68k_set_reset_callback(machine->device("maincpu"), amiga_m68k_reset); - amiga_m68k_reset(devtag_get_device(machine, "maincpu")); + amiga_m68k_reset(machine->device("maincpu")); /* call the system-specific callback */ if (amiga_intf->reset_callback) @@ -341,8 +341,8 @@ MACHINE_RESET( amiga ) static TIMER_CALLBACK( scanline_callback ) { int scanline = param; - running_device *cia_0 = devtag_get_device(machine, "cia_0"); - running_device *cia_1 = devtag_get_device(machine, "cia_1"); + running_device *cia_0 = machine->device("cia_0"); + running_device *cia_1 = machine->device("cia_1"); /* on the first scanline, we do some extra bookkeeping */ if (scanline == 0) @@ -1046,14 +1046,14 @@ READ16_HANDLER( amiga_cia_r ) /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */ if ((offset & 0x0800) == 0) { - cia = devtag_get_device(space->machine, "cia_1"); + cia = space->machine->device("cia_1"); shift = 8; } /* offsets 0800-0fff reference CIA A, and are accessed via the LSB */ else { - cia = devtag_get_device(space->machine, "cia_0"); + cia = space->machine->device("cia_0"); shift = 0; } @@ -1086,7 +1086,7 @@ WRITE16_HANDLER( amiga_cia_w ) { if (!ACCESSING_BITS_8_15) return; - cia = devtag_get_device(space->machine, "cia_1"); + cia = space->machine->device("cia_1"); data >>= 8; } @@ -1095,7 +1095,7 @@ WRITE16_HANDLER( amiga_cia_w ) { if (!ACCESSING_BITS_0_7) return; - cia = devtag_get_device(space->machine, "cia_0"); + cia = space->machine->device("cia_0"); data &= 0xff; } @@ -1444,8 +1444,8 @@ WRITE16_HANDLER( amiga_custom_w ) CUSTOM_REG(REG_SERDATR) &= ~0x8000; data = (data & 0x8000) ? (CUSTOM_REG(offset) | (data & 0x7fff)) : (CUSTOM_REG(offset) & ~(data & 0x7fff)); - cia_0 = devtag_get_device(space->machine, "cia_0"); - cia_1 = devtag_get_device(space->machine, "cia_1"); + cia_0 = space->machine->device("cia_0"); + cia_1 = space->machine->device("cia_1"); if ( mos6526_irq_r( cia_0 ) ) data |= INTENA_PORTS; if ( mos6526_irq_r( cia_1 ) ) data |= INTENA_EXTER; CUSTOM_REG(offset) = data; diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c index 111adcc4c3a..3b1ee8d0f39 100644 --- a/src/mame/machine/archimds.c +++ b/src/mame/machine/archimds.c @@ -317,7 +317,7 @@ static void latch_timer_cnt(int tmr) READ32_HANDLER(archimedes_ioc_r) { #ifdef MESS - running_device *fdc = (running_device *)devtag_get_device(space->machine, "wd1772"); + running_device *fdc = (running_device *)space->machine->device("wd1772"); #endif if (offset >= 0x80000 && offset < 0xc0000) { @@ -367,7 +367,7 @@ READ32_HANDLER(archimedes_ioc_r) WRITE32_HANDLER(archimedes_ioc_w) { #ifdef MESS - running_device *fdc = (running_device *)devtag_get_device(space->machine, "wd1772"); + running_device *fdc = (running_device *)space->machine->device("wd1772"); #endif if (offset >= 0x80000 && offset < 0xc0000) @@ -597,7 +597,7 @@ WRITE32_HANDLER(archimedes_memc_w) else { timer_adjust_oneshot(snd_timer, attotime_never, 0); - dac_signed_data_w(devtag_get_device(space->machine, "dac"), 0x80); + dac_signed_data_w(space->machine->device("dac"), 0x80); } break; diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c index de623bffd6e..5e68ac8a401 100644 --- a/src/mame/machine/asic65.c +++ b/src/mame/machine/asic65.c @@ -131,7 +131,7 @@ void asic65_config(running_machine *machine, int asictype) asic65.type = asictype; asic65.yorigin = 0x1800; if (asic65.type == ASIC65_ROMBASED) - asic65.cpu = devtag_get_device(machine, "asic65"); + asic65.cpu = machine->device("asic65"); } diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c index 373e107fb29..fbbd2250bd4 100644 --- a/src/mame/machine/atari.c +++ b/src/mame/machine/atari.c @@ -159,7 +159,7 @@ static int atari_last; void a800_handle_keyboard(running_machine *machine) { - running_device *pokey = devtag_get_device(machine, "pokey"); + running_device *pokey = machine->device("pokey"); int atari_code, count, ipt, i; static const char *const tag[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", @@ -244,7 +244,7 @@ void a800_handle_keyboard(running_machine *machine) void a5200_handle_keypads(running_machine *machine) { - running_device *pokey = devtag_get_device(machine, "pokey"); + running_device *pokey = machine->device("pokey"); int atari_code, count, ipt, i; static const char *const tag[] = { "keypad_0", "keypad_1", "keypad_2", "keypad_3" }; @@ -322,7 +322,7 @@ static UINT8 console_read(const address_space *space) static void console_write(const address_space *space, UINT8 data) { - running_device *dac = devtag_get_device(space->machine, "dac"); + running_device *dac = space->machine->device("dac"); if (data & 0x08) dac_data_w(dac, (UINT8)-120); else diff --git a/src/mame/machine/atarifb.c b/src/mame/machine/atarifb.c index 6593e919eae..540759bf23f 100644 --- a/src/mame/machine/atarifb.c +++ b/src/mame/machine/atarifb.c @@ -13,7 +13,7 @@ WRITE8_HANDLER( atarifb_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); state->CTRLD = data; @@ -27,7 +27,7 @@ WRITE8_HANDLER( atarifb_out1_w ) WRITE8_HANDLER( atarifb4_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); state->CTRLD = data; @@ -43,7 +43,7 @@ WRITE8_HANDLER( atarifb4_out1_w ) WRITE8_HANDLER( abaseb_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); state->CTRLD = data; @@ -70,7 +70,7 @@ WRITE8_HANDLER( abaseb_out1_w ) WRITE8_HANDLER( soccer_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); state->CTRLD = data; @@ -94,7 +94,7 @@ WRITE8_HANDLER( soccer_out1_w ) WRITE8_HANDLER( atarifb_out2_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd @@ -104,7 +104,7 @@ WRITE8_HANDLER( atarifb_out2_w ) WRITE8_HANDLER( soccer_out2_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index daf78fcbce3..4156e03b133 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -295,7 +295,7 @@ static TIMER_CALLBACK( scanline_interrupt_callback ) emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer; /* generate the interrupt */ - atarigen_scanline_int_gen(devtag_get_device(machine, "maincpu")); + atarigen_scanline_int_gen(machine->device("maincpu")); /* set a new timer to go off at the same scan line next frame */ timer_adjust_oneshot(timer, screen.frame_period(), 0); @@ -859,7 +859,7 @@ static TIMER_CALLBACK( delayed_6502_sound_w ) /* set up the states and signal the sound interrupt to the main CPU */ state->sound_to_cpu = param; state->sound_to_cpu_ready = 1; - atarigen_sound_int_gen(devtag_get_device(machine, "maincpu")); + atarigen_sound_int_gen(machine->device("maincpu")); } @@ -1408,7 +1408,7 @@ int atarigen_get_hblank(screen_device &screen) void atarigen_halt_until_hblank_0(screen_device &screen) { - running_device *cpu = devtag_get_device(screen.machine, "maincpu"); + running_device *cpu = screen.machine->device("maincpu"); /* halt the CPU until the next HBLANK */ int hpos = screen.hpos(); diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c index 9cdd360a46e..09f019d7632 100644 --- a/src/mame/machine/beezer.c +++ b/src/mame/machine/beezer.c @@ -108,7 +108,7 @@ WRITE8_HANDLER( beezer_bankswitch_w ) { if ((data & 0x07) == 0) { - running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = space->machine->device("via6522_0"); memory_install_write8_handler(space, 0xc600, 0xc7ff, 0, 0, watchdog_reset_w); memory_install_write8_handler(space, 0xc800, 0xc9ff, 0, 0, beezer_map_w); memory_install_read8_handler(space, 0xca00, 0xcbff, 0, 0, beezer_line_r); diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c index a930ca44a5e..c92c9c8779d 100644 --- a/src/mame/machine/carpolo.c +++ b/src/mame/machine/carpolo.c @@ -497,21 +497,21 @@ const pia6821_interface carpolo_pia1_intf = MACHINE_START( carpolo ) { /* find flip-flops */ - ttl7474_2s_1 = devtag_get_device(machine, "7474_2s_1"); - ttl7474_2s_2 = devtag_get_device(machine, "7474_2s_2"); - ttl7474_2u_1 = devtag_get_device(machine, "7474_2u_1"); - ttl7474_2u_2 = devtag_get_device(machine, "7474_2u_2"); - ttl7474_1f_1 = devtag_get_device(machine, "7474_1f_1"); - ttl7474_1f_2 = devtag_get_device(machine, "7474_1f_2"); - ttl7474_1d_1 = devtag_get_device(machine, "7474_1d_1"); - ttl7474_1d_2 = devtag_get_device(machine, "7474_1d_2"); - ttl7474_1c_1 = devtag_get_device(machine, "7474_1c_1"); - ttl7474_1c_2 = devtag_get_device(machine, "7474_1c_2"); - ttl7474_1a_1 = devtag_get_device(machine, "7474_1a_1"); - ttl7474_1a_2 = devtag_get_device(machine, "7474_1a_2"); + ttl7474_2s_1 = machine->device("7474_2s_1"); + ttl7474_2s_2 = machine->device("7474_2s_2"); + ttl7474_2u_1 = machine->device("7474_2u_1"); + ttl7474_2u_2 = machine->device("7474_2u_2"); + ttl7474_1f_1 = machine->device("7474_1f_1"); + ttl7474_1f_2 = machine->device("7474_1f_2"); + ttl7474_1d_1 = machine->device("7474_1d_1"); + ttl7474_1d_2 = machine->device("7474_1d_2"); + ttl7474_1c_1 = machine->device("7474_1c_1"); + ttl7474_1c_2 = machine->device("7474_1c_2"); + ttl7474_1a_1 = machine->device("7474_1a_1"); + ttl7474_1a_2 = machine->device("7474_1a_2"); - ttl74148_3s = devtag_get_device(machine, "74148_3s"); - ttl74153_1k = devtag_get_device(machine, "74153_1k"); + ttl74148_3s = machine->device("74148_3s"); + ttl74153_1k = machine->device("74153_1k"); state_save_register_global(machine, ball_screen_collision_cause); state_save_register_global(machine, car_ball_collision_x); diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c index 3a58a354108..a1fb6ee5689 100644 --- a/src/mame/machine/cps2crpt.c +++ b/src/mame/machine/cps2crpt.c @@ -721,7 +721,7 @@ static void cps2_decrypt(running_machine *machine, const UINT32 *master_key, UIN } memory_set_decrypted_region(space, 0x000000, length - 1, dec); - m68k_set_encrypted_opcode_range(devtag_get_device(machine, "maincpu"), 0, length); + m68k_set_encrypted_opcode_range(machine->device("maincpu"), 0, length); } diff --git a/src/mame/machine/cubocd32.c b/src/mame/machine/cubocd32.c index 4a14590677c..eac74b71412 100644 --- a/src/mame/machine/cubocd32.c +++ b/src/mame/machine/cubocd32.c @@ -102,7 +102,7 @@ void amiga_akiko_init(running_machine* machine) akiko.cdrom_toc = NULL; akiko.dma_timer = timer_alloc(machine, akiko_dma_proc, NULL); akiko.frame_timer = timer_alloc(machine, akiko_frame_proc, NULL); - akiko.i2cmem = devtag_get_device(machine, "i2cmem"); + akiko.i2cmem = machine->device("i2cmem"); machine->add_notifier(MACHINE_NOTIFY_EXIT, amiga_akiko_exit); @@ -729,7 +729,7 @@ READ32_HANDLER(amiga_akiko32_r) switch( offset ) { case 0x00/4: /* ID */ - if ( akiko.cdrom != NULL ) cdda_set_cdrom(devtag_get_device(space->machine, "cdda"), akiko.cdrom); + if ( akiko.cdrom != NULL ) cdda_set_cdrom(space->machine->device("cdda"), akiko.cdrom); return 0x0000cafe; case 0x04/4: /* CDROM STATUS 1 */ diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index 5f8728f2ce5..2235abc3a1f 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -409,7 +409,7 @@ void dc_update_interrupt_status(running_machine *machine) } level=dc_compute_interrupt_level(machine); - sh4_set_irln_input(devtag_get_device(machine, "maincpu"), 15-level); + sh4_set_irln_input(machine->device("maincpu"), 15-level); /* Wave DMA HW trigger */ if(wave_dma.flag && ((wave_dma.sel & 2) == 2)) @@ -663,7 +663,7 @@ WRITE64_HANDLER( dc_sysctrl_w ) ddtdata.direction=0; ddtdata.channel=2; ddtdata.mode=25; //011001 - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata); #if DEBUG_SYSCTRL if ((address >= 0x11000000) && (address <= 0x11FFFFFF)) if (dc_sysctrl_regs[SB_LMMODE0]) @@ -793,7 +793,7 @@ WRITE64_HANDLER( naomi_maple_w ) ddtdata.direction=0; // 0 source to buffer, 1 buffer to source ddtdata.channel= -1; // not used ddtdata.mode= -1; // copy from/to buffer - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"), &ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata); endflag=buff[0] & 0x80000000; port=(buff[0] >> 16) & 3; @@ -832,7 +832,7 @@ WRITE64_HANDLER( naomi_maple_w ) ddtdata.direction=0; ddtdata.channel= -1; ddtdata.mode=-1; - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata); chk=0; for (a=1;a < length;a++) { @@ -858,7 +858,7 @@ WRITE64_HANDLER( naomi_maple_w ) ddtdata.direction=0; ddtdata.channel= -1; ddtdata.mode=-1; - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata); subcommand = buff[0] & 0xff; #if DEBUG_MAPLE @@ -1062,7 +1062,7 @@ WRITE64_HANDLER( naomi_maple_w ) ddtdata.destination=destination; ddtdata.buffer=buff; ddtdata.direction=1; - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata); if (endflag) { @@ -1139,7 +1139,7 @@ WRITE64_HANDLER( dc_maple_w ) ddtdata.direction=0; // 0 source to buffer, 1 buffer to source ddtdata.channel= -1; // not used ddtdata.mode= -1; // copy from/to buffer - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"), &ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata); endflag=buff[0] & 0x80000000; port=(buff[0] >> 16) & 3; @@ -1211,7 +1211,7 @@ WRITE64_HANDLER( dc_maple_w ) ddtdata.destination=destination; ddtdata.buffer=buff; ddtdata.direction=1; - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata); if (endflag) { @@ -1330,7 +1330,7 @@ WRITE64_HANDLER( dc_g1_ctrl_w ) ddtdata.channel= -1; // not used ddtdata.mode= -1; // copy from/to buffer mame_printf_verbose("G1CTRL: transfer %x from ROM %08x to sdram %08x\n", g1bus_regs[SB_GDLEN], dmaoffset, g1bus_regs[SB_GDSTAR]); - sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"), &ddtdata); + sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata); /* Note: KOF Neowave definitely wants this to be delayed (!) */ /* FIXME: timing of this */ timer_set(space->machine, ATTOTIME_IN_USEC(500), NULL, 0, gdrom_dma_irq); diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c index c944957f97d..197595afeed 100644 --- a/src/mame/machine/deco102.c +++ b/src/mame/machine/deco102.c @@ -59,7 +59,7 @@ void deco102_decrypt_cpu(running_machine *machine, const char *cputag, int addre memcpy(buf, rom, size); memory_set_decrypted_region(space, 0, size - 1, opcodes); - m68k_set_encrypted_opcode_range(devtag_get_device(machine, cputag), 0, size); + m68k_set_encrypted_opcode_range(machine->device(cputag), 0, size); for (i = 0; i < size / 2; i++) { diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c index 846697c89ab..efa809879cc 100644 --- a/src/mame/machine/decocass.c +++ b/src/mame/machine/decocass.c @@ -1337,10 +1337,10 @@ MACHINE_START( decocass ) { decocass_state *state = (decocass_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->mcu = devtag_get_device(machine, "mcu"); - state->cassette = devtag_get_device(machine, "cassette"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->mcu = machine->device("mcu"); + state->cassette = machine->device("cassette"); } static void decocass_reset_common( running_machine *machine ) diff --git a/src/mame/machine/decoprot.c b/src/mame/machine/decoprot.c index 0f11ea9f1a3..719750b8566 100644 --- a/src/mame/machine/decoprot.c +++ b/src/mame/machine/decoprot.c @@ -1311,7 +1311,7 @@ static READ16_HANDLER( deco16_146_core_prot_r ) // case 0x582: return input_port_read(space->machine, "IN0"); /* IN0 */ // case 0x672: return input_port_read(space->machine, "IN1"); /* IN1 */ -// case 0x04c: return eeprom_read_bit(devtag_get_device(space->machine, "eeprom")); +// case 0x04c: return eeprom_read_bit(space->machine->device("eeprom")); case 0x468: val=DECO_PORT(0x570); @@ -1660,7 +1660,7 @@ READ32_HANDLER( deco16_146_fghthist_prot_r ) { case 0x582: return (input_port_read(space->machine, "IN0")<<16) | 0xffff; /* IN0 */ case 0x672: return (input_port_read(space->machine, "IN1")<<16) | 0xffff; /* IN1 */ - case 0x04c: return (eeprom_read_bit(devtag_get_device(space->machine, "eeprom"))<<16) | 0xffff; + case 0x04c: return (eeprom_read_bit(space->machine->device("eeprom"))<<16) | 0xffff; } /* Handle 'one shots' - writing data to an address, then immediately reading it back */ diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c index d1f96b59d6b..6f75a3252fc 100644 --- a/src/mame/machine/galaxold.c +++ b/src/mame/machine/galaxold.c @@ -45,14 +45,14 @@ WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_1_callback ) WRITE8_HANDLER( galaxold_nmi_enable_w ) { - running_device *target = devtag_get_device(space->machine, "7474_9m_1"); + running_device *target = space->machine->device("7474_9m_1"); ttl7474_preset_w(target, data ? 1 : 0); } TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer ) { - running_device *target = devtag_get_device(timer.machine, "7474_9m_2"); + running_device *target = timer.machine->device("7474_9m_2"); /* 128V, 64V and 32V go to D */ ttl7474_d_w(target, ((param & 0xe0) != 0xe0) ? 1 : 0); @@ -68,8 +68,8 @@ TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer ) static void machine_reset_common(running_machine *machine, int line) { - running_device *ttl7474_9m_1 = devtag_get_device(machine, "7474_9m_1"); - running_device *ttl7474_9m_2 = devtag_get_device(machine, "7474_9m_2"); + running_device *ttl7474_9m_1 = machine->device("7474_9m_1"); + running_device *ttl7474_9m_2 = machine->device("7474_9m_2"); irq_line = line; /* initalize main CPU interrupt generator flip-flops */ @@ -98,7 +98,7 @@ MACHINE_RESET( devilfsg ) MACHINE_RESET( hunchbkg ) { machine_reset_common(machine, 0); - cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), hunchbkg_irq_callback); + cpu_set_irq_callback(machine->device("maincpu"), hunchbkg_irq_callback); } WRITE8_HANDLER( galaxold_coin_lockout_w ) diff --git a/src/mame/machine/gaplus.c b/src/mame/machine/gaplus.c index b9f5e16b83d..42c72cbc52b 100644 --- a/src/mame/machine/gaplus.c +++ b/src/mame/machine/gaplus.c @@ -21,7 +21,7 @@ UINT8 *gaplus_customio_3; WRITE8_HANDLER( gaplus_customio_3_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); if ((offset == 0x09) && (data >= 0x0f)) sample_start(samples,0,0,0); diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c index 853551ccdaa..dd9cb1fc75c 100644 --- a/src/mame/machine/konppc.c +++ b/src/mame/machine/konppc.c @@ -142,8 +142,8 @@ WRITE32_HANDLER( cgboard_dsp_comm_w_ppc ) { const char *dsptag = (cgboard_id == 0) ? "dsp" : "dsp2"; const char *pcitag = (cgboard_id == 0) ? "k033906_1" : "k033906_2"; - running_device *dsp = devtag_get_device(space->machine, dsptag); - running_device *k033906 = devtag_get_device(space->machine, pcitag); + running_device *dsp = space->machine->device(dsptag); + running_device *k033906 = space->machine->device(pcitag); // mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, cpu_get_pc(space->cpu)); if (cgboard_id < MAX_CG_BOARDS) @@ -225,7 +225,7 @@ static void dsp_comm_sharc_w(const address_space *space, int board, int offset, case CGBOARD_TYPE_GTICLUB: { //cputag_set_input_line(machine, "dsp", SHARC_INPUT_FLAG0, ASSERT_LINE); - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 0, ASSERT_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 0, ASSERT_LINE); if (offset == 1) { @@ -239,7 +239,7 @@ static void dsp_comm_sharc_w(const address_space *space, int board, int offset, case CGBOARD_TYPE_HANGPLT: { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; - running_device *device = devtag_get_device(space->machine, dsptag); + running_device *device = space->machine->device(dsptag); if (offset == 1) { @@ -354,7 +354,7 @@ WRITE32_HANDLER( cgboard_1_shared_sharc_w ) static UINT32 nwk_fifo_r(const address_space *space, int board) { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; - running_device *device = devtag_get_device(space->machine, dsptag); + running_device *device = space->machine->device(dsptag); UINT32 data; if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r) @@ -385,7 +385,7 @@ static UINT32 nwk_fifo_r(const address_space *space, int board) static void nwk_fifo_w(running_machine *machine, int board, UINT32 data) { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; - running_device *device = devtag_get_device(machine, dsptag); + running_device *device = machine->device(dsptag); if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w) { @@ -409,7 +409,7 @@ static void nwk_fifo_w(running_machine *machine, int board, UINT32 data) READ32_HANDLER( K033906_0_r ) { - running_device *k033906_1 = devtag_get_device(space->machine, "k033906_1"); + running_device *k033906_1 = space->machine->device("k033906_1"); if (nwk_device_sel[0] & 0x01) return nwk_fifo_r(space, 0); else @@ -418,13 +418,13 @@ READ32_HANDLER( K033906_0_r ) WRITE32_HANDLER( K033906_0_w ) { - running_device *k033906_1 = devtag_get_device(space->machine, "k033906_1"); + running_device *k033906_1 = space->machine->device("k033906_1"); k033906_w(k033906_1, offset, data, mem_mask); } READ32_HANDLER( K033906_1_r ) { - running_device *k033906_2 = devtag_get_device(space->machine, "k033906_2"); + running_device *k033906_2 = space->machine->device("k033906_2"); if (nwk_device_sel[1] & 0x01) return nwk_fifo_r(space, 1); else @@ -433,7 +433,7 @@ READ32_HANDLER( K033906_1_r ) WRITE32_HANDLER(K033906_1_w) { - running_device *k033906_2 = devtag_get_device(space->machine, "k033906_2"); + running_device *k033906_2 = space->machine->device("k033906_2"); k033906_w(k033906_2, offset, data, mem_mask); } diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c index 0c3b356455c..c2a1fe667c0 100644 --- a/src/mame/machine/leland.c +++ b/src/mame/machine/leland.c @@ -376,7 +376,7 @@ MACHINE_RESET( leland ) /* reset globals */ leland_gfx_control = 0x00; - leland_sound_port_w(devtag_get_device(machine, "ay8910.1"), 0, 0xff); + leland_sound_port_w(machine->device("ay8910.1"), 0, 0xff); wcol_enable = 0; dangerz_x = 512; @@ -1143,7 +1143,7 @@ READ8_HANDLER( leland_master_input_r ) case 0x01: /* /GIN1 */ result = input_port_read(space->machine, "IN1"); - if (cpu_get_reg(devtag_get_device(space->machine, "slave"), Z80_HALT)) + if (cpu_get_reg(space->machine->device("slave"), Z80_HALT)) result ^= 0x01; break; @@ -1154,7 +1154,7 @@ READ8_HANDLER( leland_master_input_r ) case 0x03: /* /IGID */ case 0x13: - result = ay8910_r(devtag_get_device(space->machine, "ay8910.1"), offset); + result = ay8910_r(space->machine->device("ay8910.1"), offset); break; case 0x10: /* /GIN0 */ @@ -1186,7 +1186,7 @@ WRITE8_HANDLER( leland_master_output_w ) cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); cputag_set_input_line(space->machine, "slave", 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); - eeprom = devtag_get_device(space->machine, "eeprom"); + eeprom = space->machine->device("eeprom"); if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", cpu_get_pc(space->cpu), (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); eeprom_write_bit (eeprom, (data & 0x10) >> 4); @@ -1196,7 +1196,7 @@ WRITE8_HANDLER( leland_master_output_w ) case 0x0a: /* /OGIA */ case 0x0b: /* /OGID */ - ay8910_address_data_w(devtag_get_device(space->machine, "ay8910.1"), offset, data); + ay8910_address_data_w(space->machine->device("ay8910.1"), offset, data); break; case 0x0c: /* /BKXL */ @@ -1225,7 +1225,7 @@ READ8_HANDLER( ataxx_master_input_r ) case 0x07: /* /SLVBLK */ result = input_port_read(space->machine, "IN1"); - if (cpu_get_reg(devtag_get_device(space->machine, "slave"), Z80_HALT)) + if (cpu_get_reg(space->machine->device("slave"), Z80_HALT)) result ^= 0x01; break; diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c index d7ba74693c4..fc8922f0843 100644 --- a/src/mame/machine/mcr.c +++ b/src/mame/machine/mcr.c @@ -420,7 +420,7 @@ MACHINE_RESET( zwackery ) INTERRUPT_GEN( mcr_interrupt ) { - running_device *ctc = devtag_get_device(device->machine, "ctc"); + running_device *ctc = device->machine->device("ctc"); /* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */ /* for the 30Hz interlaced display */ @@ -439,7 +439,7 @@ INTERRUPT_GEN( mcr_interrupt ) INTERRUPT_GEN( mcr_ipu_interrupt ) { - running_device *ctc = devtag_get_device(device->machine, "ipu_ctc"); + running_device *ctc = device->machine->device("ipu_ctc"); /* CTC line 3 is connected to 493, which is signalled once every */ /* frame at 30Hz */ @@ -606,14 +606,14 @@ static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq ) static TIMER_CALLBACK( zwackery_493_off_callback ) { - running_device *pia = devtag_get_device(machine, "pia0"); + running_device *pia = machine->device("pia0"); pia6821_ca1_w(pia, 0, 0); } static TIMER_CALLBACK( zwackery_493_callback ) { - running_device *pia = devtag_get_device(machine, "pia0"); + running_device *pia = machine->device("pia0"); pia6821_ca1_w(pia, 0, 1); timer_set(machine, machine->primary_screen->scan_period(), NULL, 0, zwackery_493_off_callback); diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c index e21af542b50..64708594750 100644 --- a/src/mame/machine/mhavoc.c +++ b/src/mame/machine/mhavoc.c @@ -102,7 +102,7 @@ MACHINE_START( mhavoc ) MACHINE_RESET( mhavoc ) { const address_space *space = cputag_get_address_space(machine, "alpha", ADDRESS_SPACE_PROGRAM); - has_gamma_cpu = (devtag_get_device(machine, "gamma") != NULL); + has_gamma_cpu = (machine->device("gamma") != NULL); memory_configure_bank(machine, "bank1", 0, 1, mhavoc_zram0, 0); memory_configure_bank(machine, "bank1", 1, 1, mhavoc_zram1, 0); @@ -223,7 +223,7 @@ WRITE8_HANDLER( mhavoc_rom_banksel_w ) CUSTOM_INPUT( tms5220_r ) { - return tms5220_readyq_r(devtag_get_device(field->port->machine, "tms")) ? 1 : 0; + return tms5220_readyq_r(field->port->machine->device("tms")) ? 1 : 0; } CUSTOM_INPUT( mhavoc_bit67_r ) @@ -328,7 +328,7 @@ static WRITE8_HANDLER( mhavocrv_speech_data_w ) static WRITE8_HANDLER( mhavocrv_speech_strobe_w ) { - running_device *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = space->machine->device("tms"); tms5220_data_w(tms, 0, speech_write_buffer); } diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c index ae5b2feed1a..15f3b20771e 100644 --- a/src/mame/machine/micro3d.c +++ b/src/mame/machine/micro3d.c @@ -349,12 +349,12 @@ READ32_HANDLER( micro3d_scc_r ) READ16_HANDLER( micro3d_tms_host_r ) { - return tms34010_host_r(devtag_get_device(space->machine, "vgb"), offset); + return tms34010_host_r(space->machine->device("vgb"), offset); } WRITE16_HANDLER( micro3d_tms_host_w ) { - tms34010_host_w(devtag_get_device(space->machine, "vgb"), offset, data); + tms34010_host_w(space->machine->device("vgb"), offset, data); } @@ -748,10 +748,10 @@ DRIVER_INIT( micro3d ) micro3d_state *state = (micro3d_state*)machine->driver_data; const address_space *space = cputag_get_address_space(machine, "drmath", ADDRESS_SPACE_DATA); - i8051_set_serial_tx_callback(devtag_get_device(machine, "audiocpu"), data_from_i8031); - i8051_set_serial_rx_callback(devtag_get_device(machine, "audiocpu"), data_to_i8031); + i8051_set_serial_tx_callback(machine->device("audiocpu"), data_from_i8031); + i8051_set_serial_rx_callback(machine->device("audiocpu"), data_to_i8031); - state->duart68681 = devtag_get_device(machine, "duart68681"); + state->duart68681 = machine->device("duart68681"); /* The Am29000 program seems to rely on RAM from 0x00470000 onwards being non-zero on a reset, otherwise the 3D object data doesn't get uploaded! */ @@ -762,7 +762,7 @@ DRIVER_INIT( micro3d ) /* TODO? BOTSS crashes when starting the final stage because the 68000 overwrites memory in use by the Am29000. Slowing down the 68000 slightly avoids this */ - cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.945f); + cpu_set_clockscale(machine->device("maincpu"), 0.945f); } DRIVER_INIT( botssa ) diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c index f59282573aa..2e116a15302 100644 --- a/src/mame/machine/midwayic.c +++ b/src/mame/machine/midwayic.c @@ -600,13 +600,13 @@ void midway_ioasic_init(running_machine *machine, int shuffle, int upper, int ye ioasic_register_state(machine); /* do we have a DCS2 sound chip connected? (most likely) */ - ioasic.has_dcs = (devtag_get_device(machine, "dcs2") != NULL || devtag_get_device(machine, "dsio") != NULL || devtag_get_device(machine, "denver") != NULL); - ioasic.has_cage = (devtag_get_device(machine, "cage") != NULL); - ioasic.dcs_cpu = devtag_get_device(machine, "dcs2"); + ioasic.has_dcs = (machine->device("dcs2") != NULL || machine->device("dsio") != NULL || machine->device("denver") != NULL); + ioasic.has_cage = (machine->device("cage") != NULL); + ioasic.dcs_cpu = machine->device("dcs2"); if (ioasic.dcs_cpu == NULL) - ioasic.dcs_cpu = devtag_get_device(machine, "dsio"); + ioasic.dcs_cpu = machine->device("dsio"); if (ioasic.dcs_cpu == NULL) - ioasic.dcs_cpu = devtag_get_device(machine, "denver"); + ioasic.dcs_cpu = machine->device("denver"); ioasic.shuffle_type = shuffle; ioasic.shuffle_map = &shuffle_maps[shuffle][0]; ioasic.auto_ack = 0; diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c index c468095d384..27e6e85607a 100644 --- a/src/mame/machine/model1.c +++ b/src/mame/machine/model1.c @@ -2035,7 +2035,7 @@ static UINT32 copro_fifoout_pop(const address_space *space) if (copro_fifoout_num == 0) { // Reading from empty FIFO causes the v60 to enter wait state - v60_stall(devtag_get_device(space->machine, "maincpu")); + v60_stall(space->machine->device("maincpu")); timer_call_after_resynch(space->machine, NULL, 0, NULL); diff --git a/src/mame/machine/mw8080bw.c b/src/mame/machine/mw8080bw.c index 252e48b4d6f..ab7285eb54e 100644 --- a/src/mame/machine/mw8080bw.c +++ b/src/mame/machine/mw8080bw.c @@ -100,16 +100,16 @@ MACHINE_START( mw8080bw ) mw8080bw_create_interrupt_timer(machine); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->samples = devtag_get_device(machine, "samples"); - state->samples1 = devtag_get_device(machine, "samples1"); - state->samples2 = devtag_get_device(machine, "samples2"); - state->sn = devtag_get_device(machine, "snsnd"); - state->sn1 = devtag_get_device(machine, "sn1"); - state->sn2 = devtag_get_device(machine, "sn2"); - state->discrete = devtag_get_device(machine, "discrete"); - state->speaker = devtag_get_device(machine, "speaker"); - state->mb14241 = devtag_get_device(machine, "mb14241"); + state->maincpu = machine->device("maincpu"); + state->samples = machine->device("samples"); + state->samples1 = machine->device("samples1"); + state->samples2 = machine->device("samples2"); + state->sn = machine->device("snsnd"); + state->sn1 = machine->device("sn1"); + state->sn2 = machine->device("sn2"); + state->discrete = machine->device("discrete"); + state->speaker = machine->device("speaker"); + state->mb14241 = machine->device("mb14241"); } diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c index 8f7365dccb2..13a504f75eb 100644 --- a/src/mame/machine/n64.c +++ b/src/mame/machine/n64.c @@ -2006,15 +2006,15 @@ WRITE32_HANDLER( n64_pif_ram_w ) MACHINE_START( n64 ) { - mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); /* configure fast RAM regions for DRC */ - mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x007fffff, FALSE, rdram); + mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, rdram); - rspdrc_set_options(devtag_get_device(machine, "rsp"), 0); - rspdrc_add_imem(devtag_get_device(machine, "rsp"), rsp_imem); - rspdrc_add_dmem(devtag_get_device(machine, "rsp"), rsp_dmem); - rspdrc_flush_drc_cache(devtag_get_device(machine, "rsp")); + rspdrc_set_options(machine->device("rsp"), 0); + rspdrc_add_imem(machine->device("rsp"), rsp_imem); + rspdrc_add_dmem(machine->device("rsp"), rsp_dmem); + rspdrc_flush_drc_cache(machine->device("rsp")); audio_timer = timer_alloc(machine, audio_timer_callback, NULL); } diff --git a/src/mame/machine/namco06.c b/src/mame/machine/namco06.c index 21f7b682dfd..06b5e0a5204 100644 --- a/src/mame/machine/namco06.c +++ b/src/mame/machine/namco06.c @@ -231,13 +231,13 @@ static DEVICE_START( namco_06xx ) assert(state->nmicpu != NULL); /* resolve our devices */ - state->device[0] = (config->chip0 != NULL) ? devtag_get_device(device->machine, config->chip0) : NULL; + state->device[0] = (config->chip0 != NULL) ? device->machine->device(config->chip0) : NULL; assert(state->device[0] != NULL || config->chip0 == NULL); - state->device[1] = (config->chip1 != NULL) ? devtag_get_device(device->machine, config->chip1) : NULL; + state->device[1] = (config->chip1 != NULL) ? device->machine->device(config->chip1) : NULL; assert(state->device[1] != NULL || config->chip1 == NULL); - state->device[2] = (config->chip2 != NULL) ? devtag_get_device(device->machine, config->chip2) : NULL; + state->device[2] = (config->chip2 != NULL) ? device->machine->device(config->chip2) : NULL; assert(state->device[2] != NULL || config->chip2 == NULL); - state->device[3] = (config->chip3 != NULL) ? devtag_get_device(device->machine, config->chip3) : NULL; + state->device[3] = (config->chip3 != NULL) ? device->machine->device(config->chip3) : NULL; assert(state->device[3] != NULL || config->chip3 == NULL); /* loop over devices and set their read/write handlers */ diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c index 811996eb1d3..4498aab7a3c 100644 --- a/src/mame/machine/namcos1.c +++ b/src/mame/machine/namcos1.c @@ -619,7 +619,7 @@ static READ8_HANDLER( soundram_r ) offset &= 0x3ff; /* CUS 30 */ - return namcos1_cus30_r(devtag_get_device(space->machine, "namco"),offset); + return namcos1_cus30_r(space->machine->device("namco"),offset); } else { @@ -637,7 +637,7 @@ static WRITE8_HANDLER( soundram_w ) offset &= 0x3ff; /* CUS 30 */ - namcos1_cus30_w(devtag_get_device(space->machine, "namco"),offset,data); + namcos1_cus30_w(space->machine->device("namco"),offset,data); } else { @@ -745,7 +745,7 @@ WRITE8_HANDLER( namcos1_bankswitch_w ) { // logerror("cpu %s: namcos1_bankswitch_w offset %04x data %02x\n", space->cpu->tag(), offset, data); - namcos1_bankswitch(space->machine, (space->cpu == devtag_get_device(space->machine, "maincpu")) ? 0 : 1, offset, data); + namcos1_bankswitch(space->machine, (space->cpu == space->machine->device("maincpu")) ? 0 : 1, offset, data); } /* Sub cpu set start bank port */ diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c index 03ea5d4a8f2..851ee78f582 100644 --- a/src/mame/machine/namcos2.c +++ b/src/mame/machine/namcos2.c @@ -494,22 +494,22 @@ ReadWriteC148( const address_space *space, offs_t offset, UINT16 data, int bWrit UINT16 *pC148RegAlt = NULL; UINT16 result = 0; - if (space->cpu == devtag_get_device(space->machine, "maincpu")) + if (space->cpu == space->machine->device("maincpu")) { pC148Reg = namcos2_68k_master_C148; - altcpu = devtag_get_device(space->machine, "slave"); + altcpu = space->machine->device("slave"); pC148RegAlt = namcos2_68k_slave_C148; } - else if (space->cpu == devtag_get_device(space->machine, "slave")) + else if (space->cpu == space->machine->device("slave")) { pC148Reg = namcos2_68k_slave_C148; - altcpu = devtag_get_device(space->machine, "maincpu"); + altcpu = space->machine->device("maincpu"); pC148RegAlt = namcos2_68k_master_C148; } - else if (space->cpu == devtag_get_device(space->machine, "gpu")) + else if (space->cpu == space->machine->device("gpu")) { pC148Reg = namcos2_68k_gpu_C148; - altcpu = devtag_get_device(space->machine, "maincpu"); + altcpu = space->machine->device("maincpu"); pC148RegAlt = namcos2_68k_master_C148; } @@ -584,7 +584,7 @@ ReadWriteC148( const address_space *space, offs_t offset, UINT16 data, int bWrit break; case 0x1e2000: /* Sound CPU Reset control */ - if (space->cpu == devtag_get_device(space->machine, "maincpu")) /* ? */ + if (space->cpu == space->machine->device("maincpu")) /* ? */ { if (data & 0x01) { @@ -609,7 +609,7 @@ ReadWriteC148( const address_space *space, offs_t offset, UINT16 data, int bWrit break; case 0x1e4000: /* Alt 68000 & IO CPU Reset */ - if (space->cpu == devtag_get_device(space->machine, "maincpu")) /* ? */ + if (space->cpu == space->machine->device("maincpu")) /* ? */ { if (data & 0x01) { /* Resume execution */ @@ -787,7 +787,7 @@ WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w ) /* If the interrupt enable bit is set trigger an A/D IRQ */ if(data & 0x20) { - generic_pulse_irq_line(devtag_get_device(space->machine, "mcu"), HD63705_INT_ADCONV); + generic_pulse_irq_line(space->machine->device("mcu"), HD63705_INT_ADCONV); } } } diff --git a/src/mame/machine/nitedrvr.c b/src/mame/machine/nitedrvr.c index 4c90bc35281..2b6c0519456 100644 --- a/src/mame/machine/nitedrvr.c +++ b/src/mame/machine/nitedrvr.c @@ -284,8 +284,8 @@ MACHINE_START( nitedrvr ) { nitedrvr_state *state = (nitedrvr_state *)machine->driver_data; - state->maincpu = devtag_get_device(machine, "maincpu"); - state->discrete = devtag_get_device(machine, "discrete"); + state->maincpu = machine->device("maincpu"); + state->discrete = machine->device("discrete"); state_save_register_global(machine, state->gear); state_save_register_global(machine, state->track); diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c index 73b3e2a1071..1244267300a 100644 --- a/src/mame/machine/nmk004.c +++ b/src/mame/machine/nmk004.c @@ -1021,9 +1021,9 @@ static TIMER_CALLBACK( real_nmk004_init ) memset(&NMK004_state, 0, sizeof(NMK004_state)); NMK004_state.machine = machine; - NMK004_state.ymdevice = devtag_get_device(machine, "ymsnd"); - NMK004_state.oki1device = devtag_get_device(machine, "oki1"); - NMK004_state.oki2device = devtag_get_device(machine, "oki2"); + NMK004_state.ymdevice = machine->device("ymsnd"); + NMK004_state.oki1device = machine->device("oki1"); + NMK004_state.oki2device = machine->device("oki2"); NMK004_state.rom = memory_region(machine, "audiocpu"); diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c index c08773dcf9c..d3b37c99826 100644 --- a/src/mame/machine/playch10.c +++ b/src/mame/machine/playch10.c @@ -51,7 +51,7 @@ static chr_bank chr_page[8]; // Simple wrapper for ROM/RAM, since we could be ba MACHINE_RESET( pc10 ) { - running_device *rp5h01 = devtag_get_device(machine, "rp5h01"); + running_device *rp5h01 = machine->device("rp5h01"); /* initialize latches and flip-flops */ pc10_nmi_enable = pc10_dog_di = pc10_dispmask = pc10_sdcs = pc10_int_detect = 0; @@ -84,8 +84,8 @@ MACHINE_START( pc10 ) /* move to individual boards as documentation of actual boards allows */ nt_ram = auto_alloc_array(machine, UINT8, 0x1000); - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w); - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w); if (NULL != vram) set_videoram_bank(machine, 0, 8, 0, 8); @@ -104,8 +104,8 @@ MACHINE_START( playch10_hboard ) vram = auto_alloc_array(machine, UINT8, 0x2000); - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w); - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w); } /************************************* @@ -193,7 +193,7 @@ WRITE8_HANDLER( pc10_CARTSEL_w ) READ8_HANDLER( pc10_prot_r ) { - running_device *rp5h01 = devtag_get_device(space->machine, "rp5h01"); + running_device *rp5h01 = space->machine->device("rp5h01"); int data = 0xe7; /* we only support a single cart connected at slot 0 */ @@ -209,7 +209,7 @@ READ8_HANDLER( pc10_prot_r ) WRITE8_HANDLER( pc10_prot_w ) { - running_device *rp5h01 = devtag_get_device(space->machine, "rp5h01"); + running_device *rp5h01 = space->machine->device("rp5h01"); /* we only support a single cart connected at slot 0 */ if (cart_sel == 0) { @@ -277,7 +277,7 @@ READ8_HANDLER( pc10_in1_r ) /* do the gun thing */ if (pc10_gun_controller) { - running_device *ppu = devtag_get_device(space->machine, "ppu"); + running_device *ppu = space->machine->device("ppu"); int trigger = input_port_read(space->machine, "P1"); int x = input_port_read(space->machine, "GUNX"); int y = input_port_read(space->machine, "GUNY"); @@ -869,14 +869,14 @@ static void gboard_scanline_cb( running_device *device, int scanline, int vblank if (--gboard_scanline_counter == -1) { gboard_scanline_counter = gboard_scanline_latch; - generic_pulse_irq_line(devtag_get_device(device->machine, "cart"), 0); + generic_pulse_irq_line(device->machine->device("cart"), 0); } } } static WRITE8_HANDLER( gboard_rom_switch_w ) { - running_device *ppu = devtag_get_device(space->machine, "ppu"); + running_device *ppu = space->machine->device("ppu"); /* basically, a MMC3 mapper from the nes */ diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c index bfb6aae1dad..9a819708b9b 100644 --- a/src/mame/machine/qix.c +++ b/src/mame/machine/qix.c @@ -252,7 +252,7 @@ MACHINE_START( qixmcu ) WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed ) { - running_device *pia = devtag_get_device(device->machine, "sndpia0"); + running_device *pia = device->machine->device("sndpia0"); pia6821_cb1_w(pia, 0, state); } @@ -508,7 +508,7 @@ static WRITE8_DEVICE_HANDLER( qix_coinctl_w ) static WRITE8_DEVICE_HANDLER( slither_76489_0_w ) { /* write to the sound chip */ - sn76496_w(devtag_get_device(device->machine, "sn1"), 0, data); + sn76496_w(device->machine->device("sn1"), 0, data); /* clock the ready line going back into CB1 */ pia6821_cb1_w(device, 0, 0); @@ -519,7 +519,7 @@ static WRITE8_DEVICE_HANDLER( slither_76489_0_w ) static WRITE8_DEVICE_HANDLER( slither_76489_1_w ) { /* write to the sound chip */ - sn76496_w(devtag_get_device(device->machine, "sn2"), 0, data); + sn76496_w(device->machine->device("sn2"), 0, data); /* clock the ready line going back into CB1 */ pia6821_cb1_w(device, 0, 0); diff --git a/src/mame/machine/s16fd.c b/src/mame/machine/s16fd.c index db745a86c03..84529dc3e2e 100644 --- a/src/mame/machine/s16fd.c +++ b/src/mame/machine/s16fd.c @@ -67,7 +67,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state) fd1094_state = state; - cpu_set_reg(devtag_get_device(machine, fd1094_cputag), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache + cpu_set_reg(machine->device(fd1094_cputag), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache /* set the FD1094 state ready to decrypt.. */ state = fd1094_set_state(fd1094_key, state) & 0xff; @@ -80,7 +80,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state) /* copy cached state */ fd1094_userregion = fd1094_cacheregion[i]; set_decrypted_region(machine); - m68k_set_encrypted_opcode_range(devtag_get_device(machine, fd1094_cputag), 0, fd1094_cpuregionsize); + m68k_set_encrypted_opcode_range(machine->device(fd1094_cputag), 0, fd1094_cpuregionsize); return; } @@ -99,7 +99,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state) /* copy newly decrypted data to user region */ fd1094_userregion = fd1094_cacheregion[fd1094_current_cacheposition]; set_decrypted_region(machine); - m68k_set_encrypted_opcode_range(devtag_get_device(machine, fd1094_cputag), 0, fd1094_cpuregionsize); + m68k_set_encrypted_opcode_range(machine->device(fd1094_cputag), 0, fd1094_cpuregionsize); fd1094_current_cacheposition++; @@ -166,7 +166,7 @@ static STATE_POSTLOAD( fd1094_postload ) int selected_state = fd1094_selected_state; int state = fd1094_state; - fd1094_machine_init(devtag_get_device(machine, fd1094_cputag)); + fd1094_machine_init(machine->device(fd1094_cputag)); fd1094_setstate_and_decrypt(machine, selected_state); fd1094_setstate_and_decrypt(machine, state); @@ -192,7 +192,7 @@ static void key_changed(running_machine *machine) fd1094_current_cacheposition = 1; /* flush the prefetch queue */ - cpu_set_reg(devtag_get_device(machine, fd1094_cputag), M68K_PREF_ADDR, 0x0010); + cpu_set_reg(machine->device(fd1094_cputag), M68K_PREF_ADDR, 0x0010); } diff --git a/src/mame/machine/s24fd.c b/src/mame/machine/s24fd.c index c689bda8869..2d363298558 100644 --- a/src/mame/machine/s24fd.c +++ b/src/mame/machine/s24fd.c @@ -43,7 +43,7 @@ static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state) fd1094_state = state; - cpu_set_reg(devtag_get_device(machine, "sub"), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache + cpu_set_reg(machine->device("sub"), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache /* set the s24_fd1094 state ready to decrypt.. */ state = fd1094_set_state(s24_fd1094_key,state) & 0xff; @@ -56,7 +56,7 @@ static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state) /* copy cached state */ s24_fd1094_userregion = s24_fd1094_cacheregion[i]; memory_set_decrypted_region(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion); - m68k_set_encrypted_opcode_range(devtag_get_device(machine, "sub"), 0, s24_fd1094_cpuregionsize); + m68k_set_encrypted_opcode_range(machine->device("sub"), 0, s24_fd1094_cpuregionsize); return; } @@ -77,7 +77,7 @@ static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state) /* copy newly decrypted data to user region */ s24_fd1094_userregion = s24_fd1094_cacheregion[fd1094_current_cacheposition]; memory_set_decrypted_region(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion); - m68k_set_encrypted_opcode_range(devtag_get_device(machine, "sub"), 0, s24_fd1094_cpuregionsize); + m68k_set_encrypted_opcode_range(machine->device("sub"), 0, s24_fd1094_cpuregionsize); fd1094_current_cacheposition++; @@ -130,9 +130,9 @@ void s24_fd1094_machine_init(running_machine *machine) s24_fd1094_setstate_and_decrypt(machine, FD1094_STATE_RESET); s24_fd1094_kludge_reset_values(); - m68k_set_cmpild_callback(devtag_get_device(machine, "sub"), s24_fd1094_cmp_callback); - m68k_set_rte_callback(devtag_get_device(machine, "sub"), s24_fd1094_rte_callback); - cpu_set_irq_callback(devtag_get_device(machine, "sub"), s24_fd1094_int_callback); + m68k_set_cmpild_callback(machine->device("sub"), s24_fd1094_cmp_callback); + m68k_set_rte_callback(machine->device("sub"), s24_fd1094_rte_callback); + cpu_set_irq_callback(machine->device("sub"), s24_fd1094_int_callback); machine->device("sub")->reset(); } diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c index 484fe87c584..efdba395859 100644 --- a/src/mame/machine/scramble.c +++ b/src/mame/machine/scramble.c @@ -20,7 +20,7 @@ MACHINE_RESET( scramble ) { MACHINE_RESET_CALL(galaxold); - if (devtag_get_device(machine, "audiocpu") != NULL) + if (machine->device("audiocpu") != NULL) scramble_sh_init(machine); security_2B_counter = 0; @@ -60,7 +60,7 @@ static WRITE8_DEVICE_HANDLER( scramble_protection_w ) static READ8_DEVICE_HANDLER( scramble_protection_r ) { - switch (cpu_get_pc(devtag_get_device(device->machine, "maincpu"))) + switch (cpu_get_pc(device->machine->device("maincpu"))) { case 0x00a8: return 0xf0; case 0x00be: return 0xb0; @@ -120,9 +120,9 @@ static READ8_HANDLER( cavelon_banksw_r ) cavelon_banksw(space->machine); if ((offset >= 0x0100) && (offset <= 0x0103)) - return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset - 0x0100); + return ppi8255_r(space->machine->device("ppi8255_0"), offset - 0x0100); else if ((offset >= 0x0200) && (offset <= 0x0203)) - return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset - 0x0200); + return ppi8255_r(space->machine->device("ppi8255_1"), offset - 0x0200); return 0xff; } @@ -132,9 +132,9 @@ static WRITE8_HANDLER( cavelon_banksw_w ) cavelon_banksw(space->machine); if ((offset >= 0x0100) && (offset <= 0x0103)) - ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), offset - 0x0100, data); + ppi8255_w(space->machine->device("ppi8255_0"), offset - 0x0100, data); else if ((offset >= 0x0200) && (offset <= 0x0203)) - ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset - 0x0200, data); + ppi8255_w(space->machine->device("ppi8255_1"), offset - 0x0200, data); } diff --git a/src/mame/machine/simpsons.c b/src/mame/machine/simpsons.c index 46dcf638fda..68a0bb5800d 100644 --- a/src/mame/machine/simpsons.c +++ b/src/mame/machine/simpsons.c @@ -86,12 +86,12 @@ MACHINE_START( simpsons ) state->xtraram = auto_alloc_array_clear(machine, UINT8, 0x1000); state->spriteram = auto_alloc_array_clear(machine, UINT16, 0x1000 / 2); - state->maincpu = devtag_get_device(machine, "maincpu"); - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->k053260 = devtag_get_device(machine, "k053260"); - state->k052109 = devtag_get_device(machine, "k052109"); - state->k053246 = devtag_get_device(machine, "k053246"); - state->k053251 = devtag_get_device(machine, "k053251"); + state->maincpu = machine->device("maincpu"); + state->audiocpu = machine->device("audiocpu"); + state->k053260 = machine->device("k053260"); + state->k052109 = machine->device("k052109"); + state->k053246 = machine->device("k053246"); + state->k053251 = machine->device("k053251"); state_save_register_global(machine, state->firq_enabled); state_save_register_global(machine, state->video_bank); @@ -109,7 +109,7 @@ MACHINE_RESET( simpsons ) simpsons_state *state = (simpsons_state *)machine->driver_data; int i; - konami_configure_set_lines(devtag_get_device(machine, "maincpu"), simpsons_banking); + konami_configure_set_lines(machine->device("maincpu"), simpsons_banking); for (i = 0; i < 3; i++) { diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c index 7ea5808bd81..9a45d14db83 100644 --- a/src/mame/machine/slikshot.c +++ b/src/mame/machine/slikshot.c @@ -506,7 +506,7 @@ static TIMER_CALLBACK( delayed_z80_control_w ) /* this is a big kludge: only allow a reset if the Z80 is stopped */ /* at its endpoint; otherwise, we never get a result from the Z80 */ - if ((data & 0x10) || cpu_get_reg(devtag_get_device(machine, "sub"), Z80_PC) == 0x13a) + if ((data & 0x10) || cpu_get_reg(machine->device("sub"), Z80_PC) == 0x13a) { cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c index 2346c7d3fcc..f29ff6d9616 100644 --- a/src/mame/machine/snes.c +++ b/src/mame/machine/snes.c @@ -1679,7 +1679,7 @@ static void snes_init_ram( running_machine *machine ) static DIRECT_UPDATE_HANDLER( spc_direct ) { - direct->raw = direct->decrypted = spc_get_ram(devtag_get_device(space->machine, "spc700")); + direct->raw = direct->decrypted = spc_get_ram(space->machine->device("spc700")); return ~0; } diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c index e4706d1df31..3c17246b5e4 100644 --- a/src/mame/machine/starwars.c +++ b/src/mame/machine/starwars.c @@ -113,7 +113,7 @@ WRITE8_HANDLER( starwars_out_w ) break; case 7: /* NVRAM array recall */ - x2212_array_recall(devtag_get_device(space->machine, "x2212"), data >> 7); + x2212_array_recall(space->machine->device("x2212"), data >> 7); break; } } diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c index 0f4b1485f9e..62ce635ea0c 100644 --- a/src/mame/machine/stvcd.c +++ b/src/mame/machine/stvcd.c @@ -258,7 +258,7 @@ void stvcd_reset(running_machine *machine) } #ifdef MESS - cdrom = mess_cd_get_cdrom_file(devtag_get_device( machine, "cdrom" )); + cdrom = mess_cd_get_cdrom_file(machine->device( "cdrom" )); #else cdrom = cdrom_open(get_disk_handle(machine, "cdrom")); #endif diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c index 355259c50c0..b53410a3217 100644 --- a/src/mame/machine/taitosj.c +++ b/src/mame/machine/taitosj.c @@ -53,7 +53,7 @@ MACHINE_RESET( taitosj ) zaccept = 1; zready = 0; busreq = 0; - if (devtag_get_device(machine, "mcu") != NULL) + if (machine->device("mcu") != NULL) cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE); spacecr_prot_value = 0; diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c index 88f57c81470..1e89474f78c 100644 --- a/src/mame/machine/tnzs.c +++ b/src/mame/machine/tnzs.c @@ -693,9 +693,9 @@ MACHINE_START( tnzs ) state->bank1 = 2; state->bank2 = 0; - state->audiocpu = devtag_get_device(machine, "audiocpu"); - state->subcpu = devtag_get_device(machine, "sub"); - state->mcu = devtag_get_device(machine, "mcu"); + state->audiocpu = machine->device("audiocpu"); + state->subcpu = machine->device("sub"); + state->mcu = machine->device("mcu"); state_save_register_global(machine, state->screenflip); state_save_register_global(machine, state->kageki_csport_sel); @@ -725,7 +725,7 @@ MACHINE_START( jpopnics ) memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000); memory_configure_bank(machine, "bank2", 0, 4, &SUB[0x10000], 0x2000); - state->subcpu = devtag_get_device(machine, "sub"); + state->subcpu = machine->device("sub"); state->mcu = NULL; state->bank1 = 2; diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c index 378eb61e716..02e24d8569c 100644 --- a/src/mame/machine/tx1.c +++ b/src/mame/machine/tx1.c @@ -402,7 +402,7 @@ static void kick_sn74s516(running_machine *machine, UINT16 *data, const int ins) } math.dbgaddr = math.promaddr; - math.dbgpc = cpu_get_previouspc(devtag_get_device(machine, "math_cpu")); + math.dbgpc = cpu_get_previouspc(machine->device("math_cpu")); } diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c index d7ffd23eb3b..1664a46f66f 100644 --- a/src/mame/machine/vertigo.c +++ b/src/mame/machine/vertigo.c @@ -220,7 +220,7 @@ MACHINE_RESET( vertigo ) { int i; - ttl74148 = devtag_get_device(machine, "74148"); + ttl74148 = machine->device("74148"); ttl74148_enable_input_w(ttl74148, 0); for (i = 0; i < 8; i++) diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c index 31f00e6c53c..89220fbd04f 100644 --- a/src/mame/machine/vsnes.c +++ b/src/mame/machine/vsnes.c @@ -201,7 +201,7 @@ static void v_set_videorom_bank( running_machine* machine, int start, int count, MACHINE_START( vsnes ) { - const address_space *ppu1_space = cpu_get_address_space(devtag_get_device(machine, "ppu1"), ADDRESS_SPACE_PROGRAM); + const address_space *ppu1_space = cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM); int i; /* establish nametable ram */ @@ -256,12 +256,12 @@ MACHINE_START( vsdual ) nt_page[1][2] = nt_ram[1] + 0x800; nt_page[1][3] = nt_ram[1] + 0xc00; - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu1"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt0_r, vsnes_nt0_w); - memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu2"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt1_r, vsnes_nt1_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt0_r, vsnes_nt0_w); + memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu2"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt1_r, vsnes_nt1_w); // read only! - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu1"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank2"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank2"); // read only! - memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu2"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank3"); + memory_install_read_bank(cpu_get_address_space(machine->device("ppu2"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank3"); memory_configure_bank(machine, "bank2", 0, vrom_size[0] / 0x2000, vrom[0], 0x2000); memory_configure_bank(machine, "bank3", 0, vrom_size[1] / 0x2000, vrom[1], 0x2000); memory_set_bank(machine, "bank2", 0); @@ -362,7 +362,7 @@ DRIVER_INIT( vsnormal ) static WRITE8_HANDLER( gun_in0_w ) { - running_device *ppu1 = devtag_get_device(space->machine, "ppu1"); + running_device *ppu1 = space->machine->device("ppu1"); static int zapstore; if (vsnes_do_vrom_bank) @@ -699,7 +699,7 @@ static void mapper4_irq( running_device *device, int scanline, int vblank, int b static WRITE8_HANDLER( mapper4_w ) { - running_device *ppu1 = devtag_get_device(space->machine, "ppu1"); + running_device *ppu1 = space->machine->device("ppu1"); UINT8 MMC3_helper, cmd; switch (offset & 0x6001) @@ -1019,16 +1019,16 @@ DRIVER_INIT( bnglngby ) static WRITE8_HANDLER( vsdual_vrom_banking ) { - running_device *other_cpu = (space->cpu == devtag_get_device(space->machine, "maincpu")) ? devtag_get_device(space->machine, "sub") : devtag_get_device(space->machine, "maincpu"); + running_device *other_cpu = (space->cpu == space->machine->device("maincpu")) ? space->machine->device("sub") : space->machine->device("maincpu"); /* switch vrom */ - (space->cpu == devtag_get_device(space->machine, "maincpu")) ? memory_set_bank(space->machine, "bank2", BIT(data, 2)) : memory_set_bank(space->machine, "bank3", BIT(data, 2)); + (space->cpu == space->machine->device("maincpu")) ? memory_set_bank(space->machine, "bank2", BIT(data, 2)) : memory_set_bank(space->machine, "bank3", BIT(data, 2)); /* bit 1 ( data & 2 ) triggers irq on the other cpu */ cpu_set_input_line(other_cpu, 0, (data & 2) ? CLEAR_LINE : ASSERT_LINE); /* move along */ - if (space->cpu == devtag_get_device(space->machine, "maincpu")) + if (space->cpu == space->machine->device("maincpu")) vsnes_in0_w(space, offset, data); else vsnes_in0_1_w(space, offset, data); diff --git a/src/mame/video/antic.c b/src/mame/video/antic.c index 5c5ffb3194b..4a3cb01b051 100644 --- a/src/mame/video/antic.c +++ b/src/mame/video/antic.c @@ -90,7 +90,7 @@ READ8_HANDLER ( atari_antic_r ) data = antic.r.antic09; break; case 10: /* WSYNC read */ - cpu_spinuntil_trigger(devtag_get_device(space->machine, "maincpu"), TRIGGER_HSYNC); + cpu_spinuntil_trigger(space->machine->device("maincpu"), TRIGGER_HSYNC); antic.w.wsync = 1; data = antic.r.antic0a; break; @@ -200,7 +200,7 @@ WRITE8_HANDLER ( atari_antic_w ) break; case 10: /* WSYNC write */ LOG(("ANTIC 0A write WSYNC $%02X\n", data)); - cpu_spinuntil_trigger(devtag_get_device(space->machine, "maincpu"), TRIGGER_HSYNC); + cpu_spinuntil_trigger(space->machine->device("maincpu"), TRIGGER_HSYNC); antic.w.wsync = 1; break; case 11: diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c index 7b7a8129c35..edcc659b370 100644 --- a/src/mame/video/astrocde.c +++ b/src/mame/video/astrocde.c @@ -646,7 +646,7 @@ WRITE8_HANDLER( astrocade_data_chip_register_w ) case 0x17: /* noise volume register */ case 0x18: /* sound block transfer */ if (astrocade_video_config & AC_SOUND_PRESENT) - astrocade_sound_w(devtag_get_device(space->machine, "astrocade1"), offset, data); + astrocade_sound_w(space->machine->device("astrocade1"), offset, data); break; case 0x19: /* expand register */ diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c index 9dd9df3c8d8..e4fe1e096c4 100644 --- a/src/mame/video/atari.c +++ b/src/mame/video/atari.c @@ -1160,7 +1160,7 @@ static TIMER_CALLBACK( antic_steal_cycles ) LOG((" @cycle #%3d steal %d cycles\n", cycle(machine), antic.steal_cycles)); after(machine, antic.steal_cycles, antic_line_done, "antic_line_done"); antic.steal_cycles = 0; - cpu_spinuntil_trigger( devtag_get_device(machine, "maincpu"), TRIGGER_STEAL ); + cpu_spinuntil_trigger( machine->device("maincpu"), TRIGGER_STEAL ); } diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c index 4921d676988..24b95de6a60 100644 --- a/src/mame/video/atarisy1.c +++ b/src/mame/video/atarisy1.c @@ -399,7 +399,7 @@ TIMER_DEVICE_CALLBACK( atarisy1_int3_callback ) int scanline = param; /* update the state */ - atarigen_scanline_int_gen(devtag_get_device(timer.machine, "maincpu")); + atarigen_scanline_int_gen(timer.machine->device("maincpu")); /* set a timer to turn it off */ state->int3off_timer->adjust(timer.machine->primary_screen->scan_period()); diff --git a/src/mame/video/beezer.c b/src/mame/video/beezer.c index b11c5358901..dc34cfbdd9d 100644 --- a/src/mame/video/beezer.c +++ b/src/mame/video/beezer.c @@ -7,7 +7,7 @@ static int scanline=0; INTERRUPT_GEN( beezer_interrupt ) { - running_device *via_0 = devtag_get_device(device->machine, "via6522_0"); + running_device *via_0 = device->machine->device("via6522_0"); scanline = (scanline + 1) % 0x80; via_ca2_w(via_0, (scanline & 0x10) ? 1 : 0); diff --git a/src/mame/video/blstroid.c b/src/mame/video/blstroid.c index 6f9c81b8b4d..d6428a5e14d 100644 --- a/src/mame/video/blstroid.c +++ b/src/mame/video/blstroid.c @@ -100,7 +100,7 @@ static TIMER_CALLBACK( irq_off ) static TIMER_CALLBACK( irq_on ) { /* generate the interrupt */ - atarigen_scanline_int_gen(devtag_get_device(machine, "maincpu")); + atarigen_scanline_int_gen(machine->device("maincpu")); atarigen_update_interrupts(machine); } diff --git a/src/mame/video/cidelsa.c b/src/mame/video/cidelsa.c index b4e62b59c0d..f658d1d900a 100644 --- a/src/mame/video/cidelsa.c +++ b/src/mame/video/cidelsa.c @@ -190,7 +190,7 @@ static void video_start(running_machine *machine, UINT16 pageram_size) state->charram = auto_alloc_array(machine, UINT8, CIDELSA_CHARRAM_SIZE); /* find devices */ - state->cdp1869 = devtag_get_device(machine, CDP1869_TAG); + state->cdp1869 = machine->device(CDP1869_TAG); /* register for state saving */ state_save_register_global(machine, state->cdp1869_pcb); diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c index 5a206ec49d5..93648e5a754 100644 --- a/src/mame/video/cinemat.c +++ b/src/mame/video/cinemat.c @@ -226,7 +226,7 @@ VIDEO_UPDATE( cinemat ) VIDEO_UPDATE_CALL(vector); vector_clear_list(); - ccpu_wdt_timer_trigger(devtag_get_device(screen->machine, "maincpu")); + ccpu_wdt_timer_trigger(screen->machine->device("maincpu")); return 0; } diff --git a/src/mame/video/cyberbal.c b/src/mame/video/cyberbal.c index 85eeb765f10..74ed950bc6a 100644 --- a/src/mame/video/cyberbal.c +++ b/src/mame/video/cyberbal.c @@ -343,9 +343,9 @@ static void update_one_screen(screen_device &screen, bitmap_t *bitmap, const rec rectangle visarea = screen.visible_area(); /* for 2p games, the left screen is the main screen */ - running_device *left_screen = devtag_get_device(screen.machine, "lscreen"); + running_device *left_screen = screen.machine->device("lscreen"); if (left_screen == NULL) - left_screen = devtag_get_device(screen.machine, "screen"); + left_screen = screen.machine->device("screen"); /* draw the playfield */ tilemap_draw(bitmap, cliprect, (&screen == left_screen) ? state->atarigen.playfield_tilemap : state->atarigen.playfield2_tilemap, 0, 0); diff --git a/src/mame/video/djmain.c b/src/mame/video/djmain.c index fa10dbd306e..2f3ae3ec514 100644 --- a/src/mame/video/djmain.c +++ b/src/mame/video/djmain.c @@ -14,7 +14,7 @@ UINT32 *djmain_obj_ram; static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect) { - running_device *k055555 = devtag_get_device(machine, "k055555"); + running_device *k055555 = machine->device("k055555"); int offs, pri_code; int sortedlist[NUM_SPRITES]; @@ -135,7 +135,7 @@ void djmain_tile_callback(running_machine* machine, int layer, int *code, int *c VIDEO_START( djmain ) { - running_device *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = machine->device("k056832"); k056832_set_layer_offs(k056832, 0, -92, -27); // k056832_set_layer_offs(k056832, 1, -87, -27); @@ -144,8 +144,8 @@ VIDEO_START( djmain ) VIDEO_UPDATE( djmain ) { - running_device *k056832 = devtag_get_device(screen->machine, "k056832"); - running_device *k055555 = devtag_get_device(screen->machine, "k055555"); + running_device *k056832 = screen->machine->device("k056832"); + running_device *k055555 = screen->machine->device("k055555"); int enables = k055555_read_register(k055555, K55_INPUT_ENABLES); int pri[NUM_LAYERS + 1]; int order[NUM_LAYERS + 1]; diff --git a/src/mame/video/exterm.c b/src/mame/video/exterm.c index b13a53c2209..700ba969d3e 100644 --- a/src/mame/video/exterm.c +++ b/src/mame/video/exterm.c @@ -78,7 +78,7 @@ void exterm_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanlin int x; /* get parameters for the slave CPU */ - tms34010_get_display_params(devtag_get_device(screen.machine, "slave"), &fgparams); + tms34010_get_display_params(screen.machine->device("slave"), &fgparams); /* compute info about the slave vram */ if (fgparams.enabled && scanline >= fgparams.veblnk && scanline < fgparams.vsblnk && fgparams.heblnk < fgparams.hsblnk) diff --git a/src/mame/video/gaelco2.c b/src/mame/video/gaelco2.c index 21c9208050d..8871c01a629 100644 --- a/src/mame/video/gaelco2.c +++ b/src/mame/video/gaelco2.c @@ -468,8 +468,8 @@ VIDEO_UPDATE( gaelco2_dual ) { int i; - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *right_screen = screen->machine->device("rscreen"); /* read scroll values */ int scroll0x = gaelco2_videoram[0x2802/2] + 0x14; diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c index f4bc3b29984..d00f97b2dc5 100644 --- a/src/mame/video/galastrm.c +++ b/src/mame/video/galastrm.c @@ -449,8 +449,8 @@ static void tc0610_rotate_draw(running_machine *machine, bitmap_t *bitmap, bitma VIDEO_UPDATE( galastrm ) { - running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = screen->machine->device("tc0100scn"); + running_device *tc0480scp = screen->machine->device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c index 5df8d47ce51..7b95dbaa1e5 100644 --- a/src/mame/video/galpanic.c +++ b/src/mame/video/galpanic.c @@ -101,7 +101,7 @@ static void draw_fgbitmap(bitmap_t *bitmap, const rectangle *cliprect) VIDEO_UPDATE( galpanic ) { - running_device *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = screen->machine->device("pandora"); /* copy the temporary bitmap to the screen */ copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,0,0,cliprect); diff --git a/src/mame/video/genesis.c b/src/mame/video/genesis.c index 8ba53ba084c..0ab9bd89d03 100644 --- a/src/mame/video/genesis.c +++ b/src/mame/video/genesis.c @@ -325,7 +325,7 @@ WRITE16_HANDLER( genesis_vdp_w ) case 0x09: case 0x0a: case 0x0b: - device = devtag_get_device(space->machine, "snsnd"); + device = space->machine->device("snsnd"); if (device != NULL && ACCESSING_BITS_0_7) sn76496_w(device, 0, data & 0xff); break; diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c index 4a28cdb5f39..2c578998748 100644 --- a/src/mame/video/groundfx.c +++ b/src/mame/video/groundfx.c @@ -212,8 +212,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan VIDEO_UPDATE( groundfx ) { - running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = screen->machine->device("tc0100scn"); + running_device *tc0480scp = screen->machine->device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c index 2125da4cb9e..deff5fbb7ed 100644 --- a/src/mame/video/gticlub.c +++ b/src/mame/video/gticlub.c @@ -311,18 +311,18 @@ READ32_HANDLER( K001005_r ) if (K001005_fifo_read_ptr < 0x3ff) { //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE); - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, CLEAR_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE); } else { //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE); - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE); } } else { //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE); - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE); } K001005_fifo_read_ptr++; @@ -364,18 +364,18 @@ WRITE32_HANDLER( K001005_w ) if (K001005_fifo_write_ptr < 0x400) { //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE); - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE); } else { //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE); - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, CLEAR_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE); } } else { //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE); - sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE); } // mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, cpu_get_pc(space->cpu)); @@ -979,7 +979,7 @@ VIDEO_START( gticlub ) VIDEO_UPDATE( gticlub ) { - running_device *k001604 = devtag_get_device(screen->machine, "k001604_1"); + running_device *k001604 = screen->machine->device("k001604_1"); k001604_draw_back_layer(k001604, bitmap, cliprect); @@ -1041,7 +1041,7 @@ VIDEO_UPDATE( gticlub ) draw_7segment_led(bitmap, 9, 3, gticlub_led_reg1); //cputag_set_input_line(screen->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE); - sharc_set_flag_input(devtag_get_device(screen->machine, "dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE); return 0; } diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c index befb372bc81..f65f42990e4 100644 --- a/src/mame/video/gunbustr.c +++ b/src/mame/video/gunbustr.c @@ -212,7 +212,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); VIDEO_UPDATE( gunbustr ) { - running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0480scp = screen->machine->device("tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c index 5c0da7ed44d..ef4645d8e7b 100644 --- a/src/mame/video/jaguar.c +++ b/src/mame/video/jaguar.c @@ -682,7 +682,7 @@ static TIMER_CALLBACK( jaguar_pit ) if (gpu_regs[PIT0]) { - sample_period = ATTOTIME_IN_NSEC(cpu_get_clock(devtag_get_device(machine,"gpu")) / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1])); + sample_period = ATTOTIME_IN_NSEC(cpu_get_clock(machine->device("gpu")) / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1])); // timer_set(machine, sample_period, NULL, 0, jaguar_pit); } } @@ -712,7 +712,7 @@ WRITE16_HANDLER( jaguar_tom_regs_w ) case PIT1: if (gpu_regs[PIT0]) { - sample_period = ATTOTIME_IN_NSEC(cpu_get_clock(devtag_get_device(space->machine,"gpu")) / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1])); + sample_period = ATTOTIME_IN_NSEC(cpu_get_clock(space->machine->device("gpu")) / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1])); timer_set(space->machine, sample_period, NULL, 0, jaguar_pit); } break; diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c index 7330927a962..14867ae2b78 100644 --- a/src/mame/video/kaneko16.c +++ b/src/mame/video/kaneko16.c @@ -1121,7 +1121,7 @@ VIDEO_UPDATE( galsnew ) VIDEO_UPDATE( sandscrp ) { - running_device *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = screen->machine->device("pandora"); kaneko16_fill_bitmap(screen->machine,bitmap,cliprect); // if the display is disabled, do nothing? diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index 3f50b77c639..b709171cb43 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -2388,8 +2388,8 @@ VIDEO_UPDATE(konamigx) if (konamigx_has_dual_screen) { - running_device *left_screen = devtag_get_device(screen->machine, "screen"); - running_device *right_screen = devtag_get_device(screen->machine, "screen2"); + running_device *left_screen = screen->machine->device("screen"); + running_device *right_screen = screen->machine->device("screen2"); /* the video gets demuxed by a board which plugs into the jamma connector */ if (screen==left_screen) @@ -2599,8 +2599,8 @@ VIDEO_UPDATE(konamigx) if (konamigx_has_dual_screen) { - running_device *left_screen = devtag_get_device(screen->machine, "screen"); - running_device *right_screen = devtag_get_device(screen->machine, "screen2"); + running_device *left_screen = screen->machine->device("screen"); + running_device *right_screen = screen->machine->device("screen2"); if (screen==left_screen) { diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c index 27e092b9e8b..46425c74621 100644 --- a/src/mame/video/konicdev.c +++ b/src/mame/video/konicdev.c @@ -7921,7 +7921,7 @@ static DEVICE_START( k056832 ) k056832->active_layer = 0; k056832->linemap_enabled = 0; - k056832->k055555 = devtag_get_device(device->machine, intf->k055555); + k056832->k055555 = device->machine->device(intf->k055555); memset(k056832->line_dirty, 0, sizeof(UINT32) * K056832_PAGE_COUNT * 8); @@ -8414,7 +8414,7 @@ static DEVICE_START( k054338 ) const k054338_interface *intf = k054338_get_interface(device); k054338->screen = device->machine->device(intf->screen); - k054338->k055555 = devtag_get_device(device->machine, intf->k055555); + k054338->k055555 = device->machine->device(intf->k055555); k054338->alphainverted = intf->alpha_inv; @@ -10079,10 +10079,10 @@ static DEVICE_START( k001005 ) const k001005_interface *intf = k001005_get_interface(device); int i, width, height; - k001005->cpu = devtag_get_device(device->machine, intf->cpu); - k001005->dsp = devtag_get_device(device->machine, intf->dsp); - k001005->k001006_1 = devtag_get_device(device->machine, intf->k001006_1); - k001005->k001006_2 = devtag_get_device(device->machine, intf->k001006_2); + k001005->cpu = device->machine->device(intf->cpu); + k001005->dsp = device->machine->device(intf->dsp); + k001005->k001006_1 = device->machine->device(intf->k001006_1); + k001005->k001006_2 = device->machine->device(intf->k001006_2); k001005->screen = device->machine->device(intf->screen); width = k001005->screen->width(); diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c index 29f51c59b9c..eaaa9596ac5 100644 --- a/src/mame/video/megasys1.c +++ b/src/mame/video/megasys1.c @@ -455,7 +455,7 @@ WRITE16_HANDLER( megasys1_vregs_A_w ) case 0x100/2 : megasys1_sprite_flag = new_data; break; case 0x300/2 : megasys1_screen_flag = new_data; - if (devtag_get_device(space->machine, "soundcpu")) + if (space->machine->device("soundcpu")) { if (new_data & 0x10) cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE); diff --git a/src/mame/video/nbmj8688.c b/src/mame/video/nbmj8688.c index 98de201d7b7..dd9c009005b 100644 --- a/src/mame/video/nbmj8688.c +++ b/src/mame/video/nbmj8688.c @@ -717,9 +717,9 @@ VIDEO_UPDATE( mbmj8688_LCD ) { int x, y, b; - running_device *main_screen = devtag_get_device(screen->machine, "screen"); - running_device *lcd0_screen = devtag_get_device(screen->machine, "lcd0"); - running_device *lcd1_screen = devtag_get_device(screen->machine, "lcd1"); + running_device *main_screen = screen->machine->device("screen"); + running_device *lcd0_screen = screen->machine->device("lcd0"); + running_device *lcd1_screen = screen->machine->device("lcd1"); if (screen == main_screen) VIDEO_UPDATE_CALL(mbmj8688); diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c index b39766da6f3..4fecf9aa8c3 100644 --- a/src/mame/video/playch10.c +++ b/src/mame/video/playch10.c @@ -118,12 +118,12 @@ VIDEO_START( playch10_hboard ) VIDEO_UPDATE( playch10 ) { - running_device *ppu = devtag_get_device(screen->machine, "ppu"); + running_device *ppu = screen->machine->device("ppu"); /* Dual monitor version */ if (pc10_bios == 1) { - running_device *top_screen = devtag_get_device(screen->machine, "top"); + running_device *top_screen = screen->machine->device("top"); /* On Playchoice 10 single monitor, this bit toggles */ /* between PPU and BIOS display. */ diff --git a/src/mame/video/plygonet.c b/src/mame/video/plygonet.c index 1aba2451ac2..4661ee1c378 100644 --- a/src/mame/video/plygonet.c +++ b/src/mame/video/plygonet.c @@ -123,7 +123,7 @@ VIDEO_START( polygonet ) VIDEO_UPDATE( polygonet ) { - running_device *k053936 = devtag_get_device(screen->machine, "k053936"); + running_device *k053936 = screen->machine->device("k053936"); bitmap_fill(screen->machine->priority_bitmap, NULL, 0); bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); diff --git a/src/mame/video/psikyo4.c b/src/mame/video/psikyo4.c index 346f2dc0058..eb728d709ca 100644 --- a/src/mame/video/psikyo4.c +++ b/src/mame/video/psikyo4.c @@ -129,8 +129,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect VIDEO_UPDATE( psikyo4 ) { - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *right_screen = screen->machine->device("rscreen"); if (screen == left_screen) { diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c index 8980b8c0e8d..95e0b90da26 100644 --- a/src/mame/video/punchout.c +++ b/src/mame/video/punchout.c @@ -370,8 +370,8 @@ static void punchout_copy_bot_palette(running_machine *machine, int bank) VIDEO_UPDATE( punchout ) { - running_device *top_screen = devtag_get_device(screen->machine, "top"); - running_device *bottom_screen = devtag_get_device(screen->machine, "bottom"); + running_device *top_screen = screen->machine->device("top"); + running_device *bottom_screen = screen->machine->device("bottom"); if (screen == top_screen) { @@ -404,8 +404,8 @@ VIDEO_UPDATE( punchout ) VIDEO_UPDATE( armwrest ) { - running_device *top_screen = devtag_get_device(screen->machine, "top"); - running_device *bottom_screen = devtag_get_device(screen->machine, "bottom"); + running_device *top_screen = screen->machine->device("top"); + running_device *bottom_screen = screen->machine->device("bottom"); if (screen == top_screen) { diff --git a/src/mame/video/qdrmfgp.c b/src/mame/video/qdrmfgp.c index 6f3744f49ea..ce204d5af29 100644 --- a/src/mame/video/qdrmfgp.c +++ b/src/mame/video/qdrmfgp.c @@ -29,7 +29,7 @@ void qdrmfgp2_tile_callback(running_machine *machine, int layer, int *code, int VIDEO_START( qdrmfgp ) { - running_device *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = machine->device("k056832"); k056832_set_layer_association(k056832, 0); @@ -41,7 +41,7 @@ VIDEO_START( qdrmfgp ) VIDEO_START( qdrmfgp2 ) { - running_device *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = machine->device("k056832"); k056832_set_layer_association(k056832, 0); @@ -59,7 +59,7 @@ VIDEO_START( qdrmfgp2 ) VIDEO_UPDATE( qdrmfgp ) { - running_device *k056832 = devtag_get_device(screen->machine, "k056832"); + running_device *k056832 = screen->machine->device("k056832"); bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1); diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c index b0777c789cc..5a588ab9593 100644 --- a/src/mame/video/qix.c +++ b/src/mame/video/qix.c @@ -350,7 +350,7 @@ static MC6845_UPDATE_ROW( update_row ) static VIDEO_UPDATE( qix ) { - running_device *mc6845 = devtag_get_device(screen->machine, MC6845_TAG); + running_device *mc6845 = screen->machine->device(MC6845_TAG); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/video/sega16sp.c b/src/mame/video/sega16sp.c index 253f642aaed..d0a7359dcef 100644 --- a/src/mame/video/sega16sp.c +++ b/src/mame/video/sega16sp.c @@ -1461,9 +1461,9 @@ void segaic16_sprites_draw(running_device *screen, bitmap_t *bitmap, const recta sega16sp_state *sega16sp; if (!which) - device = devtag_get_device(screen->machine,"segaspr1"); + device = screen->machine->device("segaspr1"); else - device = devtag_get_device(screen->machine,"segaspr2"); + device = screen->machine->device("segaspr2"); if (!device) fatalerror("segaic16_sprites_draw device not found\n"); @@ -1491,9 +1491,9 @@ void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum, running_device* device = 0; if (!which) - device = devtag_get_device(machine,"segaspr1"); + device = machine->device("segaspr1"); else - device = devtag_get_device(machine,"segaspr2"); + device = machine->device("segaspr2"); if (!device) fatalerror("segaic16_sprites_set_bank device not found\n"); @@ -1521,9 +1521,9 @@ void segaic16_sprites_set_flip(running_machine *machine, int which, int flip) running_device* device = 0; if (!which) - device = devtag_get_device(machine,"segaspr1"); + device = machine->device("segaspr1"); else - device = devtag_get_device(machine,"segaspr2"); + device = machine->device("segaspr2"); if (!device) fatalerror("segaic16_sprites_set_flip device not found\n"); @@ -1552,9 +1552,9 @@ void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow running_device* device = 0; if (!which) - device = devtag_get_device(machine,"segaspr1"); + device = machine->device("segaspr1"); else - device = devtag_get_device(machine,"segaspr2"); + device = machine->device("segaspr2"); if (!device) fatalerror("segaic16_sprites_set_shadow device not found\n"); @@ -1614,7 +1614,7 @@ WRITE16_HANDLER( segaic16_sprites_draw_0_w ) { running_device* device = 0; - device = devtag_get_device(space->machine,"segaspr1"); + device = space->machine->device("segaspr1"); if (!device) fatalerror("segaic16_sprites_draw_0_w device not found\n"); @@ -1627,7 +1627,7 @@ WRITE16_HANDLER( segaic16_sprites_draw_1_w ) { running_device* device = 0; - device = devtag_get_device(space->machine,"segaspr2"); + device = space->machine->device("segaspr2"); if (!device) fatalerror("segaic16_sprites_draw_1_w device not found\n"); diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c index 422cc59b591..6ea5d062379 100644 --- a/src/mame/video/segas32.c +++ b/src/mame/video/segas32.c @@ -2624,7 +2624,7 @@ VIDEO_UPDATE( multi32 ) { UINT8 enablemask; - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *left_screen = screen->machine->device("lscreen"); /* update the visible area */ if (system32_videoram[0x1ff00/2] & 0x8000) diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index 9c40f08de78..a8b1b84037c 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -293,7 +293,7 @@ WRITE16_HANDLER( seta_vregs_w ) ---- ---- ---- ---0 Coin #0 Counter */ if (ACCESSING_BITS_0_7) { - running_device *x1_010 = devtag_get_device(space->machine, "x1snd"); + running_device *x1_010 = space->machine->device("x1snd"); seta_coin_lockout_w (space->machine, data & 0x0f); if (x1_010 != NULL) seta_sound_enable_w (x1_010, data & 0x20); diff --git a/src/mame/video/skydiver.c b/src/mame/video/skydiver.c index 01c28e055ec..66c4e747e59 100644 --- a/src/mame/video/skydiver.c +++ b/src/mame/video/skydiver.c @@ -130,7 +130,7 @@ WRITE8_HANDLER( skydiver_lamp_d_w ) WRITE8_HANDLER( skydiver_2000_201F_w ) { - running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = space->machine->device("discrete"); int bit = offset & 0x01; watchdog_reset_w(space,0,0); diff --git a/src/mame/video/sprint4.c b/src/mame/video/sprint4.c index 793eaef396a..bff518c38f7 100644 --- a/src/mame/video/sprint4.c +++ b/src/mame/video/sprint4.c @@ -94,7 +94,7 @@ VIDEO_EOF( sprint4 ) /* check for sprite-playfield collisions */ - running_device *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = machine->device("discrete"); for (i = 0; i < 4; i++) { diff --git a/src/mame/video/starcrus.c b/src/mame/video/starcrus.c index c66eecef8e6..ce832dfe4f4 100644 --- a/src/mame/video/starcrus.c +++ b/src/mame/video/starcrus.c @@ -64,7 +64,7 @@ VIDEO_START( starcrus ) WRITE8_HANDLER( starcrus_ship_parm_1_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); s1_sprite = data&0x1f; engine1_on = ((data&0x20)>>5)^0x01; @@ -90,7 +90,7 @@ WRITE8_HANDLER( starcrus_ship_parm_1_w ) WRITE8_HANDLER( starcrus_ship_parm_2_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); s2_sprite = data&0x1f; set_led_status(space->machine, 2,~data & 0x80); /* game over lamp */ @@ -118,7 +118,7 @@ WRITE8_HANDLER( starcrus_ship_parm_2_w ) WRITE8_HANDLER( starcrus_proj_parm_1_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); p1_sprite = data&0x0f; launch1_on = ((data&0x20)>>5)^0x01; @@ -157,7 +157,7 @@ WRITE8_HANDLER( starcrus_proj_parm_1_w ) WRITE8_HANDLER( starcrus_proj_parm_2_w ) { - running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = space->machine->device("samples"); p2_sprite = data&0x0f; launch2_on = ((data&0x20)>>5)^0x01; diff --git a/src/mame/video/subs.c b/src/mame/video/subs.c index e6bef04b05d..083023c7949 100644 --- a/src/mame/video/subs.c +++ b/src/mame/video/subs.c @@ -42,9 +42,9 @@ VIDEO_UPDATE( subs ) UINT8 *spriteram = screen->machine->generic.spriteram.u8; int offs; - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); - running_device *discrete = devtag_get_device(screen->machine, "discrete"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *right_screen = screen->machine->device("rscreen"); + running_device *discrete = screen->machine->device("discrete"); /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c index b7011a9f006..6c73b9efcc4 100644 --- a/src/mame/video/superchs.c +++ b/src/mame/video/superchs.c @@ -209,7 +209,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); VIDEO_UPDATE( superchs ) { - running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0480scp = screen->machine->device("tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; diff --git a/src/mame/video/tbowl.c b/src/mame/video/tbowl.c index 1380d6815d3..6a74759fdbf 100644 --- a/src/mame/video/tbowl.c +++ b/src/mame/video/tbowl.c @@ -212,8 +212,8 @@ VIDEO_START( tbowl ) VIDEO_UPDATE( tbowl ) { - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *right_screen = screen->machine->device("rscreen"); if (screen == left_screen) { diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c index 1a1a450cfda..c344049be5f 100644 --- a/src/mame/video/tceptor.c +++ b/src/mame/video/tceptor.c @@ -534,9 +534,9 @@ VIDEO_UPDATE( tceptor ) int pri; int bg_center = 144 - ((((bg1_scroll_x + bg2_scroll_x ) & 0x1ff) - 288) / 2); - running_device *_2d_screen = devtag_get_device(screen->machine, "2dscreen"); - running_device *_3d_left_screen = devtag_get_device(screen->machine, "3dleft"); - running_device *_3d_right_screen = devtag_get_device(screen->machine, "3dright"); + running_device *_2d_screen = screen->machine->device("2dscreen"); + running_device *_3d_left_screen = screen->machine->device("3dleft"); + running_device *_3d_right_screen = screen->machine->device("3dright"); if (screen != _2d_screen) { diff --git a/src/mame/video/tetrisp2.c b/src/mame/video/tetrisp2.c index 2e0eb858ce7..f392297e189 100644 --- a/src/mame/video/tetrisp2.c +++ b/src/mame/video/tetrisp2.c @@ -677,8 +677,8 @@ VIDEO_UPDATE( rocknms ) int scr_pri; int rot_pri; - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *right_screen = screen->machine->device("rscreen"); /* Black background color */ if (screen == left_screen) diff --git a/src/mame/video/thief.c b/src/mame/video/thief.c index 8ea48b2a6c4..015501eded5 100644 --- a/src/mame/video/thief.c +++ b/src/mame/video/thief.c @@ -110,7 +110,7 @@ VIDEO_UPDATE( thief ){ int flipscreen = thief_video_control&1; const UINT8 *source = screen->machine->generic.videoram.u8; - if (tms9927_screen_reset(devtag_get_device(screen->machine, "tms"))) + if (tms9927_screen_reset(screen->machine->device("tms"))) { bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); return 0; diff --git a/src/mame/video/tia.c b/src/mame/video/tia.c index f5c1613c93b..d665baddc67 100644 --- a/src/mame/video/tia.c +++ b/src/mame/video/tia.c @@ -1863,7 +1863,7 @@ WRITE8_HANDLER( tia_w ) case 0x18: /* AUDF1 */ case 0x19: /* AUDV0 */ case 0x1A: /* AUDV1 */ - tia_sound_w(devtag_get_device(space->machine, "tia"), offset, data); + tia_sound_w(space->machine->device("tia"), offset, data); break; case 0x1B: diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c index 4e108140452..e0dc9777b2b 100644 --- a/src/mame/video/toaplan2.c +++ b/src/mame/video/toaplan2.c @@ -1036,7 +1036,7 @@ static void toaplan2_scroll_reg_data_w(running_machine *machine, offs_t offset, if ((toaplan2_sub_cpu == CPU_2_Z80) && (data == 3)) { /* HACK! When tilted, sound CPU needs to be reset. */ - running_device *ym = devtag_get_device(machine, "ymsnd"); + running_device *ym = machine->device("ymsnd"); if (ym && ym->type() == SOUND_YM3812) { diff --git a/src/mame/video/triplhnt.c b/src/mame/video/triplhnt.c index ca1593c22f3..1577b303918 100644 --- a/src/mame/video/triplhnt.c +++ b/src/mame/video/triplhnt.c @@ -130,7 +130,7 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta VIDEO_UPDATE( triplhnt ) { - running_device *discrete = devtag_get_device(screen->machine, "discrete"); + running_device *discrete = screen->machine->device("discrete"); tilemap_mark_all_tiles_dirty(bg_tilemap); diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c index 74ea1ad172c..5e9506aa27c 100644 --- a/src/mame/video/tx1.c +++ b/src/mame/video/tx1.c @@ -1194,9 +1194,9 @@ static void tx1_combine_layers(running_machine *machine, bitmap_t *bitmap, int s VIDEO_UPDATE( tx1 ) { - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *centre_screen = devtag_get_device(screen->machine, "cscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *centre_screen = screen->machine->device("cscreen"); + running_device *right_screen = screen->machine->device("rscreen"); if (screen == left_screen) { @@ -3081,9 +3081,9 @@ VIDEO_EOF( buggyboy ) VIDEO_UPDATE( buggyboy ) { - running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); - running_device *center_screen = devtag_get_device(screen->machine, "cscreen"); - running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = screen->machine->device("lscreen"); + running_device *center_screen = screen->machine->device("cscreen"); + running_device *right_screen = screen->machine->device("rscreen"); if (screen == left_screen) { diff --git a/src/mame/video/ultratnk.c b/src/mame/video/ultratnk.c index 6c276486d05..fb91024410e 100644 --- a/src/mame/video/ultratnk.c +++ b/src/mame/video/ultratnk.c @@ -96,7 +96,7 @@ VIDEO_EOF( ultratnk ) { int i; UINT16 BG = colortable_entry_get_value(machine->colortable, 0); - running_device *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = machine->device("discrete"); UINT8 *videoram = machine->generic.videoram.u8; /* check for sprite-playfield collisions */ diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c index 83d7548e525..3c27f14a7db 100644 --- a/src/mame/video/undrfire.c +++ b/src/mame/video/undrfire.c @@ -357,8 +357,8 @@ static void draw_sprites_cbombers(running_machine *machine, bitmap_t *bitmap,con VIDEO_UPDATE( undrfire ) { - running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = screen->machine->device("tc0100scn"); + running_device *tc0480scp = screen->machine->device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; @@ -503,8 +503,8 @@ VIDEO_UPDATE( undrfire ) VIDEO_UPDATE( cbombers ) { - running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = screen->machine->device("tc0100scn"); + running_device *tc0480scp = screen->machine->device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; diff --git a/src/mame/video/vindictr.c b/src/mame/video/vindictr.c index 2136e3f39fa..18da2ac9b7a 100644 --- a/src/mame/video/vindictr.c +++ b/src/mame/video/vindictr.c @@ -187,7 +187,7 @@ void vindictr_scanline_update(screen_device &screen, int scanline) break; case 6: /* /VIRQ */ - atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu")); + atarigen_scanline_int_gen(screen.machine->device("maincpu")); break; case 7: /* /PFVS */ diff --git a/src/mame/video/vrender0.c b/src/mame/video/vrender0.c index cb72d98aaa5..853f7c84f4a 100644 --- a/src/mame/video/vrender0.c +++ b/src/mame/video/vrender0.c @@ -566,7 +566,7 @@ static DEVICE_START( vr0video ) vr0video_state *vr0 = get_safe_token(device); const vr0video_interface *intf = get_interface(device); - vr0->cpu = devtag_get_device(device->machine, intf->cpu); + vr0->cpu = device->machine->device(intf->cpu); state_save_register_device_item_array(device, 0, vr0->InternalPalette); state_save_register_device_item(device, 0, vr0->LastPalUpdate); diff --git a/src/mame/video/vsnes.c b/src/mame/video/vsnes.c index 9df72097cf8..9a757de18b2 100644 --- a/src/mame/video/vsnes.c +++ b/src/mame/video/vsnes.c @@ -58,21 +58,21 @@ VIDEO_START( vsdual ) VIDEO_UPDATE( vsnes ) { /* render the ppu */ - ppu2c0x_render( devtag_get_device(screen->machine, "ppu1"), bitmap, 0, 0, 0, 0 ); + ppu2c0x_render( screen->machine->device("ppu1"), bitmap, 0, 0, 0, 0 ); return 0; } VIDEO_UPDATE( vsdual ) { - running_device *top_screen = devtag_get_device(screen->machine, "top"); - running_device *bottom_screen = devtag_get_device(screen->machine, "bottom"); + running_device *top_screen = screen->machine->device("top"); + running_device *bottom_screen = screen->machine->device("bottom"); /* render the ppu's */ if (screen == top_screen) - ppu2c0x_render(devtag_get_device(screen->machine, "ppu1"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen->machine->device("ppu1"), bitmap, 0, 0, 0, 0); else if (screen == bottom_screen) - ppu2c0x_render(devtag_get_device(screen->machine, "ppu2"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen->machine->device("ppu2"), bitmap, 0, 0, 0, 0); return 0; } diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c index cd1bcb7af73..80d1ec6e0a6 100644 --- a/src/mame/video/wecleman.c +++ b/src/mame/video/wecleman.c @@ -1125,8 +1125,8 @@ VIDEO_UPDATE ( wecleman ) VIDEO_UPDATE( hotchase ) { - running_device *k051316_1 = devtag_get_device(screen->machine, "k051316_1"); - running_device *k051316_2 = devtag_get_device(screen->machine, "k051316_2"); + running_device *k051316_1 = screen->machine->device("k051316_1"); + running_device *k051316_2 = screen->machine->device("k051316_2"); int video_on; video_on = wecleman_irqctrl & 0x40;