summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers')
-rw-r--r--src/mame/drivers/1942.c2
-rw-r--r--src/mame/drivers/1943.c2
-rw-r--r--src/mame/drivers/20pacgal.c2
-rw-r--r--src/mame/drivers/2mindril.c8
-rw-r--r--src/mame/drivers/39in1.c2
-rw-r--r--src/mame/drivers/3do.c4
-rw-r--r--src/mame/drivers/40love.c6
-rw-r--r--src/mame/drivers/4enraya.c10
-rw-r--r--src/mame/drivers/5clown.c10
-rw-r--r--src/mame/drivers/8080bw.c4
-rw-r--r--src/mame/drivers/88games.c4
-rw-r--r--src/mame/drivers/acefruit.c2
-rw-r--r--src/mame/drivers/acesp.c2
-rw-r--r--src/mame/drivers/adp.c4
-rw-r--r--src/mame/drivers/aeroboto.c4
-rw-r--r--src/mame/drivers/aerofgt.c4
-rw-r--r--src/mame/drivers/airbustr.c6
-rw-r--r--src/mame/drivers/albazc.c2
-rw-r--r--src/mame/drivers/albazg.c2
-rw-r--r--src/mame/drivers/aleck64.c2
-rw-r--r--src/mame/drivers/alg.c16
-rw-r--r--src/mame/drivers/aliens.c2
-rw-r--r--src/mame/drivers/alpha68k.c14
-rw-r--r--src/mame/drivers/amaticmg.c4
-rw-r--r--src/mame/drivers/ampoker2.c6
-rw-r--r--src/mame/drivers/amspdwy.c2
-rw-r--r--src/mame/drivers/angelkds.c4
-rw-r--r--src/mame/drivers/appoooh.c4
-rw-r--r--src/mame/drivers/aquarium.c10
-rw-r--r--src/mame/drivers/arcadecl.c2
-rw-r--r--src/mame/drivers/arcadia.c10
-rw-r--r--src/mame/drivers/argus.c2
-rw-r--r--src/mame/drivers/aristmk4.c4
-rw-r--r--src/mame/drivers/aristmk5.c10
-rw-r--r--src/mame/drivers/aristmk6.c2
-rw-r--r--src/mame/drivers/arkanoid.c6
-rw-r--r--src/mame/drivers/armedf.c4
-rw-r--r--src/mame/drivers/ashnojoe.c2
-rw-r--r--src/mame/drivers/asterix.c4
-rw-r--r--src/mame/drivers/astinvad.c4
-rw-r--r--src/mame/drivers/astrafr.c12
-rw-r--r--src/mame/drivers/astrocde.c6
-rw-r--r--src/mame/drivers/astrocorp.c4
-rw-r--r--src/mame/drivers/astrof.c12
-rw-r--r--src/mame/drivers/asuka.c6
-rw-r--r--src/mame/drivers/atarig42.c2
-rw-r--r--src/mame/drivers/atarisy2.c8
-rw-r--r--src/mame/drivers/atarisy4.c12
-rw-r--r--src/mame/drivers/atetris.c2
-rw-r--r--src/mame/drivers/atvtrack.c4
-rw-r--r--src/mame/drivers/avt.c2
-rw-r--r--src/mame/drivers/backfire.c2
-rw-r--r--src/mame/drivers/badlands.c4
-rw-r--r--src/mame/drivers/balsente.c6
-rw-r--r--src/mame/drivers/baraduke.c2
-rw-r--r--src/mame/drivers/battlex.c6
-rw-r--r--src/mame/drivers/battlnts.c4
-rw-r--r--src/mame/drivers/bfcobra.c12
-rw-r--r--src/mame/drivers/bfm_sc1.c2
-rw-r--r--src/mame/drivers/bfm_sc2.c4
-rw-r--r--src/mame/drivers/bfm_sc4.c8
-rw-r--r--src/mame/drivers/bfm_sc4h.c2
-rw-r--r--src/mame/drivers/bfm_sc5.c2
-rw-r--r--src/mame/drivers/bigevglf.c2
-rw-r--r--src/mame/drivers/bingoc.c2
-rw-r--r--src/mame/drivers/bking.c2
-rw-r--r--src/mame/drivers/bladestl.c2
-rw-r--r--src/mame/drivers/blitz.c2
-rw-r--r--src/mame/drivers/blitz68k.c24
-rw-r--r--src/mame/drivers/blktiger.c4
-rw-r--r--src/mame/drivers/blmbycar.c6
-rw-r--r--src/mame/drivers/blockhl.c2
-rw-r--r--src/mame/drivers/bnstars.c2
-rw-r--r--src/mame/drivers/boogwing.c4
-rw-r--r--src/mame/drivers/bottom9.c2
-rw-r--r--src/mame/drivers/boxer.c2
-rw-r--r--src/mame/drivers/brkthru.c2
-rw-r--r--src/mame/drivers/btime.c18
-rw-r--r--src/mame/drivers/bublbobl.c4
-rw-r--r--src/mame/drivers/buggychl.c2
-rw-r--r--src/mame/drivers/bwing.c6
-rw-r--r--src/mame/drivers/cabal.c2
-rw-r--r--src/mame/drivers/cabaret.c2
-rw-r--r--src/mame/drivers/calchase.c8
-rw-r--r--src/mame/drivers/calomega.c10
-rw-r--r--src/mame/drivers/calorie.c4
-rw-r--r--src/mame/drivers/capbowl.c2
-rw-r--r--src/mame/drivers/cardline.c2
-rw-r--r--src/mame/drivers/carpolo.c4
-rw-r--r--src/mame/drivers/carrera.c2
-rw-r--r--src/mame/drivers/caswin.c2
-rw-r--r--src/mame/drivers/cave.c62
-rw-r--r--src/mame/drivers/cb2001.c4
-rw-r--r--src/mame/drivers/cbasebal.c2
-rw-r--r--src/mame/drivers/cbuster.c6
-rw-r--r--src/mame/drivers/ccastles.c4
-rw-r--r--src/mame/drivers/cd32.c4
-rw-r--r--src/mame/drivers/cdi.c2
-rw-r--r--src/mame/drivers/chaknpop.c2
-rw-r--r--src/mame/drivers/cham24.c12
-rw-r--r--src/mame/drivers/champbas.c10
-rw-r--r--src/mame/drivers/champbwl.c4
-rw-r--r--src/mame/drivers/chanbara.c8
-rw-r--r--src/mame/drivers/chihiro.c2
-rw-r--r--src/mame/drivers/chinagat.c8
-rw-r--r--src/mame/drivers/chinsan.c6
-rw-r--r--src/mame/drivers/chqflag.c4
-rw-r--r--src/mame/drivers/chsuper.c6
-rw-r--r--src/mame/drivers/cidelsa.c2
-rw-r--r--src/mame/drivers/cischeat.c4
-rw-r--r--src/mame/drivers/citycon.c2
-rw-r--r--src/mame/drivers/cloud9.c2
-rw-r--r--src/mame/drivers/clshroad.c2
-rw-r--r--src/mame/drivers/cmmb.c8
-rw-r--r--src/mame/drivers/cninja.c6
-rw-r--r--src/mame/drivers/cntsteer.c8
-rw-r--r--src/mame/drivers/cobra.c6
-rw-r--r--src/mame/drivers/coinmstr.c6
-rw-r--r--src/mame/drivers/coinmvga.c4
-rw-r--r--src/mame/drivers/combatsc.c4
-rw-r--r--src/mame/drivers/commando.c4
-rw-r--r--src/mame/drivers/compgolf.c6
-rw-r--r--src/mame/drivers/contra.c2
-rw-r--r--src/mame/drivers/coolpool.c12
-rw-r--r--src/mame/drivers/coolridr.c2
-rw-r--r--src/mame/drivers/cop01.c2
-rw-r--r--src/mame/drivers/corona.c2
-rw-r--r--src/mame/drivers/cosmic.c4
-rw-r--r--src/mame/drivers/cps1.c14
-rw-r--r--src/mame/drivers/cps2.c10
-rw-r--r--src/mame/drivers/cps3.c22
-rw-r--r--src/mame/drivers/crgolf.c4
-rw-r--r--src/mame/drivers/crimfght.c2
-rw-r--r--src/mame/drivers/crospang.c4
-rw-r--r--src/mame/drivers/crshrace.c8
-rw-r--r--src/mame/drivers/crystal.c20
-rw-r--r--src/mame/drivers/cshooter.c10
-rw-r--r--src/mame/drivers/csplayh5.c6
-rw-r--r--src/mame/drivers/cultures.c10
-rw-r--r--src/mame/drivers/cvs.c14
-rw-r--r--src/mame/drivers/cybertnk.c6
-rw-r--r--src/mame/drivers/cyclemb.c4
-rw-r--r--src/mame/drivers/d9final.c4
-rw-r--r--src/mame/drivers/dacholer.c2
-rw-r--r--src/mame/drivers/dambustr.c6
-rw-r--r--src/mame/drivers/darius.c6
-rw-r--r--src/mame/drivers/darkhors.c4
-rw-r--r--src/mame/drivers/darkmist.c34
-rw-r--r--src/mame/drivers/darkseal.c2
-rw-r--r--src/mame/drivers/dassault.c8
-rw-r--r--src/mame/drivers/dbz.c2
-rw-r--r--src/mame/drivers/dcon.c2
-rw-r--r--src/mame/drivers/ddayjlc.c8
-rw-r--r--src/mame/drivers/ddenlovr.c38
-rw-r--r--src/mame/drivers/ddragon.c24
-rw-r--r--src/mame/drivers/ddribble.c4
-rw-r--r--src/mame/drivers/dec0.c2
-rw-r--r--src/mame/drivers/dec8.c28
-rw-r--r--src/mame/drivers/deco156.c4
-rw-r--r--src/mame/drivers/deco32.c30
-rw-r--r--src/mame/drivers/deco_mlc.c4
-rw-r--r--src/mame/drivers/decocass.c8
-rw-r--r--src/mame/drivers/deshoros.c2
-rw-r--r--src/mame/drivers/dgpix.c14
-rw-r--r--src/mame/drivers/discoboy.c6
-rw-r--r--src/mame/drivers/djboy.c6
-rw-r--r--src/mame/drivers/djmain.c6
-rw-r--r--src/mame/drivers/dkong.c14
-rw-r--r--src/mame/drivers/dmndrby.c6
-rw-r--r--src/mame/drivers/docastle.c4
-rw-r--r--src/mame/drivers/dooyong.c2
-rw-r--r--src/mame/drivers/dorachan.c2
-rw-r--r--src/mame/drivers/dreamwld.c10
-rw-r--r--src/mame/drivers/drgnmst.c6
-rw-r--r--src/mame/drivers/drmicro.c2
-rw-r--r--src/mame/drivers/drw80pkr.c4
-rw-r--r--src/mame/drivers/dunhuang.c4
-rw-r--r--src/mame/drivers/dwarfd.c16
-rw-r--r--src/mame/drivers/dynadice.c8
-rw-r--r--src/mame/drivers/dynax.c38
-rw-r--r--src/mame/drivers/enigma2.c4
-rw-r--r--src/mame/drivers/eolith.c4
-rw-r--r--src/mame/drivers/epos.c4
-rw-r--r--src/mame/drivers/equites.c2
-rw-r--r--src/mame/drivers/esd16.c2
-rw-r--r--src/mame/drivers/esh.c2
-rw-r--r--src/mame/drivers/esripsys.c6
-rw-r--r--src/mame/drivers/ettrivia.c4
-rw-r--r--src/mame/drivers/exerion.c14
-rw-r--r--src/mame/drivers/exidy.c4
-rw-r--r--src/mame/drivers/exidy440.c6
-rw-r--r--src/mame/drivers/expro02.c6
-rw-r--r--src/mame/drivers/exprraid.c4
-rw-r--r--src/mame/drivers/exzisus.c6
-rw-r--r--src/mame/drivers/f1gp.c10
-rw-r--r--src/mame/drivers/famibox.c6
-rw-r--r--src/mame/drivers/fantland.c4
-rw-r--r--src/mame/drivers/fastfred.c2
-rw-r--r--src/mame/drivers/fastlane.c2
-rw-r--r--src/mame/drivers/fcombat.c22
-rw-r--r--src/mame/drivers/fcrash.c2
-rw-r--r--src/mame/drivers/feversoc.c2
-rw-r--r--src/mame/drivers/fgoal.c2
-rw-r--r--src/mame/drivers/firebeat.c4
-rw-r--r--src/mame/drivers/firefox.c2
-rw-r--r--src/mame/drivers/firetrap.c4
-rw-r--r--src/mame/drivers/fitfight.c4
-rw-r--r--src/mame/drivers/flkatck.c2
-rw-r--r--src/mame/drivers/flyball.c2
-rw-r--r--src/mame/drivers/forte2.c4
-rw-r--r--src/mame/drivers/fortecar.c2
-rw-r--r--src/mame/drivers/freekick.c6
-rw-r--r--src/mame/drivers/fromanc2.c6
-rw-r--r--src/mame/drivers/fromance.c2
-rw-r--r--src/mame/drivers/funkball.c20
-rw-r--r--src/mame/drivers/funworld.c32
-rw-r--r--src/mame/drivers/funybubl.c2
-rw-r--r--src/mame/drivers/fuukifg2.c2
-rw-r--r--src/mame/drivers/fuukifg3.c2
-rw-r--r--src/mame/drivers/gaelco.c2
-rw-r--r--src/mame/drivers/gaelco3d.c4
-rw-r--r--src/mame/drivers/gaiden.c12
-rw-r--r--src/mame/drivers/galaga.c14
-rw-r--r--src/mame/drivers/galaxian.c70
-rw-r--r--src/mame/drivers/galgame.c2
-rw-r--r--src/mame/drivers/galivan.c8
-rw-r--r--src/mame/drivers/galpani2.c6
-rw-r--r--src/mame/drivers/galpani3.c8
-rw-r--r--src/mame/drivers/galpanic.c4
-rw-r--r--src/mame/drivers/gamecstl.c4
-rw-r--r--src/mame/drivers/gaplus.c4
-rw-r--r--src/mame/drivers/gauntlet.c4
-rw-r--r--src/mame/drivers/gberet.c2
-rw-r--r--src/mame/drivers/gbusters.c4
-rw-r--r--src/mame/drivers/gcpinbal.c2
-rw-r--r--src/mame/drivers/gei.c48
-rw-r--r--src/mame/drivers/ghosteo.c2
-rw-r--r--src/mame/drivers/ginganin.c4
-rw-r--r--src/mame/drivers/gladiatr.c16
-rw-r--r--src/mame/drivers/glass.c6
-rw-r--r--src/mame/drivers/gng.c2
-rw-r--r--src/mame/drivers/go2000.c2
-rw-r--r--src/mame/drivers/goal92.c2
-rw-r--r--src/mame/drivers/goindol.c4
-rw-r--r--src/mame/drivers/goldnpkr.c46
-rw-r--r--src/mame/drivers/goldstar.c66
-rw-r--r--src/mame/drivers/gpworld.c2
-rw-r--r--src/mame/drivers/groundfx.c4
-rw-r--r--src/mame/drivers/gstriker.c2
-rw-r--r--src/mame/drivers/gsword.c4
-rw-r--r--src/mame/drivers/gticlub.c6
-rw-r--r--src/mame/drivers/guab.c2
-rw-r--r--src/mame/drivers/gundealr.c2
-rw-r--r--src/mame/drivers/gunpey.c6
-rw-r--r--src/mame/drivers/gunsmoke.c2
-rw-r--r--src/mame/drivers/halleys.c6
-rw-r--r--src/mame/drivers/harddriv.c4
-rw-r--r--src/mame/drivers/hcastle.c2
-rw-r--r--src/mame/drivers/highvdeo.c6
-rw-r--r--src/mame/drivers/himesiki.c2
-rw-r--r--src/mame/drivers/hitpoker.c10
-rw-r--r--src/mame/drivers/hnayayoi.c4
-rw-r--r--src/mame/drivers/hng64.c8
-rw-r--r--src/mame/drivers/homedata.c12
-rw-r--r--src/mame/drivers/homerun.c2
-rw-r--r--src/mame/drivers/hornet.c20
-rw-r--r--src/mame/drivers/hshavoc.c2
-rw-r--r--src/mame/drivers/hvyunit.c6
-rw-r--r--src/mame/drivers/hyprduel.c8
-rw-r--r--src/mame/drivers/ichiban.c2
-rw-r--r--src/mame/drivers/igs009.c4
-rw-r--r--src/mame/drivers/igs011.c68
-rw-r--r--src/mame/drivers/igs017.c62
-rw-r--r--src/mame/drivers/igs_m027.c24
-rw-r--r--src/mame/drivers/igspoker.c28
-rw-r--r--src/mame/drivers/intrscti.c2
-rw-r--r--src/mame/drivers/inufuku.c2
-rw-r--r--src/mame/drivers/iqblock.c6
-rw-r--r--src/mame/drivers/istellar.c2
-rw-r--r--src/mame/drivers/itech32.c2
-rw-r--r--src/mame/drivers/itech8.c6
-rw-r--r--src/mame/drivers/itgambl2.c2
-rw-r--r--src/mame/drivers/itgambl3.c2
-rw-r--r--src/mame/drivers/jack.c8
-rw-r--r--src/mame/drivers/jackal.c6
-rw-r--r--src/mame/drivers/jackie.c4
-rw-r--r--src/mame/drivers/jackpool.c2
-rw-r--r--src/mame/drivers/jaguar.c14
-rw-r--r--src/mame/drivers/jailbrek.c4
-rw-r--r--src/mame/drivers/jalmah.c6
-rw-r--r--src/mame/drivers/jangou.c6
-rw-r--r--src/mame/drivers/jantotsu.c4
-rw-r--r--src/mame/drivers/jchan.c4
-rw-r--r--src/mame/drivers/jedi.c2
-rw-r--r--src/mame/drivers/jokrwild.c2
-rw-r--r--src/mame/drivers/jollyjgr.c2
-rw-r--r--src/mame/drivers/jongkyo.c4
-rw-r--r--src/mame/drivers/jpmimpct.c4
-rw-r--r--src/mame/drivers/jpmsys5.c6
-rw-r--r--src/mame/drivers/jrpacman.c2
-rw-r--r--src/mame/drivers/junofrst.c4
-rw-r--r--src/mame/drivers/kaneko16.c12
-rw-r--r--src/mame/drivers/kangaroo.c2
-rw-r--r--src/mame/drivers/karnov.c6
-rw-r--r--src/mame/drivers/kas89.c4
-rw-r--r--src/mame/drivers/kchamp.c4
-rw-r--r--src/mame/drivers/kickgoal.c2
-rw-r--r--src/mame/drivers/kingdrby.c6
-rw-r--r--src/mame/drivers/kingobox.c6
-rw-r--r--src/mame/drivers/kingpin.c2
-rw-r--r--src/mame/drivers/koikoi.c2
-rw-r--r--src/mame/drivers/konamigq.c2
-rw-r--r--src/mame/drivers/konamigx.c6
-rw-r--r--src/mame/drivers/konendev.c4
-rw-r--r--src/mame/drivers/ksayakyu.c2
-rw-r--r--src/mame/drivers/kungfur.c4
-rw-r--r--src/mame/drivers/labyrunr.c2
-rw-r--r--src/mame/drivers/ladybug.c4
-rw-r--r--src/mame/drivers/lastduel.c2
-rw-r--r--src/mame/drivers/lastfght.c8
-rw-r--r--src/mame/drivers/lazercmd.c6
-rw-r--r--src/mame/drivers/legionna.c6
-rw-r--r--src/mame/drivers/leland.c6
-rw-r--r--src/mame/drivers/lethal.c4
-rw-r--r--src/mame/drivers/liberate.c18
-rw-r--r--src/mame/drivers/limenko.c8
-rw-r--r--src/mame/drivers/littlerb.c2
-rw-r--r--src/mame/drivers/lkage.c2
-rw-r--r--src/mame/drivers/looping.c6
-rw-r--r--src/mame/drivers/lordgun.c6
-rw-r--r--src/mame/drivers/lsasquad.c2
-rw-r--r--src/mame/drivers/ltcasino.c2
-rw-r--r--src/mame/drivers/luckgrln.c2
-rw-r--r--src/mame/drivers/lucky74.c2
-rw-r--r--src/mame/drivers/lwings.c2
-rw-r--r--src/mame/drivers/m107.c4
-rw-r--r--src/mame/drivers/m58.c2
-rw-r--r--src/mame/drivers/m62.c18
-rw-r--r--src/mame/drivers/m63.c8
-rw-r--r--src/mame/drivers/m72.c8
-rw-r--r--src/mame/drivers/m79amb.c2
-rw-r--r--src/mame/drivers/m90.c4
-rw-r--r--src/mame/drivers/m92.c14
-rw-r--r--src/mame/drivers/macs.c16
-rw-r--r--src/mame/drivers/madalien.c2
-rw-r--r--src/mame/drivers/madmotor.c2
-rw-r--r--src/mame/drivers/magicard.c2
-rw-r--r--src/mame/drivers/magictg.c4
-rw-r--r--src/mame/drivers/magtouch.c2
-rw-r--r--src/mame/drivers/mainevt.c2
-rw-r--r--src/mame/drivers/majorpkr.c2
-rw-r--r--src/mame/drivers/malzak.c2
-rw-r--r--src/mame/drivers/marinedt.c4
-rw-r--r--src/mame/drivers/mastboy.c6
-rw-r--r--src/mame/drivers/maxaflex.c2
-rw-r--r--src/mame/drivers/maygay1b.c4
-rw-r--r--src/mame/drivers/mayumi.c2
-rw-r--r--src/mame/drivers/mazerbla.c10
-rw-r--r--src/mame/drivers/mcatadv.c2
-rw-r--r--src/mame/drivers/mcr.c76
-rw-r--r--src/mame/drivers/mcr3.c12
-rw-r--r--src/mame/drivers/meadows.c16
-rw-r--r--src/mame/drivers/mediagx.c2
-rw-r--r--src/mame/drivers/megadrvb.c8
-rw-r--r--src/mame/drivers/megaplay.c10
-rw-r--r--src/mame/drivers/megasys1.c24
-rw-r--r--src/mame/drivers/megatech.c14
-rw-r--r--src/mame/drivers/meijinsn.c2
-rw-r--r--src/mame/drivers/merit.c16
-rw-r--r--src/mame/drivers/meritm.c10
-rw-r--r--src/mame/drivers/mermaid.c2
-rw-r--r--src/mame/drivers/metalmx.c2
-rw-r--r--src/mame/drivers/metro.c20
-rw-r--r--src/mame/drivers/mexico86.c2
-rw-r--r--src/mame/drivers/midas.c2
-rw-r--r--src/mame/drivers/midqslvr.c28
-rw-r--r--src/mame/drivers/midvunit.c4
-rw-r--r--src/mame/drivers/midzeus.c6
-rw-r--r--src/mame/drivers/miniboy7.c2
-rw-r--r--src/mame/drivers/mirax.c6
-rw-r--r--src/mame/drivers/missb2.c6
-rw-r--r--src/mame/drivers/missile.c8
-rw-r--r--src/mame/drivers/mitchell.c22
-rw-r--r--src/mame/drivers/mjkjidai.c2
-rw-r--r--src/mame/drivers/mjsister.c6
-rw-r--r--src/mame/drivers/mlanding.c6
-rw-r--r--src/mame/drivers/model1.c6
-rw-r--r--src/mame/drivers/model2.c20
-rw-r--r--src/mame/drivers/model3.c80
-rw-r--r--src/mame/drivers/mogura.c2
-rw-r--r--src/mame/drivers/momoko.c2
-rw-r--r--src/mame/drivers/moo.c2
-rw-r--r--src/mame/drivers/mouser.c4
-rw-r--r--src/mame/drivers/mpu4.c8
-rw-r--r--src/mame/drivers/mpu4vid.c6
-rw-r--r--src/mame/drivers/mquake.c4
-rw-r--r--src/mame/drivers/mrdo.c2
-rw-r--r--src/mame/drivers/ms32.c8
-rw-r--r--src/mame/drivers/multfish.c8
-rw-r--r--src/mame/drivers/multigam.c54
-rw-r--r--src/mame/drivers/murogmbl.c2
-rw-r--r--src/mame/drivers/mustache.c8
-rw-r--r--src/mame/drivers/mystwarr.c2
-rw-r--r--src/mame/drivers/namcofl.c8
-rw-r--r--src/mame/drivers/namcoic.c4
-rw-r--r--src/mame/drivers/namcona1.c2
-rw-r--r--src/mame/drivers/namconb1.c2
-rw-r--r--src/mame/drivers/namcos10.c8
-rw-r--r--src/mame/drivers/namcos11.c4
-rw-r--r--src/mame/drivers/namcos12.c10
-rw-r--r--src/mame/drivers/namcos2.c4
-rw-r--r--src/mame/drivers/namcos21.c22
-rw-r--r--src/mame/drivers/namcos22.c6
-rw-r--r--src/mame/drivers/namcos23.c16
-rw-r--r--src/mame/drivers/namcos86.c20
-rw-r--r--src/mame/drivers/naomi.c2
-rw-r--r--src/mame/drivers/naughtyb.c2
-rw-r--r--src/mame/drivers/nbmj8688.c16
-rw-r--r--src/mame/drivers/nbmj8891.c26
-rw-r--r--src/mame/drivers/nbmj8900.c8
-rw-r--r--src/mame/drivers/nbmj8991.c10
-rw-r--r--src/mame/drivers/nbmj9195.c4
-rw-r--r--src/mame/drivers/neodrvr.c14
-rw-r--r--src/mame/drivers/neogeo.c76
-rw-r--r--src/mame/drivers/neoprint.c8
-rw-r--r--src/mame/drivers/nexus3d.c4
-rw-r--r--src/mame/drivers/nightgal.c8
-rw-r--r--src/mame/drivers/ninjakd2.c20
-rw-r--r--src/mame/drivers/ninjaw.c2
-rw-r--r--src/mame/drivers/niyanpai.c4
-rw-r--r--src/mame/drivers/nmk16.c50
-rw-r--r--src/mame/drivers/norautp.c20
-rw-r--r--src/mame/drivers/nova2001.c4
-rw-r--r--src/mame/drivers/nss.c8
-rw-r--r--src/mame/drivers/nwk-tr.c2
-rw-r--r--src/mame/drivers/nycaptor.c8
-rw-r--r--src/mame/drivers/ohmygod.c4
-rw-r--r--src/mame/drivers/ojankohs.c6
-rw-r--r--src/mame/drivers/olibochu.c2
-rw-r--r--src/mame/drivers/omegrace.c4
-rw-r--r--src/mame/drivers/onetwo.c2
-rw-r--r--src/mame/drivers/opwolf.c10
-rw-r--r--src/mame/drivers/othello.c4
-rw-r--r--src/mame/drivers/othunder.c2
-rw-r--r--src/mame/drivers/pachifev.c2
-rw-r--r--src/mame/drivers/pacman.c56
-rw-r--r--src/mame/drivers/panicr.c26
-rw-r--r--src/mame/drivers/paradise.c6
-rw-r--r--src/mame/drivers/parodius.c2
-rw-r--r--src/mame/drivers/pasha2.c4
-rw-r--r--src/mame/drivers/pastelg.c2
-rw-r--r--src/mame/drivers/pbaction.c2
-rw-r--r--src/mame/drivers/pcat_nit.c2
-rw-r--r--src/mame/drivers/pcktgal.c12
-rw-r--r--src/mame/drivers/pcxt.c4
-rw-r--r--src/mame/drivers/pengadvb.c18
-rw-r--r--src/mame/drivers/pengo.c2
-rw-r--r--src/mame/drivers/peplus.c4
-rw-r--r--src/mame/drivers/pgm.c10
-rw-r--r--src/mame/drivers/pgm2.c4
-rw-r--r--src/mame/drivers/phoenix.c2
-rw-r--r--src/mame/drivers/photon.c6
-rw-r--r--src/mame/drivers/photon2.c4
-rw-r--r--src/mame/drivers/pingpong.c24
-rw-r--r--src/mame/drivers/pipedrm.c4
-rw-r--r--src/mame/drivers/pipeline.c4
-rw-r--r--src/mame/drivers/pirates.c18
-rw-r--r--src/mame/drivers/playmark.c6
-rw-r--r--src/mame/drivers/pluto5.c6
-rw-r--r--src/mame/drivers/plygonet.c6
-rw-r--r--src/mame/drivers/pntnpuzl.c2
-rw-r--r--src/mame/drivers/pokechmp.c4
-rw-r--r--src/mame/drivers/poker72.c6
-rw-r--r--src/mame/drivers/polepos.c4
-rw-r--r--src/mame/drivers/policetr.c2
-rw-r--r--src/mame/drivers/poo.c2
-rw-r--r--src/mame/drivers/poolshrk.c4
-rw-r--r--src/mame/drivers/popeye.c4
-rw-r--r--src/mame/drivers/powerbal.c2
-rw-r--r--src/mame/drivers/powerins.c2
-rw-r--r--src/mame/drivers/ppmast93.c2
-rw-r--r--src/mame/drivers/progolf.c8
-rw-r--r--src/mame/drivers/psikyo.c22
-rw-r--r--src/mame/drivers/psikyo4.c12
-rw-r--r--src/mame/drivers/psikyosh.c8
-rw-r--r--src/mame/drivers/psychic5.c4
-rw-r--r--src/mame/drivers/pturn.c2
-rw-r--r--src/mame/drivers/puckpkmn.c4
-rw-r--r--src/mame/drivers/qdrmfgp.c4
-rw-r--r--src/mame/drivers/qix.c12
-rw-r--r--src/mame/drivers/queen.c28
-rw-r--r--src/mame/drivers/quizdna.c4
-rw-r--r--src/mame/drivers/quizo.c4
-rw-r--r--src/mame/drivers/quizpun2.c6
-rw-r--r--src/mame/drivers/quizshow.c4
-rw-r--r--src/mame/drivers/r2dx_v33.c6
-rw-r--r--src/mame/drivers/rabbit.c4
-rw-r--r--src/mame/drivers/raiden.c4
-rw-r--r--src/mame/drivers/raiden2.c8
-rw-r--r--src/mame/drivers/rainbow.c4
-rw-r--r--src/mame/drivers/rampart.c2
-rw-r--r--src/mame/drivers/rastan.c4
-rw-r--r--src/mame/drivers/redclash.c6
-rw-r--r--src/mame/drivers/relief.c2
-rw-r--r--src/mame/drivers/renegade.c4
-rw-r--r--src/mame/drivers/rltennis.c6
-rw-r--r--src/mame/drivers/rmhaihai.c8
-rw-r--r--src/mame/drivers/rockrage.c2
-rw-r--r--src/mame/drivers/rocnrope.c2
-rw-r--r--src/mame/drivers/rohga.c4
-rw-r--r--src/mame/drivers/rollerg.c2
-rw-r--r--src/mame/drivers/roul.c2
-rw-r--r--src/mame/drivers/route16.c4
-rw-r--r--src/mame/drivers/royalmah.c38
-rw-r--r--src/mame/drivers/rpunch.c4
-rw-r--r--src/mame/drivers/rungun.c2
-rw-r--r--src/mame/drivers/sandscrp.c2
-rw-r--r--src/mame/drivers/sangho.c14
-rw-r--r--src/mame/drivers/saturn.c4
-rw-r--r--src/mame/drivers/sauro.c2
-rw-r--r--src/mame/drivers/savquest.c4
-rw-r--r--src/mame/drivers/sbowling.c4
-rw-r--r--src/mame/drivers/scregg.c2
-rw-r--r--src/mame/drivers/segac2.c6
-rw-r--r--src/mame/drivers/segae.c6
-rw-r--r--src/mame/drivers/segag80r.c2
-rw-r--r--src/mame/drivers/segahang.c4
-rw-r--r--src/mame/drivers/segald.c2
-rw-r--r--src/mame/drivers/segaorun.c16
-rw-r--r--src/mame/drivers/segas16a.c10
-rw-r--r--src/mame/drivers/segas16b.c34
-rw-r--r--src/mame/drivers/segas18.c4
-rw-r--r--src/mame/drivers/segas24.c10
-rw-r--r--src/mame/drivers/segas32.c6
-rw-r--r--src/mame/drivers/seibuspi.c32
-rw-r--r--src/mame/drivers/seta.c20
-rw-r--r--src/mame/drivers/seta2.c14
-rw-r--r--src/mame/drivers/sf.c2
-rw-r--r--src/mame/drivers/sfbonus.c18
-rw-r--r--src/mame/drivers/sfkick.c24
-rw-r--r--src/mame/drivers/shangha3.c2
-rw-r--r--src/mame/drivers/shangkid.c4
-rw-r--r--src/mame/drivers/shootout.c8
-rw-r--r--src/mame/drivers/shougi.c2
-rw-r--r--src/mame/drivers/sidearms.c4
-rw-r--r--src/mame/drivers/sigmab52.c10
-rw-r--r--src/mame/drivers/sigmab98.c16
-rw-r--r--src/mame/drivers/silkroad.c2
-rw-r--r--src/mame/drivers/silvmil.c4
-rw-r--r--src/mame/drivers/simpl156.c4
-rw-r--r--src/mame/drivers/skimaxx.c4
-rw-r--r--src/mame/drivers/skullxbo.c2
-rw-r--r--src/mame/drivers/skyarmy.c2
-rw-r--r--src/mame/drivers/skyfox.c4
-rw-r--r--src/mame/drivers/skykid.c4
-rw-r--r--src/mame/drivers/slapfght.c2
-rw-r--r--src/mame/drivers/slapshot.c6
-rw-r--r--src/mame/drivers/sliver.c6
-rw-r--r--src/mame/drivers/slotcarn.c6
-rw-r--r--src/mame/drivers/sms.c2
-rw-r--r--src/mame/drivers/snesb.c14
-rw-r--r--src/mame/drivers/snk.c2
-rw-r--r--src/mame/drivers/snk68.c2
-rw-r--r--src/mame/drivers/snowbros.c28
-rw-r--r--src/mame/drivers/sothello.c2
-rw-r--r--src/mame/drivers/spdodgeb.c2
-rw-r--r--src/mame/drivers/speedspn.c2
-rw-r--r--src/mame/drivers/spiders.c2
-rw-r--r--src/mame/drivers/splash.c8
-rw-r--r--src/mame/drivers/splus.c2
-rw-r--r--src/mame/drivers/spoker.c8
-rw-r--r--src/mame/drivers/spool99.c6
-rw-r--r--src/mame/drivers/sprcros2.c4
-rw-r--r--src/mame/drivers/spy.c2
-rw-r--r--src/mame/drivers/srmp2.c10
-rw-r--r--src/mame/drivers/srmp5.c2
-rw-r--r--src/mame/drivers/srmp6.c4
-rw-r--r--src/mame/drivers/srumbler.c6
-rw-r--r--src/mame/drivers/ssfindo.c2
-rw-r--r--src/mame/drivers/sshangha.c2
-rw-r--r--src/mame/drivers/ssingles.c8
-rw-r--r--src/mame/drivers/ssrj.c2
-rw-r--r--src/mame/drivers/sstrangr.c2
-rw-r--r--src/mame/drivers/ssv.c18
-rw-r--r--src/mame/drivers/st0016.c6
-rw-r--r--src/mame/drivers/starwars.c4
-rw-r--r--src/mame/drivers/statriv2.c8
-rw-r--r--src/mame/drivers/stv.c4
-rw-r--r--src/mame/drivers/sub.c4
-rw-r--r--src/mame/drivers/subsino.c14
-rw-r--r--src/mame/drivers/subsino2.c14
-rw-r--r--src/mame/drivers/suna16.c8
-rw-r--r--src/mame/drivers/suna8.c40
-rw-r--r--src/mame/drivers/supdrapo.c2
-rw-r--r--src/mame/drivers/superdq.c2
-rw-r--r--src/mame/drivers/superqix.c28
-rw-r--r--src/mame/drivers/supertnk.c10
-rw-r--r--src/mame/drivers/suprgolf.c6
-rw-r--r--src/mame/drivers/suprloco.c4
-rw-r--r--src/mame/drivers/suprnova.c4
-rw-r--r--src/mame/drivers/suprslam.c2
-rw-r--r--src/mame/drivers/surpratk.c2
-rw-r--r--src/mame/drivers/system1.c26
-rw-r--r--src/mame/drivers/system16.c28
-rw-r--r--src/mame/drivers/tail2nos.c6
-rw-r--r--src/mame/drivers/taito_b.c6
-rw-r--r--src/mame/drivers/taito_f2.c8
-rw-r--r--src/mame/drivers/taito_f3.c20
-rw-r--r--src/mame/drivers/taito_h.c2
-rw-r--r--src/mame/drivers/taito_l.c14
-rw-r--r--src/mame/drivers/taito_x.c2
-rw-r--r--src/mame/drivers/taito_z.c4
-rw-r--r--src/mame/drivers/taitoair.c2
-rw-r--r--src/mame/drivers/taitojc.c2
-rw-r--r--src/mame/drivers/taitowlf.c6
-rw-r--r--src/mame/drivers/tank8.c6
-rw-r--r--src/mame/drivers/tankbust.c6
-rw-r--r--src/mame/drivers/taotaido.c2
-rw-r--r--src/mame/drivers/targeth.c2
-rw-r--r--src/mame/drivers/tatsumi.c50
-rw-r--r--src/mame/drivers/tattack.c2
-rw-r--r--src/mame/drivers/tbowl.c8
-rw-r--r--src/mame/drivers/tcl.c4
-rw-r--r--src/mame/drivers/tecmo.c6
-rw-r--r--src/mame/drivers/tecmosys.c8
-rw-r--r--src/mame/drivers/tehkanwc.c4
-rw-r--r--src/mame/drivers/tetrisp2.c10
-rw-r--r--src/mame/drivers/thedeep.c8
-rw-r--r--src/mame/drivers/thepit.c2
-rw-r--r--src/mame/drivers/thief.c4
-rw-r--r--src/mame/drivers/thoop2.c2
-rw-r--r--src/mame/drivers/thunderx.c4
-rw-r--r--src/mame/drivers/tmaster.c36
-rw-r--r--src/mame/drivers/tmmjprd.c6
-rw-r--r--src/mame/drivers/tmnt.c24
-rw-r--r--src/mame/drivers/tmspoker.c6
-rw-r--r--src/mame/drivers/tnzs.c2
-rw-r--r--src/mame/drivers/toaplan2.c10
-rw-r--r--src/mame/drivers/toki.c22
-rw-r--r--src/mame/drivers/topspeed.c4
-rw-r--r--src/mame/drivers/trackfld.c8
-rw-r--r--src/mame/drivers/travrusa.c4
-rw-r--r--src/mame/drivers/trucocl.c2
-rw-r--r--src/mame/drivers/trvmadns.c4
-rw-r--r--src/mame/drivers/trvquest.c2
-rw-r--r--src/mame/drivers/tryout.c2
-rw-r--r--src/mame/drivers/ttchamp.c4
-rw-r--r--src/mame/drivers/tugboat.c2
-rw-r--r--src/mame/drivers/tumbleb.c32
-rw-r--r--src/mame/drivers/tumblep.c2
-rw-r--r--src/mame/drivers/turbo.c2
-rw-r--r--src/mame/drivers/tutankhm.c2
-rw-r--r--src/mame/drivers/twin16.c4
-rw-r--r--src/mame/drivers/twinkle.c4
-rw-r--r--src/mame/drivers/umipoker.c2
-rw-r--r--src/mame/drivers/undrfire.c8
-rw-r--r--src/mame/drivers/unico.c4
-rw-r--r--src/mame/drivers/upscope.c2
-rw-r--r--src/mame/drivers/usgames.c2
-rw-r--r--src/mame/drivers/vaportra.c2
-rw-r--r--src/mame/drivers/vball.c2
-rw-r--r--src/mame/drivers/vcombat.c2
-rw-r--r--src/mame/drivers/vega.c2
-rw-r--r--src/mame/drivers/vendetta.c2
-rw-r--r--src/mame/drivers/videopkr.c6
-rw-r--r--src/mame/drivers/vigilant.c2
-rw-r--r--src/mame/drivers/viper.c2
-rw-r--r--src/mame/drivers/vmetal.c6
-rw-r--r--src/mame/drivers/voyager.c8
-rw-r--r--src/mame/drivers/wallc.c6
-rw-r--r--src/mame/drivers/wardner.c2
-rw-r--r--src/mame/drivers/warpsped.c2
-rw-r--r--src/mame/drivers/warriorb.c2
-rw-r--r--src/mame/drivers/wc90.c4
-rw-r--r--src/mame/drivers/wc90b.c6
-rw-r--r--src/mame/drivers/wecleman.c26
-rw-r--r--src/mame/drivers/welltris.c4
-rw-r--r--src/mame/drivers/wgp.c6
-rw-r--r--src/mame/drivers/wheelfir.c6
-rw-r--r--src/mame/drivers/whitestar.c8
-rw-r--r--src/mame/drivers/williams.c2
-rw-r--r--src/mame/drivers/wink.c2
-rw-r--r--src/mame/drivers/witch.c6
-rw-r--r--src/mame/drivers/wiz.c4
-rw-r--r--src/mame/drivers/xain.c4
-rw-r--r--src/mame/drivers/xexex.c6
-rw-r--r--src/mame/drivers/xmen.c2
-rw-r--r--src/mame/drivers/xorworld.c2
-rw-r--r--src/mame/drivers/xtom3d.c28
-rw-r--r--src/mame/drivers/xxmissio.c2
-rw-r--r--src/mame/drivers/yunsun16.c2
-rw-r--r--src/mame/drivers/yunsung8.c6
-rw-r--r--src/mame/drivers/zaxxon.c4
-rw-r--r--src/mame/drivers/zn.c54
-rw-r--r--src/mame/drivers/zr107.c2
695 files changed, 2579 insertions, 2667 deletions
diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c
index 25040abf22c..0a5a3053f38 100644
--- a/src/mame/drivers/1942.c
+++ b/src/mame/drivers/1942.c
@@ -505,7 +505,7 @@ ROM_END
static DRIVER_INIT( 1942 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 3, &ROM[0x10000], 0x4000);
}
diff --git a/src/mame/drivers/1943.c b/src/mame/drivers/1943.c
index 30e31e75e6b..682e3efed39 100644
--- a/src/mame/drivers/1943.c
+++ b/src/mame/drivers/1943.c
@@ -643,7 +643,7 @@ ROM_END
static DRIVER_INIT( 1943 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
}
diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c
index 84c81d440a0..b8c3033c6cb 100644
--- a/src/mame/drivers/20pacgal.c
+++ b/src/mame/drivers/20pacgal.c
@@ -144,7 +144,7 @@ static void set_bankptr(running_machine &machine)
_20pacgal_state *state = machine.driver_data<_20pacgal_state>();
if (state->m_game_selected == 0)
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(rom + 0x08000);
}
else
diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c
index 409b799b35a..a81a83e31f9 100644
--- a/src/mame/drivers/2mindril.c
+++ b/src/mame/drivers/2mindril.c
@@ -495,8 +495,8 @@ static void tile_decode(running_machine &machine)
{
UINT8 lsb,msb;
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx2")->base();
- int size=machine.region("gfx2")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx2")->base();
+ int size=machine.root_device().memregion("gfx2")->bytes();
int data;
/* Setup ROM formats:
@@ -528,8 +528,8 @@ static void tile_decode(running_machine &machine)
offset+=4;
}
- gfx = machine.region("gfx1")->base();
- size=machine.region("gfx1")->bytes();
+ gfx = machine.root_device().memregion("gfx1")->base();
+ size=machine.root_device().memregion("gfx1")->bytes();
offset = size/2;
for (i = size/2+size/4; i<size; i++)
diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c
index f7e451ec6d8..dc1a0e68e04 100644
--- a/src/mame/drivers/39in1.c
+++ b/src/mame/drivers/39in1.c
@@ -1569,7 +1569,7 @@ static void pxa255_start(running_machine& machine)
static MACHINE_START(39in1)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0; i < 0x80000; i += 2)
diff --git a/src/mame/drivers/3do.c b/src/mame/drivers/3do.c
index 118b1c4a863..d3fc660c1ff 100644
--- a/src/mame/drivers/3do.c
+++ b/src/mame/drivers/3do.c
@@ -135,11 +135,11 @@ static MACHINE_RESET( 3do )
state->m_maincpu = downcast<legacy_cpu_device*>( machine.device("maincpu") );
- state->membank("bank2")->set_base(machine.region("user1")->base());
+ state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base());
/* configure overlay */
state->membank("bank1")->configure_entry(0, state->m_dram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, state->memregion("user1")->base());
/* start with overlay enabled */
state->membank("bank1")->set_entry(1);
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c
index 75d7f630044..8fc6ed5ff08 100644
--- a/src/mame/drivers/40love.c
+++ b/src/mame/drivers/40love.c
@@ -566,7 +566,7 @@ READ8_MEMBER(fortyl_state::undoukai_mcu_status_r)
static DRIVER_INIT( undoukai )
{
fortyl_state *state = machine.driver_data<fortyl_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000);
state->m_pix_color[0] = 0x000;
@@ -578,14 +578,14 @@ static DRIVER_INIT( undoukai )
static DRIVER_INIT( 40love )
{
fortyl_state *state = machine.driver_data<fortyl_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000);
#if 0
/* character ROM hack
to show a white line on the opponent side */
- UINT8 *ROM = machine.region("gfx2")->base();
+ UINT8 *ROM = state->memregion("gfx2")->base();
int adr = 0x10 * 0x022b;
ROM[adr + 0x000a] = 0x00;
ROM[adr + 0x000b] = 0x00;
diff --git a/src/mame/drivers/4enraya.c b/src/mame/drivers/4enraya.c
index 57d31854cb6..0b50147c233 100644
--- a/src/mame/drivers/4enraya.c
+++ b/src/mame/drivers/4enraya.c
@@ -79,7 +79,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_w )
READ8_MEMBER(_4enraya_state::fenraya_custom_map_r)
{
- UINT8 *prom = machine().region("pal_prom")->base();
+ UINT8 *prom = memregion("pal_prom")->base();
UINT8 prom_routing = (prom[offset >> 12] & 0xf) ^ 0xf;
UINT8 res;
@@ -87,13 +87,13 @@ READ8_MEMBER(_4enraya_state::fenraya_custom_map_r)
if(prom_routing & 1) //ROM5
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
res |= rom[offset & 0x7fff];
}
if(prom_routing & 2) //ROM4
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
res |= rom[(offset & 0x7fff) | 0x8000];
}
@@ -112,7 +112,7 @@ READ8_MEMBER(_4enraya_state::fenraya_custom_map_r)
WRITE8_MEMBER(_4enraya_state::fenraya_custom_map_w)
{
- UINT8 *prom = machine().region("pal_prom")->base();
+ UINT8 *prom = memregion("pal_prom")->base();
UINT8 prom_routing = (prom[offset >> 12] & 0xf) ^ 0xf;
if(prom_routing & 1) //ROM5
@@ -392,7 +392,7 @@ ROM_END
static DRIVER_INIT( unkpacg )
{
_4enraya_state *state = machine.driver_data<_4enraya_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->m_snd_latch_bit = 2;
diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c
index 724e2673a59..7f4dd34fa2a 100644
--- a/src/mame/drivers/5clown.c
+++ b/src/mame/drivers/5clown.c
@@ -537,7 +537,7 @@ static SCREEN_UPDATE_IND16( fclown )
static PALETTE_INIT( fclown )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/*
7654 3210
---- ---x RED component.
@@ -1205,7 +1205,7 @@ static DRIVER_INIT( fclown )
/* Decrypting main program */
int x;
- UINT8 *src = machine.region( "maincpu" )->base();
+ UINT8 *src = state->memregion( "maincpu" )->base();
for (x = 0x0000; x < 0x10000; x++)
{
@@ -1215,8 +1215,8 @@ static DRIVER_INIT( fclown )
/* Decrypting GFX by segments */
- UINT8 *gfx1_src = machine.region( "gfx1" )->base();
- UINT8 *gfx2_src = machine.region( "gfx2" )->base();
+ UINT8 *gfx1_src = machine.root_device().memregion( "gfx1" )->base();
+ UINT8 *gfx2_src = machine.root_device().memregion( "gfx2" )->base();
for (x = 0x2000; x < 0x3000; x++)
{
@@ -1236,7 +1236,7 @@ static DRIVER_INIT( fclown )
/* Decrypting sound samples */
- UINT8 *samples_src = machine.region( "oki6295" )->base();
+ UINT8 *samples_src = machine.root_device().memregion( "oki6295" )->base();
for (x = 0x0000; x < 0x10000; x++)
{
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index 2044019f8bc..8ea3bdc221e 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -2162,8 +2162,8 @@ MACHINE_CONFIG_END
/* decrypt function for vortex */
static DRIVER_INIT( vortex )
{
- UINT8 *rom = machine.region("maincpu")->base();
- int length = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
for (x = 0; x < length; x++)
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index ff46cd0ab13..af757c65336 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -266,7 +266,7 @@ INPUT_PORTS_END
static KONAMI_SETLINES_CALLBACK( k88games_banking )
{
_88games_state *state = device->machine().driver_data<_88games_state>();
- UINT8 *RAM = device->machine().region("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
int offs;
logerror("%04x: bank select %02x\n", cpu_get_pc(device), lines);
@@ -330,7 +330,7 @@ static MACHINE_RESET( 88games )
_88games_state *state = machine.driver_data<_88games_state>();
konami_configure_set_lines(machine.device("maincpu"), k88games_banking);
- state->m_generic_paletteram_8.set_target(&machine.region("maincpu")->base()[0x20000], 0x1000);
+ state->m_generic_paletteram_8.set_target(&state->memregion("maincpu")->base()[0x20000], 0x1000);
state->m_videobank = 0;
state->m_zoomreadroms = 0;
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 05f57eae656..209266d3584 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -604,7 +604,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( sidewndr )
{
- UINT8 *ROM = machine.region( "maincpu" )->base();
+ UINT8 *ROM = machine.root_device().memregion( "maincpu" )->base();
/* replace "ret nc" ( 0xd0 ) with "di" */
ROM[ 0 ] = 0xf3;
/* this is either a bad dump or the cpu core should set the carry flag on reset */
diff --git a/src/mame/drivers/acesp.c b/src/mame/drivers/acesp.c
index 0b1126e4aec..2d124fc0418 100644
--- a/src/mame/drivers/acesp.c
+++ b/src/mame/drivers/acesp.c
@@ -1237,7 +1237,7 @@ extern void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_x
DRIVER_INIT( ace_cr )
{
- descramble_crystal(machine.region( "maincpu" )->base(), 0x0000, 0x10000, 0x00);
+ descramble_crystal(machine.root_device().memregion( "maincpu" )->base(), 0x0000, 0x10000, 0x00);
}
DRIVER_INIT( ace_sp )
diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c
index 30fea3a9b5b..958feee13d1 100644
--- a/src/mame/drivers/adp.c
+++ b/src/mame/drivers/adp.c
@@ -319,7 +319,7 @@ static MACHINE_START( skattv )
// hack to handle acrt rom
{
- UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
+ UINT16 *rom = (UINT16*)state->memregion("gfx1")->base();
int i;
device_t *hd63484 = machine.device("hd63484");
@@ -637,7 +637,7 @@ static const ay8910_interface ay8910_config =
READ8_MEMBER(adp_state::h63484_rom_r)
{
- UINT8 *rom = machine().region("gfx1")->base();
+ UINT8 *rom = memregion("gfx1")->base();
return rom[offset];
}
diff --git a/src/mame/drivers/aeroboto.c b/src/mame/drivers/aeroboto.c
index f58b6308e1a..6a366324ace 100644
--- a/src/mame/drivers/aeroboto.c
+++ b/src/mame/drivers/aeroboto.c
@@ -227,8 +227,8 @@ static MACHINE_START( formatz )
{
aeroboto_state *state = machine.driver_data<aeroboto_state>();
- state->m_stars_rom = machine.region("gfx2")->base();
- state->m_stars_length = machine.region("gfx2")->bytes();
+ state->m_stars_rom = machine.root_device().memregion("gfx2")->base();
+ state->m_stars_length = state->memregion("gfx2")->bytes();
state->save_item(NAME(state->m_disable_irq));
state->save_item(NAME(state->m_count));
diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c
index ff436d68772..32e9a9c2e32 100644
--- a/src/mame/drivers/aerofgt.c
+++ b/src/mame/drivers/aerofgt.c
@@ -129,7 +129,7 @@ static WRITE16_DEVICE_HANDLER( aerfboo2_okim6295_banking_w )
WRITE8_MEMBER(aerofgt_state::aerfboot_okim6295_banking_w)
{
- UINT8 *oki = machine().region("oki")->base();
+ UINT8 *oki = memregion("oki")->base();
/*bit 2 (0x4) setted too?*/
if (data & 0x4)
memcpy(&oki[0x20000], &oki[((data & 0x3) * 0x20000) + 0x40000], 0x20000);
@@ -1302,7 +1302,7 @@ static MACHINE_START( common )
static MACHINE_START( aerofgt )
{
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &rom[0x10000], 0x8000);
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index b587de06c7e..6bbcf1af3c6 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -571,9 +571,9 @@ static INTERRUPT_GEN( slave_interrupt )
static MACHINE_START( airbustr )
{
airbustr_state *state = machine.driver_data<airbustr_state>();
- UINT8 *MASTER = machine.region("master")->base();
- UINT8 *SLAVE = machine.region("slave")->base();
- UINT8 *AUDIO = machine.region("audiocpu")->base();
+ UINT8 *MASTER = machine.root_device().memregion("master")->base();
+ UINT8 *SLAVE = machine.root_device().memregion("slave")->base();
+ UINT8 *AUDIO = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 3, &MASTER[0x00000], 0x4000);
state->membank("bank1")->configure_entries(3, 5, &MASTER[0x10000], 0x4000);
diff --git a/src/mame/drivers/albazc.c b/src/mame/drivers/albazc.c
index a926bab7c3b..5c0f04622d9 100644
--- a/src/mame/drivers/albazc.c
+++ b/src/mame/drivers/albazc.c
@@ -40,7 +40,7 @@ public:
static PALETTE_INIT( hanaroku )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int r, g, b;
diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c
index 2988a70fe7a..a982fc2bcc6 100644
--- a/src/mame/drivers/albazg.c
+++ b/src/mame/drivers/albazg.c
@@ -357,7 +357,7 @@ INPUT_PORTS_END
static MACHINE_START( yumefuda )
{
albazg_state *state = machine.driver_data<albazg_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index 3a5eaf1ebb1..c05164565fd 100644
--- a/src/mame/drivers/aleck64.c
+++ b/src/mame/drivers/aleck64.c
@@ -837,7 +837,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( aleck64 )
{
- UINT8 *rom = machine.region("user2")->base();
+ UINT8 *rom = machine.root_device().memregion("user2")->base();
rom[0x67c] = 0;
rom[0x67d] = 0;
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 926428ce46d..6c081f9b170 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -700,7 +700,7 @@ static void alg_init(running_machine &machine)
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
}
@@ -713,8 +713,8 @@ static void alg_init(running_machine &machine)
static DRIVER_INIT( palr1 )
{
- UINT32 length = machine.region("user2")->bytes();
- UINT8 *rom = machine.region("user2")->base();
+ UINT32 length = machine.root_device().memregion("user2")->bytes();
+ UINT8 *rom = machine.root_device().memregion("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -733,8 +733,8 @@ static DRIVER_INIT( palr1 )
static DRIVER_INIT( palr3 )
{
- UINT32 length = machine.region("user2")->bytes();
- UINT8 *rom = machine.region("user2")->base();
+ UINT32 length = machine.root_device().memregion("user2")->bytes();
+ UINT8 *rom = machine.root_device().memregion("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -752,8 +752,8 @@ static DRIVER_INIT( palr3 )
static DRIVER_INIT( palr6 )
{
- UINT32 length = machine.region("user2")->bytes();
- UINT8 *rom = machine.region("user2")->base();
+ UINT32 length = machine.root_device().memregion("user2")->bytes();
+ UINT8 *rom = machine.root_device().memregion("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -774,7 +774,7 @@ static DRIVER_INIT( palr6 )
static DRIVER_INIT( aplatoon )
{
/* NOT DONE TODO FIGURE OUT THE RIGHT ORDER!!!! */
- UINT8 *rom = machine.region("user2")->base();
+ UINT8 *rom = machine.root_device().memregion("user2")->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x40000);
int i;
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index 62731b646d5..8eb0759189b 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -230,7 +230,7 @@ static const k051960_interface aliens_k051960_intf =
static MACHINE_START( aliens )
{
aliens_state *state = machine.driver_data<aliens_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 20, &ROM[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index 5806ef359ea..30ec17b0434 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -1903,7 +1903,7 @@ static MACHINE_RESET( common )
static MACHINE_START( alpha68k_V )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank7")->configure_entries(0, 32, &ROM[0x10000], 0x4000);
@@ -1939,7 +1939,7 @@ static MACHINE_RESET( alpha68k_II )
static MACHINE_START( alpha68k_II )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank7")->configure_entries(0, 28, &ROM[0x10000], 0x4000);
@@ -3222,7 +3222,7 @@ static DRIVER_INIT( btlfieldb )
static DRIVER_INIT( skysoldr )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- state->membank("bank8")->set_base((machine.region("user1")->base()) + 0x40000);
+ state->membank("bank8")->set_base((state->memregion("user1")->base()) + 0x40000);
state->m_invert_controls = 0;
state->m_microcontroller_id = 0;
state->m_coin_id = 0x22 | (0x22 << 8);
@@ -3241,7 +3241,7 @@ static DRIVER_INIT( goldmedl )
static DRIVER_INIT( goldmedla )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- state->membank("bank8")->set_base(machine.region("maincpu")->base() + 0x20000);
+ state->membank("bank8")->set_base(state->memregion("maincpu")->base() + 0x20000);
state->m_invert_controls = 0;
state->m_microcontroller_id = 0x8803; //Guess - routine to handle coinage is the same as in 'goldmedl'
state->m_coin_id = 0x23 | (0x24 << 8);
@@ -3269,7 +3269,7 @@ static DRIVER_INIT( skyadvntu )
static DRIVER_INIT( gangwarsu )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- state->membank("bank8")->set_base(machine.region("user1")->base());
+ state->membank("bank8")->set_base(state->memregion("user1")->base());
state->m_invert_controls = 0;
state->m_microcontroller_id = 0x8512;
state->m_coin_id = 0x23 | (0x24 << 8);
@@ -3279,7 +3279,7 @@ static DRIVER_INIT( gangwarsu )
static DRIVER_INIT( gangwars )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- state->membank("bank8")->set_base(machine.region("user1")->base());
+ state->membank("bank8")->set_base(state->memregion("user1")->base());
state->m_invert_controls = 0;
state->m_microcontroller_id = 0x8512;
state->m_coin_id = 0x23 | (0x24 << 8);
@@ -3289,7 +3289,7 @@ static DRIVER_INIT( gangwars )
static DRIVER_INIT( sbasebal )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)state->memregion("maincpu")->base();
/* Patch protection check, it does a divide by zero because the MCU is trying to
calculate the ball speed when a strike is scored, notice that current emulation
diff --git a/src/mame/drivers/amaticmg.c b/src/mame/drivers/amaticmg.c
index f1348f338a1..80068f424a0 100644
--- a/src/mame/drivers/amaticmg.c
+++ b/src/mame/drivers/amaticmg.c
@@ -413,7 +413,7 @@ static SCREEN_UPDATE_IND16( amaticmg )
static PALETTE_INIT( amaticmg )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
@@ -440,7 +440,7 @@ static PALETTE_INIT( amaticmg )
static PALETTE_INIT( amaticmg3 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int r, g, b;
int i;
diff --git a/src/mame/drivers/ampoker2.c b/src/mame/drivers/ampoker2.c
index 6c536d89884..77c962ddbbb 100644
--- a/src/mame/drivers/ampoker2.c
+++ b/src/mame/drivers/ampoker2.c
@@ -1405,8 +1405,8 @@ ROM_END
static DRIVER_INIT( rabbitpk )
{
- UINT8 *rom = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
int start = 0;
int i;
@@ -1457,7 +1457,7 @@ static DRIVER_INIT( piccolop )
*/
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* NOP'ing the mortal jump... */
rom[0x154b] = 0x00;
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index 7ab97610c45..cdcc304182e 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -93,7 +93,7 @@ ADDRESS_MAP_END
READ8_MEMBER(amspdwy_state::amspdwy_port_r)
{
- UINT8 *tracks = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *tracks = memregion("maincpu")->base() + 0x10000;
return tracks[offset];
}
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index ed49e5a5334..6f870098984 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -744,13 +744,13 @@ ROM_END
static DRIVER_INIT( angelkds )
{
- UINT8 *RAM = machine.region("user1")->base();
+ UINT8 *RAM = machine.root_device().memregion("user1")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &RAM[0x0000], 0x4000);
}
static DRIVER_INIT( spcpostn )
{
- UINT8 *RAM = machine.region("user1")->base();
+ UINT8 *RAM = machine.root_device().memregion("user1")->base();
sega_317_0005_decode(machine, "maincpu");
machine.root_device().membank("bank1")->configure_entries(0, 10, &RAM[0x0000], 0x4000);
diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c
index dc305e44430..ba10c80c8e7 100644
--- a/src/mame/drivers/appoooh.c
+++ b/src/mame/drivers/appoooh.c
@@ -177,7 +177,7 @@ static void appoooh_adpcm_int(device_t *device)
{
if (state->m_adpcm_data == 0xffffffff)
{
- UINT8 *RAM = device->machine().region("adpcm")->base();
+ UINT8 *RAM = state->memregion("adpcm")->base();
state->m_adpcm_data = RAM[state->m_adpcm_address++];
msm5205_data_w(device, state->m_adpcm_data >> 4);
@@ -604,7 +604,7 @@ static DRIVER_INIT(robowres)
static DRIVER_INIT(robowresb)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x1c000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x1c000);
}
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index 3448780dd55..e6db4e1233c 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -239,13 +239,13 @@ static const gfx_layout tilelayout =
static DRIVER_INIT( aquarium )
{
- UINT8 *Z80 = machine.region("audiocpu")->base();
+ UINT8 *Z80 = machine.root_device().memregion("audiocpu")->base();
/* The BG tiles are 5bpp, this rearranges the data from
the roms containing the 1bpp data so we can decode it
correctly */
- UINT8 *DAT2 = machine.region("gfx1")->base() + 0x080000;
- UINT8 *DAT = machine.region("user1")->base();
+ UINT8 *DAT2 = machine.root_device().memregion("gfx1")->base() + 0x080000;
+ UINT8 *DAT = machine.root_device().memregion("user1")->base();
int len = 0x0200000;
for (len = 0; len < 0x020000; len++)
@@ -260,8 +260,8 @@ static DRIVER_INIT( aquarium )
DAT2[len * 4 + 2] |= (DAT[len] & 0x01) << 3;
}
- DAT2 = machine.region("gfx4")->base() + 0x080000;
- DAT = machine.region("user2")->base();
+ DAT2 = machine.root_device().memregion("gfx4")->base() + 0x080000;
+ DAT = machine.root_device().memregion("user2")->base();
for (len = 0; len < 0x020000; len++)
{
diff --git a/src/mame/drivers/arcadecl.c b/src/mame/drivers/arcadecl.c
index 57ba8328b27..c349e466e61 100644
--- a/src/mame/drivers/arcadecl.c
+++ b/src/mame/drivers/arcadecl.c
@@ -398,7 +398,7 @@ ROM_END
static DRIVER_INIT( sparkz )
{
- memset(machine.region("gfx1")->base(), 0, machine.region("gfx1")->bytes());
+ memset(machine.root_device().memregion("gfx1")->base(), 0, machine.root_device().memregion("gfx1")->bytes());
}
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index ff52e94c322..048cd8f1106 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -757,7 +757,7 @@ ROM_END
INLINE void generic_decode(running_machine &machine, const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
{
- UINT16 *rom = (UINT16 *)machine.region(tag)->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion(tag)->base();
int i;
/* only the low byte of ROMs are encrypted in these games */
@@ -766,8 +766,8 @@ INLINE void generic_decode(running_machine &machine, const char *tag, int bit7,
#if 0
{
- UINT8 *ROM = machine.region(tag)->base();
- int size = machine.region(tag)->bytes();
+ UINT8 *ROM = machine.root_device().memregion(tag)->base();
+ int size = machine.root_device().memregion(tag)->bytes();
FILE *fp;
char filename[256];
@@ -809,10 +809,10 @@ static void arcadia_init(running_machine &machine)
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
/* OnePlay bios is encrypted, TenPlay is not */
- biosrom = (UINT16 *)machine.region("user2")->base();
+ biosrom = (UINT16 *)machine.root_device().memregion("user2")->base();
if (biosrom[0] != 0x4afc)
generic_decode(machine, "user2", 6, 1, 0, 2, 3, 4, 5, 7);
}
diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c
index f02fb268123..6d58707057e 100644
--- a/src/mame/drivers/argus.c
+++ b/src/mame/drivers/argus.c
@@ -176,7 +176,7 @@ static const ym2203_interface ym2203_config =
WRITE8_MEMBER(argus_state::argus_bankselect_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + ((data & 7) * 0x4000);
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 9e7031f5a31..2a958a6892c 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -1587,7 +1587,7 @@ static const ppi8255_interface ppi8255_intf1 =
/* same as Casino Winner HW */
static PALETTE_INIT( aristmk4 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
@@ -1614,7 +1614,7 @@ static PALETTE_INIT( aristmk4 )
static DRIVER_INIT( aristmk4 )
{
aristmk4_state *state = machine.driver_data<aristmk4_state>();
- state->m_shapeRomPtr = (UINT8 *)machine.region("tile_gfx")->base();
+ state->m_shapeRomPtr = (UINT8 *)state->memregion("tile_gfx")->base();
memcpy(state->m_shapeRom,state->m_shapeRomPtr,sizeof(state->m_shapeRom)); // back up
state->m_nvram = auto_alloc_array(machine, UINT8, 0x1000);
}
diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c
index 920a09599da..546da3d4a2b 100644
--- a/src/mame/drivers/aristmk5.c
+++ b/src/mame/drivers/aristmk5.c
@@ -359,8 +359,8 @@ INPUT_PORTS_END
static DRIVER_INIT( aristmk5 )
{
- UINT8 *SRAM = machine.region("sram")->base();
- UINT8 *SRAM_NZ = machine.region("sram")->base();
+ UINT8 *SRAM = machine.root_device().memregion("sram")->base();
+ UINT8 *SRAM_NZ = machine.root_device().memregion("sram")->base();
archimedes_driver_init(machine);
@@ -392,15 +392,15 @@ static MACHINE_RESET( aristmk5 )
/* load the roms according to what the operator wants */
{
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *PRG;// = machine.region("prg_code")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *PRG;// = state->memregion("prg_code")->base();
int i;
UINT8 op_mode;
static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "clear_chip", "game_prg" };
op_mode = input_port_read(machine, "ROM_LOAD");
- PRG = machine.region(rom_region[op_mode & 3])->base();
+ PRG = machine.root_device().memregion(rom_region[op_mode & 3])->base();
if(PRG!=NULL)
diff --git a/src/mame/drivers/aristmk6.c b/src/mame/drivers/aristmk6.c
index 650eb342232..53a648fd8e8 100644
--- a/src/mame/drivers/aristmk6.c
+++ b/src/mame/drivers/aristmk6.c
@@ -33,7 +33,7 @@ SCREEN_UPDATE_RGB32(aristmk6)
aristmk6_state *state = screen.machine().driver_data<aristmk6_state>();
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("maincpu")->base();
+ const UINT8 *blit_ram = state->memregion("maincpu")->base();
if(screen.machine().input().code_pressed(KEYCODE_Z))
state->m_test_x++;
diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c
index c6b87cadca9..17f47bba4af 100644
--- a/src/mame/drivers/arkanoid.c
+++ b/src/mame/drivers/arkanoid.c
@@ -1580,7 +1580,7 @@ static DRIVER_INIT( block2 )
arkanoid_state *state = machine.driver_data<arkanoid_state>();
// the graphics on this bootleg have the data scrambled
int tile;
- UINT8* srcgfx = machine.region("gfx1")->base();
+ UINT8* srcgfx = state->memregion("gfx1")->base();
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x18000);
for (tile = 0; tile < 0x3000; tile++)
@@ -1643,7 +1643,7 @@ static DRIVER_INIT( paddle2 )
static DRIVER_INIT( tetrsark )
{
arkanoid_state *state = machine.driver_data<arkanoid_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int x;
for (x = 0; x < 0x8000; x++)
@@ -1657,7 +1657,7 @@ static DRIVER_INIT( tetrsark )
static DRIVER_INIT( hexa )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
#if 0
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index a0c030c57c9..f5ff09cc617 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -2085,7 +2085,7 @@ static DRIVER_INIT( legion )
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
RAM[0x0001d6 / 2] = 0x0001;
/* To avoid checksum error */
RAM[0x000488 / 2] = 0x4e71;
@@ -2102,7 +2102,7 @@ static DRIVER_INIT( legiono )
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
RAM[0x0001d6/2] = 0x0001;
/* No need to patch the checksum routine (see notes) ! */
#endif
diff --git a/src/mame/drivers/ashnojoe.c b/src/mame/drivers/ashnojoe.c
index bc361de2e05..abdd6ebf8ff 100644
--- a/src/mame/drivers/ashnojoe.c
+++ b/src/mame/drivers/ashnojoe.c
@@ -462,7 +462,7 @@ ROM_END
static DRIVER_INIT( ashnojoe )
{
- UINT8 *ROM = machine.region("adpcm")->base();
+ UINT8 *ROM = machine.root_device().memregion("adpcm")->base();
machine.root_device().membank("bank4")->configure_entries(0, 16, &ROM[0x00000], 0x8000);
machine.root_device().membank("bank4")->set_entry(0);
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index 7574e83558e..b02aa33e16b 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -460,8 +460,8 @@ ROM_END
static DRIVER_INIT( asterix )
{
#if 0
- *(UINT16 *)(machine.region("maincpu")->base() + 0x07f34) = 0x602a;
- *(UINT16 *)(machine.region("maincpu")->base() + 0x00008) = 0x0400;
+ *(UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x07f34) = 0x602a;
+ *(UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x00008) = 0x0400;
#endif
}
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 07f4e481bb5..9b675ad0ac5 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -159,7 +159,7 @@ static void plot_byte( running_machine &machine, bitmap_rgb32 &bitmap, UINT8 y,
static SCREEN_UPDATE_RGB32( astinvad )
{
astinvad_state *state = screen.machine().driver_data<astinvad_state>();
- const UINT8 *color_prom = screen.machine().region("proms")->base();
+ const UINT8 *color_prom = state->memregion("proms")->base();
UINT8 yoffs = state->m_flip_yoffs & state->m_screen_flip;
int x, y;
@@ -179,7 +179,7 @@ static SCREEN_UPDATE_RGB32( astinvad )
static SCREEN_UPDATE_RGB32( spaceint )
{
astinvad_state *state = screen.machine().driver_data<astinvad_state>();
- const UINT8 *color_prom = screen.machine().region("proms")->base();
+ const UINT8 *color_prom = state->memregion("proms")->base();
int offs;
for (offs = 0; offs < state->m_videoram.bytes(); offs++)
diff --git a/src/mame/drivers/astrafr.c b/src/mame/drivers/astrafr.c
index 08bbce222cd..f3258dfb087 100644
--- a/src/mame/drivers/astrafr.c
+++ b/src/mame/drivers/astrafr.c
@@ -1963,26 +1963,26 @@ void astra_addresslines( UINT16* src, size_t srcsize, int small )
static DRIVER_INIT( astradec )
{
- astra_addresslines( (UINT16*)machine.region( "maincpu" )->base(), machine.region( "maincpu" )->bytes(), 0 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "maincpu" )->base(), machine.root_device().memregion( "maincpu" )->bytes(), 0 );
}
static DRIVER_INIT( astradec_dual )
{
- astra_addresslines( (UINT16*)machine.region( "maincpu" )->base(), machine.region( "maincpu" )->bytes(), 0 );
- astra_addresslines( (UINT16*)machine.region( "slavecpu" )->base(), machine.region( "slavecpu" )->bytes(), 0 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "maincpu" )->base(), machine.root_device().memregion( "maincpu" )->bytes(), 0 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "slavecpu" )->base(), machine.root_device().memregion( "slavecpu" )->bytes(), 0 );
}
static DRIVER_INIT( astradec_sml )
{
- astra_addresslines( (UINT16*)machine.region( "maincpu" )->base(), machine.region( "maincpu" )->bytes(), 1 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "maincpu" )->base(), machine.root_device().memregion( "maincpu" )->bytes(), 1 );
}
static DRIVER_INIT( astradec_sml_dual )
{
- astra_addresslines( (UINT16*)machine.region( "maincpu" )->base(), machine.region( "maincpu" )->bytes(), 1 );
- astra_addresslines( (UINT16*)machine.region( "slavecpu" )->base(), machine.region( "slavecpu" )->bytes(), 1 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "maincpu" )->base(), machine.root_device().memregion( "maincpu" )->bytes(), 1 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "slavecpu" )->base(), machine.root_device().memregion( "slavecpu" )->bytes(), 1 );
}
// Single games?
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index f52e0454eb6..d505ae461c1 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -428,14 +428,14 @@ WRITE8_MEMBER(astrocde_state::profpac_banksw_w)
/* set the main banking */
prog_space->install_read_bank(0x4000, 0xbfff, "bank1");
- membank("bank1")->set_base(machine().region("user1")->base() + 0x8000 * bank);
+ membank("bank1")->set_base(machine().root_device().memregion("user1")->base() + 0x8000 * bank);
/* bank 0 reads video RAM in the 4000-7FFF range */
if (bank == 0)
prog_space->install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(astrocde_state::profpac_videoram_r),this));
/* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
- if ((data & 0x80) && machine().region("user2")->base() != NULL)
+ if ((data & 0x80) && memregion("user2")->base() != NULL)
{
/* Note: There is a jumper which could change the base offset to 0xa8 instead */
bank = data - 0x80;
@@ -444,7 +444,7 @@ WRITE8_MEMBER(astrocde_state::profpac_banksw_w)
if (bank < 0x28)
{
prog_space->install_read_bank(0x4000, 0x7fff, "bank2");
- membank("bank2")->set_base(machine().region("user2")->base() + 0x4000 * bank);
+ membank("bank2")->set_base(machine().root_device().memregion("user2")->base() + 0x4000 * bank);
}
else
prog_space->unmap_read(0x4000, 0x7fff);
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index fcff8a8b7cf..a3257efa30c 100644
--- a/src/mame/drivers/astrocorp.c
+++ b/src/mame/drivers/astrocorp.c
@@ -1008,7 +1008,7 @@ ROM_END
static DRIVER_INIT( showhand )
{
#if 0
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[0x0a1a/2] = 0x6000; // hopper jam
@@ -1024,7 +1024,7 @@ static DRIVER_INIT( showhand )
static DRIVER_INIT( showhanc )
{
#if 0
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[0x14d4/2] = 0x4e71; // enable full test mode
rom[0x14d6/2] = 0x4e71; // ""
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index 3ae0352a63c..e9bfc515ae6 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -205,7 +205,7 @@ static void astrof_get_pens( running_machine &machine, pen_t *pens )
offs_t i;
UINT8 bank = (state->m_astrof_palette_bank ? 0x10 : 0x00);
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
- UINT8 *prom = machine.region("proms")->base();
+ UINT8 *prom = state->memregion("proms")->base();
/* a common wire hack to the pcb causes the prom halves to be inverted */
/* this results in e.g. astrof background being black */
@@ -239,7 +239,7 @@ static void astrof_get_pens( running_machine &machine, pen_t *pens )
static void tomahawk_get_pens( running_machine &machine, pen_t *pens )
{
offs_t i;
- UINT8 *prom = machine.region("proms")->base();
+ UINT8 *prom = machine.root_device().memregion("proms")->base();
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
@@ -1289,8 +1289,8 @@ ROM_END
static DRIVER_INIT( abattle )
{
/* use the protection PROM to decrypt the ROMs */
- UINT8 *rom = machine.region("maincpu")->base();
- UINT8 *prom = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT8 *prom = machine.root_device().memregion("user1")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
@@ -1305,7 +1305,7 @@ static DRIVER_INIT( abattle )
static DRIVER_INIT( afire )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
@@ -1320,7 +1320,7 @@ static DRIVER_INIT( afire )
static DRIVER_INIT( sstarbtl )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c
index 1bc01a2442c..f29d7b9aa55 100644
--- a/src/mame/drivers/asuka.c
+++ b/src/mame/drivers/asuka.c
@@ -270,7 +270,7 @@ static void asuka_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("ymsnd")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("ymsnd")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
@@ -842,8 +842,8 @@ static MACHINE_START( asuka )
state->m_tc0100scn = machine.device("tc0100scn");
/* configure the banks */
- state->membank("bank1")->configure_entry(0, machine.region("audiocpu")->base());
- state->membank("bank1")->configure_entries(1, 3, machine.region("audiocpu")->base() + 0x10000, 0x04000);
+ state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base());
+ state->membank("bank1")->configure_entries(1, 3, state->memregion("audiocpu")->base() + 0x10000, 0x04000);
state->save_item(NAME(state->m_adpcm_pos));
state->save_item(NAME(state->m_adpcm_data));
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index f77fad9fc61..bd25e0e7418 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -826,7 +826,7 @@ static DRIVER_INIT( guardian )
/* it looks like they jsr to $80000 as some kind of protection */
/* put an RTS there so we don't die */
- *(UINT16 *)&machine.region("maincpu")->base()[0x80000] = 0x4E75;
+ *(UINT16 *)&state->memregion("maincpu")->base()[0x80000] = 0x4E75;
address_space *main = machine.device<m68000_device>("maincpu")->space(AS_PROGRAM);
state->m_sloop_base = main->install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::guardians_sloop_data_r),state), write16_delegate(FUNC(atarig42_state::guardians_sloop_data_w),state));
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 13bb14c8816..542f3ac5753 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -336,7 +336,7 @@ WRITE16_MEMBER(atarisy2_state::bankselect_w)
COMBINE_DATA(&newword);
m_bankselect[offset] = newword;
- base = &machine().region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
+ base = &machine().root_device().memregion("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
memcpy(offset ? m_rombank2 : m_rombank1, base, 0x2000);
}
@@ -3180,7 +3180,7 @@ static DRIVER_INIT( paperboy )
{
int i;
atarisy2_state *state = machine.driver_data<atarisy2_state>();
- UINT8 *cpu1 = machine.region("maincpu")->base();
+ UINT8 *cpu1 = state->memregion("maincpu")->base();
slapstic_init(machine, 105);
@@ -3216,7 +3216,7 @@ static DRIVER_INIT( ssprint )
{
atarisy2_state *state = machine.driver_data<atarisy2_state>();
int i;
- UINT8 *cpu1 = machine.region("maincpu")->base();
+ UINT8 *cpu1 = state->memregion("maincpu")->base();
slapstic_init(machine, 108);
@@ -3233,7 +3233,7 @@ static DRIVER_INIT( csprint )
{
int i;
atarisy2_state *state = machine.driver_data<atarisy2_state>();
- UINT8 *cpu1 = machine.region("maincpu")->base();
+ UINT8 *cpu1 = state->memregion("maincpu")->base();
slapstic_init(machine, 109);
diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c
index 3f655067e1e..8efaa96524f 100644
--- a/src/mame/drivers/atarisy4.c
+++ b/src/mame/drivers/atarisy4.c
@@ -969,13 +969,13 @@ static DRIVER_INIT( laststar )
state->m_shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
/* Populate the 68000 address space with data from the HEX files */
- load_hexfile(main, machine.region("code")->base());
- load_hexfile(main, machine.region("data")->base());
+ load_hexfile(main, machine.root_device().memregion("code")->base());
+ load_hexfile(main, machine.root_device().memregion("data")->base());
/* Set up the DSP */
state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
state->membank("dsp0_bank1")->set_base(&state->m_shared_ram[0][0x800]);
- load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
+ load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), state->memregion("dsp")->base());
}
static DRIVER_INIT( airrace )
@@ -986,17 +986,17 @@ static DRIVER_INIT( airrace )
state->m_shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000);
/* Populate RAM with data from the HEX files */
- load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), machine.region("code")->base());
+ load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), machine.root_device().memregion("code")->base());
/* Set up the first DSP */
state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
state->membank("dsp0_bank1")->set_base(&state->m_shared_ram[0][0x800]);
- load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
+ load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.root_device().memregion("dsp")->base());
/* Set up the second DSP */
state->membank("dsp1_bank0")->set_base(state->m_shared_ram[1]);
state->membank("dsp1_bank1")->set_base(&state->m_shared_ram[1][0x800]);
- load_ldafile(machine.device("dsp1")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
+ load_ldafile(machine.device("dsp1")->memory().space(AS_PROGRAM), state->memregion("dsp")->base());
}
static MACHINE_RESET( atarisy4 )
diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c
index 9971fb440b4..ae22738f811 100644
--- a/src/mame/drivers/atetris.c
+++ b/src/mame/drivers/atetris.c
@@ -486,7 +486,7 @@ ROM_END
static DRIVER_INIT( atetris )
{
atetris_state *state = machine.driver_data<atetris_state>();
- UINT8 *rgn = machine.region("maincpu")->base();
+ UINT8 *rgn = state->memregion("maincpu")->base();
slapstic_init(machine, 101);
state->m_slapstic_source = &rgn[0x10000];
diff --git a/src/mame/drivers/atvtrack.c b/src/mame/drivers/atvtrack.c
index 49ac5e0e42a..9eb20141110 100644
--- a/src/mame/drivers/atvtrack.c
+++ b/src/mame/drivers/atvtrack.c
@@ -60,7 +60,7 @@ Notes:
#include "cpu/sh4/sh4.h"
#include "debugger.h"
-const memory_region *nandregion;
+memory_region *nandregion;
int nandcommand[4], nandoffset[4], nandaddressstep, nandaddress[4];
UINT32 area1_data[4];
@@ -326,7 +326,7 @@ static MACHINE_START(atvtrack)
address_space *as;
nandaddressstep = 0;
- nandregion = machine.region("maincpu");
+ nandregion = machine.root_device().memregion("maincpu");
as = machine.device("maincpu")->memory().space(AS_PROGRAM);
dst = (UINT8 *)(as->get_write_ptr(0x0c7f0000));
src = nandregion->base()+0x10;
diff --git a/src/mame/drivers/avt.c b/src/mame/drivers/avt.c
index e685c854eba..00fad046d6b 100644
--- a/src/mame/drivers/avt.c
+++ b/src/mame/drivers/avt.c
@@ -531,7 +531,7 @@ static SCREEN_UPDATE_IND16( avt )
static PALETTE_INIT( avt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* prom bits
7654 3210
---- ---x Intensity?.
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 59df4900a77..5c5995753c2 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -667,7 +667,7 @@ ROM_END
static void descramble_sound( running_machine &machine )
{
- UINT8 *rom = machine.region("ymz")->base();
+ UINT8 *rom = machine.root_device().memregion("ymz")->base();
int length = 0x200000; // only the first rom is swapped on backfire!
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c
index 9bdd08c273c..686e961b4f2 100644
--- a/src/mame/drivers/badlands.c
+++ b/src/mame/drivers/badlands.c
@@ -586,8 +586,8 @@ static DRIVER_INIT( badlands )
badlands_state *state = machine.driver_data<badlands_state>();
/* initialize the audio system */
- state->m_bank_base = &machine.region("audiocpu")->base()[0x03000];
- state->m_bank_source_data = &machine.region("audiocpu")->base()[0x10000];
+ state->m_bank_base = &machine.root_device().memregion("audiocpu")->base()[0x03000];
+ state->m_bank_source_data = &state->memregion("audiocpu")->base()[0x10000];
}
diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c
index 5ae0060130e..7835db46643 100644
--- a/src/mame/drivers/balsente.c
+++ b/src/mame/drivers/balsente.c
@@ -2079,8 +2079,8 @@ static void expand_roms(running_machine &machine, UINT8 cd_rom_mask)
UINT8 *temp = auto_alloc_array(machine, UINT8, 0x20000);
{
- UINT8 *rom = machine.region("maincpu")->base();
- UINT32 len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT32 len = machine.root_device().memregion("maincpu")->bytes();
UINT32 base;
for (base = 0x10000; base < len; base += 0x30000)
@@ -2154,7 +2154,7 @@ static DRIVER_INIT( stocker ) { expand_roms(machine, EXPAND_ALL); config_shoot
static DRIVER_INIT( triviag1 ) { expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( triviag2 )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
memcpy(&rom[0x20000], &rom[0x28000], 0x4000);
memcpy(&rom[0x24000], &rom[0x28000], 0x4000);
expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0 /* noanalog */);
diff --git a/src/mame/drivers/baraduke.c b/src/mame/drivers/baraduke.c
index 610d1f91b11..1fe26476c9f 100644
--- a/src/mame/drivers/baraduke.c
+++ b/src/mame/drivers/baraduke.c
@@ -536,7 +536,7 @@ static DRIVER_INIT( baraduke )
int i;
/* unpack the third tile ROM */
- rom = machine.region("gfx2")->base() + 0x8000;
+ rom = machine.root_device().memregion("gfx2")->base() + 0x8000;
for (i = 0x2000;i < 0x4000;i++)
{
rom[i + 0x2000] = rom[i];
diff --git a/src/mame/drivers/battlex.c b/src/mame/drivers/battlex.c
index ff5a633632a..eaca394b87c 100644
--- a/src/mame/drivers/battlex.c
+++ b/src/mame/drivers/battlex.c
@@ -315,9 +315,9 @@ ROM_END
static DRIVER_INIT( battlex )
{
- UINT8 *colormask = machine.region("user1")->base();
- UINT8 *gfxdata = machine.region("user2")->base();
- UINT8 *dest = machine.region("gfx1")->base();
+ UINT8 *colormask = machine.root_device().memregion("user1")->base();
+ UINT8 *gfxdata = machine.root_device().memregion("user2")->base();
+ UINT8 *dest = machine.root_device().memregion("gfx1")->base();
int tile, line, bit;
diff --git a/src/mame/drivers/battlnts.c b/src/mame/drivers/battlnts.c
index 167cf362e09..6c7d5dfda63 100644
--- a/src/mame/drivers/battlnts.c
+++ b/src/mame/drivers/battlnts.c
@@ -224,7 +224,7 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( battlnts )
{
battlnts_state *state = machine.driver_data<battlnts_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
@@ -404,7 +404,7 @@ static void shuffle( UINT8 *buf, int len )
static DRIVER_INIT( rackemup )
{
/* rearrange char ROM */
- shuffle(machine.region("gfx1")->base(), machine.region("gfx1")->bytes());
+ shuffle(machine.root_device().memregion("gfx1")->base(), machine.root_device().memregion("gfx1")->bytes());
}
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index d6ef8643f3e..44004de40ec 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -420,14 +420,14 @@ INLINE UINT8* blitter_get_addr(running_machine &machine, UINT32 addr)
if (addr < 0x10000)
{
/* Is this region fixed? */
- return (UINT8*)(machine.region("user1")->base() + addr);
+ return (UINT8*)(state->memregion("user1")->base() + addr);
}
else if(addr < 0x20000)
{
addr &= 0xffff;
addr += (state->m_bank_data[0] & 1) ? 0x10000 : 0;
- return (UINT8*)(machine.region("user1")->base() + addr + ((state->m_bank_data[0] >> 1) * 0x20000));
+ return (UINT8*)(machine.root_device().memregion("user1")->base() + addr + ((state->m_bank_data[0] >> 1) * 0x20000));
}
else if (addr >= 0x20000 && addr < 0x40000)
{
@@ -1023,7 +1023,7 @@ INLINE void z80_bank(running_machine &machine, int num, int data)
{
UINT32 offset = ((state->m_bank_data[0] >> 1) * 0x20000) + ((0x4000 * data) ^ ((state->m_bank_data[0] & 1) ? 0 : 0x10000));
- state->membank(bank_names[num - 1])->set_base(machine.region("user1")->base() + offset);
+ state->membank(bank_names[num - 1])->set_base(machine.root_device().memregion("user1")->base() + offset);
}
else if (data < 0x10)
{
@@ -1138,7 +1138,7 @@ READ8_MEMBER(bfcobra_state::fddata_r)
}
fdc.offset = (BPT * fdc.track*2) + (fdc.side ? BPT : 0) + (BPS * (fdc.sector-1)) + fdc.byte_pos++;
- val = *(machine().region("user2")->base() + fdc.offset);
+ val = *(machine().root_device().memregion("user2")->base() + fdc.offset);
/* Move on to next sector? */
if (fdc.byte_pos == 1024)
@@ -1706,7 +1706,7 @@ static DRIVER_INIT( bfcobra )
UINT8 *tmp;
tmp = auto_alloc_array(machine, UINT8, 0x8000);
- rom = machine.region("audiocpu")->base() + 0x8000;
+ rom = machine.root_device().memregion("audiocpu")->base() + 0x8000;
memcpy(tmp, rom, 0x8000);
for (i = 0; i < 0x8000; i++)
@@ -1735,7 +1735,7 @@ static DRIVER_INIT( bfcobra )
state->m_bank_data[3] = 0;
/* Fixed 16kB ROM region */
- state->membank("bank4")->set_base(machine.region("user1")->base());
+ state->membank("bank4")->set_base(machine.root_device().memregion("user1")->base());
/* TODO: Properly sort out the data ACIA */
state->m_data_r = 1;
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index 555ef9ed252..328999c1980 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -668,7 +668,7 @@ static MACHINE_RESET( bfm_sc1 )
// init rom bank ////////////////////////////////////////////////////////////////////
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &rom[0x0000], 0x02000);
state->membank("bank1")->set_entry(state->m_defaultbank);
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index e2592427daa..15bb4d912cb 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -378,7 +378,7 @@ static void on_scorpion2_reset(running_machine &machine)
// init rom bank ////////////////////////////////////////////////////////
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &rom[0x00000], 0x02000);
@@ -2204,7 +2204,7 @@ static void adder2_common_init(running_machine &machine)
bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
UINT8 *pal;
- pal = machine.region("proms")->base();
+ pal = state->memregion("proms")->base();
if ( pal )
{
memcpy(state->m_key, pal, 8);
diff --git a/src/mame/drivers/bfm_sc4.c b/src/mame/drivers/bfm_sc4.c
index 89da97cdfd1..5d5dadbd388 100644
--- a/src/mame/drivers/bfm_sc4.c
+++ b/src/mame/drivers/bfm_sc4.c
@@ -63,8 +63,8 @@ int find_project_string(running_machine &machine, int addrxor, int mode)
// search for the title
const int strlength = 14;
char title_string[] = "PROJECT NUMBER";
- UINT8 *src = machine.region( "maincpu" )->base();
- int size = machine.region( "maincpu" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
+ int size = machine.root_device().memregion( "maincpu" )->bytes();
int search_start = 0;
int search_step = 1;
@@ -194,7 +194,7 @@ INPUT_PORTS_END
DRIVER_INIT( sc4 )
{
- UINT8 *src = machine.region( "maincpu" )->base();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
// SC4 identification sequence 0x80 0x00 0xf0 0x7d
if (((src[0] == 0x80) && (src[2] == 0xf0)) || ((src[1] == 0x00) && (src[3] == 0x7d)))
{
@@ -233,7 +233,7 @@ DRIVER_INIT( sc4mbus )
{
DRIVER_INIT_CALL( sc4 );
sc4_state *state = machine.driver_data<sc4_state>();
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)state->memregion("maincpu")->base();
find_mbus(state, rom);
}
diff --git a/src/mame/drivers/bfm_sc4h.c b/src/mame/drivers/bfm_sc4h.c
index 0defbf4c1e0..2e8c5f8450a 100644
--- a/src/mame/drivers/bfm_sc4h.c
+++ b/src/mame/drivers/bfm_sc4h.c
@@ -568,7 +568,7 @@ static NVRAM_HANDLER( bfm_sc4 )
static MACHINE_START( sc4 )
{
sc4_state *state = machine.driver_data<sc4_state>();
- state->m_cpuregion = (UINT16*)machine.region( "maincpu" )->base();
+ state->m_cpuregion = (UINT16*)state->memregion( "maincpu" )->base();
state->m_mainram = (UINT16*)auto_alloc_array_clear(machine, UINT16, 0x10000);
state->m_duart = machine.device("duart68681");
state->m_ymz = machine.device("ymz");
diff --git a/src/mame/drivers/bfm_sc5.c b/src/mame/drivers/bfm_sc5.c
index 57844c274f7..6daba50722d 100644
--- a/src/mame/drivers/bfm_sc5.c
+++ b/src/mame/drivers/bfm_sc5.c
@@ -11791,7 +11791,7 @@ extern int find_project_string(running_machine &machine, int addrxor, int mode);
DRIVER_INIT( sc5 )
{
// sc5 roms always start with SC5
- UINT8 *src = machine.region( "maincpu" )->base();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
// printf("%02x %02x %02x %02x\n", src[0], src[1], src[2], src[3]);
if (((src[0] == 0x20) && (src[2] == 0x43)) || ((src[1] == 0x35) && (src[3] == 0x53)))
{
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index ce750b98f0f..425b7134587 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -619,7 +619,7 @@ ROM_END
static DRIVER_INIT( bigevglf )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0xff, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/bingoc.c b/src/mame/drivers/bingoc.c
index f2b71a6a7bd..d26b2374742 100644
--- a/src/mame/drivers/bingoc.c
+++ b/src/mame/drivers/bingoc.c
@@ -100,7 +100,7 @@ static WRITE8_DEVICE_HANDLER( bingoc_play_w )
---- --x- sound rom banking
---- ---x start-stop sample
*/
- UINT8 *upd = device->machine().region("upd")->base();
+ UINT8 *upd = device->machine().root_device().memregion("upd")->base();
memcpy(&upd[0x00000], &upd[0x20000 + (((data & 2)>>1) * 0x20000)], 0x20000);
upd7759_start_w(device, data & 1);
// printf("%02x\n",data);
diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c
index eccbb696446..e3ccd09b61e 100644
--- a/src/mame/drivers/bking.c
+++ b/src/mame/drivers/bking.c
@@ -59,7 +59,7 @@ WRITE8_MEMBER(bking_state::bking3_addr_h_w)
READ8_MEMBER(bking_state::bking3_extrarom_r)
{
- UINT8 *rom = machine().region("user2")->base();
+ UINT8 *rom = memregion("user2")->base();
return rom[m_addr_h * 256 + m_addr_l];
}
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index 241d6546dc1..d5011f55fb6 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -301,7 +301,7 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( bladestl )
{
bladestl_state *state = machine.driver_data<bladestl_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c
index d4282545f9c..e46258ef83a 100644
--- a/src/mame/drivers/blitz.c
+++ b/src/mame/drivers/blitz.c
@@ -364,7 +364,7 @@ static SCREEN_UPDATE_IND16( megadpkr )
static PALETTE_INIT( megadpkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/*
This hardware has a feature called BLUE KILLER.
Using the original intensity line, the PCB has a bridge
diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c
index ccf97d85aa1..9ef120b333d 100644
--- a/src/mame/drivers/blitz68k.c
+++ b/src/mame/drivers/blitz68k.c
@@ -242,7 +242,7 @@ static SCREEN_UPDATE_RGB32(blitz68k_noblit)
WRITE16_MEMBER(blitz68k_state::blit_copy_w)
{
- UINT8 *blit_rom = machine().region("blitter")->base();
+ UINT8 *blit_rom = memregion("blitter")->base();
UINT32 blit_dst_xpos;
UINT32 blit_dst_ypos;
int x,y,x_size,y_size;
@@ -430,8 +430,8 @@ WRITE8_MEMBER(blitz68k_state::blit_flags_w)
WRITE8_MEMBER(blitz68k_state::blit_draw_w)
{
- UINT8 *blit_rom = machine().region("blitter")->base();
- int blit_romsize = machine().region("blitter")->bytes();
+ UINT8 *blit_rom = memregion("blitter")->base();
+ int blit_romsize = memregion("blitter")->bytes();
UINT32 blit_dst_xpos;
UINT32 blit_dst_ypos;
int x, y, x_size, y_size;
@@ -2690,7 +2690,7 @@ ROM_END
static DRIVER_INIT( bankrob )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0xb5e0/2] = 0x6028;
@@ -2705,7 +2705,7 @@ static DRIVER_INIT( bankrob )
static DRIVER_INIT( bankroba )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0x11e4e/2] = 0x6028;
@@ -2720,7 +2720,7 @@ static DRIVER_INIT( bankroba )
static DRIVER_INIT( cjffruit )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0xf564/2] = 0x6028;
@@ -2731,7 +2731,7 @@ static DRIVER_INIT( cjffruit )
static DRIVER_INIT( deucesw2 )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0x8fe4/2] = 0x6020;
@@ -2742,7 +2742,7 @@ static DRIVER_INIT( deucesw2 )
static DRIVER_INIT( dualgame )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0xa518/2] = 0x6024;
@@ -2753,7 +2753,7 @@ static DRIVER_INIT( dualgame )
static DRIVER_INIT( hermit )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0xdeba/2] = 0x602e;
@@ -2770,7 +2770,7 @@ static DRIVER_INIT( hermit )
static DRIVER_INIT( maxidbl )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0xb384/2] = 0x6036;
@@ -2781,7 +2781,7 @@ static DRIVER_INIT( maxidbl )
static DRIVER_INIT( megadblj )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0xe21c/2] = 0x6040;
@@ -2792,7 +2792,7 @@ static DRIVER_INIT( megadblj )
static DRIVER_INIT( megadble )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// WRONG C8 #1
ROM[0xcfc2/2] = 0x4e71;
diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c
index f59b97703be..978939500d0 100644
--- a/src/mame/drivers/blktiger.c
+++ b/src/mame/drivers/blktiger.c
@@ -283,7 +283,7 @@ static MACHINE_START( blktiger )
state->m_mcu = machine.device("mcu");
/* configure bankswitching */
- state->membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->m_scroll_bank));
state->save_item(NAME(state->m_screen_layout));
@@ -301,7 +301,7 @@ static MACHINE_RESET( blktiger )
blktiger_state *state = machine.driver_data<blktiger_state>();
/* configure bankswitching */
- state->membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("maincpu")->base() + 0x10000, 0x4000);
state->m_scroll_x[0] = 0;
state->m_scroll_x[1] = 0;
diff --git a/src/mame/drivers/blmbycar.c b/src/mame/drivers/blmbycar.c
index a9674a779ae..e685f142a71 100644
--- a/src/mame/drivers/blmbycar.c
+++ b/src/mame/drivers/blmbycar.c
@@ -43,7 +43,7 @@ WRITE16_MEMBER(blmbycar_state::blmbycar_okibank_w)
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
memcpy(&RAM[0x30000], &RAM[0x40000 + 0x10000 * (data & 0xf)], 0x10000);
}
}
@@ -521,8 +521,8 @@ ROM_END
static DRIVER_INIT( blmbycar )
{
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes() / 2;
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes() / 2;
int i;
for (i = 0; i < size; i++)
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index e34abd6c96e..2b9c95b103b 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -189,7 +189,7 @@ static const k051960_interface blockhl_k051960_intf =
static MACHINE_START( blockhl )
{
blockhl_state *state = machine.driver_data<blockhl_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c
index f5221f3d45c..5c429381dcb 100644
--- a/src/mame/drivers/bnstars.c
+++ b/src/mame/drivers/bnstars.c
@@ -1487,7 +1487,7 @@ static DRIVER_INIT (bnstars)
decrypt_ms32_tx(machine, 0x00020,0x7e, "gfx7");
decrypt_ms32_bg(machine, 0x00001,0x9b, "gfx6");
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base());
}
GAME( 1997, bnstars1, 0, bnstars, bnstars, bnstars, ROT0, "Jaleco", "Vs. Janshi Brandnew Stars", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c
index 2f77d6a6d3c..b4631969eaa 100644
--- a/src/mame/drivers/boogwing.c
+++ b/src/mame/drivers/boogwing.c
@@ -573,8 +573,8 @@ ROM_END
static DRIVER_INIT( boogwing )
{
- const UINT8* src = machine.region("gfx6")->base();
- UINT8* dst = machine.region("tiles2")->base() + 0x200000;
+ const UINT8* src = machine.root_device().memregion("gfx6")->base();
+ UINT8* dst = machine.root_device().memregion("tiles2")->base() + 0x200000;
deco56_decrypt_gfx(machine, "tiles1");
deco56_decrypt_gfx(machine, "tiles2");
diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c
index ed49945a75b..3ddf99922bc 100644
--- a/src/mame/drivers/bottom9.c
+++ b/src/mame/drivers/bottom9.c
@@ -322,7 +322,7 @@ static const k051316_interface bottom9_k051316_intf =
static MACHINE_START( bottom9 )
{
bottom9_state *state = machine.driver_data<bottom9_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c
index bc288d1b816..b38dc0ac590 100644
--- a/src/mame/drivers/boxer.c
+++ b/src/mame/drivers/boxer.c
@@ -126,7 +126,7 @@ static void draw_boxer( running_machine &machine, bitmap_ind16 &bitmap, const re
for (n = 0; n < 2; n++)
{
- const UINT8* p = machine.region(n == 0 ? "user1" : "user2")->base();
+ const UINT8* p = state->memregion(n == 0 ? "user1" : "user2")->base();
int i, j;
diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c
index f56897ca34e..423f50c1d3e 100644
--- a/src/mame/drivers/brkthru.c
+++ b/src/mame/drivers/brkthru.c
@@ -660,7 +660,7 @@ ROM_END
static DRIVER_INIT( brkthru )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000);
}
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index 606639ec5cf..726ca644651 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -223,12 +223,12 @@ static void btime_decrypt( address_space *space )
/* however if the previous instruction was JSR (which caused a write to */
/* the stack), fetch the address of the next instruction. */
addr1 = cpu_get_previouspc(&space->device());
- src1 = (addr1 < 0x9000) ? state->m_rambase : space->machine().region("maincpu")->base();
+ src1 = (addr1 < 0x9000) ? state->m_rambase : space->machine().root_device().memregion("maincpu")->base();
if (decrypted[addr1] == 0x20) /* JSR $xxxx */
addr = src1[addr1 + 1] + 256 * src1[addr1 + 2];
/* If the address of the next instruction is xxxx xxx1 xxxx x1xx, decode it. */
- src = (addr < 0x9000) ? state->m_rambase : space->machine().region("maincpu")->base();
+ src = (addr < 0x9000) ? state->m_rambase : state->memregion("maincpu")->base();
if ((addr & 0x0104) == 0x0104)
{
/* 76543210 -> 65342710 bit rotation */
@@ -2060,7 +2060,7 @@ static void decrypt_C10707_cpu(running_machine &machine, const char *cputag)
{
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine.region(cputag)->base();
+ UINT8 *rom = machine.root_device().memregion(cputag)->base();
offs_t addr;
space->set_decrypted_region(0x0000, 0xffff, decrypt);
@@ -2075,7 +2075,7 @@ static void decrypt_C10707_cpu(running_machine &machine, const char *cputag)
READ8_MEMBER(btime_state::wtennis_reset_hack_r)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
/* Otherwise the game goes into test mode and there is no way out that I
can see. I'm not sure how it can work, it probably somehow has to do
@@ -2089,7 +2089,7 @@ READ8_MEMBER(btime_state::wtennis_reset_hack_r)
static void init_rom1(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000, 0xffff, decrypted);
@@ -2110,7 +2110,7 @@ static DRIVER_INIT( btime )
static DRIVER_INIT( zoar )
{
btime_state *state = machine.driver_data<btime_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
/* At location 0xD50A is what looks like an undocumented opcode. I tried
implementing it given what opcode 0x23 should do, but it still didn't
@@ -2125,7 +2125,7 @@ static DRIVER_INIT( zoar )
static DRIVER_INIT( tisland )
{
btime_state *state = machine.driver_data<btime_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
/* At location 0xa2b6 there's a strange RLA followed by a BPL that reads from an
unmapped area that causes the game to fail in several circumstances.On the Cassette
@@ -2164,7 +2164,7 @@ static DRIVER_INIT( cookrace )
decrypt_C10707_cpu(machine, "maincpu");
machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
- state->membank("bank10")->set_base(machine.region("audiocpu")->base() + 0xe200);
+ state->membank("bank10")->set_base(state->memregion("audiocpu")->base() + 0xe200);
state->m_audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
@@ -2183,7 +2183,7 @@ static DRIVER_INIT( wtennis )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc15f, 0xc15f, read8_delegate(FUNC(btime_state::wtennis_reset_hack_r),state));
machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
- state->membank("bank10")->set_base(machine.region("audiocpu")->base() + 0xe200);
+ state->membank("bank10")->set_base(state->memregion("audiocpu")->base() + 0xe200);
state->m_audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c
index 4610fb60144..d0287a96899 100644
--- a/src/mame/drivers/bublbobl.c
+++ b/src/mame/drivers/bublbobl.c
@@ -1552,7 +1552,7 @@ ROM_END
static void configure_banks( running_machine& machine )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
}
@@ -1588,7 +1588,7 @@ static DRIVER_INIT( dland )
{
// rearrange gfx to original format
int i;
- UINT8* src = machine.region("gfx1")->base();
+ UINT8* src = machine.root_device().memregion("gfx1")->base();
for (i = 0; i < 0x40000; i++)
src[i] = BITSWAP8(src[i],7,6,5,4,0,1,2,3);
diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c
index e54aca38d8d..7eaeed9de36 100644
--- a/src/mame/drivers/buggychl.c
+++ b/src/mame/drivers/buggychl.c
@@ -359,7 +359,7 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( buggychl )
{
buggychl_state *state = machine.driver_data<buggychl_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c
index 219aceef730..c9fb4586977 100644
--- a/src/mame/drivers/bwing.c
+++ b/src/mame/drivers/bwing.c
@@ -586,9 +586,9 @@ static DRIVER_INIT( bwing )
{
bwing_state *state = machine.driver_data<bwing_state>();
- state->m_bwp123_membase[0] = machine.region("maincpu")->base();
- state->m_bwp123_membase[1] = machine.region("sub")->base();
- state->m_bwp123_membase[2] = machine.region("audiocpu")->base();
+ state->m_bwp123_membase[0] = machine.root_device().memregion("maincpu")->base();
+ state->m_bwp123_membase[1] = machine.root_device().memregion("sub")->base();
+ state->m_bwp123_membase[2] = state->memregion("audiocpu")->base();
fix_bwp3(machine);
}
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index 5059ac0c894..0d0b750bee1 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -844,7 +844,7 @@ static void seibu_sound_bootleg(running_machine &machine,const char *cpu,int len
{
address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
- UINT8 *rom = machine.region(cpu)->base();
+ UINT8 *rom = machine.root_device().memregion(cpu)->base();
space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
diff --git a/src/mame/drivers/cabaret.c b/src/mame/drivers/cabaret.c
index 386dc863628..6c1a2477649 100644
--- a/src/mame/drivers/cabaret.c
+++ b/src/mame/drivers/cabaret.c
@@ -361,7 +361,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( cabaret )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
/* decrypt the program ROM */
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index a56a927c6c2..2e72d3aa052 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -352,8 +352,8 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
#endif
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base() + 0x10000);
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base());
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base() + 0x10000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base());
}
break;
}
@@ -865,8 +865,8 @@ static const struct pit8253_config calchase_pit8254_config =
static MACHINE_RESET(calchase)
{
- //machine.root_device().membank("bank1")->set_base(machine.region("bios")->base() + 0x10000);
- machine.root_device().membank("bank1")->set_base(machine.region("bios")->base());
+ //machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base());
}
static void set_gate_a20(running_machine &machine, int a20)
diff --git a/src/mame/drivers/calomega.c b/src/mame/drivers/calomega.c
index 3f3232f1525..4b6f066d915 100644
--- a/src/mame/drivers/calomega.c
+++ b/src/mame/drivers/calomega.c
@@ -3918,7 +3918,7 @@ static DRIVER_INIT( standard )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine.region( "proms" )->base();
+ UINT8 *BPR = machine.root_device().memregion( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3930,7 +3930,7 @@ static DRIVER_INIT( standard )
static DRIVER_INIT( elgrande )
{
int x;
- UINT8 *BPR = machine.region( "proms" )->base();
+ UINT8 *BPR = machine.root_device().memregion( "proms" )->base();
/* background color is adjusted through RGB pots */
for (x = 0x0000; x < 0x0400; x++)
@@ -3944,7 +3944,7 @@ static DRIVER_INIT( jjpoker )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine.region( "proms" )->base();
+ UINT8 *BPR = machine.root_device().memregion( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3957,7 +3957,7 @@ static DRIVER_INIT( comg080 )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine.region( "proms" )->base();
+ UINT8 *BPR = machine.root_device().memregion( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3969,7 +3969,7 @@ static DRIVER_INIT( comg080 )
Start = $2042; NMI = $26f8;
Also a fake vector at $3ff8-$3ff9. The code checks these values to continue.
*/
- UINT8 *PRGROM = machine.region( "maincpu" )->base();
+ UINT8 *PRGROM = machine.root_device().memregion( "maincpu" )->base();
PRGROM[0x3ff8] = 0x8e; /* checked by code */
PRGROM[0x3ff9] = 0x97; /* checked by code */
diff --git a/src/mame/drivers/calorie.c b/src/mame/drivers/calorie.c
index fec43caee04..c4946e59a15 100644
--- a/src/mame/drivers/calorie.c
+++ b/src/mame/drivers/calorie.c
@@ -117,7 +117,7 @@ public:
static TILE_GET_INFO( get_bg_tile_info )
{
calorie_state *state = machine.driver_data<calorie_state>();
- UINT8 *src = machine.region("user1")->base();
+ UINT8 *src = state->memregion("user1")->base();
int bg_base = (state->m_bg_bank & 0x0f) * 0x200;
int code = src[bg_base + tile_index] | (((src[bg_base + tile_index + 0x100]) & 0x10) << 4);
int color = src[bg_base + tile_index + 0x100] & 0x0f;
@@ -556,7 +556,7 @@ static DRIVER_INIT( calorie )
static DRIVER_INIT( calorieb )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x10000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c
index 947bb82869b..3a33186adc2 100644
--- a/src/mame/drivers/capbowl.c
+++ b/src/mame/drivers/capbowl.c
@@ -499,7 +499,7 @@ ROM_END
static DRIVER_INIT( capbowl )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* configure ROM banks in 0x0000-0x3fff */
machine.root_device().membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/cardline.c b/src/mame/drivers/cardline.c
index d3ba0c213b7..2871b4f5129 100644
--- a/src/mame/drivers/cardline.c
+++ b/src/mame/drivers/cardline.c
@@ -186,7 +186,7 @@ GFXDECODE_END
static PALETTE_INIT(cardline)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,data;
int bit0,bit1,bit2;
for (i = 0;i < machine.total_colors();i++)
diff --git a/src/mame/drivers/carpolo.c b/src/mame/drivers/carpolo.c
index 05884b38123..47fa699ab0e 100644
--- a/src/mame/drivers/carpolo.c
+++ b/src/mame/drivers/carpolo.c
@@ -331,8 +331,8 @@ static DRIVER_INIT( carpolo )
/* invert gfx PROM since the bits are active LO */
- ROM = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ ROM = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (i = 0;i < len; i++)
ROM[i] ^= 0x0f;
}
diff --git a/src/mame/drivers/carrera.c b/src/mame/drivers/carrera.c
index 423bd27f21c..42effb92959 100644
--- a/src/mame/drivers/carrera.c
+++ b/src/mame/drivers/carrera.c
@@ -283,7 +283,7 @@ static const ay8910_interface ay8910_config =
static PALETTE_INIT(carrera)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int br_bit0, br_bit1, bit0, bit1, r, g, b;
int i;
diff --git a/src/mame/drivers/caswin.c b/src/mame/drivers/caswin.c
index 7a1af2c028d..d656397815a 100644
--- a/src/mame/drivers/caswin.c
+++ b/src/mame/drivers/caswin.c
@@ -274,7 +274,7 @@ static const ay8910_interface ay8910_config =
static PALETTE_INIT( caswin )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index fd13790171d..54dc33087d9 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -2585,8 +2585,8 @@ MACHINE_CONFIG_END
/* 4 bits -> 8 bits. Even and odd pixels are swapped */
static void unpack_sprites(running_machine &machine)
{
- const UINT32 len = machine.region("sprites")->bytes();
- UINT8 *rgn = machine.region ("sprites")->base();
+ const UINT32 len = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rgn = machine.root_device().memregion ("sprites")->base();
UINT8 *src = rgn + len / 2 - 1;
UINT8 *dst = rgn + len - 1;
@@ -2602,8 +2602,8 @@ static void unpack_sprites(running_machine &machine)
/* 4 bits -> 8 bits. Even and odd pixels and even and odd words, are swapped */
static void ddonpach_unpack_sprites(running_machine &machine)
{
- const UINT32 len = machine.region("sprites")->bytes();
- UINT8 *rgn = machine.region ("sprites")->base();
+ const UINT32 len = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rgn = machine.root_device().memregion ("sprites")->base();
UINT8 *src = rgn + len / 2 - 1;
UINT8 *dst = rgn + len - 1;
@@ -2626,8 +2626,8 @@ static void ddonpach_unpack_sprites(running_machine &machine)
/* 2 pages of 4 bits -> 8 bits */
static void esprade_unpack_sprites(running_machine &machine)
{
- UINT8 *src = machine.region("sprites")->base();
- UINT8 *dst = src + machine.region("sprites")->bytes();
+ UINT8 *src = machine.root_device().memregion("sprites")->base();
+ UINT8 *dst = src + machine.root_device().memregion("sprites")->bytes();
while(src < dst)
{
@@ -4415,8 +4415,8 @@ ROM_END
Expand the 2 bit part into a 4 bit layout, so we can decode it */
static void sailormn_unpack_tiles( running_machine &machine, const char *region )
{
- const UINT32 len = machine.region(region)->bytes();
- UINT8 *rgn = machine.region(region)->base();
+ const UINT32 len = machine.root_device().memregion(region)->bytes();
+ UINT8 *rgn = machine.root_device().memregion(region)->base();
UINT8 *src = rgn + (len/4)*3 - 1;
UINT8 *dst = rgn + (len/4)*4 - 2;
@@ -4446,17 +4446,17 @@ static void init_cave(running_machine &machine)
static DRIVER_INIT( agallet )
{
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
init_cave(machine);
machine.root_device().membank("bank1")->configure_entries(0, 0x02, &ROM[0x00000], 0x4000);
machine.root_device().membank("bank1")->configure_entries(2, 0x1e, &ROM[0x10000], 0x4000);
- ROM = machine.region("oki1")->base();
+ ROM = machine.root_device().memregion("oki1")->base();
machine.root_device().membank("bank3")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
machine.root_device().membank("bank4")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
- ROM = machine.region("oki2")->base();
+ ROM = machine.root_device().memregion("oki2")->base();
machine.root_device().membank("bank5")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
machine.root_device().membank("bank6")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
@@ -4514,7 +4514,7 @@ static DRIVER_INIT( esprade )
#if 0 //ROM PATCH
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)state->memregion("maincpu")->base();
rom[0x118A/2] = 0x4e71; //palette fix 118A: 5548 SUBQ.W #2,A0 --> NOP
}
#endif
@@ -4544,14 +4544,14 @@ static DRIVER_INIT( guwange )
static DRIVER_INIT( hotdogst )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
init_cave(machine);
state->membank("bank2")->configure_entries(0, 0x2, &ROM[0x00000], 0x4000);
state->membank("bank2")->configure_entries(2, 0xe, &ROM[0x10000], 0x4000);
- ROM = machine.region("oki")->base();
+ ROM = state->memregion("oki")->base();
state->membank("bank3")->configure_entries(0, 4, &ROM[0x00000], 0x20000);
state->membank("bank4")->configure_entries(0, 4, &ROM[0x00000], 0x20000);
@@ -4563,17 +4563,17 @@ static DRIVER_INIT( hotdogst )
static DRIVER_INIT( mazinger )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine.region("sprites")->base();
- int len = machine.region("sprites")->bytes();
+ UINT8 *src = machine.root_device().memregion("sprites")->base();
+ int len = machine.root_device().memregion("sprites")->bytes();
init_cave(machine);
state->membank("bank2")->configure_entries(0, 2, &ROM[0x00000], 0x4000);
state->membank("bank2")->configure_entries(2, 6, &ROM[0x10000], 0x4000);
- ROM = machine.region("oki")->base();
+ ROM = state->memregion("oki")->base();
state->membank("bank3")->configure_entries(0, 4, &ROM[0x00000], 0x20000);
state->membank("bank4")->configure_entries(0, 4, &ROM[0x00000], 0x20000);
@@ -4593,25 +4593,25 @@ static DRIVER_INIT( mazinger )
state->m_time_vblank_irq = 2100;
/* setup extra ROM */
- state->membank("bank1")->set_base(machine.region("user1")->base());
+ state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
}
static DRIVER_INIT( metmqstr )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
init_cave(machine);
state->membank("bank1")->configure_entries(0, 0x2, &ROM[0x00000], 0x4000);
state->membank("bank1")->configure_entries(2, 0xe, &ROM[0x10000], 0x4000);
- ROM = machine.region("oki1")->base();
+ ROM = machine.root_device().memregion("oki1")->base();
state->membank("bank3")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
state->membank("bank4")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
- ROM = machine.region("oki2")->base();
+ ROM = state->memregion("oki2")->base();
state->membank("bank5")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
state->membank("bank6")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
@@ -4625,10 +4625,10 @@ static DRIVER_INIT( metmqstr )
static DRIVER_INIT( pwrinst2j )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine.region("sprites")->base();
- int len = machine.region("sprites")->bytes();
+ UINT8 *src = machine.root_device().memregion("sprites")->base();
+ int len = state->memregion("sprites")->bytes();
int i, j;
init_cave(machine);
@@ -4664,7 +4664,7 @@ static DRIVER_INIT( pwrinst2 )
#if 1 //ROM PATCH
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0xd46c / 2] = 0xd482; // kurara dash fix 0xd400 -> 0xd482
}
#endif
@@ -4674,21 +4674,21 @@ static DRIVER_INIT( pwrinst2 )
static DRIVER_INIT( sailormn )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine.region("sprites")->base();
- int len = machine.region("sprites")->bytes();
+ UINT8 *src = machine.root_device().memregion("sprites")->base();
+ int len = machine.root_device().memregion("sprites")->bytes();
init_cave(machine);
state->membank("bank1")->configure_entries(0, 0x02, &ROM[0x00000], 0x4000);
state->membank("bank1")->configure_entries(2, 0x1e, &ROM[0x10000], 0x4000);
- ROM = machine.region("oki1")->base();
+ ROM = machine.root_device().memregion("oki1")->base();
state->membank("bank3")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
state->membank("bank4")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
- ROM = machine.region("oki2")->base();
+ ROM = state->memregion("oki2")->base();
state->membank("bank5")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
state->membank("bank6")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
diff --git a/src/mame/drivers/cb2001.c b/src/mame/drivers/cb2001.c
index 05f29f279d3..73bc0459c38 100644
--- a/src/mame/drivers/cb2001.c
+++ b/src/mame/drivers/cb2001.c
@@ -776,8 +776,8 @@ static PALETTE_INIT(cb2001)
{
int r,g,b;
- UINT8*proms = machine.region("proms")->base();
- int length = machine.region("proms")->bytes();
+ UINT8*proms = machine.root_device().memregion("proms")->base();
+ int length = machine.root_device().memregion("proms")->bytes();
UINT16 dat;
dat = (proms[0x000+i] << 8) | proms[0x200+i];
diff --git a/src/mame/drivers/cbasebal.c b/src/mame/drivers/cbasebal.c
index 76a9d022922..099d55eb2ca 100644
--- a/src/mame/drivers/cbasebal.c
+++ b/src/mame/drivers/cbasebal.c
@@ -243,7 +243,7 @@ static MACHINE_START( cbasebal )
{
cbasebal_state *state = machine.driver_data<cbasebal_state>();
- state->membank("bank1")->configure_entries(0, 32, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 32, state->memregion("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->m_rambank));
state->save_item(NAME(state->m_tilebank));
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index 739d4b0914e..5a598462ca1 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -530,7 +530,7 @@ ROM_END
static DRIVER_INIT( twocrude )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
UINT8 *PTR;
int i, j;
@@ -547,8 +547,8 @@ static DRIVER_INIT( twocrude )
}
/* Rearrange the 'extra' sprite bank to be in the same format as main sprites */
- RAM = machine.region("gfx3")->base() + 0x080000;
- PTR = machine.region("gfx3")->base() + 0x140000;
+ RAM = machine.root_device().memregion("gfx3")->base() + 0x080000;
+ PTR = machine.root_device().memregion("gfx3")->base() + 0x140000;
for (i = 0; i < 0x20000; i += 64)
{
for (j = 0; j < 16; j += 1)
diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c
index 388ff4dea88..d20cb36bea5 100644
--- a/src/mame/drivers/ccastles.c
+++ b/src/mame/drivers/ccastles.c
@@ -191,7 +191,7 @@ static MACHINE_START( ccastles )
rectangle visarea;
/* initialize globals */
- state->m_syncprom = machine.region("proms")->base() + 0x000;
+ state->m_syncprom = machine.root_device().memregion("proms")->base() + 0x000;
/* find the start of VBLANK in the SYNC PROM */
for (state->m_vblank_start = 0; state->m_vblank_start < 256; state->m_vblank_start++)
@@ -213,7 +213,7 @@ static MACHINE_START( ccastles )
machine.primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
/* configure the ROM banking */
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0xa000, 0x6000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0xa000, 0x6000);
/* create a timer for IRQs and set up the first callback */
state->m_irq_timer = machine.scheduler().timer_alloc(FUNC(clock_irq));
diff --git a/src/mame/drivers/cd32.c b/src/mame/drivers/cd32.c
index e0e6d263cff..41323161c1b 100644
--- a/src/mame/drivers/cd32.c
+++ b/src/mame/drivers/cd32.c
@@ -854,7 +854,7 @@ static DRIVER_INIT( cd32 )
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
/* input hack */
state->m_input_hack = NULL;
@@ -1473,7 +1473,7 @@ static DRIVER_INIT( odeontw2 )
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
/* input hack */
state->m_input_hack = NULL;
diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c
index 7be4d3f202d..7e04e804b53 100644
--- a/src/mame/drivers/cdi.c
+++ b/src/mame/drivers/cdi.c
@@ -199,7 +199,7 @@ static MACHINE_START( cdi )
static MACHINE_RESET( cdi )
{
cdi_state *state = machine.driver_data<cdi_state>();
- UINT16 *src = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16*)state->memregion("maincpu")->base();
UINT16 *dst = state->m_planea;
//device_t *cdrom_dev = machine.device("cdrom");
memcpy(dst, src, 0x8);
diff --git a/src/mame/drivers/chaknpop.c b/src/mame/drivers/chaknpop.c
index 0b7b33c037a..cfccfc7190b 100644
--- a/src/mame/drivers/chaknpop.c
+++ b/src/mame/drivers/chaknpop.c
@@ -346,7 +346,7 @@ GFXDECODE_END
static MACHINE_START( chaknpop )
{
chaknpop_state *state = machine.driver_data<chaknpop_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 64066832bb0..66d95f2e626 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -191,11 +191,11 @@ WRITE8_MEMBER(cham24_state::cham24_mapper_w)
UINT32 prg_bank_page_size = (offset >> 12) & 0x01;
UINT32 gfx_mirroring = (offset >> 13) & 0x01;
- UINT8* dst = machine().region("maincpu")->base();
- UINT8* src = machine().region("user1")->base();
+ UINT8* dst = memregion("maincpu")->base();
+ UINT8* src = memregion("user1")->base();
// switch PPU VROM bank
- membank("bank1")->set_base(machine().region("gfx1")->base() + (0x2000 * gfx_bank));
+ membank("bank1")->set_base(machine().root_device().memregion("gfx1")->base() + (0x2000 * gfx_bank));
// set gfx mirroring
cham24_set_mirroring(machine(), gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
@@ -304,15 +304,15 @@ static MACHINE_START( cham24 )
{
cham24_state *state = machine.driver_data<cham24_state>();
/* switch PRG rom */
- UINT8* dst = machine.region("maincpu")->base();
- UINT8* src = machine.region("user1")->base();
+ UINT8* dst = machine.root_device().memregion("maincpu")->base();
+ UINT8* src = machine.root_device().memregion("user1")->base();
memcpy(&dst[0x8000], &src[0x0f8000], 0x4000);
memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
/* uses 8K swapping, all ROM!*/
machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
- state->membank("bank1")->set_base(machine.region("gfx1")->base());
+ state->membank("bank1")->set_base(state->memregion("gfx1")->base());
/* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */
state->m_nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c
index 40d173468f7..e047f447529 100644
--- a/src/mame/drivers/champbas.c
+++ b/src/mame/drivers/champbas.c
@@ -1177,9 +1177,9 @@ ROM_END
static DRIVER_INIT(champbas)
{
// chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
- UINT8 *rom1 = machine.region("gfx1")->base();
- UINT8 *rom2 = machine.region("gfx2")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom1 = machine.root_device().memregion("gfx1")->base();
+ UINT8 *rom2 = machine.root_device().memregion("gfx2")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i;
for (i = 0; i < len/2; ++i)
@@ -1194,8 +1194,8 @@ static DRIVER_INIT(champbas)
static DRIVER_INIT( exctsccr )
{
// chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
- UINT8 *rom1 = machine.region("gfx1")->base();
- UINT8 *rom2 = machine.region("gfx2")->base();
+ UINT8 *rom1 = machine.root_device().memregion("gfx1")->base();
+ UINT8 *rom2 = machine.root_device().memregion("gfx2")->base();
int i;
// planes 0,1
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index 7734851168a..91d0da7f31d 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -430,7 +430,7 @@ static const x1_010_interface champbwl_sound_intf =
static MACHINE_START( champbwl )
{
champbwl_state *state = machine.driver_data<champbwl_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->m_mcu = NULL;
@@ -530,7 +530,7 @@ static SCREEN_VBLANK( doraemon )
static MACHINE_START( doraemon )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
}
diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c
index bf4ae8b8d0d..aa920ee5a86 100644
--- a/src/mame/drivers/chanbara.c
+++ b/src/mame/drivers/chanbara.c
@@ -88,7 +88,7 @@ public:
static PALETTE_INIT( chanbara )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, red, green, blue;
for (i = 0; i < machine.total_colors(); i++)
@@ -471,9 +471,9 @@ ROM_END
static DRIVER_INIT(chanbara )
{
- UINT8 *src = machine.region("gfx4")->base();
- UINT8 *dst = machine.region("gfx3")->base() + 0x4000;
- UINT8 *bg = machine.region("user1")->base();
+ UINT8 *src = machine.root_device().memregion("gfx4")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx3")->base() + 0x4000;
+ UINT8 *bg = machine.root_device().memregion("user1")->base();
int i;
for (i = 0; i < 0x1000; i++)
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 4bc1d6dd2a5..cd42b42ab5a 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -884,7 +884,7 @@ int ide_baseboard_device::read_sector(UINT32 lba, void *buffer)
logerror("baseboard: read sector lba %08x\n",lba);
off=(lba&0x7ff)*512;
- data=machine().region("others")->base();
+ data=machine().root_device().memregion("others")->base();
memcpy(buffer,data+off,512);
return 1;
}
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index 555abb02cde..7a25c6a2a19 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -224,7 +224,7 @@ static WRITE8_DEVICE_HANDLER( saiyugoub1_adpcm_control_w )
ddragon_state *state = device->machine().driver_data<ddragon_state>();
/* i8748 Port 2 write */
- UINT8 *saiyugoub1_adpcm_rom = device->machine().region("adpcm")->base();
+ UINT8 *saiyugoub1_adpcm_rom = state->memregion("adpcm")->base();
if (data & 0x80) /* Reset m5205 and disable ADPCM ROM outputs */
{
@@ -531,7 +531,7 @@ static MACHINE_START( chinagat )
state->m_snd_cpu = machine.device("audiocpu");
/* configure banks */
- state->membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 8, state->memregion("maincpu")->base() + 0x10000, 0x4000);
/* register for save states */
state->save_item(NAME(state->m_scrollx_hi));
@@ -912,8 +912,8 @@ ROM_END
static DRIVER_INIT( chinagat )
{
ddragon_state *state = machine.driver_data<ddragon_state>();
- UINT8 *MAIN = machine.region("maincpu")->base();
- UINT8 *SUB = machine.region("sub")->base();
+ UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *SUB = state->memregion("sub")->base();
state->m_technos_video_hw = 1;
state->m_sprite_irq = M6809_IRQ_LINE;
diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c
index 31cc888bc43..bd4e43e88e3 100644
--- a/src/mame/drivers/chinsan.c
+++ b/src/mame/drivers/chinsan.c
@@ -78,7 +78,7 @@ public:
static PALETTE_INIT( chinsan )
{
- UINT8 *src = machine.region( "color_proms" )->base();
+ UINT8 *src = machine.root_device().memregion( "color_proms" )->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -541,7 +541,7 @@ static void chin_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->m_adpcm_data & 0xf);
@@ -571,7 +571,7 @@ static MACHINE_START( chinsan )
{
chinsan_state *state = machine.driver_data<chinsan_state>();
- state->membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->m_adpcm_idle));
state->save_item(NAME(state->m_port_select));
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index 804a3b8a0de..1d62ab94608 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -40,7 +40,7 @@ static TIMER_DEVICE_CALLBACK( chqflag_scanline )
WRITE8_MEMBER(chqflag_state::chqflag_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
/* bits 0-4 = ROM bank # (0x00-0x11) */
bankaddress = 0x10000 + (data & 0x1f) * 0x4000;
@@ -322,7 +322,7 @@ static const k051316_interface chqflag_k051316_intf_2 =
static MACHINE_START( chqflag )
{
chqflag_state *state = machine.driver_data<chqflag_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/chsuper.c b/src/mame/drivers/chsuper.c
index b33f221d691..21ac2fc6bdf 100644
--- a/src/mame/drivers/chsuper.c
+++ b/src/mame/drivers/chsuper.c
@@ -267,7 +267,7 @@ static DRIVER_INIT( chsuper2 )
{
chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine.region("gfx1")->base();
+ UINT8 *rom = state->memregion("gfx1")->base();
int i;
state->m_tilexor = 0x7f00;
@@ -290,7 +290,7 @@ static DRIVER_INIT( chsuper3 )
{
chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine.region("gfx1")->base();
+ UINT8 *rom = state->memregion("gfx1")->base();
int i;
state->m_tilexor = 0x0e00;
@@ -313,7 +313,7 @@ static DRIVER_INIT( chmpnum )
{
chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine.region("gfx1")->base();
+ UINT8 *rom = state->memregion("gfx1")->base();
int i;
state->m_tilexor = 0x1800;
diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c
index c1b5bd63e6b..1f875bd7326 100644
--- a/src/mame/drivers/cidelsa.c
+++ b/src/mame/drivers/cidelsa.c
@@ -441,7 +441,7 @@ void cidelsa_state::machine_start()
void draco_state::machine_start()
{
/* setup COP402 memory banking */
- membank("bank1")->configure_entries(0, 2, machine().region(COP402N_TAG)->base(), 0x400);
+ membank("bank1")->configure_entries(0, 2, memregion(COP402N_TAG)->base(), 0x400);
membank("bank1")->set_entry(0);
/* register for state saving */
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 1cb60c92cee..96364eeff31 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -1776,8 +1776,8 @@ MACHINE_CONFIG_END
*/
static void cischeat_untangle_sprites(running_machine &machine, const char *region)
{
- UINT8 *src = machine.region(region)->base();
- const UINT8 *end = src + machine.region(region)->bytes();
+ UINT8 *src = machine.root_device().memregion(region)->base();
+ const UINT8 *end = src + machine.root_device().memregion(region)->bytes();
while (src < end)
{
diff --git a/src/mame/drivers/citycon.c b/src/mame/drivers/citycon.c
index e8757ddbf87..1558c9c7007 100644
--- a/src/mame/drivers/citycon.c
+++ b/src/mame/drivers/citycon.c
@@ -338,7 +338,7 @@ ROM_END
static DRIVER_INIT( citycon )
{
- UINT8 *rom = machine.region("gfx1")->base();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
int i;
/*
diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c
index 82e645d9961..1e67eb65964 100644
--- a/src/mame/drivers/cloud9.c
+++ b/src/mame/drivers/cloud9.c
@@ -160,7 +160,7 @@ static MACHINE_START( cloud9 )
rectangle visarea;
/* initialize globals */
- state->m_syncprom = machine.region("proms")->base() + 0x000;
+ state->m_syncprom = state->memregion("proms")->base() + 0x000;
/* find the start of VBLANK in the SYNC PROM */
for (state->m_vblank_start = 0; state->m_vblank_start < 256; state->m_vblank_start++)
diff --git a/src/mame/drivers/clshroad.c b/src/mame/drivers/clshroad.c
index 48c81e83ea4..bf9fdbd04bc 100644
--- a/src/mame/drivers/clshroad.c
+++ b/src/mame/drivers/clshroad.c
@@ -472,7 +472,7 @@ without this the death sequence never ends so the game is unplayable after you
die once, it would be nice to avoid the hack however
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x05C6] = 0xc3;
ROM[0x05C7] = 0x8d;
diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c
index 2feb11c2379..2a863a6c41f 100644
--- a/src/mame/drivers/cmmb.c
+++ b/src/mame/drivers/cmmb.c
@@ -95,14 +95,14 @@ static SCREEN_UPDATE_IND16( cmmb )
READ8_MEMBER(cmmb_state::cmmb_charram_r)
{
- UINT8 *GFX = machine().region("gfx")->base();
+ UINT8 *GFX = memregion("gfx")->base();
return GFX[offset];
}
WRITE8_MEMBER(cmmb_state::cmmb_charram_w)
{
- UINT8 *GFX = machine().region("gfx")->base();
+ UINT8 *GFX = memregion("gfx")->base();
GFX[offset] = data;
@@ -137,7 +137,7 @@ READ8_MEMBER(cmmb_state::cmmb_input_r)
/*
{
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x10000 + (0x10000 * (data & 0x03));
@@ -152,7 +152,7 @@ WRITE8_MEMBER(cmmb_state::cmmb_output_w)
{
case 0x01:
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x1c000 + (0x10000 * (data & 0x03));
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 96aed1789ce..86a457ccaa7 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -2068,7 +2068,7 @@ ROM_END
static void cninja_patch( running_machine &machine )
{
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0; i < 0x80000 / 2; i++)
@@ -2109,8 +2109,8 @@ static DRIVER_INIT( stoneage )
static DRIVER_INIT( mutantf )
{
- const UINT8 *src = machine.region("gfx2")->base();
- UINT8 *dst = machine.region("gfx1")->base();
+ const UINT8 *src = machine.root_device().memregion("gfx2")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
/* The 16x16 graphic has some 8x8 chars in it - decode them in GFX1 */
memcpy(dst + 0x50000, dst + 0x10000, 0x10000);
diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c
index 9cd0bfedd51..33a92cc86a8 100644
--- a/src/mame/drivers/cntsteer.c
+++ b/src/mame/drivers/cntsteer.c
@@ -85,7 +85,7 @@ public:
static PALETTE_INIT( zerotrgt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
{
@@ -1144,8 +1144,8 @@ ROM_END
static void zerotrgt_rearrange_gfx( running_machine &machine, int romsize, int romarea )
{
- UINT8 *src = machine.region("gfx4")->base();
- UINT8 *dst = machine.region("gfx3")->base();
+ UINT8 *src = machine.root_device().memregion("gfx4")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx3")->base();
int rm;
int cnt1;
@@ -1164,7 +1164,7 @@ static void zerotrgt_rearrange_gfx( running_machine &machine, int romsize, int r
#if 0
static DRIVER_INIT( cntsteer )
{
- UINT8 *RAM = machine.region("subcpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("subcpu")->base();
RAM[0xc2cf] = 0x43; /* Patch out Cpu 1 ram test - it never ends..?! */
RAM[0xc2d0] = 0x43;
diff --git a/src/mame/drivers/cobra.c b/src/mame/drivers/cobra.c
index 1cf92c87076..83c3b351468 100644
--- a/src/mame/drivers/cobra.c
+++ b/src/mame/drivers/cobra.c
@@ -2072,7 +2072,7 @@ static DRIVER_INIT(bujutsu)
{
int i;
UINT32 sum = 0;
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
//rom[(0x02218^4) / 4] = 0x60000000; // skip connect_grphcpu()...
@@ -2095,7 +2095,7 @@ static DRIVER_INIT(bujutsu)
// rom hacks for sub board...
{
- UINT32 *rom = (UINT32*)machine.region("user2")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user2")->base();
rom[0x62094 / 4] = 0x60000000; // skip hardcheck()...
}
@@ -2106,7 +2106,7 @@ static DRIVER_INIT(bujutsu)
int i;
UINT32 sum = 0;
- UINT32 *rom = (UINT32*)machine.region("user3")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user3")->base();
rom[(0x022d4^4) / 4] = 0x60000000; // skip init_raster() for now ...
diff --git a/src/mame/drivers/coinmstr.c b/src/mame/drivers/coinmstr.c
index 1beb60d6cab..275e6f771c2 100644
--- a/src/mame/drivers/coinmstr.c
+++ b/src/mame/drivers/coinmstr.c
@@ -141,7 +141,7 @@ WRITE8_MEMBER(coinmstr_state::quizmstr_attr3_w)
READ8_MEMBER(coinmstr_state::question_r)
{
int address;
- UINT8 *questions = machine().region("user1")->base();
+ UINT8 *questions = memregion("user1")->base();
switch(m_question_adr[2])
{
@@ -1225,8 +1225,8 @@ ROM_END
static DRIVER_INIT( coinmstr )
{
- UINT8 *rom = machine.region("user1")->base();
- int length = machine.region("user1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("user1")->base();
+ int length = machine.root_device().memregion("user1")->bytes();
UINT8 *buf = auto_alloc_array(machine, UINT8, length);
int i;
diff --git a/src/mame/drivers/coinmvga.c b/src/mame/drivers/coinmvga.c
index 5ded1a579e7..b12e796f2f1 100644
--- a/src/mame/drivers/coinmvga.c
+++ b/src/mame/drivers/coinmvga.c
@@ -872,7 +872,7 @@ ROM_END
static DRIVER_INIT( colorama )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine.region("maincpu")->base();
+ ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// rte in non-irq routines? wtf? patch them to rts...
ROM[0x02B476/2] = 0x5470;
@@ -889,7 +889,7 @@ static DRIVER_INIT( colorama )
static DRIVER_INIT( cmrltv75 )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine.region("maincpu")->base();
+ ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// rte in non-irq routines? wtf? patch them to rts...
ROM[0x056fd6/2] = 0x5470;
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 2eaf2508917..2b19da054ab 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -690,7 +690,7 @@ static const ym2203_interface ym2203_bootleg_config =
static MACHINE_START( combatsc )
{
combatsc_state *state = machine.driver_data<combatsc_state>();
- UINT8 *MEM = machine.region("maincpu")->base() + 0x38000;
+ UINT8 *MEM = machine.root_device().memregion("maincpu")->base() + 0x38000;
state->m_io_ram = MEM + 0x0000;
state->m_page[0] = MEM + 0x4000;
@@ -702,7 +702,7 @@ static MACHINE_START( combatsc )
state->m_k007121_1 = machine.device("k007121_1");
state->m_k007121_2 = machine.device("k007121_2");
- state->membank("bank1")->configure_entries(0, 10, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 10, state->memregion("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->m_priority));
state->save_item(NAME(state->m_vreg));
diff --git a/src/mame/drivers/commando.c b/src/mame/drivers/commando.c
index a78d34a0ad7..9840dc7c04c 100644
--- a/src/mame/drivers/commando.c
+++ b/src/mame/drivers/commando.c
@@ -517,7 +517,7 @@ ROM_END
static DRIVER_INIT( commando )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0xc000);
int A;
@@ -537,7 +537,7 @@ static DRIVER_INIT( commando )
static DRIVER_INIT( spaceinv )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0xc000);
int A;
diff --git a/src/mame/drivers/compgolf.c b/src/mame/drivers/compgolf.c
index 70cd8613849..ac04bc490e4 100644
--- a/src/mame/drivers/compgolf.c
+++ b/src/mame/drivers/compgolf.c
@@ -346,8 +346,8 @@ ROM_END
static void compgolf_expand_bg(running_machine &machine)
{
- UINT8 *GFXDST = machine.region("gfx2")->base();
- UINT8 *GFXSRC = machine.region("gfx4")->base();
+ UINT8 *GFXDST = machine.root_device().memregion("gfx2")->base();
+ UINT8 *GFXSRC = machine.root_device().memregion("gfx4")->base();
int x;
@@ -360,7 +360,7 @@ static void compgolf_expand_bg(running_machine &machine)
static DRIVER_INIT( compgolf )
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("user1")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("user1")->base(), 0x4000);
compgolf_expand_bg(machine);
}
diff --git a/src/mame/drivers/contra.c b/src/mame/drivers/contra.c
index 7d1e0f112f9..27fd782be22 100644
--- a/src/mame/drivers/contra.c
+++ b/src/mame/drivers/contra.c
@@ -178,7 +178,7 @@ GFXDECODE_END
static MACHINE_START( contra )
{
contra_state *state = machine.driver_data<contra_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 11f7473db7b..31d6183360b 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -534,9 +534,9 @@ READ16_MEMBER(coolpool_state::dsp_hold_line_r)
READ16_MEMBER(coolpool_state::dsp_rom_r)
{
- UINT8 *rom = machine().region("user2")->base();
+ UINT8 *rom = memregion("user2")->base();
- return rom[m_iop_romaddr & (machine().region("user2")->bytes() - 1)];
+ return rom[m_iop_romaddr & (machine().root_device().memregion("user2")->bytes() - 1)];
}
@@ -1199,8 +1199,8 @@ static DRIVER_INIT( 9ballsht )
UINT16 *rom;
/* decrypt the main program ROMs */
- rom = (UINT16 *)machine.region("user1")->base();
- len = machine.region("user1")->bytes();
+ rom = (UINT16 *)machine.root_device().memregion("user1")->base();
+ len = machine.root_device().memregion("user1")->bytes();
for (a = 0;a < len/2;a++)
{
int hi,lo,nhi,nlo;
@@ -1223,8 +1223,8 @@ static DRIVER_INIT( 9ballsht )
}
/* decrypt the sub data ROMs */
- rom = (UINT16 *)machine.region("user2")->base();
- len = machine.region("user2")->bytes();
+ rom = (UINT16 *)machine.root_device().memregion("user2")->base();
+ len = machine.root_device().memregion("user2")->bytes();
for (a = 1;a < len/2;a+=4)
{
/* just swap bits 1 and 2 of the address */
diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c
index 547db2b8272..fbbd7b953ec 100644
--- a/src/mame/drivers/coolridr.c
+++ b/src/mame/drivers/coolridr.c
@@ -683,7 +683,7 @@ WRITE32_MEMBER(coolridr_state::sysh1_char_w)
COMBINE_DATA(&m_h1_charram[offset]);
{
- UINT8 *gfx = machine().region("ram_gfx")->base();
+ UINT8 *gfx = memregion("ram_gfx")->base();
gfx[offset*4+0] = (m_h1_charram[offset] & 0xff000000) >> 24;
gfx[offset*4+1] = (m_h1_charram[offset] & 0x00ff0000) >> 16;
diff --git a/src/mame/drivers/cop01.c b/src/mame/drivers/cop01.c
index 4804fd62e96..bc6ec5a81bb 100644
--- a/src/mame/drivers/cop01.c
+++ b/src/mame/drivers/cop01.c
@@ -654,7 +654,7 @@ static DRIVER_INIT( mightguy )
#if MIGHTGUY_HACK
/* This is a hack to fix the game code to get a fully working
"Starting Area" fake Dip Switch */
- UINT8 *RAM = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 *RAM = (UINT8 *)machine.root_device().memregion("maincpu")->base();
RAM[0x00e4] = 0x07; // rlca
RAM[0x00e5] = 0x07; // rlca
RAM[0x00e6] = 0x07; // rlca
diff --git a/src/mame/drivers/corona.c b/src/mame/drivers/corona.c
index aec4dec1a39..ee4c88d0e92 100644
--- a/src/mame/drivers/corona.c
+++ b/src/mame/drivers/corona.c
@@ -353,7 +353,7 @@ public:
static PALETTE_INIT( winner )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit6, bit7, bit0, bit1, r, g, b;
int i;
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 5e035a866b6..8647b8a63cc 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -1512,8 +1512,8 @@ static DRIVER_INIT( cosmicg )
cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs, len;
UINT8 *rom;
- len = machine.region("maincpu")->bytes();
- rom = machine.region("maincpu")->base();
+ len = machine.root_device().memregion("maincpu")->bytes();
+ rom = state->memregion("maincpu")->base();
for (offs = 0; offs < len; offs++)
{
UINT8 scrambled = rom[offs];
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index c0ecd5c759f..0093a4ce16e 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -348,7 +348,7 @@ static INTERRUPT_GEN( cps1_qsound_interrupt )
READ16_MEMBER(cps_state::qsound_rom_r)
{
- UINT8 *rom = machine().region("user1")->base();
+ UINT8 *rom = memregion("user1")->base();
if (rom)
return rom[offset] | 0xff00;
@@ -387,7 +387,7 @@ WRITE8_MEMBER(cps_state::qsound_banksw_w)
{
/* Z80 bank register for music note data. It's odd that it isn't encrypted though. */
int bank = data & 0x0f;
- if ((0x10000 + (bank * 0x4000)) >= machine().region("audiocpu")->bytes())
+ if ((0x10000 + (bank * 0x4000)) >= memregion("audiocpu")->bytes())
{
logerror("WARNING: Q sound bank overflow (%02x)\n", data);
bank = 0;
@@ -3040,13 +3040,13 @@ static MACHINE_START( common )
static MACHINE_START( cps1 )
{
MACHINE_START_CALL(common);
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_START( qsound )
{
MACHINE_START_CALL(common);
- machine.root_device().membank("bank1")->configure_entries(0, 6, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 6, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_CONFIG_START( cps1_10MHz, cps_state )
@@ -10776,7 +10776,7 @@ static DRIVER_INIT( pang3b )
static DRIVER_INIT( pang3 )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int A, src, dst;
for (A = 0x80000; A < 0x100000; A += 2)
@@ -10806,8 +10806,8 @@ READ16_MEMBER(cps_state::sf2mdt_r)
static DRIVER_INIT( sf2mdt )
{
int i;
- UINT32 gfx_size = machine.region( "gfx" )->bytes();
- UINT8 *rom = machine.region( "gfx" )->base();
+ UINT32 gfx_size = machine.root_device().memregion( "gfx" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "gfx" )->base();
UINT8 tmp;
for( i = 0; i < gfx_size; i += 8 )
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index 1c79d34f70e..b748b829bbf 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -1217,7 +1217,7 @@ static MACHINE_START( cps2 )
state->m_audiocpu = machine.device("audiocpu");
if (state->m_audiocpu != NULL) // gigaman2 has no audiocpu
- state->membank("bank1")->configure_entries(0, (QSOUND_SIZE - 0x10000) / 0x4000, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, (QSOUND_SIZE - 0x10000) / 0x4000, state->memregion("audiocpu")->base() + 0x10000, 0x4000);
}
@@ -8164,8 +8164,8 @@ static WRITE16_HANDLER( gigaman2_dummyqsound_w )
static void gigaman2_gfx_reorder(running_machine &machine)
{
int i;
- int length = machine.region( "gfx" )->bytes();
- UINT16 *rom = (UINT16 *)machine.region("gfx")->base();
+ int length = machine.root_device().memregion( "gfx" )->bytes();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("gfx")->base();
UINT16 *buf = auto_alloc_array(machine, UINT16, length );
memcpy (buf, rom, length);
@@ -8181,8 +8181,8 @@ static DRIVER_INIT( gigaman2 )
{
cps_state *state = machine.driver_data<cps_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
- int length = machine.region("maincpu")->bytes();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ int length = state->memregion("maincpu")->bytes();
gigaman2_gfx_reorder(machine);
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index 5fd7ad41a19..f5f945e413c 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -663,9 +663,9 @@ static void cps3_decrypt_bios(running_machine &machine)
{
cps3_state *state = machine.driver_data<cps3_state>();
int i;
- UINT32 *coderegion = (UINT32*)machine.region("user1")->base();
+ UINT32 *coderegion = (UINT32*)machine.root_device().memregion("user1")->base();
- state->m_decrypted_bios = (UINT32*)machine.region("user1")->base();
+ state->m_decrypted_bios = (UINT32*)state->memregion("user1")->base();
for (i=0;i<0x80000;i+=4)
{
@@ -701,8 +701,8 @@ static void init_common(running_machine &machine, UINT32 key1, UINT32 key2, int
state->m_altEncryption = altEncryption;
// cache pointers to regions
- state->m_user4region = machine.region("user4")->base();
- state->m_user5region = machine.region("user5")->base();
+ state->m_user4region = machine.root_device().memregion("user4")->base();
+ state->m_user5region = state->memregion("user5")->base();
if (!state->m_user4region) state->m_user4region = auto_alloc_array(machine, UINT8, USER4REGION_LENGTH);
if (!state->m_user5region) state->m_user5region = auto_alloc_array(machine, UINT8, USER5REGION_LENGTH);
@@ -1283,7 +1283,7 @@ DIRECT_UPDATE_MEMBER(cps3_state::cps3_direct_handler)
/* BIOS ROM */
if (address < 0x80000)
{
- direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *direct.space().machine().region("user1"));
+ direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *direct.space().machine().root_device().memregion("user1"));
return ~0;
}
/* RAM */
@@ -3271,7 +3271,7 @@ ROM_END
OCEANIA 7
ASIA NCD 8
- UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion ( "user1" )->base();
rom[0x1fed8/4]^=0x00000001; // clear region to 0 (invalid)
rom[0x1fed8/4]^=0x00000008; // region 8 - ASIA NO CD - doesn't actually skip the CD
// test on startup, only during game, must be another flag
@@ -3296,7 +3296,7 @@ ROM_END
// bios rom also lists korea, but game rom does not.
- UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear region)
rom[0x1fec8/4]^=0x00000008; // region
rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
@@ -3318,7 +3318,7 @@ ROM_END
OCEANIA 7
ASIA 8
- UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear region)
rom[0x1fec8/4]^=0x00000008; // region
rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
@@ -3342,7 +3342,7 @@ ROM_END
DEVELOPMENT VERSION add 0x70 mask!
- UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region hack (clear jpn)
rom[0x1fec8/4]^=0x00000004; // region
@@ -3363,7 +3363,7 @@ ROM_END
BRAZIL 6
OCEANIA 7
- UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion ( "user1" )->base();
rom[0x1fec8/4]^=0x00000004; // region (clear region)
rom[0x1fec8/4]^=0x00000001; // region
rom[0x1fecc/4]^=0x01000000; // nocd
@@ -3385,7 +3385,7 @@ ROM_END
DEVELOPMENT VERSION add 0x70 mask!
- UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear jpn)
rom[0x1fec8/4]^=0x00000002; // region
rom[0x1fec8/4]^=0x00000070; // DEV mode
diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c
index 53fbd5c6085..0cf9bec1bdb 100644
--- a/src/mame/drivers/crgolf.c
+++ b/src/mame/drivers/crgolf.c
@@ -56,7 +56,7 @@ static MACHINE_START( crgolf )
state->m_audiocpu = machine.device("audiocpu");
/* configure the banking */
- state->membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("maincpu")->base() + 0x10000, 0x2000);
state->membank("bank1")->set_entry(0);
/* register for save states */
@@ -193,7 +193,7 @@ static void vck_callback( device_t *device )
/* only play back if we have data remaining */
if (state->m_sample_count != 0xff)
{
- UINT8 data = device->machine().region("adpcm")->base()[state->m_sample_offset >> 1];
+ UINT8 data = state->memregion("adpcm")->base()[state->m_sample_offset >> 1];
/* write the next nibble and advance */
msm5205_data_w(device, (data >> (4 * (~state->m_sample_offset & 1))) & 0x0f);
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index 07b3e8714d3..5d6ff258221 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -255,7 +255,7 @@ static const k051960_interface crimfght_k051960_intf =
static MACHINE_START( crimfght )
{
crimfght_state *state = machine.driver_data<crimfght_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank2")->configure_entries(0, 12, &ROM[0x10000], 0x2000);
state->membank("bank2")->set_entry(0);
diff --git a/src/mame/drivers/crospang.c b/src/mame/drivers/crospang.c
index 0762ab8f7ab..460fc77d131 100644
--- a/src/mame/drivers/crospang.c
+++ b/src/mame/drivers/crospang.c
@@ -562,8 +562,8 @@ ROM_END
static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
diff --git a/src/mame/drivers/crshrace.c b/src/mame/drivers/crshrace.c
index 7935d8cfe05..acbd282a6a0 100644
--- a/src/mame/drivers/crshrace.c
+++ b/src/mame/drivers/crshrace.c
@@ -138,7 +138,7 @@ Dip locations verified with Service Mode.
READ16_MEMBER(crshrace_state::extrarom1_r)
{
- UINT8 *rom = machine().region("user1")->base();
+ UINT8 *rom = memregion("user1")->base();
offset *= 2;
@@ -147,7 +147,7 @@ READ16_MEMBER(crshrace_state::extrarom1_r)
READ16_MEMBER(crshrace_state::extrarom2_r)
{
- UINT8 *rom = machine().region("user2")->base();
+ UINT8 *rom = memregion("user2")->base();
offset *= 2;
@@ -442,7 +442,7 @@ static MACHINE_START( crshrace )
{
crshrace_state *state = machine.driver_data<crshrace_state>();
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000, 0x8000);
state->save_item(NAME(state->m_roz_bank));
state->save_item(NAME(state->m_gfxctrl));
@@ -577,7 +577,7 @@ ROM_END
void crshrace_patch_code( UINT16 offset )
{
/* A hack which shows 3 player mode in code which is disabled */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[(offset + 0)/2] = 0x4e71;
RAM[(offset + 2)/2] = 0x4e71;
RAM[(offset + 4)/2] = 0x4e71;
diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c
index 59e56f1d014..96c6ab497a6 100644
--- a/src/mame/drivers/crystal.c
+++ b/src/mame/drivers/crystal.c
@@ -286,9 +286,9 @@ WRITE32_MEMBER(crystal_state::Banksw_w)
m_Bank = (data >> 1) & 7;
if (m_Bank <= 2)
- membank("bank1")->set_base(machine().region("user1")->base() + m_Bank * 0x1000000);
+ membank("bank1")->set_base(machine().root_device().memregion("user1")->base() + m_Bank * 0x1000000);
else
- membank("bank1")->set_base(machine().region("user2")->base());
+ membank("bank1")->set_base(machine().root_device().memregion("user2")->base());
}
static TIMER_CALLBACK( Timercb )
@@ -368,7 +368,7 @@ READ32_MEMBER(crystal_state::FlashCmd_r)
{
if (m_Bank <= 2)
{
- UINT32 *ptr = (UINT32*)(machine().region("user1")->base() + m_Bank * 0x1000000);
+ UINT32 *ptr = (UINT32*)(machine().root_device().memregion("user1")->base() + m_Bank * 0x1000000);
return ptr[0];
}
else
@@ -567,9 +567,9 @@ static void crystal_banksw_postload(running_machine &machine)
crystal_state *state = machine.driver_data<crystal_state>();
if (state->m_Bank <= 2)
- state->membank("bank1")->set_base(machine.region("user1")->base() + state->m_Bank * 0x1000000);
+ state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + state->m_Bank * 0x1000000);
else
- state->membank("bank1")->set_base(machine.region("user2")->base());
+ state->membank("bank1")->set_base(state->memregion("user2")->base());
}
static MACHINE_START( crystal )
@@ -613,7 +613,7 @@ static MACHINE_RESET( crystal )
state->m_IntHigh = 0;
device_set_irq_callback(machine.device("maincpu"), icallback);
state->m_Bank = 0;
- state->membank("bank1")->set_base(machine.region("user1")->base() + 0);
+ state->membank("bank1")->set_base(state->memregion("user1")->base() + 0);
state->m_FlashCmd = 0xff;
state->m_OldPort4 = 0;
@@ -960,7 +960,7 @@ ROM_END
static DRIVER_INIT(crysking)
{
- UINT16 *Rom = (UINT16*) machine.region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.root_device().memregion("user1")->base();
//patch the data feed by the protection
@@ -979,7 +979,7 @@ static DRIVER_INIT(crysking)
static DRIVER_INIT(evosocc)
{
- UINT16 *Rom = (UINT16*) machine.region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.root_device().memregion("user1")->base();
Rom += 0x1000000 * 2 / 2;
Rom[WORD_XOR_LE(0x97388E/2)] = 0x90FC; //PUSH R2..R7
@@ -997,7 +997,7 @@ static DRIVER_INIT(evosocc)
static DRIVER_INIT(topbladv)
{
- UINT16 *Rom = (UINT16*) machine.region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.root_device().memregion("user1")->base();
Rom[WORD_XOR_LE(0x12d7a/2)] = 0x90FC; //PUSH R7-R6-R5-R4-R3-R2
Rom[WORD_XOR_LE(0x12d7c/2)] = 0x9001; //PUSH R0
@@ -1015,7 +1015,7 @@ static DRIVER_INIT(topbladv)
static DRIVER_INIT(officeye)
{
- UINT16 *Rom = (UINT16*) machine.region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.root_device().memregion("user1")->base();
Rom[WORD_XOR_LE(0x9c9e/2)] = 0x901C; //PUSH R4-R3-R2
Rom[WORD_XOR_LE(0x9ca0/2)] = 0x9001; //PUSH R0
diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c
index c139fcfff2f..8f768c491b5 100644
--- a/src/mame/drivers/cshooter.c
+++ b/src/mame/drivers/cshooter.c
@@ -239,7 +239,7 @@ WRITE8_MEMBER(cshooter_state::cshooter_c700_w)
WRITE8_MEMBER(cshooter_state::bank_w)
{
- membank("bank1")->set_base(&machine().region("user1")->base()[0x4000*((data>>4)&3)]);
+ membank("bank1")->set_base(&machine().root_device().memregion("user1")->base()[0x4000*((data>>4)&3)]);
}
@@ -665,19 +665,19 @@ ROM_END
static DRIVER_INIT( cshooter )
{
/* temp so it boots */
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0xa2] = 0x00;
rom[0xa3] = 0x00;
rom[0xa4] = 0x00;
- machine.root_device().membank("bank1")->set_base(&machine.region("user1")->base()[0]);
+ machine.root_device().membank("bank1")->set_base(&machine.root_device().memregion("user1")->base()[0]);
}
static DRIVER_INIT( cshootere )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -707,7 +707,7 @@ static DRIVER_INIT( cshootere )
rom[A] = BITSWAP8(rom[A],7,6,1,4,3,2,5,0);
}
- machine.root_device().membank("bank1")->set_base(&machine.region("user1")->base()[0]);
+ machine.root_device().membank("bank1")->set_base(&machine.root_device().memregion("user1")->base()[0]);
seibu_sound_decrypt(machine,"audiocpu",0x2000);
}
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index 8991c03a12d..3275952e33a 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -167,7 +167,7 @@ sound HW is identical to Niyanpai
static void csplayh5_soundbank_w(running_machine &machine, int data)
{
- UINT8 *SNDROM = machine.region("audiocpu")->base();
+ UINT8 *SNDROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->set_base(&SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -670,8 +670,8 @@ MACHINE_CONFIG_END
void general_init(running_machine &machine, int patchaddress)
{
- UINT16 *MAINROM = (UINT16 *)machine.region("maincpu")->base();
- UINT8 *SNDROM = machine.region("audiocpu")->base();
+ UINT16 *MAINROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ UINT8 *SNDROM = machine.root_device().memregion("audiocpu")->base();
// initialize sound rom bank
csplayh5_soundbank_w(machine, 0);
diff --git a/src/mame/drivers/cultures.c b/src/mame/drivers/cultures.c
index 65619acedcb..7706ef11723 100644
--- a/src/mame/drivers/cultures.c
+++ b/src/mame/drivers/cultures.c
@@ -57,7 +57,7 @@ public:
static TILE_GET_INFO( get_bg1_tile_info )
{
cultures_state *state = machine.driver_data<cultures_state>();
- UINT8 *region = machine.region("gfx3")->base() + 0x200000 + 0x80000 * state->m_bg1_bank;
+ UINT8 *region = state->memregion("gfx3")->base() + 0x200000 + 0x80000 * state->m_bg1_bank;
int code = region[tile_index * 2] + (region[tile_index * 2 + 1] << 8);
SET_TILE_INFO(2, code, code >> 12, 0);
}
@@ -65,7 +65,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
cultures_state *state = machine.driver_data<cultures_state>();
- UINT8 *region = machine.region("gfx2")->base() + 0x200000 + 0x80000 * state->m_bg2_bank;
+ UINT8 *region = state->memregion("gfx2")->base() + 0x200000 + 0x80000 * state->m_bg2_bank;
int code = region[tile_index * 2] + (region[tile_index * 2 + 1] << 8);
SET_TILE_INFO(1, code, code >> 12, 0);
}
@@ -161,8 +161,8 @@ WRITE8_MEMBER(cultures_state::misc_w)
if (m_old_bank != new_bank)
{
// oki banking
- UINT8 *src = machine().region("oki")->base() + 0x40000 + 0x20000 * new_bank;
- UINT8 *dst = machine().region("oki")->base() + 0x20000;
+ UINT8 *src = memregion("oki")->base() + 0x40000 + 0x20000 * new_bank;
+ UINT8 *dst = memregion("oki")->base() + 0x20000;
memcpy(dst, src, 0x20000);
m_old_bank = new_bank;
@@ -370,7 +370,7 @@ static INTERRUPT_GEN( cultures_interrupt )
static MACHINE_START( cultures )
{
cultures_state *state = machine.driver_data<cultures_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 16, &ROM[0x0000], 0x4000);
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index 7c34e7d036d..90ad7c04833 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -426,11 +426,11 @@ static int speech_rom_read_bit( device_t *device )
{
cvs_state *state = device->machine().driver_data<cvs_state>();
running_machine &machine = device->machine();
- UINT8 *ROM = machine.region("speechdata")->base();
+ UINT8 *ROM = machine.root_device().memregion("speechdata")->base();
int bit;
/* before reading the bit, clamp the address to the region length */
- state->m_speech_rom_bit_address = state->m_speech_rom_bit_address & ((machine.region("speechdata")->bytes() * 8) - 1);
+ state->m_speech_rom_bit_address = state->m_speech_rom_bit_address & ((state->memregion("speechdata")->bytes() * 8) - 1);
bit = (ROM[state->m_speech_rom_bit_address >> 3] >> (state->m_speech_rom_bit_address & 0x07)) & 0x01;
/* prepare for next bit */
@@ -1595,7 +1595,7 @@ ROM_END
static DRIVER_INIT( huncholy )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* patch out protection */
ROM[0x0082] = 0xc0;
@@ -1615,7 +1615,7 @@ static DRIVER_INIT( huncholy )
static DRIVER_INIT( hunchbaka )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
offs_t offs;
@@ -1627,7 +1627,7 @@ static DRIVER_INIT( hunchbaka )
static DRIVER_INIT( superbik )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* patch out protection */
ROM[0x0079] = 0xc0;
@@ -1655,7 +1655,7 @@ static DRIVER_INIT( superbik )
static DRIVER_INIT( hero )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* patch out protection */
ROM[0x0087] = 0xc0;
@@ -1677,7 +1677,7 @@ static DRIVER_INIT( hero )
static DRIVER_INIT( raiders )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
offs_t offs;
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index 44474fe6aa6..bcf51d5c6c2 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -294,7 +294,7 @@ static UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const r
/* non-tile based spriteram (BARE-BONES, looks pretty complex) */
if(1)
{
- const UINT8 *blit_ram = screen.machine().region("spr_gfx")->base();
+ const UINT8 *blit_ram = screen.machine().root_device().memregion("spr_gfx")->base();
int offs,x,y,z,xsize,ysize,yi,xi,col_bank,fx,zoom;
UINT32 spr_offs,spr_offs_helper;
int xf,yf,xz,yz;
@@ -426,7 +426,7 @@ static UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const r
if(0) //sprite gfx debug viewer
{
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("spr_gfx")->base();
+ const UINT8 *blit_ram = screen.machine().root_device().memregion("spr_gfx")->base();
if(screen.machine().input().code_pressed(KEYCODE_Z))
state->m_test_x++;
@@ -1014,7 +1014,7 @@ DRIVER_INIT( cybertnk )
UINT8* road_data;
int i;
- road_data = machine.region("road_data")->base();
+ road_data = machine.root_device().memregion("road_data")->base();
for (i=0;i < 0x40000;i++)
{
road_data[i] = BITSWAP8(road_data[i],3,2,1,0,7,6,5,4);
diff --git a/src/mame/drivers/cyclemb.c b/src/mame/drivers/cyclemb.c
index e3bbadd64e8..cfd670c1774 100644
--- a/src/mame/drivers/cyclemb.c
+++ b/src/mame/drivers/cyclemb.c
@@ -101,7 +101,7 @@ public:
static PALETTE_INIT( cyclemb )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
@@ -613,7 +613,7 @@ ROM_END
static DRIVER_INIT( cyclemb )
{
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x1000);
}
GAME( 1984, cyclemb, 0, cyclemb, cyclemb, cyclemb, ROT0, "Taito Corporation", "Cycle Mahbou (Japan)", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/d9final.c b/src/mame/drivers/d9final.c
index f280fbc8c8e..3fba62bc63d 100644
--- a/src/mame/drivers/d9final.c
+++ b/src/mame/drivers/d9final.c
@@ -92,7 +92,7 @@ WRITE8_MEMBER(d9final_state::sc0_cram)
WRITE8_MEMBER(d9final_state::d9final_bank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x10000+(0x4000 * (data & 0x7));
@@ -273,7 +273,7 @@ GFXDECODE_END
static MACHINE_RESET( d9final )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&ROM[0x10000]);
}
diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c
index 18a58da1c8e..cf48b10906c 100644
--- a/src/mame/drivers/dacholer.c
+++ b/src/mame/drivers/dacholer.c
@@ -606,7 +606,7 @@ static MACHINE_RESET( dacholer )
/* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */
static PALETTE_INIT( dacholer )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double weights_rg[3], weights_b[2];
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index 40a72ba8933..7d1f3ba31c6 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -205,9 +205,9 @@ static DRIVER_INIT(dambustr)
{
int i, j, tmp;
int tmpram[16];
- UINT8 *rom = machine.region("maincpu")->base();
- UINT8 *usr = machine.region("user1")->base();
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT8 *usr = machine.root_device().memregion("user1")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
// Bit swap addresses
for(i=0; i<4096*4; i++) {
diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c
index cbc287c8fb8..35a6fa8ab3a 100644
--- a/src/mame/drivers/darius.c
+++ b/src/mame/drivers/darius.c
@@ -842,8 +842,8 @@ static MACHINE_START( darius )
{
darius_state *state = machine.driver_data<darius_state>();
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
- state->membank("bank1")->configure_entry(4, machine.region("audiocpu")->base());
+ state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x8000);
+ state->membank("bank1")->configure_entry(4, state->memregion("audiocpu")->base());
state->membank("bank1")->set_entry(4);
state->m_maincpu = machine.device("maincpu");
@@ -1275,7 +1275,7 @@ ROM_END
static DRIVER_INIT( darius )
{
/**** setup sound bank image ****/
- UINT8 *RAM = machine.region("audiocpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("audiocpu")->base();
int i;
for (i = 3; i >= 0; i--)
diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c
index 0df10aaf0ee..154c0b079d9 100644
--- a/src/mame/drivers/darkhors.c
+++ b/src/mame/drivers/darkhors.c
@@ -962,8 +962,8 @@ ROM_END
static DRIVER_INIT( darkhors )
{
- UINT32 *rom = (UINT32 *) machine.region("maincpu")->base();
-// UINT8 *eeprom = (UINT8 *) machine.region("eeprom")->base();
+ UINT32 *rom = (UINT32 *) machine.root_device().memregion("maincpu")->base();
+// UINT8 *eeprom = (UINT8 *) machine.root_device().memregion("eeprom")->base();
// int i;
#if 1
diff --git a/src/mame/drivers/darkmist.c b/src/mame/drivers/darkmist.c
index 287af17a1a7..d3347366bb3 100644
--- a/src/mame/drivers/darkmist.c
+++ b/src/mame/drivers/darkmist.c
@@ -32,7 +32,7 @@ TODO:
WRITE8_MEMBER(darkmist_state::darkmist_hw_w)
{
m_hw=data;
- membank("bank1")->set_base(&machine().region("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
}
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, darkmist_state )
@@ -320,8 +320,8 @@ static void decrypt_gfx(running_machine &machine)
int size;
int i;
- rom = machine.region("gfx1")->base();
- size = machine.region("gfx1")->bytes();
+ rom = machine.root_device().memregion("gfx1")->base();
+ size = machine.root_device().memregion("gfx1")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -343,8 +343,8 @@ static void decrypt_gfx(running_machine &machine)
}
- rom = machine.region("gfx2")->base();
- size = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ size = machine.root_device().memregion("gfx2")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -366,8 +366,8 @@ static void decrypt_gfx(running_machine &machine)
}
- rom = machine.region("gfx3")->base();
- size = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ size = machine.root_device().memregion("gfx3")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -394,7 +394,7 @@ static void decrypt_gfx(running_machine &machine)
static void decrypt_snd(running_machine &machine)
{
int i;
- UINT8 *ROM = machine.region("t5182")->base();
+ UINT8 *ROM = machine.root_device().memregion("t5182")->base();
for(i=0x8000;i<0x10000;i++)
ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);
@@ -404,7 +404,7 @@ static DRIVER_INIT(darkmist)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i, len;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x10000);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
@@ -440,8 +440,8 @@ static DRIVER_INIT(darkmist)
space->machine().root_device().membank("bank1")->set_base(&ROM[0x010000]);
/* adr line swaps */
- ROM = machine.region("user1")->base();
- len = machine.region("user1")->bytes();
+ ROM = machine.root_device().memregion("user1")->base();
+ len = machine.root_device().memregion("user1")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
@@ -449,24 +449,24 @@ static DRIVER_INIT(darkmist)
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,6,5,4,3,2,14,13,12,11,8,7,1,0,10,9)];
}
- ROM = machine.region("user2")->base();
- len = machine.region("user2")->bytes();
+ ROM = machine.root_device().memregion("user2")->base();
+ len = machine.root_device().memregion("user2")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,6,5,4,3,2,14,13,12,11,8,7,1,0,10,9)];
}
- ROM = machine.region("user3")->base();
- len = machine.region("user3")->bytes();
+ ROM = machine.root_device().memregion("user3")->base();
+ len = machine.root_device().memregion("user3")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14 ,5,4,3,2,11,10,9,8,13,12,1,0,7,6)];
}
- ROM = machine.region("user4")->base();
- len = machine.region("user4")->bytes();
+ ROM = machine.root_device().memregion("user4")->base();
+ len = machine.root_device().memregion("user4")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index aba25d92bf7..363a7b2e3e1 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -471,7 +471,7 @@ ROM_END
static DRIVER_INIT( darkseal )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i;
for (i=0x00000; i<0x80000; i++)
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index f8936ac4480..407001c3f58 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -830,8 +830,8 @@ ROM_END
static DRIVER_INIT( dassault )
{
- const UINT8 *src = machine.region("gfx1")->base();
- UINT8 *dst = machine.region("gfx2")->base();
+ const UINT8 *src = machine.root_device().memregion("gfx1")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx2")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Playfield 4 also has access to the char graphics, make things easier
@@ -847,8 +847,8 @@ static DRIVER_INIT( dassault )
static DRIVER_INIT( thndzone )
{
- const UINT8 *src = machine.region("gfx1")->base();
- UINT8 *dst = machine.region("gfx2")->base();
+ const UINT8 *src = machine.root_device().memregion("gfx1")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx2")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Playfield 4 also has access to the char graphics, make things easier
diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c
index 42033b48ee6..8f3565aa868 100644
--- a/src/mame/drivers/dbz.c
+++ b/src/mame/drivers/dbz.c
@@ -504,7 +504,7 @@ static DRIVER_INIT( dbz )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine.region("maincpu")->base();
+ ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// nop out dbz1's mask rom test
// tile ROM test
diff --git a/src/mame/drivers/dcon.c b/src/mame/drivers/dcon.c
index 07f73d0b571..87cd68ef40f 100644
--- a/src/mame/drivers/dcon.c
+++ b/src/mame/drivers/dcon.c
@@ -375,7 +375,7 @@ ROM_END
/***************************************************************************/
static DRIVER_INIT( sdgndmps )
{
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0x1356/2] = 0x4e71; /* beq -> nop */
RAM[0x1358/2] = 0x4e71;
diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c
index 726be4d5dd3..1b325871e1d 100644
--- a/src/mame/drivers/ddayjlc.c
+++ b/src/mame/drivers/ddayjlc.c
@@ -486,7 +486,7 @@ static MACHINE_RESET( ddayjlc )
static PALETTE_INIT( ddayjlc )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
@@ -675,8 +675,8 @@ static DRIVER_INIT( ddayjlc )
UINT8 *src, *dst, *temp;
temp = auto_alloc_array(machine, UINT8, 0x10000);
src = temp;
- dst = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ dst = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
memcpy(src, dst, length);
newadr = 0;
oldaddr = 0;
@@ -690,7 +690,7 @@ static DRIVER_INIT( ddayjlc )
auto_free(machine, temp);
}
- machine.root_device().membank("bank1")->configure_entries(0, 3, machine.region("user1")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 3, machine.root_device().memregion("user1")->base(), 0x4000);
machine.root_device().membank("bank1")->set_entry(0);
}
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index 13c30a35c23..4e9c49abaec 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -430,8 +430,8 @@ INLINE void log_draw_error( int src, int cmd )
static int blit_draw( running_machine &machine, int src, int sx )
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *src_data = machine.region("blitter")->base();
- int src_len = machine.region("blitter")->bytes();
+ UINT8 *src_data = machine.root_device().memregion("blitter")->base();
+ int src_len = state->memregion("blitter")->bytes();
int bit_addr = (src & 0xffffff) * state->m_ddenlovr_blit_rom_bits; /* convert to bit address */
int pen_size, arg_size, cmd;
int x;
@@ -1235,8 +1235,8 @@ WRITE16_MEMBER(dynax_state::ddenlovr_blitter_irq_ack_w)
READ8_MEMBER(dynax_state::rongrong_gfxrom_r)
{
- UINT8 *rom = machine().region("blitter")->base();
- size_t size = machine().region("blitter")->bytes();
+ UINT8 *rom = memregion("blitter")->base();
+ size_t size = memregion("blitter")->bytes();
int address = m_ddenlovr_blit_address;
if (address >= size)
@@ -1309,7 +1309,7 @@ SCREEN_UPDATE_IND16(ddenlovr)
#if 0
static int base = 0x0;
- const UINT8 *gfx = screen.machine().region("blitter")->base();
+ const UINT8 *gfx = screen.machine().root_device().memregion("blitter")->base();
int next;
memset(state->m_ddenlovr_pixmap[0], 0, 512 * 512);
memset(state->m_ddenlovr_pixmap[1], 0, 512 * 512);
@@ -2407,8 +2407,8 @@ READ8_MEMBER(dynax_state::hanakanz_busy_r)
READ8_MEMBER(dynax_state::hanakanz_gfxrom_r)
{
- UINT8 *rom = machine().region("blitter")->base();
- size_t size = machine().region("blitter")->bytes();
+ UINT8 *rom = memregion("blitter")->base();
+ size_t size = memregion("blitter")->bytes();
int address = (m_ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size)
@@ -2585,8 +2585,8 @@ WRITE8_MEMBER(dynax_state::mjchuuka_blitter_w)
static void mjchuuka_get_romdata(running_machine &machine)
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *rom = machine.region("blitter")->base();
- size_t size = machine.region("blitter")->bytes();
+ UINT8 *rom = machine.root_device().memregion("blitter")->base();
+ size_t size = state->memregion("blitter")->bytes();
int address = (state->m_ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size)
@@ -2820,7 +2820,7 @@ WRITE8_MEMBER(dynax_state::hginga_rombank_w)
// similar to rongrong
READ8_MEMBER(dynax_state::hginga_protection_r)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
if (m_hginga_rombank & 0x10)
return hanakanz_rand_r(space, 0);
@@ -3046,7 +3046,7 @@ WRITE8_MEMBER(dynax_state::hgokou_input_w)
// similar to rongrong
READ8_MEMBER(dynax_state::hgokou_protection_r)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
if (m_hginga_rombank == 0)
return hanakanz_rand_r(space, 0);
@@ -7613,7 +7613,7 @@ static MACHINE_RESET( ddenlovr )
static MACHINE_START( rongrong )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x20, &ROM[0x010000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 8, &ROM[0x110000], 0x1000);
@@ -7622,7 +7622,7 @@ static MACHINE_START( rongrong )
static MACHINE_START( mmpanic )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000);
MACHINE_START_CALL(ddenlovr);
@@ -7630,7 +7630,7 @@ static MACHINE_START( mmpanic )
static MACHINE_START( funkyfig )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000);
@@ -7639,7 +7639,7 @@ static MACHINE_START( funkyfig )
static MACHINE_START( hanakanz )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 0x10, &ROM[0x90000], 0x1000);
@@ -7648,7 +7648,7 @@ static MACHINE_START( hanakanz )
static MACHINE_START( mjmyster )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000);
@@ -7657,7 +7657,7 @@ static MACHINE_START( mjmyster )
static MACHINE_START( hparadis )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 8, &ROM[0x50000], 0x1000);
@@ -7666,7 +7666,7 @@ static MACHINE_START( hparadis )
static MACHINE_START( mjflove )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000);
@@ -7675,7 +7675,7 @@ static MACHINE_START( mjflove )
static MACHINE_START( sryudens )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 0x10, &ROM[0x90000], 0x1000);
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index b276b83259d..e507a7858ca 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -150,7 +150,7 @@ static MACHINE_START( ddragon )
ddragon_state *state = machine.driver_data<ddragon_state>();
/* configure banks */
- state->membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 8, state->memregion("maincpu")->base() + 0x10000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_sub_cpu = machine.device("sub");
@@ -465,7 +465,7 @@ static void dd_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * chip;
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * chip;
state->m_adpcm_data[chip] = ROM[state->m_adpcm_pos[chip]++];
msm5205_data_w(device, state->m_adpcm_data[chip] >> 4);
@@ -2023,26 +2023,26 @@ static DRIVER_INIT( toffy )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::toffy_bankswitch_w),state));
/* the program rom has a simple bitswap encryption */
- rom = machine.region("maincpu")->base();
- length = machine.region("maincpu")->bytes();
+ rom = machine.root_device().memregion("maincpu")->base();
+ length = machine.root_device().memregion("maincpu")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 6,7,5,4,3,2,1,0);
/* and the fg gfx ... */
- rom = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ rom = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0);
/* and the sprites gfx */
- rom = machine.region("gfx2")->base();
- length = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ length = machine.root_device().memregion("gfx2")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,0,1);
/* and the bg gfx */
- rom = machine.region("gfx3")->base();
- length = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ length = state->memregion("gfx3")->bytes();
for (i = 0; i < length / 2; i++)
{
rom[i + 0*length/2] = BITSWAP8(rom[i + 0*length/2], 7,6,1,4,3,2,5,0);
@@ -2058,8 +2058,8 @@ static DRIVER_INIT( ddragon6809 )
int i;
UINT8 *dst,*src;
- src = machine.region("chars")->base();
- dst = machine.region("gfx1")->base();
+ src = machine.root_device().memregion("chars")->base();
+ dst = state->memregion("gfx1")->base();
for (i = 0; i < 0x8000; i++)
{
diff --git a/src/mame/drivers/ddribble.c b/src/mame/drivers/ddribble.c
index 62811210244..6f692d74b61 100644
--- a/src/mame/drivers/ddribble.c
+++ b/src/mame/drivers/ddribble.c
@@ -82,7 +82,7 @@ static READ8_DEVICE_HANDLER( ddribble_vlm5030_busy_r )
static WRITE8_DEVICE_HANDLER( ddribble_vlm5030_ctrl_w )
{
ddribble_state *state = device->machine().driver_data<ddribble_state>();
- UINT8 *SPEECH_ROM = device->machine().region("vlm")->base();
+ UINT8 *SPEECH_ROM = state->memregion("vlm")->base();
/* b7 : vlm data bus OE */
@@ -247,7 +247,7 @@ static const vlm5030_interface vlm5030_config =
static MACHINE_START( ddribble )
{
ddribble_state *state = machine.driver_data<ddribble_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 5, &ROM[0x10000], 0x2000);
state->m_filter1 = machine.device("filter1");
diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c
index 664625cd876..062d2964194 100644
--- a/src/mame/drivers/dec0.c
+++ b/src/mame/drivers/dec0.c
@@ -3038,7 +3038,7 @@ static void dump_to_file(running_machine& machine, UINT8* ROM, int offset, int s
static DRIVER_INIT( convert_robocop_gfx4_to_automat )
{
- UINT8* R = machine.region("gfx4")->base();
+ UINT8* R = machine.root_device().memregion("gfx4")->base();
int i;
for (i=0;i<0x80000;i++)
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index 1153e75ca38..cc10df49c9f 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -3548,7 +3548,7 @@ static DRIVER_INIT( deco222 )
UINT8 *rom;
/* bits 5 and 6 of the opcodes are swapped */
- rom = machine.region("audiocpu")->base();
+ rom = state->memregion("audiocpu")->base();
decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x8000, 0xffff, decrypt);
@@ -3562,36 +3562,36 @@ static DRIVER_INIT( deco222 )
/* Below, I set up the correct number of banks depending on the "maincpu" region size */
static DRIVER_INIT( lastmisn )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( shackled )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 14, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( gondo )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( garyoret )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( ghostb )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *RAM = machine.region("proms")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("proms")->base();
/* Blank out unused garbage in colour prom to avoid colour overflow */
memset(RAM + 0x20, 0, 0xe0);
@@ -3602,8 +3602,8 @@ static DRIVER_INIT( ghostb )
static DRIVER_INIT( meikyuh )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *RAM = machine.region("proms")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("proms")->base();
/* Blank out unused garbage in colour prom to avoid colour overflow */
memset(RAM + 0x20, 0, 0xe0);
@@ -3614,8 +3614,8 @@ static DRIVER_INIT( meikyuh )
static DRIVER_INIT( csilver )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *RAM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 14, &ROM[0x10000], 0x4000);
machine.root_device().membank("bank3")->configure_entries(0, 2, &RAM[0x10000], 0x4000);
@@ -3624,21 +3624,21 @@ static DRIVER_INIT( csilver )
static DRIVER_INIT( oscar )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( deco222 );
}
static DRIVER_INIT( srdarwin )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( deco222 );
}
static DRIVER_INIT( cobracom )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index a01caf4cfb8..d4331375694 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -613,8 +613,8 @@ ROM_END
static void descramble_sound( running_machine &machine, const char *tag )
{
- UINT8 *rom = machine.region(tag)->base();
- int length = machine.region(tag)->bytes();
+ UINT8 *rom = machine.root_device().memregion(tag)->base();
+ int length = machine.root_device().memregion(tag)->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 390e0f2ae7c..978546b4828 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -3246,9 +3246,9 @@ static DRIVER_INIT( captaven )
extern void process_dvi_data(UINT8* dvi_data, int offset, int regionsize);
static DRIVER_INIT( dragngun )
{
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
- const UINT8 *SRC_RAM = machine.region("gfx1")->base();
- UINT8 *DST_RAM = machine.region("gfx2")->base();
+ UINT32 *ROM = (UINT32 *)machine.root_device().memregion("maincpu")->base();
+ const UINT8 *SRC_RAM = machine.root_device().memregion("gfx1")->base();
+ UINT8 *DST_RAM = machine.root_device().memregion("gfx2")->base();
deco74_decrypt_gfx(machine, "gfx1");
deco74_decrypt_gfx(machine, "gfx2");
@@ -3261,7 +3261,7 @@ static DRIVER_INIT( dragngun )
#if 0
{
- UINT8 *ROM = machine.region("dvi")->base();
+ UINT8 *ROM = machine.root_device().memregion("dvi")->base();
FILE *fp;
char filename[256];
@@ -3276,11 +3276,11 @@ static DRIVER_INIT( dragngun )
#endif
// there are DVI headers at 0x000000, 0x580000, 0x800000, 0xB10000, 0xB80000
- process_dvi_data(machine.region("dvi")->base(),0x000000, 0x1000000);
- process_dvi_data(machine.region("dvi")->base(),0x580000, 0x1000000);
- process_dvi_data(machine.region("dvi")->base(),0x800000, 0x1000000);
- process_dvi_data(machine.region("dvi")->base(),0xB10000, 0x1000000);
- process_dvi_data(machine.region("dvi")->base(),0xB80000, 0x1000000);
+ process_dvi_data(machine.root_device().memregion("dvi")->base(),0x000000, 0x1000000);
+ process_dvi_data(machine.root_device().memregion("dvi")->base(),0x580000, 0x1000000);
+ process_dvi_data(machine.root_device().memregion("dvi")->base(),0x800000, 0x1000000);
+ process_dvi_data(machine.root_device().memregion("dvi")->base(),0xB10000, 0x1000000);
+ process_dvi_data(machine.root_device().memregion("dvi")->base(),0xB80000, 0x1000000);
}
@@ -3294,8 +3294,8 @@ static DRIVER_INIT( fghthist )
static DRIVER_INIT( lockload )
{
- UINT8 *RAM = machine.region("maincpu")->base();
-// UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+// UINT32 *ROM = (UINT32 *)machine.root_device().memregion("maincpu")->base();
deco74_decrypt_gfx(machine, "gfx1");
deco74_decrypt_gfx(machine, "gfx2");
@@ -3311,7 +3311,7 @@ static DRIVER_INIT( lockload )
static DRIVER_INIT( tattass )
{
- UINT8 *RAM = machine.region("gfx1")->base();
+ UINT8 *RAM = machine.root_device().memregion("gfx1")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Reorder bitplanes to make decoding easier */
@@ -3319,7 +3319,7 @@ static DRIVER_INIT( tattass )
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
- RAM = machine.region("gfx2")->base();
+ RAM = machine.root_device().memregion("gfx2")->base();
memcpy(tmp,RAM+0x80000,0x80000);
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
@@ -3332,7 +3332,7 @@ static DRIVER_INIT( tattass )
static DRIVER_INIT( nslasher )
{
- UINT8 *RAM = machine.region("gfx1")->base();
+ UINT8 *RAM = machine.root_device().memregion("gfx1")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Reorder bitplanes to make decoding easier */
@@ -3340,7 +3340,7 @@ static DRIVER_INIT( nslasher )
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
- RAM = machine.region("gfx2")->base();
+ RAM = machine.root_device().memregion("gfx2")->base();
memcpy(tmp,RAM+0x80000,0x80000);
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index 2e5582da3d2..49193b71d81 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -693,8 +693,8 @@ ROM_END
static void descramble_sound( running_machine &machine )
{
/* the same as simpl156 / heavy smash? */
- UINT8 *rom = machine.region("ymz")->base();
- int length = machine.region("ymz")->bytes();
+ UINT8 *rom = machine.root_device().memregion("ymz")->base();
+ int length = machine.root_device().memregion("ymz")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index 7c0d93892b2..62b23f275ac 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -1451,7 +1451,7 @@ static DRIVER_INIT( decocass )
{
decocass_state *state = machine.driver_data<decocass_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int A;
/* allocate memory and mark all RAM regions with their decrypted pointers */
@@ -1475,8 +1475,8 @@ static DRIVER_INIT( decocass )
static DRIVER_INIT( decocrom )
{
decocass_state *state = machine.driver_data<decocass_state>();
- int romlength = machine.region("user3")->bytes();
- UINT8 *rom = machine.region("user3")->base();
+ int romlength = machine.root_device().memregion("user3")->bytes();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
int i;
state->m_decrypted2 = auto_alloc_array(machine, UINT8, romlength);
@@ -1492,7 +1492,7 @@ static DRIVER_INIT( decocrom )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0xafff, "bank1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0xafff, FUNC(decocass_de0091_w));
state->membank("bank1")->configure_entry(0, state->m_charram);
- state->membank("bank1")->configure_entry(1, machine.region("user3")->base());
+ state->membank("bank1")->configure_entry(1, state->memregion("user3")->base());
state->membank("bank1")->configure_decrypted_entry(0, &state->m_decrypted[0x6000]);
state->membank("bank1")->configure_decrypted_entry(1, state->m_decrypted2);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/deshoros.c b/src/mame/drivers/deshoros.c
index b564b858426..a3c9c76cd0d 100644
--- a/src/mame/drivers/deshoros.c
+++ b/src/mame/drivers/deshoros.c
@@ -67,7 +67,7 @@ static void answer_bankswitch(running_machine &machine,UINT8 new_bank)
deshoros_state *state = machine.driver_data<deshoros_state>();
if(state->m_bank!=new_bank)
{
- UINT8 *ROM = machine.region("data")->base();
+ UINT8 *ROM = state->memregion("data")->base();
UINT32 bankaddress;
state->m_bank = new_bank;
diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c
index 209b20e7b7a..5a53d6a3b8a 100644
--- a/src/mame/drivers/dgpix.c
+++ b/src/mame/drivers/dgpix.c
@@ -77,7 +77,7 @@ public:
READ32_MEMBER(dgpix_state::flash_r)
{
- UINT32 *ROM = (UINT32 *)machine().region("user1")->base();
+ UINT32 *ROM = (UINT32 *)machine().root_device().memregion("user1")->base();
if(offset >= (0x2000000 - m_flash_roms * 0x400000) / 4)
{
@@ -114,7 +114,7 @@ WRITE32_MEMBER(dgpix_state::flash_w)
if(data == 0xd0d00000)
{
// point to game settings
- UINT8 *rom = (UINT8 *)machine().region("user1")->base() + offset*4;
+ UINT8 *rom = (UINT8 *)machine().root_device().memregion("user1")->base() + offset*4;
// erase one block
memset(rom, 0xff, 0x10000);
@@ -132,7 +132,7 @@ WRITE32_MEMBER(dgpix_state::flash_w)
}
else
{
- UINT16 *rom = (UINT16 *)machine().region("user1")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("user1")->base();
// write game settings
@@ -223,7 +223,7 @@ static NVRAM_HANDLER( flashroms )
if (read_or_write)
{
// point to game settings
- UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000 + 0x360000;
+ UINT8 *rom = (UINT8 *)machine.root_device().memregion("user1")->base() + 0x1c00000 + 0x360000;
UINT8 tmp[0x40000];
int i;
@@ -236,7 +236,7 @@ static NVRAM_HANDLER( flashroms )
else if (file)
{
// point to game settings
- UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000 + 0x360000;
+ UINT8 *rom = (UINT8 *)machine.root_device().memregion("user1")->base() + 0x1c00000 + 0x360000;
UINT8 tmp[0x40000];
int i;
@@ -574,7 +574,7 @@ ROM_END
static DRIVER_INIT( xfiles )
{
dgpix_state *state = machine.driver_data<dgpix_state>();
- UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000;
+ UINT8 *rom = (UINT8 *)state->memregion("user1")->base() + 0x1c00000;
rom[BYTE4_XOR_BE(0x3aa92e)] = 3;
rom[BYTE4_XOR_BE(0x3aa92f)] = 0;
@@ -592,7 +592,7 @@ static DRIVER_INIT( xfiles )
static DRIVER_INIT( kdynastg )
{
dgpix_state *state = machine.driver_data<dgpix_state>();
- UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000;
+ UINT8 *rom = (UINT8 *)state->memregion("user1")->base() + 0x1c00000;
rom[BYTE4_XOR_BE(0x3aaa10)] = 3; // 129f0 - nopped call
rom[BYTE4_XOR_BE(0x3aaa11)] = 0;
diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c
index 20f75ab099a..d833b8f54a3 100644
--- a/src/mame/drivers/discoboy.c
+++ b/src/mame/drivers/discoboy.c
@@ -199,7 +199,7 @@ static SCREEN_UPDATE_IND16( discoboy )
#ifdef UNUSED_FUNCTION
void discoboy_setrombank( running_machine &machine, UINT8 data )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
data &= 0x2f;
space->machine().root_device().membank("bank1")->set_base(&ROM[0x6000 + (data * 0x1000)] );
}
@@ -560,8 +560,8 @@ ROM_END
static DRIVER_INIT( discoboy )
{
discoboy_state *state = machine.driver_data<discoboy_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *AUDIO = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *AUDIO = state->memregion("audiocpu")->base();
memset(state->m_ram_1, 0, sizeof(state->m_ram_1));
memset(state->m_ram_2, 0, sizeof(state->m_ram_2));
diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c
index aa3c40f6ef0..834b592d1ee 100644
--- a/src/mame/drivers/djboy.c
+++ b/src/mame/drivers/djboy.c
@@ -522,9 +522,9 @@ static const kaneko_pandora_interface djboy_pandora_config =
static MACHINE_START( djboy )
{
djboy_state *state = machine.driver_data<djboy_state>();
- UINT8 *MAIN = machine.region("maincpu")->base();
- UINT8 *CPU1 = machine.region("cpu1")->base();
- UINT8 *CPU2 = machine.region("cpu2")->base();
+ UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *CPU1 = machine.root_device().memregion("cpu1")->base();
+ UINT8 *CPU2 = state->memregion("cpu2")->base();
state->membank("bank1")->configure_entries(0, 4, &MAIN[0x00000], 0x2000);
state->membank("bank1")->configure_entries(4, 28, &MAIN[0x10000], 0x2000);
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index c0778be4eaf..18ab3d630af 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -104,7 +104,7 @@ WRITE32_MEMBER(djmain_state::paletteram32_w)
static void sndram_set_bank(running_machine &machine)
{
djmain_state *state = machine.driver_data<djmain_state>();
- state->m_sndram = machine.region("shared")->base() + 0x80000 * state->m_sndram_bank;
+ state->m_sndram = state->memregion("shared")->base() + 0x80000 * state->m_sndram_bank;
}
WRITE32_MEMBER(djmain_state::sndram_bank_w)
@@ -170,7 +170,7 @@ WRITE32_MEMBER(djmain_state::obj_ctrl_w)
READ32_MEMBER(djmain_state::obj_rom_r)
{
- UINT8 *mem8 = machine().region("gfx1")->base();
+ UINT8 *mem8 = memregion("gfx1")->base();
int bank = m_obj_regs[0x28/4] >> 16;
offset += bank * 0x200;
@@ -207,7 +207,7 @@ WRITE32_MEMBER(djmain_state::v_ctrl_w)
READ32_MEMBER(djmain_state::v_rom_r)
{
device_t *k056832 = machine().device("k056832");
- UINT8 *mem8 = machine().region("gfx2")->base();
+ UINT8 *mem8 = memregion("gfx2")->base();
int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
offset *= 2;
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index ccbe1a23409..6d8756b0371 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -424,7 +424,7 @@ static MACHINE_START( dkong2b )
static MACHINE_START( s2650 )
{
dkong_state *state = machine.driver_data<dkong_state>();
- UINT8 *p = machine.region("user1")->base();
+ UINT8 *p = state->memregion("user1")->base();
const char *game_name = machine.system().name;
int i;
@@ -487,7 +487,7 @@ static MACHINE_RESET( dkong )
static MACHINE_RESET( strtheat )
{
dkong_state *state = machine.driver_data<dkong_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
MACHINE_RESET_CALL(dkong);
@@ -500,7 +500,7 @@ static MACHINE_RESET( strtheat )
static MACHINE_RESET( drakton )
{
dkong_state *state = machine.driver_data<dkong_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
MACHINE_RESET_CALL(dkong);
@@ -1637,7 +1637,7 @@ static void braze_decrypt_rom(running_machine &machine, UINT8 *dest)
UINT32 mem;
UINT32 newmem;
- ROM = machine.region("braze")->base();
+ ROM = machine.root_device().memregion("braze")->base();
for (mem=0;mem<0x10000;mem++)
{
@@ -3065,7 +3065,7 @@ static void drakton_decrypt_rom(running_machine &machine, UINT8 mod, int offs, i
UINT8 *ROM;
int mem;
- ROM = machine.region("maincpu")->base();
+ ROM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -3091,7 +3091,7 @@ static void drakton_decrypt_rom(running_machine &machine, UINT8 mod, int offs, i
static DRIVER_INIT( herodk )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* swap data lines D3 and D4 */
for (A = 0;A < 0x8000;A++)
@@ -3182,7 +3182,7 @@ static DRIVER_INIT( dkongx )
static DRIVER_INIT( dkingjr )
{
- UINT8 *prom = machine.region("proms")->base();
+ UINT8 *prom = machine.root_device().memregion("proms")->base();
for( int i=0; i<0x200; ++i)
{
prom[i]^=0xff; // invert color data
diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c
index 44d5b79dfb0..8dc44c02903 100644
--- a/src/mame/drivers/dmndrby.c
+++ b/src/mame/drivers/dmndrby.c
@@ -338,7 +338,7 @@ static TILE_GET_INFO( get_dmndrby_tile_info )
static VIDEO_START(dderby)
{
dmndrby_state *state = machine.driver_data<dmndrby_state>();
- state->m_racetrack_tilemap_rom = machine.region("user1")->base();
+ state->m_racetrack_tilemap_rom = state->memregion("user1")->base();
state->m_racetrack_tilemap = tilemap_create(machine,get_dmndrby_tile_info,tilemap_scan_rows,16,16, 16, 512);
state->m_racetrack_tilemap->mark_all_dirty();
@@ -444,7 +444,7 @@ wouldnt like to say its the most effective way though...
// copied from elsewhere. surely incorrect
static PALETTE_INIT( dmnderby )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -486,7 +486,7 @@ static PALETTE_INIT( dmnderby )
}
/* color_prom now points to the beginning of the lookup table */
- color_prom = machine.region("proms2")->base();
+ color_prom = machine.root_device().memregion("proms2")->base();
/* normal tiles use colors 0-15 */
for (i = 0x000; i < 0x300; i++)
diff --git a/src/mame/drivers/docastle.c b/src/mame/drivers/docastle.c
index cb539ba188e..5379095633d 100644
--- a/src/mame/drivers/docastle.c
+++ b/src/mame/drivers/docastle.c
@@ -164,7 +164,7 @@ static void idsoccer_adpcm_int( device_t *device )
{
docastle_state *state = device->machine().driver_data<docastle_state>();
- if (state->m_adpcm_pos >= device->machine().region("adpcm")->bytes())
+ if (state->m_adpcm_pos >= state->memregion("adpcm")->bytes())
{
state->m_adpcm_idle = 1;
msm5205_reset_w(device, 1);
@@ -176,7 +176,7 @@ static void idsoccer_adpcm_int( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos++];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos++];
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
}
diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c
index ae4f6c3bddd..5087495c5c5 100644
--- a/src/mame/drivers/dooyong.c
+++ b/src/mame/drivers/dooyong.c
@@ -93,7 +93,7 @@ WRITE8_MEMBER(dooyong_state::lastday_bankswitch_w)
static MACHINE_START( lastday )
{
- machine.root_device().membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
WRITE8_MEMBER(dooyong_state::flip_screen_w)
diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c
index 82fd276d2c3..b4a36f52ee6 100644
--- a/src/mame/drivers/dorachan.c
+++ b/src/mame/drivers/dorachan.c
@@ -88,7 +88,7 @@ static SCREEN_UPDATE_RGB32( dorachan )
get_pens(pens);
- color_map_base = screen.machine().region("proms")->base();
+ color_map_base = state->memregion("proms")->base();
for (offs = 0; offs < state->m_videoram.bytes(); offs++)
{
diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c
index 9b26ce9e584..e75fe96df3f 100644
--- a/src/mame/drivers/dreamwld.c
+++ b/src/mame/drivers/dreamwld.c
@@ -168,7 +168,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
const gfx_element *gfx = machine.gfx[0];
UINT32 *source = state->m_spritebuf1;
UINT32 *finish = state->m_spritebuf1 + 0x1000 / 4;
- UINT16 *redirect = (UINT16 *)machine.region("spritelut")->base();
+ UINT16 *redirect = (UINT16 *)state->memregion("spritelut")->base();
while (source < finish)
{
@@ -408,8 +408,8 @@ READ32_MEMBER(dreamwld_state::dreamwld_protdata_r)
//printf("protection read %04x\n", count);
//count++;
- UINT8 *protdata = machine().region("user1")->base();
- size_t protsize = machine().region("user1")->bytes();
+ UINT8 *protdata = memregion("user1")->base();
+ size_t protsize = memregion("user1")->bytes();
UINT8 dat = protdata[(m_protindex++) % protsize];
// real hw returns 00 after end of data, I haven't checked if it's possible to overflow the read counter
@@ -421,7 +421,7 @@ READ32_MEMBER(dreamwld_state::dreamwld_protdata_r)
WRITE32_MEMBER(dreamwld_state::dreamwld_6295_0_bank_w)
{
- UINT8 *sound = machine().region("oki1")->base();
+ UINT8 *sound = memregion("oki1")->base();
if (ACCESSING_BITS_0_7)
memcpy(sound + 0x30000, sound + 0xb0000 + 0x10000 * (data&0x3), 0x10000);
@@ -431,7 +431,7 @@ WRITE32_MEMBER(dreamwld_state::dreamwld_6295_0_bank_w)
WRITE32_MEMBER(dreamwld_state::dreamwld_6295_1_bank_w)
{
- UINT8 *sound = machine().region("oki2")->base();
+ UINT8 *sound = memregion("oki2")->base();
if (ACCESSING_BITS_0_7)
memcpy(sound + 0x30000, sound + 0xb0000 + 0x10000 * (data&0x3), 0x10000);
diff --git a/src/mame/drivers/drgnmst.c b/src/mame/drivers/drgnmst.c
index 6d2d0d6f49f..ef2c5ce869f 100644
--- a/src/mame/drivers/drgnmst.c
+++ b/src/mame/drivers/drgnmst.c
@@ -486,9 +486,9 @@ static UINT8 drgnmst_asciitohex( UINT8 data )
static DRIVER_INIT( drgnmst )
{
- UINT8 *drgnmst_PICROM_HEX = machine.region("user1")->base();
- UINT16 *drgnmst_PICROM = (UINT16 *)machine.region("audiocpu")->base();
- UINT8 *drgnmst_PCM = machine.region("oki1")->base();
+ UINT8 *drgnmst_PICROM_HEX = machine.root_device().memregion("user1")->base();
+ UINT16 *drgnmst_PICROM = (UINT16 *)machine.root_device().memregion("audiocpu")->base();
+ UINT8 *drgnmst_PCM = machine.root_device().memregion("oki1")->base();
INT32 offs, data;
UINT16 src_pos = 0;
UINT16 dst_pos = 0;
diff --git a/src/mame/drivers/drmicro.c b/src/mame/drivers/drmicro.c
index a0709ff4ffa..c98a094f7bc 100644
--- a/src/mame/drivers/drmicro.c
+++ b/src/mame/drivers/drmicro.c
@@ -45,7 +45,7 @@ WRITE8_MEMBER(drmicro_state::nmi_enable_w)
static void pcm_w(device_t *device)
{
drmicro_state *state = device->machine().driver_data<drmicro_state>();
- UINT8 *PCM = device->machine().region("adpcm")->base();
+ UINT8 *PCM = state->memregion("adpcm")->base();
int data = PCM[state->m_pcm_adr / 2];
diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c
index 4862f0337de..db76e138a51 100644
--- a/src/mame/drivers/drw80pkr.c
+++ b/src/mame/drivers/drw80pkr.c
@@ -347,7 +347,7 @@ static SCREEN_UPDATE_IND16( drw80pkr )
static PALETTE_INIT( drw80pkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int j;
for (j = 0; j < machine.total_colors(); j++)
@@ -405,7 +405,7 @@ GFXDECODE_END
static DRIVER_INIT( drw80pkr )
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base(), 0x1000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base(), 0x1000);
}
diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c
index e4ced0f51e7..f3a79f60f92 100644
--- a/src/mame/drivers/dunhuang.c
+++ b/src/mame/drivers/dunhuang.c
@@ -346,7 +346,7 @@ WRITE8_MEMBER(dunhuang_state::dunhuang_block_h_w)
m_block_h = data;
- tile_addr = machine().region("gfx2")->base() + ((m_block_addr_hi << 8) + m_block_addr_lo) * 4;
+ tile_addr = memregion("gfx2")->base() + ((m_block_addr_hi << 8) + m_block_addr_lo) * 4;
switch (m_block_dest)
{
@@ -766,7 +766,7 @@ static const ay8910_interface dunhuang_ay8910_interface =
static MACHINE_START( dunhuang )
{
dunhuang_state *state = machine.driver_data<dunhuang_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000);
diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c
index 574b528d9ad..b5c391efd34 100644
--- a/src/mame/drivers/dwarfd.c
+++ b/src/mame/drivers/dwarfd.c
@@ -1290,8 +1290,8 @@ static DRIVER_INIT(dwarfd)
UINT8 *src, *dst;
/* expand gfx roms */
- src = machine.region("gfx1")->base();
- dst = machine.region("gfx2")->base();
+ src = machine.root_device().memregion("gfx1")->base();
+ dst = state->memregion("gfx2")->base();
for (i = 0; i < 0x4000; i++)
{
@@ -1304,7 +1304,7 @@ static DRIVER_INIT(dwarfd)
}
/* use low bit as 'interpolation' bit */
- src = machine.region("gfx2")->base();
+ src = machine.root_device().memregion("gfx2")->base();
for (i = 0; i < 0x8000; i++)
{
if (src[i] & 0x10)
@@ -1335,12 +1335,12 @@ static DRIVER_INIT(qc)
DRIVER_INIT_CALL(dwarfd);
// hacks for program to proceed
- machine.region("maincpu")->base()[0x6564] = 0x00;
- machine.region("maincpu")->base()[0x6565] = 0x00;
+ machine.root_device().memregion("maincpu")->base()[0x6564] = 0x00;
+ machine.root_device().memregion("maincpu")->base()[0x6565] = 0x00;
- machine.region("maincpu")->base()[0x59b2] = 0x00;
- machine.region("maincpu")->base()[0x59b3] = 0x00;
- machine.region("maincpu")->base()[0x59b4] = 0x00;
+ machine.root_device().memregion("maincpu")->base()[0x59b2] = 0x00;
+ machine.root_device().memregion("maincpu")->base()[0x59b3] = 0x00;
+ machine.root_device().memregion("maincpu")->base()[0x59b4] = 0x00;
}
diff --git a/src/mame/drivers/dynadice.c b/src/mame/drivers/dynadice.c
index c8973d26d3f..96398f6d791 100644
--- a/src/mame/drivers/dynadice.c
+++ b/src/mame/drivers/dynadice.c
@@ -294,10 +294,10 @@ ROM_END
static DRIVER_INIT( dynadice )
{
int i, j;
- UINT8 *usr1 = machine.region("user1")->base();
- UINT8 *cpu2 = machine.region("audiocpu")->base();
- UINT8 *gfx1 = machine.region("gfx1")->base();
- UINT8 *gfx2 = machine.region("gfx2")->base();
+ UINT8 *usr1 = machine.root_device().memregion("user1")->base();
+ UINT8 *cpu2 = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *gfx1 = machine.root_device().memregion("gfx1")->base();
+ UINT8 *gfx2 = machine.root_device().memregion("gfx2")->base();
cpu2[0x0b] = 0x23; /* bug in game code Dec HL -> Inc HL*/
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index 40f5a625e6b..ab60a610672 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -277,7 +277,7 @@ WRITE8_MEMBER(dynax_state::jantouki_sound_rombank_w)
WRITE8_MEMBER(dynax_state::hnoridur_rombank_w)
{
- int bank_n = (machine().region("maincpu")->bytes() - 0x10000) / 0x8000;
+ int bank_n = (machine().root_device().memregion("maincpu")->bytes() - 0x10000) / 0x8000;
//logerror("%04x: rom bank = %02x\n", cpu_get_pc(&space.device()), data);
if (data < bank_n)
@@ -314,7 +314,7 @@ WRITE8_MEMBER(dynax_state::hnoridur_palette_w)
// hnoridur: R/W RAM
case 0x18:
{
- UINT8 *RAM = machine().region("maincpu")->base() + 0x10000 + m_hnoridur_bank * 0x8000;
+ UINT8 *RAM = memregion("maincpu")->base() + 0x10000 + m_hnoridur_bank * 0x8000;
RAM[offset] = data;
return;
}
@@ -749,7 +749,7 @@ READ8_MEMBER(dynax_state::yarunara_input_r)
WRITE8_MEMBER(dynax_state::yarunara_rombank_w)
{
- int bank_n = (machine().region("maincpu")->bytes() - 0x10000) / 0x8000;
+ int bank_n = (machine().root_device().memregion("maincpu")->bytes() - 0x10000) / 0x8000;
//logerror("%04x: rom bank = %02x\n", cpu_get_pc(&space.device()), data);
if (data < bank_n)
@@ -1370,7 +1370,7 @@ WRITE8_MEMBER(dynax_state::tenkai_palette_w)
static void tenkai_update_rombank( running_machine &machine )
{
dynax_state *state = machine.driver_data<dynax_state>();
- state->m_romptr = machine.region("maincpu")->base() + 0x10000 + 0x8000 * state->m_rombank;
+ state->m_romptr = state->memregion("maincpu")->base() + 0x10000 + 0x8000 * state->m_rombank;
// logerror("rombank = %02x\n", state->m_rombank);
}
@@ -1569,7 +1569,7 @@ static void gekisha_set_rombank( running_machine &machine, UINT8 data )
{
dynax_state *state = machine.driver_data<dynax_state>();
state->m_rombank = data;
- state->m_romptr = machine.region("maincpu")->base() + 0x8000 + state->m_rombank * 0x8000;
+ state->m_romptr = state->memregion("maincpu")->base() + 0x8000 + state->m_rombank * 0x8000;
}
WRITE8_MEMBER(dynax_state::gekisha_p4_w)
@@ -4239,7 +4239,7 @@ static MACHINE_RESET( dynax )
static MACHINE_START( hanamai )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x10, &ROM[0x8000], 0x8000);
MACHINE_START_CALL(dynax);
@@ -4247,8 +4247,8 @@ static MACHINE_START( hanamai )
static MACHINE_START( hnoridur )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- int bank_n = (machine.region("maincpu")->bytes() - 0x10000) / 0x8000;
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ int bank_n = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x8000;
machine.root_device().membank("bank1")->configure_entries(0, bank_n, &ROM[0x10000], 0x8000);
@@ -4257,7 +4257,7 @@ static MACHINE_START( hnoridur )
static MACHINE_START( htengoku )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000);
@@ -4630,8 +4630,8 @@ static const msm5205_interface jantouki_msm5205_interface =
static MACHINE_START( jantouki )
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *MAIN = machine.region("maincpu")->base();
- UINT8 *SOUND = machine.region("soundcpu")->base();
+ UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *SOUND = state->memregion("soundcpu")->base();
state->membank("bank1")->configure_entries(0, 0x10, &MAIN[0x8000], 0x8000);
state->membank("bank2")->configure_entries(0, 12, &SOUND[0x8000], 0x8000);
@@ -5361,7 +5361,7 @@ ROM_END
static DRIVER_INIT( blktouch )
{
// fearsome encryption ;-)
- UINT8 *src = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 *src = (UINT8 *)machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0; i < 0x90000; i++)
@@ -5370,7 +5370,7 @@ static DRIVER_INIT( blktouch )
}
- src = (UINT8 *)machine.region("gfx1")->base();
+ src = (UINT8 *)machine.root_device().memregion("gfx1")->base();
for (i = 0; i < 0xc0000; i++)
{
@@ -5383,8 +5383,8 @@ static DRIVER_INIT( maya )
{
/* Address lines scrambling on 1 z80 rom */
int i;
- UINT8 *gfx = (UINT8 *)machine.region("gfx1")->base();
- UINT8 *rom = machine.region("maincpu")->base() + 0x28000, *end = rom + 0x10000;
+ UINT8 *gfx = (UINT8 *)machine.root_device().memregion("gfx1")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base() + 0x28000, *end = rom + 0x10000;
for ( ; rom < end; rom += 8)
{
UINT8 temp[8];
@@ -6101,8 +6101,8 @@ ROM_END
static DRIVER_INIT( mjelct3 )
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *rom1 = auto_alloc_array(machine, UINT8, size);
memcpy(rom1, rom, size);
@@ -6114,8 +6114,8 @@ static DRIVER_INIT( mjelct3 )
static DRIVER_INIT( mjelct3a )
{
int i, j;
- UINT8 *rom = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *rom1 = auto_alloc_array(machine, UINT8, size);
memcpy(rom1, rom, size);
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 66744c35518..5bdb653fa97 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -208,7 +208,7 @@ static SCREEN_UPDATE_RGB32( enigma2 )
pen_t pens[NUM_PENS];
const rectangle &visarea = screen.visible_area();
- UINT8 *prom = screen.machine().region("proms")->base();
+ UINT8 *prom = state->memregion("proms")->base();
UINT8 *color_map_base = state->m_flip_screen ? &prom[0x0400] : &prom[0x0000];
UINT8 *star_map_base = (state->m_blink_count & 0x08) ? &prom[0x0c00] : &prom[0x0800];
@@ -707,7 +707,7 @@ ROM_END
static DRIVER_INIT(enigma2)
{
offs_t i;
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
for(i = 0; i < 0x2000; i++)
{
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index 55f98cccd27..c74ecf8b501 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -1309,7 +1309,7 @@ static DRIVER_INIT( landbrka )
//it fails compares with memories:
//$4002d338 -> $4002d348 .... $4002d33f -> $4002d34f
//related with bits 0x100 - 0x200 read at startup from input(0) ?
- UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
+ UINT32 *rombase = (UINT32*)state->memregion("maincpu")->base();
rombase[0x14f00/4] = (rombase[0x14f00/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
state->m_coin_counter_bit = 0x2000;
@@ -1319,7 +1319,7 @@ static DRIVER_INIT( landbrka )
static DRIVER_INIT( hidctch2 )
{
//it fails compares in memory like in landbrka
- UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
+ UINT32 *rombase = (UINT32*)machine.root_device().memregion("maincpu")->base();
rombase[0xbcc8/4] = (rombase[0xbcc8/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
init_eolith_speedup(machine);
}
diff --git a/src/mame/drivers/epos.c b/src/mame/drivers/epos.c
index 185943f8068..dca11e5fc59 100644
--- a/src/mame/drivers/epos.c
+++ b/src/mame/drivers/epos.c
@@ -381,7 +381,7 @@ static MACHINE_RESET( epos )
static MACHINE_START( dealer )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0x0000], 0x10000);
machine.root_device().membank("bank2")->configure_entries(0, 2, &ROM[0x6000], 0x1000);
@@ -607,7 +607,7 @@ ROM_END
static DRIVER_INIT( dealer )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
/* Key 0 */
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index 7fce1a23b93..e9212174c22 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -1857,7 +1857,7 @@ ROM_END
static void unpack_block( running_machine &machine, const char *region, int offset, int size )
{
- UINT8 *rom = machine.region(region)->base();
+ UINT8 *rom = machine.root_device().memregion(region)->base();
int i;
for (i = 0; i < size; ++i)
diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c
index 58569cd7132..2b4d380e8b8 100644
--- a/src/mame/drivers/esd16.c
+++ b/src/mame/drivers/esd16.c
@@ -518,7 +518,7 @@ GFXDECODE_END
static MACHINE_START( esd16 )
{
esd16_state *state = machine.driver_data<esd16_state>();
- UINT8 *AUDIO = machine.region("audiocpu")->base();
+ UINT8 *AUDIO = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 17, &AUDIO[0x0000], 0x4000);
diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c
index 30d68a46787..651fb92853d 100644
--- a/src/mame/drivers/esh.c
+++ b/src/mame/drivers/esh.c
@@ -224,7 +224,7 @@ INPUT_PORTS_END
static PALETTE_INIT( esh )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* Oddly enough, the top 4 bits of each byte is 0 */
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index 310ba3065c7..9ef89f44487 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -104,7 +104,7 @@ READ8_MEMBER(esripsys_state::g_status_r)
WRITE8_MEMBER(esripsys_state::g_status_w)
{
int bankaddress;
- UINT8 *rom = machine().region("game_cpu")->base();
+ UINT8 *rom = memregion("game_cpu")->base();
m_g_status = data;
@@ -491,7 +491,7 @@ WRITE8_MEMBER(esripsys_state::s_200e_w)
WRITE8_MEMBER(esripsys_state::s_200f_w)
{
- UINT8 *rom = machine().region("sound_data")->base();
+ UINT8 *rom = memregion("sound_data")->base();
int rombank = data & 0x20 ? 0x2000 : 0;
/* Bit 6 -> Reset latch U56A */
@@ -645,7 +645,7 @@ ADDRESS_MAP_END
static DRIVER_INIT( esripsys )
{
esripsys_state *state = machine.driver_data<esripsys_state>();
- UINT8 *rom = machine.region("sound_data")->base();
+ UINT8 *rom = state->memregion("sound_data")->base();
state->m_fdt_a = auto_alloc_array(machine, UINT8, FDT_RAM_SIZE);
state->m_fdt_b = auto_alloc_array(machine, UINT8, FDT_RAM_SIZE);
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index fb4011a838a..e8dcdabe62a 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -87,7 +87,7 @@ WRITE8_MEMBER(ettrivia_state::ettrivia_control_w)
READ8_MEMBER(ettrivia_state::ettrivia_question_r)
{
- UINT8 *QUESTIONS = machine().region("user1")->base();
+ UINT8 *QUESTIONS = memregion("user1")->base();
return QUESTIONS[offset + 0x10000 * m_question_bank];
}
@@ -215,7 +215,7 @@ static TILE_GET_INFO( get_tile_info_fg )
static PALETTE_INIT( ettrivia )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[2] = { 270, 130 };
double weights[2];
int i;
diff --git a/src/mame/drivers/exerion.c b/src/mame/drivers/exerion.c
index 3f1fbd02b14..b25944ef8e5 100644
--- a/src/mame/drivers/exerion.c
+++ b/src/mame/drivers/exerion.c
@@ -165,7 +165,7 @@ static WRITE8_DEVICE_HANDLER( exerion_portb_w )
{
exerion_state *state = device->machine().driver_data<exerion_state>();
/* pull the expected value from the ROM */
- state->m_porta = device->machine().region("maincpu")->base()[0x5f76];
+ state->m_porta = state->memregion("maincpu")->base()[0x5f76];
state->m_portb = data;
logerror("Port B = %02X\n", data);
@@ -175,7 +175,7 @@ static WRITE8_DEVICE_HANDLER( exerion_portb_w )
READ8_MEMBER(exerion_state::exerion_protection_r)
{
if (cpu_get_pc(&space.device()) == 0x4143)
- return machine().region("maincpu")->base()[0x33c0 + (m_main_ram[0xd] << 2) + offset];
+ return memregion("maincpu")->base()[0x33c0 + (m_main_ram[0xd] << 2) + offset];
else
return m_main_ram[0x8 + offset];
}
@@ -558,8 +558,8 @@ static DRIVER_INIT( exerion )
/* make a temporary copy of the character data */
src = temp;
- dst = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ dst = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -576,8 +576,8 @@ static DRIVER_INIT( exerion )
/* make a temporary copy of the sprite data */
src = temp;
- dst = machine.region("gfx2")->base();
- length = machine.region("gfx2")->bytes();
+ dst = machine.root_device().memregion("gfx2")->base();
+ length = machine.root_device().memregion("gfx2")->bytes();
memcpy(src, dst, length);
/* decode the sprites */
@@ -599,7 +599,7 @@ static DRIVER_INIT( exerion )
static DRIVER_INIT( exerionb )
{
- UINT8 *ram = machine.region("maincpu")->base();
+ UINT8 *ram = machine.root_device().memregion("maincpu")->base();
int addr;
/* the program ROMs have data lines D1 and D2 swapped. Decode them. */
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index 97ddc037ad0..7dd1aa5b9b2 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -185,7 +185,7 @@ CUSTOM_INPUT_MEMBER(exidy_state::teetert_input_r)
WRITE8_MEMBER(exidy_state::fax_bank_select_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
membank("bank1")->set_base(&RAM[0x10000 + (0x2000 * (data & 0x1f))]);
if ((data & 0x1f) > 0x17)
@@ -1470,7 +1470,7 @@ static DRIVER_INIT( phantoma )
/* the ROM is actually mapped high */
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xf800, 0xffff, "bank1");
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0xf800);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0xf800);
}
diff --git a/src/mame/drivers/exidy440.c b/src/mame/drivers/exidy440.c
index 35a945e9225..be9de4bd273 100644
--- a/src/mame/drivers/exidy440.c
+++ b/src/mame/drivers/exidy440.c
@@ -308,7 +308,7 @@ void exidy440_bank_select(running_machine &machine, UINT8 bank)
/* select the bank and update the bank pointer */
state->m_bank = bank;
- state->membank("bank1")->set_base(&machine.region("maincpu")->base()[0x10000 + state->m_bank * 0x4000]);
+ state->membank("bank1")->set_base(&machine.root_device().memregion("maincpu")->base()[0x10000 + state->m_bank * 0x4000]);
}
@@ -317,7 +317,7 @@ WRITE8_MEMBER(exidy440_state::bankram_w)
/* EEROM lives in the upper 8k of bank 15 */
if (m_bank == 15 && offset >= 0x2000)
{
- machine().region("maincpu")->base()[0x10000 + 15 * 0x4000 + offset] = data;
+ memregion("maincpu")->base()[0x10000 + 15 * 0x4000 + offset] = data;
logerror("W EEROM[%04X] = %02X\n", offset - 0x2000, data);
}
@@ -445,7 +445,7 @@ static MACHINE_START( exidy440 )
{
exidy440_state *state = machine.driver_data<exidy440_state>();
/* the EEROM lives in the uppermost 8k of the top bank */
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->m_custom = machine.device("custom");
machine.device<nvram_device>("nvram")->set_base(&rom[0x10000 + 15 * 0x4000 + 0x2000], 0x2000);
diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c
index 88c83605985..a389e6757a7 100644
--- a/src/mame/drivers/expro02.c
+++ b/src/mame/drivers/expro02.c
@@ -314,7 +314,7 @@ WRITE16_MEMBER(expro02_state::galsnew_6295_bankswitch_w)
{
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = machine().region("oki")->base();
+ UINT8 *rom = memregion("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
}
}
@@ -751,8 +751,8 @@ ROM_END
static DRIVER_INIT(galsnew)
{
- UINT32 *src = (UINT32 *)machine.region("gfx3" )->base();
- UINT32 *dst = (UINT32 *)machine.region("gfx2" )->base();
+ UINT32 *src = (UINT32 *)machine.root_device().memregion("gfx3" )->base();
+ UINT32 *dst = (UINT32 *)machine.root_device().memregion("gfx2" )->base();
int x, offset;
diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c
index 52941743d23..0f458c7e02c 100644
--- a/src/mame/drivers/exprraid.c
+++ b/src/mame/drivers/exprraid.c
@@ -732,7 +732,7 @@ static void exprraid_gfx_expand(running_machine &machine)
{
/* Expand the background rom so we can use regular decode routines */
- UINT8 *gfx = machine.region("gfx3")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
int offs = 0x10000 - 0x1000;
int i;
@@ -751,7 +751,7 @@ static void exprraid_gfx_expand(running_machine &machine)
static DRIVER_INIT( wexpress )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* HACK: this set uses M6502 irq vectors but DECO CPU-16 opcodes??? */
rom[0xfff7] = rom[0xfffa];
diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c
index 58aa8df2e00..7c47949b44c 100644
--- a/src/mame/drivers/exzisus.c
+++ b/src/mame/drivers/exzisus.c
@@ -48,7 +48,7 @@ TODO:
WRITE8_MEMBER(exzisus_state::exzisus_cpua_bankswitch_w)
{
- UINT8 *RAM = machine().region("cpua")->base();
+ UINT8 *RAM = memregion("cpua")->base();
if ( (data & 0x0f) != m_cpua_bank )
{
@@ -64,7 +64,7 @@ WRITE8_MEMBER(exzisus_state::exzisus_cpua_bankswitch_w)
WRITE8_MEMBER(exzisus_state::exzisus_cpub_bankswitch_w)
{
- UINT8 *RAM = machine().region("cpub")->base();
+ UINT8 *RAM = memregion("cpub")->base();
if ( (data & 0x0f) != m_cpub_bank )
{
@@ -117,7 +117,7 @@ WRITE8_MEMBER(exzisus_state::exzisus_cpub_reset_w)
// the RAM check to work
static DRIVER_INIT( exzisus )
{
- UINT8 *RAM = machine.region("cpua")->base();
+ UINT8 *RAM = machine.root_device().memregion("cpua")->base();
/* Fix WORK RAM error */
RAM[0x67fd] = 0x18;
diff --git a/src/mame/drivers/f1gp.c b/src/mame/drivers/f1gp.c
index 9f6e2db8f42..3b5f0edfe77 100644
--- a/src/mame/drivers/f1gp.c
+++ b/src/mame/drivers/f1gp.c
@@ -43,7 +43,7 @@ WRITE16_MEMBER(f1gp_state::sharedram_w)
READ16_MEMBER(f1gp_state::extrarom_r)
{
- UINT8 *rom = machine().region("user1")->base();
+ UINT8 *rom = memregion("user1")->base();
offset *= 2;
@@ -52,7 +52,7 @@ READ16_MEMBER(f1gp_state::extrarom_r)
READ16_MEMBER(f1gp_state::extrarom2_r)
{
- UINT8 *rom = machine().region("user2")->base();
+ UINT8 *rom = memregion("user2")->base();
offset *= 2;
@@ -166,8 +166,8 @@ WRITE16_MEMBER(f1gp_state::f1gpb_misc_w)
if(old_bank != new_bank && new_bank < 5)
{
// oki banking
- UINT8 *src = machine().region("oki")->base() + 0x40000 + 0x10000 * new_bank;
- UINT8 *dst = machine().region("oki")->base() + 0x30000;
+ UINT8 *src = memregion("oki")->base() + 0x40000 + 0x10000 * new_bank;
+ UINT8 *dst = memregion("oki")->base() + 0x30000;
memcpy(dst, src, 0x10000);
old_bank = new_bank;
@@ -427,7 +427,7 @@ static MACHINE_START( f1gpb )
static MACHINE_START( f1gp )
{
f1gp_state *state = machine.driver_data<f1gp_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x8000);
diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c
index dd2e85dee88..62a3fbaf7f1 100644
--- a/src/mame/drivers/famibox.c
+++ b/src/mame/drivers/famibox.c
@@ -257,9 +257,9 @@ static void famicombox_bankswitch(running_machine &machine, UINT8 bank)
if ( bank == famicombox_banks[i].bank ||
famicombox_banks[i].bank == 0 )
{
- machine.root_device().membank("cpubank1")->set_base(machine.region(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank1_offset);
- machine.root_device().membank("cpubank2")->set_base(machine.region(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank2_offset);
- machine.root_device().membank("ppubank1")->set_base(machine.region(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].ppubank_offset);
+ machine.root_device().membank("cpubank1")->set_base(machine.root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank1_offset);
+ machine.root_device().membank("cpubank2")->set_base(machine.root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank2_offset);
+ machine.root_device().membank("ppubank1")->set_base(machine.root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].ppubank_offset);
break;
}
}
diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c
index ca678469067..daf3ac136fb 100644
--- a/src/mame/drivers/fantland.c
+++ b/src/mame/drivers/fantland.c
@@ -368,8 +368,8 @@ static void borntofi_adpcm_int( device_t *device, int voice )
if (!state->m_adpcm_playing[voice])
return;
- rom = device->machine().region("adpcm")->base();
- len = device->machine().region("adpcm")->bytes() * 2;
+ rom = device->machine().root_device().memregion("adpcm")->base();
+ len = state->memregion("adpcm")->bytes() * 2;
start = state->m_adpcm_addr[0][voice] + state->m_adpcm_nibble[voice];
stop = state->m_adpcm_addr[1][voice];
diff --git a/src/mame/drivers/fastfred.c b/src/mame/drivers/fastfred.c
index fa0a5c2cd2b..935267c1dc4 100644
--- a/src/mame/drivers/fastfred.c
+++ b/src/mame/drivers/fastfred.c
@@ -142,7 +142,7 @@ WRITE8_MEMBER(fastfred_state::imago_sprites_bank_w)
WRITE8_MEMBER(fastfred_state::imago_sprites_dma_w)
{
- UINT8 *rom = (UINT8 *)machine().region("gfx2")->base();
+ UINT8 *rom = (UINT8 *)machine().root_device().memregion("gfx2")->base();
UINT8 sprites_data;
sprites_data = rom[m_imago_sprites_address + 0x2000*0 + m_imago_sprites_bank * 0x1000];
diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c
index 36e048a6d28..4f60d6a0412 100644
--- a/src/mame/drivers/fastlane.c
+++ b/src/mame/drivers/fastlane.c
@@ -194,7 +194,7 @@ static const k007232_interface k007232_interface_2 =
static MACHINE_START( fastlane )
{
fastlane_state *state = machine.driver_data<fastlane_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/fcombat.c b/src/mame/drivers/fcombat.c
index adaae371c98..1c69aa3e049 100644
--- a/src/mame/drivers/fcombat.c
+++ b/src/mame/drivers/fcombat.c
@@ -100,7 +100,7 @@ READ8_MEMBER(fcombat_state::e300_r)
int wx = (m_tx + m_fcombat_sh) / 16;
int wy = (m_ty * 2 + m_fcombat_sv) / 16;
- return machine().region("user2")->base()[wx * 32 * 16 + wy];
+ return memregion("user2")->base()[wx * 32 * 16 + wy];
}
WRITE8_MEMBER(fcombat_state::ee00_w)
@@ -339,8 +339,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ dst = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -357,8 +357,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the sprite data */
src = temp;
- dst = machine.region("gfx2")->base();
- length = machine.region("gfx2")->bytes();
+ dst = machine.root_device().memregion("gfx2")->base();
+ length = machine.root_device().memregion("gfx2")->bytes();
memcpy(src, dst, length);
/* decode the sprites */
@@ -378,8 +378,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine.region("gfx3")->base();
- length = machine.region("gfx3")->bytes();
+ dst = machine.root_device().memregion("gfx3")->base();
+ length = machine.root_device().memregion("gfx3")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -397,8 +397,8 @@ static DRIVER_INIT( fcombat )
}
src = temp;
- dst = machine.region("user1")->base();
- length = machine.region("user1")->bytes();
+ dst = machine.root_device().memregion("user1")->base();
+ length = machine.root_device().memregion("user1")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)
@@ -409,8 +409,8 @@ static DRIVER_INIT( fcombat )
src = temp;
- dst = machine.region("user2")->base();
- length = machine.region("user2")->bytes();
+ dst = machine.root_device().memregion("user2")->base();
+ length = machine.root_device().memregion("user2")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)
diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c
index 81e972948e9..38c32028e75 100644
--- a/src/mame/drivers/fcrash.c
+++ b/src/mame/drivers/fcrash.c
@@ -693,7 +693,7 @@ static const msm5205_interface msm5205_interface2 =
static MACHINE_START( fcrash )
{
cps_state *state = machine.driver_data<cps_state>();
- UINT8 *ROM = machine.region("soundcpu")->base();
+ UINT8 *ROM = state->memregion("soundcpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/feversoc.c b/src/mame/drivers/feversoc.c
index b1dc4de8ff5..710198dec9f 100644
--- a/src/mame/drivers/feversoc.c
+++ b/src/mame/drivers/feversoc.c
@@ -298,7 +298,7 @@ ROM_END
static DRIVER_INIT( feversoc )
{
- seibuspi_rise11_sprite_decrypt_feversoc(machine.region("gfx1")->base(), 0x200000);
+ seibuspi_rise11_sprite_decrypt_feversoc(machine.root_device().memregion("gfx1")->base(), 0x200000);
}
GAME( 2004, feversoc, 0, feversoc, feversoc, feversoc, ROT0, "Seibu Kaihatsu", "Fever Soccer", 0 )
diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c
index f2044ba48ac..6b0ca694f1f 100644
--- a/src/mame/drivers/fgoal.c
+++ b/src/mame/drivers/fgoal.c
@@ -47,7 +47,7 @@ static int intensity(int bits)
static PALETTE_INIT( fgoal )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* for B/W screens PCB can be jumpered to use lower half of PROM */
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index cbbcf905999..3f903ac1e36 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -1956,7 +1956,7 @@ static MACHINE_RESET( firebeat )
firebeat_state *state = machine.driver_data<firebeat_state>();
void *cd;
int i;
- UINT8 *sound = machine.region("ymz")->base();
+ UINT8 *sound = state->memregion("ymz")->base();
for (i=0; i < 0x200000; i++)
{
@@ -2225,7 +2225,7 @@ static void init_lights(running_machine &machine, write32_space_func out1, const
static void init_firebeat(running_machine &machine)
{
firebeat_state *state = machine.driver_data<firebeat_state>();
- UINT8 *rom = machine.region("user2")->base();
+ UINT8 *rom = state->memregion("user2")->base();
atapi_init(machine);
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index 9d19651afcb..8c48f1486d9 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -481,7 +481,7 @@ static void firq_gen(running_machine &machine, phillips_22vp931_device &laserdis
static MACHINE_START( firefox )
{
firefox_state *state = machine.driver_data<firefox_state>();
- state->membank("bank1")->configure_entries(0, 32, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ state->membank("bank1")->configure_entries(0, 32, state->memregion("maincpu")->base() + 0x10000, 0x1000);
state->m_nvram_1c = machine.device<x2212_device>("nvram_1c");
state->m_nvram_1d = machine.device<x2212_device>("nvram_1d");
diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c
index ce4d175394a..a495d6011aa 100644
--- a/src/mame/drivers/firetrap.c
+++ b/src/mame/drivers/firetrap.c
@@ -593,8 +593,8 @@ static INTERRUPT_GEN( firetrap_irq )
static MACHINE_START( firetrap )
{
firetrap_state *state = machine.driver_data<firetrap_state>();
- UINT8 *MAIN = machine.region("maincpu")->base();
- UINT8 *SOUND = machine.region("audiocpu")->base();
+ UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *SOUND = state->memregion("audiocpu")->base();
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/fitfight.c b/src/mame/drivers/fitfight.c
index 9c22ea7fbed..a89a8f73f76 100644
--- a/src/mame/drivers/fitfight.c
+++ b/src/mame/drivers/fitfight.c
@@ -1002,7 +1002,7 @@ ROM_END
static DRIVER_INIT( fitfight )
{
-// UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+// UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// mem16[0x0165B2/2] = 0x4e71; // for now so it boots
fitfight_state *state = machine.driver_data<fitfight_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x700000, 0x700001, read16_delegate(FUNC(fitfight_state::fitfight_700000_r),state));
@@ -1011,7 +1011,7 @@ static DRIVER_INIT( fitfight )
static DRIVER_INIT( histryma )
{
-// UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+// UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// mem16[0x017FDC/2] = 0x4e71; // for now so it boots
fitfight_state *state = machine.driver_data<fitfight_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x700000, 0x700001, read16_delegate(FUNC(fitfight_state::histryma_700000_r),state));
diff --git a/src/mame/drivers/flkatck.c b/src/mame/drivers/flkatck.c
index be985fba890..f8b3eff010a 100644
--- a/src/mame/drivers/flkatck.c
+++ b/src/mame/drivers/flkatck.c
@@ -195,7 +195,7 @@ static const k007232_interface k007232_config =
static MACHINE_START( flkatck )
{
flkatck_state *state = machine.driver_data<flkatck_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 3, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c
index 382e786d25b..f92be725a2a 100644
--- a/src/mame/drivers/flyball.c
+++ b/src/mame/drivers/flyball.c
@@ -389,7 +389,7 @@ static MACHINE_RESET( flyball )
int i;
/* address bits 0 through 8 are inverted */
- UINT8* ROM = machine.region("maincpu")->base() + 0x2000;
+ UINT8* ROM = state->memregion("maincpu")->base() + 0x2000;
for (i = 0; i < 0x1000; i++)
state->m_rombase[i] = ROM[i ^ 0x1ff];
diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c
index 6644bb1a7f7..9dbce97e5a5 100644
--- a/src/mame/drivers/forte2.c
+++ b/src/mame/drivers/forte2.c
@@ -144,8 +144,8 @@ MACHINE_CONFIG_END
static DRIVER_INIT(pesadelo)
{
int i;
- UINT8 *mem = machine.region("maincpu")->base();
- int memsize = machine.region("maincpu")->bytes();
+ UINT8 *mem = machine.root_device().memregion("maincpu")->base();
+ int memsize = machine.root_device().memregion("maincpu")->bytes();
UINT8 *buf;
// data swap
diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c
index 9592709e9d8..45db24a7e7e 100644
--- a/src/mame/drivers/fortecar.c
+++ b/src/mame/drivers/fortecar.c
@@ -372,7 +372,7 @@ static SCREEN_UPDATE_IND16(fortecar)
static PALETTE_INIT( fortecar )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* Video resistors...
O1 (LS374) R1K RED
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index 2f02722bb80..7be573f7a1b 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -509,7 +509,7 @@ static WRITE8_DEVICE_HANDLER( snd_rom_addr_h_w )
static READ8_DEVICE_HANDLER( snd_rom_r )
{
freekick_state *state = device->machine().driver_data<freekick_state>();
- return device->machine().region("user1")->base()[state->m_romaddr & 0x7fff];
+ return state->memregion("user1")->base()[state->m_romaddr & 0x7fff];
}
static const ppi8255_interface ppi8255_intf[2] =
@@ -599,7 +599,7 @@ static MACHINE_RESET( freekick )
static MACHINE_START( pbillrd )
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
MACHINE_START_CALL(freekick);
}
@@ -1100,7 +1100,7 @@ ROM_END
static DRIVER_INIT(gigasb)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0xbfff, machine.region("maincpu")->base() + 0x10000);
+ space->set_decrypted_region(0x0000, 0xbfff, machine.root_device().memregion("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c
index fd5b7869bcc..b9038ed4eda 100644
--- a/src/mame/drivers/fromanc2.c
+++ b/src/mame/drivers/fromanc2.c
@@ -524,9 +524,9 @@ static MACHINE_START( fromanc2 )
{
fromanc2_state *state = machine.driver_data<fromanc2_state>();
- state->membank("bank1")->configure_entries(0, 4, machine.region("sub")->base(), 0x4000);
- state->membank("bank2")->configure_entry(0, machine.region("sub")->base() + 0x08000);
- state->membank("bank2")->configure_entries(1, 3, machine.region("sub")->base() + 0x14000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("sub")->base(), 0x4000);
+ state->membank("bank2")->configure_entry(0, machine.root_device().memregion("sub")->base() + 0x08000);
+ state->membank("bank2")->configure_entries(1, 3, state->memregion("sub")->base() + 0x14000, 0x4000);
MACHINE_START_CALL(fromanc4);
diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c
index 713bccd4109..6fba7c8b44e 100644
--- a/src/mame/drivers/fromance.c
+++ b/src/mame/drivers/fromance.c
@@ -954,7 +954,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( fromance )
{
fromance_state *state = machine.driver_data<fromance_state>();
- UINT8 *ROM = machine.region("sub")->base();
+ UINT8 *ROM = state->memregion("sub")->base();
state->membank("bank1")->configure_entries(0, 0x100, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/funkball.c b/src/mame/drivers/funkball.c
index 855f6dd1c63..4140f92f93b 100644
--- a/src/mame/drivers/funkball.c
+++ b/src/mame/drivers/funkball.c
@@ -490,7 +490,7 @@ READ8_MEMBER( funkball_state::flash_data_r )
if(m_flash_data_cmd == 0xff)
{
- UINT8 *ROM = machine().region(m_flash_cmd & 0x80 ? "prg_flash" : "data_flash")->base();
+ UINT8 *ROM = memregion(m_flash_cmd & 0x80 ? "prg_flash" : "data_flash")->base();
return ROM[offset + (m_flash_addr << 16)];
}
@@ -536,7 +536,7 @@ WRITE32_MEMBER(funkball_state::biu_ctrl_w)
if (data & 0x1 << i*4) // enable RAM access to region 0xe0000 - 0xfffff
membank(banknames[i])->set_base(m_bios_ram + (0x4000 * i));
else // disable RAM access (reads go to BIOS ROM)
- membank(banknames[i])->set_base(machine().region("bios")->base() + (0x4000 * i));
+ membank(banknames[i])->set_base(machine().root_device().memregion("bios")->base() + (0x4000 * i));
}
}
}
@@ -1118,14 +1118,14 @@ static MACHINE_START( funkball )
static MACHINE_RESET( funkball )
{
funkball_state *state = machine.driver_data<funkball_state>();
- state->membank("bios_ext1")->set_base(machine.region("bios")->base() + 0x00000);
- state->membank("bios_ext2")->set_base(machine.region("bios")->base() + 0x04000);
- state->membank("bios_ext3")->set_base(machine.region("bios")->base() + 0x08000);
- state->membank("bios_ext4")->set_base(machine.region("bios")->base() + 0x0c000);
- state->membank("bios_bank1")->set_base(machine.region("bios")->base() + 0x10000);
- state->membank("bios_bank2")->set_base(machine.region("bios")->base() + 0x14000);
- state->membank("bios_bank3")->set_base(machine.region("bios")->base() + 0x18000);
- state->membank("bios_bank4")->set_base(machine.region("bios")->base() + 0x1c000);
+ state->membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0x00000);
+ state->membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x04000);
+ state->membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x08000);
+ state->membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0x0c000);
+ state->membank("bios_bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
+ state->membank("bios_bank2")->set_base(machine.root_device().memregion("bios")->base() + 0x14000);
+ state->membank("bios_bank3")->set_base(machine.root_device().memregion("bios")->base() + 0x18000);
+ state->membank("bios_bank4")->set_base(state->memregion("bios")->base() + 0x1c000);
state->m_voodoo_pci_regs.base_addr = 0xff000000;
}
diff --git a/src/mame/drivers/funworld.c b/src/mame/drivers/funworld.c
index c8b3db75263..f5800b15c32 100644
--- a/src/mame/drivers/funworld.c
+++ b/src/mame/drivers/funworld.c
@@ -867,7 +867,7 @@ static UINT8 funquiz_question_bank = 0x80;
READ8_MEMBER(funworld_state::questions_r)
{
- UINT8* quiz = machine().region("questions")->base();
+ UINT8* quiz = memregion("questions")->base();
int extraoffset = ((funquiz_question_bank & 0x1f) * 0x8000);
// if 0x80 is set, read the 2nd half of the question rom (contains header info)
@@ -4346,7 +4346,7 @@ static DRIVER_INIT( tabblue )
*****************************************************************************************************/
int x, na, nb, nad, nbd;
- UINT8 *src = machine.region( "gfx1" )->base();
+ UINT8 *src = machine.root_device().memregion( "gfx1" )->base();
for (x=0x0000; x < 0x10000; x++)
@@ -4376,7 +4376,7 @@ static DRIVER_INIT( magicd2a )
******************************************************************/
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xc1c6] = 0x92;
}
@@ -4385,8 +4385,8 @@ static DRIVER_INIT( magicd2b )
/*** same as blue TAB PCB, with the magicd2a patch ***/
{
int x, na, nb, nad, nbd;
- UINT8 *src = machine.region( "gfx1" )->base();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion( "gfx1" )->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (x=0x0000; x < 0x10000; x++)
{
@@ -4405,7 +4405,7 @@ static DRIVER_INIT( magicd2b )
static DRIVER_INIT( soccernw )
{
/* temporary patch to avoid hardware errors for debug purposes */
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x80b2] = 0xa9;
ROM[0x80b3] = 0x00;
@@ -4440,16 +4440,16 @@ static DRIVER_INIT( saloon )
*************************************************/
{
- UINT8 *rom = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
int start = 0x8000;
- UINT8 *gfxrom = machine.region("gfx1")->base();
- int sizeg = machine.region("gfx1")->bytes();
+ UINT8 *gfxrom = machine.root_device().memregion("gfx1")->base();
+ int sizeg = machine.root_device().memregion("gfx1")->bytes();
int startg = 0;
- UINT8 *prom = machine.region("proms")->base();
- int sizep = machine.region("proms")->bytes();
+ UINT8 *prom = machine.root_device().memregion("proms")->base();
+ int sizep = machine.root_device().memregion("proms")->bytes();
int startp = 0;
UINT8 *buffer;
@@ -4534,7 +4534,7 @@ static DRIVER_INIT( multiwin )
******************************************************/
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4553,7 +4553,7 @@ static DRIVER_INIT( multiwin )
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x8000, 0xffff, machine.region("maincpu")->base() + 0x18000);
+ space->set_decrypted_region(0x8000, 0xffff, machine.root_device().memregion("maincpu")->base() + 0x18000);
}
static DRIVER_INIT( royalcdc )
@@ -4567,7 +4567,7 @@ static DRIVER_INIT( royalcdc )
******************************************************/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4606,7 +4606,7 @@ static DRIVER_INIT( royalcdc )
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x6000, 0xffff, machine.region("maincpu")->base() + 0x16000);
+ space->set_decrypted_region(0x6000, 0xffff, machine.root_device().memregion("maincpu")->base() + 0x16000);
}
diff --git a/src/mame/drivers/funybubl.c b/src/mame/drivers/funybubl.c
index e4ff35faa27..57f836b362f 100644
--- a/src/mame/drivers/funybubl.c
+++ b/src/mame/drivers/funybubl.c
@@ -202,7 +202,7 @@ GFXDECODE_END
static MACHINE_START( funybubl )
{
funybubl_state *state = machine.driver_data<funybubl_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c
index 47e2fdf0ca8..19322d8cc86 100644
--- a/src/mame/drivers/fuukifg2.c
+++ b/src/mame/drivers/fuukifg2.c
@@ -441,7 +441,7 @@ static TIMER_CALLBACK( raster_interrupt_callback )
static MACHINE_START( fuuki16 )
{
fuuki16_state *state = machine.driver_data<fuuki16_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 3, &ROM[0x10000], 0x8000);
diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c
index d73308c55c4..956ce5ea82c 100644
--- a/src/mame/drivers/fuukifg3.c
+++ b/src/mame/drivers/fuukifg3.c
@@ -550,7 +550,7 @@ static TIMER_CALLBACK( raster_interrupt_callback )
static MACHINE_START( fuuki32 )
{
fuuki32_state *state = machine.driver_data<fuuki32_state>();
- UINT8 *ROM = machine.region("soundcpu")->base();
+ UINT8 *ROM = state->memregion("soundcpu")->base();
state->membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000);
diff --git a/src/mame/drivers/gaelco.c b/src/mame/drivers/gaelco.c
index 4b989f356ec..6111c9801d6 100644
--- a/src/mame/drivers/gaelco.c
+++ b/src/mame/drivers/gaelco.c
@@ -61,7 +61,7 @@ WRITE16_MEMBER(gaelco_state::bigkarnk_coin_w)
WRITE16_MEMBER(gaelco_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7)
{
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index 1b12b691937..0f181ddaea5 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -206,7 +206,7 @@ static MACHINE_RESET( common )
state->m_framenum = 0;
/* boot the ADSP chip */
- src = (UINT16 *)machine.region("user1")->base();
+ src = (UINT16 *)state->memregion("user1")->base();
for (i = 0; i < (src[3] & 0xff) * 8; i++)
{
UINT32 opcode = ((src[i*4+0] & 0xff) << 16) | ((src[i*4+1] & 0xff) << 8) | (src[i*4+2] & 0xff);
@@ -216,7 +216,7 @@ static MACHINE_RESET( common )
/* allocate a timer for feeding the autobuffer */
state->m_adsp_autobuffer_timer = machine.device<timer_device>("adsp_timer");
- state->membank("bank1")->configure_entries(0, 256, machine.region("user1")->base(), 0x4000);
+ state->membank("bank1")->configure_entries(0, 256, machine.root_device().memregion("user1")->base(), 0x4000);
state->membank("bank1")->set_entry(0);
/* keep the TMS32031 halted until the code is ready to go */
diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c
index cf3124b42be..93712cba68f 100644
--- a/src/mame/drivers/gaiden.c
+++ b/src/mame/drivers/gaiden.c
@@ -1519,8 +1519,8 @@ static DRIVER_INIT( raiga )
static void descramble_drgnbowl_gfx(running_machine &machine)
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *buffer = auto_alloc_array(machine, UINT8, size);
memcpy(buffer, ROM, size);
@@ -1536,8 +1536,8 @@ static void descramble_drgnbowl_gfx(running_machine &machine)
auto_free(machine, buffer);
- ROM = machine.region("gfx2")->base();
- size = machine.region("gfx2")->bytes();
+ ROM = machine.root_device().memregion("gfx2")->base();
+ size = machine.root_device().memregion("gfx2")->bytes();
buffer = auto_alloc_array(machine, UINT8, size);
memcpy(buffer,ROM,size);
@@ -1607,8 +1607,8 @@ static void descramble_mastninj_gfx(running_machine &machine, UINT8* src)
static DRIVER_INIT(mastninj)
{
// rearrange the graphic roms into a format that MAME can decode
- descramble_mastninj_gfx(machine, machine.region("gfx2")->base());
- descramble_mastninj_gfx(machine, machine.region("gfx3")->base());
+ descramble_mastninj_gfx(machine, machine.root_device().memregion("gfx2")->base());
+ descramble_mastninj_gfx(machine, machine.root_device().memregion("gfx3")->base());
DRIVER_INIT_CALL(shadoww);
}
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index aaba405db4b..13551f7b783 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -809,7 +809,7 @@ static const namco_51xx_interface namco_51xx_intf =
static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
{
- UINT32 length = device->machine().region("52xx")->bytes();
+ UINT32 length = device->machine().root_device().memregion("52xx")->bytes();
//printf("ROM read %04X\n", offset);
if (!(offset & 0x1000))
offset = (offset & 0xfff) | 0x0000;
@@ -819,7 +819,7 @@ static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
offset = (offset & 0xfff) | 0x2000;
else if (!(offset & 0x8000))
offset = (offset & 0xfff) | 0x3000;
- return (offset < length) ? device->machine().region("52xx")->base()[offset] : 0xff;
+ return (offset < length) ? device->machine().root_device().memregion("52xx")->base()[offset] : 0xff;
}
static READ8_DEVICE_HANDLER( namco_52xx_si_r )
@@ -3260,8 +3260,8 @@ ROM_END
static DRIVER_INIT (galaga)
{
/* swap bytes for flipped character so we can decode them together with normal characters */
- UINT8 *rom = machine.region("gfx1")->base();
- int i, len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int i, len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0;i < len;i++)
{
@@ -3289,7 +3289,7 @@ static DRIVER_INIT( xevious )
UINT8 *rom;
int i;
- rom = machine.region("gfx3")->base() + 0x5000;
+ rom = machine.root_device().memregion("gfx3")->base() + 0x5000;
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] >> 4;
}
@@ -3301,14 +3301,14 @@ static DRIVER_INIT( xevios )
/* convert one of the sprite ROMs to the format used by Xevious */
- rom = machine.region("gfx3")->base();
+ rom = machine.root_device().memregion("gfx3")->base();
for (A = 0x5000;A < 0x7000;A++)
{
rom[A] = BITSWAP8(rom[A],1,3,5,7,0,2,4,6);
}
/* convert one of tile map ROMs to the format used by Xevious */
- rom = machine.region("gfx4")->base();
+ rom = machine.root_device().memregion("gfx4")->base();
for (A = 0x0000;A < 0x1000;A++)
{
rom[A] = BITSWAP8(rom[A],3,7,5,1,2,6,4,0);
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index fb2f8a3e960..9621e6f2c07 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -843,7 +843,7 @@ static void monsterz_set_latch(running_machine &machine)
{
// read from a rom (which one?? "a-3e.k3" from audiocpu ($2700-$2fff) looks very suspicious)
galaxian_state *state = machine.driver_data<galaxian_state>();
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = state->memregion("audiocpu")->base();
state->m_protection_result = rom[0x2000 | (state->m_protection_state & 0x1fff)]; // probably needs a BITSWAP8
// and an irq on the main z80 afterwards
@@ -2533,7 +2533,7 @@ MACHINE_CONFIG_END
static void decode_mooncrst(running_machine &machine, int length, UINT8 *dest)
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int offs;
for (offs = 0; offs < length; offs++)
@@ -2595,8 +2595,8 @@ static void decode_checkman(running_machine &machine)
{ 0,2,0,2 },
{ 1,4,1,4 }
};
- UINT8 *rombase = machine.region("maincpu")->base();
- UINT32 romlength = machine.region("maincpu")->bytes();
+ UINT8 *rombase = machine.root_device().memregion("maincpu")->base();
+ UINT32 romlength = machine.root_device().memregion("maincpu")->bytes();
UINT32 offs;
for (offs = 0; offs < romlength; offs++)
@@ -2612,8 +2612,8 @@ static void decode_checkman(running_machine &machine)
static void decode_dingoe(running_machine &machine)
{
- UINT8 *rombase = machine.region("maincpu")->base();
- UINT32 romlength = machine.region("maincpu")->bytes();
+ UINT8 *rombase = machine.root_device().memregion("maincpu")->base();
+ UINT32 romlength = machine.root_device().memregion("maincpu")->bytes();
UINT32 offs;
for (offs = 0; offs < romlength; offs++)
@@ -2635,7 +2635,7 @@ static void decode_dingoe(running_machine &machine)
static void decode_frogger_sound(running_machine &machine)
{
- UINT8 *rombase = machine.region("audiocpu")->base();
+ UINT8 *rombase = machine.root_device().memregion("audiocpu")->base();
UINT32 offs;
/* the first ROM of the sound CPU has data lines D0 and D1 swapped */
@@ -2646,7 +2646,7 @@ static void decode_frogger_sound(running_machine &machine)
static void decode_frogger_gfx(running_machine &machine)
{
- UINT8 *rombase = machine.region("gfx1")->base();
+ UINT8 *rombase = machine.root_device().memregion("gfx1")->base();
UINT32 offs;
/* the 2nd gfx ROM has data lines D0 and D1 swapped */
@@ -2657,8 +2657,8 @@ static void decode_frogger_gfx(running_machine &machine)
static void decode_anteater_gfx(running_machine &machine)
{
- UINT32 romlength = machine.region("gfx1")->bytes();
- UINT8 *rombase = machine.region("gfx1")->base();
+ UINT32 romlength = machine.root_device().memregion("gfx1")->bytes();
+ UINT8 *rombase = machine.root_device().memregion("gfx1")->base();
UINT8 *scratch = auto_alloc_array(machine, UINT8, romlength);
UINT32 offs;
@@ -2677,8 +2677,8 @@ static void decode_anteater_gfx(running_machine &machine)
static void decode_losttomb_gfx(running_machine &machine)
{
- UINT32 romlength = machine.region("gfx1")->bytes();
- UINT8 *rombase = machine.region("gfx1")->base();
+ UINT32 romlength = machine.root_device().memregion("gfx1")->bytes();
+ UINT8 *rombase = machine.root_device().memregion("gfx1")->base();
UINT8 *scratch = auto_alloc_array(machine, UINT8, romlength);
UINT32 offs;
@@ -2702,7 +2702,7 @@ static void decode_superbon(running_machine &machine)
/* Deryption worked out by hand by Chris Hardy. */
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x1000;i++)
{
@@ -2810,7 +2810,7 @@ static DRIVER_INIT( gmgalax )
/* ROM is banked */
space->install_read_bank(0x0000, 0x3fff, "bank1");
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x10000, 0x4000);
/* callback when the game select is toggled */
state->gmgalax_game_changed(*machine.m_portlist.first()->fieldlist().first(), NULL, 0, 0);
@@ -2869,7 +2869,7 @@ static DRIVER_INIT( mooncrst )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* decrypt program code */
- decode_mooncrst(machine, 0x8000, machine.region("maincpu")->base());
+ decode_mooncrst(machine, 0x8000, machine.root_device().memregion("maincpu")->base());
}
@@ -2939,15 +2939,15 @@ void tenspot_set_game_bank(running_machine& machine, int bank, int from_game)
int x;
sprintf(tmp,"game_%d_cpu", bank);
- srcregion = machine.region(tmp)->base();
- dstregion = machine.region("maincpu")->base();
+ srcregion = machine.root_device().memregion(tmp)->base();
+ dstregion = machine.root_device().memregion("maincpu")->base();
memcpy(dstregion, srcregion, 0x4000);
sprintf(tmp,"game_%d_temp", bank);
- srcregion = machine.region(tmp)->base();
- dstregion = machine.region("gfx1")->base();
+ srcregion = machine.root_device().memregion(tmp)->base();
+ dstregion = machine.root_device().memregion("gfx1")->base();
memcpy(dstregion, srcregion, 0x2000);
- dstregion = machine.region("gfx2")->base();
+ dstregion = machine.root_device().memregion("gfx2")->base();
memcpy(dstregion, srcregion, 0x2000);
if (from_game)
@@ -2965,8 +2965,8 @@ void tenspot_set_game_bank(running_machine& machine, int bank, int from_game)
}
sprintf(tmp,"game_%d_prom", bank);
- srcregion = machine.region(tmp)->base();
- dstregion = machine.region("proms")->base();
+ srcregion = machine.root_device().memregion(tmp)->base();
+ dstregion = machine.root_device().memregion("proms")->base();
memcpy(dstregion, srcregion, 0x20);
PALETTE_INIT_CALL(galaxian);
@@ -3026,13 +3026,13 @@ static DRIVER_INIT( zigzag )
/* make ROMs 2 & 3 swappable */
space->install_read_bank(0x2000, 0x2fff, "bank1");
space->install_read_bank(0x3000, 0x3fff, "bank2");
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x2000, 0x1000);
- state->membank("bank2")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x2000, 0x1000);
+ state->membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x1000);
+ state->membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x1000);
/* also re-install the fixed ROM area as a bank in order to inform the memory system that
the fixed area only extends to 0x1fff */
space->install_read_bank(0x0000, 0x1fff, "bank3");
- state->membank("bank3")->set_base(machine.region("maincpu")->base() + 0x0000);
+ state->membank("bank3")->set_base(state->memregion("maincpu")->base() + 0x0000);
/* handler for doing the swaps */
space->install_write_handler(0x7002, 0x7002, 0, 0x07f8, write8_delegate(FUNC(galaxian_state::zigzag_bankswap_w),state));
@@ -3147,7 +3147,7 @@ static DRIVER_INIT( skybase )
space->install_ram(0x8000, 0x87ff);
/* extend ROM */
- space->install_rom(0x0000, 0x5fff, machine.region("maincpu")->base());
+ space->install_rom(0x0000, 0x5fff, state->memregion("maincpu")->base());
}
@@ -3162,14 +3162,14 @@ static DRIVER_INIT( kong )
space->install_ram(0x8000, 0x87ff);
/* extend ROM */
- space->install_rom(0x0000, 0x7fff, machine.region("maincpu")->base());
+ space->install_rom(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base());
}
static void mshuttle_decode(running_machine &machine, const UINT8 convtable[8][16])
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
int A;
@@ -3271,8 +3271,8 @@ static DRIVER_INIT( fantastc )
3, 7, 7, 7 // ok!
};
- UINT8* romdata = machine.region("maincpu")->base();
- assert(machine.region("maincpu")->bytes() == 0x8000);
+ UINT8* romdata = machine.root_device().memregion("maincpu")->base();
+ assert(machine.root_device().memregion("maincpu")->bytes() == 0x8000);
UINT8 buf[0x8000];
memcpy(buf, romdata, 0x8000);
@@ -3312,7 +3312,7 @@ static DRIVER_INIT( scorpnmc )
space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),state));
/* extra ROM */
- space->install_rom(0x5000, 0x67ff, machine.region("maincpu")->base() + 0x5000);
+ space->install_rom(0x5000, 0x67ff, state->memregion("maincpu")->base() + 0x5000);
/* install RAM at $4000-$4800 */
space->install_ram(0x4000, 0x47ff);
@@ -3337,7 +3337,7 @@ static DRIVER_INIT( thepitm )
space->unmap_write(0xb004, 0xb004, 0, 0x07f8);
/* extend ROM */
- space->install_rom(0x0000, 0x47ff, machine.region("maincpu")->base());
+ space->install_rom(0x0000, 0x47ff, state->memregion("maincpu")->base());
}
/*************************************
@@ -3396,7 +3396,7 @@ static DRIVER_INIT( sfx )
/* sound board has space for extra ROM */
machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
- state->membank("bank1")->set_base(machine.region("audiocpu")->base());
+ state->membank("bank1")->set_base(state->memregion("audiocpu")->base());
}
@@ -3502,7 +3502,7 @@ static DRIVER_INIT( scorpion )
/* extra ROM */
space->install_read_bank(0x5800, 0x67ff, "bank1");
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x5800);
+ state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x5800);
/* no background related */
// space->nop_write(0x6803, 0x6803);
@@ -3510,7 +3510,7 @@ static DRIVER_INIT( scorpion )
machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3000, 0x3000, read8_delegate(FUNC(galaxian_state::scorpion_digitalker_intr_r),state));
/*
{
- const UINT8 *rom = machine.region("speech")->base();
+ const UINT8 *rom = state->memregion("speech")->base();
int i;
for (i = 0; i < 0x2c; i++)
diff --git a/src/mame/drivers/galgame.c b/src/mame/drivers/galgame.c
index 2ffa906da3e..085756ea99e 100644
--- a/src/mame/drivers/galgame.c
+++ b/src/mame/drivers/galgame.c
@@ -397,7 +397,7 @@ static UINT8 read_uint8(UINT8 *pval, int pos, const UINT8* line, int linelen)
static DRIVER_INIT(galaxygame)
{
address_space *main = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *code = machine.region("code")->base();
+ UINT8 *code = machine.root_device().memregion("code")->base();
int filepos = 0, linepos, linelen;
UINT8 line[256];
diff --git a/src/mame/drivers/galivan.c b/src/mame/drivers/galivan.c
index 93f6796fad8..58cd8c13582 100644
--- a/src/mame/drivers/galivan.c
+++ b/src/mame/drivers/galivan.c
@@ -380,7 +380,7 @@ static MACHINE_START( galivan )
galivan_state *state = machine.driver_data<galivan_state>();
/* configure ROM banking */
- UINT8 *rombase = machine.region("maincpu")->base();
+ UINT8 *rombase = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &rombase[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
@@ -397,7 +397,7 @@ static MACHINE_START( ninjemak )
galivan_state *state = machine.driver_data<galivan_state>();
/* configure ROM banking */
- UINT8 *rombase = machine.region("maincpu")->base();
+ UINT8 *rombase = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
@@ -1085,10 +1085,10 @@ static DRIVER_INIT( youmab )
galivan_state *state = machine.driver_data<galivan_state>();
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x82, 0x82, write8_delegate(FUNC(galivan_state::youmab_extra_bank_w),state)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3");
- state->membank("bank3")->set_base(machine.region("maincpu")->base());
+ state->membank("bank3")->set_base(machine.root_device().memregion("maincpu")->base());
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank2");
- state->membank("bank2")->configure_entries(0, 2, machine.region("user2")->base(), 0x4000);
+ state->membank("bank2")->configure_entries(0, 2, state->memregion("user2")->base(), 0x4000);
state->membank("bank2")->set_entry(0);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x81, 0x81, write8_delegate(FUNC(galivan_state::youmab_81_w),state)); // ?? often, alternating values
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 63f4f274682..aced2842a55 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -275,7 +275,7 @@ WRITE8_MEMBER(galpani2_state::galpani2_coin_lockout_w)
static WRITE8_DEVICE_HANDLER( galpani2_oki1_bank_w )
{
- UINT8 *ROM = device->machine().region("oki1")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("oki1")->base();
logerror("%s : %s bank %08X\n",device->machine().describe_context(),device->tag(),data);
memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000);
}
@@ -349,8 +349,8 @@ ADDRESS_MAP_END
READ16_MEMBER(galpani2_state::galpani2_bankedrom_r)
{
- UINT16 *ROM = (UINT16 *) machine().region( "user1" )->base();
- size_t len = machine().region( "user1" )->bytes() / 2;
+ UINT16 *ROM = (UINT16 *) memregion( "user1" )->base();
+ size_t len = memregion( "user1" )->bytes() / 2;
offset += (0x800000/2) * (*m_rombank & 0x0003);
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 2c0b13d97db..0da0d925935 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -400,7 +400,7 @@ static SCREEN_UPDATE_RGB32(galpani3)
state->m_sprite_bitmap_1.fill(0x0000, cliprect);
- state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, &state->m_spriteram32[0], 0x4000, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_spc_regs );
+ state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, &state->m_spriteram32[0], 0x4000, screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), state->m_spc_regs );
// ignoring priority bits for now..
for (y=0;y<240;y++)
@@ -748,7 +748,7 @@ WRITE16_MEMBER(galpani3_state::galpani3_regs1_go_w)
{
UINT32 address = m_regs1_address_regs[1]| (m_regs1_address_regs[0]<<16);
- UINT8* rledata = machine().region("gfx2")->base();
+ UINT8* rledata = memregion("gfx2")->base();
printf("galpani3_regs1_go_w? %08x\n",address );
if ((data==0x2000) || (data==0x3000)) gp3_do_rle(address, m_framebuffer1, rledata);
@@ -766,7 +766,7 @@ WRITE16_MEMBER(galpani3_state::galpani3_regs2_go_w)
{
UINT32 address = m_regs2_address_regs[1]| (m_regs2_address_regs[0]<<16);
- UINT8* rledata = machine().region("gfx2")->base();
+ UINT8* rledata = memregion("gfx2")->base();
printf("galpani3_regs2_go_w? %08x\n", address );
@@ -788,7 +788,7 @@ WRITE16_MEMBER(galpani3_state::galpani3_regs3_go_w)
{
UINT32 address = m_regs3_address_regs[1]| (m_regs3_address_regs[0]<<16);
- UINT8* rledata = machine().region("gfx2")->base();
+ UINT8* rledata = memregion("gfx2")->base();
printf("galpani3_regs3_go_w? %08x\n",address );
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index 1691bf24b9c..e8b27396f6f 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -170,7 +170,7 @@ WRITE16_MEMBER(galpanic_state::galpanic_6295_bankswitch_w)
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = machine().region("oki")->base();
+ UINT8 *rom = memregion("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
@@ -183,7 +183,7 @@ WRITE16_MEMBER(galpanic_state::galpanica_6295_bankswitch_w)
{
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = machine().region("oki")->base();
+ UINT8 *rom = memregion("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
}
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index bf58f828125..90c8ff930ff 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -220,7 +220,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
else // disable RAM access (reads go to BIOS ROM)
{
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base() + 0x30000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base() + 0x30000);
}
break;
}
@@ -614,7 +614,7 @@ static MACHINE_START(gamecstl)
static MACHINE_RESET(gamecstl)
{
- machine.root_device().membank("bank1")->set_base(machine.region("bios")->base() + 0x30000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x30000);
device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c
index 245ee5f8b5e..60e16ba3d3d 100644
--- a/src/mame/drivers/gaplus.c
+++ b/src/mame/drivers/gaplus.c
@@ -872,11 +872,11 @@ static DRIVER_INIT( gaplus )
UINT8 *rom;
int i;
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] >> 4;
- rom = machine.region("gfx2")->base() + 0x6000;
+ rom = machine.root_device().memregion("gfx2")->base() + 0x6000;
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] << 4;
}
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index 2cd7192a1fc..69aeb15b302 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -1621,7 +1621,7 @@ ROM_END
static void gauntlet_common_init(running_machine &machine, int slapstic, int vindctr2)
{
gauntlet_state *state = machine.driver_data<gauntlet_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->m_eeprom_default = NULL;
atarigen_slapstic_init(machine.device("maincpu"), 0x038000, 0, slapstic);
@@ -1657,7 +1657,7 @@ static DRIVER_INIT( gauntlet2 )
static DRIVER_INIT( vindctr2 )
{
- UINT8 *gfx2_base = machine.region("gfx2")->base();
+ UINT8 *gfx2_base = machine.root_device().memregion("gfx2")->base();
UINT8 *data = auto_alloc_array(machine, UINT8, 0x8000);
int i;
diff --git a/src/mame/drivers/gberet.c b/src/mame/drivers/gberet.c
index ad1bcbe3c99..cf8898b1fee 100644
--- a/src/mame/drivers/gberet.c
+++ b/src/mame/drivers/gberet.c
@@ -573,7 +573,7 @@ ROM_END
static DRIVER_INIT( mrgoemon )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index c28fe3a8554..1a9ce532ade 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -268,7 +268,7 @@ static const k051960_interface gbusters_k051960_intf =
static MACHINE_START( gbusters )
{
gbusters_state *state = machine.driver_data<gbusters_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
@@ -288,7 +288,7 @@ static MACHINE_START( gbusters )
static MACHINE_RESET( gbusters )
{
gbusters_state *state = machine.driver_data<gbusters_state>();
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
konami_configure_set_lines(machine.device("maincpu"), gbusters_banking);
diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c
index ff42457e5bd..209d1e4de10 100644
--- a/src/mame/drivers/gcpinbal.c
+++ b/src/mame/drivers/gcpinbal.c
@@ -214,7 +214,7 @@ static void gcp_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("msm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("msm")->base();
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_start] & 0x0f) : (ROM[state->m_adpcm_start] & 0xf0) >> 4));
msm5205_data_w(device, state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index aca599fba44..01e06d0c930 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -269,68 +269,68 @@ static READ8_DEVICE_HANDLER( portC_r )
WRITE8_MEMBER(gei_state::banksel_main_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x8000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x8000);
}
WRITE8_MEMBER(gei_state::banksel_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
}
WRITE8_MEMBER(gei_state::banksel_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x18000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000);
}
WRITE8_MEMBER(gei_state::banksel_3_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x20000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x20000);
}
WRITE8_MEMBER(gei_state::banksel_4_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x28000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x28000);
}
WRITE8_MEMBER(gei_state::banksel_5_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x30000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x30000);
}
WRITE8_MEMBER(gei_state::banksel_1_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
}
WRITE8_MEMBER(gei_state::banksel_2_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x14000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x14000);
}
WRITE8_MEMBER(gei_state::banksel_3_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x18000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000);
}
WRITE8_MEMBER(gei_state::banksel_4_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1c000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1c000);
}
WRITE8_MEMBER(gei_state::banksel_5_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x20000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x20000);
}
WRITE8_MEMBER(gei_state::banksel_1_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x12000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x12000);
}
WRITE8_MEMBER(gei_state::banksel_2_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x16000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x16000);
}
WRITE8_MEMBER(gei_state::banksel_3_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1a000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1a000);
}
WRITE8_MEMBER(gei_state::banksel_4_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1e000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1e000);
}
WRITE8_MEMBER(gei_state::banksel_5_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x22000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x22000);
}
WRITE8_MEMBER(gei_state::geimulti_bank_w)
@@ -358,36 +358,36 @@ WRITE8_MEMBER(gei_state::geimulti_bank_w)
}
if (bank != -1)
- membank("bank1")->set_base(machine().region("bank")->base() + bank*0x8000);
+ membank("bank1")->set_base(machine().root_device().memregion("bank")->base() + bank*0x8000);
}
READ8_MEMBER(gei_state::banksel_1_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
return 0x03;
};
READ8_MEMBER(gei_state::banksel_2_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x18000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000);
return 0x03;
}
READ8_MEMBER(gei_state::banksel_3_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x20000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x20000);
return 0x03;
}
READ8_MEMBER(gei_state::banksel_4_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x28000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x28000);
return 0x03;
}
READ8_MEMBER(gei_state::banksel_5_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x30000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x30000);
return 0x03;
}
@@ -1873,12 +1873,12 @@ ROM_END
static DRIVER_INIT( setbank )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base() + 0x2000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x2000);
}
static DRIVER_INIT( geimulti )
{
- machine.root_device().membank("bank1")->set_base(machine.region("bank")->base() + 0x0000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bank")->base() + 0x0000);
}
GAME( 1982, jokpoker, 0, gselect, gselect, setbank, ROT0, "Greyhound Electronics", "Joker Poker (Version 16.03B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index 7fe00b6b67b..b4ddd72e669 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -269,7 +269,7 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
break;
case NAND_M_READ :
{
- UINT8 *flash = (UINT8 *)device->machine().region( "user1")->base();
+ UINT8 *flash = (UINT8 *)device->machine().root_device().memregion( "user1")->base();
if (nand.byte_addr < 0x200)
{
data = *(flash + nand.page_addr * 0x200 + nand.byte_addr);
diff --git a/src/mame/drivers/ginganin.c b/src/mame/drivers/ginganin.c
index 335dfd7ce13..4e953bb6a2d 100644
--- a/src/mame/drivers/ginganin.c
+++ b/src/mame/drivers/ginganin.c
@@ -380,7 +380,7 @@ static DRIVER_INIT( ginganin )
UINT16 *rom;
/* main cpu patches */
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/* avoid writes to rom getting to the log */
rom[0x408 / 2] = 0x6000;
rom[0x40a / 2] = 0x001c;
@@ -388,7 +388,7 @@ static DRIVER_INIT( ginganin )
/* sound cpu patches */
/* let's clear the RAM: ROM starts at 0x4000 */
- memset(machine.region("audiocpu")->base(), 0, 0x800);
+ memset(machine.root_device().memregion("audiocpu")->base(), 0, 0x800);
}
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index c446f2a5051..5b7620d6652 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -194,7 +194,7 @@ TODO:
/*Rom bankswitching*/
WRITE8_MEMBER(gladiatr_state::gladiatr_bankswitch_w)
{
- UINT8 *rom = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *rom = memregion("maincpu")->base() + 0x10000;
membank("bank1")->set_base(rom + 0x6000 * (data & 0x01));
}
@@ -256,7 +256,7 @@ static MACHINE_RESET( gladiator )
TAITO8741_start(&gladiator_8741interface);
/* 6809 bank memory set */
{
- UINT8 *rom = machine.region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base() + 0x10000;
machine.root_device().membank("bank2")->set_base(rom);
machine.device("audiocpu")->reset();
}
@@ -279,7 +279,7 @@ static void gladiator_ym_irq(device_t *device, int irq)
/*Sound Functions*/
static WRITE8_DEVICE_HANDLER( glad_adpcm_w )
{
- UINT8 *rom = device->machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = device->machine().root_device().memregion("audiocpu")->base() + 0x10000;
/* bit6 = bank offset */
device->machine().root_device().membank("bank2")->set_base(rom + ((data & 0x40) ? 0xc000 : 0));
@@ -956,7 +956,7 @@ static DRIVER_INIT( gladiatr )
UINT8 *rom;
int i,j;
- rom = machine.region("gfx2")->base();
+ rom = machine.root_device().memregion("gfx2")->base();
// unpack 3bpp graphics
for (j = 3; j >= 0; j--)
{
@@ -970,7 +970,7 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x14000, rom + 0x18000, 0x4000);
- rom = machine.region("gfx3")->base();
+ rom = machine.root_device().memregion("gfx3")->base();
// unpack 3bpp graphics
for (j = 5; j >= 0; j--)
{
@@ -987,7 +987,7 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x24000, rom + 0x28000, 0x4000);
/* make sure bank is valid in cpu-reset */
- rom = machine.region("audiocpu")->base() + 0x10000;
+ rom = machine.root_device().memregion("audiocpu")->base() + 0x10000;
machine.root_device().membank("bank2")->set_base(rom);
}
@@ -1005,14 +1005,14 @@ static DRIVER_INIT(ppking)
UINT8 *rom;
int i,j;
- rom = machine.region("gfx2")->base();
+ rom = machine.root_device().memregion("gfx2")->base();
// unpack 3bpp graphics
for (i = 0; i < 0x2000; i++)
{
rom[i+0x2000] = rom[i] >> 4;
}
- rom = machine.region("gfx3")->base();
+ rom = machine.root_device().memregion("gfx3")->base();
// unpack 3bpp graphics
for (j = 1; j >= 0; j--)
{
diff --git a/src/mame/drivers/glass.c b/src/mame/drivers/glass.c
index 38ff14c9cc5..62525ecf4b3 100644
--- a/src/mame/drivers/glass.c
+++ b/src/mame/drivers/glass.c
@@ -54,7 +54,7 @@ GFXDECODE_END
WRITE16_MEMBER(glass_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7)
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f) * 0x10000], 0x10000);
@@ -297,10 +297,10 @@ static void glass_ROM16_split_gfx( running_machine &machine, const char *src_reg
int i;
/* get a pointer to the source data */
- UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
+ UINT8 *src = (UINT8 *)machine.root_device().memregion(src_reg)->base();
/* get a pointer to the destination data */
- UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
+ UINT8 *dst = (UINT8 *)machine.root_device().memregion(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length / 2; i++)
diff --git a/src/mame/drivers/gng.c b/src/mame/drivers/gng.c
index 24784fbfbb5..d25cceca5b2 100644
--- a/src/mame/drivers/gng.c
+++ b/src/mame/drivers/gng.c
@@ -304,7 +304,7 @@ static MACHINE_START( gng )
{
gng_state *state = machine.driver_data<gng_state>();
- UINT8 *rombase = machine.region("maincpu")->base();
+ UINT8 *rombase = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x2000);
state->membank("bank1")->configure_entry(4, &rombase[0x4000]);
diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c
index 07ec632f3d2..0305269590f 100644
--- a/src/mame/drivers/go2000.c
+++ b/src/mame/drivers/go2000.c
@@ -310,7 +310,7 @@ static SCREEN_UPDATE_IND16(go2000)
static MACHINE_START( go2000 )
{
go2000_state *state = machine.driver_data<go2000_state>();
- UINT8 *SOUND = machine.region("soundcpu")->base();
+ UINT8 *SOUND = state->memregion("soundcpu")->base();
int i;
for (i = 0; i < 8; i++)
diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c
index 89589aafbbc..5ca3ccb6c2c 100644
--- a/src/mame/drivers/goal92.c
+++ b/src/mame/drivers/goal92.c
@@ -291,7 +291,7 @@ GFXDECODE_END
static MACHINE_START( goal92 )
{
goal92_state *state = machine.driver_data<goal92_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/goindol.c b/src/mame/drivers/goindol.c
index 7bf30dc8c1c..bb2559f7d5c 100644
--- a/src/mame/drivers/goindol.c
+++ b/src/mame/drivers/goindol.c
@@ -220,7 +220,7 @@ GFXDECODE_END
static MACHINE_START( goindol )
{
goindol_state *state = machine.driver_data<goindol_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
@@ -383,7 +383,7 @@ ROM_END
static DRIVER_INIT( goindol )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* I hope that's all patches to avoid protection */
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index 8ba7ab944c0..369099ae0c2 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -1049,7 +1049,7 @@ static SCREEN_UPDATE_IND16( goldnpkr )
static PALETTE_INIT( goldnpkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* prom bits
7654 3210
---- ---x red component.
@@ -1093,7 +1093,7 @@ static PALETTE_INIT( goldnpkr )
static PALETTE_INIT( witchcrd )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/*
This hardware has a feature called BLUE KILLER.
Using the original intensity line, the PCB has a bridge
@@ -1141,7 +1141,7 @@ static PALETTE_INIT( witchcrd )
static PALETTE_INIT( wcrdxtnd )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/*
Using the original intensity line, the PCB has a bridge
that allow (as default) turn the background dark blue.
@@ -9368,7 +9368,7 @@ static DRIVER_INIT( royale )
{
/* $60bb, NOPing the ORA #$F0 (after read the PIA1 port B */
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x60bb] = 0xea;
// ROM[0x60bc] = 0xea;
@@ -9398,8 +9398,8 @@ static DRIVER_INIT( flcnw )
/* Attempt to decrypt the MCU program (we're sooo close!) */
- UINT8 *ROM = machine.region("mcu")->base();
- int size = machine.region("mcu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("mcu")->base();
+ int size = machine.root_device().memregion("mcu")->bytes();
int start = 0x0000;
int i;
@@ -9417,7 +9417,7 @@ static DRIVER_INIT( vkdlsa )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe097] = 0xea;
ROM[0xe098] = 0xea;
@@ -9429,7 +9429,7 @@ static DRIVER_INIT( vkdlsb )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe87b] = 0xea;
ROM[0xe87c] = 0xea;
@@ -9441,7 +9441,7 @@ static DRIVER_INIT( vkdlsc )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x453a] = 0xea;
ROM[0x453b] = 0xea;
@@ -9453,7 +9453,7 @@ static DRIVER_INIT( vkdlsww )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xf2c9] = 0xea;
ROM[0xf2ca] = 0xea;
@@ -9465,7 +9465,7 @@ static DRIVER_INIT( vkdlswwa )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xdf80] = 0xea;
ROM[0xdf81] = 0xea;
@@ -9477,7 +9477,7 @@ static DRIVER_INIT( vkdlswwc )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe42f] = 0xea;
ROM[0xe430] = 0xea;
@@ -9489,7 +9489,7 @@ static DRIVER_INIT( vkdlswwd )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe442] = 0xea;
ROM[0xe443] = 0xea;
@@ -9501,7 +9501,7 @@ static DRIVER_INIT( vkdlswwh )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe4d5] = 0xea;
ROM[0xe4d6] = 0xea;
@@ -9513,7 +9513,7 @@ static DRIVER_INIT( vkdlswwl )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe87c] = 0xea;
ROM[0xe87d] = 0xea;
@@ -9525,7 +9525,7 @@ static DRIVER_INIT( vkdlswwo )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe7d5] = 0xea;
ROM[0xe7d6] = 0xea;
@@ -9537,7 +9537,7 @@ static DRIVER_INIT( vkdlswwp )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe7d9] = 0xea;
ROM[0xe7da] = 0xea;
@@ -9549,7 +9549,7 @@ static DRIVER_INIT( vkdlswwr )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe7f7] = 0xea;
ROM[0xe7f8] = 0xea;
@@ -9561,7 +9561,7 @@ static DRIVER_INIT( vkdlswws )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe8a5] = 0xea;
ROM[0xe8a6] = 0xea;
@@ -9573,7 +9573,7 @@ static DRIVER_INIT( vkdlswwt )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe955] = 0xea;
ROM[0xe956] = 0xea;
@@ -9585,7 +9585,7 @@ static DRIVER_INIT( vkdlswwu )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xee6b] = 0xea;
ROM[0xee6c] = 0xea;
@@ -9597,7 +9597,7 @@ static DRIVER_INIT( vkdlswwv )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xf052] = 0xea;
ROM[0xf053] = 0xea;
@@ -9729,7 +9729,7 @@ static DRIVER_INIT( wstrike )
after compare with a string inside the Dallas TK RAM
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xf2e1] = 0xea;
ROM[0xf2e2] = 0xea;
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index 1590dd43801..fe824d833d6 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -5946,7 +5946,7 @@ static PALETTE_INIT(cm)
for (i = 0; i < 0x100; i++)
{
UINT8 data;
- UINT8*proms = machine.region("proms")->base();
+ UINT8*proms = machine.root_device().memregion("proms")->base();
data = proms[0x000 + i] | (proms[0x100 + i] << 4);
@@ -5961,7 +5961,7 @@ static PALETTE_INIT(cmast91)
{
int r,g,b;
- UINT8*proms = machine.region("proms")->base();
+ UINT8*proms = machine.root_device().memregion("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -5979,7 +5979,7 @@ static PALETTE_INIT(lucky8)
UINT8 data;
UINT8 *proms;
- proms = machine.region("proms")->base();
+ proms = machine.root_device().memregion("proms")->base();
for (i = 0; i < 0x100; i++)
{
@@ -5988,7 +5988,7 @@ static PALETTE_INIT(lucky8)
palette_set_color_rgb(machine, i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
}
- proms = machine.region("proms2")->base();
+ proms = machine.root_device().memregion("proms2")->base();
for (i=0; i < 0x20; i++)
{
data = proms[i];
@@ -6361,7 +6361,7 @@ static PALETTE_INIT(magodds)
{
int r,g,b;
- UINT8*proms = machine.region("proms")->base();
+ UINT8*proms = machine.root_device().memregion("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -8433,7 +8433,7 @@ YM2203
static DRIVER_INIT(magoddsc)
{
int A;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x8000;A++)
{
@@ -10058,7 +10058,7 @@ ROM_END
static DRIVER_INIT(goldstar)
{
int A;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
{
@@ -10143,8 +10143,8 @@ static UINT8 chry10_decrypt(UINT8 cipherText)
static DRIVER_INIT( chry10 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
int start = 0;
int i;
@@ -10167,8 +10167,8 @@ static DRIVER_INIT( chry10 )
static DRIVER_INIT( cb3 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
int start = 0;
int i;
@@ -10186,7 +10186,7 @@ static DRIVER_INIT( cb3 )
static DRIVER_INIT( chrygld )
{
int A;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
do_blockswaps(machine, ROM);
// a data bitswap
@@ -10202,7 +10202,7 @@ static DRIVER_INIT( chrygld )
static DRIVER_INIT(cm)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -10213,7 +10213,7 @@ static DRIVER_INIT(cm)
static DRIVER_INIT(cmv4)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -10224,7 +10224,7 @@ static DRIVER_INIT(cmv4)
static DRIVER_INIT(cmast91)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -10235,7 +10235,7 @@ static DRIVER_INIT(cmast91)
static DRIVER_INIT(lucky8a)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x0010] = 0x21;
}
@@ -10243,7 +10243,7 @@ static DRIVER_INIT(lucky8a)
static DRIVER_INIT( nfb96sea )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
@@ -10276,7 +10276,7 @@ READ8_MEMBER(goldstar_state::fixedvala8_r)
static DRIVER_INIT( schery97 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10304,7 +10304,7 @@ READ8_MEMBER(goldstar_state::fixedval38_r)
static DRIVER_INIT( schery97a )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10333,7 +10333,7 @@ READ8_MEMBER(goldstar_state::fixedvalea_r)
static DRIVER_INIT( skill98 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10360,7 +10360,7 @@ READ8_MEMBER(goldstar_state::fixedval68_r)
static DRIVER_INIT( nfb96_c1 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10387,7 +10387,7 @@ READ8_MEMBER(goldstar_state::fixedval58_r)
static DRIVER_INIT( nfb96_c2 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10424,7 +10424,7 @@ READ8_MEMBER(goldstar_state::fixedvalaa_r)
static DRIVER_INIT( nfb96_d )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10457,7 +10457,7 @@ READ8_MEMBER(goldstar_state::fixedvalbe_r)
static DRIVER_INIT( nfb96_dk )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10489,7 +10489,7 @@ READ8_MEMBER(goldstar_state::fixedval84_r)
static DRIVER_INIT( rp35 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10517,7 +10517,7 @@ READ8_MEMBER(goldstar_state::fixedvalb2_r)
static DRIVER_INIT( rp36 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10545,7 +10545,7 @@ READ8_MEMBER(goldstar_state::fixedval48_r)
static DRIVER_INIT( rp36c3 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10579,7 +10579,7 @@ READ8_MEMBER(goldstar_state::fixedval74_r)
static DRIVER_INIT( po33 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10613,7 +10613,7 @@ READ8_MEMBER(goldstar_state::fixedvalc7_r)
static DRIVER_INIT( match133 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10637,7 +10637,7 @@ static DRIVER_INIT( match133 )
static DRIVER_INIT(cherrys)
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
unsigned char rawData[256] = {
0xCC, 0xCD, 0xCE, 0xCF, 0xC8, 0xC9, 0xCA, 0xCB, 0xC4, 0xC5, 0xC6, 0xC7,
@@ -10674,21 +10674,21 @@ static DRIVER_INIT(cherrys)
/* todo: remove these patches! */
static DRIVER_INIT( unkch1 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x9d52] = 0x00;
ROM[0x9d53] = 0x00;
}
static DRIVER_INIT( unkch3 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x9b86] = 0x00;
ROM[0x9b87] = 0x00;
}
static DRIVER_INIT( unkch4 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x9a6e] = 0x00;
ROM[0x9a6f] = 0x00;
}
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index 56348e39784..e1fe9ba557d 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -125,7 +125,7 @@ static void gpworld_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,
int i;
- UINT8 *GFX = machine.region("gfx2")->base();
+ UINT8 *GFX = state->memregion("gfx2")->base();
/* Heisted from Daphne which heisted it from MAME */
for (i = 0; i < 0x800; i += 8)
diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c
index 6bd10fb5574..b976db6d9e1 100644
--- a/src/mame/drivers/groundfx.c
+++ b/src/mame/drivers/groundfx.c
@@ -453,8 +453,8 @@ READ32_MEMBER(groundfx_state::irq_speedup_r_groundfx)
static DRIVER_INIT( groundfx )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx3")->base();
- int size=machine.region("gfx3")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int size=machine.root_device().memregion("gfx3")->bytes();
int data;
/* Speedup handlers */
diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c
index 5f83780b326..936d57d5297 100644
--- a/src/mame/drivers/gstriker.c
+++ b/src/mame/drivers/gstriker.c
@@ -213,7 +213,7 @@ WRITE8_MEMBER(gstriker_state::gs_sh_pending_command_clear_w)
WRITE8_MEMBER(gstriker_state::gs_sh_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x8000;
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index 5f5708a0180..f4f856e4159 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -903,7 +903,7 @@ ROM_END
static DRIVER_INIT( gsword )
{
#if 0
- UINT8 *ROM2 = machine.region("sub")->base();
+ UINT8 *ROM2 = machine.root_device().memregion("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x71e] = 0; /* patch for sound protection or time out function */
@@ -919,7 +919,7 @@ static DRIVER_INIT( gsword )
static DRIVER_INIT( gsword2 )
{
#if 0
- UINT8 *ROM2 = machine.region("sub")->base();
+ UINT8 *ROM2 = machine.root_device().memregion("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x726] = 0; /* patch for sound protection or time out function */
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index 94fea7584ef..be0e347f7ca 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -1165,7 +1165,7 @@ static DRIVER_INIT(gticlub)
state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
- K001005_preprocess_texture_data(machine.region("gfx1")->base(), machine.region("gfx1")->bytes(), 1);
+ K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 1);
}
static DRIVER_INIT(hangplt)
@@ -1173,8 +1173,8 @@ static DRIVER_INIT(hangplt)
gticlub_state *state = machine.driver_data<gticlub_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
state->m_sharc_dataram_1 = auto_alloc_array(machine, UINT32, 0x100000/4);
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index a114ac79124..fadefe86604 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -319,7 +319,7 @@ static TIMER_CALLBACK( fdc_data_callback )
{
guab_state *state = machine.driver_data<guab_state>();
struct wd1770 &fdc = state->m_fdc;
- UINT8* disk = (UINT8*)machine.region("user1")->base();
+ UINT8* disk = (UINT8*)state->memregion("user1")->base();
int more_data = 0;
/*
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index e03363525cb..d7dc78ccee7 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -364,7 +364,7 @@ GFXDECODE_END
static MACHINE_START( gundealr )
{
gundealr_state *state = machine.driver_data<gundealr_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c
index 35b4bfe67cb..15ef83a2238 100644
--- a/src/mame/drivers/gunpey.c
+++ b/src/mame/drivers/gunpey.c
@@ -134,7 +134,7 @@ WRITE8_MEMBER(gunpey_state::gunpey_blitter_w)
{
UINT16 *blit_buffer = m_blit_buffer;
UINT16 *blit_ram = m_blit_ram;
- UINT8 *blit_rom = machine().region("blit_data")->base();
+ UINT8 *blit_rom = memregion("blit_data")->base();
int x,y;
blit_ram[offset] = data;
@@ -307,7 +307,7 @@ INPUT_PORTS_END
static PALETTE_INIT( gunpey )
{
int i,r,g,b,val;
- UINT8 *blit_rom = machine.region("blit_data")->base();
+ UINT8 *blit_rom = machine.root_device().memregion("blit_data")->base();
for (i = 0; i < 512; i+=2)
{
@@ -384,7 +384,7 @@ ROM_END
static DRIVER_INIT( gunpey )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch SLOOOOW cycle checks ... */
rom[0x848b5] = 0x7e;
diff --git a/src/mame/drivers/gunsmoke.c b/src/mame/drivers/gunsmoke.c
index 72a7d6ff701..85c2d4f9b2d 100644
--- a/src/mame/drivers/gunsmoke.c
+++ b/src/mame/drivers/gunsmoke.c
@@ -274,7 +274,7 @@ GFXDECODE_END
static MACHINE_START( gunsmoke )
{
gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
- UINT8 *rombase = machine.region("maincpu")->base();
+ UINT8 *rombase = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x4000);
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index f01c225a064..38a05067677 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -1167,7 +1167,7 @@ static void halleys_decode_rgb(running_machine &machine, UINT32 *r, UINT32 *g, U
sram_189 = state->m_generic_paletteram_8;
// each of the three 32-byte 6330 PROM is wired to an RGB component output
- prom_6330 = machine.region("proms")->base();
+ prom_6330 = state->memregion("proms")->base();
// latch1 holds 8 bits from the selected palette RAM address
latch1_273 = sram_189[addr];
@@ -2187,7 +2187,7 @@ static void init_common(running_machine &machine)
// decrypt main program ROM
- rom = state->m_cpu1_base = machine.region("maincpu")->base();
+ rom = state->m_cpu1_base = state->memregion("maincpu")->base();
buf = state->m_gfx1_base;
for (i=0; i<0x10000; i++)
@@ -2200,7 +2200,7 @@ static void init_common(running_machine &machine)
// swap graphics ROM addresses and unpack each pixel
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
buf = state->m_gfx_plane02;
for (i=0xffff; i>=0; i--)
diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c
index 5b543f0e762..f8cb2f270b0 100644
--- a/src/mame/drivers/harddriv.c
+++ b/src/mame/drivers/harddriv.c
@@ -3924,7 +3924,7 @@ static void init_ds3(running_machine &machine)
static void init_dsk(running_machine &machine)
{
harddriv_state *state = machine.driver_data<harddriv_state>();
- UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr3 = state->memregion("user3")->base();
/* install ASIC61 */
state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x85c000, 0x85c7ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
@@ -3958,7 +3958,7 @@ static void init_dsk(running_machine &machine)
static void init_dsk2(running_machine &machine)
{
harddriv_state *state = machine.driver_data<harddriv_state>();
- UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr3 = state->memregion("user3")->base();
/* install ASIC65 */
state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w));
diff --git a/src/mame/drivers/hcastle.c b/src/mame/drivers/hcastle.c
index 1e7175177ba..90ead108346 100644
--- a/src/mame/drivers/hcastle.c
+++ b/src/mame/drivers/hcastle.c
@@ -179,7 +179,7 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( hcastle )
{
hcastle_state *state = machine.driver_data<hcastle_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index 06aac0cdcab..30d5b174b7c 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -243,7 +243,7 @@ WRITE16_MEMBER(highvdeo_state::tv_vcf_paletteram_w)
WRITE16_MEMBER(highvdeo_state::tv_vcf_bankselect_w)
{
UINT32 bankaddress;
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
/* bits 0, 1 select the ROM bank */
bankaddress = (data & 0x03) * 0x40000;
@@ -378,7 +378,7 @@ WRITE16_MEMBER(highvdeo_state::tv_tcf_paletteram_w)
WRITE16_MEMBER(highvdeo_state::tv_tcf_bankselect_w)
{
UINT32 bankaddress;
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
/* bits 0, 1, 2 select the ROM bank */
bankaddress = (data & 0x07) * 0x40000;
@@ -494,7 +494,7 @@ READ16_MEMBER(highvdeo_state::brasil_status_r)
WRITE16_MEMBER(highvdeo_state::brasil_status_w)
{
UINT32 bankaddress;
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
switch(data & 3) //data & 7?
{
diff --git a/src/mame/drivers/himesiki.c b/src/mame/drivers/himesiki.c
index c272193dec4..76ee2ddc86f 100644
--- a/src/mame/drivers/himesiki.c
+++ b/src/mame/drivers/himesiki.c
@@ -269,7 +269,7 @@ GFXDECODE_END
static MACHINE_START( himesiki )
{
himesiki_state *state = machine.driver_data<himesiki_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index b3f2272f770..888cf8923f6 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -117,7 +117,7 @@ static SCREEN_UPDATE_IND16(hitpoker)
READ8_MEMBER(hitpoker_state::hitpoker_vram_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
if(m_pic_data & 0x10)
return m_videoram[offset];
@@ -127,7 +127,7 @@ READ8_MEMBER(hitpoker_state::hitpoker_vram_r)
WRITE8_MEMBER(hitpoker_state::hitpoker_vram_w)
{
-// UINT8 *ROM = machine().region("maincpu")->base();
+// UINT8 *ROM = memregion("maincpu")->base();
// if(m_sys_regs[0x00] & 0x10)
m_videoram[offset] = data;
@@ -135,7 +135,7 @@ WRITE8_MEMBER(hitpoker_state::hitpoker_vram_w)
READ8_MEMBER(hitpoker_state::hitpoker_cram_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
if(m_pic_data & 0x10)
return m_colorram[offset];
@@ -150,7 +150,7 @@ WRITE8_MEMBER(hitpoker_state::hitpoker_cram_w)
READ8_MEMBER(hitpoker_state::hitpoker_paletteram_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
if(m_pic_data & 0x10)
return m_paletteram[offset];
@@ -517,7 +517,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(hitpoker)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x1220] = 0x01; //patch eeprom write?
ROM[0x1221] = 0x01;
diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c
index e21e24e7d70..729350123e7 100644
--- a/src/mame/drivers/hnayayoi.c
+++ b/src/mame/drivers/hnayayoi.c
@@ -674,8 +674,8 @@ ROM_END
static DRIVER_INIT( hnfubuki )
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i, j;
/* interestingly, the blitter data has a slight encryption */
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 130acb4846d..cf6defe3300 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -1523,14 +1523,14 @@ static void hng64_reorder(running_machine &machine, UINT8* gfxregion, size_t gfx
static DRIVER_INIT( hng64_reorder_gfx )
{
- hng64_reorder(machine, machine.region("scrtile")->base(), machine.region("scrtile")->bytes());
+ hng64_reorder(machine, machine.root_device().memregion("scrtile")->base(), machine.root_device().memregion("scrtile")->bytes());
}
#define HACK_REGION
#ifdef HACK_REGION
static void hng64_patch_bios_region(running_machine& machine, int region)
{
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("user1")->base();
if ((rom[0x4000]==0xff) && (rom[0x4001] == 0xff))
{
@@ -1576,7 +1576,7 @@ static DRIVER_INIT( fatfurwa )
{
hng64_state *state = machine.driver_data<hng64_state>();
- /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(machine.region("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
+ /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(state->memregion("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
DRIVER_INIT_CALL(hng64_fght);
state->m_mcu_type = FIGHT_MCU;
}
@@ -1661,7 +1661,7 @@ static MACHINE_RESET(hyperneo)
{
hng64_state *state = machine.driver_data<hng64_state>();
int i;
- const UINT8 *rom = machine.region("user2")->base();
+ const UINT8 *rom = state->memregion("user2")->base();
/* Sound CPU */
UINT8 *RAM = (UINT8*)state->m_soundram;
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index b20e934f59a..afc00c1e370 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -291,7 +291,7 @@ READ8_MEMBER(homedata_state::mrokumei_sound_io_r)
if (m_sndbank & 4)
return(soundlatch_byte_r(space, 0));
else
- return machine().region("audiocpu")->base()[0x10000 + offset + (m_sndbank & 1) * 0x10000];
+ return memregion("audiocpu")->base()[0x10000 + offset + (m_sndbank & 1) * 0x10000];
}
WRITE8_MEMBER(homedata_state::mrokumei_sound_bank_w)
@@ -509,7 +509,7 @@ WRITE8_MEMBER(homedata_state::pteacher_upd7807_portc_w)
WRITE8_MEMBER(homedata_state::bankswitch_w)
{
- int last_bank = (machine().region("maincpu")->bytes() - 0x10000) / 0x4000;
+ int last_bank = (machine().root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
/* last bank is fixed and is #0 for us, other banks start from #1 (hence data+1 below)*/
if (data < last_bank)
@@ -1149,10 +1149,10 @@ static MACHINE_START( homedata )
static MACHINE_START( reikaids )
{
homedata_state *state = machine.driver_data<homedata_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0xc000], 0x4000);
- state->membank("bank2")->configure_entries(0, 4, machine.region("audiocpu")->base(), 0x10000);
+ state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
@@ -1166,10 +1166,10 @@ static MACHINE_START( reikaids )
static MACHINE_START( pteacher )
{
homedata_state *state = machine.driver_data<homedata_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
- state->membank("bank2")->configure_entries(0, 4, machine.region("audiocpu")->base(), 0x10000);
+ state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
diff --git a/src/mame/drivers/homerun.c b/src/mame/drivers/homerun.c
index 29454b17907..e73d6845024 100644
--- a/src/mame/drivers/homerun.c
+++ b/src/mame/drivers/homerun.c
@@ -193,7 +193,7 @@ GFXDECODE_END
static MACHINE_START( homerun )
{
homerun_state *state = machine.driver_data<homerun_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entry(0, &ROM[0x00000]);
state->membank("bank1")->configure_entries(1, 7, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index f9540f79aa8..5d5b0e67924 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -597,7 +597,7 @@ WRITE32_MEMBER(hornet_state::comm1_w)
WRITE32_MEMBER(hornet_state::comm_rombank_w)
{
int bank = data >> 24;
- UINT8 *usr3 = machine().region("user3")->base();
+ UINT8 *usr3 = memregion("user3")->base();
if (usr3 != NULL)
membank("bank1")->set_entry(bank & 0x7f);
}
@@ -893,11 +893,11 @@ static MACHINE_START( hornet )
static MACHINE_RESET( hornet )
{
- UINT8 *usr3 = machine.region("user3")->base();
- UINT8 *usr5 = machine.region("user5")->base();
+ UINT8 *usr3 = machine.root_device().memregion("user3")->base();
+ UINT8 *usr5 = machine.root_device().memregion("user5")->base();
if (usr3 != NULL)
{
- machine.root_device().membank("bank1")->configure_entries(0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ machine.root_device().membank("bank1")->configure_entries(0, machine.root_device().memregion("user3")->bytes() / 0x40000, usr3, 0x40000);
machine.root_device().membank("bank1")->set_entry(0);
}
@@ -1014,12 +1014,12 @@ MACHINE_CONFIG_END
static MACHINE_RESET( hornet_2board )
{
- UINT8 *usr3 = machine.region("user3")->base();
- UINT8 *usr5 = machine.region("user5")->base();
+ UINT8 *usr3 = machine.root_device().memregion("user3")->base();
+ UINT8 *usr5 = machine.root_device().memregion("user5")->base();
if (usr3 != NULL)
{
- machine.root_device().membank("bank1")->configure_entries(0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ machine.root_device().membank("bank1")->configure_entries(0, machine.root_device().memregion("user3")->bytes() / 0x40000, usr3, 0x40000);
machine.root_device().membank("bank1")->set_entry(0);
}
cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
@@ -1244,7 +1244,7 @@ static DRIVER_INIT(hornet)
{
hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
@@ -1255,8 +1255,8 @@ static DRIVER_INIT(hornet_2board)
{
hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
diff --git a/src/mame/drivers/hshavoc.c b/src/mame/drivers/hshavoc.c
index 264c7804dec..356f4a65e14 100644
--- a/src/mame/drivers/hshavoc.c
+++ b/src/mame/drivers/hshavoc.c
@@ -119,7 +119,7 @@ static DRIVER_INIT(hshavoc)
{
int x;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
static const UINT16 typedat[16] = {
1,1,1,1, 1,1,1,1,
diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c
index 8c552f21674..6a8df189574 100644
--- a/src/mame/drivers/hvyunit.c
+++ b/src/mame/drivers/hvyunit.c
@@ -216,7 +216,7 @@ WRITE8_MEMBER(hvyunit_state::trigger_nmi_on_slave_cpu)
WRITE8_MEMBER(hvyunit_state::master_bankswitch_w)
{
- unsigned char *ROM = machine().region("master")->base();
+ unsigned char *ROM = memregion("master")->base();
int bank = data & 7;
ROM = &ROM[0x4000 * bank];
membank("bank1")->set_base(ROM);
@@ -275,7 +275,7 @@ WRITE8_MEMBER(hvyunit_state::hu_colorram_w)
WRITE8_MEMBER(hvyunit_state::slave_bankswitch_w)
{
- unsigned char *ROM = machine().region("slave")->base();
+ unsigned char *ROM = memregion("slave")->base();
int bank = (data & 0x03);
m_port0_data = data;
ROM = &ROM[0x4000 * bank];
@@ -308,7 +308,7 @@ WRITE8_MEMBER(hvyunit_state::coin_count_w)
WRITE8_MEMBER(hvyunit_state::sound_bankswitch_w)
{
- unsigned char *ROM = machine().region("soundcpu")->base();
+ unsigned char *ROM = memregion("soundcpu")->base();
int bank = data & 0x3;
ROM = &ROM[0x4000 * bank];
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index 0558644587f..fa66282400a 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -201,8 +201,8 @@ static TIMER_CALLBACK( magerror_irq_callback )
READ16_MEMBER(hyprduel_state::hyprduel_bankedrom_r)
{
- UINT8 *ROM = machine().region("gfx1")->base();
- size_t len = machine().region("gfx1")->bytes();
+ UINT8 *ROM = memregion("gfx1")->base();
+ size_t len = memregion("gfx1")->bytes();
offset = offset * 2 + 0x10000 * (*m_rombank);
@@ -286,8 +286,8 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
if (offset == 0xc / 2)
{
- UINT8 *src = machine().region("gfx1")->base();
- size_t src_len = machine().region("gfx1")->bytes();
+ UINT8 *src = memregion("gfx1")->base();
+ size_t src_len = memregion("gfx1")->bytes();
UINT32 tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2];
UINT32 src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2];
diff --git a/src/mame/drivers/ichiban.c b/src/mame/drivers/ichiban.c
index 543395f4eb7..30b259cac8e 100644
--- a/src/mame/drivers/ichiban.c
+++ b/src/mame/drivers/ichiban.c
@@ -104,7 +104,7 @@ GFXDECODE_END
void ichibanjyan_state::machine_start()
{
- UINT8 *ROM = machine().region("code")->base();
+ UINT8 *ROM = memregion("code")->base();
membank("bank1")->configure_entries(0, 4, ROM, 0x8000);
}
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index fe865e391eb..9e30a1ec8f4 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -783,8 +783,8 @@ ROM_END
static DRIVER_INIT( jingbell )
{
int i;
- UINT8 *rom = (UINT8 *)machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *rom = (UINT8 *)machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
for (i=0; i<size; i++)
{
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index d18249fe0d6..3b50c1e7c18 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -415,10 +415,10 @@ WRITE16_MEMBER(igs011_state::igs011_blit_flags_w)
UINT8 trans_pen, clear_pen, pen_hi, *dest;
UINT8 pen = 0;
- UINT8 *gfx = machine().region("blitter")->base();
- UINT8 *gfx2 = machine().region("blitter_hi")->base();
- int gfx_size = machine().region("blitter")->bytes();
- int gfx2_size = machine().region("blitter_hi")->bytes();
+ UINT8 *gfx = memregion("blitter")->base();
+ UINT8 *gfx2 = memregion("blitter_hi")->base();
+ int gfx_size = memregion("blitter")->bytes();
+ int gfx2_size = memregion("blitter_hi")->bytes();
const rectangle &clip = machine().primary_screen->visible_area();
@@ -559,7 +559,7 @@ READ16_MEMBER(igs011_state::igs_5_dips_r){ return igs_dips_r(5); }
static void wlcc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -583,7 +583,7 @@ static void wlcc_decrypt(running_machine &machine)
static void lhb_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -608,7 +608,7 @@ static void lhb_decrypt(running_machine &machine)
static void drgnwrld_type3_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -636,7 +636,7 @@ static void drgnwrld_type3_decrypt(running_machine &machine)
static void drgnwrld_type2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -669,7 +669,7 @@ static void drgnwrld_type2_decrypt(running_machine &machine)
static void drgnwrld_type1_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -699,7 +699,7 @@ static void lhb2_decrypt(running_machine &machine)
{
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -740,7 +740,7 @@ static void nkishusp_decrypt(running_machine &machine)
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -770,7 +770,7 @@ static void nkishusp_decrypt(running_machine &machine)
static void vbowlj_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -804,7 +804,7 @@ static void vbowlj_decrypt(running_machine &machine)
static void dbc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -854,7 +854,7 @@ static void dbc_decrypt(running_machine &machine)
static void ryukobou_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
for (i=0; i<rom_size/2; i++)
@@ -886,7 +886,7 @@ static void lhb2_decrypt_gfx(running_machine &machine)
{
int i;
unsigned rom_size = 0x200000;
- UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -901,7 +901,7 @@ static void drgnwrld_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x400000;
- UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -1014,7 +1014,7 @@ WRITE16_MEMBER(igs011_state::igs011_prot_addr_w)
// m_prot2 = 0x00;
address_space *sp = machine().device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
// Plug previous address range with ROM access
sp->install_rom(m_prot1_addr + 0, m_prot1_addr + 9, rom + m_prot1_addr);
@@ -1757,7 +1757,7 @@ READ16_MEMBER(igs011_state::vbowl_igs003_r)
// V0400O
static DRIVER_INIT( drgnwrld )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1783,7 +1783,7 @@ static DRIVER_INIT( drgnwrld )
static DRIVER_INIT( drgnwrldv30 )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1808,7 +1808,7 @@ static DRIVER_INIT( drgnwrldv30 )
static DRIVER_INIT( drgnwrldv21 )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type2_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1838,7 +1838,7 @@ static DRIVER_INIT( drgnwrldv21 )
static DRIVER_INIT( drgnwrldv21j )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1865,7 +1865,7 @@ static DRIVER_INIT( drgnwrldv21j )
static DRIVER_INIT( drgnwrldv20j )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1903,7 +1903,7 @@ static DRIVER_INIT( drgnwrldv11h )
static DRIVER_INIT( drgnwrldv10c )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1929,7 +1929,7 @@ static DRIVER_INIT( drgnwrldv10c )
static DRIVER_INIT( lhb )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb_decrypt(machine);
@@ -1939,7 +1939,7 @@ static DRIVER_INIT( lhb )
static DRIVER_INIT( lhbv33c )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb_decrypt(machine);
@@ -1949,7 +1949,7 @@ static DRIVER_INIT( lhbv33c )
static DRIVER_INIT( dbc )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
dbc_decrypt(machine);
@@ -1979,7 +1979,7 @@ static DRIVER_INIT( dbc )
static DRIVER_INIT( ryukobou )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
ryukobou_decrypt(machine);
@@ -1993,7 +1993,7 @@ static DRIVER_INIT( ryukobou )
static DRIVER_INIT( xymg )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb_decrypt(machine);
/*
@@ -2027,7 +2027,7 @@ static DRIVER_INIT( xymg )
static DRIVER_INIT( wlcc )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
wlcc_decrypt(machine);
/*
@@ -2051,7 +2051,7 @@ static DRIVER_INIT( wlcc )
static DRIVER_INIT( lhb2 )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb2_decrypt(machine);
lhb2_decrypt_gfx(machine);
@@ -2073,8 +2073,8 @@ static DRIVER_INIT( lhb2 )
static DRIVER_INIT( vbowl )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.root_device().memregion("blitter")->base();
int i;
vbowlj_decrypt(machine);
@@ -2098,8 +2098,8 @@ static DRIVER_INIT( vbowl )
static DRIVER_INIT( vbowlj )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.root_device().memregion("blitter")->base();
int i;
vbowlj_decrypt(machine);
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index e81877deee1..ce1f5ae7760 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -219,8 +219,8 @@ WRITE16_MEMBER(igs017_state::spriteram_lsb_w)
static void expand_sprites(running_machine &machine)
{
igs017_state *state = machine.driver_data<igs017_state>();
- UINT8 *rom = machine.region("sprites")->base();
- int size = machine.region("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
+ int size = state->memregion("sprites")->bytes();
int i;
state->m_sprites_gfx_size = size / 2 * 3;
@@ -421,8 +421,8 @@ static SCREEN_UPDATE_IND16( igs017 )
static void decrypt_program_rom(running_machine &machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
{
- int length = machine.region("maincpu")->bytes();
- UINT8 *rom = machine.region("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -474,7 +474,7 @@ static void decrypt_program_rom(running_machine &machine, int mask, int a7, int
static void iqblocka_patch_rom(running_machine &machine)
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// rom[0x7b64] = 0xc9;
@@ -515,8 +515,8 @@ static DRIVER_INIT( iqblockf )
static void tjsb_decrypt_sprites(running_machine &machine)
{
- int length = machine.region("sprites")->bytes();
- UINT8 *rom = machine.region("sprites")->base();
+ int length = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i, addr;
@@ -551,7 +551,7 @@ static DRIVER_INIT( tjsb )
static void mgcs_decrypt_program_rom(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
@@ -600,8 +600,8 @@ static void mgcs_decrypt_program_rom(running_machine &machine)
static void mgcs_decrypt_tiles(running_machine &machine)
{
- int length = machine.region("tilemaps")->bytes();
- UINT8 *rom = machine.region("tilemaps")->base();
+ int length = machine.root_device().memregion("tilemaps")->bytes();
+ UINT8 *rom = machine.root_device().memregion("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -617,8 +617,8 @@ static void mgcs_decrypt_tiles(running_machine &machine)
static void mgcs_flip_sprites(running_machine &machine)
{
- int length = machine.region("sprites")->bytes();
- UINT8 *rom = machine.region("sprites")->base();
+ int length = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
int i;
for (i = 0;i < length;i+=2)
@@ -638,7 +638,7 @@ static void mgcs_flip_sprites(running_machine &machine)
static void mgcs_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x4e036/2] = 0x6006;
@@ -664,7 +664,7 @@ static DRIVER_INIT( mgcs )
// decryption is incomplete, the first part of code doesn't seem right.
static DRIVER_INIT( tarzan )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int i;
int size = 0x40000;
@@ -690,7 +690,7 @@ static DRIVER_INIT( tarzan )
// by iq_132
static DRIVER_INIT( tarzana )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
int size = 0x80000;
@@ -763,7 +763,7 @@ static DRIVER_INIT( starzan )
{
int size = 0x040000;
- UINT8 *data = machine.region("maincpu")->base();
+ UINT8 *data = machine.root_device().memregion("maincpu")->base();
UINT8 *code = auto_alloc_array(machine, UINT8, size);
memcpy(code, data, size);
@@ -781,7 +781,7 @@ static DRIVER_INIT( starzan )
static DRIVER_INIT( sdmg2 )
{
int i;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
@@ -838,7 +838,7 @@ static DRIVER_INIT( sdmg2 )
static DRIVER_INIT( mgdha )
{
int i;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
@@ -873,7 +873,7 @@ static DRIVER_INIT( mgdh )
{
DRIVER_INIT_CALL( mgdha );
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// additional protection
rom[0x4ad50/2] = 0x4e71;
@@ -885,7 +885,7 @@ static DRIVER_INIT( mgdh )
static void lhzb2_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Prot. checks:
rom[0x14786/2] = 0x6044; // 014786: 6744 beq $147cc
@@ -896,8 +896,8 @@ static void lhzb2_patch_rom(running_machine &machine)
static void lhzb2_decrypt_tiles(running_machine &machine)
{
- int length = machine.region("tilemaps")->bytes();
- UINT8 *rom = machine.region("tilemaps")->base();
+ int length = machine.root_device().memregion("tilemaps")->bytes();
+ UINT8 *rom = machine.root_device().memregion("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -914,8 +914,8 @@ static void lhzb2_decrypt_tiles(running_machine &machine)
static void lhzb2_decrypt_sprites(running_machine &machine)
{
- int length = machine.region("sprites")->bytes();
- UINT8 *rom = machine.region("sprites")->base();
+ int length = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i, addr;
@@ -940,7 +940,7 @@ static void lhzb2_decrypt_sprites(running_machine &machine)
static DRIVER_INIT( lhzb2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -1033,7 +1033,7 @@ static DRIVER_INIT( lhzb2 )
static void lhzb2a_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Prot. checks:
rom[0x09c52/2] = 0x6026; // 009C52: 6726 beq $9c7a
@@ -1049,7 +1049,7 @@ static void lhzb2a_patch_rom(running_machine &machine)
static DRIVER_INIT( lhzb2a )
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -1114,7 +1114,7 @@ static DRIVER_INIT( lhzb2a )
static void slqz2_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Prot. checks:
rom[0x1489c/2] = 0x6044; // 01489C: 6744 beq $148e2
@@ -1125,8 +1125,8 @@ static void slqz2_patch_rom(running_machine &machine)
static void slqz2_decrypt_tiles(running_machine &machine)
{
- int length = machine.region("tilemaps")->bytes();
- UINT8 *rom = machine.region("tilemaps")->base();
+ int length = machine.root_device().memregion("tilemaps")->bytes();
+ UINT8 *rom = machine.root_device().memregion("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -1143,7 +1143,7 @@ static void slqz2_decrypt_tiles(running_machine &machine)
static DRIVER_INIT( slqz2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c
index 8bf2214a7b9..2aedb1ec1c5 100644
--- a/src/mame/drivers/igs_m027.c
+++ b/src/mame/drivers/igs_m027.c
@@ -254,7 +254,7 @@ static void sdwx_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x80000;
- UINT8 *src = (UINT8 *) (machine.region("gfx1")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("gfx1")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -758,7 +758,7 @@ ROM_END
static void pgm_create_dummy_internal_arm_region(running_machine &machine)
{
- UINT16 *temp16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// fill with RX 14
int i;
@@ -785,7 +785,7 @@ static void sdwx_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -831,7 +831,7 @@ static const UINT8 hauntedh_tab[0x100] = {
static void hauntedh_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x080000;
@@ -876,7 +876,7 @@ static const UINT8 chessc2_tab[0x100] = {
static void chessc2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -921,7 +921,7 @@ static const UINT8 klxyj_tab[0x100] = {
static void klxyj_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -965,7 +965,7 @@ static const UINT8 big2_tab[0x100] = {
static void big2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1009,7 +1009,7 @@ static const UINT8 gonefsh2_tab[0x100] = {
static void gonefsh2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1053,7 +1053,7 @@ static const UINT8 sddz_tab[0x100] = {
static void sddz_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1097,7 +1097,7 @@ static const UINT8 lhzb3_tab[0x100] = {
static void lhzb3_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1141,7 +1141,7 @@ static const UINT8 mgfx_tab[0x100] = {
static void mgfx_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1185,7 +1185,7 @@ static const UINT8 lhzb4_tab[0x100] = {
static void lhzb4_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index a8854f64223..6f51f76859f 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -343,7 +343,7 @@ CUSTOM_INPUT_MEMBER(igspoker_state::hopper_r)
READ8_MEMBER(igspoker_state::exp_rom_r)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
return rom[offset+0x10000];
}
@@ -1919,7 +1919,7 @@ ROM_END
static DRIVER_INIT( cpoker )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1933,7 +1933,7 @@ static DRIVER_INIT( cpoker )
static DRIVER_INIT( cpokert )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -1963,7 +1963,7 @@ static DRIVER_INIT( cpokert )
static DRIVER_INIT( cska )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1980,7 +1980,7 @@ static DRIVER_INIT( cska )
static DRIVER_INIT( igs_ncs )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -2141,7 +2141,7 @@ Clocks
static DRIVER_INIT( igs_ncs2 )
{
- UINT8 *src = (UINT8 *) (machine.region("maincpu")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("maincpu")->base());
int i;
for(i = 0; i < 0x10000; i++)
@@ -2218,8 +2218,8 @@ static DRIVER_INIT( chleague )
int length;
UINT8 *rom;
- rom = machine.region("maincpu")->base();
- length = machine.region("maincpu")->bytes();
+ rom = machine.root_device().memregion("maincpu")->base();
+ length = machine.root_device().memregion("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2282,8 +2282,8 @@ static DRIVER_INIT( number10 )
UINT8 *tmp;
UINT8 *rom;
- rom = machine.region("maincpu")->base();
- length = machine.region("maincpu")->bytes();
+ rom = machine.root_device().memregion("maincpu")->base();
+ length = machine.root_device().memregion("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2312,8 +2312,8 @@ static DRIVER_INIT( number10 )
rom[0xeed] = 0xc3;
/* Descramble graphic */
- rom = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ rom = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
tmp = auto_alloc_array(machine, UINT8, length);
memcpy(tmp,rom,length);
for (A = 0;A < length;A++)
@@ -2361,7 +2361,7 @@ ROM_END
static DRIVER_INIT( cpokerpk )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A=0x0714; A < 0xF000; A+=0x1000)
rom[A] ^= 0x20;
@@ -2415,7 +2415,7 @@ ROM_END
static DRIVER_INIT( pktet346 )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
diff --git a/src/mame/drivers/intrscti.c b/src/mame/drivers/intrscti.c
index 692fdb2fade..a1471e38ed2 100644
--- a/src/mame/drivers/intrscti.c
+++ b/src/mame/drivers/intrscti.c
@@ -131,7 +131,7 @@ ROM_END
static DRIVER_INIT( intrscti )
{
- UINT8 *cpu = machine.region( "maincpu" )->base();
+ UINT8 *cpu = machine.root_device().memregion( "maincpu" )->base();
int i;
for (i=0x8000;i<0x8fff;i++)
{
diff --git a/src/mame/drivers/inufuku.c b/src/mame/drivers/inufuku.c
index 9cc9d1cb28f..60eeafe064b 100644
--- a/src/mame/drivers/inufuku.c
+++ b/src/mame/drivers/inufuku.c
@@ -314,7 +314,7 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( inufuku )
{
inufuku_state *state = machine.driver_data<inufuku_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/iqblock.c b/src/mame/drivers/iqblock.c
index e5dcfdb307e..1c00afaa917 100644
--- a/src/mame/drivers/iqblock.c
+++ b/src/mame/drivers/iqblock.c
@@ -95,7 +95,7 @@ WRITE8_MEMBER(iqblock_state::iqblock_irqack_w)
READ8_MEMBER(iqblock_state::extrarom_r)
{
- return machine().region("user1")->base()[offset];
+ return memregion("user1")->base()[offset];
}
@@ -431,7 +431,7 @@ ROM_END
static DRIVER_INIT( iqblock )
{
iqblock_state *state = machine.driver_data<iqblock_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -454,7 +454,7 @@ static DRIVER_INIT( iqblock )
static DRIVER_INIT( grndtour )
{
iqblock_state *state = machine.driver_data<iqblock_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
/* decrypt the program ROM */
diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c
index 9f3b79b2d9a..67eaf6f15a1 100644
--- a/src/mame/drivers/istellar.c
+++ b/src/mame/drivers/istellar.c
@@ -274,7 +274,7 @@ INPUT_PORTS_END
static PALETTE_INIT( istellar )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* Oddly enough, the top 4 bits of each byte is 0 */
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index f7cc08901bd..de20516833e 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -625,7 +625,7 @@ READ32_MEMBER(itech32_state::gtclass_prot_result_r)
WRITE8_MEMBER(itech32_state::sound_bank_w)
{
- membank("bank1")->set_base(&machine().region("soundcpu")->base()[0x10000 + data * 0x4000]);
+ membank("bank1")->set_base(&machine().root_device().memregion("soundcpu")->base()[0x10000 + data * 0x4000]);
}
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index 4daeb5f0487..73ff7a54ead 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -657,7 +657,7 @@ static MACHINE_RESET( itech8 )
/* make sure bank 0 is selected */
if (main_cpu_type == M6809 || main_cpu_type == HD6309)
{
- state->membank("bank1")->set_base(&machine.region("maincpu")->base()[0x4000]);
+ state->membank("bank1")->set_base(&state->memregion("maincpu")->base()[0x4000]);
machine.device("maincpu")->reset();
}
@@ -705,7 +705,7 @@ WRITE8_MEMBER(itech8_state::blitter_w)
{
/* bit 0x20 on address 7 controls CPU banking */
if (offset / 2 == 7)
- membank("bank1")->set_base(&machine().region("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
/* the rest is handled by the video hardware */
itech8_blitter_w(space, offset, data);
@@ -715,7 +715,7 @@ WRITE8_MEMBER(itech8_state::blitter_w)
WRITE8_MEMBER(itech8_state::rimrockn_bank_w)
{
/* banking is controlled here instead of by the blitter output */
- membank("bank1")->set_base(&machine().region("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
}
diff --git a/src/mame/drivers/itgambl2.c b/src/mame/drivers/itgambl2.c
index c7ca873ce7c..4fc4bbaf6f3 100644
--- a/src/mame/drivers/itgambl2.c
+++ b/src/mame/drivers/itgambl2.c
@@ -86,7 +86,7 @@ static SCREEN_UPDATE_RGB32( itgambl2 )
{
itgambl2_state *state = screen.machine().driver_data<itgambl2_state>();
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("gfx1")->base();
+ const UINT8 *blit_ram = state->memregion("gfx1")->base();
if(screen.machine().input().code_pressed(KEYCODE_Z))
state->m_test_x++;
diff --git a/src/mame/drivers/itgambl3.c b/src/mame/drivers/itgambl3.c
index 6a19248aa15..30801e5a934 100644
--- a/src/mame/drivers/itgambl3.c
+++ b/src/mame/drivers/itgambl3.c
@@ -74,7 +74,7 @@ static SCREEN_UPDATE_RGB32( itgambl3 )
{
itgambl3_state *state = screen.machine().driver_data<itgambl3_state>();
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("gfx1")->base();
+ const UINT8 *blit_ram = state->memregion("gfx1")->base();
if(screen.machine().input().code_pressed(KEYCODE_Z))
state->m_test_x++;
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 4529a594adf..acff3f65694 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -109,7 +109,7 @@ READ8_MEMBER(jack_state::striv_question_r)
// Read the actual byte from question roms
else
{
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
int real_address;
real_address = m_question_address | (offset & 0x3f0) | m_remap_address[offset & 0x0f];
@@ -1298,7 +1298,7 @@ static void treahunt_decode( running_machine &machine )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x4000);
int data;
@@ -1373,7 +1373,7 @@ static DRIVER_INIT( loverboy )
code, the protection device is disabled or changes behaviour via
writes at 0xf000 and 0xf008. -AS
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
ROM[0x13] = 0x01;
ROM[0x12] = 0x9d;
@@ -1384,7 +1384,7 @@ static DRIVER_INIT( loverboy )
static DRIVER_INIT( striv )
{
jack_state *state = machine.driver_data<jack_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 data;
int A;
diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c
index 7f75e890a8f..67c9fa64dd1 100644
--- a/src/mame/drivers/jackal.c
+++ b/src/mame/drivers/jackal.c
@@ -114,7 +114,7 @@ READ8_MEMBER(jackal_state::jackal_spriteram_r)
WRITE8_MEMBER(jackal_state::jackal_rambank_w)
{
- UINT8 *rgn = machine().region("master")->base();
+ UINT8 *rgn = memregion("master")->base();
if (data & 0x04)
popmessage("jackal_rambank_w %02x", data);
@@ -328,7 +328,7 @@ static INTERRUPT_GEN( jackal_interrupt )
static MACHINE_START( jackal )
{
jackal_state *state = machine.driver_data<jackal_state>();
- UINT8 *ROM = machine.region("master")->base();
+ UINT8 *ROM = state->memregion("master")->base();
state->membank("bank1")->configure_entry(0, &ROM[0x04000]);
state->membank("bank1")->configure_entry(1, &ROM[0x14000]);
@@ -343,7 +343,7 @@ static MACHINE_START( jackal )
static MACHINE_RESET( jackal )
{
jackal_state *state = machine.driver_data<jackal_state>();
- UINT8 *rgn = machine.region("master")->base();
+ UINT8 *rgn = state->memregion("master")->base();
// HACK: running at the nominal clock rate, music stops working
// at the beginning of the game. This fixes it.
diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c
index ab756f5ae7c..38da3b5c1b2 100644
--- a/src/mame/drivers/jackie.c
+++ b/src/mame/drivers/jackie.c
@@ -346,7 +346,7 @@ WRITE8_MEMBER(jackie_state::igs_irqack_w)
READ8_MEMBER(jackie_state::expram_r)
{
- UINT8 *rom = machine().region("gfx3")->base();
+ UINT8 *rom = memregion("gfx3")->base();
offset += m_exp_bank * 0x8000;
// logerror("PC %06X: %04x = %02x\n",cpu_get_pc(&space.device()),offset,rom[offset]);
@@ -540,7 +540,7 @@ static DRIVER_INIT( jackie )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0xf000;A++)
{
diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c
index 4f5e32b5c1e..a40d539c841 100644
--- a/src/mame/drivers/jackpool.c
+++ b/src/mame/drivers/jackpool.c
@@ -296,7 +296,7 @@ ROM_END
static DRIVER_INIT( jackpool )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/* patch NVRAM routine */
rom[0x9040/2] = 0x6602;
diff --git a/src/mame/drivers/jaguar.c b/src/mame/drivers/jaguar.c
index bc1f29b9313..87c91597a1e 100644
--- a/src/mame/drivers/jaguar.c
+++ b/src/mame/drivers/jaguar.c
@@ -491,7 +491,7 @@ static IRQ_CALLBACK(jaguar_irq_callback)
static MACHINE_RESET( cojag )
{
cojag_state *state = machine.driver_data<cojag_state>();
- UINT8 *rom = machine.region("user2")->base();
+ UINT8 *rom = state->memregion("user2")->base();
/* 68020 only: copy the interrupt vectors into RAM */
if (!cojag_is_r3000)
@@ -719,7 +719,7 @@ WRITE32_MEMBER(cojag_state::misc_control_w)
}
/* adjust banking */
- if (machine().region("user2")->base())
+ if (machine().root_device().memregion("user2")->base())
{
membank("bank2")->set_entry((data >> 1) & 7);
membank("bank9")->set_entry((data >> 1) & 7);
@@ -899,7 +899,7 @@ WRITE32_MEMBER(cojag_state::latch_w)
logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(&space.device()), data);
/* adjust banking */
- if (machine().region("user2")->base())
+ if (machine().root_device().memregion("user2")->base())
{
if (cojag_is_r3000)
membank("bank1")->set_entry(data & 1);
@@ -1831,7 +1831,7 @@ MACHINE_CONFIG_END
static void jaguar_fix_endian( running_machine &machine, UINT32 addr, UINT32 size )
{
- UINT8 j[4], *RAM = machine.region("maincpu")->base();
+ UINT8 j[4], *RAM = machine.root_device().memregion("maincpu")->base();
UINT32 i;
size += addr;
logerror("File Loaded to address range %X to %X\n",addr,size-1);
@@ -1871,7 +1871,7 @@ static QUICKLOAD_LOAD( jaguar )
memset(jaguar_shared_ram, 0, 0x200000);
quickload_size = MIN(quickload_size, 0x200000 - quickload_begin);
- image.fread( &image.device().machine().region("maincpu")->base()[quickload_begin], quickload_size);
+ image.fread( &image.device().machine().root_device().memregion("maincpu")->base()[quickload_begin], quickload_size);
jaguar_fix_endian(image.device().machine(), quickload_begin, quickload_size);
@@ -1916,7 +1916,7 @@ static QUICKLOAD_LOAD( jaguar )
{
memset(jaguar_shared_ram, 0, 0x200000);
image.fseek(0, SEEK_SET);
- image.fread( &image.device().machine().region("maincpu")->base()[start-skip], quickload_size);
+ image.fread( &image.device().machine().root_device().memregion("maincpu")->base()[start-skip], quickload_size);
quickload_begin = start;
jaguar_fix_endian(image.device().machine(), (start-skip)&0xfffffc, quickload_size);
}
@@ -1955,7 +1955,7 @@ static DEVICE_IMAGE_LOAD( jaguar )
}
/* Load cart into memory */
- image.fread( &image.device().machine().region("maincpu")->base()[0x800000+load_offset], size);
+ image.fread( &image.device().machine().root_device().memregion("maincpu")->base()[0x800000+load_offset], size);
}
else
{
diff --git a/src/mame/drivers/jailbrek.c b/src/mame/drivers/jailbrek.c
index b0a57de5269..8658af1ffb0 100644
--- a/src/mame/drivers/jailbrek.c
+++ b/src/mame/drivers/jailbrek.c
@@ -404,7 +404,7 @@ ROM_END
static DRIVER_INIT( jailbrek )
{
- UINT8 *SPEECH_ROM = machine.region("vlm")->base();
+ UINT8 *SPEECH_ROM = machine.root_device().memregion("vlm")->base();
int ind;
/*
@@ -416,7 +416,7 @@ static DRIVER_INIT( jailbrek )
represents address line A13.)
*/
- if (machine.region("vlm")->bytes() == 0x4000)
+ if (machine.root_device().memregion("vlm")->bytes() == 0x4000)
{
for (ind = 0; ind < 0x2000; ++ind)
{
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 9b9693edf7e..7dc61aad3f8 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -353,7 +353,7 @@ priority = 8, then 4, 2 and finally 1).
static void jalmah_priority_system(running_machine &machine)
{
jalmah_state *state = machine.driver_data<jalmah_state>();
- UINT8 *pri_rom = machine.region("user1")->base();
+ UINT8 *pri_rom = state->memregion("user1")->base();
UINT8 i;
UINT8 prinum[0x10];
@@ -950,7 +950,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okirom_w)
{
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = machine().region("oki")->base();
+ UINT8 *oki = memregion("oki")->base();
m_oki_rom = data & 1;
@@ -967,7 +967,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okibank_w)
{
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = machine().region("oki")->base();
+ UINT8 *oki = memregion("oki")->base();
m_oki_bank = data & 3;
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index 7ed9038bbab..1f8cc272dcd 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -89,7 +89,7 @@ public:
/* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */
static PALETTE_INIT( jangou )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double weights_rg[3], weights_b[2];
@@ -168,7 +168,7 @@ w [$17]
static UINT8 jangou_gfx_nibble( running_machine &machine, UINT16 niboffset )
{
- const UINT8 *const blit_rom = machine.region("gfx")->base();
+ const UINT8 *const blit_rom = machine.root_device().memregion("gfx")->base();
if (niboffset & 1)
return (blit_rom[(niboffset >> 1) & 0xffff] & 0xf0) >> 4;
@@ -1371,7 +1371,7 @@ static DRIVER_INIT (luckygrl)
{
// this is WRONG
int A;
- UINT8 *ROM = machine.region("cpu0")->base();
+ UINT8 *ROM = machine.root_device().memregion("cpu0")->base();
unsigned char patn1[32] = {
0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0,
diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c
index 6ceb5dfe048..733bfc2d2f8 100644
--- a/src/mame/drivers/jantotsu.c
+++ b/src/mame/drivers/jantotsu.c
@@ -200,7 +200,7 @@ WRITE8_MEMBER(jantotsu_state::bankaddr_w)
static PALETTE_INIT( jantotsu )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2, r, g, b;
int i;
@@ -300,7 +300,7 @@ static void jan_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index 53d91ac59dd..cbf6caa1ad5 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -394,8 +394,8 @@ static SCREEN_UPDATE_IND16(jchan)
state->m_sprite_bitmap_1->fill(0x0000, cliprect);
state->m_sprite_bitmap_2->fill(0x0000, cliprect);
- state->m_spritegen1->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_sprite_regs32_1 );
- state->m_spritegen2->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen.machine().region("gfx2")->base(), screen.machine().region ("gfx2")->bytes(), state->m_sprite_regs32_2 );
+ state->m_spritegen1->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), state->m_sprite_regs32_1 );
+ state->m_spritegen2->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen.machine().root_device().memregion("gfx2")->base(), state->memregion ("gfx2")->bytes(), state->m_sprite_regs32_2 );
// ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes
for (y=0;y<240;y++)
diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c
index a590bf4d13c..33f76fc495e 100644
--- a/src/mame/drivers/jedi.c
+++ b/src/mame/drivers/jedi.c
@@ -162,7 +162,7 @@ static MACHINE_START( jedi )
state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(32), 32);
/* configure the banks */
- state->membank("bank1")->configure_entries(0, 3, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 3, state->memregion("maincpu")->base() + 0x10000, 0x4000);
/* set up save state */
state->save_item(NAME(state->m_nvram_enabled));
diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c
index 40945cb4308..14bfd7238a8 100644
--- a/src/mame/drivers/jokrwild.c
+++ b/src/mame/drivers/jokrwild.c
@@ -553,7 +553,7 @@ static DRIVER_INIT( jokrwild )
*****************************************************************************/
{
int i, offs;
- UINT8 *srcp = machine.region( "maincpu" )->base();
+ UINT8 *srcp = machine.root_device().memregion( "maincpu" )->base();
for (i = 0x8000; i < 0x10000; i++)
{
diff --git a/src/mame/drivers/jollyjgr.c b/src/mame/drivers/jollyjgr.c
index 0ca9bed75be..5b99e4dd576 100644
--- a/src/mame/drivers/jollyjgr.c
+++ b/src/mame/drivers/jollyjgr.c
@@ -402,7 +402,7 @@ INPUT_PORTS_END
static PALETTE_INIT( jollyjgr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* tilemap / sprites palette */
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index 44f98d71e19..e96d0cb2755 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -430,7 +430,7 @@ INPUT_PORTS_END
static PALETTE_INIT(jongkyo)
{
int i;
- UINT8* proms = machine.region("proms")->base();
+ UINT8* proms = machine.root_device().memregion("proms")->base();
for (i = 0; i < 0x40; i++)
{
int data = proms[i];
@@ -550,7 +550,7 @@ ROM_END
static DRIVER_INIT( jongkyo )
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* first of all, do a simple bitswap */
for (i = 0x6000; i < 0x9000; ++i)
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index 5e3acbb1fbb..5de9eccc62e 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -5449,8 +5449,8 @@ DRIVER_INIT( j6fbcrz )
int i;
- UINT8 *src1 = machine.region( "maincpu" )->base();
- UINT8 *src2 = machine.region( "encrypted" )->base();
+ UINT8 *src1 = machine.root_device().memregion( "maincpu" )->base();
+ UINT8 *src2 = machine.root_device().memregion( "encrypted" )->base();
for (i=0;i<0x040000;i++)
{
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index 64345535658..3a10138f822 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -249,7 +249,7 @@ static void sys5_draw_lamps(jpmsys5_state *state)
WRITE16_MEMBER(jpmsys5_state::rombank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
data &= 0x1f;
membank("bank1")->set_base(&rom[0x20000 + 0x20000 * data]);
}
@@ -643,7 +643,7 @@ static ACIA6850_INTERFACE( acia2_if )
static MACHINE_START( jpmsys5v )
{
jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base()+0x20000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base()+0x20000);
state->m_touch_timer = machine.scheduler().timer_alloc(FUNC(touch_cb));
}
@@ -794,7 +794,7 @@ INPUT_PORTS_END
static MACHINE_START( jpmsys5 )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base()+0x20000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base()+0x20000);
}
static MACHINE_RESET( jpmsys5 )
diff --git a/src/mame/drivers/jrpacman.c b/src/mame/drivers/jrpacman.c
index 98f2e54d0cd..33b909af22d 100644
--- a/src/mame/drivers/jrpacman.c
+++ b/src/mame/drivers/jrpacman.c
@@ -392,7 +392,7 @@ static DRIVER_INIT( jrpacman )
{ 0,0 }
};
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i, j, A;
for (i = A = 0; table[i].count; i++)
diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c
index c8c92895c77..8169bfa03b5 100644
--- a/src/mame/drivers/junofrst.c
+++ b/src/mame/drivers/junofrst.c
@@ -143,7 +143,7 @@ WRITE8_MEMBER(junofrst_state::junofrst_blitter_w)
if (offset == 3)
{
int i;
- UINT8 *gfx_rom = machine().region("gfx1")->base();
+ UINT8 *gfx_rom = memregion("gfx1")->base();
offs_t src = ((m_blitterdata[2] << 8) | m_blitterdata[3]) & 0xfffc;
offs_t dest = (m_blitterdata[0] << 8) | m_blitterdata[1];
@@ -529,7 +529,7 @@ static DRIVER_INIT( junofrst )
{
UINT8 *decrypted = konami1_decode(machine, "maincpu");
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x1000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypted + 0x10000, 0x1000);
}
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index 2faa2401a67..487fdd756a5 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -807,8 +807,8 @@ ADDRESS_MAP_END
static void kaneko16_common_oki_bank_w( running_machine& machine, const char *bankname, const char* tag, int bank, size_t fixedsize, size_t bankedsize )
{
UINT32 bankaddr;
- UINT8* samples = machine.region(tag)->base();
- size_t length = machine.region(tag)->bytes();
+ UINT8* samples = machine.root_device().memregion(tag)->base();
+ size_t length = machine.root_device().memregion(tag)->bytes();
bankaddr = fixedsize + (bankedsize * bank);
@@ -2235,8 +2235,8 @@ MACHINE_CONFIG_END
*/
static void kaneko16_unscramble_tiles(running_machine &machine, const char *region)
{
- UINT8 *RAM = machine.region(region)->base();
- int size = machine.region(region)->bytes();
+ UINT8 *RAM = machine.root_device().memregion(region)->base();
+ int size = machine.root_device().memregion(region)->bytes();
int i;
if (RAM == NULL) return;
@@ -2261,11 +2261,11 @@ static void kaneko16_expand_sample_banks(running_machine &machine, const char *r
int bank;
UINT8 *src0;
- if (machine.region(region)->bytes() < 0x40000 * 16)
+ if (machine.root_device().memregion(region)->bytes() < 0x40000 * 16)
fatalerror("gtmr SOUND1 region too small");
/* bank 0 maps to itself, so we just leave it alone */
- src0 = machine.region(region)->base();
+ src0 = machine.root_device().memregion(region)->base();
for (bank = 15; bank > 0; bank--)
{
UINT8 *srcn = src0 + 0x10000 * (bank < 3 ? 3 : bank);
diff --git a/src/mame/drivers/kangaroo.c b/src/mame/drivers/kangaroo.c
index ac05cbeb75d..1ffa9c7e762 100644
--- a/src/mame/drivers/kangaroo.c
+++ b/src/mame/drivers/kangaroo.c
@@ -174,7 +174,7 @@
static MACHINE_START( kangaroo )
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("gfx1")->base(), 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("gfx1")->base(), 0x2000);
}
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 5c004211321..602d3317c67 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -1153,7 +1153,7 @@ static DRIVER_INIT( wndrplnt )
static DRIVER_INIT( chelnov )
{
karnov_state *state = machine.driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
state->m_microcontroller_id = CHELNOV;
state->m_coin_mask = 0xe0;
@@ -1164,7 +1164,7 @@ static DRIVER_INIT( chelnov )
static DRIVER_INIT( chelnovu )
{
karnov_state *state = machine.driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
state->m_microcontroller_id = CHELNOVU;
state->m_coin_mask = 0xe0;
@@ -1175,7 +1175,7 @@ static DRIVER_INIT( chelnovu )
static DRIVER_INIT( chelnovj )
{
karnov_state *state = machine.driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
state->m_microcontroller_id = CHELNOVJ;
state->m_coin_mask = 0xe0;
diff --git a/src/mame/drivers/kas89.c b/src/mame/drivers/kas89.c
index 33e9d400085..56343a269f0 100644
--- a/src/mame/drivers/kas89.c
+++ b/src/mame/drivers/kas89.c
@@ -865,8 +865,8 @@ ROM_END
static DRIVER_INIT(kas89)
{
int i;
- UINT8 *mem = machine.region("maincpu")->base();
- int memsize = machine.region("maincpu")->bytes();
+ UINT8 *mem = machine.root_device().memregion("maincpu")->base();
+ int memsize = machine.root_device().memregion("maincpu")->bytes();
UINT8 *buf;
/* Unscrambling data lines */
diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c
index 0fa6c6f5ebd..ed4a505a1f6 100644
--- a/src/mame/drivers/kchamp.c
+++ b/src/mame/drivers/kchamp.c
@@ -724,7 +724,7 @@ static UINT8 *decrypt_code(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
space->set_decrypted_region(0x0000, 0xffff, decrypted);
@@ -739,7 +739,7 @@ static UINT8 *decrypt_code(running_machine &machine)
static DRIVER_INIT( kchampvs )
{
kchamp_state *state = machine.driver_data<kchamp_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
UINT8 *decrypted = decrypt_code(machine);
int A;
diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c
index ee1b7f2b160..e7f1b5717e9 100644
--- a/src/mame/drivers/kickgoal.c
+++ b/src/mame/drivers/kickgoal.c
@@ -810,7 +810,7 @@ ROM_END
static DRIVER_INIT( kickgoal )
{
#if 0 /* we should find a real fix instead */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/* fix "bug" that prevents game from writing to EEPROM */
rom[0x12b0/2] = 0x0001;
diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c
index 0ed35509b28..bb1a27465ce 100644
--- a/src/mame/drivers/kingdrby.c
+++ b/src/mame/drivers/kingdrby.c
@@ -954,7 +954,7 @@ static const ym2203_interface cowrace_ym2203_interface =
static PALETTE_INIT(kingdrby)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
@@ -980,8 +980,8 @@ static PALETTE_INIT(kingdrby)
static PALETTE_INIT(kingdrbb)
{
- UINT8 *raw_prom = machine.region("raw_prom")->base();
- UINT8 *prom = machine.region("proms")->base();
+ UINT8 *raw_prom = machine.root_device().memregion("raw_prom")->base();
+ UINT8 *prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c
index a3b8a5b1bb7..3eb46b22e01 100644
--- a/src/mame/drivers/kingobox.c
+++ b/src/mame/drivers/kingobox.c
@@ -788,7 +788,7 @@ ROM_END
static DRIVER_INIT( ringking3 )
{
int i;
- UINT8 *RAM = machine.region("proms")->base();
+ UINT8 *RAM = machine.root_device().memregion("proms")->base();
/* expand the first color PROM to look like the kingofb ones... */
for (i = 0; i < 0x100; i++)
@@ -798,8 +798,8 @@ static DRIVER_INIT( ringking3 )
static DRIVER_INIT( ringkingw )
{
int i,j,k;
- UINT8 *PROMS = machine.region("proms")->base();
- UINT8 *USER1 = machine.region("user1")->base();
+ UINT8 *PROMS = machine.root_device().memregion("proms")->base();
+ UINT8 *USER1 = machine.root_device().memregion("user1")->base();
/* change the PROMs encode in a simple format to use kingofb decode */
for(i = 0, j = 0; j < 0x40; i++, j++)
diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c
index 210188748b4..6c1890e00dd 100644
--- a/src/mame/drivers/kingpin.c
+++ b/src/mame/drivers/kingpin.c
@@ -178,7 +178,7 @@ static DRIVER_INIT( kingpin )
kingpin_state *state = machine.driver_data<kingpin_state>();
/* Hacks to keep the emu a'runnin */
- state->m_code_base = machine.region("maincpu")->base();
+ state->m_code_base = state->memregion("maincpu")->base();
state->m_code_base[0x17d4] = 0xc3; /* Maybe sound related? */
}
diff --git a/src/mame/drivers/koikoi.c b/src/mame/drivers/koikoi.c
index d9e496079c6..4a934376a91 100644
--- a/src/mame/drivers/koikoi.c
+++ b/src/mame/drivers/koikoi.c
@@ -87,7 +87,7 @@ static TILE_GET_INFO( get_tile_info )
static PALETTE_INIT( koikoi )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c
index 412b3dbedd9..e79677c37f7 100644
--- a/src/mame/drivers/konamigq.c
+++ b/src/mame/drivers/konamigq.c
@@ -321,7 +321,7 @@ static DRIVER_INIT( konamigq )
psx_driver_init(machine);
- state->m_p_n_pcmram = machine.region( "shared" )->base() + 0x80000;
+ state->m_p_n_pcmram = state->memregion( "shared" )->base() + 0x80000;
}
static void konamigq_exit(running_machine &machine)
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index d2b3507c7fa..44a9c93131a 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -923,14 +923,14 @@ READ32_MEMBER(konamigx_state::gx6bppspr_r)
READ32_MEMBER(konamigx_state::type1_roz_r1)
{
- UINT32 *ROM = (UINT32 *)machine().region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)machine().root_device().memregion("gfx3")->base();
return ROM[offset];
}
READ32_MEMBER(konamigx_state::type1_roz_r2)
{
- UINT32 *ROM = (UINT32 *)machine().region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)machine().root_device().memregion("gfx3")->base();
ROM += (0x600000/2);
@@ -3754,7 +3754,7 @@ static DRIVER_INIT(konamigx)
case 2: // tkmmpzdm hack
{
- UINT32 *rom = (UINT32*)machine.region("maincpu")->base();
+ UINT32 *rom = (UINT32*)state->memregion("maincpu")->base();
// The display is initialized after POST but the copyright screen disabled
// planes B,C,D and didn't bother restoring them. I've spent a good
diff --git a/src/mame/drivers/konendev.c b/src/mame/drivers/konendev.c
index 0ff5bd01e8d..c437f5f2c7d 100644
--- a/src/mame/drivers/konendev.c
+++ b/src/mame/drivers/konendev.c
@@ -161,8 +161,8 @@ ROM_END
DRIVER_INIT( konendev )
{
- UINT8 *src = machine.region( "maincpu" )->base();
- size_t srcsize = machine.region( "maincpu" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
+ size_t srcsize = machine.root_device().memregion( "maincpu" )->bytes();
for (int i = 0; i < srcsize; i += 2)
{
int temp = src[i];
diff --git a/src/mame/drivers/ksayakyu.c b/src/mame/drivers/ksayakyu.c
index 22ec7d30e93..8f538067c7d 100644
--- a/src/mame/drivers/ksayakyu.c
+++ b/src/mame/drivers/ksayakyu.c
@@ -250,7 +250,7 @@ GFXDECODE_END
static MACHINE_START( ksayakyu )
{
ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c
index a27d747c70c..a12a7971dfe 100644
--- a/src/mame/drivers/kungfur.c
+++ b/src/mame/drivers/kungfur.c
@@ -191,7 +191,7 @@ static WRITE8_DEVICE_HANDLER( kungfur_adpcm2_w )
static void kfr_adpcm1_int(device_t *device)
{
kungfur_state *state = device->machine().driver_data<kungfur_state>();
- UINT8 *ROM = device->machine().region("adpcm1")->base();
+ UINT8 *ROM = state->memregion("adpcm1")->base();
UINT8 data = ROM[state->m_adpcm_pos[0] & 0x1ffff];
msm5205_data_w(device, state->m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf);
@@ -202,7 +202,7 @@ static void kfr_adpcm1_int(device_t *device)
static void kfr_adpcm2_int(device_t *device)
{
kungfur_state *state = device->machine().driver_data<kungfur_state>();
- UINT8 *ROM = device->machine().region("adpcm2")->base();
+ UINT8 *ROM = state->memregion("adpcm2")->base();
UINT8 data = ROM[state->m_adpcm_pos[1] & 0x3ffff];
msm5205_data_w(device, state->m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf);
diff --git a/src/mame/drivers/labyrunr.c b/src/mame/drivers/labyrunr.c
index feee71d1a19..49a3e6bbbf9 100644
--- a/src/mame/drivers/labyrunr.c
+++ b/src/mame/drivers/labyrunr.c
@@ -180,7 +180,7 @@ static const ym2203_interface ym2203_interface_2 =
static MACHINE_START( labyrunr )
{
labyrunr_state *state = machine.driver_data<labyrunr_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index 5db4a857dd8..adbf04633da 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -1045,8 +1045,8 @@ static DRIVER_INIT( dorodon )
offs_t i;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x6000);
- UINT8 *rom = machine.region("maincpu")->base();
- UINT8 *table = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT8 *table = machine.root_device().memregion("user1")->base();
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c
index 71384b2c684..ace6812dcc3 100644
--- a/src/mame/drivers/lastduel.c
+++ b/src/mame/drivers/lastduel.c
@@ -479,7 +479,7 @@ static MACHINE_START( lastduel )
static MACHINE_START( madgear )
{
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index eeafb46f5c6..ef99e215c11 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -148,7 +148,7 @@ static SCREEN_UPDATE_IND16( lastfght )
#if 1
// gfx roms viewer (toggle with enter, use pgup/down to browse)
int x, y, count = 0;
- UINT8 *gfxdata = screen.machine().region("gfx1")->base();
+ UINT8 *gfxdata = screen.machine().root_device().memregion("gfx1")->base();
UINT8 data;
if (screen.machine().input().code_pressed_once(KEYCODE_ENTER)) state->m_view_roms ^= 1;
@@ -156,7 +156,7 @@ static SCREEN_UPDATE_IND16( lastfght )
{
if (screen.machine().input().code_pressed_once(KEYCODE_PGDN)) state->m_base += 512 * 256;
if (screen.machine().input().code_pressed_once(KEYCODE_PGUP)) state->m_base -= 512 * 256;
- state->m_base %= screen.machine().region("gfx1")->bytes();
+ state->m_base %= state->memregion("gfx1")->bytes();
count = state->m_base;
@@ -330,7 +330,7 @@ WRITE16_MEMBER(lastfght_state::lastfght_blit_w)
if (ACCESSING_BITS_8_15)
{
int x, y, addr;
- UINT8 *gfxdata = machine().region( "gfx1" )->base();
+ UINT8 *gfxdata = memregion( "gfx1" )->base();
bitmap_ind16 &dest = m_bitmap[m_dest];
#if 0
@@ -621,7 +621,7 @@ ROM_END
static DRIVER_INIT(lastfght)
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
// pass initial check (protection ? hw?)
rom[0x00354 / 2] = 0x403e;
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index a01a486508e..17d46d8f15c 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -789,7 +789,7 @@ ROM_END
static DRIVER_INIT( lazercmd )
{
int i, y;
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -818,7 +818,7 @@ static DRIVER_INIT( lazercmd )
static DRIVER_INIT( medlanes )
{
int i, y;
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -847,7 +847,7 @@ static DRIVER_INIT( medlanes )
static DRIVER_INIT( bbonk )
{
int i, y;
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
diff --git a/src/mame/drivers/legionna.c b/src/mame/drivers/legionna.c
index 29f62078ed3..d7373da40af 100644
--- a/src/mame/drivers/legionna.c
+++ b/src/mame/drivers/legionna.c
@@ -2188,7 +2188,7 @@ ROM_END
static DRIVER_INIT( cupsoc )
{
#if CUPSOC_DEBUG_MODE
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/*Press p1 button 3 to enter into debug mode during gameplay*/
ROM[0xffffb/2] = 0x0000;
@@ -2200,13 +2200,13 @@ static DRIVER_INIT( cupsoc )
static DRIVER_INIT( denjinmk )
{
/* problem with audio comms? */
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
ROM[0x5fe4/2] = 0x4e71;
}
static DRIVER_INIT( legiongfx )
{
- descramble_legionnaire_gfx( machine, machine.region("gfx5")->base() );
+ descramble_legionnaire_gfx( machine, machine.root_device().memregion("gfx5")->base() );
}
diff --git a/src/mame/drivers/leland.c b/src/mame/drivers/leland.c
index 498c22f6fe6..e8d0f668c68 100644
--- a/src/mame/drivers/leland.c
+++ b/src/mame/drivers/leland.c
@@ -1995,9 +1995,9 @@ static DRIVER_INIT( cerberus )
leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->m_update_master_bank = cerberus_bankswitch;
- state->membank("bank1")->set_base(machine.region("master")->base() + 0x2000);
- state->membank("bank2")->set_base(machine.region("master")->base() + 0xa000);
- state->membank("bank3")->set_base(machine.region("slave")->base() + 0x2000);
+ state->membank("bank1")->set_base(state->memregion("master")->base() + 0x2000);
+ state->membank("bank2")->set_base(state->memregion("master")->base() + 0xa000);
+ state->membank("bank3")->set_base(state->memregion("slave")->base() + 0x2000);
/* set up the master CPU I/O ports */
init_master_ports(machine, 0x40, 0x80);
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index 2b20e85ab1e..06f327b9aa3 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -579,7 +579,7 @@ static const k054539_interface k054539_config =
static MACHINE_START( lethalen )
{
lethal_state *state = machine.driver_data<lethal_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 0x20, &ROM[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
@@ -601,7 +601,7 @@ static MACHINE_START( lethalen )
static MACHINE_RESET( lethalen )
{
lethal_state *state = machine.driver_data<lethal_state>();
- UINT8 *prgrom = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 *prgrom = (UINT8 *)state->memregion("maincpu")->base();
int i;
state->membank("bank2")->set_base(&prgrom[0x48000]);
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 7f720f14f0d..453c7b21afe 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -27,7 +27,7 @@
READ8_MEMBER(liberate_state::deco16_bank_r)
{
- const UINT8 *ROM = machine().region("user1")->base();
+ const UINT8 *ROM = memregion("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (m_bank)
@@ -76,7 +76,7 @@ WRITE8_MEMBER(liberate_state::deco16_bank_w)
READ8_MEMBER(liberate_state::prosoccr_bank_r)
{
- const UINT8 *ROM = machine().region("user1")->base();
+ const UINT8 *ROM = memregion("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (m_bank)
@@ -105,7 +105,7 @@ READ8_MEMBER(liberate_state::prosoccr_bank_r)
READ8_MEMBER(liberate_state::prosoccr_charram_r)
{
- UINT8 *SRC_GFX = machine().region("shared_gfx")->base();
+ UINT8 *SRC_GFX = memregion("shared_gfx")->base();
if (m_gfx_rom_readback)
{
@@ -126,7 +126,7 @@ READ8_MEMBER(liberate_state::prosoccr_charram_r)
WRITE8_MEMBER(liberate_state::prosoccr_charram_w)
{
- UINT8 *FG_GFX = machine().region("fg_gfx")->base();
+ UINT8 *FG_GFX = memregion("fg_gfx")->base();
if (m_bank)
{
@@ -182,7 +182,7 @@ WRITE8_MEMBER(liberate_state::prosoccr_io_bank_w)
READ8_MEMBER(liberate_state::prosport_charram_r)
{
- UINT8 *FG_GFX = machine().region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = memregion("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -202,7 +202,7 @@ READ8_MEMBER(liberate_state::prosport_charram_r)
WRITE8_MEMBER(liberate_state::prosport_charram_w)
{
- UINT8 *FG_GFX = machine().region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = memregion("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -1350,7 +1350,7 @@ static void sound_cpu_decrypt(running_machine &machine)
{
address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
int i;
/* Bit swapping on sound cpu - Opcodes only */
@@ -1362,7 +1362,7 @@ static void sound_cpu_decrypt(running_machine &machine)
static DRIVER_INIT( prosport )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i;
/* Main cpu has the nibbles swapped */
@@ -1384,7 +1384,7 @@ static DRIVER_INIT( liberate )
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
space->set_decrypted_region(0x0000, 0xffff, decrypted);
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 3b89928ee6f..d9a2b3b018d 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -371,8 +371,8 @@ static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectan
limenko_state *state = machine.driver_data<limenko_state>();
int i;
- UINT8 *base_gfx = machine.region("gfx1")->base();
- UINT8 *gfx_max = base_gfx + machine.region("gfx1")->bytes();
+ UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT8 *gfx_max = base_gfx + state->memregion("gfx1")->bytes();
UINT8 *gfxdata;
gfx_element gfx(machine);
@@ -1066,8 +1066,8 @@ static DRIVER_INIT( sb2003 )
static DRIVER_INIT( spotty )
{
limenko_state *state = machine.driver_data<limenko_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src = machine.region("user2")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src = state->memregion("user2")->base();
int x;
/* expand 4bpp roms to 8bpp space */
diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c
index 7ce627c7279..172722d1d2e 100644
--- a/src/mame/drivers/littlerb.c
+++ b/src/mame/drivers/littlerb.c
@@ -503,7 +503,7 @@ static TIMER_DEVICE_CALLBACK( littlerb_scanline )
if((scanline % 2) == 0)
{
UINT8 res;
- UINT8 *sample_rom = timer.machine().region("samples")->base();
+ UINT8 *sample_rom = state->memregion("samples")->base();
res = sample_rom[state->m_sound_pointer_l|(state->m_sound_index_l<<10)|0x40000];
dac_signed_w(state->m_dacl, 0, res);
diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c
index 43949d9839c..3714506f895 100644
--- a/src/mame/drivers/lkage.c
+++ b/src/mame/drivers/lkage.c
@@ -159,7 +159,7 @@ ADDRESS_MAP_END
READ8_MEMBER(lkage_state::port_fetch_r)
{
- return machine().region("user1")->base()[offset];
+ return memregion("user1")->base()[offset];
}
static ADDRESS_MAP_START( lkage_io_map, AS_IO, 8, lkage_state )
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index dd1ad19aab5..4fa2113f8c3 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -145,7 +145,7 @@ public:
static PALETTE_INIT( looping )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -900,8 +900,8 @@ ROM_END
static DRIVER_INIT( looping )
{
looping_state *state = machine.driver_data<looping_state>();
- int length = machine.region("maincpu")->bytes();
- UINT8 *rom = machine.region("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
state->m_cop_io = auto_alloc_array(machine, UINT8, 0x08);
diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c
index 924fd5843cc..cab22273790 100644
--- a/src/mame/drivers/lordgun.c
+++ b/src/mame/drivers/lordgun.c
@@ -57,7 +57,7 @@ Notes:
static DRIVER_INIT( lordgun )
{
int i;
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Decryption
@@ -82,7 +82,7 @@ static DRIVER_INIT( lordgun )
// From XingXing:
static DRIVER_INIT( aliencha )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Protection
@@ -106,7 +106,7 @@ static DRIVER_INIT( aliencha )
static DRIVER_INIT( alienchac )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Protection
diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c
index f4a022ca0de..d2bd2c26261 100644
--- a/src/mame/drivers/lsasquad.c
+++ b/src/mame/drivers/lsasquad.c
@@ -567,7 +567,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lsasquad )
{
lsasquad_state *state = machine.driver_data<lsasquad_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/ltcasino.c b/src/mame/drivers/ltcasino.c
index 7bd9f2876c7..fa56a9e384c 100644
--- a/src/mame/drivers/ltcasino.c
+++ b/src/mame/drivers/ltcasino.c
@@ -712,7 +712,7 @@ ROM_END
static DRIVER_INIT(mv4in1)
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for(i=0;i<0x10000;i++)
rom[i]=BITSWAP8(rom[i],7,6,5,4,3,1,2,0);
}
diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c
index 6e248b35d5c..343500bca5a 100644
--- a/src/mame/drivers/luckgrln.c
+++ b/src/mame/drivers/luckgrln.c
@@ -1026,7 +1026,7 @@ static DRIVER_INIT( luckgrln )
{
int i;
UINT8 x,v;
- UINT8* rom = machine.region("rom_data")->base();
+ UINT8* rom = machine.root_device().memregion("rom_data")->base();
for (i=0;i<0x20000;i++)
{
diff --git a/src/mame/drivers/lucky74.c b/src/mame/drivers/lucky74.c
index b0e2a698acf..a01160a575e 100644
--- a/src/mame/drivers/lucky74.c
+++ b/src/mame/drivers/lucky74.c
@@ -1130,7 +1130,7 @@ static void lucky74_adpcm_int(device_t *device)
if (state->m_adpcm_data == -1)
{
/* transferring 1st nibble */
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
diff --git a/src/mame/drivers/lwings.c b/src/mame/drivers/lwings.c
index 4667aff3772..a7b76ff0a1f 100644
--- a/src/mame/drivers/lwings.c
+++ b/src/mame/drivers/lwings.c
@@ -748,7 +748,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( lwings )
{
lwings_state *state = machine.driver_data<lwings_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index 79b7dff39d8..19fda4eb463 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -964,7 +964,7 @@ ROM_END
static DRIVER_INIT( firebarr )
{
m107_state *state = machine.driver_data<m107_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
@@ -975,7 +975,7 @@ static DRIVER_INIT( firebarr )
static DRIVER_INIT( dsoccr94 )
{
m107_state *state = machine.driver_data<m107_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x07, write16_delegate(FUNC(m107_state::m107_bankswitch_w),state));
diff --git a/src/mame/drivers/m58.c b/src/mame/drivers/m58.c
index 4d2a22ff802..234a0f366f0 100644
--- a/src/mame/drivers/m58.c
+++ b/src/mame/drivers/m58.c
@@ -434,7 +434,7 @@ static DRIVER_INIT( yard85 )
// on these sets the content of the sprite color PROM needs reversing
// are the proms on the other sets from bootleg boards, or hand modified?
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x10);
- UINT8* region = machine.region("proms")->base();
+ UINT8* region = machine.root_device().memregion("proms")->base();
int i;
for (i=0;i<0x10;i++)
diff --git a/src/mame/drivers/m62.c b/src/mame/drivers/m62.c
index d269fec3eb3..415360141f8 100644
--- a/src/mame/drivers/m62.c
+++ b/src/mame/drivers/m62.c
@@ -2158,50 +2158,50 @@ ROM_END
static DRIVER_INIT( battroad )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun2 )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun4 )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( kidniki )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* in Kid Niki, bank 0 has code falling from 7fff to 8000, */
/* so I have to copy it there because bank switching wouldn't catch it */
memcpy(ROM + 0x08000, ROM + 0x10000, 0x2000);
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunkr )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunk2 )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x20000, 0x1000);
- machine.root_device().membank("bank2")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x20000, 0x1000);
+ machine.root_device().membank("bank2")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x1000);
}
static DRIVER_INIT( youjyudn )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
GAME( 1984, kungfum, 0, kungfum, kungfum, 0, ROT0, "Irem", "Kung-Fu Master", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index e8b30cf375b..7ff4bf2df6e 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -180,7 +180,7 @@ public:
static PALETTE_INIT( m63 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 256; i++)
@@ -432,7 +432,7 @@ READ8_MEMBER(m63_state::snddata_r)
switch (m_p2 & 0xf0)
{
case 0x60: return soundlatch_byte_r(space, 0); ;
- case 0x70: return machine().region("user1")->base()[((m_p1 & 0x1f) << 8) | offset];
+ case 0x70: return memregion("user1")->base()[((m_p1 & 0x1f) << 8) | offset];
}
return 0xff;
}
@@ -696,8 +696,8 @@ static SAMPLES_START( fghtbskt_sh_start )
{
running_machine &machine = device.machine();
m63_state *state = machine.driver_data<m63_state>();
- int i, len = machine.region("samples")->bytes();
- UINT8 *ROM = machine.region("samples")->base();
+ int i, len = machine.root_device().memregion("samples")->bytes();
+ UINT8 *ROM = state->memregion("samples")->base();
state->m_samplebuf = auto_alloc_array(machine, INT16, len);
state->save_pointer(NAME(state->m_samplebuf), len);
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index f406b34544b..b726b3724a3 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -299,7 +299,7 @@ static INTERRUPT_GEN( m72_mcu_int )
READ8_MEMBER(m72_state::m72_mcu_sample_r)
{
UINT8 sample;
- sample = machine().region("samples")->base()[m_mcu_sample_addr++];
+ sample = memregion("samples")->base()[m_mcu_sample_addr++];
return sample;
}
@@ -383,7 +383,7 @@ INLINE DRIVER_INIT( m72_8751 )
* prefetching on the V30.
*/
{
- UINT8 *rom=machine.region("mcu")->base();
+ UINT8 *rom=state->memregion("mcu")->base();
rom[0x12d+5] += 1; printf(" 5: %d\n", rom[0x12d+5]);
rom[0x12d+8] += 5; printf(" 8: %d\n", rom[0x12d+8]);
@@ -423,8 +423,8 @@ the NMI handler in the other games.
#if 0
static int find_sample(int num)
{
- UINT8 *rom = machine.region("samples")->base();
- int len = machine.region("samples")->bytes();
+ UINT8 *rom = machine.root_device().memregion("samples")->base();
+ int len = machine.root_device().memregion("samples")->bytes();
int addr = 0;
while (num--)
diff --git a/src/mame/drivers/m79amb.c b/src/mame/drivers/m79amb.c
index 2144f5e0231..88ed1232a38 100644
--- a/src/mame/drivers/m79amb.c
+++ b/src/mame/drivers/m79amb.c
@@ -290,7 +290,7 @@ static const UINT8 lut_pos[0x20] = {
static DRIVER_INIT( m79amb )
{
m79amb_state *state = machine.driver_data<m79amb_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i, j;
/* PROM data is active low */
diff --git a/src/mame/drivers/m90.c b/src/mame/drivers/m90.c
index 746577e1c46..1ed445f4dd6 100644
--- a/src/mame/drivers/m90.c
+++ b/src/mame/drivers/m90.c
@@ -1186,7 +1186,7 @@ ROM_END
static DRIVER_INIT( quizf1 )
{
m90_state *state = machine.driver_data<m90_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("user1")->base(), 0x10000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("user1")->base(), 0x10000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x04, 0x05, write16_delegate(FUNC(m90_state::quizf1_bankswitch_w),state));
}
@@ -1194,7 +1194,7 @@ static DRIVER_INIT( quizf1 )
static DRIVER_INIT( bomblord )
{
- UINT16 *ROM = (UINT16 *)(machine.region("maincpu")->base());
+ UINT16 *ROM = (UINT16 *)(machine.root_device().memregion("maincpu")->base());
for (int i = 0; i < 0x100000 / 2; i += 4)
{
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index 0caf2d38ef6..da2c8105393 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -252,14 +252,14 @@ static TIMER_DEVICE_CALLBACK( m92_scanline_interrupt )
READ16_MEMBER(m92_state::m92_eeprom_r)
{
- UINT8 *RAM = machine().region("eeprom")->base();
+ UINT8 *RAM = memregion("eeprom")->base();
// logerror("%05x: EEPROM RE %04x\n",cpu_get_pc(&space.device()),offset);
return RAM[offset] | 0xff00;
}
WRITE16_MEMBER(m92_state::m92_eeprom_w)
{
- UINT8 *RAM = machine().region("eeprom")->base();
+ UINT8 *RAM = memregion("eeprom")->base();
// logerror("%05x: EEPROM WR %04x\n",cpu_get_pc(&space.device()),offset);
if (ACCESSING_BITS_0_7)
RAM[offset] = data;
@@ -2060,7 +2060,7 @@ ROM_END
static DRIVER_INIT( m92 )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
@@ -2072,7 +2072,7 @@ static DRIVER_INIT( m92 )
static DRIVER_INIT( m92_alt )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
@@ -2093,7 +2093,7 @@ static DRIVER_INIT( lethalth )
static DRIVER_INIT( m92_bank )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),state));
@@ -2106,7 +2106,7 @@ static DRIVER_INIT( m92_bank )
static DRIVER_INIT( majtitl2 )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),state));
@@ -2122,7 +2122,7 @@ static DRIVER_INIT( majtitl2 )
static DRIVER_INIT( ppan )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
state->m_game_kludge = 0;
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index 2f067cd560c..7e75025615f 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -136,14 +136,14 @@ READ8_MEMBER(macs_state::macs_input_r)
WRITE8_MEMBER(macs_state::macs_rom_bank_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
m_st0016_rom_bank=data;
}
WRITE8_MEMBER(macs_state::macs_output_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
switch(offset)
{
@@ -676,11 +676,11 @@ static MACHINE_RESET(macs)
730E: ED B0 ldir
...
*/
- memcpy(macs_ram1 + 0x0e9f, machine.region("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x1e9f, machine.region("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x0e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x1e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x0800, machine.region("user1")->base()+0x73fa, 0x507);
- memcpy(macs_ram1 + 0x1800, machine.region("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x0800, machine.root_device().memregion("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x1800, state->memregion("user1")->base()+0x73fa, 0x507);
#define MAKEJMP(n,m) macs_ram2[(n) - 0xe800 + 0]=0xc3;\
macs_ram2[(n) - 0xe800 + 1]=(m)&0xff;\
@@ -716,10 +716,10 @@ static MACHINE_RESET(macs)
macs_ram1[0x1ff9]=0x07;
#endif
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 );
+ state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x10000 );
state->membank("bank2")->set_base(macs_ram1+0x800);
state->membank("bank3")->set_base(macs_ram1+0x10000);
- state->membank("bank4")->set_base(machine.region("maincpu")->base() );
+ state->membank("bank4")->set_base(machine.root_device().memregion("maincpu")->base() );
}
static DRIVER_INIT(macs)
diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c
index df6ad4a721d..27f297582f9 100644
--- a/src/mame/drivers/madalien.c
+++ b/src/mame/drivers/madalien.c
@@ -25,7 +25,7 @@ INPUT_CHANGED_MEMBER(madalien_state::coin_inserted)
INLINE UINT8 shift_common(running_machine &machine, UINT8 hi, UINT8 lo)
{
- const UINT8 *table = machine.region("user2")->base();
+ const UINT8 *table = machine.root_device().memregion("user2")->base();
return table[((hi & 0x07) << 8) | lo];
}
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index 00dd08bd381..cd6721acfa9 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -351,7 +351,7 @@ ROM_END
static DRIVER_INIT( madmotor )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0x00000;i < 0x80000;i++)
diff --git a/src/mame/drivers/magicard.c b/src/mame/drivers/magicard.c
index 2ea224832f8..0242ebcec23 100644
--- a/src/mame/drivers/magicard.c
+++ b/src/mame/drivers/magicard.c
@@ -693,7 +693,7 @@ INPUT_PORTS_END
static MACHINE_RESET( magicard )
{
magicard_state *state = machine.driver_data<magicard_state>();
- UINT16 *src = (UINT16*)machine.region("maincpu" )->base();
+ UINT16 *src = (UINT16*)state->memregion("maincpu" )->base();
UINT16 *dst = state->m_magicram;
memcpy (dst, src, 0x80000);
machine.device("maincpu")->reset();
diff --git a/src/mame/drivers/magictg.c b/src/mame/drivers/magictg.c
index f33178a4533..19dc5c8943d 100644
--- a/src/mame/drivers/magictg.c
+++ b/src/mame/drivers/magictg.c
@@ -229,7 +229,7 @@ void magictg_state::machine_start()
void magictg_state::machine_reset()
{
- UINT8 *adsp_boot = (UINT8*)machine().region("adsp")->base();
+ UINT8 *adsp_boot = (UINT8*)machine().root_device().memregion("adsp")->base();
zr36120_reset();
@@ -752,7 +752,7 @@ WRITE16_MEMBER( magictg_state::adsp_control_w )
if (data > 0)
{
address_space* addr_space;
- UINT8* adsp_rom = (UINT8*)space.machine().region("adsp")->base();
+ UINT8* adsp_rom = (UINT8*)space.machine().root_device().memregion("adsp")->base();
UINT32 page = (m_adsp_regs.bdma_control >> 8) & 0xff;
UINT32 dir = (m_adsp_regs.bdma_control >> 2) & 1;
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index 5a5543ddb2a..db4c2fd4aff 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -201,7 +201,7 @@ static MACHINE_START( magtouch )
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, magtouch_set_keyb_int);
- machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.region("game_prg")->base(), 0x8000 );
+ machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.root_device().memregion("game_prg")->base(), 0x8000 );
machine.root_device().membank("rombank")->set_entry(0);
// microtouch_init(machine, magtouch_microtouch_tx_callback, NULL);
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index 91c70118961..1980517236d 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -412,7 +412,7 @@ static const k051960_interface mainevt_k051960_intf =
static MACHINE_START( mainevt )
{
mainevt_state *state = machine.driver_data<mainevt_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/majorpkr.c b/src/mame/drivers/majorpkr.c
index de34566264c..bb091ad7282 100644
--- a/src/mame/drivers/majorpkr.c
+++ b/src/mame/drivers/majorpkr.c
@@ -1083,7 +1083,7 @@ ROM_END
static DRIVER_INIT( majorpkr )
{
- UINT8 * ROM = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 * ROM = (UINT8 *)machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("rom_bank")->configure_entries(0, 4, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index 0ba3c202116..f02522d0558 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -370,7 +370,7 @@ static MACHINE_START( malzak )
{
malzak_state *state = machine.driver_data<malzak_state>();
- state->membank("bank1")->configure_entries(0, 2, machine.region("user2")->base(), 0x400);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("user2")->base(), 0x400);
state->m_s2636_0 = machine.device("s2636_0");
state->m_s2636_1 = machine.device("s2636_1");
diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c
index bffb31df78d..ab35bfbc891 100644
--- a/src/mame/drivers/marinedt.c
+++ b/src/mame/drivers/marinedt.c
@@ -187,7 +187,7 @@ READ8_MEMBER(marinedt_state::marinedt_obj1_x_r)
//xxxx---- unknown
//----xxxx x pos in tile ram
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (RAM[0x430e])
--m_cx;
@@ -445,7 +445,7 @@ GFXDECODE_END
static PALETTE_INIT( marinedt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,b,g;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c
index 3ac72c9aa9d..35fc1ba3bf7 100644
--- a/src/mame/drivers/mastboy.c
+++ b/src/mame/drivers/mastboy.c
@@ -542,7 +542,7 @@ READ8_MEMBER(mastboy_state::banked_ram_r)
if (bank>0x3) // ROM access
{
- UINT8 *src = machine().region( "gfx1" )->base();
+ UINT8 *src = memregion( "gfx1" )->base();
bank &=0x3;
return src[offset+(bank*0x4000)];
}
@@ -558,7 +558,7 @@ READ8_MEMBER(mastboy_state::banked_ram_r)
UINT8 *src;
int bank;
bank = m_bank & 0x7f;
- src = machine().region ( "user1" )->base() + bank * 0x4000;
+ src = memregion ( "user1" )->base() + bank * 0x4000;
return src[offset];
}
}
@@ -997,7 +997,7 @@ ROM_END
static DRIVER_INIT( mastboy )
{
mastboy_state *state = machine.driver_data<mastboy_state>();
- state->m_vram = machine.region( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way
+ state->m_vram = state->memregion( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way
}
GAME( 1991, mastboy, 0, mastboy, mastboy, mastboy, ROT0, "Gaelco", "Master Boy (Spanish, PCB Rev A)", 0 )
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index a9b66c24218..8a8d5c54bcd 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -503,7 +503,7 @@ ROM_END
static DRIVER_INIT( a600xl )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
memcpy( rom + 0x5000, rom + 0xd000, 0x800 );
}
diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c
index de6ab52ed1c..443ab31372f 100644
--- a/src/mame/drivers/maygay1b.c
+++ b/src/mame/drivers/maygay1b.c
@@ -4420,7 +4420,7 @@ static DRIVER_INIT( m1 )
//AM_RANGE(0x2420, 0x2421) AM_WRITE(latch_ch2_w ) // oki
// if there is no OKI region disable writes here, the rom might be missing, so alert user
- UINT8 *okirom = machine.region( "oki" )->base();
+ UINT8 *okirom = machine.root_device().memregion( "oki" )->base();
if (!okirom) {
maygay1b_state *state = machine.driver_data<maygay1b_state>();
@@ -4429,7 +4429,7 @@ static DRIVER_INIT( m1 )
// print out the rom id / header info to give us some hints
// note this isn't always correct, alley cat has 'Calpsyo' still in the ident string?
{
- UINT8 *cpu = machine.region( "maincpu" )->base();
+ UINT8 *cpu = machine.root_device().memregion( "maincpu" )->base();
int base = 0xff20;
for (int i=0;i<14;i++)
{
diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c
index 7b217deb2ec..860a7274494 100644
--- a/src/mame/drivers/mayumi.c
+++ b/src/mame/drivers/mayumi.c
@@ -351,7 +351,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( mayumi )
{
mayumi_state *state = machine.driver_data<mayumi_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index 9215c77586b..8b700dec6b3 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -361,14 +361,14 @@ WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w)/* mazer blazer */
{
m_gfx_rom_bank = data;
- membank("bank1")->set_base(machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
}
WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w_gg)/* great guns */
{
m_gfx_rom_bank = data >> 1;
- membank("bank1")->set_base(machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
}
@@ -411,7 +411,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_cmd_param_r)
READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
{
- UINT8 * rom = machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
+ UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -557,7 +557,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r)
{
- UINT8 * rom = machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
+ UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -1713,7 +1713,7 @@ static DRIVER_INIT( mazerbla )
static DRIVER_INIT( greatgun )
{
mazerbla_state *state = machine.driver_data<mazerbla_state>();
- UINT8 *rom = machine.region("sub2")->base();
+ UINT8 *rom = state->memregion("sub2")->base();
state->m_game_id = GREATGUN;
diff --git a/src/mame/drivers/mcatadv.c b/src/mame/drivers/mcatadv.c
index 3b82e5d07ba..77e4217310e 100644
--- a/src/mame/drivers/mcatadv.c
+++ b/src/mame/drivers/mcatadv.c
@@ -428,7 +428,7 @@ static const ym2610_interface mcatadv_ym2610_interface =
static MACHINE_START( mcatadv )
{
mcatadv_state *state = machine.driver_data<mcatadv_state>();
- UINT8 *ROM = machine.region("soundcpu")->base();
+ UINT8 *ROM = state->memregion("soundcpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank1")->set_entry(1);
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index 9f94a29ca4f..3f111f88b8f 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -1784,9 +1784,6 @@ ROM_START( solarfox )
ROM_LOAD( "sfvid.1b", 0x2000, 0x2000, CRC(78801e83) SHA1(23b5811a03fe4ad576c5313d2205203577300159) )
ROM_LOAD( "sfvid.1d", 0x4000, 0x2000, CRC(4d8445cf) SHA1(fbe427da0e758b79eb2230713f2cd12e6f8bdeb7) )
ROM_LOAD( "sfvid.1e", 0x6000, 0x2000, CRC(3da25495) SHA1(e7b703bc8caca7497af92efc869c6f1b7dbc8bf1) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1814,9 +1811,6 @@ ROM_START( kick )
ROM_LOAD( "2700b-v2.1d", 0x2000, 0x2000, CRC(565ea97d) SHA1(4a30a371ad407bf774cf08bf528f824675383698) )
ROM_LOAD( "2800c-v2.1b", 0x4000, 0x2000, CRC(f3be56a1) SHA1(eb3eb0379a918a2959565572d88f9b0f021d1c2a) )
ROM_LOAD( "2900d-v2.1a", 0x6000, 0x2000, CRC(77da795e) SHA1(ebebc8551e7a7534d89bb8458eb2576713cfbeaf) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( kickman )
@@ -1843,9 +1837,6 @@ ROM_START( kickman )
ROM_LOAD( "2700b-v2.1d", 0x2000, 0x2000, CRC(565ea97d) SHA1(4a30a371ad407bf774cf08bf528f824675383698) )
ROM_LOAD( "2800c-v2.1b", 0x4000, 0x2000, CRC(f3be56a1) SHA1(eb3eb0379a918a2959565572d88f9b0f021d1c2a) )
ROM_LOAD( "2900d-v2.1a", 0x6000, 0x2000, CRC(77da795e) SHA1(ebebc8551e7a7534d89bb8458eb2576713cfbeaf) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( kickc )
@@ -1872,9 +1863,6 @@ ROM_START( kickc )
ROM_LOAD( "2700-b.1d", 0x2000, 0x2000, CRC(78eda36c) SHA1(5cf9da6f364f586f324e7ac529db0dc273498320) )
ROM_LOAD( "2800-c.1b", 0x4000, 0x2000, CRC(c93e0170) SHA1(a7efdb6fd13dccd8d8d10de61b87585828bde6ac) )
ROM_LOAD( "2900-d.1a", 0x6000, 0x2000, CRC(91e59383) SHA1(bf87642cc747f1abbd80c6f529adfa60a1d9bc9e) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1901,9 +1889,6 @@ ROM_START( shollow )
ROM_LOAD( "sh-fg.01", 0x2000, 0x2000, CRC(ba1a38b4) SHA1(cee5f0a66e40c779f1bfbb4bfafe5301385e7dae) )
ROM_LOAD( "sh-fg.02", 0x4000, 0x2000, CRC(6b57f6da) SHA1(71165df59dd5ca037116dc0f46fd4f6aac6dbfd1) )
ROM_LOAD( "sh-fg.03", 0x6000, 0x2000, CRC(37ea9d07) SHA1(82e006b01ee12390308be530d4b68fc2404b6b91) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( shollow2 )
@@ -1929,9 +1914,6 @@ ROM_START( shollow2 )
ROM_LOAD( "sh-fg.01", 0x2000, 0x2000, CRC(ba1a38b4) SHA1(cee5f0a66e40c779f1bfbb4bfafe5301385e7dae) )
ROM_LOAD( "sh-fg.02", 0x4000, 0x2000, CRC(6b57f6da) SHA1(71165df59dd5ca037116dc0f46fd4f6aac6dbfd1) )
ROM_LOAD( "sh-fg.03", 0x6000, 0x2000, CRC(37ea9d07) SHA1(82e006b01ee12390308be530d4b68fc2404b6b91) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
/*
@@ -1962,9 +1944,6 @@ ROM_START( tron )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2001,9 +1980,6 @@ ROM_START( tron2 )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2040,9 +2016,6 @@ ROM_START( tron3 )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2079,9 +2052,6 @@ ROM_START( tron4 )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2113,9 +2083,6 @@ ROM_START( kroozr )
ROM_LOAD( "kozmkvid.1d", 0x2000, 0x2000, CRC(4e23b35b) SHA1(322221ea207ad0eeb0e711f3af473f71b70f7128) )
ROM_LOAD( "kozmkvid.1b", 0x4000, 0x2000, CRC(c6041ba7) SHA1(9bd55f06d360657af5c56062053221dd24027978) )
ROM_LOAD( "kozmkvid.1a", 0x6000, 0x2000, CRC(b57fb0ff) SHA1(e4dde9fb09a0e5051352ba05d776ebbe0cd81504) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2141,9 +2108,6 @@ ROM_START( domino )
ROM_LOAD( "dmanfg1.bin", 0x2000, 0x2000, CRC(16aa4b9b) SHA1(700f7dc3ce20dacce38dc40783b28fc9b4c1443a) )
ROM_LOAD( "dmanfg2.bin", 0x4000, 0x2000, CRC(4a8e76b8) SHA1(563b9db39940060265b771f3b0c4a2055963cf2b) )
ROM_LOAD( "dmanfg3.bin", 0x6000, 0x2000, CRC(1f39257e) SHA1(645f9b7e8bd2254167d15567c3bd577d3a574f7d) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2168,9 +2132,6 @@ ROM_START( wacko )
ROM_LOAD( "wackovid.1d", 0x2000, 0x2000, CRC(a02f1672) SHA1(1d1b7eada4dae5e31dc1474b13cefd71926cbfc7) )
ROM_LOAD( "wackovid.1b", 0x4000, 0x2000, CRC(7d899790) SHA1(aa320f4ac41d2a1acec4880a8d95dfe6406e210e) )
ROM_LOAD( "wackovid.1a", 0x6000, 0x2000, CRC(080be3ad) SHA1(ead2be17d749a15841123e42d434aab573870fba) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2195,9 +2156,6 @@ ROM_START( twotiger )
ROM_LOAD( "vid_c1", 0x2000, 0x2000, CRC(62ed737b) SHA1(954c1f17da2ceb77e710faf0822d29381b873a07) )
ROM_LOAD( "vid_b1", 0x4000, 0x2000, CRC(0939921e) SHA1(f52d3475232557959e501f70765a4ad472300e84) )
ROM_LOAD( "vid_a1", 0x6000, 0x2000, CRC(ef515824) SHA1(983af762733405b96351ef4910f4f4be40c4880e) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( twotigerc )
@@ -2221,9 +2179,6 @@ ROM_START( twotigerc )
ROM_LOAD( "2tgrfg1.bin", 0x2000, 0x2000, CRC(fbcaffa5) SHA1(5145cd7cc08552388b8662b5d159b3af6344c51a) )
ROM_LOAD( "2tgrfg2.bin", 0x4000, 0x2000, CRC(08e3e1a6) SHA1(c9c5ce072b235a299a3151f984d73bab97289e19) )
ROM_LOAD( "2tgrfg3.bin", 0x6000, 0x2000, CRC(9b22697b) SHA1(4c3fa30ce1b645ab18c0e53ce0f3754133a267ad) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2254,9 +2209,6 @@ ROM_START( journey )
ROM_LOAD( "a4", 0xa000, 0x2000, CRC(765876a7) SHA1(9c477f5fae068f7e424939652e959711b3ad3a80) )
ROM_LOAD( "a1", 0xc000, 0x2000, CRC(4af986f8) SHA1(56af9525a404bcf6d76b19318efe541189844210) )
ROM_LOAD( "a2", 0xe000, 0x2000, CRC(b30cd2a7) SHA1(df1b36a3481fdec49f73d504f23951070c121291) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2286,9 +2238,6 @@ ROM_START( tapper )
ROM_LOAD( "tapfg4.bin", 0x14000, 0x4000, CRC(32674ee6) SHA1(402c166d50b4a693959b3f0706a7931a5daef6ce) )
ROM_LOAD( "tapfg7.bin", 0x18000, 0x4000, CRC(070b4c81) SHA1(95879a455ecfe2e3de7fe2a75078f9e6934960f5) )
ROM_LOAD( "tapfg6.bin", 0x1c000, 0x4000, CRC(a37aef36) SHA1(a24696f16d467d9eea4f25aef5f4c5ff55bf51ff) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( tappera )
@@ -2317,9 +2266,6 @@ ROM_START( tappera )
ROM_LOAD( "fg4_a4.128", 0x14000, 0x4000, CRC(082a4059) SHA1(52672b853d67432fd80e4612fa54208c225d2444) )
ROM_LOAD( "fg7_a1.128", 0x18000, 0x4000, CRC(3b476abe) SHA1(6fe170695386fc77310384a5590a7cc3671ae853) )
ROM_LOAD( "fg6_a2.128", 0x1c000, 0x4000, CRC(6717264c) SHA1(5a6d30974e73f952694b8c09fb3a5393a76db4f2) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( sutapper )
@@ -2348,9 +2294,6 @@ ROM_START( sutapper )
ROM_LOAD( "5800", 0x14000, 0x4000, CRC(ebf1f948) SHA1(251cf018da8db11c3844123255082146b22507e5) )
ROM_LOAD( "5801", 0x18000, 0x4000, CRC(d70defa7) SHA1(e8ceabe94080eb28aa393b97ec54729cf8aba001) )
ROM_LOAD( "5802", 0x1c000, 0x4000, CRC(d4f114b9) SHA1(58ae647b4fd0f48af4158b85e29c813605d930d3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( rbtapper )
@@ -2379,9 +2322,6 @@ ROM_START( rbtapper )
ROM_LOAD( "rbtfg4.bin", 0x14000, 0x4000, CRC(8c79e7d7) SHA1(e2a427324fc1d4422e50a1ab79822aff0290e109) )
ROM_LOAD( "rbtfg7.bin", 0x18000, 0x4000, CRC(8dbf0c36) SHA1(dab52db0bca13b9f3470060bc3babe4a6c2cdcc8) )
ROM_LOAD( "rbtfg6.bin", 0x1c000, 0x4000, CRC(441201a0) SHA1(400d390729601610b152e21da55399399830221f) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
@@ -2410,9 +2350,6 @@ ROM_START( timber )
ROM_LOAD( "timfg4.bin", 0x14000, 0x4000, CRC(b7105eb7) SHA1(913687f0e5dd105a3dfdc0afd1b5610b27124451) )
ROM_LOAD( "timfg7.bin", 0x18000, 0x4000, CRC(d9c27475) SHA1(24a7e6200e4f3514d4d3f25b2ffe3338c0c2a495) )
ROM_LOAD( "timfg6.bin", 0x1c000, 0x4000, CRC(244778e8) SHA1(494bc1e627997cd4f1d5267c5fafd0779ccf9255) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2442,9 +2379,6 @@ ROM_START( dotron )
ROM_LOAD( "loc-d.cp7", 0x0a000, 0x2000, CRC(5e8a3ef3) SHA1(74983c922eae1326ecd0ff14000851e0b424cc61) )
ROM_LOAD( "loc-a.cp0", 0x0c000, 0x2000, CRC(b35f5374) SHA1(3f330ffde52ac57c02dfdf8e105aefcc10f87a0b) )
ROM_LOAD( "loc-b.cp9", 0x0e000, 0x2000, CRC(565a5c48) SHA1(9dfafd58bd552bfda4e1799a175735ecc1369ba3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( dotrona )
@@ -2473,9 +2407,6 @@ ROM_START( dotrona )
ROM_LOAD( "loc-d.cp7", 0x0a000, 0x2000, CRC(5e8a3ef3) SHA1(74983c922eae1326ecd0ff14000851e0b424cc61) )
ROM_LOAD( "loc-a.cp0", 0x0c000, 0x2000, CRC(b35f5374) SHA1(3f330ffde52ac57c02dfdf8e105aefcc10f87a0b) )
ROM_LOAD( "loc-b.cp9", 0x0e000, 0x2000, CRC(565a5c48) SHA1(9dfafd58bd552bfda4e1799a175735ecc1369ba3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( dotrone )
@@ -2511,7 +2442,6 @@ ROM_START( dotrone )
ROM_LOAD( "loc-b.cp9", 0x0e000, 0x2000, CRC(565a5c48) SHA1(9dfafd58bd552bfda4e1799a175735ecc1369ba3) )
ROM_REGION( 0x0040, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_LOAD( "edotlamp.u2", 0x0020, 0x0020, CRC(fb58b867) SHA1(45beb55f2c2e9197f091fc06e9a2f595e57e5c93) ) /* lamp sequencer PROM */
ROM_END
@@ -2550,9 +2480,6 @@ ROM_START( nflfoot )
ROM_LOAD( "nflvidfg.cp7", 0x0a000, 0x2000, CRC(73f62392) SHA1(18f28be7264f8edff38f8a6aa067eeb1970f544c) )
ROM_LOAD( "nflvidfg.c10", 0x0c000, 0x2000, CRC(1766dcc7) SHA1(df499e3c66ae702d2d56e6cd095a754665569fcd) )
ROM_LOAD( "nflvidfg.cp9", 0x0e000, 0x2000, CRC(46558146) SHA1(4bedfae8cf0fcb9d837706ee13fbe3944ab47216) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
@@ -2581,9 +2508,6 @@ ROM_START( demoderb )
ROM_LOAD( "dd_fg-6.a7", 0x14000, 0x4000, CRC(abfb9a8b) SHA1(14ab416bc76db25ad97353c9072048c64ec95344) )
ROM_LOAD( "dd_fg-3.a10", 0x18000, 0x4000, CRC(801d9b86) SHA1(5a8c72d1060eea1a3ad67b98aa6eff13f6837af6) )
ROM_LOAD( "dd_fg-7.a9", 0x1c000, 0x4000, CRC(0ec3f60a) SHA1(4176b246b0ea7bce9498c20e12678f16f7173529) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index 4a0a9f7187d..98e7b909496 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -1388,9 +1388,6 @@ ROM_START( spyhunt )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "cpu_alph.10g", 0x00000, 0x1000, CRC(936dc87f) SHA1(cdf73bea82481fbc300ec5a1fbbe8d662007c56b) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1431,9 +1428,6 @@ ROM_START( spyhuntp )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "sh_mb_1.bin", 0x00000, 0x0800, CRC(5c74c9f0) SHA1(e42789d14e5510d1dcf4a30f6bd40a40ab46f7f3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1469,9 +1463,6 @@ ROM_START( crater )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "crcpu.10g", 0x00000, 0x1000, CRC(6fe53c8d) SHA1(ceb04916af42d58f3173e5986756a0db8be11999) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1511,9 +1502,6 @@ ROM_START( turbotag )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "ttan.bin", 0x00000, 0x1000, CRC(aa0b1471) SHA1(e3dd69f1a14926c6b709d6b19d9e90a1f0867465) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
diff --git a/src/mame/drivers/meadows.c b/src/mame/drivers/meadows.c
index 9d69202cf70..446732d900a 100644
--- a/src/mame/drivers/meadows.c
+++ b/src/mame/drivers/meadows.c
@@ -872,12 +872,12 @@ static DRIVER_INIT( gypsyjug )
0x01,0x80, 0x03,0xc0, 0x03,0xc0, 0x01,0x80
};
int i;
- UINT8 *gfx2 = machine.region("gfx2")->base();
- UINT8 *gfx3 = machine.region("gfx3")->base();
- UINT8 *gfx4 = machine.region("gfx4")->base();
- UINT8 *gfx5 = machine.region("gfx5")->base();
- int len3 = machine.region("gfx3")->bytes();
- int len4 = machine.region("gfx4")->bytes();
+ UINT8 *gfx2 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *gfx3 = machine.root_device().memregion("gfx3")->base();
+ UINT8 *gfx4 = machine.root_device().memregion("gfx4")->base();
+ UINT8 *gfx5 = machine.root_device().memregion("gfx5")->base();
+ int len3 = machine.root_device().memregion("gfx3")->bytes();
+ int len4 = machine.root_device().memregion("gfx4")->bytes();
memcpy(gfx3,gfx2,len3);
@@ -896,8 +896,8 @@ static DRIVER_INIT( minferno )
UINT8 *mem;
/* create an inverted copy of the graphics data */
- mem = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ mem = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
for (i = 0; i < length/2; i++)
mem[i] = ~mem[i + length/2];
}
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index 51d1d026488..6c5ded705d6 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -1045,7 +1045,7 @@ static MACHINE_START(mediagx)
static MACHINE_RESET(mediagx)
{
mediagx_state *state = machine.driver_data<mediagx_state>();
- UINT8 *rom = machine.region("bios")->base();
+ UINT8 *rom = state->memregion("bios")->base();
device_set_irq_callback(machine.device("maincpu"), irq_callback);
diff --git a/src/mame/drivers/megadrvb.c b/src/mame/drivers/megadrvb.c
index e791fa55912..55de0266ded 100644
--- a/src/mame/drivers/megadrvb.c
+++ b/src/mame/drivers/megadrvb.c
@@ -659,7 +659,7 @@ static DRIVER_INIT( aladmdb )
* Game does a check @ 1afc00 with work RAM fff57c that makes it play like the original console version (i.e. 8 energy hits instead of 2)
*/
#if ENERGY_CONSOLE_MODE
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x1afc08/2] = 0x6600;
#endif
@@ -675,7 +675,7 @@ static DRIVER_INIT( aladmdb )
// after this decode look like intentional changes
static DRIVER_INIT( mk3mdb )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (int x = 0x000001; x < 0x100001; x += 2)
{
@@ -726,7 +726,7 @@ static DRIVER_INIT( ssf2mdb )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x400000, 0x5fffff, "bank5");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x400000, 0x5fffff);
- machine.root_device().membank("bank5")->set_base(machine.region( "maincpu" )->base() + 0x400000 );
+ machine.root_device().membank("bank5")->set_base(machine.root_device().memregion( "maincpu" )->base() + 0x400000 );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(ssf2mdb_dsw_r) );
@@ -736,7 +736,7 @@ static DRIVER_INIT( ssf2mdb )
static DRIVER_INIT( srmdb )
{
- UINT8* rom = machine.region("maincpu")->base();
+ UINT8* rom = machine.root_device().memregion("maincpu")->base();
/* todo, reduce bitswaps to single swap */
for (int x = 0x00001; x < 0x40000; x += 2)
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index c957779673c..ee993c5c434 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -427,7 +427,7 @@ static READ16_HANDLER( megaplay_io_read )
static READ8_HANDLER( bank_r )
{
mplay_state *state = space->machine().driver_data<mplay_state>();
- UINT8* bank = space->machine().region("mtbios")->base();
+ UINT8* bank = state->memregion("mtbios")->base();
UINT32 fulladdress = state->m_mp_bios_bank_addr + offset;
if ((fulladdress >= 0x000000) && (fulladdress <= 0x3fffff)) // ROM Addresses
@@ -450,7 +450,7 @@ static READ8_HANDLER( bank_r )
}
else
{
- return space->machine().region("maincpu")->base()[fulladdress ^ 1];
+ return space->machine().root_device().memregion("maincpu")->base()[fulladdress ^ 1];
}
}
else if (fulladdress >= 0xa10000 && fulladdress <= 0xa1001f) // IO Acess
@@ -828,9 +828,9 @@ ROM_END
static void mplay_start(running_machine &machine)
{
- UINT8 *src = machine.region("mtbios")->base();
- UINT8 *instruction_rom = machine.region("user1")->base();
- UINT8 *game_rom = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("mtbios")->base();
+ UINT8 *instruction_rom = machine.root_device().memregion("user1")->base();
+ UINT8 *game_rom = machine.root_device().memregion("maincpu")->base();
int offs;
memmove(src + 0x10000, src + 0x8000, 0x18000); // move bios..
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index dc30899430d..d7e1351f8aa 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -1380,7 +1380,7 @@ WRITE16_MEMBER(megasys1_state::protection_peekaboo_w)
if ((m_protection_val & 0x90) == 0x90)
{
- UINT8 *RAM = machine().region("oki1")->base();
+ UINT8 *RAM = memregion("oki1")->base();
int new_bank = (m_protection_val & 0x7) % 7;
if (m_bank != new_bank)
@@ -3587,8 +3587,8 @@ ROM_END
static void rodlandj_gfx_unmangle(running_machine &machine, const char *region)
{
- UINT8 *rom = machine.region(region)->base();
- int size = machine.region(region)->bytes();
+ UINT8 *rom = machine.root_device().memregion(region)->base();
+ int size = machine.root_device().memregion(region)->bytes();
UINT8 *buffer;
int i;
@@ -3619,8 +3619,8 @@ static void rodlandj_gfx_unmangle(running_machine &machine, const char *region)
static void jitsupro_gfx_unmangle(running_machine &machine, const char *region)
{
- UINT8 *rom = machine.region(region)->base();
- int size = machine.region(region)->bytes();
+ UINT8 *rom = machine.root_device().memregion(region)->base();
+ int size = machine.root_device().memregion(region)->bytes();
UINT8 *buffer;
int i;
@@ -3673,7 +3673,7 @@ static void stdragona_gfx_unmangle(running_machine &machine, const char *region)
static DRIVER_INIT( 64street )
{
megasys1_state *state = machine.driver_data<megasys1_state>();
-// UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *RAM = (UINT16 *) state->memregion("maincpu")->base();
// RAM[0x006b8/2] = 0x6004; // d8001 test
// RAM[0x10EDE/2] = 0x6012; // watchdog
@@ -3686,7 +3686,7 @@ static DRIVER_INIT( 64street )
READ16_MEMBER(megasys1_state::megasys1A_mcu_hs_r)
{
- UINT16 *ROM = (UINT16 *) machine().region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) memregion("maincpu")->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
@@ -3827,7 +3827,7 @@ static DRIVER_INIT( hayaosi1 )
READ16_MEMBER(megasys1_state::iganinju_mcu_hs_r)
{
- UINT16 *ROM = (UINT16 *) machine().region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) memregion("maincpu")->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
@@ -3867,7 +3867,7 @@ static DRIVER_INIT( iganinju )
phantasm_rom_decode(machine, "maincpu");
- //RAM = (UINT16 *) machine.region("maincpu")->base();
+ //RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
megasys1_state *state = machine.driver_data<megasys1_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_r),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x2f000, 0x2f009, write16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_w),state));
@@ -3887,7 +3887,7 @@ static DRIVER_INIT( jitsupro )
{
device_t *oki1 = machine.device("oki1");
device_t *oki2 = machine.device("oki2");
- //UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ //UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
astyanax_rom_decode(machine, "maincpu"); // Code
@@ -3955,7 +3955,7 @@ static DRIVER_INIT( soldam )
READ16_MEMBER(megasys1_state::stdragon_mcu_hs_r)
{
- UINT16 *ROM = (UINT16 *) machine().region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) memregion("maincpu")->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
@@ -4026,7 +4026,7 @@ READ16_MEMBER(megasys1_state::monkelf_input_r)
static DRIVER_INIT( monkelf )
{
megasys1_state *state = machine.driver_data<megasys1_state>();
- UINT16 *ROM = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16*)state->memregion("maincpu")->base();
ROM[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap?
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::monkelf_input_r),state));
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 96c33bc867f..8adfe1a2275 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -222,9 +222,9 @@ static TIMER_CALLBACK( megatech_z80_run_state )
UINT8* game_region;
sprintf(tempname, "game%d", param);
- game_region = machine.region(tempname)->base();
+ game_region = machine.root_device().memregion(tempname)->base();
- memcpy(machine.region("maincpu")->base(), game_region, 0x400000);
+ memcpy(state->memregion("maincpu")->base(), game_region, 0x400000);
if (!state->m_cart_is_genesis[param])
{
@@ -252,7 +252,7 @@ static TIMER_CALLBACK( megatech_z80_stop_state )
printf("megatech_select_game %d\n", param+1);
sprintf(tempname, "game%d", param);
- game_region = machine.region(tempname)->base();
+ game_region = machine.root_device().memregion(tempname)->base();
cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, ASSERT_LINE);
cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_RESET, ASSERT_LINE);
@@ -274,8 +274,8 @@ static TIMER_CALLBACK( megatech_z80_stop_state )
else
{
/* no cart.. */
- memset(machine.region("mtbios")->base() + 0x8000, 0x00, 0x8000);
- memset(machine.region("maincpu")->base(), 0x00, 0x400000);
+ memset(machine.root_device().memregion("mtbios")->base() + 0x8000, 0x00, 0x8000);
+ memset(machine.root_device().memregion("maincpu")->base(), 0x00, 0x400000);
}
return;
@@ -436,7 +436,7 @@ static DRIVER_INIT(mt_slot)
static DRIVER_INIT(mt_crt)
{
mtech_state *state = machine.driver_data<mtech_state>();
- UINT8* pin = machine.region("sms_pin")->base();
+ UINT8* pin = state->memregion("sms_pin")->base();
DRIVER_INIT_CALL(mt_slot);
state->m_cart_is_genesis[0] = !pin[0] ? 1 : 0;;
@@ -556,7 +556,7 @@ static DEVICE_IMAGE_LOAD( megatech_cart )
return IMAGE_INIT_FAIL;
//printf("load list\n");
- UINT8 *ROM = image.device().machine().region(this_cart->region)->base();
+ UINT8 *ROM = image.device().machine().root_device().memregion(this_cart->region)->base();
//printf("load list2\n");
UINT32 length = image.get_software_region_length("rom");
memcpy(ROM, image.get_software_region("rom"), length);
diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c
index cf8627ae32c..bc2bd2ce259 100644
--- a/src/mame/drivers/meijinsn.c
+++ b/src/mame/drivers/meijinsn.c
@@ -248,7 +248,7 @@ static VIDEO_START(meijinsn)
static PALETTE_INIT( meijinsn )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_b[2] = { 470, 220 };
static const int resistances_rg[3] = { 1000, 470, 220 };
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index fdf660f9874..305f8c0d3af 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -100,7 +100,7 @@ static MACHINE_START(merit)
READ8_MEMBER(merit_state::questions_r)
{
- UINT8 *questions = machine().region("user1")->base();
+ UINT8 *questions = memregion("user1")->base();
int address;
switch(m_question_address >> 16)
@@ -220,9 +220,9 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine().region("gfx1")->base();
- gfx[1] = device->machine().region("gfx2")->base();
- rlen = device->machine().region("gfx2")->bytes();
+ gfx[0] = device->machine().root_device().memregion("gfx1")->base();
+ gfx[1] = device->machine().root_device().memregion("gfx2")->base();
+ rlen = state->memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
for (cx = 0; cx < x_count; cx++)
@@ -1215,8 +1215,8 @@ void merit_state::dodge_nvram_init(nvram_device &nvram, void *base, size_t size)
static MACHINE_START(casino5)
{
MACHINE_START_CALL(merit);
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x2000, 0x2000);
- machine.root_device().membank("bank2")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x6000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x2000);
+ machine.root_device().membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x6000, 0x2000);
machine.root_device().membank("bank1")->set_entry(0);
machine.root_device().membank("bank2")->set_entry(0);
}
@@ -2021,7 +2021,7 @@ static DRIVER_INIT( key_7 )
static DRIVER_INIT( couple )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
#if 0 //quick rom compare test
{
@@ -2048,7 +2048,7 @@ static DRIVER_INIT( dtrvwz5 )
{
merit_state *state = machine.driver_data<merit_state>();
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
/* fill b000 - b0ff with ret 0xc9 */
for ( i = 0xb000; i < 0xb100; i++ )
ROM[i] = 0xc9;
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 82a00f82865..e57bcfddca3 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -484,7 +484,7 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_questions_bank_w)
return;
}
- dst = machine().region("maincpu")->base() + 0x70000 + 2;
+ dst = memregion("maincpu")->base() + 0x70000 + 2;
if (data == 0)
{
@@ -513,7 +513,7 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_questions_bank_w)
default: logerror( "meritm_crt250_questions_bank_w: unknown data = %02x\n", data ); return;
}
logerror( "Reading question byte at %06X\n", questions_address | m_questions_loword_address);
- *dst = machine().region("extra")->base()[questions_address | m_questions_loword_address];
+ *dst = memregion("extra")->base()[questions_address | m_questions_loword_address];
}
};
@@ -989,7 +989,7 @@ static MACHINE_START(merit_common)
static MACHINE_START(meritm_crt250)
{
meritm_state *state = machine.driver_data<meritm_state>();
- state->membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base(), 0x10000);
+ state->membank("bank1")->configure_entries(0, 8, state->memregion("maincpu")->base(), 0x10000);
state->m_bank = 0xff;
meritm_crt250_switch_banks(machine);
MACHINE_START_CALL(merit_common);
@@ -1016,8 +1016,8 @@ static MACHINE_START(meritm_crt260)
state->m_ram = auto_alloc_array(machine, UINT8, 0x8000 );
machine.device<nvram_device>("nvram")->set_base(state->m_ram, 0x8000);
memset(state->m_ram, 0x00, 0x8000);
- state->membank("bank1")->configure_entries(0, 128, machine.region("maincpu")->base(), 0x8000);
- state->membank("bank2")->configure_entries(0, 128, machine.region("maincpu")->base(), 0x8000);
+ state->membank("bank1")->configure_entries(0, 128, machine.root_device().memregion("maincpu")->base(), 0x8000);
+ state->membank("bank2")->configure_entries(0, 128, state->memregion("maincpu")->base(), 0x8000);
state->membank("bank3")->configure_entries(0, 4, state->m_ram, 0x2000);
state->m_bank = 0xff;
state->m_psd_a15 = 0;
diff --git a/src/mame/drivers/mermaid.c b/src/mame/drivers/mermaid.c
index 675d78bfbb8..b5c0a6a7a79 100644
--- a/src/mame/drivers/mermaid.c
+++ b/src/mame/drivers/mermaid.c
@@ -419,7 +419,7 @@ static void rougien_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c
index 42a41f445ea..da4ec0e88b8 100644
--- a/src/mame/drivers/metalmx.c
+++ b/src/mame/drivers/metalmx.c
@@ -770,7 +770,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( metalmx )
{
- UINT8 *adsp_boot = (UINT8*)machine.region("adsp")->base();
+ UINT8 *adsp_boot = (UINT8*)machine.root_device().memregion("adsp")->base();
metalmx_state *state = machine.driver_data<metalmx_state>();
state->m_adsp->load_boot_data(adsp_boot, state->m_adsp_internal_program_ram);
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index e38e8e5e780..e16dabc5a82 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -397,7 +397,7 @@ WRITE16_MEMBER(metro_state::metro_soundstatus_w)
WRITE8_MEMBER(metro_state::metro_sound_rombank_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("audiocpu")->base();
+ UINT8 *ROM = memregion("audiocpu")->base();
bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x03) * 0x4000;
if (bankaddress < 0x10000) bankaddress = 0x0000;
@@ -408,7 +408,7 @@ WRITE8_MEMBER(metro_state::metro_sound_rombank_w)
WRITE8_MEMBER(metro_state::daitorid_sound_rombank_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("audiocpu")->base();
+ UINT8 *ROM = memregion("audiocpu")->base();
bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x07) * 0x4000;
if (bankaddress < 0x10000) bankaddress = 0x10000;
@@ -590,8 +590,8 @@ WRITE16_MEMBER(metro_state::metro_coin_lockout_4words_w)
READ16_MEMBER(metro_state::metro_bankedrom_r)
{
- UINT8 *ROM = machine().region("gfx1")->base();
- size_t len = machine().region("gfx1")->bytes();
+ UINT8 *ROM = memregion("gfx1")->base();
+ size_t len = memregion("gfx1")->bytes();
offset = offset * 2 + 0x10000 * (*m_rombank);
@@ -680,8 +680,8 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
if (offset == 0x0c / 2)
{
- UINT8 *src = machine().region("gfx1")->base();
- size_t src_len = machine().region("gfx1")->bytes();
+ UINT8 *src = memregion("gfx1")->base();
+ size_t src_len = memregion("gfx1")->bytes();
UINT32 tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2];
UINT32 src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2];
@@ -1692,7 +1692,7 @@ WRITE16_MEMBER(metro_state::blzntrnd_sound_w)
WRITE8_MEMBER(metro_state::blzntrnd_sh_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x4000;
@@ -5995,8 +5995,8 @@ static DRIVER_INIT( balcube )
{
metro_state *state = machine.driver_data<metro_state>();
- const size_t len = machine.region("gfx1")->bytes();
- UINT8 *src = machine.region("gfx1")->base();
+ const size_t len = machine.root_device().memregion("gfx1")->bytes();
+ UINT8 *src = state->memregion("gfx1")->base();
UINT8 *end = src + len;
while (src < end)
@@ -6016,7 +6016,7 @@ static DRIVER_INIT( balcube )
static DRIVER_INIT( dharmak )
{
- UINT8 *src = machine.region( "gfx1" )->base();
+ UINT8 *src = machine.root_device().memregion( "gfx1" )->base();
int i;
for (i = 0; i < 0x200000; i += 4)
diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c
index 8fe6f698184..dde5db1a6a3 100644
--- a/src/mame/drivers/mexico86.c
+++ b/src/mame/drivers/mexico86.c
@@ -421,7 +421,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( mexico86 )
{
mexico86_state *state = machine.driver_data<mexico86_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c
index c52b15a38bd..d6006be3de6 100644
--- a/src/mame/drivers/midas.c
+++ b/src/mame/drivers/midas.c
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT( livequiz )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
// PROTECTION CHECKS
rom[0x13345a/2] = 0x4e75;
diff --git a/src/mame/drivers/midqslvr.c b/src/mame/drivers/midqslvr.c
index faecef5c218..ea225139224 100644
--- a/src/mame/drivers/midqslvr.c
+++ b/src/mame/drivers/midqslvr.c
@@ -134,7 +134,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
state->membank("bios_bank")->set_base(state->m_bios_ram);
else // disable RAM access (reads go to BIOS ROM)
- state->membank("bios_bank")->set_base(busdevice->machine().region("bios")->base() + 0x70000);
+ state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x70000);
break;
}
case 0x5a: // PAM1
@@ -142,12 +142,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("video_bank1")->set_base(state->m_isa_ram1);
else
- state->membank("video_bank1")->set_base(busdevice->machine().region("video_bios")->base() + 0);
+ state->membank("video_bank1")->set_base(state->memregion("video_bios")->base() + 0);
if (data & 0x10)
state->membank("video_bank2")->set_base(state->m_isa_ram2);
else
- state->membank("video_bank2")->set_base(busdevice->machine().region("video_bios")->base() + 0x4000);
+ state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
break;
}
@@ -156,12 +156,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
else
- state->membank("bios_ext1")->set_base(busdevice->machine().region("bios")->base() + 0x60000);
+ state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0x60000);
if (data & 0x10)
state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram);
else
- state->membank("bios_ext2")->set_base(busdevice->machine().region("bios")->base() + 0x64000);
+ state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x64000);
break;
}
@@ -170,12 +170,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
else
- state->membank("bios_ext3")->set_base(busdevice->machine().region("bios")->base() + 0x68000);
+ state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x68000);
if (data & 0x10)
state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram);
else
- state->membank("bios_ext4")->set_base(busdevice->machine().region("bios")->base() + 0x6c000);
+ state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0x6c000);
break;
}
@@ -674,13 +674,13 @@ static MACHINE_START( midqslvr )
static MACHINE_RESET( midqslvr )
{
- machine.root_device().membank("bios_bank")->set_base(machine.region("bios")->base() + 0x70000);
- machine.root_device().membank("bios_ext1")->set_base(machine.region("bios")->base() + 0x60000);
- machine.root_device().membank("bios_ext2")->set_base(machine.region("bios")->base() + 0x64000);
- machine.root_device().membank("bios_ext3")->set_base(machine.region("bios")->base() + 0x68000);
- machine.root_device().membank("bios_ext4")->set_base(machine.region("bios")->base() + 0x6c000);
- machine.root_device().membank("video_bank1")->set_base(machine.region("video_bios")->base() + 0);
- machine.root_device().membank("video_bank2")->set_base(machine.region("video_bios")->base() + 0x4000);
+ machine.root_device().membank("bios_bank")->set_base(machine.root_device().memregion("bios")->base() + 0x70000);
+ machine.root_device().membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0x60000);
+ machine.root_device().membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x64000);
+ machine.root_device().membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x68000);
+ machine.root_device().membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0x6c000);
+ machine.root_device().membank("video_bank1")->set_base(machine.root_device().memregion("video_bios")->base() + 0);
+ machine.root_device().membank("video_bank2")->set_base(machine.root_device().memregion("video_bios")->base() + 0x4000);
}
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index fa0b28be63d..c31851316f8 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -56,7 +56,7 @@ static MACHINE_RESET( midvunit )
dcs_reset_w(machine, 1);
dcs_reset_w(machine, 0);
- memcpy(state->m_ram_base, machine.region("user1")->base(), 0x20000*4);
+ memcpy(state->m_ram_base, state->memregion("user1")->base(), 0x20000*4);
machine.device("maincpu")->reset();
state->m_timer[0] = machine.device<timer_device>("timer0");
@@ -70,7 +70,7 @@ static MACHINE_RESET( midvplus )
dcs_reset_w(machine, 1);
dcs_reset_w(machine, 0);
- memcpy(state->m_ram_base, machine.region("user1")->base(), 0x20000*4);
+ memcpy(state->m_ram_base, state->memregion("user1")->base(), 0x20000*4);
machine.device("maincpu")->reset();
state->m_timer[0] = machine.device<timer_device>("timer0");
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index c45df570ca8..a43d6c8664e 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -92,7 +92,7 @@ static MACHINE_START( midzeus )
static MACHINE_RESET( midzeus )
{
- memcpy(ram_base, machine.region("user1")->base(), 0x40000*4);
+ memcpy(ram_base, machine.root_device().memregion("user1")->base(), 0x40000*4);
*ram_base <<= 1;
machine.device("maincpu")->reset();
@@ -1441,7 +1441,7 @@ static DRIVER_INIT( crusnexo )
{
dcs2_init(machine, 0, 0);
midway_ioasic_init(machine, MIDWAY_IOASIC_STANDARD, 472/* or 476,477,478,110 */, 99, NULL);
- machine.root_device().membank("bank1")->configure_entries(0, 3, machine.region("user2")->base(), 0x400000*4);
+ machine.root_device().membank("bank1")->configure_entries(0, 3, machine.root_device().memregion("user2")->base(), 0x400000*4);
midzeus_state *state = machine.driver_data<midzeus_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x9b0004, 0x9b0007, read32_delegate(FUNC(midzeus_state::crusnexo_leds_r),state), write32_delegate(FUNC(midzeus_state::crusnexo_leds_w),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler (0x8d0009, 0x8d000a, write32_delegate(FUNC(midzeus_state::keypad_select_w),state));
@@ -1452,7 +1452,7 @@ static DRIVER_INIT( thegrid )
{
dcs2_init(machine, 0, 0);
midway_ioasic_init(machine, MIDWAY_IOASIC_STANDARD, 474/* or 491 */, 99, NULL);
- machine.root_device().membank("bank1")->configure_entries(0, 3, machine.region("user2")->base(), 0x400000*4);
+ machine.root_device().membank("bank1")->configure_entries(0, 3, machine.root_device().memregion("user2")->base(), 0x400000*4);
}
diff --git a/src/mame/drivers/miniboy7.c b/src/mame/drivers/miniboy7.c
index c6f0c757649..8b17fe79de6 100644
--- a/src/mame/drivers/miniboy7.c
+++ b/src/mame/drivers/miniboy7.c
@@ -219,7 +219,7 @@ static SCREEN_UPDATE_IND16( miniboy7 )
static PALETTE_INIT( miniboy7 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* FIXME... Can't get the correct palette.
sometimes RGB bits are inverted, disregarding the 4th bit.
diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c
index b9bc7f87a2a..a768acd90d2 100644
--- a/src/mame/drivers/mirax.c
+++ b/src/mame/drivers/mirax.c
@@ -130,7 +130,7 @@ public:
static PALETTE_INIT( mirax )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
@@ -535,8 +535,8 @@ ROM_END
static DRIVER_INIT( mirax )
{
mirax_state *state = machine.driver_data<mirax_state>();
- UINT8 *DATA = machine.region("data_code")->base();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *DATA = machine.root_device().memregion("data_code")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
int i;
for(i=0x0000;i<0x4000;i++)
diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c
index d4c584c36d9..2f2710aae90 100644
--- a/src/mame/drivers/missb2.c
+++ b/src/mame/drivers/missb2.c
@@ -72,7 +72,7 @@ static SCREEN_UPDATE_IND16( missb2 )
sx = 0;
- prom = screen.machine().region("proms")->base();
+ prom = screen.machine().root_device().memregion("proms")->base();
for (offs = 0; offs < state->m_objectram.bytes(); offs += 4)
{
/* skip empty sprites */
@@ -573,8 +573,8 @@ ROM_END
static void configure_banks( running_machine& machine )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *SLAVE = machine.region("slave")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *SLAVE = machine.root_device().memregion("slave")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index a0dd94530d2..94965f82c2b 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -501,7 +501,7 @@ DIRECT_UPDATE_MEMBER(missile_state::missile_direct_handler)
/* ROM? */
else if (address >= 0x5000)
{
- direct.explicit_configure(0x5000 | offset, 0x7fff | offset, 0x7fff, direct.space().machine().region("maincpu")->base() + 0x5000);
+ direct.explicit_configure(0x5000 | offset, 0x7fff | offset, 0x7fff, direct.space().machine().root_device().memregion("maincpu")->base() + 0x5000);
return ~0;
}
@@ -514,7 +514,7 @@ static MACHINE_START( missile )
{
missile_state *state = machine.driver_data<missile_state>();
/* initialize globals */
- state->m_writeprom = machine.region("proms")->base();
+ state->m_writeprom = state->memregion("proms")->base();
state->m_flipscreen = 0;
/* set up an opcode base handler since we use mapped handlers for RAM */
@@ -786,7 +786,7 @@ READ8_MEMBER(missile_state::missile_r)
/* ROM */
else if (offset >= 0x5000)
- result = machine().region("maincpu")->base()[offset];
+ result = memregion("maincpu")->base()[offset];
/* POKEY */
else if (offset < 0x4800)
@@ -1199,7 +1199,7 @@ ROM_END
static DRIVER_INIT( suprmatk )
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x40; i++)
{
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index 386e1848d06..f86a6588ec6 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -2105,14 +2105,14 @@ ROM_END
static void bootleg_decode( running_machine &machine )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x50000);
- machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, machine.region("maincpu")->base() + 0x60000, 0x4000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x50000);
+ machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x60000, 0x4000);
}
static void configure_banks( running_machine &machine )
{
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
@@ -2161,7 +2161,7 @@ static DRIVER_INIT( spang )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
spang_decode(machine);
configure_banks(machine);
}
@@ -2171,7 +2171,7 @@ static DRIVER_INIT( spangbl )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
bootleg_decode(machine);
configure_banks(machine);
}
@@ -2181,7 +2181,7 @@ static DRIVER_INIT( spangj )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
spangj_decode(machine);
configure_banks(machine);
}
@@ -2190,7 +2190,7 @@ static DRIVER_INIT( sbbros )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
sbbros_decode(machine);
configure_banks(machine);
}
@@ -2255,7 +2255,7 @@ static DRIVER_INIT( block )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 2;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xff80]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xff80]; /* NVRAM */
block_decode(machine);
configure_banks(machine);
}
@@ -2264,7 +2264,7 @@ static DRIVER_INIT( blockbl )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 2;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xff80]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xff80]; /* NVRAM */
bootleg_decode(machine);
configure_banks(machine);
}
@@ -2272,9 +2272,9 @@ static DRIVER_INIT( blockbl )
static DRIVER_INIT( mstworld )
{
/* descramble the program rom .. */
- int len = machine.region("maincpu")->bytes();
+ int len = machine.root_device().memregion("maincpu")->bytes();
UINT8* source = auto_alloc_array(machine, UINT8, len);
- UINT8* dst = machine.region("maincpu")->base() ;
+ UINT8* dst = machine.root_device().memregion("maincpu")->base() ;
int x;
static const int tablebank[]=
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index 623c8c4918a..0aa333bfb11 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -74,7 +74,7 @@ static DEVICE_START( mjkjidai_adpcm )
state->m_playing = 0;
state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, mjkjidai_adpcm_callback);
- state->m_base = machine.region("adpcm")->base();
+ state->m_base = machine.root_device().memregion("adpcm")->base();
state->m_adpcm.reset();
}
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index a32b8fb92b4..2f79d2971d6 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -166,7 +166,7 @@ static SCREEN_UPDATE_IND16( mjsister )
static TIMER_CALLBACK( dac_callback )
{
mjsister_state *state = machine.driver_data<mjsister_state>();
- UINT8 *DACROM = machine.region("samples")->base();
+ UINT8 *DACROM = state->memregion("samples")->base();
dac_data_w(state->m_dac, DACROM[(state->m_dac_bank * 0x10000 + state->m_dac_adr++) & 0x1ffff]);
@@ -449,9 +449,9 @@ static void mjsister_redraw(mjsister_state *state)
static MACHINE_START( mjsister )
{
mjsister_state *state = machine.driver_data<mjsister_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
- machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
state->m_maincpu = machine.device("maincpu");
state->m_dac = machine.device("dac");
diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c
index f1ab0b1ec0d..1907e495b8d 100644
--- a/src/mame/drivers/mlanding.c
+++ b/src/mame/drivers/mlanding.c
@@ -271,7 +271,7 @@ WRITE16_MEMBER(mlanding_state::ml_output_w)
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
data=0;
- device->machine().root_device().membank("bank1")->set_base(device->machine().region("audiocpu")->base() + ((data) & 0x03) * 0x4000 + 0x10000 );
+ device->machine().root_device().membank("bank1")->set_base(device->machine().root_device().memregion("audiocpu")->base() + ((data) & 0x03) * 0x4000 + 0x10000 );
}
static void ml_msm5205_vck(device_t *device)
@@ -288,7 +288,7 @@ static void ml_msm5205_vck(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) );
msm5205_data_w(device,state->m_adpcm_data & 0xf);
@@ -846,7 +846,7 @@ ROM_END
static DRIVER_INIT(mlanding)
{
-// UINT8 *rom = machine.region("sub")->base();
+// UINT8 *rom = machine.root_device().memregion("sub")->base();
// rom[0x88b]=0x4e;
// rom[0x88a]=0x71;
}
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index b886e28907d..5667f42dcae 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -664,7 +664,7 @@ WRITE16_MEMBER(model1_state::bank_w)
if(ACCESSING_BITS_0_7) {
switch(data & 0xf) {
case 0x1: // 100000-1fffff data roms banking
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1000000 + 0x100000*((data >> 4) & 0xf));
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1000000 + 0x100000*((data >> 4) & 0xf));
logerror("BANK %x\n", 0x1000000 + 0x100000*((data >> 4) & 0xf));
break;
case 0x2: // 200000-2fffff data roms banking (unused, all known games have only one bank)
@@ -735,7 +735,7 @@ static TIMER_DEVICE_CALLBACK( model1_interrupt )
static MACHINE_RESET(model1)
{
model1_state *state = machine.driver_data<model1_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x1000000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x1000000);
irq_init(machine);
model1_tgp_reset(machine, !strcmp(machine.system().name, "swa") || !strcmp(machine.system().name, "wingwar") || !strcmp(machine.system().name, "wingwaru") || !strcmp(machine.system().name, "wingwarj"));
if (!strcmp(machine.system().name, "swa"))
@@ -755,7 +755,7 @@ static MACHINE_RESET(model1)
static MACHINE_RESET(model1_vr)
{
model1_state *state = machine.driver_data<model1_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x1000000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x1000000);
irq_init(machine);
model1_vr_tgp_reset(machine);
state->m_sound_irq = 3;
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 83ee7ee5e49..2ba52ce5497 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -356,11 +356,11 @@ static MACHINE_RESET(model2o)
static MACHINE_RESET(model2_scsp)
{
model2_state *state = machine.driver_data<model2_state>();
- state->membank("bank4")->set_base(machine.region("scsp")->base() + 0x200000);
- state->membank("bank5")->set_base(machine.region("scsp")->base() + 0x600000);
+ state->membank("bank4")->set_base(machine.root_device().memregion("scsp")->base() + 0x200000);
+ state->membank("bank5")->set_base(machine.root_device().memregion("scsp")->base() + 0x600000);
// copy the 68k vector table into RAM
- memcpy(state->m_soundram, machine.region("audiocpu")->base() + 0x80000, 16);
+ memcpy(state->m_soundram, state->memregion("audiocpu")->base() + 0x80000, 16);
machine.device("audiocpu")->reset();
scsp_set_ram_base(machine.device("scsp"), state->m_soundram);
}
@@ -1153,7 +1153,7 @@ WRITE32_MEMBER(model2_state::model2_prot_w)
READ32_MEMBER(model2_state::maxx_r)
{
- UINT32 *ROM = (UINT32 *)machine().region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)machine().root_device().memregion("maincpu")->base();
if (offset <= 0x1f/4)
{
@@ -1844,9 +1844,9 @@ ADDRESS_MAP_END
WRITE16_MEMBER(model2_state::model2snd_ctrl)
{
// handle sample banking
- if (machine().region("scsp")->bytes() > 0x800000)
+ if (machine().root_device().memregion("scsp")->bytes() > 0x800000)
{
- UINT8 *snd = machine().region("scsp")->base();
+ UINT8 *snd = memregion("scsp")->base();
if (data & 0x20)
{
membank("bank4")->set_base(snd + 0x200000);
@@ -5117,7 +5117,7 @@ static DRIVER_INIT( genprot )
static DRIVER_INIT( pltkids )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
state->m_protstate = state->m_protpos = 0;
@@ -5129,7 +5129,7 @@ static DRIVER_INIT( pltkids )
static DRIVER_INIT( zerogun )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
state->m_protstate = state->m_protpos = 0;
@@ -5173,7 +5173,7 @@ WRITE32_MEMBER(model2_state::jaleco_network_w)
static DRIVER_INIT( sgt24h )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),state), write32_delegate(FUNC(model2_state::jaleco_network_w),state));
@@ -5196,7 +5196,7 @@ static DRIVER_INIT( overrev )
static DRIVER_INIT( doa )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
state->m_protstate = state->m_protpos = 0;
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index cc5cf95af10..a127090078e 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1277,13 +1277,13 @@ static void model3_init(running_machine &machine, int step)
state->m_sound_irq_enable = 0;
state->m_sound_timer->adjust(attotime::never);
- state->membank("bank1")->set_base(machine.region( "user1" )->base() + 0x800000 ); /* banked CROM */
+ state->membank("bank1")->set_base(machine.root_device().memregion( "user1" )->base() + 0x800000 ); /* banked CROM */
- state->membank("bank4")->set_base(machine.region("samples")->base() + 0x200000);
- state->membank("bank5")->set_base(machine.region("samples")->base() + 0x600000);
+ state->membank("bank4")->set_base(machine.root_device().memregion("samples")->base() + 0x200000);
+ state->membank("bank5")->set_base(machine.root_device().memregion("samples")->base() + 0x600000);
// copy the 68k vector table into RAM
- memcpy(state->m_soundram, machine.region("audiocpu")->base()+0x80000, 16);
+ memcpy(state->m_soundram, state->memregion("audiocpu")->base()+0x80000, 16);
machine.device("audiocpu")->reset();
model3_machine_init(machine, step); // step 1.5
@@ -1589,7 +1589,7 @@ WRITE64_MEMBER(model3_state::model3_sys_w)
data >>= 56;
data = (~data) & 0x7;
- membank("bank1")->set_base(machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ membank("bank1")->set_base(machine().root_device().memregion( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
}
if (ACCESSING_BITS_24_31)
{
@@ -1845,8 +1845,8 @@ WRITE64_MEMBER(model3_state::daytona2_rombank_w)
{
data >>= 56;
data = (~data) & 0xf;
- membank("bank1")->set_base(machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
- membank("bank2")->set_base(machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ membank("bank1")->set_base(machine().root_device().memregion( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ membank("bank2")->set_base(machine().root_device().memregion( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
}
}
@@ -5044,9 +5044,9 @@ ROM_END
WRITE16_MEMBER(model3_state::model3snd_ctrl)
{
// handle sample banking
- if (machine().region("scsp2")->bytes() > 0x800000)
+ if (machine().root_device().memregion("scsp2")->bytes() > 0x800000)
{
- UINT8 *snd = machine().region("scsp2")->base();
+ UINT8 *snd = memregion("scsp2")->base();
if (data & 0x20)
{
membank("bank4")->set_base(snd + 0x200000);
@@ -5302,9 +5302,9 @@ static void interleave_vroms(running_machine &machine)
model3_state *state = machine.driver_data<model3_state>();
int start;
int i,j,x;
- UINT16 *vrom1 = (UINT16*)machine.region("user3")->base();
- UINT16 *vrom2 = (UINT16*)machine.region("user4")->base();
- int vrom_length = machine.region("user3")->bytes();
+ UINT16 *vrom1 = (UINT16*)machine.root_device().memregion("user3")->base();
+ UINT16 *vrom2 = (UINT16*)machine.root_device().memregion("user4")->base();
+ int vrom_length = state->memregion("user3")->bytes();
UINT16 *vrom;
state->m_vrom = auto_alloc_array(machine, UINT32, 0x4000000/4);
@@ -5369,7 +5369,7 @@ static DRIVER_INIT( model3_20 )
static DRIVER_INIT( lostwsga )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */
@@ -5381,7 +5381,7 @@ static DRIVER_INIT( lostwsga )
static DRIVER_INIT( scud )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
@@ -5394,7 +5394,7 @@ static DRIVER_INIT( scud )
static DRIVER_INIT( scudp )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
@@ -5412,7 +5412,7 @@ static DRIVER_INIT( scudp )
static DRIVER_INIT( lemans24 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),state), write64_delegate(FUNC(model3_state::scsi_w),state));
@@ -5426,7 +5426,7 @@ static DRIVER_INIT( lemans24 )
static DRIVER_INIT( vf3 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_10);
@@ -5440,7 +5440,7 @@ static DRIVER_INIT( vf3 )
static DRIVER_INIT( vs215 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
rom[(0x70dde0^4)/4] = 0x60000000;
rom[(0x70e6f0^4)/4] = 0x60000000;
@@ -5461,7 +5461,7 @@ static DRIVER_INIT( vs215 )
static DRIVER_INIT( vs29815 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
rom[(0x6028ec^4)/4] = 0x60000000;
rom[(0x60290c^4)/4] = 0x60000000;
@@ -5481,7 +5481,7 @@ static DRIVER_INIT( vs29815 )
static DRIVER_INIT( bass )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
rom[(0x7999a8^4)/4] = 0x60000000;
rom[(0x7999c8^4)/4] = 0x60000000;
@@ -5513,7 +5513,7 @@ static DRIVER_INIT( getbass )
static DRIVER_INIT( vs2 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5523,7 +5523,7 @@ static DRIVER_INIT( vs2 )
static DRIVER_INIT( vs298 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5534,7 +5534,7 @@ static DRIVER_INIT( vs298 )
static DRIVER_INIT( vs2v991 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5544,7 +5544,7 @@ static DRIVER_INIT( vs2v991 )
static DRIVER_INIT( vs299b )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5554,7 +5554,7 @@ static DRIVER_INIT( vs299b )
static DRIVER_INIT( vs299a )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5564,7 +5564,7 @@ static DRIVER_INIT( vs299a )
static DRIVER_INIT( vs299 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5575,7 +5575,7 @@ static DRIVER_INIT( vs299 )
static DRIVER_INIT( harley )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
state->m_network_ram = auto_alloc_array_clear(machine, UINT64, 0x10000);
@@ -5591,7 +5591,7 @@ static DRIVER_INIT( harley )
static DRIVER_INIT( harleyb )
{
model3_state *state = machine.driver_data<model3_state>();
- //UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ //UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
state->m_network_ram = auto_alloc_array_clear(machine, UINT64, 0x10000);
@@ -5607,7 +5607,7 @@ static DRIVER_INIT( harleyb )
static DRIVER_INIT( srally2 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x7c0c4^4)/4] = 0x60000000;
@@ -5617,7 +5617,7 @@ static DRIVER_INIT( srally2 )
static DRIVER_INIT( swtrilgy )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0xf0e48^4)/4] = 0x60000000;
@@ -5628,7 +5628,7 @@ static DRIVER_INIT( swtrilgy )
static DRIVER_INIT( swtrilga )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0xf6dd0^4)/4] = 0x60000000;
@@ -5636,7 +5636,7 @@ static DRIVER_INIT( swtrilga )
static DRIVER_INIT( von2 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x189168^4)/4] = 0x60000000;
@@ -5648,7 +5648,7 @@ static DRIVER_INIT( von2 )
static DRIVER_INIT( dirtdvls )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x0600a0^4)/4] = 0x60000000;
@@ -5662,7 +5662,7 @@ static DRIVER_INIT( dirtdvls )
static DRIVER_INIT( daytona2 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),state));
@@ -5677,7 +5677,7 @@ static DRIVER_INIT( daytona2 )
static DRIVER_INIT( dayto2pe )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),state));
@@ -5692,7 +5692,7 @@ static DRIVER_INIT( dayto2pe )
static DRIVER_INIT( spikeout )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x6059cc^4)/4] = 0x60000000;
@@ -5701,7 +5701,7 @@ static DRIVER_INIT( spikeout )
static DRIVER_INIT( spikeofe )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x6059cc^4)/4] = 0x60000000;
@@ -5710,7 +5710,7 @@ static DRIVER_INIT( spikeofe )
static DRIVER_INIT( eca )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x535580^4)/4] = 0x60000000;
@@ -5720,7 +5720,7 @@ static DRIVER_INIT( eca )
static DRIVER_INIT( skichamp )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x5263c8^4)/4] = 0x60000000;
@@ -5731,7 +5731,7 @@ static DRIVER_INIT( skichamp )
static DRIVER_INIT( oceanhun )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x57995c^4)/4] = 0x60000000; // decrementer
diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c
index 02a56ef5180..458b7aee275 100644
--- a/src/mame/drivers/mogura.c
+++ b/src/mame/drivers/mogura.c
@@ -32,7 +32,7 @@ public:
static PALETTE_INIT( mogura )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, j;
j = 0;
diff --git a/src/mame/drivers/momoko.c b/src/mame/drivers/momoko.c
index cd818b81d13..8e1d27e2552 100644
--- a/src/mame/drivers/momoko.c
+++ b/src/mame/drivers/momoko.c
@@ -228,7 +228,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( momoko )
{
momoko_state *state = machine.driver_data<momoko_state>();
- UINT8 *BG_MAP = machine.region("user1")->base();
+ UINT8 *BG_MAP = state->memregion("user1")->base();
state->membank("bank1")->configure_entries(0, 32, &BG_MAP[0x0000], 0x1000);
diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c
index 254f3bb10e0..5c37fb44e5f 100644
--- a/src/mame/drivers/moo.c
+++ b/src/mame/drivers/moo.c
@@ -180,7 +180,7 @@ READ16_MEMBER(moo_state::sound_status_r)
WRITE8_MEMBER(moo_state::sound_bankswitch_w)
{
- membank("bank1")->set_base(machine().region("soundcpu")->base() + 0x10000 + (data&0xf)*0x4000);
+ membank("bank1")->set_base(machine().root_device().memregion("soundcpu")->base() + 0x10000 + (data&0xf)*0x4000);
}
diff --git a/src/mame/drivers/mouser.c b/src/mame/drivers/mouser.c
index f4a36edfea3..eaf32f1f255 100644
--- a/src/mame/drivers/mouser.c
+++ b/src/mame/drivers/mouser.c
@@ -295,9 +295,9 @@ static DRIVER_INIT( mouser )
offs_t i;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x6000);
- UINT8 *table = machine.region("user1")->base();
+ UINT8 *table = machine.root_device().memregion("user1")->base();
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c
index 3b069954284..965ece3a033 100644
--- a/src/mame/drivers/mpu4.c
+++ b/src/mame/drivers/mpu4.c
@@ -464,7 +464,7 @@ static MACHINE_RESET( mpu4 )
/* init rom bank, some games don't set this, and will assume bank 0,set 0 */
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &rom[0x01000], 0x10000);
@@ -528,7 +528,7 @@ WRITE8_MEMBER(mpu4_state::bankswitch_w)
READ8_MEMBER(mpu4_state::bankswitch_r)
{
- return machine().root_device().membank("bank1")->entry();
+ return membank("bank1")->entry();
}
@@ -15233,13 +15233,13 @@ void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
DRIVER_INIT( crystal )
{
DRIVER_INIT_CALL(m_frkstn);
- descramble_crystal(machine.region( "maincpu" )->base(), 0x0000, 0x10000, 0x00);
+ descramble_crystal(machine.root_device().memregion( "maincpu" )->base(), 0x0000, 0x10000, 0x00);
}
DRIVER_INIT( crystali )
{
DRIVER_INIT_CALL(m_frkstn);
- descramble_crystal(machine.region( "maincpu" )->base(), 0x0000, 0x10000, 0xff); // invert after decrypt?!
+ descramble_crystal(machine.root_device().memregion( "maincpu" )->base(), 0x0000, 0x10000, 0xff); // invert after decrypt?!
}
diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c
index ab58fdb5a45..67d21fef681 100644
--- a/src/mame/drivers/mpu4vid.c
+++ b/src/mame/drivers/mpu4vid.c
@@ -2112,7 +2112,7 @@ GFXDECODE_END
static PALETTE_INIT( dealem )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, len;
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
@@ -2123,7 +2123,7 @@ static PALETTE_INIT( dealem )
3, resistances_rg, weights_g, 1000, 0,
2, resistances_b, weights_b, 1000, 0);
- len = machine.region("proms")->bytes();
+ len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len; i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -2883,7 +2883,7 @@ static DRIVER_INIT (prizeinv)
void mpu4vid_char_cheat(running_machine& machine, int address)
{
mpu4_state *state = machine.driver_data<mpu4_state>();
- UINT8* cheattable = machine.region( "video" )->base()+address;
+ UINT8* cheattable = state->memregion( "video" )->base()+address;
state->m_current_chr_table = blank_data;
for (int i=0;i<72;i++)
{
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index 8fc3fe2b307..d79f698e28e 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -87,7 +87,7 @@ static WRITE8_DEVICE_HANDLER( mquake_cia_0_portb_w )
static READ8_HANDLER( es5503_sample_r )
{
- UINT8 *rom = space->machine().region("es5503")->base();
+ UINT8 *rom = space->machine().root_device().memregion("es5503")->base();
es5503_device *es5503 = space->machine().device<es5503_device>("es5503");
return rom[offset + (es5503->get_channel_strobe() * 0x10000)];
@@ -445,7 +445,7 @@ static DRIVER_INIT(mquake)
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
}
diff --git a/src/mame/drivers/mrdo.c b/src/mame/drivers/mrdo.c
index 23c274d39da..3f8d7c96147 100644
--- a/src/mame/drivers/mrdo.c
+++ b/src/mame/drivers/mrdo.c
@@ -34,7 +34,7 @@ There's a chance that certain bootlegs might have the different 8/20 MHz XTALS.
/* if a read from this address doesn't return the value it expects. */
READ8_MEMBER(mrdo_state::mrdo_SECRE_r)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
return RAM[cpu_get_reg(&space.device(), Z80_HL)];
}
diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c
index c86384d9070..c1865efec79 100644
--- a/src/mame/drivers/ms32.c
+++ b/src/mame/drivers/ms32.c
@@ -1381,7 +1381,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ms32 )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base());
machine.root_device().membank("bank4")->set_entry(0);
machine.root_device().membank("bank5")->set_entry(1);
irq_init(machine);
@@ -2202,8 +2202,8 @@ static void configure_banks(running_machine &machine)
{
ms32_state *state = machine.driver_data<ms32_state>();
state_save_register_global(machine, state->m_to_main);
- state->membank("bank4")->configure_entries(0, 16, machine.region("audiocpu")->base() + 0x14000, 0x4000);
- state->membank("bank5")->configure_entries(0, 16, machine.region("audiocpu")->base() + 0x14000, 0x4000);
+ state->membank("bank4")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base() + 0x14000, 0x4000);
+ state->membank("bank5")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
}
static DRIVER_INIT( ms32_common )
@@ -2262,7 +2262,7 @@ static DRIVER_INIT (47pie2)
static DRIVER_INIT (f1superb)
{
#if 0 // we shouldn't need this hack, something else is wrong, and the x offsets are never copied either, v70 problems??
- UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.root_device().memregion("maincpu")->base();
pROM[0x19d04/4]=0x167a021a; // bne->br : sprite Y offset table is always copied to RAM
#endif
DRIVER_INIT_CALL(ss92046_01);
diff --git a/src/mame/drivers/multfish.c b/src/mame/drivers/multfish.c
index 901edba0692..8fbbebdf359 100644
--- a/src/mame/drivers/multfish.c
+++ b/src/mame/drivers/multfish.c
@@ -471,7 +471,7 @@ A12 <-> A13
*/
UINT32 i,j,jscr,romoffset;
- UINT8 *multfish_gfx = machine.region("gfx")->base();
+ UINT8 *multfish_gfx = machine.root_device().memregion("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
@@ -543,7 +543,7 @@ INLINE void rom_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor
static void lottery_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
{
- UINT8 *multfish_gfx = machine.region("gfx")->base();
+ UINT8 *multfish_gfx = machine.root_device().memregion("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
/* ROMs decode */
@@ -584,7 +584,7 @@ INLINE void roment_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32
static void ent_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
{
- UINT8 *multfish_gfx = machine.region("gfx")->base();
+ UINT8 *multfish_gfx = machine.root_device().memregion("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
/* ROMs decode */
@@ -1009,7 +1009,7 @@ static MACHINE_RESET( multfish )
{
multfish_state *state = machine.driver_data<multfish_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base(), 0x4000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("maincpu")->base(), 0x4000);
state->membank("bank1")->set_entry(0);
state->m_disp_enable = 0;
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index df7289240aa..18a363d2d5f 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -196,7 +196,7 @@ static void set_videorom_bank(running_machine& machine, int start, int count, in
/* count determines the size of the area mapped in KB */
for (i = 0; i < count; i++, offset += 0x400)
{
- machine.root_device().membank(banknames[i + start])->set_base(machine.region("gfx1")->base() + offset);
+ machine.root_device().membank(banknames[i + start])->set_base(machine.root_device().memregion("gfx1")->base() + offset);
}
}
@@ -293,8 +293,8 @@ CUSTOM_INPUT_MEMBER(multigam_state::multigam_inputs_r)
WRITE8_MEMBER(multigam_state::multigam_switch_prg_rom)
{
/* switch PRG rom */
- UINT8* dst = machine().region("maincpu")->base();
- UINT8* src = machine().region("user1")->base();
+ UINT8* dst = memregion("maincpu")->base();
+ UINT8* src = memregion("user1")->base();
if (data & 0x80)
{
@@ -313,7 +313,7 @@ WRITE8_MEMBER(multigam_state::multigam_switch_prg_rom)
WRITE8_MEMBER(multigam_state::multigam_switch_gfx_rom)
{
- membank("bank1")->set_base(machine().region("gfx1")->base() + (0x2000 * (data & 0x3f)));
+ membank("bank1")->set_base(machine().root_device().memregion("gfx1")->base() + (0x2000 * (data & 0x3f)));
set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
m_game_gfx_bank = data;
};
@@ -323,7 +323,7 @@ WRITE8_MEMBER(multigam_state::multigam_mapper2_w)
{
if (m_game_gfx_bank & 0x80)
{
- membank("bank1")->set_base(machine().region("gfx1")->base() + (0x2000 * ((data & 0x3) + (m_game_gfx_bank & 0x3c))));
+ membank("bank1")->set_base(machine().root_device().memregion("gfx1")->base() + (0x2000 * ((data & 0x3) + (m_game_gfx_bank & 0x3c))));
}
else
{
@@ -408,7 +408,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
if (m_multigam3_mmc3_last_bank != (data & 0xc0))
{
int bank;
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
/* reset the banks */
if (m_multigam3_mmc3_command & 0x40)
@@ -461,7 +461,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
case 6: /* program banking */
{
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
if (m_multigam3_mmc3_command & 0x40)
{
/* high bank */
@@ -486,7 +486,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
case 7: /* program banking */
{
/* mid bank */
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
m_multigam3_mmc3_banks[1] = data & bankmask;
bank = m_multigam3_mmc3_banks[1] * 0x2000;
@@ -515,7 +515,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
}
else
{
- membank("bank10")->set_base(machine().region("maincpu")->base() + 0x6000);
+ membank("bank10")->set_base(machine().root_device().memregion("maincpu")->base() + 0x6000);
}
if (data & 0x40)
{
@@ -544,7 +544,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
static void multigam_init_mmc3(running_machine &machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
{
multigam_state *state = machine.driver_data<multigam_state>();
- UINT8* dst = machine.region("maincpu")->base();
+ UINT8* dst = state->memregion("maincpu")->base();
// Tom & Jerry in Super Game III enables 6000 ram, but does not read/write it
// however, it expects ROM from 6000 there (code jumps to $6xxx)
@@ -588,8 +588,8 @@ WRITE8_MEMBER(multigam_state::multigm3_switch_gfx_rom)
WRITE8_MEMBER(multigam_state::multigm3_switch_prg_rom)
{
/* switch PRG rom */
- UINT8* dst = machine().region("maincpu")->base();
- UINT8* src = machine().region("user1")->base();
+ UINT8* dst = memregion("maincpu")->base();
+ UINT8* src = memregion("user1")->base();
if (data == 0xa8)
{
@@ -599,7 +599,7 @@ WRITE8_MEMBER(multigam_state::multigm3_switch_prg_rom)
else
{
space.install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigm3_mapper2_w),this) );
- membank("bank10")->set_base(machine().region("maincpu")->base() + 0x6000);
+ membank("bank10")->set_base(machine().root_device().memregion("maincpu")->base() + 0x6000);
}
if (data & 0x80)
@@ -651,7 +651,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(multigam_state::multigam3_mapper02_rom_switch_w)
{
- UINT8* mem = machine().region("maincpu")->base();
+ UINT8* mem = memregion("maincpu")->base();
int bankmask = (m_mapper02_prg_size/0x4000) - 1;
memcpy(mem + 0x8000, m_mapper02_prg_base + 0x4000*(data & bankmask), 0x4000);
}
@@ -660,7 +660,7 @@ static void multigam_init_mapper02(running_machine &machine, UINT8* prg_base, in
{
multigam_state *state = machine.driver_data<multigam_state>();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
- UINT8* mem = machine.region("maincpu")->base();
+ UINT8* mem = state->memregion("maincpu")->base();
memcpy(mem + 0x8000, prg_base + prg_size - 0x8000, 0x8000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigam3_mapper02_rom_switch_w),state));
@@ -780,7 +780,7 @@ WRITE8_MEMBER(multigam_state::mmc1_rom_switch_w)
case 3: /* program banking */
{
int bank = (m_mmc1_shiftreg & m_mmc1_rom_mask) * 0x4000;
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
if (!m_size16k)
{
@@ -813,7 +813,7 @@ WRITE8_MEMBER(multigam_state::mmc1_rom_switch_w)
static void multigam_init_mmc1(running_machine &machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
{
multigam_state *state = machine.driver_data<multigam_state>();
- UINT8* dst = machine.region("maincpu")->base();
+ UINT8* dst = state->memregion("maincpu")->base();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000);
@@ -856,7 +856,7 @@ static void supergm3_set_bank(running_machine &machine)
{
multigam_state *state = machine.driver_data<multigam_state>();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
- UINT8* mem = machine.region("maincpu")->base();
+ UINT8* mem = state->memregion("maincpu")->base();
// video bank
if (state->m_supergm3_chr_bank == 0x10 ||
@@ -897,14 +897,14 @@ static void supergm3_set_bank(running_machine &machine)
{
// mapper 02
multigam_init_mapper02(machine,
- machine.region("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
+ machine.root_device().memregion("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
0x20000);
}
else if (state->m_supergm3_chr_bank & 0x10)
{
// MMC3
multigam_init_mmc3(machine,
- machine.region("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
+ machine.root_device().memregion("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
(state->m_supergm3_prg_bank & 0x20) ? 0x20000 : 0x40000,
(state->m_supergm3_chr_bank & 0x0f)*0x80);
}
@@ -912,7 +912,7 @@ static void supergm3_set_bank(running_machine &machine)
{
//MMC1
multigam_init_mmc1(machine,
- machine.region("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
+ machine.root_device().memregion("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
0x20000,
(state->m_supergm3_chr_bank & 0x0f)*0x80/4 );
}
@@ -1139,7 +1139,7 @@ static MACHINE_START( multigam )
machine.device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),state), write8_delegate(FUNC(multigam_state::multigam_nt_w),state));
machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
- state->membank("bank1")->set_base(machine.region("gfx1")->base());
+ state->membank("bank1")->set_base(state->memregion("gfx1")->base());
}
static MACHINE_START( multigm3 )
@@ -1373,8 +1373,8 @@ static DRIVER_INIT(multigm3)
const UINT8 decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a };
- multigm3_decrypt(machine.region("maincpu")->base(), machine.region("maincpu")->bytes(), decode );
- multigm3_decrypt(machine.region("user1")->base(), machine.region("user1")->bytes(), decode );
+ multigm3_decrypt(machine.root_device().memregion("maincpu")->base(), machine.root_device().memregion("maincpu")->bytes(), decode );
+ multigm3_decrypt(machine.root_device().memregion("user1")->base(), machine.root_device().memregion("user1")->bytes(), decode );
state->m_multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -1391,7 +1391,7 @@ static DRIVER_INIT(multigmt)
int i;
int addr;
- rom = machine.region("maincpu")->base();
+ rom = machine.root_device().memregion("maincpu")->base();
size = 0x8000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
@@ -1401,7 +1401,7 @@ static DRIVER_INIT(multigmt)
rom[i] = buf[addr];
}
- rom = machine.region("user1")->base();
+ rom = machine.root_device().memregion("user1")->base();
size = 0x80000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
@@ -1409,7 +1409,7 @@ static DRIVER_INIT(multigmt)
addr = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,8,11,12,10,9,7,6,5,4,3,2,1,0);
rom[i] = buf[addr];
}
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
size = 0x80000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
diff --git a/src/mame/drivers/murogmbl.c b/src/mame/drivers/murogmbl.c
index 2b653132b5d..e33ec3e2b7a 100644
--- a/src/mame/drivers/murogmbl.c
+++ b/src/mame/drivers/murogmbl.c
@@ -51,7 +51,7 @@ public:
static PALETTE_INIT( murogmbl )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/mustache.c b/src/mame/drivers/mustache.c
index 173991329e3..73d1fd8a75e 100644
--- a/src/mame/drivers/mustache.c
+++ b/src/mame/drivers/mustache.c
@@ -252,10 +252,10 @@ static DRIVER_INIT( mustache )
{
int i;
- int G1 = machine.region("gfx1")->bytes()/3;
- int G2 = machine.region("gfx2")->bytes()/2;
- UINT8 *gfx1 = machine.region("gfx1")->base();
- UINT8 *gfx2 = machine.region("gfx2")->base();
+ int G1 = machine.root_device().memregion("gfx1")->bytes()/3;
+ int G2 = machine.root_device().memregion("gfx2")->bytes()/2;
+ UINT8 *gfx1 = machine.root_device().memregion("gfx1")->base();
+ UINT8 *gfx2 = machine.root_device().memregion("gfx2")->base();
UINT8 *buf=auto_alloc_array(machine, UINT8, G2*2);
/* BG data lines */
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index 6645514c881..f564298824c 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -557,7 +557,7 @@ ADDRESS_MAP_END
static void reset_sound_region(running_machine &machine)
{
mystwarr_state *state = machine.driver_data<mystwarr_state>();
- state->membank("bank2")->set_base(machine.region("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
+ state->membank("bank2")->set_base(state->memregion("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
}
WRITE8_MEMBER(mystwarr_state::sound_bankswitch_w)
diff --git a/src/mame/drivers/namcofl.c b/src/mame/drivers/namcofl.c
index eedd1682762..08d8aa00757 100644
--- a/src/mame/drivers/namcofl.c
+++ b/src/mame/drivers/namcofl.c
@@ -188,11 +188,11 @@ WRITE32_MEMBER(namcofl_state::namcofl_sysreg_w)
if (data == 0) // RAM at 00000000, ROM at 10000000
{
membank("bank1")->set_base(m_workram );
- membank("bank2")->set_base(machine().region("maincpu")->base() );
+ membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() );
}
else // ROM at 00000000, RAM at 10000000
{
- membank("bank1")->set_base(machine().region("maincpu")->base() );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() );
membank("bank2")->set_base(m_workram );
}
}
@@ -580,7 +580,7 @@ static MACHINE_RESET( namcofl )
machine.scheduler().timer_set(machine.primary_screen->time_until_pos(machine.primary_screen->visible_area().max_y + 3), FUNC(network_interrupt_callback));
machine.scheduler().timer_set(machine.primary_screen->time_until_pos(machine.primary_screen->visible_area().max_y + 1), FUNC(vblank_interrupt_callback));
- state->membank("bank1")->set_base(machine.region("maincpu")->base() );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() );
state->membank("bank2")->set_base(state->m_workram );
memset(state->m_workram, 0x00, 0x100000);
@@ -811,7 +811,7 @@ static void namcofl_common_init(running_machine &machine)
namcofl_state *state = machine.driver_data<namcofl_state>();
state->m_workram = auto_alloc_array(machine, UINT32, 0x100000/4);
- state->membank("bank1")->set_base(machine.region("maincpu")->base() );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() );
state->membank("bank2")->set_base(state->m_workram );
}
diff --git a/src/mame/drivers/namcoic.c b/src/mame/drivers/namcoic.c
index 1c740a14756..8b5e89f6dfd 100644
--- a/src/mame/drivers/namcoic.c
+++ b/src/mame/drivers/namcoic.c
@@ -1101,7 +1101,7 @@ roz_get_info( running_machine &machine, tile_data &tileinfo, int tile_index, int
break;
}
SET_TILE_INFO( mRozGfxBank,mangle,0/*color*/,0/*flag*/ );
- tileinfo.mask_data = 32*tile + (UINT8 *)machine.region( mRozMaskRegion )->base();
+ tileinfo.mask_data = 32*tile + (UINT8 *)machine.root_device().memregion( mRozMaskRegion )->base();
} /* roz_get_info */
static
@@ -1604,7 +1604,7 @@ namco_road_set_transparent_color(pen_t pen)
void
namco_road_draw(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
{
- const UINT8 *clut = (const UINT8 *)machine.region("user3")->base();
+ const UINT8 *clut = (const UINT8 *)machine.root_device().memregion("user3")->base();
unsigned yscroll;
int i;
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index dec2f34c685..066ab34f354 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -1067,7 +1067,7 @@ MACHINE_CONFIG_END
static void init_namcona1( running_machine &machine, int gametype )
{
namcona1_state *state = machine.driver_data<namcona1_state>();
- UINT16 *pMem = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *pMem = (UINT16 *)state->memregion( "maincpu" )->base();
state->m_gametype = gametype;
state->m_mpBank0 = &pMem[0x80000/2];
diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c
index 1f15352dea4..5f63eac3e53 100644
--- a/src/mame/drivers/namconb1.c
+++ b/src/mame/drivers/namconb1.c
@@ -608,7 +608,7 @@ static MACHINE_START(namconb)
static DRIVER_INIT( nebulray )
{
- UINT8 *pMem = (UINT8 *)machine.region(NAMCONB1_TILEMASKREGION)->base();
+ UINT8 *pMem = (UINT8 *)machine.root_device().memregion(NAMCONB1_TILEMASKREGION)->base();
size_t numBytes = (0xfe7-0xe6f)*8;
memset( &pMem[0xe6f*8], 0, numBytes );
diff --git a/src/mame/drivers/namcos10.c b/src/mame/drivers/namcos10.c
index bd0e52ce737..8d2724d17af 100644
--- a/src/mame/drivers/namcos10.c
+++ b/src/mame/drivers/namcos10.c
@@ -339,7 +339,7 @@ WRITE32_MEMBER(namcos10_state::bank_w)
READ32_MEMBER(namcos10_state::range_r)
{
- UINT32 data32 = ((const UINT32 *)(machine().region("user1")->base()))[offset+bank_base];
+ UINT32 data32 = ((const UINT32 *)(machine().root_device().memregion("user1")->base()))[offset+bank_base];
UINT16 d16;
if(ACCESSING_BITS_16_31)
@@ -491,8 +491,8 @@ ADDRESS_MAP_END
static void memn_driver_init( running_machine &machine )
{
namcos10_state *state = machine.driver_data<namcos10_state>();
- UINT8 *BIOS = (UINT8 *)machine.region( "user1" )->base();
- state->nand_base = (UINT8 *)machine.region( "user2" )->base();
+ UINT8 *BIOS = (UINT8 *)machine.root_device().memregion( "user1" )->base();
+ state->nand_base = (UINT8 *)state->memregion( "user2" )->base();
state->nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 );
state->nand_copy( (UINT32 *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 );
@@ -503,7 +503,7 @@ static void memn_driver_init( running_machine &machine )
static void decrypt_bios( running_machine &machine, const char *regionName, int start, int b15, int b14, int b13, int b12, int b11, int b10, int b9, int b8,
int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0 )
{
- const memory_region *region = machine.region( regionName );
+ memory_region *region = machine.root_device().memregion( regionName );
UINT16 *BIOS = (UINT16 *)( region->base() + start );
int len = (region->bytes()-start)/2;
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index f3e139fd0f0..3aa18febbc5 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -877,8 +877,8 @@ static void namcos11_init_common(running_machine &machine, int n_daughterboard)
// init banks
int bank;
- UINT32 len = machine.region( "user2" )->bytes();
- UINT8 *rgn = machine.region( "user2" )->base();
+ UINT32 len = machine.root_device().memregion( "user2" )->bytes();
+ UINT8 *rgn = machine.root_device().memregion( "user2" )->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f000000, 0x1f0fffff, "bank1" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f100000, 0x1f1fffff, "bank2" );
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index 1c3c2eab129..4cf9a46ce33 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1208,8 +1208,8 @@ static void namcos12_rom_read( namcos12_state *state, UINT32 n_address, INT32 n_
verboselog( state->machine(), 1, "namcos12_rom_read( %08x, %08x ) game %08x\n", n_address, n_size, n_offset );
}
- source = (UINT16 *) state->machine().region( n_region )->base();
- n_romleft = ( state->machine().region( n_region )->bytes() - n_offset ) / 4;
+ source = (UINT16 *) state->machine().root_device().memregion( n_region )->base();
+ n_romleft = ( state->machine().root_device().memregion( n_region )->bytes() - n_offset ) / 4;
if( n_size > n_romleft )
{
verboselog( state->machine(), 1, "namcos12_rom_read dma truncated %d to %d passed end of rom\n", n_size, n_romleft );
@@ -1321,7 +1321,7 @@ static void system11gun_install( running_machine &machine )
WRITE32_MEMBER(namcos12_state::kcoff_w)
{
- membank( "bank2" )->set_base( machine().region( "user1" )->base() + 0x20280 );
+ membank( "bank2" )->set_base( memregion( "user1" )->base() + 0x20280 );
}
WRITE32_MEMBER(namcos12_state::kcon_w)
@@ -1627,7 +1627,7 @@ static DRIVER_INIT( namcos12 )
psx_driver_init(machine);
- state->membank("bank1")->configure_entries(0, machine.region( "user2" )->bytes() / 0x200000, machine.region( "user2" )->base(), 0x200000 );
+ state->membank("bank1")->configure_entries(0, machine.root_device().memregion( "user2" )->bytes() / 0x200000, state->memregion( "user2" )->base(), 0x200000 );
state->m_s12_porta = 0;
state->m_s12_rtcstate = 0;
@@ -1652,7 +1652,7 @@ static DRIVER_INIT( ptblank2 )
DRIVER_INIT_CALL(namcos12);
/* patch out wait for dma 5 to complete */
- *( (UINT32 *)( machine.region( "user1" )->base() + 0x331c4 ) ) = 0;
+ *( (UINT32 *)( machine.root_device().memregion( "user1" )->base() + 0x331c4 ) ) = 0;
system11gun_install(machine);
}
diff --git a/src/mame/drivers/namcos2.c b/src/mame/drivers/namcos2.c
index 73f90cf8a62..4c50f65916e 100644
--- a/src/mame/drivers/namcos2.c
+++ b/src/mame/drivers/namcos2.c
@@ -5100,7 +5100,7 @@ static DRIVER_INIT( metlhawk )
{
/* unscramble sprites */
int i, j, k, l;
- UINT8 *data = machine.region("gfx1")->base();
+ UINT8 *data = machine.root_device().memregion("gfx1")->base();
for(i=0; i<0x200000; i+=32*32)
{
for(j=0; j<32*32; j+=32*4)
@@ -5217,7 +5217,7 @@ static DRIVER_INIT( bubbletr ){
static DRIVER_INIT( luckywld ){
- UINT8 *pData = (UINT8 *)machine.region( "gfx5" )->base();
+ UINT8 *pData = (UINT8 *)machine.root_device().memregion( "gfx5" )->base();
int i;
for( i=0; i<32*0x4000; i++ )
{ /* unscramble gfx mask */
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index 3075b9886c8..af8e57f18f5 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -313,7 +313,7 @@ CPU68 PCB:
static INT32
ReadPointROMData( running_machine &machine, unsigned offset )
{
- const INT32 *pPointData = (INT32 *)machine.region( "user2" )->base();
+ const INT32 *pPointData = (INT32 *)machine.root_device().memregion( "user2" )->base();
INT32 result = pPointData[offset];
return result;
}
@@ -590,7 +590,7 @@ static int
InitDSP( running_machine &machine )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.region("dspmaster")->base();
+ UINT16 *pMem = (UINT16 *)state->memregion("dspmaster")->base();
/**
* DSP BIOS tests "CPU ID" on startup
* "JAPAN (C)1990 NAMCO LTD. by H.F "
@@ -1222,7 +1222,7 @@ WRITE16_MEMBER(namcos21_state::winrun_dsp_pointrom_addr_w)
READ16_MEMBER(namcos21_state::winrun_dsp_pointrom_data_r)
{
- UINT16 *ptrom = (UINT16 *)machine().region("user2")->base();
+ UINT16 *ptrom = (UINT16 *)machine().root_device().memregion("user2")->base();
return ptrom[m_winrun_pointrom_addr++];
} /* winrun_dsp_pointrom_data_r */
@@ -1264,7 +1264,7 @@ ADDRESS_MAP_END
READ16_MEMBER(namcos21_state::gpu_data_r)
{
- const UINT16 *pSrc = (UINT16 *)machine().region( "user3" )->base();
+ const UINT16 *pSrc = (UINT16 *)machine().root_device().memregion( "user3" )->base();
return pSrc[offset];
}
@@ -1282,7 +1282,7 @@ WRITE16_MEMBER(namcos21_state::winrun_dspbios_w)
COMBINE_DATA( &m_winrun_dspbios[offset] );
if( offset==0xfff )
{
- UINT16 *mem = (UINT16 *)machine().region("dsp")->base();
+ UINT16 *mem = (UINT16 *)machine().root_device().memregion("dsp")->base();
memcpy( mem, m_winrun_dspbios, 0x2000 );
m_winrun_dsp_alive = 1;
}
@@ -2245,7 +2245,7 @@ static void namcos21_init( running_machine &machine, int game_type )
namcos21_state *state = machine.driver_data<namcos21_state>();
namcos2_gametype = game_type;
state->m_pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
- state->m_mpDataROM = (UINT16 *)machine.region( "user1" )->base();
+ state->m_mpDataROM = (UINT16 *)state->memregion( "user1" )->base();
InitDSP(machine);
state->m_mbNeedsKickstart = 20;
if( game_type==NAMCOS21_CYBERSLED )
@@ -2257,7 +2257,7 @@ static void namcos21_init( running_machine &machine, int game_type )
static DRIVER_INIT( winrun )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.region("dsp")->base();
+ UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
@@ -2265,7 +2265,7 @@ static DRIVER_INIT( winrun )
state->m_winrun_dspcomram = auto_alloc_array(machine, UINT16, 0x1000*2);
namcos2_gametype = NAMCOS21_WINRUN91;
- state->m_mpDataROM = (UINT16 *)machine.region( "user1" )->base();
+ state->m_mpDataROM = (UINT16 *)state->memregion( "user1" )->base();
state->m_pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
state->m_pointram_idx = 0;
state->m_mbNeedsKickstart = 0;
@@ -2289,7 +2289,7 @@ static DRIVER_INIT( cybsled )
static DRIVER_INIT( solvalou )
{
- UINT16 *mem = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem = (UINT16 *)machine.root_device().memregion("maincpu")->base();
mem[0x20ce4/2+1] = 0x0000; // $200128
mem[0x20cf4/2+0] = 0x4e71; // 2nd ptr_booting
mem[0x20cf4/2+1] = 0x4e71;
@@ -2301,13 +2301,13 @@ static DRIVER_INIT( solvalou )
static DRIVER_INIT( driveyes )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.region("dsp")->base();
+ UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
state->m_winrun_dspcomram = auto_alloc_array(machine, UINT16, 0x1000*2);
namcos2_gametype = NAMCOS21_DRIVERS_EYES;
- state->m_mpDataROM = (UINT16 *)machine.region( "user1" )->base();
+ state->m_mpDataROM = (UINT16 *)state->memregion( "user1" )->base();
state->m_pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
state->m_pointram_idx = 0;
state->m_mbNeedsKickstart = 0;
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index afe1da47429..9f44243bfe8 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -1933,9 +1933,9 @@ static NVRAM_HANDLER( namcos22 )
else
{
memset( state->m_nvmem, 0x00, state->m_nvmem.bytes() );
- if (machine.region("nvram")->bytes() == state->m_nvmem.bytes())
+ if (machine.root_device().memregion("nvram")->bytes() == state->m_nvmem.bytes())
{
- UINT8* nvram = machine.region("nvram")->base();
+ UINT8* nvram = machine.root_device().memregion("nvram")->base();
for( i=0; i<state->m_nvmem.bytes()/4; i++ )
{
@@ -5538,7 +5538,7 @@ static DRIVER_INIT( airco22 )
static DRIVER_INIT( propcycl )
{
- UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.root_device().memregion("maincpu")->base();
/* patch out strange routine (uninitialized-eprom related?) */
pROM[0x1992C/4] = 0x4E754E75;
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index 8d8fc697e26..ab89fd76360 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -3070,14 +3070,14 @@ static DRIVER_INIT(ss23)
{
namcos23_state *state = machine.driver_data<namcos23_state>();
render_t &render = state->m_render;
- state->m_ptrom = (const UINT32 *)machine.region("pointrom")->base();
- state->m_tmlrom = (const UINT16 *)machine.region("textilemapl")->base();
- state->m_tmhrom = machine.region("textilemaph")->base();
- state->m_texrom = machine.region("textile")->base();
-
- state->m_tileid_mask = (machine.region("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
- state->m_tile_mask = machine.region("textile")->bytes()/256 - 1;
- state->m_ptrom_limit = machine.region("pointrom")->bytes()/4;
+ state->m_ptrom = (const UINT32 *)machine.root_device().memregion("pointrom")->base();
+ state->m_tmlrom = (const UINT16 *)machine.root_device().memregion("textilemapl")->base();
+ state->m_tmhrom = machine.root_device().memregion("textilemaph")->base();
+ state->m_texrom = machine.root_device().memregion("textile")->base();
+
+ state->m_tileid_mask = (machine.root_device().memregion("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
+ state->m_tile_mask = machine.root_device().memregion("textile")->bytes()/256 - 1;
+ state->m_ptrom_limit = state->memregion("pointrom")->bytes()/4;
state->m_mi_rd = state->m_mi_wr = state->m_im_rd = state->m_im_wr = 0;
state->m_jvssense = 1;
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index 99a8c0bea25..cff065b6cde 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -184,18 +184,18 @@ TODO:
WRITE8_MEMBER(namcos86_state::bankswitch1_w)
{
- UINT8 *base = machine().region("cpu1")->base() + 0x10000;
+ UINT8 *base = memregion("cpu1")->base() + 0x10000;
/* if the ROM expansion module is available, don't do anything. This avoids conflict */
/* with bankswitch1_ext_w() in wndrmomo */
- if (machine().region("user1")->base()) return;
+ if (machine().root_device().memregion("user1")->base()) return;
membank("bank1")->set_base(base + ((data & 0x03) * 0x2000));
}
WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w)
{
- UINT8 *base = machine().region("user1")->base();
+ UINT8 *base = memregion("user1")->base();
if (base == 0) return;
@@ -204,7 +204,7 @@ WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w)
WRITE8_MEMBER(namcos86_state::bankswitch2_w)
{
- UINT8 *base = machine().region("cpu2")->base() + 0x10000;
+ UINT8 *base = memregion("cpu2")->base() + 0x10000;
membank("bank2")->set_base(base + ((data & 0x03) * 0x2000));
}
@@ -294,7 +294,7 @@ WRITE8_MEMBER(namcos86_state::namcos86_led_w)
WRITE8_MEMBER(namcos86_state::cus115_w)
{
/* make sure the expansion board is present */
- if (!machine().region("user1")->base())
+ if (!machine().root_device().memregion("user1")->base())
{
popmessage("expansion board not present");
return;
@@ -324,7 +324,7 @@ WRITE8_MEMBER(namcos86_state::cus115_w)
static MACHINE_RESET( namco86 )
{
- UINT8 *base = machine.region("cpu1")->base() + 0x10000;
+ UINT8 *base = machine.root_device().memregion("cpu1")->base() + 0x10000;
machine.root_device().membank("bank1")->set_base(base);
}
@@ -1471,8 +1471,8 @@ static DRIVER_INIT( namco86 )
UINT8 *buffer;
/* shuffle tile ROMs so regular gfx unpack routines can be used */
- gfx = machine.region("gfx1")->base();
- size = machine.region("gfx1")->bytes() * 2 / 3;
+ gfx = machine.root_device().memregion("gfx1")->base();
+ size = machine.root_device().memregion("gfx1")->bytes() * 2 / 3;
buffer = auto_alloc_array(machine, UINT8, size );
{
@@ -1496,8 +1496,8 @@ static DRIVER_INIT( namco86 )
auto_free( machine, buffer );
}
- gfx = machine.region("gfx2")->base();
- size = machine.region("gfx2")->bytes() * 2 / 3;
+ gfx = machine.root_device().memregion("gfx2")->base();
+ size = machine.root_device().memregion("gfx2")->bytes() * 2 / 3;
buffer = auto_alloc_array(machine, UINT8, size );
{
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index 632ed2de3fb..0712d20c7ad 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -7388,7 +7388,7 @@ ROM_END
static DRIVER_INIT( atomiswave )
{
- UINT64 *ROM = (UINT64 *)machine.region("awflash")->base();
+ UINT64 *ROM = (UINT64 *)machine.root_device().memregion("awflash")->base();
// patch out long startup delay
ROM[0x98e/8] = (ROM[0x98e/8] & U64(0xffffffffffff)) | (UINT64)0x0009<<48;
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index 38dba3f4370..f496e150aae 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -846,7 +846,7 @@ static DRIVER_INIT( popflame )
READ8_MEMBER(naughtyb_state::trvmstr_questions_r)
{
- return machine().region("user1")->base()[m_question_offset];
+ return memregion("user1")->base()[m_question_offset];
}
WRITE8_MEMBER(naughtyb_state::trvmstr_questions_w)
diff --git a/src/mame/drivers/nbmj8688.c b/src/mame/drivers/nbmj8688.c
index fd4c0680594..940c5008674 100644
--- a/src/mame/drivers/nbmj8688.c
+++ b/src/mame/drivers/nbmj8688.c
@@ -67,8 +67,8 @@ static DRIVER_INIT( otonano )
static DRIVER_INIT( mjcamera )
{
- UINT8 *rom = machine.region("voice")->base() + 0x20000;
- UINT8 *prot = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x20000;
+ UINT8 *prot = machine.root_device().memregion("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -87,7 +87,7 @@ static DRIVER_INIT( mjcamera )
static DRIVER_INIT( kanatuen )
{
/* uses the same protection data as mjcamer, but a different check */
- UINT8 *rom = machine.region("voice")->base() + 0x30000;
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x30000;
rom[0x0004] = 0x09;
rom[0x0103] = 0x0e;
@@ -101,7 +101,7 @@ static DRIVER_INIT( kyuhito )
{
#if 1
/* uses the same protection data as ????, but a different check */
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x0149] = 0x00;
rom[0x014a] = 0x00;
@@ -113,8 +113,8 @@ static DRIVER_INIT( kyuhito )
static DRIVER_INIT( idhimitu )
{
- UINT8 *rom = machine.region("voice")->base() + 0x20000;
- UINT8 *prot = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x20000;
+ UINT8 *prot = machine.root_device().memregion("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -138,8 +138,8 @@ static DRIVER_INIT( kaguya )
static DRIVER_INIT( kaguya2 )
{
- UINT8 *rom = machine.region("voice")->base() + 0x20000;
- UINT8 *prot = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x20000;
+ UINT8 *prot = machine.root_device().memregion("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
diff --git a/src/mame/drivers/nbmj8891.c b/src/mame/drivers/nbmj8891.c
index 5fc8c38666a..d3f68896189 100644
--- a/src/mame/drivers/nbmj8891.c
+++ b/src/mame/drivers/nbmj8891.c
@@ -61,7 +61,7 @@ TODO:
static DRIVER_INIT( gionbana )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -85,7 +85,7 @@ static DRIVER_INIT( mgion )
static DRIVER_INIT( omotesnd )
{
#if 0
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -100,7 +100,7 @@ static DRIVER_INIT( omotesnd )
#endif
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x0106] = 0x00;
@@ -135,7 +135,7 @@ static DRIVER_INIT( msjiken )
static DRIVER_INIT( telmahjn )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -153,7 +153,7 @@ static DRIVER_INIT( telmahjn )
static DRIVER_INIT( mgmen89 )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -171,8 +171,8 @@ static DRIVER_INIT( mgmen89 )
static DRIVER_INIT( mjfocus )
{
- UINT8 *prot = machine.region("protection")->base();
- UINT8 *ram = machine.region("maincpu")->base() + 0xf800;
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
+ UINT8 *ram = machine.root_device().memregion("maincpu")->base() + 0xf800;
int i;
/* need to clear RAM otherwise it doesn't boot... */
@@ -194,7 +194,7 @@ static DRIVER_INIT( mjfocus )
static DRIVER_INIT( mjfocusm )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x014e] = 0x00;
@@ -206,7 +206,7 @@ static DRIVER_INIT( mjfocusm )
static DRIVER_INIT( scandal )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00;
@@ -223,10 +223,10 @@ static DRIVER_INIT( mjnanpas )
{
/* they forgot to enable the protection check in this game... */
#if 0
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
- machine.region("maincpu")->base()[0x003d] = 0x01; // force the protection check to be executed
+ machine.root_device().memregion("maincpu")->base()[0x003d] = 0x01; // force the protection check to be executed
/* this is one possible way to rearrange the protection ROM data to get the
expected 0xfe1a checksum. It's probably completely wrong! But since the
@@ -284,7 +284,7 @@ static DRIVER_INIT( hanaoji )
static DRIVER_INIT( pairsnb )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -302,7 +302,7 @@ static DRIVER_INIT( pairsnb )
static DRIVER_INIT( pairsten )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
diff --git a/src/mame/drivers/nbmj8900.c b/src/mame/drivers/nbmj8900.c
index 9c6d8abfdb0..75eb71e0009 100644
--- a/src/mame/drivers/nbmj8900.c
+++ b/src/mame/drivers/nbmj8900.c
@@ -45,7 +45,7 @@ TODO:
static DRIVER_INIT( ohpaipee )
{
#if 0
- UINT8 *prot = machine.region("protdata")->base();
+ UINT8 *prot = machine.root_device().memregion("protdata")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -59,7 +59,7 @@ static DRIVER_INIT( ohpaipee )
prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
}
#else
- unsigned char *ROM = machine.region("maincpu")->base();
+ unsigned char *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x00e4] = 0x00;
@@ -78,7 +78,7 @@ static DRIVER_INIT( ohpaipee )
static DRIVER_INIT( togenkyo )
{
#if 0
- UINT8 *prot = machine.region("protdata")->base();
+ UINT8 *prot = machine.root_device().memregion("protdata")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -91,7 +91,7 @@ static DRIVER_INIT( togenkyo )
prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
}
#else
- unsigned char *ROM = machine.region("maincpu")->base();
+ unsigned char *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x010b] = 0x00;
diff --git a/src/mame/drivers/nbmj8991.c b/src/mame/drivers/nbmj8991.c
index d6aa00e5450..a25bbcc3c11 100644
--- a/src/mame/drivers/nbmj8991.c
+++ b/src/mame/drivers/nbmj8991.c
@@ -70,7 +70,7 @@ static MACHINE_RESET( nbmj8991 )
device_t *audiocpu = machine.device("audiocpu");
if (audiocpu != NULL && audiocpu->type() == Z80)
{
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x8000, 0x8000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x8000, 0x8000);
machine.root_device().membank("bank1")->set_entry(0);
}
MACHINE_RESET_CALL(nb1413m3);
@@ -108,7 +108,7 @@ static DRIVER_INIT( vanilla )
static DRIVER_INIT( finalbny )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00;
@@ -134,7 +134,7 @@ static DRIVER_INIT( hyouban )
static DRIVER_INIT( galkaika )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
@@ -145,7 +145,7 @@ static DRIVER_INIT( galkaika )
static DRIVER_INIT( tokyogal )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
@@ -156,7 +156,7 @@ static DRIVER_INIT( tokyogal )
static DRIVER_INIT( tokimbsj )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index 7b92e988a62..426556ee567 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -40,7 +40,7 @@ Notes:
WRITE8_MEMBER(nbmj9195_state::nbmj9195_soundbank_w)
{
- UINT8 *SNDROM = machine().region("audiocpu")->base();
+ UINT8 *SNDROM = memregion("audiocpu")->base();
membank("bank1")->set_base(&SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -662,7 +662,7 @@ static DRIVER_INIT( nbmj9195 )
{
nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
// sound program patch
ROM[0x0213] = 0x00; // DI -> NOP
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 8122e27b2b1..0c83802540d 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -9456,8 +9456,8 @@ static DRIVER_INIT( kof2002b )
kof2002_decrypt_68k(machine);
neo_pcm2_swap(machine, 0);
neogeo_cmc50_m1_decrypt(machine);
- kof2002b_gfx_decrypt(machine, machine.region("sprites")->base(),0x4000000);
- kof2002b_gfx_decrypt(machine, machine.region("fixed")->base(),0x20000);
+ kof2002b_gfx_decrypt(machine, machine.root_device().memregion("sprites")->base(),0x4000000);
+ kof2002b_gfx_decrypt(machine, machine.root_device().memregion("fixed")->base(),0x20000);
}
static DRIVER_INIT( kf2k2pls )
@@ -9560,7 +9560,7 @@ static DRIVER_INIT( mslug5 )
static TIMER_CALLBACK( ms5pcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( ms5pcb )
@@ -9597,7 +9597,7 @@ static DRIVER_INIT( ms5plus )
static TIMER_CALLBACK( svcpcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( svcpcb )
@@ -9700,7 +9700,7 @@ static DRIVER_INIT( kf2k3pcb )
incorrect */
{
int i;
- UINT8* rom = machine.region("audiocpu")->base();
+ UINT8* rom = state->memregion("audiocpu")->base();
for (i = 0; i < 0x90000; i++)
{
rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2);
@@ -9835,7 +9835,7 @@ static DRIVER_INIT( mvs )
static READ16_HANDLER( sbp_lowerrom_r )
{
- UINT16* rom = (UINT16*)space->machine().region("maincpu")->base();
+ UINT16* rom = (UINT16*)space->machine().root_device().memregion("maincpu")->base();
UINT16 origdata = rom[(offset+(0x200/2))];
UINT16 data = BITSWAP16(origdata, 11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4);
int realoffset = 0x200+(offset*2);
@@ -9881,7 +9881,7 @@ static DRIVER_INIT(sbp )
/* the game code clears the text overlay used ingame immediately after writing it.. why? protection? sloppy code that the hw ignores? imperfect emulation? */
{
- UINT16* rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[0x2a6f8/2] = 0x4e71;
rom[0x2a6fa/2] = 0x4e71;
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 10a1d244856..518ae9cdb2f 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -641,7 +641,7 @@ static void set_main_cpu_vector_table_source( running_machine &machine, UINT8 da
static void _set_main_cpu_bank_address( running_machine &machine )
{
neogeo_state *state = machine.driver_data<neogeo_state>();
- state->membank(NEOGEO_BANK_CARTRIDGE)->set_base(&machine.region("maincpu")->base()[state->m_main_cpu_bank_address]);
+ state->membank(NEOGEO_BANK_CARTRIDGE)->set_base(&state->memregion("maincpu")->base()[state->m_main_cpu_bank_address]);
}
@@ -660,7 +660,7 @@ void neogeo_set_main_cpu_bank_address( address_space *space, UINT32 bank_address
WRITE16_MEMBER(neogeo_state::main_cpu_bank_select_w)
{
UINT32 bank_address;
- UINT32 len = machine().region("maincpu")->bytes();
+ UINT32 len = memregion("maincpu")->bytes();
if ((len <= 0x100000) && (data & 0x07))
logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", cpu_get_pc(&space.device()), data);
@@ -684,11 +684,11 @@ static void main_cpu_banking_init( running_machine &machine )
address_space *mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* create vector banks */
- machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.region("mainbios")->base());
- machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(1, machine.region("maincpu")->base());
+ machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.root_device().memregion("mainbios")->base());
+ machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(1, machine.root_device().memregion("maincpu")->base());
/* set initial main CPU bank */
- if (machine.region("maincpu")->bytes() > 0x100000)
+ if (machine.root_device().memregion("maincpu")->bytes() > 0x100000)
neogeo_set_main_cpu_bank_address(mainspace, 0x100000);
else
neogeo_set_main_cpu_bank_address(mainspace, 0x000000);
@@ -760,7 +760,7 @@ static void _set_audio_cpu_rom_source( address_space *space )
{
neogeo_state *state = space->machine().driver_data<neogeo_state>();
-/* if (!machine.region("audiobios")->base()) */
+/* if (!state->memregion("audiobios")->base()) */
state->m_audio_cpu_rom_source = 1;
state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->set_entry(state->m_audio_cpu_rom_source);
@@ -795,14 +795,14 @@ static void audio_cpu_banking_init( running_machine &machine )
UINT32 address_mask;
/* audio bios/cartridge selection */
- if (machine.region("audiobios")->base())
- state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, machine.region("audiobios")->base());
- state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, machine.region("audiocpu")->base());
+ if (machine.root_device().memregion("audiobios")->base())
+ state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, machine.root_device().memregion("audiobios")->base());
+ state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, machine.root_device().memregion("audiocpu")->base());
/* audio banking */
- address_mask = machine.region("audiocpu")->bytes() - 0x10000 - 1;
+ address_mask = machine.root_device().memregion("audiocpu")->bytes() - 0x10000 - 1;
- rgn = machine.region("audiocpu")->base();
+ rgn = state->memregion("audiocpu")->base();
for (region = 0; region < 4; region++)
{
for (bank = 0; bank < 0x100; bank++)
@@ -990,7 +990,7 @@ static MACHINE_START( neogeo )
machine.device<nvram_device>("saveram")->set_base(save_ram, 0x10000);
/* set the BIOS bank */
- state->membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base());
+ state->membank(NEOGEO_BANK_BIOS)->set_base(state->memregion("mainbios")->base());
/* set the initial main CPU bank */
main_cpu_banking_init(machine);
@@ -1279,63 +1279,63 @@ DEVICE_IMAGE_LOAD( neo_cartridge )
{
// create memory regions
size = image.get_software_region_length("maincpu");
- image.device().machine().region_free(":maincpu");
- image.device().machine().region_alloc(":maincpu",size, 2, ENDIANNESS_BIG);
- memcpy(image.device().machine().region("maincpu")->base(),image.get_software_region("maincpu"),size);
+ image.device().machine().memory().region_free(":maincpu");
+ image.device().machine().memory().region_alloc(":maincpu",size, 2, ENDIANNESS_BIG);
+ memcpy(image.device().machine().root_device().memregion("maincpu")->base(),image.get_software_region("maincpu"),size);
// for whatever reason (intentional, or design flaw) software loaded via software lists is swapped in endianess vs. the standard ROM loading, regardless of the above. Swap it to keep consistency
for (int i=0; i<size/2;i++)
{
- UINT16* ROM = (UINT16*)image.device().machine().region("maincpu")->base();
+ UINT16* ROM = (UINT16*)image.device().machine().root_device().memregion("maincpu")->base();
ROM[i] = ((ROM[i]&0xff00)>>8) | ((ROM[i]&0x00ff)<<8);
}
size = image.get_software_region_length("fixed");
- image.device().machine().region_free(":fixed");
- image.device().machine().region_alloc(":fixed",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("fixed")->base(),image.get_software_region("fixed"),size);
+ image.device().machine().memory().region_free(":fixed");
+ image.device().machine().memory().region_alloc(":fixed",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("fixed")->base(),image.get_software_region("fixed"),size);
if(image.get_software_region("audiocpu") != NULL)
{
size = image.get_software_region_length("audiocpu");
- image.device().machine().region_free(":audiocpu");
- image.device().machine().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("audiocpu")->base(),image.get_software_region("audiocpu"),size);
- memcpy(image.device().machine().region("audiocpu")->base()+0x10000,image.get_software_region("audiocpu"),size); // avoid reloading in XML, should just improve banking instead tho?
+ image.device().machine().memory().region_free(":audiocpu");
+ image.device().machine().memory().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("audiocpu")->base(),image.get_software_region("audiocpu"),size);
+ memcpy(image.device().machine().root_device().memregion("audiocpu")->base()+0x10000,image.get_software_region("audiocpu"),size); // avoid reloading in XML, should just improve banking instead tho?
}
size = image.get_software_region_length("ymsnd");
- image.device().machine().region_free(":ymsnd");
- image.device().machine().region_alloc(":ymsnd",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("ymsnd")->base(),image.get_software_region("ymsnd"),size);
+ image.device().machine().memory().region_free(":ymsnd");
+ image.device().machine().memory().region_alloc(":ymsnd",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("ymsnd")->base(),image.get_software_region("ymsnd"),size);
if(image.get_software_region("ymsnd.deltat") != NULL)
{
size = image.get_software_region_length("ymsnd.deltat");
- image.device().machine().region_free(":ymsnd.deltat");
- image.device().machine().region_alloc(":ymsnd.deltat",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("ymsnd.deltat")->base(),image.get_software_region("ymsnd.deltat"),size);
+ image.device().machine().memory().region_free(":ymsnd.deltat");
+ image.device().machine().memory().region_alloc(":ymsnd.deltat",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("ymsnd.deltat")->base(),image.get_software_region("ymsnd.deltat"),size);
}
else
- image.device().machine().region_free(":ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games
+ image.device().machine().memory().region_free(":ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games
ym->reset();
size = image.get_software_region_length("sprites");
- image.device().machine().region_free(":sprites");
- image.device().machine().region_alloc(":sprites",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("sprites")->base(),image.get_software_region("sprites"),size);
+ image.device().machine().memory().region_free(":sprites");
+ image.device().machine().memory().region_alloc(":sprites",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("sprites")->base(),image.get_software_region("sprites"),size);
if(image.get_software_region("audiocrypt") != NULL) // encrypted Z80 code
{
size = image.get_software_region_length("audiocrypt");
- image.device().machine().region_alloc(":audiocrypt",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("audiocrypt")->base(),image.get_software_region("audiocrypt"),size);
+ image.device().machine().memory().region_alloc(":audiocrypt",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("audiocrypt")->base(),image.get_software_region("audiocrypt"),size);
// allocate the audiocpu region to decrypt data into
- image.device().machine().region_free(":audiocpu");
- image.device().machine().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
+ image.device().machine().memory().region_free(":audiocpu");
+ image.device().machine().memory().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
}
// setup cartridge ROM area
image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x000080,0x0fffff,"cart_rom");
- image.device().machine().root_device().membank("cart_rom")->set_base(&image.device().machine().region("maincpu")->base()[0x80]);
+ image.device().machine().root_device().membank("cart_rom")->set_base(&image.device().machine().root_device().memregion("maincpu")->base()[0x80]);
// handle possible protection
mvs_install_protection(image);
diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c
index 213ca58bb08..3c56514595c 100644
--- a/src/mame/drivers/neoprint.c
+++ b/src/mame/drivers/neoprint.c
@@ -273,7 +273,7 @@ WRITE8_MEMBER(neoprint_state::nprsp_bank_w)
READ16_MEMBER(neoprint_state::rom_window_r)
{
- UINT16 *rom = (UINT16 *)machine().region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("maincpu")->base();
return rom[offset | 0x80000/2 | m_bank_val*0x40000/2];
}
@@ -592,7 +592,7 @@ ROM_END
/* FIXME: get rid of these two, probably something to do with irq3 and camera / printer devices */
static DRIVER_INIT( npcartv1 )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
ROM[0x1260/2] = 0x4e71;
@@ -602,14 +602,14 @@ static DRIVER_INIT( npcartv1 )
static DRIVER_INIT( 98best44 )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
ROM[0x1312/2] = 0x4e71;
}
static DRIVER_INIT( nprsp )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
ROM[0x13a4/2] = 0x4e71;
ROM[0x13bc/2] = 0x4e71;
diff --git a/src/mame/drivers/nexus3d.c b/src/mame/drivers/nexus3d.c
index 87b41c08a9e..e28887a85e7 100644
--- a/src/mame/drivers/nexus3d.c
+++ b/src/mame/drivers/nexus3d.c
@@ -263,8 +263,8 @@ static DRIVER_INIT( nexus3d )
{
nexus3d_state *state = machine.driver_data<nexus3d_state>();
// the first part of the flash ROM automatically gets copied to RAM
- memcpy( state->m_mainram, machine.region("user1")->base(), 4 * 1024);
- state->m_flash_region = machine.region("user1")->base();
+ memcpy( state->m_mainram, machine.root_device().memregion("user1")->base(), 4 * 1024);
+ state->m_flash_region = state->memregion("user1")->base();
}
GAME( 2005, acheart, 0, nexus3d, nexus3d, nexus3d, ROT0, "Examu", "Arcana Heart",GAME_IS_SKELETON )
diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c
index 57380905bd3..51e1bd44cfc 100644
--- a/src/mame/drivers/nightgal.c
+++ b/src/mame/drivers/nightgal.c
@@ -112,7 +112,7 @@ static SCREEN_UPDATE_IND16( nightgal )
static UINT8 nightgal_gfx_nibble( running_machine &machine, int niboffset )
{
- UINT8 *blit_rom = machine.region("gfx1")->base();
+ UINT8 *blit_rom = machine.root_device().memregion("gfx1")->base();
if (niboffset & 1)
{
@@ -250,7 +250,7 @@ WRITE8_MEMBER(nightgal_state::sexygal_nsc_true_blitter_w)
/* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */
static PALETTE_INIT( nightgal )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double weights_rg[3], weights_b[2];
@@ -1226,7 +1226,7 @@ ROM_END
static DRIVER_INIT( royalqn )
{
- UINT8 *ROM = machine.region("sub")->base();
+ UINT8 *ROM = machine.root_device().memregion("sub")->base();
/* patch open bus / protection */
ROM[0xc27e] = 0x02;
@@ -1235,7 +1235,7 @@ static DRIVER_INIT( royalqn )
static DRIVER_INIT( ngalsumr )
{
- UINT8 *ROM = machine.region("sub")->base();
+ UINT8 *ROM = machine.root_device().memregion("sub")->base();
/* patch protection */
ROM[0xd6ce] = 0x02;
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index 044cb08c96b..e9068884e2e 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -175,15 +175,15 @@ static INTERRUPT_GEN( ninjakd2_interrupt )
static MACHINE_RESET( ninjakd2 )
{
/* initialize main Z80 bank */
- machine.root_device().membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->set_entry(0);
}
static void robokid_init_banks(running_machine &machine)
{
/* initialize main Z80 bank */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base(), 0x4000);
- machine.root_device().membank("bank1")->configure_entries(2, 14, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(2, 14, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->set_entry(0);
}
@@ -228,8 +228,8 @@ static SAMPLES_START( ninjakd2_init_samples )
{
ninjakd2_state *state = device.machine().driver_data<ninjakd2_state>();
running_machine &machine = device.machine();
- const UINT8* const rom = machine.region("pcm")->base();
- const int length = machine.region("pcm")->bytes();
+ const UINT8* const rom = machine.root_device().memregion("pcm")->base();
+ const int length = state->memregion("pcm")->bytes();
INT16* sampledata = auto_alloc_array(machine, INT16, length);
int i;
@@ -244,12 +244,12 @@ static SAMPLES_START( ninjakd2_init_samples )
WRITE8_MEMBER(ninjakd2_state::ninjakd2_pcm_play_w)
{
samples_device *samples = machine().device<samples_device>("pcm");
- const UINT8* const rom = machine().region("pcm")->base();
+ const UINT8* const rom = memregion("pcm")->base();
// only Ninja Kid II uses this
if (rom)
{
- const int length = machine().region("pcm")->bytes();
+ const int length = memregion("pcm")->bytes();
const int start = data << 8;
@@ -1425,9 +1425,9 @@ by one place all the intervening bits.
static void lineswap_gfx_roms(running_machine &machine, const char *region, const int bit)
{
- const int length = machine.region(region)->bytes();
+ const int length = machine.root_device().memregion(region)->bytes();
- UINT8* const src = machine.region(region)->base();
+ UINT8* const src = machine.root_device().memregion(region)->base();
UINT8* const temp = auto_alloc_array(machine, UINT8, length);
@@ -1472,7 +1472,7 @@ static DRIVER_INIT( ninjakd2 )
static DRIVER_INIT( bootleg )
{
address_space *space = machine.device("soundcpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("soundcpu")->base() + 0x10000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("soundcpu")->base() + 0x10000);
gfx_unscramble(machine);
}
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index bceb8cb0291..50f02a52988 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -757,7 +757,7 @@ static MACHINE_START( ninjaw )
{
ninjaw_state *state = machine.driver_data<ninjaw_state>();
- state->membank("bank10")->configure_entries(0, 8, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 8, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c
index 3794dcbec98..a9ce1c5ccd5 100644
--- a/src/mame/drivers/niyanpai.c
+++ b/src/mame/drivers/niyanpai.c
@@ -55,7 +55,7 @@ Memo:
static void niyanpai_soundbank_w(running_machine &machine, int data)
{
- UINT8 *SNDROM = machine.region("audiocpu")->base();
+ UINT8 *SNDROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->set_base(&SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -266,7 +266,7 @@ static MACHINE_RESET( niyanpai )
static DRIVER_INIT( niyanpai )
{
niyanpai_state *state = machine.driver_data<niyanpai_state>();
- UINT8 *SNDROM = machine.region("audiocpu")->base();
+ UINT8 *SNDROM = state->memregion("audiocpu")->base();
// sound program patch
SNDROM[0x0213] = 0x00; // DI -> NOP
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index 2744b8d0e7b..f19220f48a6 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -214,7 +214,7 @@ WRITE16_MEMBER(nmk16_state::ssmissin_sound_w)
WRITE8_MEMBER(nmk16_state::ssmissin_soundbank_w)
{
- UINT8 *rom = machine().region("oki1")->base();
+ UINT8 *rom = memregion("oki1")->base();
int bank;
bank = data & 0x3;
@@ -275,14 +275,14 @@ WRITE16_MEMBER(nmk16_state::macross2_sound_command_w)
WRITE8_MEMBER(nmk16_state::macross2_sound_bank_w)
{
- UINT8 *rom = machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
membank("bank1")->set_base(rom + (data & 0x07) * 0x4000);
}
WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_0_w)
{
- UINT8 *rom = machine().region("oki1")->base();
+ UINT8 *rom = memregion("oki1")->base();
data &= 3;
if (data != 3)
@@ -291,7 +291,7 @@ WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_0_w)
WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_1_w)
{
- UINT8 *rom = machine().region("oki2")->base();
+ UINT8 *rom = memregion("oki2")->base();
data &= 3;
if (data != 3)
@@ -1067,7 +1067,7 @@ WRITE8_MEMBER(nmk16_state::okibank_w)
WRITE8_MEMBER(nmk16_state::raphero_sound_rombank_w)
{
- membank("bank1")->set_base(machine().region("audiocpu")->base() + 0x10000 + (data & 0x07) * 0x4000);
+ membank("bank1")->set_base(machine().root_device().memregion("audiocpu")->base() + 0x10000 + (data & 0x07) * 0x4000);
}
static ADDRESS_MAP_START( raphero_sound_mem_map, AS_PROGRAM, 8, nmk16_state )
@@ -4406,16 +4406,16 @@ static void decode_gfx(running_machine &machine)
/* background */
- rom = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_bg[bjtwin_address_map_bg0(A)]);
}
/* sprites */
- rom = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (A = 0;A < len;A += 2)
{
UINT16 tmp = decode_word( rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]);
@@ -4444,8 +4444,8 @@ static void decode_tdragonb(running_machine &machine)
{0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0},
};
- rom = machine.region("maincpu")->base();
- len = machine.region("maincpu")->bytes();
+ rom = machine.root_device().memregion("maincpu")->base();
+ len = machine.root_device().memregion("maincpu")->bytes();
for (A = 0;A < len;A += 2)
{
int h = A+NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = A+NATIVE_ENDIAN_VALUE_LE_BE(0,1);
@@ -4454,15 +4454,15 @@ static void decode_tdragonb(running_machine &machine)
rom[l] = tmp & 0xff;
}
- rom = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
}
- rom = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
@@ -4481,15 +4481,15 @@ static void decode_ssmissin(running_machine &machine)
{0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0},
};
- rom = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
}
- rom = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
@@ -4504,7 +4504,7 @@ static DRIVER_INIT( nmk )
static DRIVER_INIT( hachamf )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
//rom[0x0006/2] = 0x7dc2; /* replace reset vector with the "real" one */
@@ -4515,7 +4515,7 @@ static DRIVER_INIT( hachamf )
static DRIVER_INIT( tdragonb )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
decode_tdragonb(machine);
@@ -4526,7 +4526,7 @@ static DRIVER_INIT( tdragonb )
static DRIVER_INIT( tdragon )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
//rom[0x94b0/2] = 0; /* Patch out JMP to shared memory (protection) */
//rom[0x94b2/2] = 0x92f4;
@@ -4560,7 +4560,7 @@ static DRIVER_INIT( bjtwin )
* 008F7E: 207C 000F 9000 movea.l #$f9000, A0
*/
#if 0
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x09172/2] = 0x6006; /* patch checksum error */
rom[0x08f74/2] = 0x4e71;
#endif
@@ -4974,8 +4974,8 @@ static void decryptcode( running_machine &machine, int a23, int a22, int a21, in
int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 )
{
int i;
- UINT8 *RAM = machine.region( "maincpu" )->base();
- size_t size = machine.region( "maincpu" )->bytes();
+ UINT8 *RAM = machine.root_device().memregion( "maincpu" )->base();
+ size_t size = machine.root_device().memregion( "maincpu" )->bytes();
UINT8 *buffer = auto_alloc_array(machine, UINT8, size );
memcpy( buffer, RAM, size );
diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c
index 0d7ae6d5d07..efedadc1e19 100644
--- a/src/mame/drivers/norautp.c
+++ b/src/mame/drivers/norautp.c
@@ -3395,21 +3395,21 @@ ROM_END
*/
//static DRIVER_INIT( norautrh )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x1110] = 0x00;
// ROM[0x1111] = 0x00;
//}
//static DRIVER_INIT( norautpn )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x0827] = 0x00;
// ROM[0x0828] = 0x00;
//}
//static DRIVER_INIT( norautu )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x083c] = 0x00;
// ROM[0x083d] = 0x00;
// ROM[0x083e] = 0x00;
@@ -3417,7 +3417,7 @@ ROM_END
//static DRIVER_INIT( gtipoker )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x0cc6] = 0x00;
// ROM[0x0cc7] = 0x00;
// ROM[0x0cc8] = 0x00;
@@ -3428,7 +3428,7 @@ ROM_END
//static DRIVER_INIT( dphl )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x1510] = 0x00;
// ROM[0x1511] = 0x00;
// ROM[0x1512] = 0x00;
@@ -3436,7 +3436,7 @@ ROM_END
//static DRIVER_INIT( dphla )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x0b09] = 0x00;
// ROM[0x0b0a] = 0x00;
// ROM[0x0b0b] = 0x00;
@@ -3446,9 +3446,9 @@ static DRIVER_INIT( enc )
{
/* Attempt to decrypt the program ROM */
-// UINT8 *rom = machine.region("maincpu")->base();
+// UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// UINT8 *buffer;
-// int size = 0x2000; //machine.region("maincpu")->bytes();
+// int size = 0x2000; //machine.root_device().memregion("maincpu")->bytes();
// int start = 0;
// int i;
@@ -3485,7 +3485,7 @@ static DRIVER_INIT( deb )
/* Just for debugging purposes */
/* Should be removed soon */
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x02f7] = 0xca;
ROM[0x02f8] = 0x18;
ROM[0x206c] = 0xff;
@@ -3495,7 +3495,7 @@ static DRIVER_INIT( ssa )
/* Passing the video PPI handshaking lines */
/* Just for debugging purposes */
{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x073b] = 0x00;
// ROM[0x073c] = 0x00;
diff --git a/src/mame/drivers/nova2001.c b/src/mame/drivers/nova2001.c
index ece120fb81e..0d34b85bcd0 100644
--- a/src/mame/drivers/nova2001.c
+++ b/src/mame/drivers/nova2001.c
@@ -980,9 +980,9 @@ This code is overly generic because it is used for several games in ninjakd2.c
static void lineswap_gfx_roms(running_machine &machine, const char *region, const int bit)
{
- const int length = machine.region(region)->bytes();
+ const int length = machine.root_device().memregion(region)->bytes();
- UINT8* const src = machine.region(region)->base();
+ UINT8* const src = machine.root_device().memregion(region)->base();
UINT8* const temp = auto_alloc_array(machine, UINT8, length);
diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c
index 9fc3215ffbc..e7dfef19bf3 100644
--- a/src/mame/drivers/nss.c
+++ b/src/mame/drivers/nss.c
@@ -394,13 +394,13 @@ READ8_MEMBER(nss_state::m50458_r)
if(m_m50458_rom_bank)
{
- UINT8 *gfx_rom = machine().region("m50458_gfx")->base();
+ UINT8 *gfx_rom = memregion("m50458_gfx")->base();
return gfx_rom[offset & 0xfff];
}
else
{
- UINT8 *gfx_ram = machine().region("m50458_vram")->base();
+ UINT8 *gfx_ram = memregion("m50458_vram")->base();
return gfx_ram[offset & 0xfff];
}
@@ -415,7 +415,7 @@ WRITE8_MEMBER(nss_state::m50458_w)
logerror("Warning: write to M50458 GFX ROM!\n");
else
{
- UINT8 *gfx_ram = machine().region("m50458_vram")->base();
+ UINT8 *gfx_ram = memregion("m50458_vram")->base();
gfx_ram[offset & 0xfff] = data;
}
@@ -510,7 +510,7 @@ ADDRESS_MAP_END
static MACHINE_START( nss )
{
nss_state *state = machine.driver_data<nss_state>();
- UINT8 *ROM = machine.region("bios")->base();
+ UINT8 *ROM = state->memregion("bios")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x8000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index 0e898db70cd..daabe814cd7 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -739,7 +739,7 @@ static DRIVER_INIT(nwktr)
{
nwktr_state *state = machine.driver_data<nwktr_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_NWKTR);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
state->m_sharc_dataram = auto_alloc_array(machine, UINT32, 0x100000/4);
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c
index 6c76b80f961..02f29645b24 100644
--- a/src/mame/drivers/nycaptor.c
+++ b/src/mame/drivers/nycaptor.c
@@ -331,7 +331,7 @@ READ8_MEMBER(nycaptor_state::nycaptor_generic_control_r)
WRITE8_MEMBER(nycaptor_state::nycaptor_generic_control_w)
{
m_generic_control_reg = data;
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
}
static ADDRESS_MAP_START( nycaptor_master_map, AS_PROGRAM, 8, nycaptor_state )
@@ -436,7 +436,7 @@ WRITE8_MEMBER(nycaptor_state::cyclshtg_generic_control_w)
int bank = (data >> 2) & 3;
m_generic_control_reg = data;
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + bank*0x4000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + bank*0x4000 );
}
@@ -1354,7 +1354,7 @@ static DRIVER_INIT( bronx )
{
nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
for (i = 0; i < 0x20000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
@@ -1366,7 +1366,7 @@ static DRIVER_INIT( colt )
{
nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
for (i = 0; i < 0x20000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
diff --git a/src/mame/drivers/ohmygod.c b/src/mame/drivers/ohmygod.c
index ea2c4b9a5c7..c127e9eeb6b 100644
--- a/src/mame/drivers/ohmygod.c
+++ b/src/mame/drivers/ohmygod.c
@@ -22,7 +22,7 @@ WRITE16_MEMBER(ohmygod_state::ohmygod_ctrl_w)
if (ACCESSING_BITS_0_7)
{
- UINT8 *rom = machine().region("oki")->base();
+ UINT8 *rom = memregion("oki")->base();
/* ADPCM bank switch */
if (m_sndbank != ((data >> m_adpcm_bank_shift) & 0x0f))
@@ -306,7 +306,7 @@ static MACHINE_START( ohmygod )
static MACHINE_RESET( ohmygod )
{
ohmygod_state *state = machine.driver_data<ohmygod_state>();
- UINT8 *rom = machine.region("oki")->base();
+ UINT8 *rom = state->memregion("oki")->base();
state->m_sndbank = 0;
memcpy(rom + 0x20000, rom + 0x40000 + 0x20000 * state->m_sndbank, 0x20000);
diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c
index 37af890928e..dcdee4aa7e5 100644
--- a/src/mame/drivers/ojankohs.c
+++ b/src/mame/drivers/ojankohs.c
@@ -808,7 +808,7 @@ static MACHINE_START( common )
static MACHINE_START( ojankohs )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x40, &ROM[0x10000], 0x4000);
@@ -817,7 +817,7 @@ static MACHINE_START( ojankohs )
static MACHINE_START( ojankoy )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x20, &ROM[0x10000], 0x4000);
@@ -826,7 +826,7 @@ static MACHINE_START( ojankoy )
static MACHINE_START( ojankoc )
{
- UINT8 *ROM = machine.region("user1")->base();
+ UINT8 *ROM = machine.root_device().memregion("user1")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x10, &ROM[0x0000], 0x8000);
diff --git a/src/mame/drivers/olibochu.c b/src/mame/drivers/olibochu.c
index 1b9ee4053ef..dcf3cf9a7bc 100644
--- a/src/mame/drivers/olibochu.c
+++ b/src/mame/drivers/olibochu.c
@@ -87,7 +87,7 @@ public:
static PALETTE_INIT( olibochu )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index 096f3cd6e5f..a4089cc5f6a 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -589,8 +589,8 @@ ROM_END
static DRIVER_INIT( omegrace )
{
- int i, len = machine.region("user1")->bytes();
- UINT8 *prom = machine.region("user1")->base();
+ int i, len = machine.root_device().memregion("user1")->bytes();
+ UINT8 *prom = machine.root_device().memregion("user1")->base();
/* Omega Race has two pairs of the state PROM output
* lines swapped before going into the decoder.
diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c
index cecb9bdf858..2104b0c271a 100644
--- a/src/mame/drivers/onetwo.c
+++ b/src/mame/drivers/onetwo.c
@@ -348,7 +348,7 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( onetwo )
{
onetwo_state *state = machine.driver_data<onetwo_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index 654bb512f11..63680a883d8 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -476,7 +476,7 @@ static void opwolf_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data[chip] = device->machine().region("adpcm")->base()[state->m_adpcm_pos[chip]];
+ state->m_adpcm_data[chip] = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos[chip]];
state->m_adpcm_pos[chip] = (state->m_adpcm_pos[chip] + 1) & 0x7ffff;
msm5205_data_w(device, state->m_adpcm_data[chip] >> 4);
}
@@ -979,7 +979,7 @@ ROM_END
static DRIVER_INIT( opwolf )
{
opwolf_state *state = machine.driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
@@ -989,14 +989,14 @@ static DRIVER_INIT( opwolf )
state->m_opwolf_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff);
state->m_opwolf_gun_yoffs = 0x1c - (rom[0x03ffae / 2] & 0xff);
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( opwolfb )
{
opwolf_state *state = machine.driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
@@ -1004,7 +1004,7 @@ static DRIVER_INIT( opwolfb )
state->m_opwolf_gun_xoffs = -2;
state->m_opwolf_gun_yoffs = 17;
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c
index d20ebec8ec6..6c63eac64c3 100644
--- a/src/mame/drivers/othello.c
+++ b/src/mame/drivers/othello.c
@@ -100,7 +100,7 @@ static MC6845_UPDATE_ROW( update_row )
UINT32 data_address;
UINT32 tmp;
- const UINT8 *gfx = device->machine().region("gfx")->base();
+ const UINT8 *gfx = state->memregion("gfx")->base();
for(cx = 0; cx < x_count; ++cx)
{
@@ -283,7 +283,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
READ8_MEMBER(othello_state::n7751_rom_r)
{
- return machine().region("n7751data")->base()[m_sound_addr];
+ return memregion("n7751data")->base()[m_sound_addr];
}
READ8_MEMBER(othello_state::n7751_command_r)
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index f1e62af93ee..69805436955 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -674,7 +674,7 @@ static MACHINE_START( othunder )
{
othunder_state *state = machine.driver_data<othunder_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c
index 9189135f249..f20a01f3dfe 100644
--- a/src/mame/drivers/pachifev.c
+++ b/src/mame/drivers/pachifev.c
@@ -261,7 +261,7 @@ static void pf_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) );
msm5205_data_w(device,state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index 6501f6856aa..e00c3a09c1e 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -373,7 +373,7 @@ Boards:
static MACHINE_RESET( mschamp )
{
- UINT8 *rom = machine.region("maincpu")->base() + 0x10000;
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base() + 0x10000;
int whichbank = input_port_read(machine, "GAME") & 1;
machine.root_device().membank("bank1")->configure_entries(0, 2, &rom[0x0000], 0x8000);
@@ -650,7 +650,7 @@ WRITE8_MEMBER(pacman_state::bigbucks_bank_w)
READ8_MEMBER(pacman_state::bigbucks_question_r)
{
- UINT8 *question = machine().region("user1")->base();
+ UINT8 *question = memregion("user1")->base();
UINT8 ret;
ret = question[(m_bigbucks_bank << 16) | (offset ^ 0xffff)];
@@ -754,7 +754,7 @@ WRITE8_MEMBER(pacman_state::rocktrv2_question_bank_w)
READ8_MEMBER(pacman_state::rocktrv2_question_r)
{
- UINT8 *question = machine().region("user1")->base();
+ UINT8 *question = memregion("user1")->base();
return question[offset | (m_rocktrv2_question_bank * 0x8000)];
}
@@ -843,17 +843,17 @@ READ8_MEMBER(pacman_state::pacman_read_nop)
#define mspacman_disable_decode_latch(m) m.root_device().membank("bank1")->set_entry(0)
// any access to these ROM addresses disables the decoder, and all you see is the original Pac-Man code
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x0038){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x0038]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x03b0){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x03b0]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x1600){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x1600]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x2120){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x2120]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x3ff0){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x3ff0]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x8000){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x8000]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x97f0){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x97f0]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x0038){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x0038]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x03b0){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x03b0]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x1600){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x1600]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x2120){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x2120]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x3ff0){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x3ff0]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x8000){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x8000]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x97f0){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x97f0]; }
WRITE8_MEMBER(pacman_state::mspacman_disable_decode_w){ mspacman_disable_decode_latch(machine()); }
// any access to these ROM addresses enables the decoder, and you'll see the Ms. Pac-Man code
-READ8_MEMBER(pacman_state::mspacman_enable_decode_r_0x3ff8){ mspacman_enable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x3ff8+0x10000]; }
+READ8_MEMBER(pacman_state::mspacman_enable_decode_r_0x3ff8){ mspacman_enable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x3ff8+0x10000]; }
WRITE8_MEMBER(pacman_state::mspacman_enable_decode_w){ mspacman_enable_decode_latch(machine()); }
@@ -5466,7 +5466,7 @@ static void maketrax_rom_decode(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
@@ -5499,7 +5499,7 @@ static void korosuke_rom_decode(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
@@ -5535,10 +5535,10 @@ static DRIVER_INIT( ponpoko )
int i, j;
UINT8 *RAM, temp;
- int length = machine.region("gfx1")->bytes()/2;
+ int length = machine.root_device().memregion("gfx1")->bytes()/2;
/* Characters */
- RAM = machine.region("gfx1")->base();
+ RAM = machine.root_device().memregion("gfx1")->base();
for (i = 0;i < length;i += 0x10)
{
for (j = 0; j < 8; j++)
@@ -5550,7 +5550,7 @@ static DRIVER_INIT( ponpoko )
}
/* Sprites */
- RAM = machine.region("gfx1")->base()+length;
+ RAM = machine.root_device().memregion("gfx1")->base()+length;
for (i = 0;i < length;i += 0x20)
{
for (j = 0; j < 8; j++)
@@ -5588,7 +5588,7 @@ static DRIVER_INIT( eyes )
/* CPU ROMs */
/* Data lines D3 and D5 swapped */
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x4000; i++)
{
RAM[i] = BITSWAP8(RAM[i],7,6,3,4,5,2,1,0);
@@ -5598,8 +5598,8 @@ static DRIVER_INIT( eyes )
/* Graphics ROMs */
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0;i < len;i += 8)
eyes_decode(&RAM[i]);
}
@@ -5672,10 +5672,10 @@ static DRIVER_INIT( mspacman )
/* CPU ROMs */
/* Pac-Man code is in low bank */
- ROM = machine.region("maincpu")->base();
+ ROM = machine.root_device().memregion("maincpu")->base();
/* decrypted Ms. Pac-Man code is in high bank */
- DROM = &machine.region("maincpu")->base()[0x10000];
+ DROM = &machine.root_device().memregion("maincpu")->base()[0x10000];
/* copy ROMs into decrypted bank */
for (i = 0; i < 0x1000; i++)
@@ -5722,8 +5722,8 @@ static DRIVER_INIT( woodpek )
/* Graphics ROMs */
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0;i < len;i += 8)
eyes_decode(&RAM[i]);
}
@@ -5740,7 +5740,7 @@ static DRIVER_INIT( jumpshot )
static DRIVER_INIT( drivfrcp )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&ROM[0 * 0x2000]);
machine.root_device().membank("bank2")->set_base(&ROM[1 * 0x2000]);
machine.root_device().membank("bank3")->set_base(&ROM[2 * 0x2000]);
@@ -5749,7 +5749,7 @@ static DRIVER_INIT( drivfrcp )
static DRIVER_INIT( 8bpm )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* Data lines D0 and D6 swapped */
@@ -5766,7 +5766,7 @@ static DRIVER_INIT( 8bpm )
static DRIVER_INIT( porky )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* Data lines D0 and D4 swapped */
@@ -5789,7 +5789,7 @@ static DRIVER_INIT( porky )
static DRIVER_INIT( rocktrv2 )
{
/* hack to pass the rom check for the bad rom */
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x7ffe] = 0xa7;
ROM[0x7fee] = 0x6d;
@@ -5801,7 +5801,7 @@ socket and run through the 74298. Clock is tied to system clock. */
static DRIVER_INIT( mspacmbe )
{
UINT8 temp;
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i;
/* Address lines A1 and A0 swapped if A2=0 */
diff --git a/src/mame/drivers/panicr.c b/src/mame/drivers/panicr.c
index 79fd4f698b6..15e733563b5 100644
--- a/src/mame/drivers/panicr.c
+++ b/src/mame/drivers/panicr.c
@@ -93,7 +93,7 @@ public:
static PALETTE_INIT( panicr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -151,8 +151,8 @@ static TILE_GET_INFO( get_bgtile_info )
{
int code,attr;
- code=machine.region("user1")->base()[tile_index];
- attr=machine.region("user2")->base()[tile_index];
+ code=machine.root_device().memregion("user1")->base()[tile_index];
+ attr=machine.root_device().memregion("user2")->base()[tile_index];
code+=((attr&7)<<8);
SET_TILE_INFO(
1,
@@ -469,8 +469,8 @@ static DRIVER_INIT( panicr )
int size;
int i;
- rom = machine.region("gfx1")->base();
- size = machine.region("gfx1")->bytes();
+ rom = machine.root_device().memregion("gfx1")->base();
+ size = machine.root_device().memregion("gfx1")->bytes();
// text data lines
for (i = 0;i < size/2;i++)
@@ -492,8 +492,8 @@ static DRIVER_INIT( panicr )
}
- rom = machine.region("gfx2")->base();
- size = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ size = machine.root_device().memregion("gfx2")->bytes();
// tiles data lines
for (i = 0;i < size/4;i++)
@@ -519,8 +519,8 @@ static DRIVER_INIT( panicr )
}
- rom = machine.region("gfx3")->base();
- size = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ size = machine.root_device().memregion("gfx3")->bytes();
// sprites data lines
for (i = 0;i < size/2;i++)
@@ -545,8 +545,8 @@ static DRIVER_INIT( panicr )
//rearrange bg tilemaps a bit....
- rom = machine.region("user1")->base();
- size = machine.region("user1")->bytes();
+ rom = machine.root_device().memregion("user1")->base();
+ size = machine.root_device().memregion("user1")->bytes();
memcpy(buf,rom, size);
{
@@ -558,8 +558,8 @@ static DRIVER_INIT( panicr )
}
}
- rom = machine.region("user2")->base();
- size = machine.region("user2")->bytes();
+ rom = machine.root_device().memregion("user2")->base();
+ size = machine.root_device().memregion("user2")->bytes();
memcpy(buf,rom, size);
{
diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c
index 0942e495b06..2acf3bbd8ca 100644
--- a/src/mame/drivers/paradise.c
+++ b/src/mame/drivers/paradise.c
@@ -47,7 +47,7 @@ penky: we need to delay the irqs at startup or it won't boot. Either one of
WRITE8_MEMBER(paradise_state::paradise_rombank_w)
{
int bank = data;
- int bank_n = machine().region("maincpu")->bytes() / 0x4000 - 1;
+ int bank_n = memregion("maincpu")->bytes() / 0x4000 - 1;
if (bank >= bank_n)
{
@@ -629,8 +629,8 @@ GFXDECODE_END
static MACHINE_START( paradise )
{
paradise_state *state = machine.driver_data<paradise_state>();
- int bank_n = machine.region("maincpu")->bytes() / 0x4000 - 1;
- UINT8 *ROM = machine.region("maincpu")->base();
+ int bank_n = machine.root_device().memregion("maincpu")->bytes() / 0x4000 - 1;
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 3, &ROM[0x00000], 0x4000);
state->membank("bank1")->configure_entries(3, bank_n - 3, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/parodius.c b/src/mame/drivers/parodius.c
index 1886a213dcb..8cb82ef642d 100644
--- a/src/mame/drivers/parodius.c
+++ b/src/mame/drivers/parodius.c
@@ -248,7 +248,7 @@ static const k05324x_interface parodius_k05324x_intf =
static MACHINE_START( parodius )
{
parodius_state *state = machine.driver_data<parodius_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 14, &ROM[0x10000], 0x4000);
state->membank("bank1")->configure_entries(14, 2, &ROM[0x08000], 0x4000);
diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c
index 79959763be4..956f66aaf46 100644
--- a/src/mame/drivers/pasha2.c
+++ b/src/mame/drivers/pasha2.c
@@ -127,7 +127,7 @@ WRITE16_MEMBER(pasha2_state::pasha2_misc_w)
case 0xb000:
case 0xc000:
case 0xd000:
- membank("bank1")->set_base(machine().region("user2")->base() + 0x400 * (bank - 0x8000)); break;
+ membank("bank1")->set_base(machine().root_device().memregion("user2")->base() + 0x400 * (bank - 0x8000)); break;
}
}
}
@@ -476,7 +476,7 @@ static DRIVER_INIT( pasha2 )
pasha2_state *state = machine.driver_data<pasha2_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x95744, 0x95747, read16_delegate(FUNC(pasha2_state::pasha2_speedup_r), state));
- state->membank("bank1")->set_base(machine.region("user2")->base());
+ state->membank("bank1")->set_base(state->memregion("user2")->base());
}
GAME( 1998, pasha2, 0, pasha2, pasha2, pasha2, ROT0, "Dong Sung", "Pasha Pasha 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/pastelg.c b/src/mame/drivers/pastelg.c
index 8e389083676..8aba35434de 100644
--- a/src/mame/drivers/pastelg.c
+++ b/src/mame/drivers/pastelg.c
@@ -45,7 +45,7 @@ static DRIVER_INIT( pastelg )
READ8_MEMBER(pastelg_state::pastelg_sndrom_r)
{
- UINT8 *ROM = machine().region("voice")->base();
+ UINT8 *ROM = memregion("voice")->base();
return ROM[pastelg_blitter_src_addr_r(&space) & 0x7fff];
}
diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c
index 755568a13f9..99c884ef595 100644
--- a/src/mame/drivers/pbaction.c
+++ b/src/mame/drivers/pbaction.c
@@ -481,7 +481,7 @@ READ8_MEMBER(pbaction_state::pbactio3_prot_kludge_r)
static DRIVER_INIT( pbactio3 )
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* first of all, do a simple bitswap */
for (i = 0; i < 0xc000; i++)
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index 4850f63b4b9..4c114f72546 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -232,7 +232,7 @@ static MACHINE_START( streetg2 )
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, streetg2_set_keyb_int);
- machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.region("game_prg")->base(), 0x8000 );
+ machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.root_device().memregion("game_prg")->base(), 0x8000 );
machine.root_device().membank("rombank")->set_entry(0);
//microtouch_init(machine, pcat_nit_microtouch_tx_callback, NULL);
diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c
index 56698948441..79311e0ca69 100644
--- a/src/mame/drivers/pcktgal.c
+++ b/src/mame/drivers/pcktgal.c
@@ -24,7 +24,7 @@
WRITE8_MEMBER(pcktgal_state::pcktgal_bank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (data & 1) { membank("bank1")->set_base(&RAM[0x4000]); }
else { membank("bank1")->set_base(&RAM[0x10000]); }
@@ -413,7 +413,7 @@ static DRIVER_INIT( deco222 )
int A;
address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
space->set_decrypted_region(0x8000, 0xffff, decrypted);
@@ -421,17 +421,17 @@ static DRIVER_INIT( deco222 )
for (A = 0x8000;A < 0x18000;A++)
decrypted[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1);
- machine.root_device().membank("bank3")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank3")->configure_decrypted_entries(0, 2, &decrypted[0x8000], 0x4000);
}
static DRIVER_INIT( graphics )
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i,j,temp[16];
- machine.root_device().membank("bank3")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
/* Tile graphics roms have some swapped lines, original version only */
for (i = 0x00000;i < len;i += 32)
diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c
index 9e47424084a..f9314561cca 100644
--- a/src/mame/drivers/pcxt.c
+++ b/src/mame/drivers/pcxt.c
@@ -109,7 +109,7 @@ static SCREEN_UPDATE_RGB32( tetriskr )
pcxt_state *state = screen.machine().driver_data<pcxt_state>();
int x,y;
int yi;
- const UINT8 *bg_rom = screen.machine().region("gfx2")->base();
+ const UINT8 *bg_rom = state->memregion("gfx2")->base();
//popmessage("%04x",m_start_offs);
@@ -199,7 +199,7 @@ WRITE8_MEMBER(pcxt_state::disk_iobank_w)
if (newbank != m_bank)
{
m_bank = newbank;
- membank("bank1")->set_base(machine().region("game_prg")->base() + 0x10000 * m_bank );
+ membank("bank1")->set_base(machine().root_device().memregion("game_prg")->base() + 0x10000 * m_bank );
}
m_lastvalue = data;
diff --git a/src/mame/drivers/pengadvb.c b/src/mame/drivers/pengadvb.c
index 53c5fe68e68..e31c6ef0694 100644
--- a/src/mame/drivers/pengadvb.c
+++ b/src/mame/drivers/pengadvb.c
@@ -60,7 +60,7 @@ static void mem_map_banks(running_machine &machine)
case 0:
// BIOS
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
- state->membank("bank1")->set_base(machine.region("maincpu")->base());
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base());
break;
default:
@@ -75,16 +75,16 @@ static void mem_map_banks(running_machine &machine)
// BIOS
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
- state->membank("bank21")->set_base(machine.region("maincpu")->base() + 0x4000);
- state->membank("bank22")->set_base(machine.region("maincpu")->base() + 0x4000 + 0x2000);
+ state->membank("bank21")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000);
+ state->membank("bank22")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000 + 0x2000);
break;
case 1:
// game
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
- state->membank("bank21")->set_base(machine.region("game")->base() + state->m_mem_banks[0]*0x2000);
- state->membank("bank22")->set_base(machine.region("game")->base() + state->m_mem_banks[1]*0x2000);
+ state->membank("bank21")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[0]*0x2000);
+ state->membank("bank22")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[1]*0x2000);
break;
default:
@@ -99,8 +99,8 @@ static void mem_map_banks(running_machine &machine)
// game
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0x9fff, "bank31" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xbfff, "bank32" );
- state->membank("bank31")->set_base(machine.region("game")->base() + state->m_mem_banks[2]*0x2000);
- state->membank("bank32")->set_base(machine.region("game")->base() + state->m_mem_banks[3]*0x2000);
+ state->membank("bank31")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[2]*0x2000);
+ state->membank("bank32")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[3]*0x2000);
break;
default:
@@ -289,8 +289,8 @@ MACHINE_CONFIG_END
static void pengadvb_decrypt(running_machine &machine, const char* region)
{
- UINT8 *mem = machine.region(region)->base();
- int memsize = machine.region(region)->bytes();
+ UINT8 *mem = machine.root_device().memregion(region)->base();
+ int memsize = machine.root_device().memregion(region)->bytes();
UINT8 *buf;
int i;
diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c
index bc264e929e8..ce8dc12ffa1 100644
--- a/src/mame/drivers/pengo.c
+++ b/src/mame/drivers/pengo.c
@@ -692,7 +692,7 @@ static DRIVER_INIT( penta )
};
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 117637f2377..3234f3bb94f 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -285,7 +285,7 @@ static const mc6845_interface mc6845_intf =
static void peplus_load_superdata(running_machine &machine, const char *bank_name)
{
peplus_state *state = machine.driver_data<peplus_state>();
- UINT8 *super_data = machine.region(bank_name)->base();
+ UINT8 *super_data = state->memregion(bank_name)->base();
/* Distribute Superboard Data */
memcpy(state->m_s3000_ram, &super_data[0x3000], 0x1000);
@@ -700,7 +700,7 @@ static SCREEN_UPDATE_IND16( peplus )
static PALETTE_INIT( peplus )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* prom bits
7654 3210
---- -xxx red component.
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index d6b88c029dc..4a29c150b02 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -3570,11 +3570,11 @@ ROM_END
static void expand_32x32x5bpp(running_machine &machine)
{
- UINT8 *src = machine.region( "tiles" )->base();
+ UINT8 *src = machine.root_device().memregion( "tiles" )->base();
gfx_layout glcopy;
glcopy = *(&pgm32_charlayout);
- size_t srcsize = machine.region( "tiles" )->bytes();
+ size_t srcsize = machine.root_device().memregion( "tiles" )->bytes();
int cnt, pix;
size_t gfx2_size_needed = ((srcsize/5)*8)+0x1000;
UINT8 *dst = auto_alloc_array(machine, UINT8, gfx2_size_needed);
@@ -3613,8 +3613,8 @@ static void expand_32x32x5bpp(running_machine &machine)
static void expand_colourdata( running_machine &machine )
{
pgm_state *state = machine.driver_data<pgm_state>();
- UINT8 *src = machine.region( "sprcol" )->base();
- size_t srcsize = machine.region( "sprcol" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "sprcol" )->base();
+ size_t srcsize = state->memregion( "sprcol" )->bytes();
int cnt;
size_t needed = srcsize / 2 * 3;
@@ -3645,7 +3645,7 @@ void pgm_basic_init( running_machine &machine, bool set_bank)
{
pgm_state *state = machine.driver_data<pgm_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
if (set_bank) state->membank("bank1")->set_base(&ROM[0x100000]);
expand_32x32x5bpp(machine);
diff --git a/src/mame/drivers/pgm2.c b/src/mame/drivers/pgm2.c
index 20652475e95..6f643622218 100644
--- a/src/mame/drivers/pgm2.c
+++ b/src/mame/drivers/pgm2.c
@@ -286,7 +286,7 @@ static void iga_u12_decode(UINT16* rom, int len, int ixor)
static DRIVER_INIT( orleg2 )
{
- UINT16 *src = (UINT16 *)machine.region("spritesa")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("spritesa")->base();
iga_u12_decode(src, 0x2000000, 0x4761);
iga_u16_decode(src, 0x2000000, 0xc79f);
@@ -294,7 +294,7 @@ static DRIVER_INIT( orleg2 )
static DRIVER_INIT( kov2nl )
{
- UINT16 *src = (UINT16 *)machine.region("spritesa")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("spritesa")->base();
iga_u12_decode(src, 0x2000000, 0xa193);
iga_u16_decode(src, 0x2000000, 0xb780);
diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c
index fce13e77f0b..565c6b5b3e2 100644
--- a/src/mame/drivers/phoenix.c
+++ b/src/mame/drivers/phoenix.c
@@ -446,7 +446,7 @@ static const ay8910_interface survival_ay8910_interface =
static MACHINE_RESET( phoenix )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base() + 0x4000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000);
}
diff --git a/src/mame/drivers/photon.c b/src/mame/drivers/photon.c
index 9b7307f774d..67d4ec9f553 100644
--- a/src/mame/drivers/photon.c
+++ b/src/mame/drivers/photon.c
@@ -33,8 +33,8 @@ public:
static void pk8000_set_bank(running_machine &machine,UINT8 data)
{
- UINT8 *rom = machine.region("maincpu")->base();
- UINT8 *ram = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ram = machine.root_device().memregion("maincpu")->base();
UINT8 block1 = data & 3;
UINT8 block2 = (data >> 2) & 3;
UINT8 block3 = (data >> 4) & 3;
@@ -199,7 +199,7 @@ static VIDEO_START( photon )
static SCREEN_UPDATE_IND16( photon )
{
- return pk8000_video_update(screen, bitmap, cliprect, screen.machine().region("maincpu")->base());
+ return pk8000_video_update(screen, bitmap, cliprect, screen.machine().root_device().memregion("maincpu")->base());
}
static MACHINE_CONFIG_START( photon, photon_state )
diff --git a/src/mame/drivers/photon2.c b/src/mame/drivers/photon2.c
index 5650e451a67..dca0437c2a5 100644
--- a/src/mame/drivers/photon2.c
+++ b/src/mame/drivers/photon2.c
@@ -198,7 +198,7 @@ WRITE8_MEMBER(photon2_state::photon2_membank_w)
logerror( "Unknown banking write: %02X\n", data);
}
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x4000*bank );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x4000*bank );
}
READ8_MEMBER(photon2_state::photon2_fe_r)
@@ -312,7 +312,7 @@ static TIMER_DEVICE_CALLBACK( spec_interrupt_hack )
static MACHINE_RESET( photon2 )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base());
}
static MACHINE_CONFIG_START( photon2, photon2_state )
diff --git a/src/mame/drivers/pingpong.c b/src/mame/drivers/pingpong.c
index 2d492da3d51..58404d5e6d2 100644
--- a/src/mame/drivers/pingpong.c
+++ b/src/mame/drivers/pingpong.c
@@ -36,7 +36,7 @@ WRITE8_MEMBER(pingpong_state::cashquiz_question_bank_low_w)
static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" };
const char *bank = bankname[data & 7];
int bankaddr = m_question_addr_high | ((data - 0x60) * 0x100);
- UINT8 *questions = machine().region("user1")->base() + bankaddr;
+ UINT8 *questions = memregion("user1")->base() + bankaddr;
membank(bank)->set_base(questions);
}
@@ -559,7 +559,7 @@ ROM_END
static DRIVER_INIT( merlinmm )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* decrypt program code */
@@ -573,12 +573,12 @@ static DRIVER_INIT( cashquiz )
int i;
/* decrypt program code */
- ROM = machine.region("maincpu")->base();
+ ROM = machine.root_device().memregion("maincpu")->base();
for( i = 0; i < 0x4000; i++ )
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
/* decrypt questions */
- ROM = machine.region("user1")->base();
+ ROM = machine.root_device().memregion("user1")->base();
for( i = 0; i < 0x40000; i++ )
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
@@ -598,14 +598,14 @@ static DRIVER_INIT( cashquiz )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5700, 0x57ff, "bank8");
// setup default banks
- state->membank("bank1")->set_base(machine.region("user1")->base() + 0x100*0 );
- state->membank("bank2")->set_base(machine.region("user1")->base() + 0x100*1 );
- state->membank("bank3")->set_base(machine.region("user1")->base() + 0x100*2 );
- state->membank("bank4")->set_base(machine.region("user1")->base() + 0x100*3 );
- state->membank("bank5")->set_base(machine.region("user1")->base() + 0x100*4 );
- state->membank("bank6")->set_base(machine.region("user1")->base() + 0x100*5 );
- state->membank("bank7")->set_base(machine.region("user1")->base() + 0x100*6 );
- state->membank("bank8")->set_base(machine.region("user1")->base() + 0x100*7 );
+ state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + 0x100*0 );
+ state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base() + 0x100*1 );
+ state->membank("bank3")->set_base(machine.root_device().memregion("user1")->base() + 0x100*2 );
+ state->membank("bank4")->set_base(machine.root_device().memregion("user1")->base() + 0x100*3 );
+ state->membank("bank5")->set_base(machine.root_device().memregion("user1")->base() + 0x100*4 );
+ state->membank("bank6")->set_base(machine.root_device().memregion("user1")->base() + 0x100*5 );
+ state->membank("bank7")->set_base(machine.root_device().memregion("user1")->base() + 0x100*6 );
+ state->membank("bank8")->set_base(state->memregion("user1")->base() + 0x100*7 );
}
diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c
index 35173ef31ad..c2d8277f922 100644
--- a/src/mame/drivers/pipedrm.c
+++ b/src/mame/drivers/pipedrm.c
@@ -595,11 +595,11 @@ static MACHINE_START( pipedrm )
state->m_subcpu = machine.device("sub");
/* initialize main Z80 bank */
- state->membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ state->membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
state->membank("bank1")->set_entry(0);
/* initialize sound bank */
- state->membank("bank2")->configure_entries(0, 2, machine.region("sub")->base() + 0x10000, 0x8000);
+ state->membank("bank2")->configure_entries(0, 2, state->memregion("sub")->base() + 0x10000, 0x8000);
state->membank("bank2")->set_entry(0);
/* state save */
diff --git a/src/mame/drivers/pipeline.c b/src/mame/drivers/pipeline.c
index 4bf8a2308f4..e35f64602cb 100644
--- a/src/mame/drivers/pipeline.c
+++ b/src/mame/drivers/pipeline.c
@@ -367,8 +367,8 @@ static const ym2203_interface ym2203_config =
static PALETTE_INIT(pipeline)
{
int r,g,b,i,c;
- UINT8 *prom1 = &machine.region("proms")->base()[0x000];
- UINT8 *prom2 = &machine.region("proms")->base()[0x100];
+ UINT8 *prom1 = &machine.root_device().memregion("proms")->base()[0x000];
+ UINT8 *prom2 = &machine.root_device().memregion("proms")->base()[0x100];
for(i=0;i<0x100;i++)
{
diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c
index 1b588e5942a..31b6e92e4d1 100644
--- a/src/mame/drivers/pirates.c
+++ b/src/mame/drivers/pirates.c
@@ -342,11 +342,11 @@ static void pirates_decrypt_68k(running_machine &machine)
UINT16 *buf, *rom;
int i;
- rom_size = machine.region("maincpu")->bytes();
+ rom_size = machine.root_device().memregion("maincpu")->bytes();
buf = auto_alloc_array(machine, UINT16, rom_size/2);
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/2; i++)
@@ -371,11 +371,11 @@ static void pirates_decrypt_p(running_machine &machine)
UINT8 *buf, *rom;
int i;
- rom_size = machine.region("gfx1")->bytes();
+ rom_size = machine.root_device().memregion("gfx1")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/4; i++)
@@ -395,11 +395,11 @@ static void pirates_decrypt_s(running_machine &machine)
UINT8 *buf, *rom;
int i;
- rom_size = machine.region("gfx2")->bytes();
+ rom_size = machine.root_device().memregion("gfx2")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("gfx2")->base();
+ rom = machine.root_device().memregion("gfx2")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/4; i++)
@@ -420,11 +420,11 @@ static void pirates_decrypt_oki(running_machine &machine)
UINT8 *buf, *rom;
int i;
- rom_size = machine.region("oki")->bytes();
+ rom_size = machine.root_device().memregion("oki")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("oki")->base();
+ rom = machine.root_device().memregion("oki")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size; i++)
@@ -438,7 +438,7 @@ static void pirates_decrypt_oki(running_machine &machine)
static DRIVER_INIT( pirates )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
pirates_decrypt_68k(machine);
pirates_decrypt_p(machine);
diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c
index 2fe7649da6c..4e09041b32f 100644
--- a/src/mame/drivers/playmark.c
+++ b/src/mame/drivers/playmark.c
@@ -167,7 +167,7 @@ static WRITE8_DEVICE_HANDLER( playmark_oki_banking_w )
{
state->m_old_oki_bank = data & 7;
- if (((state->m_old_oki_bank - 1) * 0x40000) < device->machine().region("oki")->bytes())
+ if (((state->m_old_oki_bank - 1) * 0x40000) < state->memregion("oki")->bytes())
{
downcast<okim6295_device *>(device)->set_bank_base(0x40000 * (state->m_old_oki_bank - 1));
}
@@ -1678,8 +1678,8 @@ static UINT8 playmark_asciitohex(UINT8 data)
static DRIVER_INIT( bigtwin )
{
playmark_state *state = machine.driver_data<playmark_state>();
- UINT8 *playmark_PICROM_HEX = machine.region("user1")->base();
- UINT16 *playmark_PICROM = (UINT16 *)machine.region("audiocpu")->base();
+ UINT8 *playmark_PICROM_HEX = machine.root_device().memregion("user1")->base();
+ UINT16 *playmark_PICROM = (UINT16 *)state->memregion("audiocpu")->base();
INT32 offs, data;
UINT16 src_pos = 0;
UINT16 dst_pos = 0;
diff --git a/src/mame/drivers/pluto5.c b/src/mame/drivers/pluto5.c
index e8ecb606992..e22c4bee9c4 100644
--- a/src/mame/drivers/pluto5.c
+++ b/src/mame/drivers/pluto5.c
@@ -499,18 +499,18 @@ extern void astra_addresslines( UINT16* src, size_t srcsize, int small );
static DRIVER_INIT( hb )
{
- astra_addresslines( (UINT16*)machine.region( "maincpu" )->base(), machine.region( "maincpu" )->bytes(), 0 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "maincpu" )->base(), machine.root_device().memregion( "maincpu" )->bytes(), 0 );
#if 0
{
- UINT8* ROM = machine.region( "maincpu" )->base();
+ UINT8* ROM = machine.root_device().memregion( "maincpu" )->base();
FILE *fp;
char filename[256];
sprintf(filename,"%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
- fwrite(ROM, machine.region( "maincpu" )->bytes(), 1, fp);
+ fwrite(ROM, machine.root_device().memregion( "maincpu" )->bytes(), 1, fp);
fclose(fp);
}
}
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index 4efa4f030e4..cbffc795c00 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -135,7 +135,7 @@ WRITE32_MEMBER(polygonet_state::polygonet_eeprom_w)
READ32_MEMBER(polygonet_state::ttl_rom_r)
{
UINT32 *ROM;
- ROM = (UINT32 *)machine().region("gfx1")->base();
+ ROM = (UINT32 *)machine().root_device().memregion("gfx1")->base();
return ROM[offset];
}
@@ -144,7 +144,7 @@ READ32_MEMBER(polygonet_state::ttl_rom_r)
READ32_MEMBER(polygonet_state::psac_rom_r)
{
UINT32 *ROM;
- ROM = (UINT32 *)machine().region("gfx2")->base();
+ ROM = (UINT32 *)machine().root_device().memregion("gfx2")->base();
return ROM[offset];
}
@@ -545,7 +545,7 @@ ADDRESS_MAP_END
static void reset_sound_region(running_machine &machine)
{
polygonet_state *state = machine.driver_data<polygonet_state>();
- state->membank("bank2")->set_base(machine.region("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
+ state->membank("bank2")->set_base(state->memregion("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
}
WRITE8_MEMBER(polygonet_state::sound_bankswitch_w)
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index de120edd67c..21040bf00b0 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -378,7 +378,7 @@ ROM_END
static DRIVER_INIT(pip)
{
-// UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// rom[0x2696/2] = 0x4e71;
// rom[0x26a0/2] = 0x4e71;
pc_vga_init(machine, vga_setting, NULL);
diff --git a/src/mame/drivers/pokechmp.c b/src/mame/drivers/pokechmp.c
index 4f052fc20c0..05ff356853b 100644
--- a/src/mame/drivers/pokechmp.c
+++ b/src/mame/drivers/pokechmp.c
@@ -53,7 +53,7 @@ ClawGrip, Jul 2006
WRITE8_MEMBER(pokechmp_state::pokechmp_bank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (data == 0x00)
{
@@ -262,7 +262,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( pokechmp )
{
- machine.root_device().membank("bank3")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/poker72.c b/src/mame/drivers/poker72.c
index fa94061849a..5c4d2e8ab27 100644
--- a/src/mame/drivers/poker72.c
+++ b/src/mame/drivers/poker72.c
@@ -77,7 +77,7 @@ WRITE8_MEMBER(poker72_state::poker72_paletteram_w)
WRITE8_MEMBER(poker72_state::output_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
printf("%02x\n",data);
@@ -339,7 +339,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_RESET( poker72 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&ROM[0]);
}
@@ -393,7 +393,7 @@ ROM_END
static DRIVER_INIT( poker72 )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x4a9] = 0x28;
}
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index e86e26640d8..c2503fd91bd 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -378,9 +378,9 @@ static const namco_51xx_interface namco_51xx_intf =
static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
{
- UINT32 length = device->machine().region("52xx")->bytes();
+ UINT32 length = device->machine().root_device().memregion("52xx")->bytes();
logerror("ROM @ %04X\n", offset);
- return (offset < length) ? device->machine().region("52xx")->base()[offset] : 0xff;
+ return (offset < length) ? device->machine().root_device().memregion("52xx")->base()[offset] : 0xff;
}
static READ8_DEVICE_HANDLER( namco_52xx_si_r )
diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c
index 5a8ade99473..3b2b34d20d0 100644
--- a/src/mame/drivers/policetr.c
+++ b/src/mame/drivers/policetr.c
@@ -186,7 +186,7 @@ CUSTOM_INPUT_MEMBER(policetr_state::bsmt_status_r)
READ32_MEMBER(policetr_state::bsmt2000_data_r)
{
- return machine().region("bsmt")->base()[m_bsmt_data_bank * 0x10000 + m_bsmt_data_offset] << 8;
+ return memregion("bsmt")->base()[m_bsmt_data_bank * 0x10000 + m_bsmt_data_offset] << 8;
}
diff --git a/src/mame/drivers/poo.c b/src/mame/drivers/poo.c
index 3696edbaf4b..9678240ae6d 100644
--- a/src/mame/drivers/poo.c
+++ b/src/mame/drivers/poo.c
@@ -291,7 +291,7 @@ GFXDECODE_END
static PALETTE_INIT( unclepoo )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
diff --git a/src/mame/drivers/poolshrk.c b/src/mame/drivers/poolshrk.c
index 9d353d25917..200fc8268d3 100644
--- a/src/mame/drivers/poolshrk.c
+++ b/src/mame/drivers/poolshrk.c
@@ -14,8 +14,8 @@ Atari Poolshark Driver
static DRIVER_INIT( poolshrk )
{
- UINT8* pSprite = machine.region("gfx1")->base();
- UINT8* pOffset = machine.region("proms")->base();
+ UINT8* pSprite = machine.root_device().memregion("gfx1")->base();
+ UINT8* pOffset = machine.root_device().memregion("proms")->base();
int i;
int j;
diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c
index 96d97d20b88..7c005c4cf60 100644
--- a/src/mame/drivers/popeye.c
+++ b/src/mame/drivers/popeye.c
@@ -620,7 +620,7 @@ static DRIVER_INIT( skyskipr )
{
popeye_state *state = machine.driver_data<popeye_state>();
UINT8 *buffer;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int len = 0x10000;
/* decrypt the program ROMs */
@@ -642,7 +642,7 @@ static DRIVER_INIT( popeye )
{
popeye_state *state = machine.driver_data<popeye_state>();
UINT8 *buffer;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int len = 0x10000;
/* decrypt the program ROMs */
diff --git a/src/mame/drivers/powerbal.c b/src/mame/drivers/powerbal.c
index 7261176cbff..d0e31cf69ea 100644
--- a/src/mame/drivers/powerbal.c
+++ b/src/mame/drivers/powerbal.c
@@ -70,7 +70,7 @@ static WRITE16_DEVICE_HANDLER( oki_banking )
{
int addr = 0x40000 * ((data & 3) - 1);
- if (addr < device->machine().region("oki")->bytes())
+ if (addr < device->machine().root_device().memregion("oki")->bytes())
downcast<okim6295_device *>(device)->set_bank_base(addr);
}
}
diff --git a/src/mame/drivers/powerins.c b/src/mame/drivers/powerins.c
index 1f014df42dd..86678701c1c 100644
--- a/src/mame/drivers/powerins.c
+++ b/src/mame/drivers/powerins.c
@@ -48,7 +48,7 @@ WRITE16_MEMBER(powerins_state::powerins_okibank_w)
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = machine().region("oki1")->base();
+ UINT8 *RAM = memregion("oki1")->base();
int new_bank = data & 0x7;
if (new_bank != m_oki_bank)
diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c
index 4a1ec5b1016..5a3a2a34dc3 100644
--- a/src/mame/drivers/ppmast93.c
+++ b/src/mame/drivers/ppmast93.c
@@ -171,7 +171,7 @@ WRITE8_MEMBER(ppmast93_state::ppmast93_bgram_w)
WRITE8_MEMBER(ppmast93_state::ppmast93_port4_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int bank;
coin_counter_w(machine(), 0, data & 0x08);
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index ee28c4ef725..a3b3ed59fea 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -212,7 +212,7 @@ READ8_MEMBER(progolf_state::audio_command_r)
READ8_MEMBER(progolf_state::progolf_videoram_r)
{
UINT8 *videoram = m_videoram;
- UINT8 *gfx_rom = machine().region("gfx1")->base();
+ UINT8 *gfx_rom = memregion("gfx1")->base();
if (offset >= 0x0800)
{
@@ -389,7 +389,7 @@ static const mc6845_interface mc6845_intf =
static PALETTE_INIT( progolf )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
@@ -502,7 +502,7 @@ static DRIVER_INIT( progolf )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);
@@ -516,7 +516,7 @@ static DRIVER_INIT( progolfa )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index ad5bf4d1cff..d8b74ab13d5 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -1811,8 +1811,8 @@ static DRIVER_INIT( sngkace )
psikyo_state *state = machine.driver_data<psikyo_state>();
{
- UINT8 *RAM = machine.region("ymsnd")->base();
- int len = machine.region("ymsnd")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("ymsnd")->base();
+ int len = state->memregion("ymsnd")->bytes();
int i;
/* Bit 6&7 of the samples are swapped. Naughty, naughty... */
@@ -1832,13 +1832,13 @@ static DRIVER_INIT( sngkace )
state->m_ka302c_banking = 0; // SH201B doesn't have any gfx banking
/* setup audiocpu banks */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x8000);
/* Enable other regions */
#if 0
if (!strcmp(machine.system().name,"sngkace"))
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x995] = 0x4e;
ROM[0x994] = 0x71;
ROM[0x997] = 0x4e;
@@ -1892,7 +1892,7 @@ static DRIVER_INIT( tengai )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( gunbird )
@@ -1909,7 +1909,7 @@ static DRIVER_INIT( gunbird )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
@@ -1933,7 +1933,7 @@ static DRIVER_INIT( s1945 )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945a )
@@ -1956,7 +1956,7 @@ static DRIVER_INIT( s1945a )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945j )
@@ -1979,7 +1979,7 @@ static DRIVER_INIT( s1945j )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945jn )
@@ -1996,7 +1996,7 @@ static DRIVER_INIT( s1945jn )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945bl )
@@ -2011,7 +2011,7 @@ static DRIVER_INIT( s1945bl )
state->m_ka302c_banking = 1;
- state->membank("okibank")->configure_entries(0, 4, machine.region("oki")->base() + 0x30000, 0x10000);
+ state->membank("okibank")->configure_entries(0, 4, state->memregion("oki")->base() + 0x30000, 0x10000);
state->membank("okibank")->set_entry(0);
}
diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c
index 2e83eae39d8..be4c724236d 100644
--- a/src/mame/drivers/psikyo4.c
+++ b/src/mame/drivers/psikyo4.c
@@ -319,7 +319,7 @@ WRITE32_MEMBER(psikyo4_state::ps4_vidregs_w)
if (offset == 2) /* Configure bank for gfx test */
{
if (ACCESSING_BITS_0_15) // Bank
- membank("bank2")->set_base(machine().region("gfx1")->base() + 0x2000 * (m_vidregs[offset] & 0x1fff)); /* Bank comes from vidregs */
+ membank("bank2")->set_base(machine().root_device().memregion("gfx1")->base() + 0x2000 * (m_vidregs[offset] & 0x1fff)); /* Bank comes from vidregs */
}
}
@@ -328,8 +328,8 @@ WRITE32_MEMBER(psikyo4_state::ps4_vidregs_w)
static void set_hotgmck_pcm_bank( running_machine &machine, int n )
{
psikyo4_state *state = machine.driver_data<psikyo4_state>();
- UINT8 *ymf_pcmbank = machine.region("ymf")->base() + 0x200000;
- UINT8 *pcm_rom = machine.region("ymfsource")->base();
+ UINT8 *ymf_pcmbank = machine.root_device().memregion("ymf")->base() + 0x200000;
+ UINT8 *pcm_rom = state->memregion("ymfsource")->base();
memcpy(ymf_pcmbank + n * 0x100000, pcm_rom + PCM_BANK_NO_LEGACY(n) * 0x100000, 0x100000);
}
@@ -955,8 +955,8 @@ static void hotgmck_pcm_bank_postload(running_machine &machine)
static void install_hotgmck_pcm_bank(running_machine &machine)
{
psikyo4_state *state = machine.driver_data<psikyo4_state>();
- UINT8 *ymf_pcm = machine.region("ymf")->base();
- UINT8 *pcm_rom = machine.region("ymfsource")->base();
+ UINT8 *ymf_pcm = machine.root_device().memregion("ymf")->base();
+ UINT8 *pcm_rom = state->memregion("ymfsource")->base();
memcpy(ymf_pcm, pcm_rom, 0x200000);
@@ -970,7 +970,7 @@ static void install_hotgmck_pcm_bank(running_machine &machine)
static DRIVER_INIT( hotgmck )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
install_hotgmck_pcm_bank(machine); // Banked PCM ROM
}
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index f936393625c..2bc4fe43708 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -799,7 +799,7 @@ static MACHINE_START( psikyosh )
state->m_maincpu = machine.device("maincpu");
- state->membank("bank2")->configure_entries(0, 0x1000, machine.region("gfx1")->base(), 0x20000);
+ state->membank("bank2")->configure_entries(0, 0x1000, state->memregion("gfx1")->base(), 0x20000);
}
@@ -1218,7 +1218,7 @@ static DRIVER_INIT( s1945ii )
static DRIVER_INIT( daraku )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
@@ -1230,14 +1230,14 @@ static DRIVER_INIT( sbomberb )
static DRIVER_INIT( gunbird2 )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( s1945iii )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
diff --git a/src/mame/drivers/psychic5.c b/src/mame/drivers/psychic5.c
index 9f0cba2db16..8deb4472291 100644
--- a/src/mame/drivers/psychic5.c
+++ b/src/mame/drivers/psychic5.c
@@ -354,7 +354,7 @@ READ8_MEMBER(psychic5_state::psychic5_bankselect_r)
WRITE8_MEMBER(psychic5_state::psychic5_bankselect_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bankaddress;
if (m_bank_latch != data)
@@ -367,7 +367,7 @@ WRITE8_MEMBER(psychic5_state::psychic5_bankselect_w)
WRITE8_MEMBER(psychic5_state::bombsa_bankselect_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bankaddress;
if (m_bank_latch != data)
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index 8d424c46ac7..935e3239844 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -143,7 +143,7 @@ static TILE_GET_INFO( get_pturn_bg_tile_info )
{
pturn_state *state = machine.driver_data<pturn_state>();
int tileno,palno;
- tileno = machine.region("user1")->base()[tile_index];
+ tileno = state->memregion("user1")->base()[tile_index];
palno=state->m_bgpalette;
if(palno==1)
{
diff --git a/src/mame/drivers/puckpkmn.c b/src/mame/drivers/puckpkmn.c
index a9b510d8cea..9838f2406e0 100644
--- a/src/mame/drivers/puckpkmn.c
+++ b/src/mame/drivers/puckpkmn.c
@@ -260,8 +260,8 @@ Screenshots available on my site at http://guru.mameworld.info/oldnews2001.html
static DRIVER_INIT( puckpkmn )
{
- UINT8 *rom = machine.region("maincpu")->base();
- size_t len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ size_t len = machine.root_device().memregion("maincpu")->bytes();
int i;
for (i = 0; i < len; i++)
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index f0bd872467d..3b0a8b08310 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -119,7 +119,7 @@ WRITE16_MEMBER(qdrmfgp_state::gp2_control_w)
READ16_MEMBER(qdrmfgp_state::v_rom_r)
{
device_t *k056832 = machine().device("k056832");
- UINT8 *mem8 = machine().region("gfx1")->base();
+ UINT8 *mem8 = memregion("gfx1")->base();
int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
offset += bank * 0x800 * 4;
@@ -650,7 +650,7 @@ static MACHINE_START( qdrmfgp2 )
static MACHINE_RESET( qdrmfgp )
{
qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
- state->m_sndram = machine.region("konami")->base() + 0x100000;
+ state->m_sndram = state->memregion("konami")->base() + 0x100000;
/* reset the IDE controller */
state->m_gp2_irq_control = 0;
diff --git a/src/mame/drivers/qix.c b/src/mame/drivers/qix.c
index d4812e317f8..907228ffbd0 100644
--- a/src/mame/drivers/qix.c
+++ b/src/mame/drivers/qix.c
@@ -1278,8 +1278,8 @@ static DRIVER_INIT( kram3 )
********************************/
i = 0;
- //patch = machine.region("user1")->base();
- rom = machine.region("maincpu")->base();
+ //patch = machine.root_device().memregion("user1")->base();
+ rom = machine.root_device().memregion("maincpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x6000);
mainspace->set_decrypted_region(0xa000, 0xffff, decrypted);
@@ -1291,8 +1291,8 @@ static DRIVER_INIT( kram3 )
}
i = 0;
- //patch = machine.region("user2")->base();
- rom = machine.region("videocpu")->base();
+ //patch = machine.root_device().memregion("user2")->base();
+ rom = machine.root_device().memregion("videocpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x6000);
videospace->set_decrypted_region(0xa000, 0xffff, decrypted);
@@ -1308,8 +1308,8 @@ static DRIVER_INIT( kram3 )
static DRIVER_INIT( zookeep )
{
/* configure the banking */
- machine.root_device().membank("bank1")->configure_entry(0, machine.region("videocpu")->base() + 0xa000);
- machine.root_device().membank("bank1")->configure_entry(1, machine.region("videocpu")->base() + 0x10000);
+ machine.root_device().membank("bank1")->configure_entry(0, machine.root_device().memregion("videocpu")->base() + 0xa000);
+ machine.root_device().membank("bank1")->configure_entry(1, machine.root_device().memregion("videocpu")->base() + 0x10000);
machine.root_device().membank("bank1")->set_entry(0);
}
diff --git a/src/mame/drivers/queen.c b/src/mame/drivers/queen.c
index 90830e0a781..dbc78a199dd 100644
--- a/src/mame/drivers/queen.c
+++ b/src/mame/drivers/queen.c
@@ -143,7 +143,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
state->membank("bios_bank")->set_base(state->m_bios_ram);
else // disable RAM access (reads go to BIOS ROM)
- state->membank("bios_bank")->set_base(busdevice->machine().region("bios")->base() + 0x10000);
+ state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x10000);
break;
}
case 0x5a: // PAM1
@@ -151,12 +151,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("video_bank1")->set_base(state->m_isa_ram1);
else
- state->membank("video_bank1")->set_base(busdevice->machine().region("video_bios")->base() + 0);
+ state->membank("video_bank1")->set_base(state->memregion("video_bios")->base() + 0);
if (data & 0x10)
state->membank("video_bank2")->set_base(state->m_isa_ram2);
else
- state->membank("video_bank2")->set_base(busdevice->machine().region("video_bios")->base() + 0x4000);
+ state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
break;
}
@@ -165,12 +165,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
else
- state->membank("bios_ext1")->set_base(busdevice->machine().region("bios")->base() + 0);
+ state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0);
if (data & 0x10)
state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram);
else
- state->membank("bios_ext2")->set_base(busdevice->machine().region("bios")->base() + 0x4000);
+ state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x4000);
break;
}
@@ -179,12 +179,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
else
- state->membank("bios_ext3")->set_base(busdevice->machine().region("bios")->base() + 0x8000);
+ state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x8000);
if (data & 0x10)
state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram);
else
- state->membank("bios_ext4")->set_base(busdevice->machine().region("bios")->base() + 0xc000);
+ state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0xc000);
break;
}
@@ -658,13 +658,13 @@ static MACHINE_START( queen )
static MACHINE_RESET( queen )
{
- machine.root_device().membank("bios_bank")->set_base(machine.region("bios")->base() + 0x30000);
- machine.root_device().membank("bios_ext1")->set_base(machine.region("bios")->base() + 0x20000);
- machine.root_device().membank("bios_ext2")->set_base(machine.region("bios")->base() + 0x24000);
- machine.root_device().membank("bios_ext3")->set_base(machine.region("bios")->base() + 0x28000);
- machine.root_device().membank("bios_ext4")->set_base(machine.region("bios")->base() + 0x2c000);
- machine.root_device().membank("video_bank1")->set_base(machine.region("video_bios")->base() + 0);
- machine.root_device().membank("video_bank2")->set_base(machine.region("video_bios")->base() + 0x4000);
+ machine.root_device().membank("bios_bank")->set_base(machine.root_device().memregion("bios")->base() + 0x30000);
+ machine.root_device().membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0x20000);
+ machine.root_device().membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x24000);
+ machine.root_device().membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x28000);
+ machine.root_device().membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0x2c000);
+ machine.root_device().membank("video_bank1")->set_base(machine.root_device().memregion("video_bios")->base() + 0);
+ machine.root_device().membank("video_bank2")->set_base(machine.root_device().memregion("video_bios")->base() + 0x4000);
}
diff --git a/src/mame/drivers/quizdna.c b/src/mame/drivers/quizdna.c
index c25f91b980a..ee034ef275d 100644
--- a/src/mame/drivers/quizdna.c
+++ b/src/mame/drivers/quizdna.c
@@ -18,13 +18,13 @@ Quiz Gekiretsu Scramble (Gakuen Paradise 2) (c) 1993 Face
WRITE8_MEMBER(quizdna_state::quizdna_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(&ROM[0x10000+0x4000*(data & 0x3f)]);
}
WRITE8_MEMBER(quizdna_state::gekiretu_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(&ROM[0x10000+0x4000*((data & 0x3f) ^ 0x0a)]);
}
diff --git a/src/mame/drivers/quizo.c b/src/mame/drivers/quizo.c
index 154627ce8a8..be3e283d555 100644
--- a/src/mame/drivers/quizo.c
+++ b/src/mame/drivers/quizo.c
@@ -51,7 +51,7 @@ static const UINT8 rombankLookup[]={ 2, 3, 4, 4, 4, 4, 4, 5, 0, 1};
static PALETTE_INIT(quizo)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 16;i++)
{
@@ -129,7 +129,7 @@ WRITE8_MEMBER(quizo_state::port60_w)
data=0;
}
m_port60=data;
- membank("bank1")->set_base(&machine().region("user1")->base()[rombankLookup[data]*0x4000] );
+ membank("bank1")->set_base(&machine().root_device().memregion("user1")->base()[rombankLookup[data]*0x4000] );
}
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, quizo_state )
diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c
index 8d8142a1d73..8cf944f466f 100644
--- a/src/mame/drivers/quizpun2.c
+++ b/src/mame/drivers/quizpun2.c
@@ -249,7 +249,7 @@ READ8_MEMBER(quizpun2_state::quizpun2_protection_r)
case STATE_EEPROM_R: // EEPROM read
{
- UINT8 *eeprom = machine().region("eeprom")->base();
+ UINT8 *eeprom = memregion("eeprom")->base();
ret = eeprom[prot.addr];
break;
}
@@ -276,7 +276,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w)
{
case STATE_EEPROM_W:
{
- UINT8 *eeprom = machine().region("eeprom")->base();
+ UINT8 *eeprom = memregion("eeprom")->base();
eeprom[prot.addr] = data;
prot.addr++;
if ((prot.addr % 8) == 0)
@@ -343,7 +343,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w)
WRITE8_MEMBER(quizpun2_state::quizpun2_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(&ROM[ 0x10000 + 0x2000 * (data & 0x1f) ] );
}
diff --git a/src/mame/drivers/quizshow.c b/src/mame/drivers/quizshow.c
index 5fba7464402..c21e9cc69c1 100644
--- a/src/mame/drivers/quizshow.c
+++ b/src/mame/drivers/quizshow.c
@@ -425,8 +425,8 @@ ROM_END
static DRIVER_INIT( quizshow )
{
- UINT8 *gfxdata = machine.region("user1")->base();
- UINT8 *dest = machine.region("gfx1")->base();
+ UINT8 *gfxdata = machine.root_device().memregion("user1")->base();
+ UINT8 *dest = machine.root_device().memregion("gfx1")->base();
int tile, line;
diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c
index eafa8a62c49..3aa310e7fcc 100644
--- a/src/mame/drivers/r2dx_v33.c
+++ b/src/mame/drivers/r2dx_v33.c
@@ -227,7 +227,7 @@ static SCREEN_UPDATE_IND16( rdx_v33 )
if(frame == 5)
{
int i,data;
- static UINT8 *rom = space->machine().region("mainprg")->base();
+ static UINT8 *rom = space->machine().root_device().memregion("mainprg")->base();
for(i=0;i<0x800;i+=2)
{
@@ -733,7 +733,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(rdx_v33)
{
- machine.root_device().membank("bank1")->configure_entries(0, 0x20, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("bank1")->configure_entries(0, 0x20, machine.root_device().memregion("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
@@ -742,7 +742,7 @@ static DRIVER_INIT(rdx_v33)
static DRIVER_INIT(nzerotea)
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
zeroteam_decrypt_sprites(machine);
diff --git a/src/mame/drivers/rabbit.c b/src/mame/drivers/rabbit.c
index fe5385e473c..08c156f8be2 100644
--- a/src/mame/drivers/rabbit.c
+++ b/src/mame/drivers/rabbit.c
@@ -520,7 +520,7 @@ READ32_MEMBER(rabbit_state::randomrabbits)
/* rom bank is used when testing roms, not currently hooked up */
WRITE32_MEMBER(rabbit_state::rabbit_rombank_w)
{
- UINT8 *dataroms = machine().region("gfx1")->base();
+ UINT8 *dataroms = memregion("gfx1")->base();
#if 0
int bank;
printf("rabbit rombank %08x\n",data);
@@ -546,7 +546,7 @@ static TIMER_CALLBACK( rabbit_blit_done )
static void rabbit_do_blit(running_machine &machine)
{
rabbit_state *state = machine.driver_data<rabbit_state>();
- UINT8 *blt_data = machine.region("gfx1")->base();
+ UINT8 *blt_data = state->memregion("gfx1")->base();
int blt_source = (state->m_blitterregs[0]&0x000fffff)>>0;
int blt_column = (state->m_blitterregs[1]&0x00ff0000)>>16;
int blt_line = (state->m_blitterregs[1]&0x000000ff);
diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c
index aee2e4a19a1..bc08876b975 100644
--- a/src/mame/drivers/raiden.c
+++ b/src/mame/drivers/raiden.c
@@ -548,7 +548,7 @@ bit-swapping */
static void common_decrypt(running_machine &machine)
{
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0; i < 0x20000; i++)
@@ -560,7 +560,7 @@ static void common_decrypt(running_machine &machine)
RAM[0xc0000/2 + i] = data;
}
- RAM = (UINT16 *)machine.region("sub")->base();
+ RAM = (UINT16 *)machine.root_device().memregion("sub")->base();
for (i = 0; i < 0x20000; i++)
{
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index 855d59072ce..6412624adda 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -2894,25 +2894,25 @@ ROM_END
static DRIVER_INIT (raiden2)
{
- machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
}
static DRIVER_INIT (raidendx)
{
- machine.root_device().membank("mainbank")->configure_entries(0, 0x10, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("mainbank")->configure_entries(0, 0x10, machine.root_device().memregion("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
}
static DRIVER_INIT (xsedae)
{
/* doesn't have banking */
- //machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ //machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
}
static DRIVER_INIT (zeroteam)
{
- machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
zeroteam_decrypt_sprites(machine);
}
diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c
index ffa0f761150..2a88c6f3eca 100644
--- a/src/mame/drivers/rainbow.c
+++ b/src/mame/drivers/rainbow.c
@@ -875,7 +875,7 @@ ROM_END
static DRIVER_INIT( rbisland )
{
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
@@ -884,7 +884,7 @@ static DRIVER_INIT( rbisland )
static DRIVER_INIT( rbislande )
{
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
diff --git a/src/mame/drivers/rampart.c b/src/mame/drivers/rampart.c
index 29435711eb9..7693e1c6760 100644
--- a/src/mame/drivers/rampart.c
+++ b/src/mame/drivers/rampart.c
@@ -479,7 +479,7 @@ ROM_END
static DRIVER_INIT( rampart )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
memcpy(&rom[0x140000], &rom[0x40000], 0x8000);
atarigen_slapstic_init(machine.device("maincpu"), 0x140000, 0x438000, 118);
diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c
index efdb361528d..0a5c01c0218 100644
--- a/src/mame/drivers/rastan.c
+++ b/src/mame/drivers/rastan.c
@@ -177,7 +177,7 @@ static void rastan_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
@@ -359,7 +359,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( rastan )
{
rastan_state *state = machine.driver_data<rastan_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entry(0, &ROM[0x00000]);
state->membank("bank1")->configure_entries(1, 3, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c
index af811ca5db0..b9e79cc83b4 100644
--- a/src/mame/drivers/redclash.c
+++ b/src/mame/drivers/redclash.c
@@ -539,9 +539,9 @@ ROM_END
static DRIVER_INIT( redclash )
{
int i,j;
- const UINT8 *src = machine.region("gfx2")->base();
- UINT8 *dst = machine.region("gfx3")->base();
- int len = machine.region("gfx3")->bytes();
+ const UINT8 *src = machine.root_device().memregion("gfx2")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx3")->base();
+ int len = machine.root_device().memregion("gfx3")->bytes();
/* rearrange the sprite graphics */
for (i = 0;i < len;i++)
diff --git a/src/mame/drivers/relief.c b/src/mame/drivers/relief.c
index 04f4d2fc304..74724654b96 100644
--- a/src/mame/drivers/relief.c
+++ b/src/mame/drivers/relief.c
@@ -444,7 +444,7 @@ ROM_END
static DRIVER_INIT( relief )
{
- UINT8 *sound_base = machine.region("oki")->base();
+ UINT8 *sound_base = machine.root_device().memregion("oki")->base();
/* expand the ADPCM data to avoid lots of memcpy's during gameplay */
/* the upper 128k is fixed, the lower 128k is bankswitched */
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 61b4d5797e9..907aeec9a22 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -165,7 +165,7 @@ static DEVICE_START( renegade_adpcm )
renegade_adpcm_state *state = get_safe_token(device);
state->m_playing = 0;
state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, renegade_adpcm_callback);
- state->m_base = device->machine().region("adpcm")->base();
+ state->m_base = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm.reset();
}
@@ -240,7 +240,7 @@ static const UINT8 kuniokun_xor_table[0x2a] =
static void setbank(running_machine &machine)
{
renegade_state *state = machine.driver_data<renegade_state>();
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&RAM[state->m_bank ? 0x10000 : 0x4000]);
}
diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c
index 511326da0a1..a6567fa8835 100644
--- a/src/mame/drivers/rltennis.c
+++ b/src/mame/drivers/rltennis.c
@@ -162,9 +162,9 @@ static MACHINE_START( rltennis )
state->m_screen = machine.device( "screen");
state->m_dac_1 = machine.device("dac1");
state->m_dac_2 = machine.device("dac2");
- state->m_samples_1 = machine.region("samples1")->base();
- state->m_samples_2 = machine.region("samples2")->base();
- state->m_gfx = machine.region("gfx1")->base();
+ state->m_samples_1 = machine.root_device().memregion("samples1")->base();
+ state->m_samples_2 = machine.root_device().memregion("samples2")->base();
+ state->m_gfx = state->memregion("gfx1")->base();
state->m_timer = machine.scheduler().timer_alloc(FUNC(sample_player));
}
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index af0b4e0c220..186da5fef2e 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -155,7 +155,7 @@ logerror("%04x: keyboard_w %02x\n",cpu_get_pc(&space.device()),data);
READ8_MEMBER(rmhaihai_state::samples_r)
{
- return machine().region("adpcm")->base()[offset];
+ return memregion("adpcm")->base()[offset];
}
static WRITE8_DEVICE_HANDLER( adpcm_w )
@@ -181,7 +181,7 @@ WRITE8_MEMBER(rmhaihai_state::ctrl_w)
WRITE8_MEMBER(rmhaihai_state::themj_rombank_w)
{
- UINT8 *rom = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *rom = memregion("maincpu")->base() + 0x10000;
int bank = data & 0x03;
logerror("banksw %d\n",bank);
membank("bank1")->set_base(rom + bank*0x4000);
@@ -665,8 +665,8 @@ ROM_END
static DRIVER_INIT( rmhaihai )
{
- UINT8 *rom = machine.region("gfx1")->base();
- int size = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int size = machine.root_device().memregion("gfx1")->bytes();
int a,b;
size /= 2;
diff --git a/src/mame/drivers/rockrage.c b/src/mame/drivers/rockrage.c
index 737c877a0a5..4823fbb7eb6 100644
--- a/src/mame/drivers/rockrage.c
+++ b/src/mame/drivers/rockrage.c
@@ -237,7 +237,7 @@ static const k007420_interface rockrage_k007420_intf =
static MACHINE_START( rockrage )
{
rockrage_state *state = machine.driver_data<rockrage_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/rocnrope.c b/src/mame/drivers/rocnrope.c
index 82717fc1e67..046bd89cd85 100644
--- a/src/mame/drivers/rocnrope.c
+++ b/src/mame/drivers/rocnrope.c
@@ -25,7 +25,7 @@
/* Roc'n'Rope has the IRQ vectors in RAM. The rom contains $FFFF at this address! */
WRITE8_MEMBER(rocnrope_state::rocnrope_interrupt_vector_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
RAM[0xfff2 + offset] = data;
}
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index 3e62bafa40f..d7a4be56362 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -1558,8 +1558,8 @@ static DRIVER_INIT( nitrobal )
static DRIVER_INIT( schmeisr )
{
- const UINT8 *src = machine.region("gfx2")->base();
- UINT8 *dst = machine.region("gfx1")->base();
+ const UINT8 *src = machine.root_device().memregion("gfx2")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
memcpy(dst, src, 0x20000);
memcpy(dst + 0x20000, src + 0x80000, 0x20000);
diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c
index d0ec636f16e..1a3148cf0c7 100644
--- a/src/mame/drivers/rollerg.c
+++ b/src/mame/drivers/rollerg.c
@@ -249,7 +249,7 @@ static const k053252_interface rollerg_k053252_intf =
static MACHINE_START( rollerg )
{
rollerg_state *state = machine.driver_data<rollerg_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
state->membank("bank1")->configure_entries(6, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/roul.c b/src/mame/drivers/roul.c
index 663b1dfb0ea..9f1c14d39bc 100644
--- a/src/mame/drivers/roul.c
+++ b/src/mame/drivers/roul.c
@@ -88,7 +88,7 @@ public:
static PALETTE_INIT( roul )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit6, bit7, bit0, bit1, r, g, b;
int i;
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index c6b21e601e3..1075cdd93a0 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -957,7 +957,7 @@ READ8_MEMBER(route16_state::routex_prot_read)
static DRIVER_INIT( route16 )
{
- UINT8 *ROM = machine.region("cpu1")->base();
+ UINT8 *ROM = machine.root_device().memregion("cpu1")->base();
/* Is this actually a bootleg? some of the protection has
been removed */
@@ -972,7 +972,7 @@ static DRIVER_INIT( route16 )
static DRIVER_INIT( route16a )
{
- UINT8 *ROM = machine.region("cpu1")->base();
+ UINT8 *ROM = machine.root_device().memregion("cpu1")->base();
/* TO DO : Replace these patches with simulation of the protection device */
/* patch the protection */
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index cd514e735f7..b0e314881d3 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -196,8 +196,8 @@ public:
static PALETTE_INIT( royalmah )
{
offs_t i;
- const UINT8 *prom = machine.region("proms")->base();
- int len = machine.region("proms")->bytes();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
+ int len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len; i++)
{
@@ -231,8 +231,8 @@ static PALETTE_INIT( royalmah )
static PALETTE_INIT( mjderngr )
{
offs_t i;
- const UINT8 *prom = machine.region("proms")->base();
- int len = machine.region("proms")->bytes();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
+ int len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len / 2; i++)
{
@@ -386,7 +386,7 @@ READ8_MEMBER(royalmah_state::suzume_dsw_r)
WRITE8_MEMBER(royalmah_state::suzume_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
m_suzume_bank = data;
@@ -402,7 +402,7 @@ logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
WRITE8_MEMBER(royalmah_state::mjapinky_bank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
m_rombank = data;
membank("bank1")->set_base(ROM + 0x10000 + 0x8000 * data);
}
@@ -418,12 +418,12 @@ WRITE8_MEMBER(royalmah_state::mjapinky_palbank_w)
READ8_MEMBER(royalmah_state::mjapinky_dsw_r)
{
if (m_rombank == 0x0e) return input_port_read(machine(), "DSW3");
- else return *(machine().region("maincpu")->base() + 0x10000 + 0x8000 * m_rombank);
+ else return *(machine().root_device().memregion("maincpu")->base() + 0x10000 + 0x8000 * m_rombank);
}
WRITE8_MEMBER(royalmah_state::tontonb_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
@@ -441,7 +441,7 @@ logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
/* bits 5 and 6 seem to affect which Dip Switch to read in 'majs101b' */
WRITE8_MEMBER(royalmah_state::dynax_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
//logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
@@ -470,7 +470,7 @@ READ8_MEMBER(royalmah_state::daisyari_dsw_r)
WRITE8_MEMBER(royalmah_state::daisyari_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
m_dsw_select = (data & 0xc);
@@ -498,7 +498,7 @@ READ8_MEMBER(royalmah_state::mjclub_dsw_r)
WRITE8_MEMBER(royalmah_state::mjclub_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
m_dsw_select = data & 0xc0;
@@ -727,7 +727,7 @@ WRITE8_MEMBER(royalmah_state::jansou_6402_w)
READ8_MEMBER(royalmah_state::jansou_6403_r)
{
- UINT8 *GFXROM = machine().region("gfx1")->base();
+ UINT8 *GFXROM = memregion("gfx1")->base();
int d0 = GFXROM[m_gfx_adr];
int d1 = GFXROM[m_gfx_adr+1];
int c0 = m_jansou_colortable[d1 & 0x0f] & 0x0f;
@@ -828,7 +828,7 @@ READ8_MEMBER(royalmah_state::janptr96_dsw_r)
WRITE8_MEMBER(royalmah_state::janptr96_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(ROM + 0x10000 + 0x8000 * data);
}
@@ -880,7 +880,7 @@ WRITE8_MEMBER(royalmah_state::mjifb_coin_counter_w)
READ8_MEMBER(royalmah_state::mjifb_rom_io_r)
{
if (m_mjifb_rom_enable)
- return ((UINT8*)(machine().region("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
+ return ((UINT8*)(machine().root_device().memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
offset += 0x8000;
@@ -989,7 +989,7 @@ ADDRESS_MAP_END
READ8_MEMBER(royalmah_state::mjdejavu_rom_io_r)
{
if (m_mjifb_rom_enable)
- return ((UINT8*)(machine().region("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
+ return ((UINT8*)(machine().root_device().memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
offset += 0x8000;
@@ -1050,7 +1050,7 @@ READ8_MEMBER(royalmah_state::mjtensin_p3_r)
static void mjtensin_update_rombank(running_machine &machine)
{
royalmah_state *state = machine.driver_data<royalmah_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
}
WRITE8_MEMBER(royalmah_state::mjtensin_p4_w)
{
@@ -1092,7 +1092,7 @@ ADDRESS_MAP_END
static void cafetime_update_rombank(running_machine &machine)
{
royalmah_state *state = machine.driver_data<royalmah_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
}
WRITE8_MEMBER(royalmah_state::cafetime_p4_w)
{
@@ -1177,7 +1177,7 @@ WRITE8_MEMBER(royalmah_state::mjvegasa_rombank_w)
READ8_MEMBER(royalmah_state::mjvegasa_rom_io_r)
{
if ((m_rombank & 0x70) != 0x70)
- return machine().region("maincpu")->base()[0x10000 + m_rombank * 0x8000 + offset];
+ return memregion("maincpu")->base()[0x10000 + m_rombank * 0x8000 + offset];
offset += 0x8000;
@@ -4710,7 +4710,7 @@ ROM_START( jansoua )
ROM_END
-static DRIVER_INIT( ippatsu ) { machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base() + 0x8000 ); }
+static DRIVER_INIT( ippatsu ) { machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x8000 ); }
static DRIVER_INIT( janptr96 )
{
diff --git a/src/mame/drivers/rpunch.c b/src/mame/drivers/rpunch.c
index f1cb0e2335e..ddd29c0f017 100644
--- a/src/mame/drivers/rpunch.c
+++ b/src/mame/drivers/rpunch.c
@@ -132,7 +132,7 @@ static void ym2151_irq_gen(device_t *device, int state)
static MACHINE_RESET( rpunch )
{
- UINT8 *snd = machine.region("upd")->base();
+ UINT8 *snd = machine.root_device().memregion("upd")->base();
memcpy(snd, snd + 0x20000, 0x20000);
}
@@ -198,7 +198,7 @@ static WRITE8_DEVICE_HANDLER( upd_control_w )
rpunch_state *state = device->machine().driver_data<rpunch_state>();
if ((data & 1) != state->m_upd_rom_bank)
{
- UINT8 *snd = device->machine().region("upd")->base();
+ UINT8 *snd = state->memregion("upd")->base();
state->m_upd_rom_bank = data & 1;
memcpy(snd, snd + 0x20000 * (state->m_upd_rom_bank + 1), 0x20000);
}
diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c
index 7d9d124782e..a03114b2695 100644
--- a/src/mame/drivers/rungun.c
+++ b/src/mame/drivers/rungun.c
@@ -366,7 +366,7 @@ static const k053252_interface rng_k053252_intf =
static MACHINE_START( rng )
{
rungun_state *state = machine.driver_data<rungun_state>();
- UINT8 *ROM = machine.region("soundcpu")->base();
+ UINT8 *ROM = state->memregion("soundcpu")->base();
state->membank("bank2")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c
index 31507bffc3c..e1a490fc9ad 100644
--- a/src/mame/drivers/sandscrp.c
+++ b/src/mame/drivers/sandscrp.c
@@ -269,7 +269,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sandscrp_state::sandscrp_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bank = data & 0x07;
if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(&space.device()),data);
diff --git a/src/mame/drivers/sangho.c b/src/mame/drivers/sangho.c
index 7b6454ee382..ab94364672b 100644
--- a/src/mame/drivers/sangho.c
+++ b/src/mame/drivers/sangho.c
@@ -79,7 +79,7 @@ static void pzlestar_map_banks(running_machine &machine)
case 2:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff);
- state->membank("bank1")->set_base(machine.region("user1")->base()+ 0x10000);
+ state->membank("bank1")->set_base(state->memregion("user1")->base()+ 0x10000);
break;
case 1:
case 3:
@@ -101,12 +101,12 @@ static void pzlestar_map_banks(running_machine &machine)
case 2:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
- state->membank("bank2")->set_base(machine.region("user1")->base()+ 0x18000);
+ state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base()+ 0x18000);
break;
case 3:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
- state->membank("bank2")->set_base(machine.region("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000) + 0x4000);
+ state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000) + 0x4000);
break;
case 1:
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x4000, 0x7fff);
@@ -127,7 +127,7 @@ static void pzlestar_map_banks(running_machine &machine)
case 3:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff);
- state->membank("bank3")->set_base(machine.region("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000));
+ state->membank("bank3")->set_base(machine.root_device().memregion("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000));
break;
case 1:
case 2:
@@ -198,18 +198,18 @@ static void sexyboom_map_bank(running_machine &machine, int bank)
else
{
// rom 0
- state->membank(read_bank_name)->set_base(machine.region("user1")->base()+0x4000*banknum);
+ state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x4000*banknum);
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
}
else if (banktype == 0x82)
{
- state->membank(read_bank_name)->set_base(machine.region("user1")->base()+0x20000+banknum*0x4000);
+ state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x20000+banknum*0x4000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
else if (banktype == 0x80)
{
- state->membank(read_bank_name)->set_base(machine.region("user1")->base()+0x120000+banknum*0x4000);
+ state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x120000+banknum*0x4000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
else
diff --git a/src/mame/drivers/saturn.c b/src/mame/drivers/saturn.c
index 360d6f4c45f..2570e83b408 100644
--- a/src/mame/drivers/saturn.c
+++ b/src/mame/drivers/saturn.c
@@ -2154,7 +2154,7 @@ struct cdrom_interface saturn_cdrom =
static DEVICE_IMAGE_LOAD( sat_cart )
{
- UINT8 *ROM = image.device().machine().region("maincpu")->base()+0x080000;
+ UINT8 *ROM = image.device().machine().root_device().memregion("maincpu")->base()+0x080000;
UINT32 length;
if (image.software_entry() != NULL)
@@ -2359,7 +2359,7 @@ static DEVICE_IMAGE_LOAD( stv_cart )
if (image.software_entry() == NULL)
return IMAGE_INIT_FAIL;
- UINT8 *ROM = image.device().machine().region(this_cart->region)->base();
+ UINT8 *ROM = image.device().machine().root_device().memregion(this_cart->region)->base();
UINT32 length = image.get_software_region_length("rom");
memcpy(ROM, image.get_software_region("rom"), length);
diff --git a/src/mame/drivers/sauro.c b/src/mame/drivers/sauro.c
index 04e8b7bc762..864020f4f73 100644
--- a/src/mame/drivers/sauro.c
+++ b/src/mame/drivers/sauro.c
@@ -554,7 +554,7 @@ static DRIVER_INIT( tecfri )
/* This game doesn't like all memory to be initialized to zero, it won't
initialize the high scores */
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
memset(&RAM[0xe000], 0, 0x100);
RAM[0xe000] = 1;
diff --git a/src/mame/drivers/savquest.c b/src/mame/drivers/savquest.c
index d0c71f80dff..a8cde432075 100644
--- a/src/mame/drivers/savquest.c
+++ b/src/mame/drivers/savquest.c
@@ -110,7 +110,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
else // disable RAM access (reads go to BIOS ROM)
{
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base() + 0x20000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base() + 0x20000);
}
break;
}
@@ -531,7 +531,7 @@ static MACHINE_START( savquest )
static MACHINE_RESET( savquest )
{
- machine.root_device().membank("bank1")->set_base(machine.region("bios")->base() + 0x20000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x20000);
}
diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c
index f79fe366da1..149a0d4937d 100644
--- a/src/mame/drivers/sbowling.c
+++ b/src/mame/drivers/sbowling.c
@@ -75,7 +75,7 @@ public:
static TILE_GET_INFO( get_sb_tile_info )
{
sbowling_state *state = machine.driver_data<sbowling_state>();
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = state->memregion("user1")->base();
int tileno = rom[tile_index + state->m_bgmap * 1024];
SET_TILE_INFO(0, tileno, 0, 0);
@@ -342,7 +342,7 @@ GFXDECODE_END
static PALETTE_INIT( sbowling )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_rg[3] = { 470, 270, 100 };
diff --git a/src/mame/drivers/scregg.c b/src/mame/drivers/scregg.c
index fa792f2cf14..ee7c51cd200 100644
--- a/src/mame/drivers/scregg.c
+++ b/src/mame/drivers/scregg.c
@@ -396,7 +396,7 @@ static DRIVER_INIT( rockduck )
{
// rd2.rdh and rd1.rdj are bitswapped, but not rd3.rdg .. are they really from the same board?
int x;
- UINT8 *src = machine.region( "gfx1" )->base();
+ UINT8 *src = machine.root_device().memregion( "gfx1" )->base();
for (x = 0x2000; x < 0x6000; x++)
{
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 1ec556936bb..17c1f5308c1 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -118,8 +118,8 @@ static MACHINE_RESET( segac2 )
/* determine how many sound banks */
state->m_sound_banks = 0;
- if (machine.region("upd")->base())
- state->m_sound_banks = machine.region("upd")->bytes() / 0x20000;
+ if (machine.root_device().memregion("upd")->base())
+ state->m_sound_banks = state->memregion("upd")->bytes() / 0x20000;
/* reset the protection */
state->m_prot_write_buf = 0;
@@ -2088,7 +2088,7 @@ static DRIVER_INIT( ichirj )
static DRIVER_INIT( ichirjbl )
{
/* when did this actually work? - the protection is patched but the new check fails? */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x390/2] = 0x6600;
segac2_common_init(machine, NULL);
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index bcc453a1670..f436851a178 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -437,10 +437,10 @@ WRITE8_MEMBER( systeme_state::bank_write )
void systeme_state::driver_start()
{
/* Allocate video RAM */
- m_vdp1_vram = machine().region_alloc("vdp1_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
- m_vdp2_vram = machine().region_alloc("vdp2_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
+ m_vdp1_vram = machine().memory().region_alloc("vdp1_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
+ m_vdp2_vram = machine().memory().region_alloc("vdp2_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
- membank("bank1")->configure_entries(0, 16, machine().region("maincpu")->base() + 0x10000, 0x4000);
+ membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
if ( !strcmp( system().name, "ridleofp" ) )
{
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index a7d8b59196f..b6ba355d4a3 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -1405,7 +1405,7 @@ static void monsterb_expand_gfx(running_machine &machine, const char *region)
/* expand the background ROMs; A11/A12 of each ROM is independently controlled via */
/* banking */
- dest = machine.region(region)->base();
+ dest = machine.root_device().memregion(region)->base();
temp = auto_alloc_array(machine, UINT8, 0x4000);
memcpy(temp, dest, 0x4000);
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index 9a4e57e066c..c36bce22ec2 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -1762,7 +1762,7 @@ static DRIVER_INIT( enduror )
static DRIVER_INIT( endurobl )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
hangon_generic_init(machine);
@@ -1776,7 +1776,7 @@ static DRIVER_INIT( endurobl )
static DRIVER_INIT( endurob2 )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
hangon_generic_init(machine);
diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c
index e95abeb8f71..158abc5d358 100644
--- a/src/mame/drivers/segald.c
+++ b/src/mame/drivers/segald.c
@@ -597,7 +597,7 @@ ROM_END
static DRIVER_INIT( astron )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 2, &ROM[0x8000], 0x4000);
}
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index 652ee4d2228..1b78acd047a 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -2126,22 +2126,22 @@ static DRIVER_INIT( outrunb )
state->m_custom_io_w = outrun_custom_io_w;
/* main CPU: swap bits 11,12 and 6,7 */
- word = (UINT16 *)machine.region("maincpu")->base();
- length = machine.region("maincpu")->bytes() / 2;
+ word = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ length = machine.root_device().memregion("maincpu")->bytes() / 2;
for (i = 0; i < length; i++)
word[i] = BITSWAP16(word[i], 15,14,11,12,13,10,9,8,6,7,5,4,3,2,1,0);
/* sub CPU: swap bits 14,15 and 2,3 */
- word = (UINT16 *)machine.region("sub")->base();
- length = machine.region("sub")->bytes() / 2;
+ word = (UINT16 *)machine.root_device().memregion("sub")->base();
+ length = machine.root_device().memregion("sub")->bytes() / 2;
for (i = 0; i < length; i++)
word[i] = BITSWAP16(word[i], 14,15,13,12,11,10,9,8,7,6,5,4,2,3,1,0);
/* road gfx */
/* rom a-2.bin: swap bits 6,7 */
/* rom a-3.bin: swap bits 5,6 */
- byte = machine.region("gfx3")->base();
- length = machine.region("gfx3")->bytes() / 2;
+ byte = machine.root_device().memregion("gfx3")->base();
+ length = machine.root_device().memregion("gfx3")->bytes() / 2;
for (i = 0; i < length; i++)
{
byte[i] = BITSWAP8(byte[i], 6,7,5,4,3,2,1,0);
@@ -2149,8 +2149,8 @@ static DRIVER_INIT( outrunb )
}
/* Z80 code: swap bits 5,6 */
- byte = machine.region("soundcpu")->base();
- length = machine.region("soundcpu")->bytes();
+ byte = machine.root_device().memregion("soundcpu")->base();
+ length = machine.root_device().memregion("soundcpu")->bytes();
for (i = 0; i < length; i++)
byte[i] = BITSWAP8(byte[i], 7,5,6,4,3,2,1,0);
}
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index eca68a68fe9..d38bf800ec3 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -451,7 +451,7 @@ static WRITE8_HANDLER( n7751_command_w )
*/
segas1x_state *state = space->machine().driver_data<segas1x_state>();
- int numroms = space->machine().region("n7751data")->bytes() / 0x8000;
+ int numroms = state->memregion("n7751data")->bytes() / 0x8000;
state->m_n7751_rom_address &= 0x3fff;
state->m_n7751_rom_address |= (data & 0x01) << 14;
if (!(data & 0x02) && numroms >= 1) state->m_n7751_rom_address |= 0x00000;
@@ -496,7 +496,7 @@ static READ8_HANDLER( n7751_rom_r )
{
/* read from BUS */
segas1x_state *state = space->machine().driver_data<segas1x_state>();
- return space->machine().region("n7751data")->base()[state->m_n7751_rom_address];
+ return state->memregion("n7751data")->base()[state->m_n7751_rom_address];
}
@@ -973,11 +973,11 @@ static READ8_HANDLER( mcu_io_r )
return maincpu_byte_r(space->machine(), 0x840001 ^ offset);
case 5:
- return space->machine().region("maincpu")->base()[0x00000 + offset];
+ return space->machine().root_device().memregion("maincpu")->base()[0x00000 + offset];
case 6:
- return space->machine().region("maincpu")->base()[0x10000 + offset];
+ return space->machine().root_device().memregion("maincpu")->base()[0x10000 + offset];
case 7:
- return space->machine().region("maincpu")->base()[0x20000 + offset];
+ return state->memregion("maincpu")->base()[0x20000 + offset];
default:
logerror("%03X: MCU movx read mode %02X offset %04X\n",
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index ad7671c583e..c9a06a99cda 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1319,7 +1319,7 @@ static WRITE16_HANDLER( unknown_rgn2_w )
static WRITE8_DEVICE_HANDLER( upd7759_control_w )
{
segas1x_state *state = device->machine().driver_data<segas1x_state>();
- int size = device->machine().region("soundcpu")->bytes() - 0x10000;
+ int size = state->memregion("soundcpu")->bytes() - 0x10000;
if (size > 0)
{
int bankoffs = 0;
@@ -1376,7 +1376,7 @@ static WRITE8_DEVICE_HANDLER( upd7759_control_w )
bankoffs += (data & 0x07) * 0x04000;
break;
}
- state->membank("bank1")->set_base(device->machine().region("soundcpu")->base() + 0x10000 + (bankoffs % size));
+ state->membank("bank1")->set_base(device->machine().root_device().memregion("soundcpu")->base() + 0x10000 + (bankoffs % size));
}
}
@@ -6822,8 +6822,8 @@ static WRITE16_HANDLER( isgsm_cart_addr_low_w )
// when reading from this port the data is xored by a fixed value depending on the cart
static READ16_HANDLER( isgsm_cart_data_r )
{
- int size = space->machine().region("gamecart_rgn")->bytes();
- UINT8* rgn = space->machine().region("gamecart_rgn")->base();
+ int size = space->machine().root_device().memregion("gamecart_rgn")->bytes();
+ UINT8* rgn = space->machine().root_device().memregion("gamecart_rgn")->base();
isgsm_cart_addr++;
@@ -6847,16 +6847,16 @@ static WRITE16_HANDLER( isgsm_data_w )
switch (isgsm_type&0x0f)
{
- case 0x0: dest = space->machine().region("gfx2")->base();
+ case 0x0: dest = space->machine().root_device().memregion("gfx2")->base();
break;
- case 0x1: dest = space->machine().region("gfx1")->base();
+ case 0x1: dest = space->machine().root_device().memregion("gfx1")->base();
break;
- case 0x2: dest = space->machine().region("soundcpu")->base();
+ case 0x2: dest = space->machine().root_device().memregion("soundcpu")->base();
break;
- case 0x3: dest = space->machine().region("maincpu")->base();
+ case 0x3: dest = space->machine().root_device().memregion("maincpu")->base();
break;
default: // no other cases?
@@ -6967,7 +6967,7 @@ static WRITE16_HANDLER( isgsm_data_w )
dest[isgsm_addr] = byte;
- if (dest == space->machine().region("gfx1")->base())
+ if (dest == space->machine().root_device().memregion("gfx1")->base())
{
// we need to re-decode the tiles if writing to this area to keep MAME happy
@@ -7061,14 +7061,14 @@ static WRITE16_HANDLER( isgsm_main_bank_change_w )
// other values on real hw have strange results, change memory mapping etc??
if (data==1)
{
- space->machine().root_device().membank(ISGSM_MAIN_BANK)->set_base(space->machine().region("maincpu")->base());
+ space->machine().root_device().membank(ISGSM_MAIN_BANK)->set_base(space->machine().root_device().memregion("maincpu")->base());
}
}
static MACHINE_START( isgsm )
{
- machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.region("gamecart_rgn")->base());
- machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.region("bios")->base());
+ machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.root_device().memregion("gamecart_rgn")->base());
+ machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.root_device().memregion("bios")->base());
}
static ADDRESS_MAP_START( isgsm_map, AS_PROGRAM, 16, segas1x_state )
@@ -7219,8 +7219,8 @@ static MACHINE_RESET( isgsm )
for (int i = 0; i < 16; i++)
segaic16_sprites_set_bank(machine, 0, i, i);
- machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.region("gamecart_rgn")->base());
- machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.region("bios")->base());
+ machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.root_device().memregion("gamecart_rgn")->base());
+ machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.root_device().memregion("bios")->base());
devtag_reset( machine, "maincpu" );
}
@@ -7248,7 +7248,7 @@ DRIVER_INIT( isgsm )
// decrypt the bios...
UINT16* temp = (UINT16*)malloc(0x20000);
- UINT16* rom = (UINT16*)machine.region("bios")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("bios")->base();
int i;
for (i=0;i<0x10000;i++)
@@ -7265,7 +7265,7 @@ DRIVER_INIT( shinfz )
DRIVER_INIT_CALL( isgsm );
UINT16* temp = (UINT16*)malloc(0x200000);
- UINT16* rom = (UINT16*)machine.region("gamecart_rgn")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("gamecart_rgn")->base();
int i;
for (i=0;i<0x100000;i++)
@@ -7285,7 +7285,7 @@ DRIVER_INIT( tetrbx )
DRIVER_INIT_CALL( isgsm );
UINT16* temp = (UINT16*)malloc(0x80000);
- UINT16* rom = (UINT16*)machine.region("gamecart_rgn")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("gamecart_rgn")->base();
int i;
for (i=0;i<0x80000/2;i++)
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index abfb12d60e6..68993a569aa 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -429,7 +429,7 @@ static WRITE16_HANDLER( rom_5987_bank_w )
/* sprite banking */
else
{
- int maxbanks = space->machine().region("gfx2")->bytes() / 0x40000;
+ int maxbanks = space->machine().root_device().memregion("gfx2")->bytes() / 0x40000;
if (data >= maxbanks)
data = 255;
segaic16_sprites_set_bank(space->machine(), 0, (offset - 8) * 2 + 0, data * 2 + 0);
@@ -587,7 +587,7 @@ static WRITE16_HANDLER( wwally_custom_io_w )
static WRITE8_HANDLER( soundbank_w )
{
- space->machine().root_device().membank("bank1")->set_base(space->machine().region("soundcpu")->base() + 0x10000 + 0x2000 * data);
+ space->machine().root_device().membank("bank1")->set_base(space->machine().root_device().memregion("soundcpu")->base() + 0x10000 + 0x2000 * data);
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index d64e43e9fed..a8ca2a33b83 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -433,7 +433,7 @@ WRITE16_MEMBER( segas24_state::fdc_w )
break;
case 0x9:
logerror("Read multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track);
- fdc_pt = machine().region("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
+ fdc_pt = memregion("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
fdc_span = track_size;
fdc_status = 3;
fdc_drq = 1;
@@ -441,7 +441,7 @@ WRITE16_MEMBER( segas24_state::fdc_w )
break;
case 0xb:
logerror("Write multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track);
- fdc_pt = machine().region("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
+ fdc_pt = memregion("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
fdc_span = track_size;
fdc_status = 3;
fdc_drq = 1;
@@ -712,7 +712,7 @@ void segas24_state::reset_control_w(UINT8 data)
void segas24_state::reset_bank()
{
- if (machine().region("romboard")->base())
+ if (machine().root_device().memregion("romboard")->base())
{
membank("bank1")->set_entry(curbank & 15);
membank("bank2")->set_entry(curbank & 15);
@@ -1262,9 +1262,9 @@ static MACHINE_START( system24 )
{
segas24_state *state = machine.driver_data<segas24_state>();
if (state->track_size)
- machine.device<nvram_device>("floppy_nvram")->set_base(machine.region("floppy")->base(), 2*state->track_size);
+ machine.device<nvram_device>("floppy_nvram")->set_base(machine.root_device().memregion("floppy")->base(), 2*state->track_size);
- UINT8 *usr1 = machine.region("romboard")->base();
+ UINT8 *usr1 = state->memregion("romboard")->base();
if (usr1)
{
state->membank("bank1")->configure_entries(0, 16, usr1, 0x40000);
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 80a79503764..acd05e67954 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -1130,14 +1130,14 @@ static void ym3438_irq_handler(device_t *device, int state)
WRITE8_MEMBER(segas32_state::sound_bank_lo_w)
{
m_sound_bank = (m_sound_bank & ~0x3f) | (data & 0x3f);
- membank("bank1")->set_base(machine().region("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
+ membank("bank1")->set_base(machine().root_device().memregion("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
}
WRITE8_MEMBER(segas32_state::sound_bank_hi_w)
{
m_sound_bank = (m_sound_bank & 0x3f) | ((data & 0x04) << 4) | ((data & 0x03) << 7);
- membank("bank1")->set_base(machine().region("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
+ membank("bank1")->set_base(machine().root_device().memregion("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
}
@@ -4145,7 +4145,7 @@ static DRIVER_INIT( jpark )
{
segas32_state *state = machine.driver_data<segas32_state>();
/* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */
- UINT16 *pROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *pROM = (UINT16 *)state->memregion("maincpu")->base();
segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state));
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index dbd7fc8b4f2..17998afe9e9 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -995,8 +995,8 @@ READ8_MEMBER(seibuspi_state::z80_coin_r)
READ32_MEMBER(seibuspi_state::soundrom_r)
{
- UINT8 *sound = (UINT8*)machine().region("user2")->base();
- UINT16 *sound16 = (UINT16*)machine().region("user2")->base();
+ UINT8 *sound = (UINT8*)machine().root_device().memregion("user2")->base();
+ UINT16 *sound16 = (UINT16*)machine().root_device().memregion("user2")->base();
if (mem_mask == 0x000000ff)
{
@@ -1812,9 +1812,9 @@ static MACHINE_RESET( spi )
{
seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
- UINT8 *sound = machine.region("ymf")->base();
+ UINT8 *sound = machine.root_device().memregion("ymf")->base();
- UINT8 *rombase = machine.region("user1")->base();
+ UINT8 *rombase = state->memregion("user1")->base();
UINT8 flash_data = rombase[0x1ffffc];
cputag_set_input_line(machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE );
@@ -1897,7 +1897,7 @@ static MACHINE_START( sxx2f )
static MACHINE_RESET( sxx2f )
{
seibuspi_state *state = machine.driver_data<seibuspi_state>();
- UINT8 *rom = machine.region("soundcpu")->base();
+ UINT8 *rom = state->memregion("soundcpu")->base();
state->membank("bank4")->set_base(state->m_z80_rom);
state->membank("bank5")->set_base(state->m_z80_rom);
@@ -2075,9 +2075,9 @@ static void init_spi(running_machine &machine)
state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0");
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
- seibuspi_text_decrypt(machine.region("gfx1")->base());
- seibuspi_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
- seibuspi_sprite_decrypt(machine.region("gfx3")->base(), 0x400000);
+ seibuspi_text_decrypt(machine.root_device().memregion("gfx1")->base());
+ seibuspi_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_sprite_decrypt(state->memregion("gfx3")->base(), 0x400000);
}
static DRIVER_INIT( rdft )
@@ -2146,9 +2146,9 @@ static void init_rf2(running_machine &machine)
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0282AC, 0x0282AF, read32_delegate(FUNC(seibuspi_state::rf2_speedup_r),state));
- seibuspi_rise10_text_decrypt(machine.region("gfx1")->base());
- seibuspi_rise10_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
- seibuspi_rise10_sprite_decrypt(machine.region("gfx3")->base(), 0x600000);
+ seibuspi_rise10_text_decrypt(machine.root_device().memregion("gfx1")->base());
+ seibuspi_rise10_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_rise10_sprite_decrypt(state->memregion("gfx3")->base(), 0x600000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
}
@@ -2171,9 +2171,9 @@ static void init_rfjet(running_machine &machine)
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x002894c, 0x002894f, read32_delegate(FUNC(seibuspi_state::rfjet_speedup_r),state));
- seibuspi_rise11_text_decrypt(machine.region("gfx1")->base());
- seibuspi_rise11_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
- seibuspi_rise11_sprite_decrypt_rfjet(machine.region("gfx3")->base(), 0x800000);
+ seibuspi_rise11_text_decrypt(machine.root_device().memregion("gfx1")->base());
+ seibuspi_rise11_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_rise11_sprite_decrypt_rfjet(state->memregion("gfx3")->base(), 0x800000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
}
@@ -2237,11 +2237,11 @@ MACHINE_CONFIG_END
static DRIVER_INIT( sys386f2 )
{
int i, j;
- UINT16 *src = (UINT16 *)machine.region("gfx3")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("gfx3")->base();
UINT16 tmp[0x40 / 2], Offset;
// sprite_reorder() only
- for(i = 0; i < machine.region("gfx3")->bytes() / 0x40; i++)
+ for(i = 0; i < machine.root_device().memregion("gfx3")->bytes() / 0x40; i++)
{
memcpy(tmp, src, 0x40);
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index e3f51c7302f..2b352030c3b 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -2975,7 +2975,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(seta_state::sub_bankswitch_w)
{
- UINT8 *rom = machine().region("sub")->base();
+ UINT8 *rom = memregion("sub")->base();
int bank = data >> 4;
membank("bank1")->set_base(&rom[bank * 0x4000 + 0xc000]);
@@ -10533,7 +10533,7 @@ static DRIVER_INIT( arbalest )
static DRIVER_INIT( metafox )
{
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
/* This game uses the 21c000-21ffff area for protection? */
// machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x21c000, 0x21ffff);
@@ -10556,7 +10556,7 @@ static DRIVER_INIT ( blandia )
rom_size = 0x80000;
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("gfx2")->base() + 0x40000;
+ rom = machine.root_device().memregion("gfx2")->base() + 0x40000;
for (rpos = 0; rpos < rom_size/2; rpos++) {
buf[rpos+0x40000] = rom[rpos*2];
@@ -10565,7 +10565,7 @@ static DRIVER_INIT ( blandia )
memcpy( rom, buf, rom_size );
- rom = machine.region("gfx3")->base() + 0x40000;
+ rom = machine.root_device().memregion("gfx3")->base() + 0x40000;
for (rpos = 0; rpos < rom_size/2; rpos++) {
buf[rpos+0x40000] = rom[rpos*2];
@@ -10594,7 +10594,7 @@ static DRIVER_INIT( zombraid )
static DRIVER_INIT( kiwame )
{
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
/* WARNING: This game writes to the interrupt vector
table. Lev 1 routine address is stored at $100 */
@@ -10616,8 +10616,8 @@ static DRIVER_INIT( wiggie )
UINT8 temp[16];
int i,j;
- src = machine.region("maincpu")->base();
- len = machine.region("maincpu")->bytes();
+ src = machine.root_device().memregion("maincpu")->base();
+ len = machine.root_device().memregion("maincpu")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -10647,7 +10647,7 @@ static DRIVER_INIT( wiggie )
static DRIVER_INIT( crazyfgt )
{
//seta_state *state = machine.driver_data<seta_state>();
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
// protection check at boot
RAM[0x1078/2] = 0x4e71;
@@ -10666,7 +10666,7 @@ static DRIVER_INIT( crazyfgt )
static DRIVER_INIT( inttoote )
{
//seta_state *state = machine.driver_data<seta_state>();
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// missing / unused video regs
seta_state *state = machine.driver_data<seta_state>();
@@ -10682,7 +10682,7 @@ static DRIVER_INIT( inttoote )
static DRIVER_INIT( inttootea )
{
//seta_state *state = machine.driver_data<seta_state>();
- //UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ //UINT16 *ROM = (UINT16 *)state->memregion( "maincpu" )->base();
// missing / unused video regs
seta_state *state = machine.driver_data<seta_state>();
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index 20c090c3d03..d7988e4a19e 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -122,8 +122,8 @@ WRITE16_MEMBER(seta2_state::seta2_sound_bank_w)
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *ROM = machine().region( "x1snd" )->base();
- int banks = (machine().region( "x1snd" )->bytes() - 0x100000) / 0x20000;
+ UINT8 *ROM = memregion( "x1snd" )->base();
+ int banks = (machine().root_device().memregion( "x1snd" )->bytes() - 0x100000) / 0x20000;
if (data >= banks)
{
logerror("CPU #0 PC %06X: invalid sound bank %04X\n",cpu_get_pc(&space.device()),data);
@@ -325,7 +325,7 @@ ADDRESS_MAP_END
READ16_MEMBER(seta2_state::pzlbowl_protection_r)
{
UINT32 address = (space.read_word(0x20ba16) << 16) | space.read_word(0x20ba18);
- return machine().region("maincpu")->base()[address - 2];
+ return memregion("maincpu")->base()[address - 2];
}
READ16_MEMBER(seta2_state::pzlbowl_coins_r)
@@ -2408,8 +2408,8 @@ ROM_END
static DRIVER_INIT( funcube2 )
{
- UINT32 *main_cpu = (UINT32 *) machine.region("maincpu")->base();
- UINT16 *sub_cpu = (UINT16 *) machine.region("sub")->base();
+ UINT32 *main_cpu = (UINT32 *) machine.root_device().memregion("maincpu")->base();
+ UINT16 *sub_cpu = (UINT16 *) machine.root_device().memregion("sub")->base();
main_cpu[0xa5c/4] = 0x4e713e3c; // PIC protection?
main_cpu[0xa74/4] = 0x4e713e3c;
@@ -2421,8 +2421,8 @@ static DRIVER_INIT( funcube2 )
static DRIVER_INIT( funcube3 )
{
- UINT32 *main_cpu = (UINT32 *) machine.region("maincpu")->base();
- UINT16 *sub_cpu = (UINT16 *) machine.region("sub")->base();
+ UINT32 *main_cpu = (UINT32 *) machine.root_device().memregion("maincpu")->base();
+ UINT16 *sub_cpu = (UINT16 *) machine.root_device().memregion("sub")->base();
main_cpu[0x008bc/4] = 0x4a804e71;
main_cpu[0x19f0c/4] = 0x4e714e71;
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index 879a3d5bc54..a22bf375f8f 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -173,7 +173,7 @@ READ16_MEMBER(sf_state::button2_r)
WRITE8_MEMBER(sf_state::sound2_bank_w)
{
- membank("bank1")->set_base(machine().region("audio2")->base() + 0x8000 * (data + 1));
+ membank("bank1")->set_base(machine().root_device().memregion("audio2")->base() + 0x8000 * (data + 1));
}
diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c
index 8a4696b196c..3b5fa927019 100644
--- a/src/mame/drivers/sfbonus.c
+++ b/src/mame/drivers/sfbonus.c
@@ -1080,7 +1080,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sfbonus_state::sfbonus_bank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
UINT8 bank;
bank = data & 7;
@@ -1214,7 +1214,7 @@ GFXDECODE_END
static MACHINE_RESET( sfbonus )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&ROM[0]);
}
@@ -1233,12 +1233,12 @@ static NVRAM_HANDLER( sfbonus )
}
else
{
- UINT8* defaultram = machine.region("defaults")->base();
+ UINT8* defaultram = machine.root_device().memregion("defaults")->base();
memset(state->m_nvram,0x00,state->m_nvram.bytes());
if (defaultram)
if ((defaultram[0x02]==0x00) && (defaultram[0x03]==0x00)) // hack! rom region optional regions get cleared with garbage if no rom is present, this is not good!
- memcpy(state->m_nvram, machine.region("defaults")->base(), machine.region("defaults")->bytes());
+ memcpy(state->m_nvram, machine.root_device().memregion("defaults")->base(), machine.root_device().memregion("defaults")->bytes());
}
}
}
@@ -5733,9 +5733,9 @@ static DRIVER_INIT( sfbonus_common)
// dummy.rom helper
{
- UINT8 *ROM = machine.region("maincpu")->base();
- int length = machine.region("maincpu")->bytes();
- UINT8* ROM2 = machine.region("user1")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
+ UINT8* ROM2 = state->memregion("user1")->base();
if (ROM2)
{
@@ -5785,9 +5785,9 @@ static void sfbonus_bitswap( running_machine& machine,
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
- for(i = 0; i < machine.region("maincpu")->bytes(); i++)
+ for(i = 0; i < machine.root_device().memregion("maincpu")->bytes(); i++)
{
UINT8 x = ROM[i];
diff --git a/src/mame/drivers/sfkick.c b/src/mame/drivers/sfkick.c
index 8a027043d4b..ff9b7ec84b7 100644
--- a/src/mame/drivers/sfkick.c
+++ b/src/mame/drivers/sfkick.c
@@ -108,7 +108,7 @@ static void sfkick_remap_banks(running_machine &machine)
{
case 0: /* bios */
{
- UINT8 *mem = machine.region("bios")->base();
+ UINT8 *mem = state->memregion("bios")->base();
state->membank("bank1")->set_base(mem);
state->membank("bank2")->set_base(mem+0x2000);
}
@@ -116,7 +116,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 1: /* ext rom */
{
- UINT8 *mem = machine.region("extrom")->base();
+ UINT8 *mem = machine.root_device().memregion("extrom")->base();
state->membank("bank1")->set_base(mem+0x4000);
state->membank("bank2")->set_base(mem+0x6000);
}
@@ -124,7 +124,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank1")->set_base(mem+0x2000*state->m_bank[0]);
state->membank("bank2")->set_base(mem+0x2000*state->m_bank[1]);
}
@@ -132,7 +132,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 3: /* unknown */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank1")->set_base(mem+0x18000);
state->membank("bank2")->set_base(mem+0x18000);
}
@@ -144,7 +144,7 @@ static void sfkick_remap_banks(running_machine &machine)
{
case 0: /* bios - upper part */
{
- UINT8 *mem = machine.region("bios")->base();
+ UINT8 *mem = machine.root_device().memregion("bios")->base();
state->membank("bank3")->set_base(mem+0x4000);
state->membank("bank4")->set_base(mem+0x6000);
}
@@ -153,7 +153,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 1: /* unknown */
case 3:
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank3")->set_base(mem+0x18000);
state->membank("bank4")->set_base(mem+0x18000);
}
@@ -161,7 +161,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank3")->set_base(mem+0x2000*state->m_bank[2]);
state->membank("bank4")->set_base(mem+0x2000*state->m_bank[3]);
}
@@ -173,7 +173,7 @@ static void sfkick_remap_banks(running_machine &machine)
{
case 0: /* cartridge */
{
- UINT8 *mem = machine.region("cartridge")->base();
+ UINT8 *mem = machine.root_device().memregion("cartridge")->base();
state->membank("bank5")->set_base(mem+0x4000);
state->membank("bank6")->set_base(mem+0x6000);
}
@@ -182,7 +182,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 1: /* unknown */
case 3:
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank5")->set_base(mem+0x18000);
state->membank("bank6")->set_base(mem+0x18000);
}
@@ -190,7 +190,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank5")->set_base(mem+0x2000*state->m_bank[4]);
state->membank("bank6")->set_base(mem+0x2000*state->m_bank[5]);
}
@@ -203,7 +203,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 0: /* unknown */
case 1:
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank7")->set_base(mem+0x18000);
state->membank("bank8")->set_base(mem+0x18000);
}
@@ -211,7 +211,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank7")->set_base(mem+0x2000*state->m_bank[6]);
state->membank("bank8")->set_base(mem+0x2000*state->m_bank[7]);
}
diff --git a/src/mame/drivers/shangha3.c b/src/mame/drivers/shangha3.c
index b3a216b34dd..d527e119f5b 100644
--- a/src/mame/drivers/shangha3.c
+++ b/src/mame/drivers/shangha3.c
@@ -58,7 +58,7 @@ WRITE16_MEMBER(shangha3_state::shangha3_prot_w)
READ16_MEMBER(shangha3_state::heberpop_gfxrom_r)
{
- UINT8 *ROM = machine().region("gfx1")->base();
+ UINT8 *ROM = memregion("gfx1")->base();
return ROM[2*offset] | (ROM[2*offset+1] << 8);
}
diff --git a/src/mame/drivers/shangkid.c b/src/mame/drivers/shangkid.c
index 3e70aee0e31..b13ea64c790 100644
--- a/src/mame/drivers/shangkid.c
+++ b/src/mame/drivers/shangkid.c
@@ -134,8 +134,8 @@ static DRIVER_INIT( shangkid )
state->m_gfx_type = 1;
/* set up banking */
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x8000, 0x8000);
- state->membank("bank2")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x0000, 0x10000);
+ state->membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x8000, 0x8000);
+ state->membank("bank2")->configure_entries(0, 2, state->memregion("audiocpu")->base() + 0x0000, 0x10000);
}
/***************************************************************************************/
diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c
index c4ee7e5f0cb..6174093d35a 100644
--- a/src/mame/drivers/shootout.c
+++ b/src/mame/drivers/shootout.c
@@ -409,9 +409,9 @@ ROM_END
static DRIVER_INIT( shootout )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- int length = machine.region("maincpu")->bytes();
+ int length = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length - 0x8000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
space->set_decrypted_region(0x8000, 0xffff, decrypt);
@@ -419,13 +419,13 @@ static DRIVER_INIT( shootout )
for (A = 0x8000;A < length;A++)
decrypt[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x40) >> 1) | ((rom[A] & 0x20) << 1);
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x8000, 0x4000);
}
static DRIVER_INIT( shootouj )
{
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c
index 4431ed2ec68..ff1c67e9bdb 100644
--- a/src/mame/drivers/shougi.c
+++ b/src/mame/drivers/shougi.c
@@ -133,7 +133,7 @@ public:
static PALETTE_INIT( shougi )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_b[2] = { 470, 220 };
static const int resistances_rg[3] = { 1000, 470, 220 };
diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c
index 7cd9525aefd..c2f12b7dee5 100644
--- a/src/mame/drivers/sidearms.c
+++ b/src/mame/drivers/sidearms.c
@@ -44,7 +44,7 @@ Notes:
WRITE8_MEMBER(sidearms_state::sidearms_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
/* bits 0 and 1 select the ROM bank */
@@ -124,7 +124,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sidearms_state::whizz_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bank = 0;
switch (data & 0xC0)
diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c
index fe49a60b24c..c9cd6430724 100644
--- a/src/mame/drivers/sigmab52.c
+++ b/src/mame/drivers/sigmab52.c
@@ -294,7 +294,7 @@ READ8_MEMBER(sigmab52_state::unk_f700_r)
WRITE8_MEMBER(sigmab52_state::unk_f710_w)
{
- membank("bank1" )->set_base(&machine().region("maincpu")->base()[0x10000 + ((data&0x80)?0x4000:0x0000)]);
+ membank("bank1" )->set_base(&machine().root_device().memregion("maincpu")->base()[0x10000 + ((data&0x80)?0x4000:0x0000)]);
}
READ8_MEMBER(sigmab52_state::unk_f721_r)
@@ -542,11 +542,11 @@ static INTERRUPT_GEN( timer_irq )
static MACHINE_START(jwildb52)
{
- machine.root_device().membank("bank1")->set_base(&machine.region("maincpu")->base()[0x10000 + 0x0000]);
+ machine.root_device().membank("bank1")->set_base(&machine.root_device().memregion("maincpu")->base()[0x10000 + 0x0000]);
- machine.root_device().membank("bank2")->set_base(&machine.region("maincpu")->base()[0x10000 + 0xf800]);
+ machine.root_device().membank("bank2")->set_base(&machine.root_device().memregion("maincpu")->base()[0x10000 + 0xf800]);
- machine.root_device().membank("bank3")->set_base(&machine.region("maincpu")->base()[0x10000 + 0x8000]);
+ machine.root_device().membank("bank3")->set_base(&machine.root_device().memregion("maincpu")->base()[0x10000 + 0x8000]);
/*
@@ -560,7 +560,7 @@ static MACHINE_START(jwildb52)
*/
{
- UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("gfx1")->base();
int i;
device_t *hd63484 = machine.device("hd63484");
diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c
index b0a9bb517d1..8dbba694a03 100644
--- a/src/mame/drivers/sigmab98.c
+++ b/src/mame/drivers/sigmab98.c
@@ -542,7 +542,7 @@ WRITE8_MEMBER(sigmab98_state::animalc_rombank_w)
return;
}
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
switch ( m_reg )
{
case 0x0f:
@@ -898,7 +898,7 @@ READ8_MEMBER(sigmab98_state::haekaka_b000_r)
case 0x1d:
case 0x1e:
case 0x1f:
- return machine().region("maincpu")->base()[offset + 0xb400 + 0x1000 * (m_rombank-0x10)];
+ return memregion("maincpu")->base()[offset + 0xb400 + 0x1000 * (m_rombank-0x10)];
case 0x65: // SPRITERAM
if (offset < 0x1000)
@@ -1010,7 +1010,7 @@ WRITE8_MEMBER(sigmab98_state::itazuram_rombank_w)
return;
}
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
switch ( m_reg )
{
case 0x0d:
@@ -1374,7 +1374,7 @@ READ8_MEMBER(sigmab98_state::tdoboon_c000_r)
case 0x1d:
case 0x1e:
case 0x1f:
- return machine().region("maincpu")->base()[offset + 0xc400 + 0x1000 * (m_rombank-0x10)];
+ return memregion("maincpu")->base()[offset + 0xc400 + 0x1000 * (m_rombank-0x10)];
case 0x64: // SPRITERAM
if (offset < 0x1000)
@@ -1897,7 +1897,7 @@ ROM_END
static DRIVER_INIT( gegege )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// Protection?
rom[0x0bdd] = 0xc9;
@@ -1946,7 +1946,7 @@ ROM_END
static DRIVER_INIT( pepsiman )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// Protection?
rom[0x058a] = 0xc9;
@@ -1997,7 +1997,7 @@ ROM_END
static DRIVER_INIT( ucytokyu )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// Protection?
rom[0x0bfa] = 0xc9;
@@ -2150,7 +2150,7 @@ static DRIVER_INIT( itazuram )
{
sigmab98_state *state = machine.driver_data<sigmab98_state>();
// ROM banks
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->membank("rombank0")->set_base(rom + 0x3400);
state->membank("rombank1")->set_base(rom + 0x4400);
state->m_rombank = 0x0f;
diff --git a/src/mame/drivers/silkroad.c b/src/mame/drivers/silkroad.c
index 4a44dfc3806..21ace1bc908 100644
--- a/src/mame/drivers/silkroad.c
+++ b/src/mame/drivers/silkroad.c
@@ -327,7 +327,7 @@ static DRIVER_INIT( silkroad )
verified as correct... problem with the original which the gfx
hardware didn't care about? */
- UINT8 *src = machine.region("gfx1")->base()+0x1000000;
+ UINT8 *src = machine.root_device().memregion("gfx1")->base()+0x1000000;
int len = 0x0200000;
UINT8 *buffer;
diff --git a/src/mame/drivers/silvmil.c b/src/mame/drivers/silvmil.c
index 036870fa9f3..af2de9792ef 100644
--- a/src/mame/drivers/silvmil.c
+++ b/src/mame/drivers/silvmil.c
@@ -409,8 +409,8 @@ ROM_END
static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 7144369b2ae..5f5edaef491 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -1022,8 +1022,8 @@ ROM_END
static DRIVER_INIT( simpl156 )
{
- UINT8 *rom = machine.region("okimusic")->base();
- int length = machine.region("okimusic")->bytes();
+ UINT8 *rom = machine.root_device().memregion("okimusic")->base();
+ int length = machine.root_device().memregion("okimusic")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c
index 11f99fe0078..b1ea7c1319c 100644
--- a/src/mame/drivers/skimaxx.c
+++ b/src/mame/drivers/skimaxx.c
@@ -138,8 +138,8 @@ READ32_MEMBER(skimaxx_state::skimaxx_blitter_r)
static VIDEO_START( skimaxx )
{
skimaxx_state *state = machine.driver_data<skimaxx_state>();
- state->m_blitter_gfx = (UINT16 *) machine.region( "blitter" )->base();
- state->m_blitter_gfx_len = machine.region( "blitter" )->bytes() / 2;
+ state->m_blitter_gfx = (UINT16 *) machine.root_device().memregion( "blitter" )->base();
+ state->m_blitter_gfx_len = state->memregion( "blitter" )->bytes() / 2;
state->m_bg_buffer = auto_alloc_array(machine, UINT32, 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2); // 2 buffers
state->m_bg_buffer_back = state->m_bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 0;
diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c
index d8b347c6356..7984c6d0be6 100644
--- a/src/mame/drivers/skullxbo.c
+++ b/src/mame/drivers/skullxbo.c
@@ -619,7 +619,7 @@ ROM_END
static DRIVER_INIT( skullxbo )
{
atarijsa_init(machine, "FF5802", 0x0080);
- memset(machine.region("gfx1")->base() + 0x170000, 0, 0x20000);
+ memset(machine.root_device().memregion("gfx1")->base() + 0x170000, 0, 0x20000);
}
diff --git a/src/mame/drivers/skyarmy.c b/src/mame/drivers/skyarmy.c
index c30ac7d8648..417d530db7c 100644
--- a/src/mame/drivers/skyarmy.c
+++ b/src/mame/drivers/skyarmy.c
@@ -87,7 +87,7 @@ WRITE8_MEMBER(skyarmy_state::skyarmy_colorram_w)
static PALETTE_INIT( skyarmy )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 32;i++)
diff --git a/src/mame/drivers/skyfox.c b/src/mame/drivers/skyfox.c
index 52bc699d282..4a9c301262d 100644
--- a/src/mame/drivers/skyfox.c
+++ b/src/mame/drivers/skyfox.c
@@ -432,8 +432,8 @@ ROM_END
/* Untangle the graphics: cut each 32x32x8 tile in 16 8x8x8 tiles */
static DRIVER_INIT( skyfox )
{
- UINT8 *RAM = machine.region("gfx1")->base();
- UINT8 *end = RAM + machine.region("gfx1")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("gfx1")->base();
+ UINT8 *end = RAM + machine.root_device().memregion("gfx1")->bytes();
UINT8 buf[32 * 32];
while (RAM < end)
diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c
index 91ed7aa8bdc..5997ab03506 100644
--- a/src/mame/drivers/skykid.c
+++ b/src/mame/drivers/skykid.c
@@ -92,7 +92,7 @@ static MACHINE_START( skykid )
{
skykid_state *state = machine.driver_data<skykid_state>();
/* configure the banks */
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x10000, 0x2000);
state_save_register_global(machine, state->m_inputport_selected);
}
@@ -638,7 +638,7 @@ static DRIVER_INIT( skykid )
int i;
/* unpack the third sprite ROM */
- rom = machine.region("gfx3")->base() + 0x4000;
+ rom = machine.root_device().memregion("gfx3")->base() + 0x4000;
for (i = 0;i < 0x2000;i++)
{
rom[i + 0x4000] = rom[i]; // sprite set #1, plane 3
diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c
index 28d78435b61..bf014700219 100644
--- a/src/mame/drivers/slapfght.c
+++ b/src/mame/drivers/slapfght.c
@@ -1829,7 +1829,7 @@ static DRIVER_INIT( getstarj )
static DRIVER_INIT( gtstarb1 )
{
slapfght_state *state = machine.driver_data<slapfght_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->m_getstar_id = GTSTARB1;
getstar_init(machine);
diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c
index 9163651d2a2..83c7a7180d2 100644
--- a/src/mame/drivers/slapshot.c
+++ b/src/mame/drivers/slapshot.c
@@ -524,7 +524,7 @@ static MACHINE_START( slapshot )
{
slapshot_state *state = machine.driver_data<slapshot_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
@@ -730,8 +730,8 @@ ROM_END
static DRIVER_INIT( slapshot )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx2")->base();
- int size = machine.region("gfx2")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx2")->base();
+ int size = machine.root_device().memregion("gfx2")->bytes();
int data;
offset = size / 2;
diff --git a/src/mame/drivers/sliver.c b/src/mame/drivers/sliver.c
index 76a2eb20602..59ba3f18f18 100644
--- a/src/mame/drivers/sliver.c
+++ b/src/mame/drivers/sliver.c
@@ -165,7 +165,7 @@ static void blit_gfx(running_machine &machine)
{
sliver_state *state = machine.driver_data<sliver_state>();
int tmpptr=0;
- const UINT8 *rom = machine.region("user1")->base();
+ const UINT8 *rom = state->memregion("user1")->base();
while (tmpptr < state->m_fptr)
{
@@ -239,7 +239,7 @@ static void render_jpeg(running_machine &machine)
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
- jpeg_mem_src(&cinfo, machine.region("user2")->base()+addr, machine.region("user2")->bytes()-addr);
+ jpeg_mem_src(&cinfo, machine.root_device().memregion("user2")->base()+addr, machine.root_device().memregion("user2")->bytes()-addr);
jpeg_read_header(&cinfo, TRUE);
jpeg_start_decompress(&cinfo);
@@ -349,7 +349,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sliver_state::oki_setbank)
{
- UINT8 *sound = machine().region("oki")->base();
+ UINT8 *sound = memregion("oki")->base();
int bank=(data^0xff)&3; //xor or not ?
memcpy(sound+0x20000, sound+0x100000+0x20000*bank, 0x20000);
}
diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c
index 4c93fcae745..96cf5a19721 100644
--- a/src/mame/drivers/slotcarn.c
+++ b/src/mame/drivers/slotcarn.c
@@ -112,9 +112,9 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine().region("gfx1")->base();
- gfx[1] = device->machine().region("gfx2")->base();
- rlen = device->machine().region("gfx2")->bytes();
+ gfx[0] = device->machine().root_device().memregion("gfx1")->base();
+ gfx[1] = device->machine().root_device().memregion("gfx2")->base();
+ rlen = state->memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
for (cx = 0; cx < x_count; cx++)
diff --git a/src/mame/drivers/sms.c b/src/mame/drivers/sms.c
index ef194ac1284..7312bf54a24 100644
--- a/src/mame/drivers/sms.c
+++ b/src/mame/drivers/sms.c
@@ -533,7 +533,7 @@ ADDRESS_MAP_END
static MACHINE_START( sms )
{
smsmfg_state *state = machine.driver_data<smsmfg_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("questions")->base(), 0x4000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("questions")->base(), 0x4000);
state_save_register_global(machine, state->m_communication_port_status);
state_save_register_global_array(machine, state->m_communication_port);
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index 77b3638812d..c75ca0fa7ed 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -650,7 +650,7 @@ static DRIVER_INIT(kinstb)
{
snesb_state *state = machine.driver_data<snesb_state>();
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = state->memregion("user3")->base();
for (i = 0; i < 0x400000; i++)
{
@@ -671,7 +671,7 @@ static DRIVER_INIT(kinstb)
static DRIVER_INIT( ffight2b )
{
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
for(i = 0; i < 0x200000; i++)
{
@@ -715,7 +715,7 @@ static DRIVER_INIT( ffight2b )
static DRIVER_INIT( iron )
{
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
for (i = 0; i < 0x140000; i++)
{
@@ -740,7 +740,7 @@ static DRIVER_INIT( iron )
static DRIVER_INIT( denseib )
{
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
INT32 i;
for (i = 0; i < 0x200000; i++)
@@ -790,8 +790,8 @@ static const UINT8 address_substitution_high[] =
static DRIVER_INIT( sblast2b )
{
int i, cipherText, plainText, newAddress;
- UINT8 *src = machine.region("user7")->base();
- UINT8 *dst = machine.region("user3")->base();
+ UINT8 *src = machine.root_device().memregion("user7")->base();
+ UINT8 *dst = machine.root_device().memregion("user3")->base();
for (i =0; i < 0x80000 * 3; i++)
{
@@ -841,7 +841,7 @@ static DRIVER_INIT( sblast2b )
static DRIVER_INIT( endless )
{
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
/* there is more to this, 0x800 based block swaps? */
for (i = 0; i < 0x200000; i++)
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index 5affde5a403..dbf07048958 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -89,7 +89,7 @@ Notes:
a bug. The service mode functionality is very limited anyway. To get past the
failed ROM test and see the service mode, use this ROM patch:
- UINT8 *mem = machine.region("maincpu")->base();
+ UINT8 *mem = machine.root_device().memregion("maincpu")->base();
mem[0x3a5d] = mem[0x3a5e] = mem[0x3a5f] = 0;
- The "SNK Wave" custom sound circuitry is only actually used by marvins and
diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c
index eaaca24d985..116d301c67b 100644
--- a/src/mame/drivers/snk68.c
+++ b/src/mame/drivers/snk68.c
@@ -1040,7 +1040,7 @@ ROM_END
static DRIVER_INIT( searchar )
{
- machine.root_device().membank("bank1")->set_base(machine.region("user1")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
}
/******************************************************************************/
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index f7fa1ec161f..c415b424e6e 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -418,13 +418,13 @@ static void sb3_play_music(running_machine &machine, int data)
{
case 0x23:
case 0x26:
- snd = machine.region("oki")->base();
+ snd = machine.root_device().memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x00000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
case 0x24:
- snd = machine.region("oki")->base();
+ snd = machine.root_device().memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x20000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
@@ -437,7 +437,7 @@ static void sb3_play_music(running_machine &machine, int data)
case 0x2b:
case 0x2c:
case 0x2d:
- snd = machine.region("oki")->base();
+ snd = state->memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x40000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
@@ -1516,7 +1516,7 @@ static const ym2151_interface ym2151_config =
static MACHINE_RESET (semiprot)
{
snowbros_state *state = machine.driver_data<snowbros_state>();
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+ UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
int i;
for (i = 0;i < 0x200/2;i++)
@@ -1526,7 +1526,7 @@ static MACHINE_RESET (semiprot)
static MACHINE_RESET (finalttr)
{
snowbros_state *state = machine.driver_data<snowbros_state>();
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+ UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
int i;
for (i = 0;i < 0x200/2;i++)
@@ -2337,7 +2337,7 @@ READ16_MEMBER(snowbros_state::moremorp_0a_read)
static DRIVER_INIT( moremorp )
{
//snowbros_state *state = machine.driver_data<snowbros_state>();
-// UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+// UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
// int i;
// for (i = 0;i < 0x200/2;i++)
@@ -2352,8 +2352,8 @@ static DRIVER_INIT( moremorp )
static DRIVER_INIT( cookbib2 )
{
//snowbros_state *state = machine.driver_data<snowbros_state>();
-// UINT16 *HCROM = (UINT16*)machine.region("maincpu")->base();
-// UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+// UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
+// UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
// int i;
// state->m_hyperpac_ram[0xf000/2] = 0x46fc;
// state->m_hyperpac_ram[0xf002/2] = 0x2700;
@@ -2719,8 +2719,8 @@ READ16_MEMBER(snowbros_state::_4in1_02_read)
static DRIVER_INIT(4in1boot)
{
UINT8 *buffer;
- UINT8 *src = machine.region("maincpu")->base();
- int len = machine.region("maincpu")->bytes();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
+ int len = machine.root_device().memregion("maincpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
@@ -2734,8 +2734,8 @@ static DRIVER_INIT(4in1boot)
auto_free(machine, buffer);
}
- src = machine.region("soundcpu")->base();
- len = machine.region("soundcpu")->bytes();
+ src = machine.root_device().memregion("soundcpu")->base();
+ len = machine.root_device().memregion("soundcpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
@@ -2753,8 +2753,8 @@ static DRIVER_INIT(4in1boot)
static DRIVER_INIT(snowbro3)
{
UINT8 *buffer;
- UINT8 *src = machine.region("maincpu")->base();
- int len = machine.region("maincpu")->bytes();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
+ int len = machine.root_device().memregion("maincpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c
index a0f9b0b94cf..2e1021bc8e1 100644
--- a/src/mame/drivers/sothello.c
+++ b/src/mame/drivers/sothello.c
@@ -80,7 +80,7 @@ public:
WRITE8_MEMBER(sothello_state::bank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bank=0;
switch(data^0xff)
{
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 672c1525f0c..0b65ecb9a28 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -78,7 +78,7 @@ static void spd_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * chip;
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * chip;
state->m_adpcm_data[chip] = ROM[state->m_adpcm_pos[chip]++];
msm5205_data_w(device,state->m_adpcm_data[chip] >> 4);
diff --git a/src/mame/drivers/speedspn.c b/src/mame/drivers/speedspn.c
index ea73867d06a..bc3c1fdc414 100644
--- a/src/mame/drivers/speedspn.c
+++ b/src/mame/drivers/speedspn.c
@@ -65,7 +65,7 @@ WRITE8_MEMBER(speedspn_state::speedspn_banked_rom_change)
{
/* is this weird banking some form of protection? */
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int addr;
switch (data)
diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c
index 0c39c09a4dc..a83dce3e326 100644
--- a/src/mame/drivers/spiders.c
+++ b/src/mame/drivers/spiders.c
@@ -545,7 +545,7 @@ static READ8_DEVICE_HANDLER( gfx_rom_r )
if (state->m_gfx_rom_ctrl_mode)
{
- UINT8 *rom = device->machine().region("gfx1")->base();
+ UINT8 *rom = state->memregion("gfx1")->base();
ret = rom[state->m_gfx_rom_address];
diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c
index 8567a0c04d2..12dad8f2baa 100644
--- a/src/mame/drivers/splash.c
+++ b/src/mame/drivers/splash.c
@@ -1016,7 +1016,7 @@ static DRIVER_INIT( splash10 )
static DRIVER_INIT( roldfrog )
{
splash_state *state = machine.driver_data<splash_state>();
- UINT8 * ROM = (UINT8 *)machine.region("audiocpu")->base();
+ UINT8 * ROM = (UINT8 *)state->memregion("audiocpu")->base();
state->membank("sound_bank")->configure_entries(0, 16, &ROM[0x10000], 0x8000);
state->m_bitmap_type = 1;
@@ -1026,7 +1026,7 @@ static DRIVER_INIT( roldfrog )
static DRIVER_INIT( rebus )
{
splash_state *state = machine.driver_data<splash_state>();
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)state->memregion("maincpu")->base();
state->m_bitmap_type = 1;
state->m_sprite_attr2_shift = 0;
@@ -1056,7 +1056,7 @@ static DRIVER_INIT( rebus )
static DRIVER_INIT( funystrp )
{
splash_state *state = machine.driver_data<splash_state>();
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
state->m_bitmap_type = 0;
state->m_sprite_attr2_shift = 0;
@@ -1095,7 +1095,7 @@ static DRIVER_INIT( funystrp )
ROM[0x11730/2] = 0x7001;
ROM[0x11f80/2] = 0x7001;
- ROM = (UINT16 *)machine.region("audiocpu")->base();
+ ROM = (UINT16 *)state->memregion("audiocpu")->base();
state->membank("sound_bank")->configure_entries(0, 16, &ROM[0x00000], 0x8000);
diff --git a/src/mame/drivers/splus.c b/src/mame/drivers/splus.c
index b682398aadd..f6026fcd9d6 100644
--- a/src/mame/drivers/splus.c
+++ b/src/mame/drivers/splus.c
@@ -578,7 +578,7 @@ static DRIVER_INIT( splus )
{
splus_state *state = machine.driver_data<splus_state>();
- UINT8 *reel_data = machine.region( "reeldata" )->base();
+ UINT8 *reel_data = state->memregion( "reeldata" )->base();
// Load Reel Data
memcpy(state->m_reel_ram, &reel_data[0x0000], 0x2000);
diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c
index 333c9a8fbba..612b8328d24 100644
--- a/src/mame/drivers/spoker.c
+++ b/src/mame/drivers/spoker.c
@@ -575,7 +575,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( spk116it )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -682,7 +682,7 @@ ROM_END
static DRIVER_INIT( 3super8 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* Decryption is probably done using one macrocell/output on an address decoding pal which we do not have a dump of */
@@ -700,8 +700,8 @@ static DRIVER_INIT( 3super8 )
/* cheesy hack: take gfx roms from spk116it and rearrange them for this game needs */
{
- UINT8 *src = machine.region("rep_gfx")->base();
- UINT8 *dst = machine.region("gfx1")->base();
+ UINT8 *src = machine.root_device().memregion("rep_gfx")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
UINT8 x;
for(x=0;x<3;x++)
diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c
index c7d56045d00..fab1405d33f 100644
--- a/src/mame/drivers/spool99.c
+++ b/src/mame/drivers/spool99.c
@@ -159,7 +159,7 @@ WRITE8_MEMBER(spool99_state::spool99_cram_w)
READ8_MEMBER(spool99_state::spool99_io_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
// if(!(io_switch))
{
@@ -229,7 +229,7 @@ ADDRESS_MAP_END
READ8_MEMBER(spool99_state::vcarn_io_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
// if(!(io_switch))
{
@@ -419,7 +419,7 @@ static DRIVER_INIT( spool99 )
{
spool99_state *state = machine.driver_data<spool99_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
// vram = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(state->m_main, ROM, 0x100);
}
diff --git a/src/mame/drivers/sprcros2.c b/src/mame/drivers/sprcros2.c
index 02180074d4d..a5268fec8ab 100644
--- a/src/mame/drivers/sprcros2.c
+++ b/src/mame/drivers/sprcros2.c
@@ -64,7 +64,7 @@ Notes:
WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w)
{
- UINT8 *RAM = machine().region("master")->base();
+ UINT8 *RAM = memregion("master")->base();
//76543210
//x------- unused
@@ -85,7 +85,7 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w)
WRITE8_MEMBER(sprcros2_state::sprcros2_s_port3_w)
{
- UINT8 *RAM = machine().region("slave")->base();
+ UINT8 *RAM = memregion("slave")->base();
//76543210
//xxxx---- unused
diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c
index 6630fd0f857..52a967069f9 100644
--- a/src/mame/drivers/spy.c
+++ b/src/mame/drivers/spy.c
@@ -498,7 +498,7 @@ static const k051960_interface spy_k051960_intf =
static MACHINE_START( spy )
{
spy_state *state = machine.driver_data<spy_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c
index ae51fe9820a..85d9248e033 100644
--- a/src/mame/drivers/srmp2.c
+++ b/src/mame/drivers/srmp2.c
@@ -171,7 +171,7 @@ static WRITE16_DEVICE_HANDLER( srmp2_adpcm_code_w )
*/
srmp2_state *state = device->machine().driver_data<srmp2_state>();
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = state->memregion("adpcm")->base();
state->m_adpcm_sptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
state->m_adpcm_eptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
@@ -195,7 +195,7 @@ static WRITE8_DEVICE_HANDLER( srmp3_adpcm_code_w )
*/
srmp2_state *state = device->machine().driver_data<srmp2_state>();
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = state->memregion("adpcm")->base();
state->m_adpcm_sptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
state->m_adpcm_eptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
@@ -212,7 +212,7 @@ static WRITE8_DEVICE_HANDLER( srmp3_adpcm_code_w )
static void srmp2_adpcm_int(device_t *device)
{
srmp2_state *state = device->machine().driver_data<srmp2_state>();
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = state->memregion("adpcm")->base();
if (state->m_adpcm_sptr)
{
@@ -357,7 +357,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_rombank_w)
xxx- ---- : ADPCM ROM bank
*/
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
int addr;
m_adpcm_bank = ((data & 0xe0) >> 5);
@@ -507,7 +507,7 @@ WRITE8_MEMBER(srmp2_state::rmgoldyh_rombank_w)
xxx- ---- : ADPCM ROM bank
*/
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
int addr;
m_adpcm_bank = ((data & 0xe0) >> 5);
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index 58fad461ddd..f8550bbc112 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -268,7 +268,7 @@ WRITE32_MEMBER(srmp5_state::spr_w)
READ32_MEMBER(srmp5_state::data_r)
{
UINT32 data;
- const UINT8 *usr = machine().region("user2")->base();
+ const UINT8 *usr = memregion("user2")->base();
data=((m_databank>>4)&0xf)*0x100000; //guess
data=usr[data+offset*2]+usr[data+offset*2+1]*256;
diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c
index fb340d3ed11..05d3fdb924c 100644
--- a/src/mame/drivers/srmp6.c
+++ b/src/mame/drivers/srmp6.c
@@ -333,7 +333,7 @@ WRITE16_MEMBER(srmp6_state::video_regs_w)
case 0x5e/2: // bank switch, used by ROM check
{
- const UINT8 *rom = machine().region("nile")->base();
+ const UINT8 *rom = memregion("nile")->base();
LOG(("%x\n",data));
membank("bank1")->set_base((UINT16 *)(rom + (data & 0x0f)*0x200000));
break;
@@ -418,7 +418,7 @@ WRITE16_MEMBER(srmp6_state::srmp6_dma_w)
COMBINE_DATA(&dmaram[offset]);
if (offset==13 && dmaram[offset]==0x40)
{
- const UINT8 *rom = machine().region("nile")->base();
+ const UINT8 *rom = memregion("nile")->base();
UINT32 srctab=2*((((UINT32)dmaram[5])<<16)|dmaram[4]);
UINT32 srcdata=2*((((UINT32)dmaram[11])<<16)|dmaram[10]);
UINT32 len=4*(((((UINT32)dmaram[7]&3)<<16)|dmaram[6])+1); //??? WRONG!
diff --git a/src/mame/drivers/srumbler.c b/src/mame/drivers/srumbler.c
index 225146d8632..f0078a9cb59 100644
--- a/src/mame/drivers/srumbler.c
+++ b/src/mame/drivers/srumbler.c
@@ -28,9 +28,9 @@ WRITE8_MEMBER(srumbler_state::srumbler_bankswitch_w)
that as well to be 100% accurate.
*/
int i;
- UINT8 *ROM = machine().region("user1")->base();
- UINT8 *prom1 = machine().region("proms")->base() + (data & 0xf0);
- UINT8 *prom2 = machine().region("proms")->base() + 0x100 + ((data & 0x0f) << 4);
+ UINT8 *ROM = memregion("user1")->base();
+ UINT8 *prom1 = memregion("proms")->base() + (data & 0xf0);
+ UINT8 *prom2 = memregion("proms")->base() + 0x100 + ((data & 0x0f) << 4);
for (i = 0x05;i < 0x10;i++)
{
diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c
index 567885a8bd9..db1fbed206d 100644
--- a/src/mame/drivers/ssfindo.c
+++ b/src/mame/drivers/ssfindo.c
@@ -485,7 +485,7 @@ WRITE32_MEMBER(ssfindo_state::PS7500_IO_w)
READ32_MEMBER(ssfindo_state::io_r)
{
- UINT16 *FLASH = (UINT16 *)machine().region("user2")->base(); //16 bit - WORD access
+ UINT16 *FLASH = (UINT16 *)machine().root_device().memregion("user2")->base(); //16 bit - WORD access
int adr=m_flashAdr*0x200+(m_flashOffset);
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 367311c6d77..29aa157cdf7 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -492,7 +492,7 @@ static DRIVER_INIT( sshangha )
#if SSHANGHA_HACK
/* This is a hack to allow you to use the extra features
of the first "Unused" Dip Switch (see notes above). */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0x000384/2] = 0x4e71;
RAM[0x000386/2] = 0x4e71;
RAM[0x000388/2] = 0x4e71;
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index 657d048d485..8259e5c5f17 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -193,7 +193,7 @@ static MC6845_UPDATE_ROW( ssingles_update_row )
UINT32 tile_address;
UINT16 cell,palette;
UINT8 b0,b1;
- const UINT8 *gfx = device->machine().region("gfx1")->base();
+ const UINT8 *gfx = state->memregion("gfx1")->base();
for(cx=0;cx<x_count;++cx)
{
@@ -231,7 +231,7 @@ static MC6845_UPDATE_ROW( atamanot_update_row )
UINT32 tile_address;
UINT16 cell,palette;
UINT8 b0,b1;
- const UINT8 *gfx = device->machine().region("gfx1")->base();
+ const UINT8 *gfx = state->memregion("gfx1")->base();
for(cx=0;cx<x_count;++cx)
{
@@ -293,14 +293,14 @@ static const mc6845_interface atamanot_mc6845_intf =
WRITE8_MEMBER(ssingles_state::ssingles_videoram_w)
{
- UINT8 *vram = machine().region("vram")->base();
+ UINT8 *vram = memregion("vram")->base();
vram[offset] = data;
m_videoram[offset]=data;
}
WRITE8_MEMBER(ssingles_state::ssingles_colorram_w)
{
- UINT8 *cram = machine().region("cram")->base();
+ UINT8 *cram = memregion("cram")->base();
cram[offset] = data;
m_colorram[offset]=data;
}
diff --git a/src/mame/drivers/ssrj.c b/src/mame/drivers/ssrj.c
index 48a396c7a09..f34b0295c5a 100644
--- a/src/mame/drivers/ssrj.c
+++ b/src/mame/drivers/ssrj.c
@@ -37,7 +37,7 @@ HW info :
static MACHINE_RESET(ssrj)
{
ssrj_state *state = machine.driver_data<ssrj_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
memset(&rom[0xc000], 0 ,0x3fff); /* req for some control types */
state->m_oldport = 0x80;
diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c
index 33b14dc785c..14ebabf9044 100644
--- a/src/mame/drivers/sstrangr.c
+++ b/src/mame/drivers/sstrangr.c
@@ -92,7 +92,7 @@ static SCREEN_UPDATE_RGB32( sstrngr2 )
get_pens(pens);
- color_map_base = &screen.machine().region("proms")->base()[state->m_flip_screen ? 0x0000 : 0x0200];
+ color_map_base = &state->memregion("proms")->base()[state->m_flip_screen ? 0x0000 : 0x0200];
for (offs = 0; offs < 0x2000; offs++)
{
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 8b0edb2fb51..f4b0312626d 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -326,7 +326,7 @@ static MACHINE_RESET( ssv )
ssv_state *state = machine.driver_data<ssv_state>();
state->m_requested_int = 0;
device_set_irq_callback(machine.device("maincpu"), ssv_irq_callback);
- state->membank("bank1")->set_base(machine.region("user1")->base());
+ state->membank("bank1")->set_base(state->memregion("user1")->base());
}
@@ -549,8 +549,8 @@ WRITE16_MEMBER(ssv_state::gdfs_blitram_w)
UINT32 dst = (gdfs_blitram[0xc4/2] + (gdfs_blitram[0xc6/2] << 16)) << 4;
UINT32 len = (gdfs_blitram[0xc8/2]) << 4;
- UINT8 *rom = machine().region("gfx2")->base();
- size_t size = machine().region("gfx2")->bytes();
+ UINT8 *rom = memregion("gfx2")->base();
+ size_t size = memregion("gfx2")->bytes();
if ( (src+len <= size) && (dst+len <= 4 * 0x100000) )
{
@@ -962,8 +962,8 @@ ADDRESS_MAP_END
READ16_MEMBER(ssv_state::eaglshot_gfxrom_r)
{
- UINT8 *rom = machine().region("gfx1")->base();
- size_t size = machine().region("gfx1")->bytes();
+ UINT8 *rom = memregion("gfx1")->base();
+ size_t size = memregion("gfx1")->bytes();
offset = offset * 2 + m_gfxrom_select * 0x200000;
@@ -2648,9 +2648,9 @@ static void init_hypreac2(running_machine &machine)
// massages the data from the BPMicro-compatible dump to runnable form
static void init_st010(running_machine &machine)
{
- UINT8 *dspsrc = (UINT8 *)machine.region("st010")->base();
- UINT32 *dspprg = (UINT32 *)machine.region("dspprg")->base();
- UINT16 *dspdata = (UINT16 *)machine.region("dspdata")->base();
+ UINT8 *dspsrc = (UINT8 *)machine.root_device().memregion("st010")->base();
+ UINT32 *dspprg = (UINT32 *)machine.root_device().memregion("dspprg")->base();
+ UINT16 *dspdata = (UINT16 *)machine.root_device().memregion("dspdata")->base();
// copy DSP program
for (int i = 0; i < 0x10000; i+= 4)
@@ -2677,7 +2677,7 @@ static DRIVER_INIT( meosism ) { init_ssv(machine, 0); }
static DRIVER_INIT( mslider ) { init_ssv(machine, 0); }
static DRIVER_INIT( ryorioh ) { init_ssv(machine, 0); }
static DRIVER_INIT( srmp4 ) { init_ssv(machine, 0);
-// ((UINT16 *)machine.region("user1")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */
+// ((UINT16 *)machine.root_device().memregion("user1")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */
}
static DRIVER_INIT( srmp7 ) { init_ssv(machine, 0); }
static DRIVER_INIT( stmblade ) { init_ssv(machine, 0); init_st010(machine); }
diff --git a/src/mame/drivers/st0016.c b/src/mame/drivers/st0016.c
index 9cfb82bcf57..1bf9d7e5b11 100644
--- a/src/mame/drivers/st0016.c
+++ b/src/mame/drivers/st0016.c
@@ -70,7 +70,7 @@ WRITE8_MEMBER(st0016_state::mux_select_w)
WRITE8_MEMBER(st0016_state::st0016_rom_bank_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + (data* 0x4000) + 0x10000 );
st0016_rom_bank=data;
}
@@ -681,13 +681,13 @@ static DRIVER_INIT(nratechu)
static DRIVER_INIT(mayjinsn)
{
st0016_game=4|0x80;
- machine.root_device().membank("bank2")->set_base(machine.region("user1")->base());
+ machine.root_device().membank("bank2")->set_base(machine.root_device().memregion("user1")->base());
}
static DRIVER_INIT(mayjisn2)
{
st0016_game=4;
- machine.root_device().membank("bank2")->set_base(machine.region("user1")->base());
+ machine.root_device().membank("bank2")->set_base(machine.root_device().memregion("user1")->base());
}
/*************************************
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index 5ffe006f684..0d929de0111 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -502,7 +502,7 @@ static DRIVER_INIT( starwars )
starwars_mproc_init(machine);
/* initialize banking */
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x6000, 0x10000 - 0x6000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x6000, 0x10000 - 0x6000);
state->membank("bank1")->set_entry(0);
}
@@ -510,7 +510,7 @@ static DRIVER_INIT( starwars )
static DRIVER_INIT( esb )
{
starwars_state *state = machine.driver_data<starwars_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
/* init the slapstic */
slapstic_init(machine, 101);
diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c
index 37dc4431cad..c7959bd36ca 100644
--- a/src/mame/drivers/statriv2.c
+++ b/src/mame/drivers/statriv2.c
@@ -224,8 +224,8 @@ static INTERRUPT_GEN( statriv2_interrupt )
READ8_MEMBER(statriv2_state::question_data_r)
{
- const UINT8 *qrom = machine().region("questions")->base();
- UINT32 qromsize = machine().region("questions")->bytes();
+ const UINT8 *qrom = memregion("questions")->base();
+ UINT32 qromsize = memregion("questions")->bytes();
UINT32 address;
if (m_question_offset_high == 0xff)
@@ -1102,8 +1102,8 @@ static DRIVER_INIT( addr_lmhe )
* *
\***************************************************/
- UINT8 *qrom = machine.region("questions")->base();
- UINT32 length = machine.region("questions")->bytes();
+ UINT8 *qrom = machine.root_device().memregion("questions")->base();
+ UINT32 length = machine.root_device().memregion("questions")->bytes();
UINT32 address;
for (address = 0; address < length; address++)
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 1b124cee94c..eb9a9b8de79 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -401,7 +401,7 @@ DRIVER_INIT(magzun)
/* Program ROM patches, don't understand how to avoid these two checks ... */
{
- UINT32 *ROM = (UINT32 *)machine.region("game0")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("game0")->base();
ROM[0x90054/4] = 0x00e00001; // END error
@@ -1098,7 +1098,7 @@ by Sega titles,and this is a Sunsoft game)It's likely to be a left-over...
static DRIVER_INIT( sanjeon )
{
- UINT8 *src = machine.region ( "game0" )->base();
+ UINT8 *src = machine.root_device().memregion ( "game0" )->base();
int x;
for (x=0;x<0x3000000;x++)
diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c
index 5f03e39c0cd..e433213ed68 100644
--- a/src/mame/drivers/sub.c
+++ b/src/mame/drivers/sub.c
@@ -386,9 +386,9 @@ GFXDECODE_END
static PALETTE_INIT( sub )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
- UINT8* lookup = machine.region("proms2")->base();
+ UINT8* lookup = machine.root_device().memregion("proms2")->base();
/* allocate the colortable */
machine.colortable = colortable_alloc(machine, 0x100);
diff --git a/src/mame/drivers/subsino.c b/src/mame/drivers/subsino.c
index ab856a7327c..95ee82ee7fc 100644
--- a/src/mame/drivers/subsino.c
+++ b/src/mame/drivers/subsino.c
@@ -548,7 +548,7 @@ static SCREEN_UPDATE_IND16( stisub_reels )
static PALETTE_INIT( subsino_2proms )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
@@ -575,7 +575,7 @@ static PALETTE_INIT( subsino_2proms )
static PALETTE_INIT( subsino_3proms )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
@@ -3362,7 +3362,7 @@ ROM_END
static DRIVER_INIT( smoto16 )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
rom[0x12d0] = 0x20; // "ERROR 951010"
}
@@ -3512,13 +3512,13 @@ static DRIVER_INIT( sharkpye )
static DRIVER_INIT( smoto20 )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
rom[0x12e1] = 0x20; // "ERROR 951010"
}
static DRIVER_INIT( tisub )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
DRIVER_INIT_CALL(victor5);
@@ -3533,7 +3533,7 @@ static DRIVER_INIT( tisub )
static DRIVER_INIT( tisuba )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
DRIVER_INIT_CALL(victor5);
@@ -3549,7 +3549,7 @@ static DRIVER_INIT( tisuba )
static DRIVER_INIT( stisub )
{
subsino_state *state = machine.driver_data<subsino_state>();
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = state->memregion( "maincpu" )->base();
rom[0x1005] = 0x1d; //patch protection check
rom[0x7ab] = 0x18; //patch "winning protection" check
rom[0x957] = 0x18; //patch "losing protection" check
diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c
index 1ba6311193d..6a26f130663 100644
--- a/src/mame/drivers/subsino2.c
+++ b/src/mame/drivers/subsino2.c
@@ -2362,7 +2362,7 @@ ROM_END
static DRIVER_INIT( bishjan )
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
// patch serial protection test (it always enters test mode on boot otherwise)
rom[0x042EA/2] = 0x4008;
@@ -2426,7 +2426,7 @@ ROM_END
static DRIVER_INIT( expcard )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xed4dc-0xc0000] = 0xeb;
@@ -2524,7 +2524,7 @@ DRIVER_INIT( mtrain )
subsino_decrypt(machine, crsbingo_bitswaps, crsbingo_xors, 0x8000);
// patch serial protection test (it always enters test mode on boot otherwise)
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x0cec] = 0x18;
rom[0xb037] = 0x18;
@@ -2578,7 +2578,7 @@ ROM_END
static DRIVER_INIT( saklove )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch serial protection test (it always enters test mode on boot otherwise)
rom[0x0e029] = 0xeb;
@@ -2638,7 +2638,7 @@ ROM_END
static DRIVER_INIT( xplan )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xeded9-0xc0000] = 0xeb;
@@ -2698,7 +2698,7 @@ ROM_END
static DRIVER_INIT( xtrain )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xe190f-0xc0000] = 0xeb;
@@ -2743,7 +2743,7 @@ DRIVER_INIT( wtrnymph )
subsino_decrypt(machine, victor5_bitswaps, victor5_xors, 0x8000);
// patch serial protection test (it always enters test mode on boot otherwise)
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x0d79] = 0x18;
rom[0xc1cf] = 0x18;
rom[0xc2a9] = 0x18;
diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c
index 79c3162f2d5..04aec0f63b3 100644
--- a/src/mame/drivers/suna16.c
+++ b/src/mame/drivers/suna16.c
@@ -260,7 +260,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna16_state::bssoccer_pcm_1_bankswitch_w)
{
- UINT8 *RAM = machine().region("pcm1")->base();
+ UINT8 *RAM = memregion("pcm1")->base();
int bank = data & 7;
if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
membank("bank1")->set_base(&RAM[bank * 0x10000 + 0x1000]);
@@ -268,7 +268,7 @@ WRITE8_MEMBER(suna16_state::bssoccer_pcm_1_bankswitch_w)
WRITE8_MEMBER(suna16_state::bssoccer_pcm_2_bankswitch_w)
{
- UINT8 *RAM = machine().region("pcm2")->base();
+ UINT8 *RAM = memregion("pcm2")->base();
int bank = data & 7;
if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
membank("bank2")->set_base(&RAM[bank * 0x10000 + 0x1000]);
@@ -322,7 +322,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna16_state::uballoon_pcm_1_bankswitch_w)
{
- UINT8 *RAM = machine().region("pcm1")->base();
+ UINT8 *RAM = memregion("pcm1")->base();
int bank = data & 1;
if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
membank("bank1")->set_base(&RAM[bank * 0x10000 + 0x400]);
@@ -1087,7 +1087,7 @@ ROM_END
static DRIVER_INIT( uballoon )
{
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
// Patch out the protection checks
RAM[0x0113c/2] = 0x4e71; // bne $646
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 07d2dc8347a..16e75a64497 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -60,7 +60,7 @@ Notes:
static DRIVER_INIT( hardhead )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0; i < 0x8000; i++)
@@ -75,15 +75,15 @@ static DRIVER_INIT( hardhead )
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0) ^ 0x58;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/* Non encrypted bootleg */
static DRIVER_INIT( hardhedb )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x48000);
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x48000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -95,8 +95,8 @@ static DRIVER_INIT( hardhedb )
static UINT8 *brickzn_decrypt(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
int i;
@@ -137,7 +137,7 @@ static UINT8 *brickzn_decrypt(running_machine &machine)
static DRIVER_INIT( brickzn )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = brickzn_decrypt(machine);
int i;
@@ -162,13 +162,13 @@ static DRIVER_INIT( brickzn )
decrypt[0x24b5] = 0x00; // HALT -> NOP
decrypt[0x2583] = 0x00; // HALT -> NOP
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x10000, 0x4000);
}
static DRIVER_INIT( brickzn3 )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = brickzn_decrypt(machine);
int i;
@@ -193,7 +193,7 @@ static DRIVER_INIT( brickzn3 )
decrypt[0x2487] = 0x00; // HALT -> NOP
decrypt[0x256c] = 0x00; // HALT -> NOP
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x10000, 0x4000);
}
@@ -205,8 +205,8 @@ static DRIVER_INIT( brickzn3 )
static DRIVER_INIT( hardhea2 )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -280,7 +280,7 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x41;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank2")->configure_entries(0, 2, auto_alloc_array(machine, UINT8, 0x2000 * 2), 0x2000);
}
@@ -292,8 +292,8 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
static DRIVER_INIT( starfigh )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -349,7 +349,7 @@ static DRIVER_INIT( starfigh )
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x45;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
@@ -360,8 +360,8 @@ static DRIVER_INIT( starfigh )
static DRIVER_INIT( sparkman )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -417,7 +417,7 @@ static DRIVER_INIT( sparkman )
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x44;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -2355,7 +2355,7 @@ ROM_END
static DRIVER_INIT( suna8 )
{
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/* Working Games */
diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c
index 9d0a571b843..f11d0eef237 100644
--- a/src/mame/drivers/supdrapo.c
+++ b/src/mame/drivers/supdrapo.c
@@ -126,7 +126,7 @@ static SCREEN_UPDATE_IND16( supdrapo )
/*Maybe bit 2 & 3 of the second color prom are intensity bits? */
static PALETTE_INIT( sdpoker )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c
index eceb40daf16..b15398d4e6e 100644
--- a/src/mame/drivers/superdq.c
+++ b/src/mame/drivers/superdq.c
@@ -82,7 +82,7 @@ static SCREEN_UPDATE_IND16( superdq )
static PALETTE_INIT( superdq )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances[3] = { 820, 390, 200 };
double rweights[3], gweights[3], bweights[2];
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 8e5fe73e933..47fa32441a5 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -112,8 +112,8 @@ static SAMPLES_START( pbillian_sh_start )
{
superqix_state *state = device.machine().driver_data<superqix_state>();
running_machine &machine = device.machine();
- UINT8 *src = machine.region("samples")->base();
- int i, len = machine.region("samples")->bytes();
+ UINT8 *src = machine.root_device().memregion("samples")->base();
+ int i, len = state->memregion("samples")->bytes();
/* convert 8-bit unsigned samples to 8-bit signed */
state->m_samplebuf = auto_alloc_array(machine, INT16, len);
@@ -124,8 +124,8 @@ static SAMPLES_START( pbillian_sh_start )
WRITE8_MEMBER(superqix_state::pbillian_sample_trigger_w)
{
samples_device *samples = machine().device<samples_device>("samples");
- UINT8 *src = machine().region("samples")->base();
- int len = machine().region("samples")->bytes();
+ UINT8 *src = memregion("samples")->base();
+ int len = memregion("samples")->bytes();
int start,end;
start = data << 7;
@@ -548,7 +548,7 @@ static void machine_init_common(running_machine &machine)
static MACHINE_START( superqix )
{
/* configure the banks */
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine_init_common(machine);
}
@@ -556,7 +556,7 @@ static MACHINE_START( superqix )
static MACHINE_START( pbillian )
{
/* configure the banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine_init_common(machine);
}
@@ -1363,8 +1363,8 @@ static DRIVER_INIT( perestro )
int i,j;
/* decrypt program code; the address lines are shuffled around in a non-trivial way */
- src = machine.region("maincpu")->base();
- len = machine.region("maincpu")->bytes();
+ src = machine.root_device().memregion("maincpu")->base();
+ len = machine.root_device().memregion("maincpu")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1383,8 +1383,8 @@ static DRIVER_INIT( perestro )
}
/* decrypt gfx ROMs; simple bit swap on the address lines */
- src = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ src = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1394,8 +1394,8 @@ static DRIVER_INIT( perestro )
}
}
- src = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ src = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1405,8 +1405,8 @@ static DRIVER_INIT( perestro )
}
}
- src = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ src = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
diff --git a/src/mame/drivers/supertnk.c b/src/mame/drivers/supertnk.c
index 98d8c2eb4a4..498dfb0f2c3 100644
--- a/src/mame/drivers/supertnk.c
+++ b/src/mame/drivers/supertnk.c
@@ -140,7 +140,7 @@ WRITE8_MEMBER(supertnk_state::supertnk_bankswitch_0_w)
bank_address = 0x10000 + (m_rom_bank * 0x1000);
- membank("bank1")->set_base(&machine().region("maincpu")->base()[bank_address]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[bank_address]);
}
@@ -152,7 +152,7 @@ WRITE8_MEMBER(supertnk_state::supertnk_bankswitch_1_w)
bank_address = 0x10000 + (m_rom_bank * 0x1000);
- membank("bank1")->set_base(&machine().region("maincpu")->base()[bank_address]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[bank_address]);
}
@@ -187,7 +187,7 @@ static VIDEO_START( supertnk )
{
supertnk_state *state = machine.driver_data<supertnk_state>();
offs_t i;
- const UINT8 *prom = machine.region("proms")->base();
+ const UINT8 *prom = state->memregion("proms")->base();
for (i = 0; i < NUM_PENS; i++)
{
@@ -490,8 +490,8 @@ static DRIVER_INIT( supertnk )
{
/* decode the TMS9980 ROMs */
offs_t offs;
- UINT8 *rom = machine.region("maincpu")->base();
- size_t len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ size_t len = machine.root_device().memregion("maincpu")->bytes();
for (offs = 0; offs < len; offs++)
{
diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c
index 1ea44de6ee9..2066e6a89ef 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -257,7 +257,7 @@ static READ8_DEVICE_HANDLER( rom_bank_select_r )
static WRITE8_DEVICE_HANDLER( rom_bank_select_w )
{
suprgolf_state *state = device->machine().driver_data<suprgolf_state>();
- UINT8 *region_base = device->machine().region("user1")->base();
+ UINT8 *region_base = state->memregion("user1")->base();
state->m_rom_bank = data;
@@ -272,7 +272,7 @@ static WRITE8_DEVICE_HANDLER( rom_bank_select_w )
WRITE8_MEMBER(suprgolf_state::rom2_bank_select_w)
{
- UINT8 *region_base = machine().region("user2")->base();
+ UINT8 *region_base = memregion("user2")->base();
// mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,cpu_get_previouspc(&space.device()));
membank("bank1")->set_base(region_base + (data&0x0f) * 0x4000);
@@ -638,7 +638,7 @@ ROM_END
static DRIVER_INIT( suprgolf )
{
- UINT8 *ROM = machine.region("user2")->base();
+ UINT8 *ROM = machine.root_device().memregion("user2")->base();
ROM[0x74f4-0x4000] = 0x00;
ROM[0x74f5-0x4000] = 0x00;
diff --git a/src/mame/drivers/suprloco.c b/src/mame/drivers/suprloco.c
index fc735279004..24e63e32bc8 100644
--- a/src/mame/drivers/suprloco.c
+++ b/src/mame/drivers/suprloco.c
@@ -258,9 +258,9 @@ static DRIVER_INIT( suprloco )
int i, j, k, color_source, color_dest;
UINT8 *source, *dest, *lookup;
- source = machine.region("gfx1")->base();
+ source = machine.root_device().memregion("gfx1")->base();
dest = source + 0x6000;
- lookup = machine.region("proms")->base() + 0x0200;
+ lookup = machine.root_device().memregion("proms")->base() + 0x0200;
for (i = 0; i < 0x80; i++, lookup += 8)
{
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index bb22fd8499b..a406738d066 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -431,7 +431,7 @@ static MACHINE_RESET(skns)
else
hit.disconnect= 0;
- state->membank("bank1")->set_base(machine.region("user1")->base());
+ state->membank("bank1")->set_base(state->memregion("user1")->base());
}
@@ -665,7 +665,7 @@ WRITE32_MEMBER(skns_state::skns_io_w)
WRITE32_MEMBER(skns_state::skns_v3t_w)
{
- UINT8 *btiles = machine().region("gfx3")->base();
+ UINT8 *btiles = memregion("gfx3")->base();
COMBINE_DATA(&m_v3t_ram[offset]);
diff --git a/src/mame/drivers/suprslam.c b/src/mame/drivers/suprslam.c
index 5d3fd078397..737f558b8b8 100644
--- a/src/mame/drivers/suprslam.c
+++ b/src/mame/drivers/suprslam.c
@@ -114,7 +114,7 @@ WRITE8_MEMBER(suprslam_state::pending_command_clear_w)
WRITE8_MEMBER(suprslam_state::suprslam_sh_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x8000;
diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c
index 41967f13946..1c8fe1b3b61 100644
--- a/src/mame/drivers/surpratk.c
+++ b/src/mame/drivers/surpratk.c
@@ -191,7 +191,7 @@ static const k05324x_interface surpratk_k05324x_intf =
static MACHINE_START( surpratk )
{
surpratk_state *state = machine.driver_data<surpratk_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 28, &ROM[0x10000], 0x2000);
state->membank("bank1")->configure_entries(28, 4, &ROM[0x08000], 0x2000);
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index 9a1170efb90..0694cb43a28 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -356,12 +356,12 @@ static const UINT8 cc_ex[0x100] = {
static MACHINE_START( system1 )
{
system1_state *state = machine.driver_data<system1_state>();
- UINT32 numbanks = (machine.region("maincpu")->bytes() - 0x10000) / 0x4000;
+ UINT32 numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
if (numbanks > 0)
- state->membank("bank1")->configure_entries(0, numbanks, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, numbanks, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
else
- state->membank("bank1")->configure_entry(0, machine.region("maincpu")->base() + 0x8000);
+ state->membank("bank1")->configure_entry(0, state->memregion("maincpu")->base() + 0x8000);
state->membank("bank1")->set_entry(0);
z80_set_cycle_tables(machine.device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
@@ -583,7 +583,7 @@ READ8_MEMBER(system1_state::mcu_io_r)
return machine().device<z80_device>("maincpu")->space(AS_PROGRAM)->read_byte(offset);
case 1:
- return machine().region("maincpu")->base()[offset + 0x10000];
+ return memregion("maincpu")->base()[offset + 0x10000];
case 2:
return machine().device<z80_device>("maincpu")->space(AS_IO)->read_byte(offset);
@@ -4651,12 +4651,12 @@ static DRIVER_INIT( myherok )
/* additionally to the usual protection, all the program ROMs have data lines */
/* D0 and D1 swapped. */
- rom = machine.region("maincpu")->base();
+ rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0xc000;A++)
rom[A] = (rom[A] & 0xfc) | ((rom[A] & 1) << 1) | ((rom[A] & 2) >> 1);
/* the tile gfx ROMs are mangled as well: */
- rom = machine.region("tiles")->base();
+ rom = machine.root_device().memregion("tiles")->base();
/* the first ROM has data lines D0 and D6 swapped. */
for (A = 0x0000;A < 0x4000;A++)
@@ -4691,7 +4691,7 @@ static DRIVER_INIT( myherok )
READ8_MEMBER(system1_state::nob_start_r)
{
/* in reality, it's likely some M1-dependent behavior */
- return (cpu_get_pc(&space.device()) <= 0x0003) ? 0x80 : machine().region("maincpu")->base()[1];
+ return (cpu_get_pc(&space.device()) <= 0x0003) ? 0x80 : memregion("maincpu")->base()[1];
}
static DRIVER_INIT( nob )
@@ -4717,7 +4717,7 @@ static DRIVER_INIT( nobb )
/* Patch to get PRG ROMS ('T', 'R' and 'S) status as "GOOD" in the "test mode" */
/* not really needed */
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x3296] = 0x18; // 'jr' instead of 'jr z' - 'T' (PRG Main ROM)
// ROM[0x32be] = 0x18; // 'jr' instead of 'jr z' - 'R' (Banked ROM 1)
@@ -4730,7 +4730,7 @@ static DRIVER_INIT( nobb )
/* Patch to get sound in later levels(the program enters into a tight loop)*/
address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
- UINT8 *ROM2 = machine.region("soundcpu")->base();
+ UINT8 *ROM2 = machine.root_device().memregion("soundcpu")->base();
ROM2[0x02f9] = 0x28;//'jr z' instead of 'jr'
@@ -4747,7 +4747,7 @@ static DRIVER_INIT( nobb )
static DRIVER_INIT( bootleg )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x10000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x10000);
DRIVER_INIT_CALL(bank00);
}
@@ -4755,14 +4755,14 @@ static DRIVER_INIT( bootleg )
static DRIVER_INIT( bootsys2 )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x20000);
- machine.root_device().membank("bank1")->configure_decrypted_entries(0, 4, machine.region("maincpu")->base() + 0x30000, 0x4000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x20000);
+ machine.root_device().membank("bank1")->configure_decrypted_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x30000, 0x4000);
DRIVER_INIT_CALL(bank0c);
}
static DRIVER_INIT( choplift )
{
- UINT8 *mcurom = machine.region("mcu")->base();
+ UINT8 *mcurom = machine.root_device().memregion("mcu")->base();
/* the ROM dump we have is bad; the following patches make it work */
mcurom[0x100] = 0x55; /* D5 in current dump */
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 0fbc47647b9..2f3a9d406ff 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -389,7 +389,7 @@ READ8_MEMBER(segas1x_bootleg_state::tturfbl_soundbank_r)
WRITE8_MEMBER(segas1x_bootleg_state::tturfbl_soundbank_w)
{
- UINT8 *mem = machine().region("soundcpu")->base();
+ UINT8 *mem = memregion("soundcpu")->base();
switch(data)
{
@@ -460,11 +460,11 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( upd7759_bank_w ) //*
{
- int offs, size = device->machine().region("soundcpu")->bytes() - 0x10000;
+ int offs, size = device->machine().root_device().memregion("soundcpu")->bytes() - 0x10000;
upd7759_reset_w(device, data & 0x40);
offs = 0x10000 + (data * 0x4000) % size;
- device->machine().root_device().membank("bank1")->set_base(device->machine().region("soundcpu")->base() + offs);
+ device->machine().root_device().membank("bank1")->set_base(device->machine().root_device().memregion("soundcpu")->base() + offs);
}
@@ -1039,7 +1039,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(segas1x_bootleg_state::sys18_soundbank_w)
{
- UINT8 *mem = machine().region("soundcpu")->base();
+ UINT8 *mem = memregion("soundcpu")->base();
int rom = (data >> 6) & 3;
int bank = (data & 0x3f);
int mask = m_sound_info[rom * 2 + 0];
@@ -1203,7 +1203,7 @@ READ8_MEMBER(segas1x_bootleg_state::shdancbl_soundbank_r)
WRITE8_MEMBER(segas1x_bootleg_state::shdancbl_bankctrl_w)
{
- UINT8 *mem = machine().region("soundcpu")->base();
+ UINT8 *mem = memregion("soundcpu")->base();
switch (data)
{
@@ -3349,8 +3349,8 @@ static DRIVER_INIT( goldnaxeb1 )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *KEY = machine.region("decryption")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *KEY = state->memregion("decryption")->base();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 data[0x1000];
@@ -3393,7 +3393,7 @@ static DRIVER_INIT( bayrouteb1 )
// decrypt
DRIVER_INIT_CALL( goldnaxeb1 );
- ROM2 = (UINT16*)machine.region("maincpu")->base();
+ ROM2 = (UINT16*)state->memregion("maincpu")->base();
decrypted_region2 = (UINT16*)state->m_decrypted_region;
// patch interrupt vector
@@ -3408,7 +3408,7 @@ static DRIVER_INIT( bayrouteb1 )
static DRIVER_INIT( bayrouteb2 )
{
- UINT8 *mem = machine.region("soundcpu")->base();
+ UINT8 *mem = machine.root_device().memregion("soundcpu")->base();
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3426,7 +3426,7 @@ static DRIVER_INIT( goldnaxeb2 )
static DRIVER_INIT( tturfbl )
{
- UINT8 *mem = machine.region("soundcpu")->base();
+ UINT8 *mem = machine.root_device().memregion("soundcpu")->base();
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3462,7 +3462,7 @@ static DRIVER_INIT( fpointbl )
/* Tetris-based */
static DRIVER_INIT( beautyb )
{
- UINT16*rom = (UINT16*)machine.region( "maincpu" )->base();
+ UINT16*rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base();
int x;
for (x = 0; x < 0x8000; x++)
@@ -3481,7 +3481,7 @@ static DRIVER_INIT( beautyb )
static DRIVER_INIT( shdancbl )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- UINT8 *mem = machine.region("soundcpu")->base();;
+ UINT8 *mem = state->memregion("soundcpu")->base();;
/* Copy first 32K of IC45 to Z80 address space */
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3496,7 +3496,7 @@ static DRIVER_INIT( shdancbl )
static DRIVER_INIT( mwalkbl )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- UINT8 *RAM = machine.region("soundcpu")->base();
+ UINT8 *RAM = state->memregion("soundcpu")->base();
static const int mwalk_sound_info[] =
{
0x0f, 0x00000, // ROM #1 = 128K
@@ -3518,7 +3518,7 @@ static DRIVER_INIT( mwalkbl )
static DRIVER_INIT( astormbl )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- UINT8 *RAM = machine.region("soundcpu")->base();
+ UINT8 *RAM = state->memregion("soundcpu")->base();
static const int astormbl_sound_info[] =
{
0x0f, 0x00000, // ROM #1 = 128K
diff --git a/src/mame/drivers/tail2nos.c b/src/mame/drivers/tail2nos.c
index 5b6449d5254..7a4fe809376 100644
--- a/src/mame/drivers/tail2nos.c
+++ b/src/mame/drivers/tail2nos.c
@@ -208,7 +208,7 @@ static const k051316_interface tail2nos_k051316_intf =
static MACHINE_START( tail2nos )
{
tail2nos_state *state = machine.driver_data<tail2nos_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank3")->configure_entries(0, 2, &ROM[0x10000], 0x8000);
state->membank("bank3")->set_entry(0);
@@ -227,8 +227,8 @@ static MACHINE_RESET( tail2nos )
tail2nos_state *state = machine.driver_data<tail2nos_state>();
/* point to the extra ROMs */
- state->membank("bank1")->set_base(machine.region("user1")->base());
- state->membank("bank2")->set_base(machine.region("user2")->base());
+ state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
+ state->membank("bank2")->set_base(state->memregion("user2")->base());
state->m_charbank = 0;
state->m_charpalette = 0;
diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c
index d4d0b828bb2..9c76fbbb2f4 100644
--- a/src/mame/drivers/taito_b.c
+++ b/src/mame/drivers/taito_b.c
@@ -2794,7 +2794,7 @@ MACHINE_CONFIG_END
#if 0
static void ryujin_patch(void)
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[ 0x62/2 ] = 1;
//0 (already in rom) - Taito Corporation 1993
//1 - Taito America corp with blue FBI logo
@@ -2849,7 +2849,7 @@ MACHINE_CONFIG_END
#if 0
static void sbm_patch(void)
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[ 0x7ffff/2 ] = 2; //US version
}
#endif
@@ -3707,7 +3707,7 @@ ROM_END
static DRIVER_INIT( taito_b )
{
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
GAME( 1989, masterw, 0, masterw, masterw, taito_b, ROT270, "Taito Corporation Japan", "Master of Weapon (World)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c
index 56e84b1af3b..7ecbe0685ec 100644
--- a/src/mame/drivers/taito_f2.c
+++ b/src/mame/drivers/taito_f2.c
@@ -3013,7 +3013,7 @@ static MACHINE_START( common )
static MACHINE_START( f2 )
{
MACHINE_START_CALL(common);
- machine.root_device().membank("bank2")->configure_entries(0, 8, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank2")->configure_entries(0, 8, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_CONFIG_START( taito_f2, taitof2_state )
@@ -5274,7 +5274,7 @@ static DRIVER_INIT( finalb )
int i;
UINT8 data;
UINT32 offset;
- UINT8 *gfx = machine.region("gfx2")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx2")->base();
offset = 0x100000;
for (i = 0x180000; i < 0x200000; i++)
@@ -5310,8 +5310,8 @@ static DRIVER_INIT( cameltry )
static DRIVER_INIT( mjnquest )
{
taitof2_state *state = machine.driver_data<taitof2_state>();
- int i, len = machine.region("gfx2")->bytes();
- UINT8 *gfx = machine.region("gfx2")->base();
+ int i, len = machine.root_device().memregion("gfx2")->bytes();
+ UINT8 *gfx = state->memregion("gfx2")->base();
/* the bytes in each longword are in reversed order, put them in the
order used by the other games. */
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index acb1898493c..b945ab251f9 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -121,7 +121,7 @@ WRITE32_MEMBER(taito_f3_state::f3_sound_reset_1_w)
WRITE32_MEMBER(taito_f3_state::f3_sound_bankswitch_w)
{
if (m_f3_game==KIRAMEKI) {
- UINT16 *rom = (UINT16 *)machine().region("audiocpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("audiocpu")->base();
UINT32 idx;
idx = (offset << 1) & 0x1e;
@@ -3666,8 +3666,8 @@ static void tile_decode(running_machine &machine)
{
UINT8 lsb,msb;
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx2")->base();
- int size=machine.region("gfx2")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx2")->base();
+ int size=machine.root_device().memregion("gfx2")->bytes();
int data;
/* Setup ROM formats:
@@ -3699,8 +3699,8 @@ static void tile_decode(running_machine &machine)
offset+=4;
}
- gfx = machine.region("gfx1")->base();
- size=machine.region("gfx1")->bytes();
+ gfx = machine.root_device().memregion("gfx1")->base();
+ size=machine.root_device().memregion("gfx1")->bytes();
offset = size/2;
for (i = size/2+size/4; i<size; i++)
@@ -3781,7 +3781,7 @@ static DRIVER_INIT( trstaroj )
static DRIVER_INIT( scfinals )
{
taito_f3_state *state = machine.driver_data<taito_f3_state>();
- UINT32 *RAM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *RAM = (UINT32 *)state->memregion("maincpu")->base();
/* Doesn't boot without this - eprom related? */
RAM[0x5af0/4]=0x4e710000|(RAM[0x5af0/4]&0xffff);
@@ -3868,7 +3868,7 @@ WRITE32_MEMBER(taito_f3_state::bubsympb_oki_w)
//if (mem_mask==0x000000ff) downcast<okim6295_device *>(device)->write(0,data&0xff);
if (ACCESSING_BITS_16_23)
{
- UINT8 *snd = machine().region("oki")->base();
+ UINT8 *snd = memregion("oki")->base();
int bank = (data & 0x000f0000) >> 16;
// almost certainly wrong
memcpy(snd+0x30000, snd+0x80000+0x30000+bank*0x10000, 0x10000);
@@ -3889,7 +3889,7 @@ static DRIVER_INIT( bubsympb )
/* expand gfx rom */
{
int i;
- UINT8 *gfx = machine.region("gfx2")->base();
+ UINT8 *gfx = state->memregion("gfx2")->base();
for (i=0x200000;i<0x400000; i+=4)
{
@@ -3941,7 +3941,7 @@ static DRIVER_INIT( landmakr )
static DRIVER_INIT( landmkrp )
{
taito_f3_state *state = machine.driver_data<taito_f3_state>();
- UINT32 *RAM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *RAM = (UINT32 *)state->memregion("maincpu")->base();
/* For some reason the least significant byte in the last 2 long words of
ROM is swapped. As the roms have been verified ok, I assume this is some
@@ -3989,7 +3989,7 @@ static DRIVER_INIT( pbobbl2p )
// which eventually causes the game to crash
// -- protection check?? or some kind of checksum fail?
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
/* protection? */
ROM[0x40090/4]=0x00004e71|(ROM[0x40090/4]&0xffff0000);
diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c
index 78c3e387659..e2fdbacc79e 100644
--- a/src/mame/drivers/taito_h.c
+++ b/src/mame/drivers/taito_h.c
@@ -518,7 +518,7 @@ static MACHINE_RESET( taitoh )
static MACHINE_START( taitoh )
{
taitoh_state *state = machine.driver_data<taitoh_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index 55304550517..49a5d7b5b97 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -173,7 +173,7 @@ static void machine_reset(running_machine &machine)
}
state->m_cur_rombank = state->m_cur_rombank2 = 0;
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000);
+ state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x10000);
gfx_element_set_source(machine.gfx[2], state->m_rambanks);
@@ -377,7 +377,7 @@ WRITE8_MEMBER(taitol_state::rombankswitch_w)
//logerror("robs %d, %02x (%04x)\n", offset, data, cpu_get_pc(&space.device()));
m_cur_rombank = data;
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + 0x2000 * m_cur_rombank);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + 0x2000 * m_cur_rombank);
}
}
@@ -397,7 +397,7 @@ WRITE8_MEMBER(taitol_state::rombank2switch_w)
//logerror("robs2 %02x (%04x)\n", data, cpu_get_pc(&space.device()));
m_cur_rombank2 = data;
- membank("bank6")->set_base(machine().region("slave")->base() + 0x10000 + 0x4000 * m_cur_rombank2);
+ membank("bank6")->set_base(machine().root_device().memregion("slave")->base() + 0x10000 + 0x4000 * m_cur_rombank2);
}
}
@@ -596,7 +596,7 @@ static void champwr_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0x1ffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
@@ -740,7 +740,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(taitol_state::sound_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int banknum = (data - 1) & 3;
membank ("bank7")->set_base (&RAM [0x10000 + (banknum * 0x4000)]);
@@ -1784,7 +1784,7 @@ static WRITE8_DEVICE_HANDLER( portA_w )
if (state->m_cur_bank != (data & 0x03))
{
int bankaddress;
- UINT8 *RAM = device->machine().region("audiocpu")->base();
+ UINT8 *RAM = state->memregion("audiocpu")->base();
state->m_cur_bank = data & 0x03;
bankaddress = 0x10000 + (state->m_cur_bank - 1) * 0x4000;
@@ -2722,7 +2722,7 @@ static DRIVER_INIT( plottinga )
v |= 1 << (7 - j);
tab[i] = v;
}
- p = machine.region("maincpu")->base();
+ p = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x20000; i++)
{
*p = tab[*p];
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index 3a32dae892b..f1390a12435 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -412,7 +412,7 @@ static void reset_sound_region(running_machine &machine)
{
taitox_state *state = machine.driver_data<taitox_state>();
- state->membank("bank2")->set_base(machine.region("audiocpu")->base() + (state->m_banknum * 0x4000) + 0x10000 );
+ state->membank("bank2")->set_base(state->memregion("audiocpu")->base() + (state->m_banknum * 0x4000) + 0x10000 );
}
WRITE8_MEMBER(taitox_state::sound_bankswitch_w)
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index 53e34bc0b2d..bedc843964c 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -3060,9 +3060,9 @@ static MACHINE_START( bshark )
static MACHINE_START( taitoz )
{
- int banks = (machine.region("audiocpu")->bytes() - 0xc000) / 0x4000;
+ int banks = (machine.root_device().memregion("audiocpu")->bytes() - 0xc000) / 0x4000;
- machine.root_device().membank("bank10")->configure_entries(0, banks, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ machine.root_device().membank("bank10")->configure_entries(0, banks, machine.root_device().memregion("audiocpu")->base() + 0xc000, 0x4000);
machine.save().register_postload(save_prepost_delegate(FUNC(taitoz_postload), &machine));
diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c
index 5751c3d5019..9672a735a06 100644
--- a/src/mame/drivers/taitoair.c
+++ b/src/mame/drivers/taitoair.c
@@ -669,7 +669,7 @@ static const tc0140syt_interface airsys_tc0140syt_intf =
static MACHINE_START( taitoair )
{
taitoair_state *state = machine.driver_data<taitoair_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
int i;
state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index 8c9e6b1541a..9eb9c2bfc21 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -919,7 +919,7 @@ ADDRESS_MAP_END
READ16_MEMBER(taitojc_state::dsp_rom_r)
{
- UINT16 *rom = (UINT16*)machine().region("gfx2")->base();
+ UINT16 *rom = (UINT16*)machine().root_device().memregion("gfx2")->base();
UINT16 data = rom[m_dsp_rom_pos++];
//mame_printf_debug("dsp_rom_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(&space.device()));
diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c
index 342f7ecf24f..c8e918ee6db 100644
--- a/src/mame/drivers/taitowlf.c
+++ b/src/mame/drivers/taitowlf.c
@@ -73,7 +73,7 @@ public:
static SCREEN_UPDATE_RGB32( taitowlf )
{
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("user5")->base();
+ const UINT8 *blit_ram = screen.machine().root_device().memregion("user5")->base();
bitmap.fill(get_black_pen(screen.machine()), cliprect);
@@ -148,7 +148,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
else // disable RAM access (reads go to BIOS ROM)
{
- state->membank("bank1")->set_base(busdevice->machine().region("user1")->base() + 0x30000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("user1")->base() + 0x30000);
}
break;
}
@@ -539,7 +539,7 @@ static MACHINE_START(taitowlf)
static MACHINE_RESET(taitowlf)
{
- machine.root_device().membank("bank1")->set_base(machine.region("user1")->base() + 0x30000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + 0x30000);
}
diff --git a/src/mame/drivers/tank8.c b/src/mame/drivers/tank8.c
index 9e49c66e2c2..d4dbf198ced 100644
--- a/src/mame/drivers/tank8.c
+++ b/src/mame/drivers/tank8.c
@@ -464,10 +464,10 @@ ROM_END
static DRIVER_INIT( decode )
{
- const UINT8* DECODE = machine.region("user1")->base();
+ const UINT8* DECODE = machine.root_device().memregion("user1")->base();
- UINT8* p1 = machine.region("maincpu")->base() + 0x00000;
- UINT8* p2 = machine.region("maincpu")->base() + 0x10000;
+ UINT8* p1 = machine.root_device().memregion("maincpu")->base() + 0x00000;
+ UINT8* p2 = machine.root_device().memregion("maincpu")->base() + 0x10000;
int i;
diff --git a/src/mame/drivers/tankbust.c b/src/mame/drivers/tankbust.c
index 720a84ef51d..3f53472ce85 100644
--- a/src/mame/drivers/tankbust.c
+++ b/src/mame/drivers/tankbust.c
@@ -99,8 +99,8 @@ WRITE8_MEMBER(tankbust_state::tankbust_e0xx_w)
case 7: /* 0xe007 bankswitch */
/* bank 1 at 0x6000-9fff = from 0x10000 when bit0=0 else from 0x14000 */
/* bank 2 at 0xa000-bfff = from 0x18000 when bit0=0 else from 0x1a000 */
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + ((data&1) * 0x4000) );
- membank("bank2")->set_base(machine().region("maincpu")->base() + 0x18000 + ((data&1) * 0x2000) ); /* verified (the game will reset after the "game over" otherwise) */
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + ((data&1) * 0x4000) );
+ membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000 + ((data&1) * 0x2000) ); /* verified (the game will reset after the "game over" otherwise) */
break;
}
}
@@ -115,7 +115,7 @@ READ8_MEMBER(tankbust_state::debug_output_area_r)
static PALETTE_INIT( tankbust )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 128; i++)
diff --git a/src/mame/drivers/taotaido.c b/src/mame/drivers/taotaido.c
index 594ed0a8cfa..a12efd1cbc0 100644
--- a/src/mame/drivers/taotaido.c
+++ b/src/mame/drivers/taotaido.c
@@ -123,7 +123,7 @@ WRITE8_MEMBER(taotaido_state::pending_command_clear_w)
WRITE8_MEMBER(taotaido_state::taotaido_sh_bankswitch_w)
{
- UINT8 *rom = machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
membank("bank1")->set_base(rom + (data & 0x03) * 0x8000);
}
diff --git a/src/mame/drivers/targeth.c b/src/mame/drivers/targeth.c
index 3f5c7e1e2df..01d677a02dc 100644
--- a/src/mame/drivers/targeth.c
+++ b/src/mame/drivers/targeth.c
@@ -51,7 +51,7 @@ static TIMER_DEVICE_CALLBACK(targeth_interrupt )
WRITE16_MEMBER(targeth_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c
index 4ec06e9f152..1ddd71f89dd 100644
--- a/src/mame/drivers/tatsumi.c
+++ b/src/mame/drivers/tatsumi.c
@@ -1284,9 +1284,9 @@ ROM_END
static DRIVER_INIT( apache3 )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src1 = machine.region("gfx2")->base();
- UINT8 *src2 = machine.region("gfx3")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *src2 = state->memregion("gfx3")->base();
int i;
for (i=0; i<0x100000; i+=32) {
@@ -1299,10 +1299,10 @@ static DRIVER_INIT( apache3 )
}
// Copy sprite & palette data out of GFX rom area
- state->m_rom_sprite_lookup1 = machine.region("gfx2")->base();
- state->m_rom_sprite_lookup2 = machine.region("gfx3")->base();
- state->m_rom_clut0 = machine.region("gfx2")->base()+ 0x100000 - 0x800;
- state->m_rom_clut1 = machine.region("gfx3")->base()+ 0x100000 - 0x800;
+ state->m_rom_sprite_lookup1 = machine.root_device().memregion("gfx2")->base();
+ state->m_rom_sprite_lookup2 = machine.root_device().memregion("gfx3")->base();
+ state->m_rom_clut0 = machine.root_device().memregion("gfx2")->base()+ 0x100000 - 0x800;
+ state->m_rom_clut1 = machine.root_device().memregion("gfx3")->base()+ 0x100000 - 0x800;
tatsumi_reset(machine);
@@ -1312,9 +1312,9 @@ static DRIVER_INIT( apache3 )
static DRIVER_INIT( roundup5 )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src1 = machine.region("gfx2")->base();
- UINT8 *src2 = machine.region("gfx3")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *src2 = state->memregion("gfx3")->base();
int i;
for (i=0; i<0xc0000; i+=32) {
@@ -1327,10 +1327,10 @@ static DRIVER_INIT( roundup5 )
}
// Copy sprite & palette data out of GFX rom area
- state->m_rom_sprite_lookup1 = machine.region("gfx2")->base();
- state->m_rom_sprite_lookup2 = machine.region("gfx3")->base();
- state->m_rom_clut0 = machine.region("gfx2")->base()+ 0xc0000 - 0x800;
- state->m_rom_clut1 = machine.region("gfx3")->base()+ 0xc0000 - 0x800;
+ state->m_rom_sprite_lookup1 = machine.root_device().memregion("gfx2")->base();
+ state->m_rom_sprite_lookup2 = machine.root_device().memregion("gfx3")->base();
+ state->m_rom_clut0 = machine.root_device().memregion("gfx2")->base()+ 0xc0000 - 0x800;
+ state->m_rom_clut1 = machine.root_device().memregion("gfx3")->base()+ 0xc0000 - 0x800;
tatsumi_reset(machine);
}
@@ -1338,11 +1338,11 @@ static DRIVER_INIT( roundup5 )
static DRIVER_INIT( cyclwarr )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src1 = machine.region("gfx2")->base();
- int len1 = machine.region("gfx2")->bytes();
- UINT8 *src2 = machine.region("gfx3")->base();
- int len2 = machine.region("gfx3")->bytes();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ int len1 = machine.root_device().memregion("gfx2")->bytes();
+ UINT8 *src2 = machine.root_device().memregion("gfx3")->base();
+ int len2 = state->memregion("gfx3")->bytes();
int i;
for (i=0; i<len1; i+=32) {
memcpy(dst,src1,32);
@@ -1353,19 +1353,19 @@ static DRIVER_INIT( cyclwarr )
src2+=32;
}
- dst = machine.region("maincpu")->base();
+ dst = machine.root_device().memregion("maincpu")->base();
memcpy(state->m_cyclwarr_cpua_ram,dst,8);
state->membank("bank1")->set_base(dst);
- dst = machine.region("sub")->base();
+ dst = machine.root_device().memregion("sub")->base();
memcpy(state->m_cyclwarr_cpub_ram,dst,8);
state->membank("bank2")->set_base(dst);
// Copy sprite & palette data out of GFX rom area
- state->m_rom_sprite_lookup1 = machine.region("gfx2")->base();
- state->m_rom_sprite_lookup2 = machine.region("gfx3")->base();
- state->m_rom_clut0 = machine.region("gfx2")->base() + len1 - 0x1000;
- state->m_rom_clut1 = machine.region("gfx3")->base() + len2 - 0x1000;
+ state->m_rom_sprite_lookup1 = machine.root_device().memregion("gfx2")->base();
+ state->m_rom_sprite_lookup2 = machine.root_device().memregion("gfx3")->base();
+ state->m_rom_clut0 = machine.root_device().memregion("gfx2")->base() + len1 - 0x1000;
+ state->m_rom_clut1 = machine.root_device().memregion("gfx3")->base() + len2 - 0x1000;
tatsumi_reset(machine);
}
diff --git a/src/mame/drivers/tattack.c b/src/mame/drivers/tattack.c
index 397eb6826e9..6c7ab467405 100644
--- a/src/mame/drivers/tattack.c
+++ b/src/mame/drivers/tattack.c
@@ -238,7 +238,7 @@ ROM_END
static DRIVER_INIT(tattack)
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x1b4]=0;
rom[0x1b5]=0;
diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c
index c018b8b9353..2e416c5d44d 100644
--- a/src/mame/drivers/tbowl.c
+++ b/src/mame/drivers/tbowl.c
@@ -34,7 +34,7 @@ note: check this, its borrowed from tecmo.c / wc90.c at the moment and could wel
WRITE8_MEMBER(tbowl_state::tbowlb_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
@@ -44,7 +44,7 @@ WRITE8_MEMBER(tbowl_state::tbowlb_bankswitch_w)
WRITE8_MEMBER(tbowl_state::tbowlc_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("sub")->base();
+ UINT8 *RAM = memregion("sub")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
@@ -166,7 +166,7 @@ static void tbowl_adpcm_int(device_t *device)
tbowl_state *state = device->machine().driver_data<tbowl_state>();
int num = (strcmp(device->tag(), ":msm1") == 0) ? 0 : 1;
if (state->m_adpcm_pos[num] >= state->m_adpcm_end[num] ||
- state->m_adpcm_pos[num] >= device->machine().region("adpcm")->bytes()/2)
+ state->m_adpcm_pos[num] >= state->memregion("adpcm")->bytes()/2)
msm5205_reset_w(device,1);
else if (state->m_adpcm_data[num] != -1)
{
@@ -175,7 +175,7 @@ static void tbowl_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * num;
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * num;
state->m_adpcm_data[num] = ROM[state->m_adpcm_pos[num]++];
msm5205_data_w(device,state->m_adpcm_data[num] >> 4);
diff --git a/src/mame/drivers/tcl.c b/src/mame/drivers/tcl.c
index 33d61e94ed4..4bc5dc9efa7 100644
--- a/src/mame/drivers/tcl.c
+++ b/src/mame/drivers/tcl.c
@@ -189,8 +189,8 @@ static DRIVER_INIT(tcl)
/* only the first part is decrypted (and verified)*/
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *dest = machine.region("maincpu")->base();
- int len = machine.region("maincpu")->bytes();
+ UINT8 *dest = machine.root_device().memregion("maincpu")->base();
+ int len = machine.root_device().memregion("maincpu")->bytes();
UINT8 *src = auto_alloc_array(machine, UINT8, len);
int i,idx=0;
diff --git a/src/mame/drivers/tecmo.c b/src/mame/drivers/tecmo.c
index af0e8aa2903..b80cf9e9abc 100644
--- a/src/mame/drivers/tecmo.c
+++ b/src/mame/drivers/tecmo.c
@@ -55,7 +55,7 @@ f80b ????
WRITE8_MEMBER(tecmo_state::tecmo_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
@@ -86,7 +86,7 @@ static void tecmo_adpcm_int(device_t *device)
{
tecmo_state *state = device->machine().driver_data<tecmo_state>();
if (state->m_adpcm_pos >= state->m_adpcm_end ||
- state->m_adpcm_pos >= device->machine().region("adpcm")->bytes())
+ state->m_adpcm_pos >= state->memregion("adpcm")->bytes())
msm5205_reset_w(device,1);
else if (state->m_adpcm_data != -1)
{
@@ -95,7 +95,7 @@ static void tecmo_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ROM[state->m_adpcm_pos++];
msm5205_data_w(device,state->m_adpcm_data >> 4);
diff --git a/src/mame/drivers/tecmosys.c b/src/mame/drivers/tecmosys.c
index 84a86231f0b..7212ae74f95 100644
--- a/src/mame/drivers/tecmosys.c
+++ b/src/mame/drivers/tecmosys.c
@@ -333,7 +333,7 @@ WRITE8_MEMBER(tecmosys_state::tecmosys_oki_bank_w)
{
UINT8 upperbank = (data & 0x30) >> 4;
UINT8 lowerbank = (data & 0x03) >> 0;
- UINT8* region = machine().region("oki")->base();
+ UINT8* region = memregion("oki")->base();
memcpy( region+0x00000, region+0x80000 + lowerbank * 0x20000, 0x20000 );
memcpy( region+0x20000, region+0x80000 + upperbank * 0x20000, 0x20000 );
@@ -448,7 +448,7 @@ static const ymf262_interface tecmosys_ymf262_interface =
static MACHINE_START( tecmosys )
{
// tecmosys_state *state = machine.driver_data<tecmosys_state>();
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("audiocpu")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base(), 0x4000);
}
static MACHINE_CONFIG_START( deroon, tecmosys_state )
@@ -631,8 +631,8 @@ ROM_END
static void tecmosys_descramble(running_machine &machine)
{
- UINT8 *gfxsrc = machine.region( "gfx1" )->base();
- size_t srcsize = machine.region( "gfx1" )->bytes();
+ UINT8 *gfxsrc = machine.root_device().memregion( "gfx1" )->base();
+ size_t srcsize = machine.root_device().memregion( "gfx1" )->bytes();
int i;
for (i=0; i < srcsize; i+=4)
diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c
index c2f62d9313c..f8be8501f5a 100644
--- a/src/mame/drivers/tehkanwc.c
+++ b/src/mame/drivers/tehkanwc.c
@@ -195,7 +195,7 @@ static void tehkanwc_adpcm_int(device_t *device)
{
tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
- UINT8 *SAMPLES = device->machine().region("adpcm")->base();
+ UINT8 *SAMPLES = state->memregion("adpcm")->base();
int msm_data = SAMPLES[state->m_msm_data_offs & 0x7fff];
if (state->m_toggle == 0)
@@ -707,7 +707,7 @@ static DRIVER_INIT( teedoff )
023A: 00 nop
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x0238] = 0x00;
ROM[0x0239] = 0x00;
diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c
index 3a7cead701d..790f2ad6d75 100644
--- a/src/mame/drivers/tetrisp2.c
+++ b/src/mame/drivers/tetrisp2.c
@@ -117,7 +117,7 @@ READ16_MEMBER(tetrisp2_state::rockn_adpcmbank_r)
WRITE16_MEMBER(tetrisp2_state::rockn_adpcmbank_w)
{
- UINT8 *SNDROM = machine().region("ymz")->base();
+ UINT8 *SNDROM = memregion("ymz")->base();
int bank;
m_rockn_adpcmbank = data;
@@ -134,7 +134,7 @@ WRITE16_MEMBER(tetrisp2_state::rockn_adpcmbank_w)
WRITE16_MEMBER(tetrisp2_state::rockn2_adpcmbank_w)
{
- UINT8 *SNDROM = machine().region("ymz")->base();
+ UINT8 *SNDROM = memregion("ymz")->base();
int bank;
char banktable[9][3]=
@@ -181,13 +181,13 @@ WRITE16_MEMBER(tetrisp2_state::nndmseal_sound_bank_w)
if (ACCESSING_BITS_0_7)
{
- UINT8 *rom = machine().region("okisource")->base();
+ UINT8 *rom = memregion("okisource")->base();
if (data & 0x04)
{
m_bank_lo = data & 0x03;
- memcpy(machine().region("oki")->base(), rom + (m_bank_lo * 0x80000), 0x20000);
+ memcpy(machine().root_device().memregion("oki")->base(), rom + (m_bank_lo * 0x80000), 0x20000);
// logerror("PC:%06X sound bank_lo = %02X\n",cpu_get_pc(&space.device()),m_bank_lo);
}
@@ -195,7 +195,7 @@ WRITE16_MEMBER(tetrisp2_state::nndmseal_sound_bank_w)
{
m_bank_hi = data & 0x03;
- memcpy(machine().region("oki")->base() + 0x20000, rom + (m_bank_lo * 0x80000) + (m_bank_hi * 0x20000), 0x20000);
+ memcpy(machine().root_device().memregion("oki")->base() + 0x20000, rom + (m_bank_lo * 0x80000) + (m_bank_hi * 0x20000), 0x20000);
// logerror("PC:%06X sound bank_hi = %02X\n",cpu_get_pc(&space.device()),m_bank_hi);
}
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index c1ed81787c8..2313439f89c 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -53,7 +53,7 @@ WRITE8_MEMBER(thedeep_state::thedeep_sound_w)
static MACHINE_RESET( thedeep )
{
thedeep_state *state = machine.driver_data<thedeep_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 + 0 * 0x4000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x10000 + 0 * 0x4000);
state->m_scroll[0] = 0;
state->m_scroll[1] = 0;
state->m_scroll[2] = 0;
@@ -86,7 +86,7 @@ WRITE8_MEMBER(thedeep_state::thedeep_protection_w)
int new_rombank = m_protection_command & 3;
if (m_rombank == new_rombank) break;
m_rombank = new_rombank;
- rom = machine().region("maincpu")->base();
+ rom = memregion("maincpu")->base();
membank("bank1")->set_base(rom + 0x10000 + m_rombank * 0x4000);
/* there's code which falls through from the fixed ROM to bank #1, I have to */
/* copy it there otherwise the CPU bank switching support will not catch it. */
@@ -116,7 +116,7 @@ WRITE8_MEMBER(thedeep_state::thedeep_protection_w)
// d166-d174: hl = (hl + 2*a)
// d175-d181: hl *= e (e must be non zero)
// d182-d19a: hl /= de
- m_protection_data = machine().region("mcu")->base()[0x185+m_protection_index++];
+ m_protection_data = memregion("mcu")->base()[0x185+m_protection_index++];
else
m_protection_data = 0xc9;
@@ -197,7 +197,7 @@ static void thedeep_maincpu_bankswitch(running_machine &machine,UINT8 bank_trig)
if (state->m_rombank == new_rombank)
return;
state->m_rombank = new_rombank;
- rom = machine.region("maincpu")->base();
+ rom = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(rom + 0x10000 + state->m_rombank * 0x4000);
/* there's code which falls through from the fixed ROM to bank #1, I have to */
/* copy it there otherwise the CPU bank switching support will not catch it. */
diff --git a/src/mame/drivers/thepit.c b/src/mame/drivers/thepit.c
index 884fbe89639..8b29dac92b2 100644
--- a/src/mame/drivers/thepit.c
+++ b/src/mame/drivers/thepit.c
@@ -1080,7 +1080,7 @@ READ8_MEMBER(thepit_state::rtriv_question_r)
// Read the actual byte from question roms
else if((offset & 0xc00) == 0xc00)
{
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
int real_address;
real_address = (0x8000 * m_question_rom) | m_question_address | (offset & 0x3f0) | m_remap_address[offset & 0x0f];
diff --git a/src/mame/drivers/thief.c b/src/mame/drivers/thief.c
index 3c9fb6e2f0a..a2756914a6d 100644
--- a/src/mame/drivers/thief.c
+++ b/src/mame/drivers/thief.c
@@ -636,8 +636,8 @@ ROM_END
static DRIVER_INIT( thief )
{
- UINT8 *dest = machine.region( "maincpu" )->base();
- const UINT8 *source = machine.region( "cpu1" )->base();
+ UINT8 *dest = machine.root_device().memregion( "maincpu" )->base();
+ const UINT8 *source = machine.root_device().memregion( "cpu1" )->base();
/* C8 is mapped (banked) in CPU1's address space; it contains Z80 code */
memcpy( &dest[0xe010], &source[0x290], 0x20 );
diff --git a/src/mame/drivers/thoop2.c b/src/mame/drivers/thoop2.c
index cf63bc7dc7d..c258da5d174 100644
--- a/src/mame/drivers/thoop2.c
+++ b/src/mame/drivers/thoop2.c
@@ -51,7 +51,7 @@ GFXDECODE_END
WRITE16_MEMBER(thoop2_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c
index 932b0be4b09..6e256acdf48 100644
--- a/src/mame/drivers/thunderx.c
+++ b/src/mame/drivers/thunderx.c
@@ -315,7 +315,7 @@ WRITE8_MEMBER(thunderx_state::thunderx_1f98_w)
WRITE8_MEMBER(thunderx_state::scontra_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int offs;
//logerror("%04x: bank switch %02x\n",cpu_get_pc(&space.device()),data);
@@ -624,7 +624,7 @@ static MACHINE_START( scontra )
static MACHINE_START( thunderx )
{
thunderx_state *state = machine.driver_data<thunderx_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000);
state->membank("bank1")->configure_entries(12, 4, &ROM[0x08000], 0x2000);
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index ac85b8f9b73..f7454b08fb8 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -380,7 +380,7 @@ static void tmaster_draw(running_machine &machine)
tmaster_state *state = machine.driver_data<tmaster_state>();
int x,y,x0,x1,y0,y1,dx,dy,flipx,flipy,sx,sy,sw,sh, addr, mode, layer,buffer, color;
- UINT8 *gfxdata = machine.region( "blitter" )->base() + state->m_gfx_offs;
+ UINT8 *gfxdata = state->memregion( "blitter" )->base() + state->m_gfx_offs;
UINT16 pen;
@@ -642,12 +642,12 @@ WRITE16_MEMBER(tmaster_state::galgames_palette_data_w)
// Sound
READ16_MEMBER(tmaster_state::galgames_okiram_r)
{
- return machine().region("oki")->base()[offset] | 0xff00;
+ return memregion("oki")->base()[offset] | 0xff00;
}
WRITE16_MEMBER(tmaster_state::galgames_okiram_w)
{
if (ACCESSING_BITS_0_7)
- machine().region("oki")->base()[offset] = data & 0xff;
+ memregion("oki")->base()[offset] = data & 0xff;
}
// Carts (preliminary, PIC communication is not implemented)
@@ -882,7 +882,7 @@ static MACHINE_RESET( tmaster )
{
tmaster_state *state = machine.driver_data<tmaster_state>();
state->m_gfx_offs = 0;
- state->m_gfx_size = machine.region("blitter")->bytes();
+ state->m_gfx_size = state->memregion("blitter")->bytes();
state->m_duart68681 = machine.device( "duart68681" );
}
@@ -1621,7 +1621,7 @@ ROM_END
static DRIVER_INIT( tm4k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x834ce/2] = 0x4e75;
@@ -1642,7 +1642,7 @@ Protection resembles that of tm5k rather than tm4ka:
static DRIVER_INIT( tm4ka )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x83476/2] = 0x4e75;
@@ -1664,7 +1664,7 @@ Protection starts:
static DRIVER_INIT( tm4kb )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x82b7a/2] = 0x4e75;
@@ -1685,7 +1685,7 @@ Protection starts:
static DRIVER_INIT( tm5k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x96002/2] = 0x4e75;
@@ -1708,7 +1708,7 @@ Protection starts:
static DRIVER_INIT( tm5kca )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x95ffe/2] = 0x4e75;
@@ -1720,7 +1720,7 @@ static DRIVER_INIT( tm5kca )
static DRIVER_INIT( tm5ka )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x96b30/2] = 0x4e75;
@@ -1741,7 +1741,7 @@ Protection starts:
static DRIVER_INIT( tm7k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x81730/2] = 0x4e75;
@@ -1764,7 +1764,7 @@ Protection starts:
static DRIVER_INIT( tm7ka )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x81594/2] = 0x4e75;
@@ -1787,7 +1787,7 @@ Protection starts:
static DRIVER_INIT( tm7keval ) /* kit came with a security key labeled A-21657-004, which is a TM5000 key */
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x8949e/2] = 0x4e75;
@@ -1810,7 +1810,7 @@ Protection starts:
static DRIVER_INIT( tm8k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x78b70/2] = 0x4e75;
@@ -1834,7 +1834,7 @@ Protection starts:
static DRIVER_INIT( galgames )
{
tmaster_state *state = machine.driver_data<tmaster_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int cart;
// RAM bank at 0x000000-0x03ffff and 0x200000-0x23ffff
@@ -1856,9 +1856,9 @@ static DRIVER_INIT( galgames )
for (cart = 1; cart <= 4; cart++)
{
- UINT8 *CART = machine.region("maincpu")->base();
+ UINT8 *CART = machine.root_device().memregion("maincpu")->base();
- if (0x200000 * (cart+1) <= machine.region("maincpu")->bytes())
+ if (0x200000 * (cart+1) <= state->memregion("maincpu")->bytes())
CART += 0x200000 * cart;
state->membank(GALGAMES_BANK_200000_R)->configure_entry(GALGAMES_ROM0+cart, CART);
@@ -1868,7 +1868,7 @@ static DRIVER_INIT( galgames )
static DRIVER_INIT( galgame2 )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// Patch BIOS to see the game code as first cartridge (until the PIC therein is emulated)
ROM[0x118da/2] = 0x4a06;
diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c
index ce54e8ad7aa..394711ba80a 100644
--- a/src/mame/drivers/tmmjprd.c
+++ b/src/mame/drivers/tmmjprd.c
@@ -290,7 +290,7 @@ static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap,
static SCREEN_UPDATE_IND16( tmmjprd_left )
{
tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>();
- UINT8* gfxroms = screen.machine().region("gfx2")->base();
+ UINT8* gfxroms = state->memregion("gfx2")->base();
bitmap.fill(get_black_pen(screen.machine()), cliprect);
@@ -325,7 +325,7 @@ static SCREEN_UPDATE_IND16( tmmjprd_left )
static SCREEN_UPDATE_IND16( tmmjprd_right )
{
tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>();
- UINT8* gfxroms = screen.machine().region("gfx2")->base();
+ UINT8* gfxroms = state->memregion("gfx2")->base();
bitmap.fill(get_black_pen(screen.machine()), cliprect);
@@ -385,7 +385,7 @@ static TIMER_CALLBACK( tmmjprd_blit_done )
static void tmmjprd_do_blit(running_machine &machine)
{
tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
- UINT8 *blt_data = machine.region("gfx1")->base();
+ UINT8 *blt_data = state->memregion("gfx1")->base();
int blt_source = (tmmjprd_blitterregs[0]&0x000fffff)>>0;
int blt_column = (tmmjprd_blitterregs[1]&0x00ff0000)>>16;
int blt_line = (tmmjprd_blitterregs[1]&0x000000ff);
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index a0f28a2ceb3..8efaa2389b5 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -278,7 +278,7 @@ static SAMPLES_START( tmnt_decode_sample )
running_machine &machine = device.machine();
tmnt_state *state = machine.driver_data<tmnt_state>();
int i;
- UINT8 *source = machine.region("title")->base();
+ UINT8 *source = state->memregion("title")->base();
state->save_item(NAME(state->m_sampledata));
@@ -925,7 +925,7 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w)
CellSrc = m_tmnt2_1c0800[0x00] | (m_tmnt2_1c0800[0x01] << 16 );
// if (CellDest >= 0x180000 && CellDest < 0x183fe0) {
CellVar -= 0x104000;
- src = (UINT16 *)(machine().region("maincpu")->base() + CellSrc);
+ src = (UINT16 *)(machine().root_device().memregion("maincpu")->base() + CellSrc);
CellVar >>= 1;
@@ -2604,7 +2604,7 @@ static const k054539_interface k054539_config =
static MACHINE_START( prmrsocr )
{
MACHINE_START_CALL(common);
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
}
@@ -4079,8 +4079,8 @@ static DRIVER_INIT( mia )
be shuffled around because the ROMs are connected differently to the
051962 custom IC.
*/
- gfxdata = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ gfxdata = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4100,8 +4100,8 @@ static DRIVER_INIT( mia )
be shuffled around because the ROMs are connected differently to the
051937 custom IC.
*/
- gfxdata = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ gfxdata = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4172,8 +4172,8 @@ static DRIVER_INIT( tmnt )
be shuffled around because the ROMs are connected differently to the
051962 custom IC.
*/
- gfxdata = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ gfxdata = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4193,8 +4193,8 @@ static DRIVER_INIT( tmnt )
be shuffled around because the ROMs are connected differently to the
051937 custom IC.
*/
- gfxdata = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ gfxdata = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4211,7 +4211,7 @@ static DRIVER_INIT( tmnt )
temp = auto_alloc_array(machine, UINT8, len);
memcpy(temp, gfxdata, len);
- code_conv_table = &machine.region("proms")->base()[0x0000];
+ code_conv_table = &machine.root_device().memregion("proms")->base()[0x0000];
for (A = 0; A < len / 4; A++)
{
#define CA0 0
diff --git a/src/mame/drivers/tmspoker.c b/src/mame/drivers/tmspoker.c
index 29abb47019f..816442115cc 100644
--- a/src/mame/drivers/tmspoker.c
+++ b/src/mame/drivers/tmspoker.c
@@ -293,7 +293,7 @@ static INTERRUPT_GEN( tmspoker_interrupt )
static MACHINE_START( tmspoker )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 2, &ROM[0], 0x1000);
}
@@ -615,8 +615,8 @@ static DRIVER_INIT( bus )
{
/* decode the TMS9980 ROMs */
offs_t offs;
- UINT8 *rom = machine.region("maincpu")->base();
- const size_t len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ const size_t len = machine.root_device().memregion("maincpu")->bytes();
for (offs = 0; offs < len; offs++)
{
diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c
index 566f42c9272..34489fd8905 100644
--- a/src/mame/drivers/tnzs.c
+++ b/src/mame/drivers/tnzs.c
@@ -639,7 +639,7 @@ static SAMPLES_START( kageki_init_samples )
int start, size;
int i, n;
- src = machine.region("samples")->base() + 0x0090;
+ src = state->memregion("samples")->base() + 0x0090;
for (i = 0; i < MAX_SAMPLES; i++)
{
start = (src[(i * 2) + 1] * 256) + src[(i * 2)];
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index c93eccc3ffb..05d1a0ecfdb 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -431,7 +431,7 @@ static DRIVER_INIT( fixeight )
static DRIVER_INIT( fixeightbl )
{
- UINT8 *ROM = machine.region("oki")->base();
+ UINT8 *ROM = machine.root_device().memregion("oki")->base();
machine.root_device().membank("bank1")->configure_entries(0, 5, &ROM[0x30000], 0x10000);
}
@@ -447,7 +447,7 @@ static DRIVER_INIT( vfive )
static DRIVER_INIT( pipibibsbl )
{
- UINT16 *ROM = (UINT16 *)(machine.region("maincpu")->base());
+ UINT16 *ROM = (UINT16 *)(machine.root_device().memregion("maincpu")->base());
for (int i = 0; i < (0x040000/2); i += 4)
{
@@ -461,7 +461,7 @@ static DRIVER_INIT( pipibibsbl )
static DRIVER_INIT( bgaregga )
{
- UINT8 *Z80 = machine.region("audiocpu")->base();
+ UINT8 *Z80 = machine.root_device().memregion("audiocpu")->base();
// seems to only use banks 0x0a to 0x0f
machine.root_device().membank("bank1")->configure_entries(8, 8, Z80, 0x4000);
@@ -471,7 +471,7 @@ static DRIVER_INIT( bgaregga )
static DRIVER_INIT( batrider )
{
toaplan2_state *state = machine.driver_data<toaplan2_state>();
- UINT8 *Z80 = machine.region("audiocpu")->base();
+ UINT8 *Z80 = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 16, Z80, 0x4000);
state->m_sndirq_line = 4;
@@ -909,7 +909,7 @@ WRITE16_MEMBER(toaplan2_state::batrider_z80_busreq_w)
READ16_MEMBER(toaplan2_state::batrider_z80rom_r)
{
- UINT8 *Z80 = machine().region("audiocpu")->base();
+ UINT8 *Z80 = memregion("audiocpu")->base();
return Z80[offset];
}
diff --git a/src/mame/drivers/toki.c b/src/mame/drivers/toki.c
index 80701106e1e..7c6f51d9e51 100644
--- a/src/mame/drivers/toki.c
+++ b/src/mame/drivers/toki.c
@@ -71,7 +71,7 @@ static void toki_adpcm_int (device_t *device)
static WRITE8_DEVICE_HANDLER( toki_adpcm_control_w )
{
int bankaddress;
- UINT8 *RAM = device->machine().region("audiocpu")->base();
+ UINT8 *RAM = device->machine().root_device().memregion("audiocpu")->base();
/* the code writes either 2 or 3 in the bottom two bits */
@@ -738,7 +738,7 @@ ROM_END
static DRIVER_INIT( toki )
{
- UINT8 *ROM = machine.region("oki")->base();
+ UINT8 *ROM = machine.root_device().memregion("oki")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x20000);
int i;
@@ -761,14 +761,14 @@ static DRIVER_INIT( tokib )
UINT8 *rom;
/* invert the sprite data in the ROMs */
- len = machine.region("gfx2")->bytes();
- rom = machine.region("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
for (i = 0; i < len; i++)
rom[i] ^= 0xff;
/* merge background tile graphics together */
- len = machine.region("gfx3")->bytes();
- rom = machine.region("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
for (offs = 0; offs < len; offs += 0x20000)
{
UINT8 *base = &rom[offs];
@@ -781,8 +781,8 @@ static DRIVER_INIT( tokib )
memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800);
}
}
- len = machine.region("gfx4")->bytes();
- rom = machine.region("gfx4")->base();
+ len = machine.root_device().memregion("gfx4")->bytes();
+ rom = machine.root_device().memregion("gfx4")->base();
for (offs = 0; offs < len; offs += 0x20000)
{
UINT8 *base = &rom[offs];
@@ -804,7 +804,7 @@ static DRIVER_INIT(jujub)
/* Program ROMs are bitswapped */
{
int i;
- UINT16 *prgrom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *prgrom = (UINT16*)machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x60000/2; i++)
{
@@ -819,7 +819,7 @@ static DRIVER_INIT(jujub)
{
address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x20000);
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
int i;
memcpy(decrypt,rom,0x20000);
@@ -834,7 +834,7 @@ static DRIVER_INIT(jujub)
}
{
- UINT8 *ROM = machine.region("oki")->base();
+ UINT8 *ROM = machine.root_device().memregion("oki")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x20000);
int i;
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index fb31e9236d6..6610183c547 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -412,7 +412,7 @@ static void topspeed_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0x1ffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
@@ -646,7 +646,7 @@ static MACHINE_START( topspeed )
{
topspeed_state *state = machine.driver_data<topspeed_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_subcpu = machine.device("sub");
diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c
index 8015ec9def8..486b3df30b8 100644
--- a/src/mame/drivers/trackfld.c
+++ b/src/mame/drivers/trackfld.c
@@ -1424,7 +1424,7 @@ static DRIVER_INIT( trackfld )
static DRIVER_INIT( atlantol )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt;
int A;
@@ -1454,7 +1454,7 @@ static DRIVER_INIT( atlantol )
static DRIVER_INIT( mastkin )
{
- UINT8 *prom = machine.region("proms")->base();
+ UINT8 *prom = machine.root_device().memregion("proms")->base();
int i;
/* build a fake palette so the screen won't be all black */
@@ -1475,14 +1475,14 @@ static DRIVER_INIT( mastkin )
static DRIVER_INIT( wizzquiz )
{
- UINT8 *ROM = machine.region("maincpu")->base() + 0xe000;
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base() + 0xe000;
int i;
/* decrypt program rom */
for (i = 0; i < 0x2000; i++)
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
- ROM = machine.region("user1")->base();
+ ROM = machine.root_device().memregion("user1")->base();
/* decrypt questions roms */
for (i = 0; i < 0x40000; i++)
diff --git a/src/mame/drivers/travrusa.c b/src/mame/drivers/travrusa.c
index 4fc25c9b448..3027a27015b 100644
--- a/src/mame/drivers/travrusa.c
+++ b/src/mame/drivers/travrusa.c
@@ -453,7 +453,7 @@ ROM_END
static DRIVER_INIT( motorace )
{
int A, j;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(buffer, rom, 0x2000);
@@ -471,7 +471,7 @@ static DRIVER_INIT( motorace )
static DRIVER_INIT( shtridra )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* D3/D4 and D5/D6 swapped */
for (A = 0; A < 0x2000; A++)
diff --git a/src/mame/drivers/trucocl.c b/src/mame/drivers/trucocl.c
index 06320d9542a..b4c0147ea5d 100644
--- a/src/mame/drivers/trucocl.c
+++ b/src/mame/drivers/trucocl.c
@@ -52,7 +52,7 @@ static TIMER_CALLBACK( dac_irq )
static WRITE8_DEVICE_HANDLER( audio_dac_w )
{
trucocl_state *state = device->machine().driver_data<trucocl_state>();
- UINT8 *rom = device->machine().region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int dac_address = ( data & 0xf0 ) << 8;
int sel = ( ( (~data) >> 1 ) & 2 ) | ( data & 1 );
diff --git a/src/mame/drivers/trvmadns.c b/src/mame/drivers/trvmadns.c
index d6f2b3bf948..fbcb34c87f2 100644
--- a/src/mame/drivers/trvmadns.c
+++ b/src/mame/drivers/trvmadns.c
@@ -98,7 +98,7 @@ WRITE8_MEMBER(trvmadns_state::trvmadns_banking_w)
}
else if((data & 0xf0) == 0x80 || (data & 0xf0) == 0x90)
{
- rom = machine().region("user2")->base();
+ rom = memregion("user2")->base();
switch(data & 0xf)
{
@@ -126,7 +126,7 @@ WRITE8_MEMBER(trvmadns_state::trvmadns_banking_w)
//logerror("port80 = %02X\n",data);
}
- rom = machine().region("user1")->base();
+ rom = memregion("user1")->base();
/*
7
diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c
index 75beeba297d..58f50b47c96 100644
--- a/src/mame/drivers/trvquest.c
+++ b/src/mame/drivers/trvquest.c
@@ -45,7 +45,7 @@ static READ8_HANDLER( trvquest_question_r )
{
gameplan_state *state = space->machine().driver_data<gameplan_state>();
- return space->machine().region("questions")->base()[*state->m_trvquest_question * 0x2000 + offset];
+ return state->memregion("questions")->base()[*state->m_trvquest_question * 0x2000 + offset];
}
static WRITE8_DEVICE_HANDLER( trvquest_coin_w )
diff --git a/src/mame/drivers/tryout.c b/src/mame/drivers/tryout.c
index 184ae234ddf..30a870e3d01 100644
--- a/src/mame/drivers/tryout.c
+++ b/src/mame/drivers/tryout.c
@@ -45,7 +45,7 @@ WRITE8_MEMBER(tryout_state::tryout_sound_irq_ack_w)
WRITE8_MEMBER(tryout_state::tryout_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x01) * 0x2000;
diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c
index c4427f369c8..a8af40ac405 100644
--- a/src/mame/drivers/ttchamp.c
+++ b/src/mame/drivers/ttchamp.c
@@ -109,7 +109,7 @@ WRITE16_MEMBER(ttchamp_state::paloff_w)
WRITE16_MEMBER(ttchamp_state::pcup_prgbank_w)
{
int bank;
- UINT8 *ROM1 = machine().region("user1")->base();
+ UINT8 *ROM1 = memregion("user1")->base();
if (ACCESSING_BITS_0_7)
{
@@ -337,7 +337,7 @@ ROM_END
static DRIVER_INIT (ttchamp)
{
- UINT8 *ROM1 = machine.region("user1")->base();
+ UINT8 *ROM1 = machine.root_device().memregion("user1")->base();
machine.root_device().membank("bank1")->set_base(&ROM1[0x120000]);
machine.root_device().membank("bank2")->set_base(&ROM1[0x180000]);
}
diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c
index b1b245b5e77..63846dd7289 100644
--- a/src/mame/drivers/tugboat.c
+++ b/src/mame/drivers/tugboat.c
@@ -51,7 +51,7 @@ public:
just four 1k resistors. */
static PALETTE_INIT( tugboat )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 4ed8704e407..7ef620a4e02 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -490,7 +490,7 @@ static const int tumbleb_sound_lookup[256] = {
/* we use channels 1,2,3 for sound effects, and channel 4 for music */
static void tumbleb2_set_music_bank( running_machine &machine, int bank )
{
- UINT8 *oki = machine.region("oki")->base();
+ UINT8 *oki = machine.root_device().memregion("oki")->base();
memcpy(&oki[0x38000], &oki[0x80000 + 0x38000 + 0x8000 * bank], 0x8000);
}
@@ -783,7 +783,7 @@ WRITE16_MEMBER(tumbleb_state::semicom_soundcmd_w)
WRITE8_MEMBER(tumbleb_state::oki_sound_bank_w)
{
- UINT8 *oki = machine().region("oki")->base();
+ UINT8 *oki = memregion("oki")->base();
memcpy(&oki[0x30000], &oki[(data * 0x10000) + 0x40000], 0x10000);
}
@@ -808,7 +808,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(tumbleb_state::jumppop_z80_bank_w)
{
- membank("bank1")->set_base(machine().region("audiocpu")->base() + 0x10000 + (0x4000 * data));
+ membank("bank1")->set_base(machine().root_device().memregion("audiocpu")->base() + 0x10000 + (0x4000 * data));
}
static ADDRESS_MAP_START( jumppop_sound_map, AS_PROGRAM, 8, tumbleb_state )
@@ -856,8 +856,8 @@ ADDRESS_MAP_END
WRITE8_MEMBER(tumbleb_state::jumpkids_oki_bank_w)
{
- UINT8* sound1 = machine().region("oki")->base();
- UINT8* sound2 = machine().region("oki2")->base();
+ UINT8* sound1 = memregion("oki")->base();
+ UINT8* sound2 = memregion("oki2")->base();
int bank = data & 0x03;
memcpy(sound1 + 0x20000, sound2 + bank * 0x20000, 0x20000);
@@ -2227,8 +2227,8 @@ static MACHINE_RESET (htchctch)
tumbleb_state *state = machine.driver_data<tumbleb_state>();
/* copy protection data every reset */
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
- int i, len = machine.region("user1")->bytes();
+ UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
+ int i, len = state->memregion("user1")->bytes();
for (i = 0; i < len / 2; i++)
state->m_mainram[0x000/2 + i] = PROTDATA[i];
@@ -3362,7 +3362,7 @@ ROM_END
void tumblepb_patch_code(running_machine &machine, UINT16 offset)
{
/* A hack which enables all Dip Switches effects */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[(offset + 0)/2] = 0x0240;
RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0
}
@@ -3371,8 +3371,8 @@ void tumblepb_patch_code(running_machine &machine, UINT16 offset)
static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
@@ -3429,7 +3429,7 @@ static DRIVER_INIT( fncywld )
#if FNCYWLD_HACK
/* This is a hack to allow you to use the extra features
of the 2 first "Unused" Dip Switch (see notes above). */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0x0005fa/2] = 0x4e71;
RAM[0x00060a/2] = 0x4e71;
#endif
@@ -3456,9 +3456,9 @@ static DRIVER_INIT( htchctch )
{
tumbleb_state *state = machine.driver_data<tumbleb_state>();
-// UINT16 *HCROM = (UINT16*)machine.region("maincpu")->base();
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
- int i, len = machine.region("user1")->bytes();
+// UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
+ UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
+ int i, len = state->memregion("user1")->bytes();
/* simulate RAM initialization done by the protection MCU */
/* verified on real hardware */
// static const UINT16 htchctch_mcu68k[] =
@@ -3710,7 +3710,7 @@ static DRIVER_INIT( htchctch )
static void suprtrio_decrypt_code(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
UINT16 *buf = auto_alloc_array(machine, UINT16, 0x80000/2);
int i;
@@ -3728,7 +3728,7 @@ static void suprtrio_decrypt_code(running_machine &machine)
static void suprtrio_decrypt_gfx(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("gfx1")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("gfx1")->base();
UINT16 *buf = auto_alloc_array(machine, UINT16, 0x100000/2);
int i;
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index ec9ed274f33..dcd50d91d5f 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -389,7 +389,7 @@ ROM_END
void tumblep_patch_code(UINT16 offset)
{
/* A hack which enables all Dip Switches effects */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[(offset + 0)/2] = 0x0240;
RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0
}
diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c
index 7a745942b04..24954ed8503 100644
--- a/src/mame/drivers/turbo.c
+++ b/src/mame/drivers/turbo.c
@@ -1627,7 +1627,7 @@ static void turbo_rom_decode(running_machine &machine)
2,1,2,1 /* 0x5000-0x5fff */
};
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int offs, i, j;
UINT8 src;
diff --git a/src/mame/drivers/tutankhm.c b/src/mame/drivers/tutankhm.c
index 792b4f95166..d923d09a668 100644
--- a/src/mame/drivers/tutankhm.c
+++ b/src/mame/drivers/tutankhm.c
@@ -198,7 +198,7 @@ static MACHINE_START( tutankhm )
{
tutankhm_state *state = machine.driver_data<tutankhm_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("maincpu")->base() + 0x10000, 0x1000);
state->m_maincpu = machine.device<cpu_device>("maincpu");
diff --git a/src/mame/drivers/twin16.c b/src/mame/drivers/twin16.c
index a6a1cce64f2..0ed1e5f81a0 100644
--- a/src/mame/drivers/twin16.c
+++ b/src/mame/drivers/twin16.c
@@ -88,7 +88,7 @@ WRITE16_MEMBER(twin16_state::videoram16_w)
READ16_MEMBER(twin16_state::extra_rom_r)
{
- return ((UINT16 *)machine().region("gfx3")->base())[offset];
+ return ((UINT16 *)machine().root_device().memregion("gfx3")->base())[offset];
}
READ16_MEMBER(twin16_state::twin16_gfx_rom1_r)
@@ -1305,7 +1305,7 @@ static void gfx_untangle( running_machine &machine )
int i;
UINT16 *temp = auto_alloc_array(machine, UINT16, 0x200000/2);
- state->m_gfx_rom = (UINT16 *)machine.region("gfx2")->base();
+ state->m_gfx_rom = (UINT16 *)state->memregion("gfx2")->base();
memcpy( temp, state->m_gfx_rom, 0x200000 );
for( i=0; i<0x080000; i++ )
diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c
index 5449e2b50e9..9de55c7018c 100644
--- a/src/mame/drivers/twinkle.c
+++ b/src/mame/drivers/twinkle.c
@@ -712,14 +712,14 @@ WRITE16_MEMBER(twinkle_state::twinkle_spu_ctrl_w)
READ16_MEMBER(twinkle_state::twinkle_waveram_r)
{
- UINT16 *waveram = (UINT16 *)machine().region("rfsnd")->base();
+ UINT16 *waveram = (UINT16 *)machine().root_device().memregion("rfsnd")->base();
return waveram[offset];
}
WRITE16_MEMBER(twinkle_state::twinkle_waveram_w)
{
- UINT16 *waveram = (UINT16 *)machine().region("rfsnd")->base();
+ UINT16 *waveram = (UINT16 *)machine().root_device().memregion("rfsnd")->base();
COMBINE_DATA(&waveram[offset]);
}
diff --git a/src/mame/drivers/umipoker.c b/src/mame/drivers/umipoker.c
index b37abea7e5a..fa61bd5cea0 100644
--- a/src/mame/drivers/umipoker.c
+++ b/src/mame/drivers/umipoker.c
@@ -149,7 +149,7 @@ static SCREEN_UPDATE_IND16( umipoker )
READ8_MEMBER(umipoker_state::z80_rom_readback_r)
{
- UINT8 *ROM = machine().region("audiocpu")->base();
+ UINT8 *ROM = memregion("audiocpu")->base();
return ROM[offset];
}
diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c
index 358fad4d924..019e1cc11be 100644
--- a/src/mame/drivers/undrfire.c
+++ b/src/mame/drivers/undrfire.c
@@ -970,8 +970,8 @@ ROM_END
static DRIVER_INIT( undrfire )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx3")->base();
- int size=machine.region("gfx3")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int size=machine.root_device().memregion("gfx3")->bytes();
int data;
/* make piv tile GFX format suitable for gfxdecode */
@@ -999,8 +999,8 @@ static DRIVER_INIT( undrfire )
static DRIVER_INIT( cbombers )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx3")->base();
- int size=machine.region("gfx3")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int size=machine.root_device().memregion("gfx3")->bytes();
int data;
diff --git a/src/mame/drivers/unico.c b/src/mame/drivers/unico.c
index 98ee864c00c..5d658951733 100644
--- a/src/mame/drivers/unico.c
+++ b/src/mame/drivers/unico.c
@@ -91,7 +91,7 @@ WRITE16_MEMBER(unico_state::zeropnt_sound_bank_w)
contains garbage. Indeed, only banks 0&1 are used */
int bank = (data >> 8 ) & 1;
- UINT8 *dst = machine().region("oki")->base();
+ UINT8 *dst = memregion("oki")->base();
UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
@@ -180,7 +180,7 @@ WRITE32_MEMBER(unico_state::zeropnt2_sound_bank_w)
if (ACCESSING_BITS_24_31)
{
int bank = ((data >> 24) & 3) % 4;
- UINT8 *dst = machine().region("oki1")->base();
+ UINT8 *dst = memregion("oki1")->base();
UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
}
diff --git a/src/mame/drivers/upscope.c b/src/mame/drivers/upscope.c
index 7018c6c5731..ff20fac87fc 100644
--- a/src/mame/drivers/upscope.c
+++ b/src/mame/drivers/upscope.c
@@ -405,7 +405,7 @@ static DRIVER_INIT( upscope )
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
}
diff --git a/src/mame/drivers/usgames.c b/src/mame/drivers/usgames.c
index 2c20b4e848a..eb9a3e3a588 100644
--- a/src/mame/drivers/usgames.c
+++ b/src/mame/drivers/usgames.c
@@ -33,7 +33,7 @@ Sound: AY-3-8912
WRITE8_MEMBER(usgames_state::usgames_rombank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
// logerror ("BANK WRITE? -%02x-\n",data);
//popmessage("%02x",data);
diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c
index 6af2312ec41..180bd0cca21 100644
--- a/src/mame/drivers/vaportra.c
+++ b/src/mame/drivers/vaportra.c
@@ -855,7 +855,7 @@ C3D54*
static DRIVER_INIT( vaportra )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0x00000; i < 0x80000; i++)
diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c
index bc4b0a56622..bc2fdda5987 100644
--- a/src/mame/drivers/vball.c
+++ b/src/mame/drivers/vball.c
@@ -157,7 +157,7 @@ WRITE8_MEMBER(vball_state::vball_irq_ack_w)
*/
WRITE8_MEMBER(vball_state::vb_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
membank("bank1")->set_base(&RAM[0x10000 + (0x4000 * (data & 1))]);
if (m_gfxset != ((data & 0x20) ^ 0x20))
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 7ba1080ef3a..17ff01f2895 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -439,7 +439,7 @@ DIRECT_UPDATE_MEMBER(vcombat_state::vcombat_vid_1_direct_handler)
static DRIVER_INIT( vcombat )
{
vcombat_state *state = machine.driver_data<vcombat_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
/* The two i860s execute out of RAM */
address_space *space = machine.device<i860_device>("vid_0")->space(AS_PROGRAM);
diff --git a/src/mame/drivers/vega.c b/src/mame/drivers/vega.c
index 991a3713a6f..7848c6ddf2b 100644
--- a/src/mame/drivers/vega.c
+++ b/src/mame/drivers/vega.c
@@ -106,7 +106,7 @@ UINT8 ascii_to_bin( UINT8 ascii )
DRIVER_INIT(vegaa)
{
UINT8* buf = (UINT8*)malloc(0x10000);
- UINT8* rom = machine.region("maincpu")->base();
+ UINT8* rom = machine.root_device().memregion("maincpu")->base();
int i;
int count = 0;
// last 0xc bytes of file are just some settings, ignore
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index afa8376f0e0..d8ac75f24f2 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -459,7 +459,7 @@ static const k053252_interface esckids_k053252_intf =
static MACHINE_START( vendetta )
{
vendetta_state *state = machine.driver_data<vendetta_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 28, &ROM[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c
index 42c1b6ed4dc..de3f2a5d526 100644
--- a/src/mame/drivers/videopkr.c
+++ b/src/mame/drivers/videopkr.c
@@ -400,7 +400,7 @@ static void count_7dig(unsigned long data, UINT8 index)
static PALETTE_INIT( videopkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int j;
for (j = 0; j < machine.total_colors(); j++)
@@ -427,7 +427,7 @@ static PALETTE_INIT( videopkr )
static PALETTE_INIT( babypkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int j;
for (j = 0; j < machine.total_colors(); j++)
@@ -458,7 +458,7 @@ static PALETTE_INIT( babypkr )
static PALETTE_INIT( fortune1 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int j;
for (j = 0; j < machine.total_colors(); j++)
diff --git a/src/mame/drivers/vigilant.c b/src/mame/drivers/vigilant.c
index a930c51b6f3..e74a87ee962 100644
--- a/src/mame/drivers/vigilant.c
+++ b/src/mame/drivers/vigilant.c
@@ -26,7 +26,7 @@ Buccaneers has a 5.6888 Mhz and a 18.432 Mhz OSC
WRITE8_MEMBER(vigilant_state::vigilant_bank_select_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + (data & 0x07) * 0x4000;
membank("bank1")->set_base(&RAM[bankaddress]);
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index 4c0f15495e0..b8bba5fb21d 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -1929,7 +1929,7 @@ static MACHINE_START(viper)
/* configure fast RAM regions for DRC */
ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x00ffffff, FALSE, workram);
- ds2430_rom = (UINT8*)machine.region("ds2430")->base();
+ ds2430_rom = (UINT8*)machine.root_device().memregion("ds2430")->base();
}
static MACHINE_RESET(viper)
diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c
index 39f3bf0091a..370fab699b1 100644
--- a/src/mame/drivers/vmetal.c
+++ b/src/mame/drivers/vmetal.c
@@ -119,7 +119,7 @@ READ16_MEMBER(vmetal_state::varia_crom_read)
/* game reads the cgrom, result is 7772, verified to be correct on the real board */
- UINT8 *cgrom = machine().region("gfx1")->base();
+ UINT8 *cgrom = memregion("gfx1")->base();
UINT16 retdat;
offset = offset << 1;
@@ -423,8 +423,8 @@ static TILE_GET_INFO( get_vmetal_mid2tilemap_tile_info )
static void expand_gfx1(running_machine &machine)
{
metro_state *state = machine.driver_data<metro_state>();
- UINT8 *base_gfx = machine.region("gfx1")->base();
- UINT32 length = 2 * machine.region("gfx1")->bytes();
+ UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT32 length = 2 * state->memregion("gfx1")->bytes();
state->m_expanded_gfx1 = auto_alloc_array(machine, UINT8, length);
for (int i = 0; i < length; i += 2)
{
diff --git a/src/mame/drivers/voyager.c b/src/mame/drivers/voyager.c
index 7c24fef2acf..d862b7b8b51 100644
--- a/src/mame/drivers/voyager.c
+++ b/src/mame/drivers/voyager.c
@@ -247,8 +247,8 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
#endif
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base() + 0x10000);
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base());
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base() + 0x10000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base());
}
break;
}
@@ -720,8 +720,8 @@ static const struct pit8253_config voyager_pit8254_config =
static MACHINE_RESET(voyager)
{
- //machine.root_device().membank("bank1")->set_base(machine.region("bios")->base() + 0x10000);
- machine.root_device().membank("bank1")->set_base(machine.region("bios")->base());
+ //machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base());
}
static void set_gate_a20(running_machine &machine, int a20)
diff --git a/src/mame/drivers/wallc.c b/src/mame/drivers/wallc.c
index 2256bf86e3b..3b0398f9b74 100644
--- a/src/mame/drivers/wallc.c
+++ b/src/mame/drivers/wallc.c
@@ -94,7 +94,7 @@ public:
static PALETTE_INIT( wallc )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_rg[2] = { 330, 220 };
@@ -259,7 +259,7 @@ static DRIVER_INIT( wallc )
UINT8 c;
UINT32 i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i=0; i<0x2000*2; i++)
{
@@ -274,7 +274,7 @@ static DRIVER_INIT( wallca )
UINT8 c;
UINT32 i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i=0; i<0x4000; i++)
{
diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c
index 24f06a1a7b8..7c14293851c 100644
--- a/src/mame/drivers/wardner.c
+++ b/src/mame/drivers/wardner.c
@@ -152,7 +152,7 @@ WRITE8_MEMBER(wardner_state::wardner_ramrom_bank_sw)
int bankaddress = 0;
address_space *mainspace;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM);
m_wardner_membank = data;
diff --git a/src/mame/drivers/warpsped.c b/src/mame/drivers/warpsped.c
index 1c9a9efb8d6..ad20b3ce492 100644
--- a/src/mame/drivers/warpsped.c
+++ b/src/mame/drivers/warpsped.c
@@ -121,7 +121,7 @@ static TILE_GET_INFO( get_warpspeed_starfield_tile_info )
UINT8 code = 0x3f;
if ( tile_index & 1 )
{
- code = machine.region("starfield")->base()[tile_index >> 1] & 0x3f;
+ code = machine.root_device().memregion("starfield")->base()[tile_index >> 1] & 0x3f;
}
SET_TILE_INFO(1, code, 0, 0);
}
diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c
index ae08f19d96f..8184e66b5d3 100644
--- a/src/mame/drivers/warriorb.c
+++ b/src/mame/drivers/warriorb.c
@@ -542,7 +542,7 @@ static MACHINE_START( warriorb )
{
warriorb_state *state = machine.driver_data<warriorb_state>();
- state->membank("bank10")->configure_entries(0, 8, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 8, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/wc90.c b/src/mame/drivers/wc90.c
index 042331e34e6..d761cf73327 100644
--- a/src/mame/drivers/wc90.c
+++ b/src/mame/drivers/wc90.c
@@ -83,7 +83,7 @@ voice.ic82 CRC32 abc61f3d SHA1 c6f123d16a26c4d77c635617dd97bb4b906c463a
WRITE8_MEMBER(wc90_state::wc90_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + ( ( data & 0xf8 ) << 8 );
@@ -93,7 +93,7 @@ WRITE8_MEMBER(wc90_state::wc90_bankswitch_w)
WRITE8_MEMBER(wc90_state::wc90_bankswitch1_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("sub")->base();
+ UINT8 *RAM = memregion("sub")->base();
bankaddress = 0x10000 + ( ( data & 0xf8 ) << 8 );
diff --git a/src/mame/drivers/wc90b.c b/src/mame/drivers/wc90b.c
index 59548ee8077..7c4c1469d06 100644
--- a/src/mame/drivers/wc90b.c
+++ b/src/mame/drivers/wc90b.c
@@ -99,7 +99,7 @@ Noted added by ClawGrip 28-Mar-2008:
WRITE8_MEMBER(wc90b_state::wc90b_bankswitch_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
membank("bank1")->set_base(&ROM[bankaddress]);
@@ -108,7 +108,7 @@ WRITE8_MEMBER(wc90b_state::wc90b_bankswitch_w)
WRITE8_MEMBER(wc90b_state::wc90b_bankswitch1_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("sub")->base();
+ UINT8 *ROM = memregion("sub")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
membank("bank2")->set_base(&ROM[bankaddress]);
@@ -123,7 +123,7 @@ WRITE8_MEMBER(wc90b_state::wc90b_sound_command_w)
static WRITE8_DEVICE_HANDLER( adpcm_control_w )
{
int bankaddress;
- UINT8 *ROM = device->machine().region("audiocpu")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("audiocpu")->base();
/* the code writes either 2 or 3 in the bottom two bits */
bankaddress = 0x10000 + (data & 0x01) * 0x4000;
diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c
index 95914623609..db613bfbcad 100644
--- a/src/mame/drivers/wecleman.c
+++ b/src/mame/drivers/wecleman.c
@@ -1218,9 +1218,9 @@ static void wecleman_unpack_sprites(running_machine &machine)
{
const char *region = "gfx1"; // sprites
- const UINT32 len = machine.region(region)->bytes();
- UINT8 *src = machine.region(region)->base() + len / 2 - 1;
- UINT8 *dst = machine.region(region)->base() + len - 1;
+ const UINT32 len = machine.root_device().memregion(region)->bytes();
+ UINT8 *src = machine.root_device().memregion(region)->base() + len / 2 - 1;
+ UINT8 *dst = machine.root_device().memregion(region)->base() + len - 1;
while(dst > src)
{
@@ -1251,7 +1251,7 @@ static DRIVER_INIT( wecleman )
wecleman_state *state = machine.driver_data<wecleman_state>();
int i, len;
UINT8 *RAM;
-// UINT16 *RAM1 = (UINT16 *) machine.region("maincpu")->base(); /* Main CPU patches */
+// UINT16 *RAM1 = (UINT16 *) machine.root_device().memregion("maincpu")->base(); /* Main CPU patches */
// RAM1[0x08c2/2] = 0x601e; // faster self test
/* Decode GFX Roms - Compensate for the address lines scrambling */
@@ -1261,8 +1261,8 @@ static DRIVER_INIT( wecleman )
I hope you'll appreciate this effort! */
/* let's swap even and odd *pixels* of the sprites */
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = state->memregion("gfx1")->bytes();
for (i = 0; i < len; i ++)
{
/* TODO: could be wrong, colors have to be fixed. */
@@ -1271,18 +1271,18 @@ static DRIVER_INIT( wecleman )
RAM[i] = BITSWAP8(RAM[i],7,0,1,2,3,4,5,6);
}
- bitswap(machine, machine.region("gfx1")->base(), machine.region("gfx1")->bytes(),
+ bitswap(machine, machine.root_device().memregion("gfx1")->base(), machine.root_device().memregion("gfx1")->bytes(),
0,1,20,19,18,17,14,9,16,6,4,7,8,15,10,11,13,5,12,3,2);
/* Now we can unpack each nibble of the sprites into a pixel (one byte) */
wecleman_unpack_sprites(machine);
/* Bg & Fg & Txt */
- bitswap(machine, machine.region("gfx2")->base(), machine.region("gfx2")->bytes(),
+ bitswap(machine, machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes(),
20,19,18,17,16,15,12,7,14,4,2,5,6,13,8,9,11,3,10,1,0);
/* Road */
- bitswap(machine, machine.region("gfx3")->base(), machine.region("gfx3")->bytes(),
+ bitswap(machine, machine.root_device().memregion("gfx3")->base(), machine.root_device().memregion("gfx3")->bytes(),
20,19,18,17,16,15,14,7,12,4,2,5,6,13,8,9,11,3,10,1,0);
state->m_spr_color_offs = 0x40;
@@ -1347,7 +1347,7 @@ static void hotchase_sprite_decode( running_machine &machine, int num16_banks, i
UINT8 *base, *temp;
int i;
- base = machine.region("gfx1")->base(); // sprites
+ base = machine.root_device().memregion("gfx1")->base(); // sprites
temp = auto_alloc_array(machine, UINT8, bank_size );
for( i = num16_banks; i >0; i-- ){
@@ -1393,7 +1393,7 @@ static void hotchase_sprite_decode( running_machine &machine, int num16_banks, i
static DRIVER_INIT( hotchase )
{
wecleman_state *state = machine.driver_data<wecleman_state>();
-// UINT16 *RAM1 = (UINT16) machine.region("maincpu")->base(); /* Main CPU patches */
+// UINT16 *RAM1 = (UINT16) machine.root_device().memregion("maincpu")->base(); /* Main CPU patches */
// RAM[0x1140/2] = 0x0015; RAM[0x195c/2] = 0x601A; // faster self test
UINT8 *RAM;
@@ -1401,13 +1401,13 @@ static DRIVER_INIT( hotchase )
/* Decode GFX Roms */
/* Let's swap even and odd bytes of the sprites gfx roms */
- RAM = machine.region("gfx1")->base();
+ RAM = machine.root_device().memregion("gfx1")->base();
/* Now we can unpack each nibble of the sprites into a pixel (one byte) */
hotchase_sprite_decode(machine,3,0x80000*2); // num banks, bank len
/* Let's copy the second half of the fg layer gfx (charset) over the first */
- RAM = machine.region("gfx3")->base();
+ RAM = state->memregion("gfx3")->base();
memcpy(&RAM[0], &RAM[0x10000/2], 0x10000/2);
state->m_spr_color_offs = 0;
diff --git a/src/mame/drivers/welltris.c b/src/mame/drivers/welltris.c
index 52838c084c1..cf5d148af86 100644
--- a/src/mame/drivers/welltris.c
+++ b/src/mame/drivers/welltris.c
@@ -322,7 +322,7 @@ TODO:
WRITE8_MEMBER(welltris_state::welltris_sh_bankswitch_w)
{
- UINT8 *rom = machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
membank("bank1")->set_base(rom + (data & 0x03) * 0x8000);
}
@@ -689,7 +689,7 @@ static DRIVER_INIT( welltris )
{
#if WELLTRIS_4P_HACK
/* A Hack which shows 4 player mode in code which is disabled */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0xB91C/2] = 0x4e71;
RAM[0xB91E/2] = 0x4e71;
#endif
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 7420d32162b..594ecbe001c 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -946,7 +946,7 @@ static MACHINE_START( wgp )
{
wgp_state *state = machine.driver_data<wgp_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
@@ -1262,7 +1262,7 @@ static DRIVER_INIT( wgp )
#if 0
/* Patch for coding error that causes corrupt data in
sprite tilemapping area from $4083c0-847f */
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
ROM[0x25dc / 2] = 0x0602; // faulty value is 0x0206
#endif
}
@@ -1270,7 +1270,7 @@ static DRIVER_INIT( wgp )
static DRIVER_INIT( wgp2 )
{
/* Code patches to prevent failure in memory checks */
- UINT16 *ROM = (UINT16 *)machine.region("sub")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("sub")->base();
ROM[0x8008 / 2] = 0x0;
ROM[0x8010 / 2] = 0x0;
}
diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c
index 25375f4fa9a..f9cf0bec6a7 100644
--- a/src/mame/drivers/wheelfir.c
+++ b/src/mame/drivers/wheelfir.c
@@ -378,7 +378,7 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_blit_w)
cputag_set_input_line(machine(), "maincpu", 1, HOLD_LINE);
{
- UINT8 *rom = machine().region("gfx1")->base();
+ UINT8 *rom = memregion("gfx1")->base();
int width = machine().primary_screen->width();
int height = machine().primary_screen->height();
@@ -788,7 +788,7 @@ static MACHINE_START( wheelfir )
state->m_zoom_table[i]=-1;
}
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for(int j=0;j<400;++j)
{
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT(wheelfir)
{
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0xdd3da/2] = 0x4e71; //hack
}
diff --git a/src/mame/drivers/whitestar.c b/src/mame/drivers/whitestar.c
index f6643d2b9b0..e267d9648a2 100644
--- a/src/mame/drivers/whitestar.c
+++ b/src/mame/drivers/whitestar.c
@@ -98,12 +98,12 @@ WRITE8_MEMBER(whitestar_state::switch_w)
WRITE8_MEMBER(whitestar_state::bank_w)
{
- membank("bank1")->set_base(machine().region("user1")->base() + (data & 0x1f) * 0x4000);
+ membank("bank1")->set_base(machine().root_device().memregion("user1")->base() + (data & 0x1f) * 0x4000);
}
WRITE8_MEMBER(whitestar_state::dmd_bank_w)
{
- membank("dmd_bank1")->set_base(machine().region("dmdcpu")->base() + (data & 0x1f) * 0x4000);
+ membank("dmd_bank1")->set_base(machine().root_device().memregion("dmdcpu")->base() + (data & 0x1f) * 0x4000);
}
READ8_MEMBER(whitestar_state::dmd_latch_r)
@@ -170,8 +170,8 @@ ADDRESS_MAP_END
static MACHINE_RESET( whitestar )
{
- machine.root_device().membank("bank1")->set_base(machine.region("user1")->base());
- machine.root_device().membank("dmd_bank1")->set_base(machine.region("dmdcpu")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
+ machine.root_device().membank("dmd_bank1")->set_base(machine.root_device().memregion("dmdcpu")->base());
}
static DRIVER_INIT( whitestar )
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index 46fe3fb4670..6d456bc617e 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -2730,7 +2730,7 @@ static DRIVER_INIT( defender )
static DRIVER_INIT( defndjeu )
{
williams_state *state = machine.driver_data<williams_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000);
diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c
index 284db339c79..dc5dbc731bb 100644
--- a/src/mame/drivers/wink.c
+++ b/src/mame/drivers/wink.c
@@ -411,7 +411,7 @@ ROM_END
static DRIVER_INIT( wink )
{
UINT32 i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x8000);
// protection module reverse engineered by HIGHWAYMAN
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c
index 32bc55f5ff8..cb951e82551 100644
--- a/src/mame/drivers/witch.c
+++ b/src/mame/drivers/witch.c
@@ -380,7 +380,7 @@ WRITE8_MEMBER(witch_state::write_a00x)
if(newbank != m_bank)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
m_bank = newbank;
ROM = &ROM[0x10000+0x8000 * newbank + UNBANKED_SIZE];
membank("bank1")->set_base(ROM);
@@ -419,7 +419,7 @@ READ8_MEMBER(witch_state::prot_read_700x)
case 0x25e:
return offset;//enough to pass...
}
- return machine().region("sub")->base()[0x7000+offset];
+ return memregion("sub")->base()[0x7000+offset];
}
/*
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT(witch)
{
witch_state *state = machine.driver_data<witch_state>();
- UINT8 *ROM = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 *ROM = (UINT8 *)state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0x10000+UNBANKED_SIZE]);
machine.device("sub")->memory().space(AS_PROGRAM)->install_read_handler(0x7000, 0x700f, read8_delegate(FUNC(witch_state::prot_read_700x), state));
diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c
index c8698f66d9a..8d7fa2d43ae 100644
--- a/src/mame/drivers/wiz.c
+++ b/src/mame/drivers/wiz.c
@@ -1070,8 +1070,8 @@ static DRIVER_INIT( stinger )
{ 5,7,3, 0x28 }
};
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
int A;
const UINT8 *tbl;
diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c
index 2c18374bb76..1350ad85dc1 100644
--- a/src/mame/drivers/xain.c
+++ b/src/mame/drivers/xain.c
@@ -568,8 +568,8 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( xsleena )
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x4000, 0xc000);
- machine.root_device().membank("bank2")->configure_entries(0, 2, machine.region("sub")->base() + 0x4000, 0xc000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x4000, 0xc000);
+ machine.root_device().membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("sub")->base() + 0x4000, 0xc000);
machine.root_device().membank("bank1")->set_entry(0);
machine.root_device().membank("bank2")->set_entry(0);
}
diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c
index 2d41f9e12d3..7471a7e2a31 100644
--- a/src/mame/drivers/xexex.c
+++ b/src/mame/drivers/xexex.c
@@ -456,7 +456,7 @@ static void xexex_postload(running_machine &machine)
static MACHINE_START( xexex )
{
xexex_state *state = machine.driver_data<xexex_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank2")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank2")->set_entry(0);
@@ -684,8 +684,8 @@ static DRIVER_INIT( xexex )
if (!strcmp(machine.system().name, "xexex"))
{
// Invulnerability
-// *(UINT16 *)(machine.region("maincpu")->base() + 0x648d4) = 0x4a79;
-// *(UINT16 *)(machine.region("maincpu")->base() + 0x00008) = 0x5500;
+// *(UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x648d4) = 0x4a79;
+// *(UINT16 *)(state->memregion("maincpu")->base() + 0x00008) = 0x5500;
state->m_strip_0x1a = 1;
}
}
diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c
index 326dfecec17..a947a3e3669 100644
--- a/src/mame/drivers/xmen.c
+++ b/src/mame/drivers/xmen.c
@@ -295,7 +295,7 @@ INPUT_PORTS_END
static MACHINE_START( xmen )
{
xmen_state *state = machine.driver_data<xmen_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank4")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank4")->set_entry(0);
diff --git a/src/mame/drivers/xorworld.c b/src/mame/drivers/xorworld.c
index c33fb3e1f01..017ee7eb29b 100644
--- a/src/mame/drivers/xorworld.c
+++ b/src/mame/drivers/xorworld.c
@@ -223,7 +223,7 @@ static DRIVER_INIT( xorworld )
/* patch some strange protection (without this, strange characters appear
after level 5 and some pieces don't rotate properly some times) */
- UINT16 *rom = (UINT16 *)(machine.region("maincpu")->base() + 0x1390);
+ UINT16 *rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x1390);
PATCH(0x4239); PATCH(0x00ff); PATCH(0xe196); /* clr.b $ffe196 */
PATCH(0x4239); PATCH(0x00ff); PATCH(0xe197); /* clr.b $ffe197 */
diff --git a/src/mame/drivers/xtom3d.c b/src/mame/drivers/xtom3d.c
index f001604d0f7..f1b9e1f0fd7 100644
--- a/src/mame/drivers/xtom3d.c
+++ b/src/mame/drivers/xtom3d.c
@@ -147,7 +147,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
state->membank("bios_bank")->set_base(state->m_bios_ram);
else // disable RAM access (reads go to BIOS ROM)
- state->membank("bios_bank")->set_base(busdevice->machine().region("bios")->base() + 0x10000);
+ state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x10000);
break;
}
case 0x5a: // PAM1
@@ -155,12 +155,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("video_bank1")->set_base(state->m_isa_ram1);
else
- state->membank("video_bank1")->set_base(busdevice->machine().region("video_bios")->base() + 0);
+ state->membank("video_bank1")->set_base(state->memregion("video_bios")->base() + 0);
if (data & 0x10)
state->membank("video_bank2")->set_base(state->m_isa_ram2);
else
- state->membank("video_bank2")->set_base(busdevice->machine().region("video_bios")->base() + 0x4000);
+ state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
break;
}
@@ -169,12 +169,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
else
- state->membank("bios_ext1")->set_base(busdevice->machine().region("bios")->base() + 0);
+ state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0);
if (data & 0x10)
state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram);
else
- state->membank("bios_ext2")->set_base(busdevice->machine().region("bios")->base() + 0x4000);
+ state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x4000);
break;
}
@@ -183,12 +183,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
else
- state->membank("bios_ext3")->set_base(busdevice->machine().region("bios")->base() + 0x8000);
+ state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x8000);
if (data & 0x10)
state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram);
else
- state->membank("bios_ext4")->set_base(busdevice->machine().region("bios")->base() + 0xc000);
+ state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0xc000);
break;
}
@@ -666,13 +666,13 @@ static MACHINE_START( xtom3d )
static MACHINE_RESET( xtom3d )
{
- machine.root_device().membank("bios_bank")->set_base(machine.region("bios")->base() + 0x10000);
- machine.root_device().membank("bios_ext1")->set_base(machine.region("bios")->base() + 0);
- machine.root_device().membank("bios_ext2")->set_base(machine.region("bios")->base() + 0x4000);
- machine.root_device().membank("bios_ext3")->set_base(machine.region("bios")->base() + 0x8000);
- machine.root_device().membank("bios_ext4")->set_base(machine.region("bios")->base() + 0xc000);
- machine.root_device().membank("video_bank1")->set_base(machine.region("video_bios")->base() + 0);
- machine.root_device().membank("video_bank2")->set_base(machine.region("video_bios")->base() + 0x4000);
+ machine.root_device().membank("bios_bank")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
+ machine.root_device().membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0);
+ machine.root_device().membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x4000);
+ machine.root_device().membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x8000);
+ machine.root_device().membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0xc000);
+ machine.root_device().membank("video_bank1")->set_base(machine.root_device().memregion("video_bios")->base() + 0);
+ machine.root_device().membank("video_bank2")->set_base(machine.root_device().memregion("video_bios")->base() + 0x4000);
}
diff --git a/src/mame/drivers/xxmissio.c b/src/mame/drivers/xxmissio.c
index 52e268f338b..3ab0739f304 100644
--- a/src/mame/drivers/xxmissio.c
+++ b/src/mame/drivers/xxmissio.c
@@ -79,7 +79,7 @@ static INTERRUPT_GEN( xxmissio_interrupt_s )
static MACHINE_START( xxmissio )
{
- machine.root_device().membank("bank1")->configure_entries(0, 8, machine.region("user1")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("user1")->base(), 0x4000);
machine.root_device().membank("bank1")->set_entry(0);
}
diff --git a/src/mame/drivers/yunsun16.c b/src/mame/drivers/yunsun16.c
index d6dd6dc1ec5..9329a310db9 100644
--- a/src/mame/drivers/yunsun16.c
+++ b/src/mame/drivers/yunsun16.c
@@ -106,7 +106,7 @@ WRITE16_MEMBER(yunsun16_state::yunsun16_sound_bank_w)
if (ACCESSING_BITS_0_7)
{
int bank = data & 3;
- UINT8 *dst = machine().region("oki")->base();
+ UINT8 *dst = memregion("oki")->base();
UINT8 *src = dst + 0x80000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
}
diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c
index ac82e6c8981..743d5d3c289 100644
--- a/src/mame/drivers/yunsung8.c
+++ b/src/mame/drivers/yunsung8.c
@@ -466,8 +466,8 @@ static const msm5205_interface yunsung8_msm5205_interface =
static MACHINE_START( yunsung8 )
{
yunsung8_state *state = machine.driver_data<yunsung8_state>();
- UINT8 *MAIN = machine.region("maincpu")->base();
- UINT8 *AUDIO = machine.region("audiocpu")->base();
+ UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *AUDIO = machine.root_device().memregion("audiocpu")->base();
state->m_videoram_0 = state->m_videoram + 0x0000; // Ram is banked
state->m_videoram_1 = state->m_videoram + 0x2000;
@@ -475,7 +475,7 @@ static MACHINE_START( yunsung8 )
state->membank("bank1")->configure_entries(0, 3, &MAIN[0x00000], 0x4000);
state->membank("bank1")->configure_entries(3, 5, &MAIN[0x10000], 0x4000);
state->membank("bank2")->configure_entries(0, 3, &AUDIO[0x00000], 0x4000);
- machine.root_device().membank("bank2")->configure_entries(3, 5, &AUDIO[0x10000], 0x4000);
+ state->membank("bank2")->configure_entries(3, 5, &AUDIO[0x10000], 0x4000);
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index dc86bbf2838..8f525530c0b 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -1430,8 +1430,8 @@ static void zaxxonj_decode(running_machine &machine, const char *cputag)
int A;
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region(cputag)->base();
- int size = machine.region(cputag)->bytes();
+ UINT8 *rom = machine.root_device().memregion(cputag)->base();
+ int size = machine.root_device().memregion(cputag)->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
space->set_decrypted_region(0x0000, size - 1, decrypt);
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index 90f72c1c8c8..b9ead50f523 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -684,12 +684,12 @@ READ32_MEMBER(zn_state::capcom_kickharness_r)
WRITE32_MEMBER(zn_state::bank_coh1000c_w)
{
- membank( "bank2" )->set_base( machine().region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
+ membank( "bank2" )->set_base( memregion( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
}
WRITE8_MEMBER(zn_state::qsound_bankswitch_w)
{
- membank( "bank10" )->set_base( machine().region( "audiocpu" )->base() + 0x10000 + ( ( data & 0x0f ) * 0x4000 ) );
+ membank( "bank10" )->set_base( memregion( "audiocpu" )->base() + 0x10000 + ( ( data & 0x0f ) * 0x4000 ) );
}
static INTERRUPT_GEN( qsound_interrupt )
@@ -728,9 +728,9 @@ static DRIVER_INIT( coh1000c )
static MACHINE_RESET( coh1000c )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
- machine.root_device().membank( "bank3" )->set_base( machine.region( "user3" )->base() ); /* country rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user2" )->base() + 0x400000 ); /* banked game rom */
+ machine.root_device().membank( "bank3" )->set_base( machine.root_device().memregion( "user3" )->base() ); /* country rom */
zn_machine_init(machine);
}
@@ -918,7 +918,7 @@ Notes:
WRITE32_MEMBER(zn_state::bank_coh3002c_w)
{
- membank( "bank2" )->set_base( machine().region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
+ membank( "bank2" )->set_base( memregion( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
}
static DRIVER_INIT( coh3002c )
@@ -937,9 +937,9 @@ static DRIVER_INIT( coh3002c )
static MACHINE_RESET( coh3002c )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
- machine.root_device().membank( "bank3" )->set_base( machine.region( "user3" )->base() ); /* country rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user2" )->base() + 0x400000 ); /* banked game rom */
+ machine.root_device().membank( "bank3" )->set_base( machine.root_device().memregion( "user3" )->base() ); /* country rom */
zn_machine_init(machine);
}
@@ -1180,12 +1180,12 @@ WRITE32_MEMBER(zn_state::bank_coh1000t_w)
device_t *mb3773 = machine().device("mb3773");
mb3773_set_ck(mb3773, (data & 0x20) >> 5);
verboselog( machine(), 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
}
WRITE8_MEMBER(zn_state::fx1a_sound_bankswitch_w)
{
- membank( "bank10" )->set_base( machine().region( "audiocpu" )->base() + 0x10000 + ( ( ( data - 1 ) & 0x07 ) * 0x4000 ) );
+ membank( "bank10" )->set_base( memregion( "audiocpu" )->base() + 0x10000 + ( ( ( data - 1 ) & 0x07 ) * 0x4000 ) );
}
READ32_MEMBER(zn_state::taitofx1a_ymsound_r)
@@ -1225,7 +1225,7 @@ static DRIVER_INIT( coh1000ta )
static MACHINE_RESET( coh1000ta )
{
zn_state *state = machine.driver_data<zn_state>();
- state->membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked game rom */
+ state->membank( "bank1" )->set_base( state->memregion( "user2" )->base() ); /* banked game rom */
state->membank( "bank2" )->set_base( state->m_taitofx1_eeprom1 );
zn_machine_init(machine);
}
@@ -1320,7 +1320,7 @@ static MACHINE_RESET( coh1000tb )
{
zn_state *state = machine.driver_data<zn_state>();
- state->membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked game rom */
+ state->membank( "bank1" )->set_base( state->memregion( "user2" )->base() ); /* banked game rom */
state->membank( "bank2" )->set_base( state->m_taitofx1_eeprom1 );
state->membank( "bank3" )->set_base( state->m_taitofx1_eeprom2 );
zn_machine_init(machine);
@@ -1505,7 +1505,7 @@ static DRIVER_INIT( coh1000w )
static MACHINE_RESET( coh1000w )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
zn_machine_init(machine);
devtag_reset(machine, "ide");
@@ -1670,7 +1670,7 @@ WRITE32_MEMBER(zn_state::coh1002e_bank_w)
{
znsecsel_w( space, offset, data, mem_mask );
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
}
WRITE32_MEMBER(zn_state::coh1002e_latch_w)
@@ -1693,7 +1693,7 @@ static DRIVER_INIT( coh1002e )
static MACHINE_RESET( coh1002e )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* banked game rom */
zn_machine_init(machine);
}
@@ -1784,7 +1784,7 @@ WRITE32_MEMBER(zn_state::bam2_mcu_w)
{
if (ACCESSING_BITS_0_15)
{
- membank( "bank2" )->set_base( machine().region( "user2" )->base() + ( ( data & 0xf ) * 0x400000 ) );
+ membank( "bank2" )->set_base( memregion( "user2" )->base() + ( ( data & 0xf ) * 0x400000 ) );
}
else if (ACCESSING_BITS_16_31)
{
@@ -1839,8 +1839,8 @@ static DRIVER_INIT( bam2 )
static MACHINE_RESET( bam2 )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user2" )->base() + 0x400000 ); /* banked game rom */
zn_machine_init(machine);
}
@@ -2176,7 +2176,7 @@ static DRIVER_INIT( coh1000a )
static MACHINE_RESET( coh1000a )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
zn_machine_init(machine);
if( ( !strcmp( machine.system().name, "jdredd" ) ) ||
( !strcmp( machine.system().name, "jdreddb" ) ) )
@@ -2318,7 +2318,7 @@ Notes:
WRITE32_MEMBER(zn_state::coh1001l_bnk_w)
{
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ( ( ( data >> 16 ) & 3 ) * 0x800000 ) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ( ( ( data >> 16 ) & 3 ) * 0x800000 ) );
}
static DRIVER_INIT( coh1001l )
@@ -2332,7 +2332,7 @@ static DRIVER_INIT( coh1001l )
static MACHINE_RESET( coh1001l )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* banked rom */
zn_machine_init(machine);
}
@@ -2361,7 +2361,7 @@ Key: Mother KN01
WRITE32_MEMBER(zn_state::coh1002v_bnk_w)
{
- membank( "bank2" )->set_base( machine().region( "user3" )->base() + ( data * 0x100000 ) );
+ membank( "bank2" )->set_base( memregion( "user3" )->base() + ( data * 0x100000 ) );
}
static DRIVER_INIT( coh1002v )
@@ -2376,8 +2376,8 @@ static DRIVER_INIT( coh1002v )
static MACHINE_RESET( coh1002v )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user3" )->base() ); /* banked rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user3" )->base() ); /* banked rom */
zn_machine_init(machine);
}
@@ -2546,7 +2546,7 @@ Notes:
WRITE32_MEMBER(zn_state::coh1002m_bank_w)
{
verboselog( machine(), 1, "coh1002m_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ((data>>16) * 0x800000) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ((data>>16) * 0x800000) );
}
READ32_MEMBER(zn_state::cbaj_z80_r)
@@ -2580,7 +2580,7 @@ static DRIVER_INIT( coh1002m )
static MACHINE_RESET( coh1002m )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() );
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() );
zn_machine_init(machine);
}
diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c
index 56a7e8e68ed..a090e5876ca 100644
--- a/src/mame/drivers/zr107.c
+++ b/src/mame/drivers/zr107.c
@@ -838,7 +838,7 @@ static void init_zr107(running_machine &machine)
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
state->m_ccu_vcth = state->m_ccu_vctl = 0;
- K001005_preprocess_texture_data(machine.region("gfx1")->base(), machine.region("gfx1")->bytes(), 0);
+ K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 0);
}
static DRIVER_INIT(zr107)