summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c2
-rw-r--r--src/emu/cpu/esrip/esrip.c2
-rw-r--r--src/emu/cpu/mb86233/mb86233.c2
-rw-r--r--src/emu/debug/debugcpu.c6
-rw-r--r--src/emu/debug/dvmemory.c6
-rw-r--r--src/emu/debug/dvmemory.h2
-rw-r--r--src/emu/device.c10
-rw-r--r--src/emu/device.h6
-rw-r--r--src/emu/diimage.c4
-rw-r--r--src/emu/drawgfx.c2
-rw-r--r--src/emu/imagedev/cartslot.c2
-rw-r--r--src/emu/machine.c71
-rw-r--r--src/emu/machine.h88
-rw-r--r--src/emu/machine/laserdsc.c2
-rw-r--r--src/emu/machine/mccs1850.c4
-rw-r--r--src/emu/machine/pls100.c4
-rw-r--r--src/emu/memory.c83
-rw-r--r--src/emu/memory.h68
-rw-r--r--src/emu/romload.c12
-rw-r--r--src/emu/screen.c2
-rw-r--r--src/emu/sound/2610intf.c4
-rw-r--r--src/emu/sound/digitalk.c2
-rw-r--r--src/emu/sound/es5506.c8
-rw-r--r--src/emu/sound/fm.c8
-rw-r--r--src/emu/sound/gaelco.c2
-rw-r--r--src/emu/sound/i5000.c4
-rw-r--r--src/emu/sound/k053260.c2
-rw-r--r--src/emu/sound/k054539.c2
-rw-r--r--src/emu/sound/tms5110.c2
-rw-r--r--src/emu/sound/votrax.c2
-rw-r--r--src/emu/sound/ymz770.c2
-rw-r--r--src/emu/sound/zsg2.c2
-rw-r--r--src/emu/video/315_5124.c2
-rw-r--r--src/emu/video/generic.c2
-rw-r--r--src/emu/video/hd61830.c2
-rw-r--r--src/emu/video/pc_cga.c14
-rw-r--r--src/emu/video/tms9927.c2
-rw-r--r--src/mame/audio/atarijsa.c6
-rw-r--r--src/mame/audio/cage.c4
-rw-r--r--src/mame/audio/cclimber.c8
-rw-r--r--src/mame/audio/cinemat.c2
-rw-r--r--src/mame/audio/circus.c2
-rw-r--r--src/mame/audio/cyberbal.c2
-rw-r--r--src/mame/audio/dcs.c8
-rw-r--r--src/mame/audio/dkong.c2
-rw-r--r--src/mame/audio/exidy440.c4
-rw-r--r--src/mame/audio/flower.c4
-rw-r--r--src/mame/audio/gomoku.c2
-rw-r--r--src/mame/audio/harddriv.c4
-rw-r--r--src/mame/audio/leland.c2
-rw-r--r--src/mame/audio/m72.c4
-rw-r--r--src/mame/audio/mario.c10
-rw-r--r--src/mame/audio/midway.c23
-rw-r--r--src/mame/audio/midway.h1
-rw-r--r--src/mame/audio/polepos.c2
-rw-r--r--src/mame/audio/segag80r.c10
-rw-r--r--src/mame/audio/segasnd.c2
-rw-r--r--src/mame/audio/seibu.c12
-rw-r--r--src/mame/audio/snes_snd.c4
-rw-r--r--src/mame/audio/snk6502.c2
-rw-r--r--src/mame/audio/suna8.c4
-rw-r--r--src/mame/audio/taito_en.c6
-rw-r--r--src/mame/audio/targ.c2
-rw-r--r--src/mame/audio/williams.c10
-rw-r--r--src/mame/audio/wiping.c4
-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
-rw-r--r--src/mame/machine/acitya.c12
-rw-r--r--src/mame/machine/ajax.c4
-rw-r--r--src/mame/machine/archimds.c8
-rw-r--r--src/mame/machine/atari.c2
-rw-r--r--src/mame/machine/awboard.c2
-rw-r--r--src/mame/machine/balsente.c8
-rw-r--r--src/mame/machine/beezer.c2
-rw-r--r--src/mame/machine/bfm_comn.c2
-rw-r--r--src/mame/machine/btime.c4
-rw-r--r--src/mame/machine/cclimber.c8
-rw-r--r--src/mame/machine/cps2crpt.c4
-rw-r--r--src/mame/machine/dec0.c6
-rw-r--r--src/mame/machine/deco102.c4
-rw-r--r--src/mame/machine/deco156.c4
-rw-r--r--src/mame/machine/decocass.c18
-rw-r--r--src/mame/machine/decocrpt.c4
-rw-r--r--src/mame/machine/fd1089.c8
-rw-r--r--src/mame/machine/fddebug.c10
-rw-r--r--src/mame/machine/gaelco2.c4
-rw-r--r--src/mame/machine/galaxold.c18
-rw-r--r--src/mame/machine/harddriv.c4
-rw-r--r--src/mame/machine/irobot.c8
-rw-r--r--src/mame/machine/jalcrpt.c24
-rw-r--r--src/mame/machine/jumpshot.c2
-rw-r--r--src/mame/machine/kabuki.c8
-rw-r--r--src/mame/machine/kaneko16.c10
-rw-r--r--src/mame/machine/konami1.c4
-rw-r--r--src/mame/machine/leland.c24
-rw-r--r--src/mame/machine/mc8123.c4
-rw-r--r--src/mame/machine/md_cart.c42
-rw-r--r--src/mame/machine/megadriv.c22
-rw-r--r--src/mame/machine/mhavoc.c2
-rw-r--r--src/mame/machine/micro3d.c6
-rw-r--r--src/mame/machine/midtunit.c2
-rw-r--r--src/mame/machine/midwunit.c4
-rw-r--r--src/mame/machine/midxunit.c4
-rw-r--r--src/mame/machine/midyunit.c4
-rw-r--r--src/mame/machine/model1.c6
-rw-r--r--src/mame/machine/n64.c8
-rw-r--r--src/mame/machine/namcond1.c2
-rw-r--r--src/mame/machine/namcos1.c8
-rw-r--r--src/mame/machine/namcos2.c6
-rw-r--r--src/mame/machine/naomi.c6
-rw-r--r--src/mame/machine/naomigd.c4
-rw-r--r--src/mame/machine/naomim1.c2
-rw-r--r--src/mame/machine/naomim2.c2
-rw-r--r--src/mame/machine/naomim4.c2
-rw-r--r--src/mame/machine/nb1413m3.c6
-rw-r--r--src/mame/machine/nb1414m4.c14
-rw-r--r--src/mame/machine/neoboot.c112
-rw-r--r--src/mame/machine/neocrypt.c96
-rw-r--r--src/mame/machine/neoprot.c4
-rw-r--r--src/mame/machine/nmk004.c4
-rw-r--r--src/mame/machine/nmk112.c8
-rw-r--r--src/mame/machine/opwolf.c2
-rw-r--r--src/mame/machine/pacplus.c2
-rw-r--r--src/mame/machine/pgmcrypt.c46
-rw-r--r--src/mame/machine/pgmprot1.c40
-rw-r--r--src/mame/machine/pgmprot2.c10
-rw-r--r--src/mame/machine/pgmprot3.c2
-rw-r--r--src/mame/machine/pgmprot4.c14
-rw-r--r--src/mame/machine/pgmprot5.c8
-rw-r--r--src/mame/machine/pgmprot6.c2
-rw-r--r--src/mame/machine/playch10.c40
-rw-r--r--src/mame/machine/r2crypt.c4
-rw-r--r--src/mame/machine/s16fd.c8
-rw-r--r--src/mame/machine/s24fd.c2
-rw-r--r--src/mame/machine/scramble.c48
-rw-r--r--src/mame/machine/segacrp2.c2
-rw-r--r--src/mame/machine/segacrpt.c14
-rw-r--r--src/mame/machine/segamsys.c14
-rw-r--r--src/mame/machine/segas32.c6
-rw-r--r--src/mame/machine/simpsons.c6
-rw-r--r--src/mame/machine/slapfght.c4
-rw-r--r--src/mame/machine/smpc.c6
-rw-r--r--src/mame/machine/snes.c8
-rw-r--r--src/mame/machine/snes7110.c8
-rw-r--r--src/mame/machine/snesbsx.c4
-rw-r--r--src/mame/machine/snessdd1.c2
-rw-r--r--src/mame/machine/starwars.c2
-rw-r--r--src/mame/machine/stfight.c6
-rw-r--r--src/mame/machine/stvprot.c16
-rw-r--r--src/mame/machine/subsino.c2
-rw-r--r--src/mame/machine/taitosj.c4
-rw-r--r--src/mame/machine/tatsumi.c4
-rw-r--r--src/mame/machine/theglobp.c10
-rw-r--r--src/mame/machine/tnzs.c10
-rw-r--r--src/mame/machine/tx1.c16
-rw-r--r--src/mame/machine/vectrex.c2
-rw-r--r--src/mame/machine/vsnes.c40
-rw-r--r--src/mame/machine/williams.c10
-rw-r--r--src/mame/machine/wrally.c2
-rw-r--r--src/mame/video/1942.c2
-rw-r--r--src/mame/video/1943.c6
-rw-r--r--src/mame/video/20pacgal.c2
-rw-r--r--src/mame/video/40love.c2
-rw-r--r--src/mame/video/8080bw.c12
-rw-r--r--src/mame/video/aerofgt.c4
-rw-r--r--src/mame/video/alpha68k.c8
-rw-r--r--src/mame/video/ambush.c2
-rw-r--r--src/mame/video/ampoker2.c2
-rw-r--r--src/mame/video/appoooh.c6
-rw-r--r--src/mame/video/arabian.c2
-rw-r--r--src/mame/video/archimds.c2
-rw-r--r--src/mame/video/argus.c4
-rw-r--r--src/mame/video/artmagic.c4
-rw-r--r--src/mame/video/atarirle.c4
-rw-r--r--src/mame/video/atarisy1.c6
-rw-r--r--src/mame/video/avgdvg.c4
-rw-r--r--src/mame/video/bagman.c2
-rw-r--r--src/mame/video/balsente.c8
-rw-r--r--src/mame/video/bankp.c2
-rw-r--r--src/mame/video/baraduke.c2
-rw-r--r--src/mame/video/bbusters.c2
-rw-r--r--src/mame/video/bfm_adr2.c4
-rw-r--r--src/mame/video/bking.c4
-rw-r--r--src/mame/video/bladestl.c2
-rw-r--r--src/mame/video/bogeyman.c2
-rw-r--r--src/mame/video/bombjack.c2
-rw-r--r--src/mame/video/bosco.c2
-rw-r--r--src/mame/video/brkthru.c2
-rw-r--r--src/mame/video/btime.c6
-rw-r--r--src/mame/video/bublbobl.c2
-rw-r--r--src/mame/video/buggychl.c2
-rw-r--r--src/mame/video/bwing.c4
-rw-r--r--src/mame/video/calomega.c2
-rw-r--r--src/mame/video/capbowl.c2
-rw-r--r--src/mame/video/carjmbre.c2
-rw-r--r--src/mame/video/carpolo.c4
-rw-r--r--src/mame/video/cave.c8
-rw-r--r--src/mame/video/ccastles.c6
-rw-r--r--src/mame/video/cclimber.c10
-rw-r--r--src/mame/video/centiped.c4
-rw-r--r--src/mame/video/chaknpop.c4
-rw-r--r--src/mame/video/champbas.c4
-rw-r--r--src/mame/video/changela.c18
-rw-r--r--src/mame/video/cheekyms.c2
-rw-r--r--src/mame/video/circusc.c2
-rw-r--r--src/mame/video/citycon.c2
-rw-r--r--src/mame/video/cloud9.c6
-rw-r--r--src/mame/video/clshroad.c4
-rw-r--r--src/mame/video/combatsc.c4
-rw-r--r--src/mame/video/compgolf.c2
-rw-r--r--src/mame/video/contra.c2
-rw-r--r--src/mame/video/cop01.c2
-rw-r--r--src/mame/video/cosmic.c24
-rw-r--r--src/mame/video/cps1.c18
-rw-r--r--src/mame/video/crbaloon.c2
-rw-r--r--src/mame/video/crgolf.c2
-rw-r--r--src/mame/video/cvs.c2
-rw-r--r--src/mame/video/darkmist.c10
-rw-r--r--src/mame/video/dcheese.c6
-rw-r--r--src/mame/video/dday.c4
-rw-r--r--src/mame/video/ddribble.c2
-rw-r--r--src/mame/video/deadang.c4
-rw-r--r--src/mame/video/dec8.c2
-rw-r--r--src/mame/video/deco_mlc.c4
-rw-r--r--src/mame/video/deniam.c2
-rw-r--r--src/mame/video/digdug.c4
-rw-r--r--src/mame/video/dkong.c20
-rw-r--r--src/mame/video/docastle.c2
-rw-r--r--src/mame/video/dogfgt.c2
-rw-r--r--src/mame/video/dooyong.c44
-rw-r--r--src/mame/video/dribling.c6
-rw-r--r--src/mame/video/drmicro.c2
-rw-r--r--src/mame/video/dynax.c10
-rw-r--r--src/mame/video/epos.c4
-rw-r--r--src/mame/video/equites.c8
-rw-r--r--src/mame/video/espial.c2
-rw-r--r--src/mame/video/esripsys.c10
-rw-r--r--src/mame/video/exedexes.c10
-rw-r--r--src/mame/video/exerion.c6
-rw-r--r--src/mame/video/exprraid.c2
-rw-r--r--src/mame/video/f1gp.c8
-rw-r--r--src/mame/video/fastfred.c2
-rw-r--r--src/mame/video/fastlane.c2
-rw-r--r--src/mame/video/fcombat.c6
-rw-r--r--src/mame/video/finalizr.c2
-rw-r--r--src/mame/video/firetrap.c2
-rw-r--r--src/mame/video/firetrk.c2
-rw-r--r--src/mame/video/flower.c2
-rw-r--r--src/mame/video/funkybee.c2
-rw-r--r--src/mame/video/funworld.c2
-rw-r--r--src/mame/video/fuukifg2.c2
-rw-r--r--src/mame/video/gaelco3d.c8
-rw-r--r--src/mame/video/galaga.c2
-rw-r--r--src/mame/video/galastrm.c2
-rw-r--r--src/mame/video/galaxian.c6
-rw-r--r--src/mame/video/galaxold.c24
-rw-r--r--src/mame/video/galivan.c8
-rw-r--r--src/mame/video/gaplus.c2
-rw-r--r--src/mame/video/gberet.c2
-rw-r--r--src/mame/video/ginganin.c2
-rw-r--r--src/mame/video/glass.c2
-rw-r--r--src/mame/video/goldstar.c4
-rw-r--r--src/mame/video/gomoku.c14
-rw-r--r--src/mame/video/gotya.c2
-rw-r--r--src/mame/video/gradius3.c2
-rw-r--r--src/mame/video/grchamp.c10
-rw-r--r--src/mame/video/gridlee.c4
-rw-r--r--src/mame/video/groundfx.c2
-rw-r--r--src/mame/video/gsword.c6
-rw-r--r--src/mame/video/gticlub.c6
-rw-r--r--src/mame/video/gunbustr.c2
-rw-r--r--src/mame/video/gunsmoke.c4
-rw-r--r--src/mame/video/gyruss.c2
-rw-r--r--src/mame/video/hanaawas.c2
-rw-r--r--src/mame/video/hcastle.c2
-rw-r--r--src/mame/video/hexion.c6
-rw-r--r--src/mame/video/higemaru.c2
-rw-r--r--src/mame/video/hnayayoi.c4
-rw-r--r--src/mame/video/hng64.c6
-rw-r--r--src/mame/video/homedata.c16
-rw-r--r--src/mame/video/hyhoo.c6
-rw-r--r--src/mame/video/hyperspt.c2
-rw-r--r--src/mame/video/hyprduel.c8
-rw-r--r--src/mame/video/ikki.c4
-rw-r--r--src/mame/video/irobot.c2
-rw-r--r--src/mame/video/ironhors.c2
-rw-r--r--src/mame/video/itech32.c4
-rw-r--r--src/mame/video/itech8.c4
-rw-r--r--src/mame/video/jack.c2
-rw-r--r--src/mame/video/jackal.c8
-rw-r--r--src/mame/video/jailbrek.c2
-rw-r--r--src/mame/video/jedi.c10
-rw-r--r--src/mame/video/kaneko16.c2
-rw-r--r--src/mame/video/kangaroo.c4
-rw-r--r--src/mame/video/karnov.c2
-rw-r--r--src/mame/video/kchamp.c2
-rw-r--r--src/mame/video/kingobox.c4
-rw-r--r--src/mame/video/kncljoe.c4
-rw-r--r--src/mame/video/konamigx.c4
-rw-r--r--src/mame/video/konamiic.c56
-rw-r--r--src/mame/video/konicdev.c140
-rw-r--r--src/mame/video/kopunch.c2
-rw-r--r--src/mame/video/ksayakyu.c6
-rw-r--r--src/mame/video/kyugo.c2
-rw-r--r--src/mame/video/labyrunr.c2
-rw-r--r--src/mame/video/ladybug.c4
-rw-r--r--src/mame/video/lasso.c6
-rw-r--r--src/mame/video/leland.c10
-rw-r--r--src/mame/video/lethalj.c4
-rw-r--r--src/mame/video/liberate.c4
-rw-r--r--src/mame/video/liberatr.c8
-rw-r--r--src/mame/video/lockon.c16
-rw-r--r--src/mame/video/lucky74.c2
-rw-r--r--src/mame/video/lvcards.c4
-rw-r--r--src/mame/video/lwings.c4
-rw-r--r--src/mame/video/m107.c2
-rw-r--r--src/mame/video/m52.c2
-rw-r--r--src/mame/video/m57.c2
-rw-r--r--src/mame/video/m58.c2
-rw-r--r--src/mame/video/m62.c8
-rw-r--r--src/mame/video/madalien.c6
-rw-r--r--src/mame/video/magmax.c6
-rw-r--r--src/mame/video/mainsnk.c2
-rw-r--r--src/mame/video/mappy.c6
-rw-r--r--src/mame/video/marineb.c2
-rw-r--r--src/mame/video/mario.c2
-rw-r--r--src/mame/video/markham.c2
-rw-r--r--src/mame/video/matmania.c2
-rw-r--r--src/mame/video/mcatadv.c4
-rw-r--r--src/mame/video/mcr68.c2
-rw-r--r--src/mame/video/megasys1.c2
-rw-r--r--src/mame/video/megazone.c2
-rw-r--r--src/mame/video/mermaid.c4
-rw-r--r--src/mame/video/metro.c8
-rw-r--r--src/mame/video/mikie.c2
-rw-r--r--src/mame/video/mjkjidai.c2
-rw-r--r--src/mame/video/model1.c2
-rw-r--r--src/mame/video/model2.c4
-rw-r--r--src/mame/video/momoko.c10
-rw-r--r--src/mame/video/mouser.c2
-rw-r--r--src/mame/video/mrdo.c2
-rw-r--r--src/mame/video/mrjong.c2
-rw-r--r--src/mame/video/munchmo.c4
-rw-r--r--src/mame/video/mustache.c2
-rw-r--r--src/mame/video/mw8080bw.c2
-rw-r--r--src/mame/video/mystston.c2
-rw-r--r--src/mame/video/mystwarr.c22
-rw-r--r--src/mame/video/n64.h4
-rw-r--r--src/mame/video/n8080.c4
-rw-r--r--src/mame/video/namcofl.c2
-rw-r--r--src/mame/video/namconb1.c4
-rw-r--r--src/mame/video/namcos1.c2
-rw-r--r--src/mame/video/namcos2.c10
-rw-r--r--src/mame/video/namcos22.c8
-rw-r--r--src/mame/video/namcos86.c2
-rw-r--r--src/mame/video/naughtyb.c2
-rw-r--r--src/mame/video/nbmj8688.c12
-rw-r--r--src/mame/video/nbmj8891.c8
-rw-r--r--src/mame/video/nbmj8900.c10
-rw-r--r--src/mame/video/nbmj8991.c6
-rw-r--r--src/mame/video/nbmj9195.c6
-rw-r--r--src/mame/video/neogeo.c10
-rw-r--r--src/mame/video/niyanpai.c6
-rw-r--r--src/mame/video/nmk16.c2
-rw-r--r--src/mame/video/nova2001.c2
-rw-r--r--src/mame/video/ojankohs.c2
-rw-r--r--src/mame/video/othunder.c2
-rw-r--r--src/mame/video/pacland.c4
-rw-r--r--src/mame/video/pacman.c2
-rw-r--r--src/mame/video/pandoras.c2
-rw-r--r--src/mame/video/pastelg.c10
-rw-r--r--src/mame/video/pcktgal.c2
-rw-r--r--src/mame/video/pgm.c4
-rw-r--r--src/mame/video/phoenix.c8
-rw-r--r--src/mame/video/pingpong.c2
-rw-r--r--src/mame/video/pitnrun.c10
-rw-r--r--src/mame/video/playch10.c6
-rw-r--r--src/mame/video/plygonet.c2
-rw-r--r--src/mame/video/polepos.c6
-rw-r--r--src/mame/video/policetr.c4
-rw-r--r--src/mame/video/pooyan.c2
-rw-r--r--src/mame/video/popeye.c6
-rw-r--r--src/mame/video/popper.c2
-rw-r--r--src/mame/video/portrait.c4
-rw-r--r--src/mame/video/ppu2c0x.c2
-rw-r--r--src/mame/video/prehisle.c2
-rw-r--r--src/mame/video/psikyo.c8
-rw-r--r--src/mame/video/punchout.c4
-rw-r--r--src/mame/video/pushman.c2
-rw-r--r--src/mame/video/quasar.c2
-rw-r--r--src/mame/video/quizdna.c6
-rw-r--r--src/mame/video/rallyx.c4
-rw-r--r--src/mame/video/redalert.c4
-rw-r--r--src/mame/video/redclash.c2
-rw-r--r--src/mame/video/retofinv.c2
-rw-r--r--src/mame/video/rockrage.c2
-rw-r--r--src/mame/video/rocnrope.c2
-rw-r--r--src/mame/video/rollrace.c4
-rw-r--r--src/mame/video/route16.c8
-rw-r--r--src/mame/video/rungun.c2
-rw-r--r--src/mame/video/sbasketb.c2
-rw-r--r--src/mame/video/scotrsht.c2
-rw-r--r--src/mame/video/sega16sp.c44
-rw-r--r--src/mame/video/segag80r.c8
-rw-r--r--src/mame/video/segag80v.c2
-rw-r--r--src/mame/video/segaic16.c8
-rw-r--r--src/mame/video/segas32.c4
-rw-r--r--src/mame/video/seibuspi.c2
-rw-r--r--src/mame/video/seicross.c2
-rw-r--r--src/mame/video/seta.c8
-rw-r--r--src/mame/video/sf.c4
-rw-r--r--src/mame/video/shangkid.c4
-rw-r--r--src/mame/video/shaolins.c2
-rw-r--r--src/mame/video/shisen.c2
-rw-r--r--src/mame/video/shootout.c2
-rw-r--r--src/mame/video/sidearms.c4
-rw-r--r--src/mame/video/sidepckt.c2
-rw-r--r--src/mame/video/skyfox.c4
-rw-r--r--src/mame/video/skykid.c2
-rw-r--r--src/mame/video/skyraid.c4
-rw-r--r--src/mame/video/snk.c2
-rw-r--r--src/mame/video/snk6502.c4
-rw-r--r--src/mame/video/snookr10.c4
-rw-r--r--src/mame/video/sonson.c2
-rw-r--r--src/mame/video/spacefb.c6
-rw-r--r--src/mame/video/spdodgeb.c4
-rw-r--r--src/mame/video/speedatk.c2
-rw-r--r--src/mame/video/sprcros2.c2
-rw-r--r--src/mame/video/srmp2.c4
-rw-r--r--src/mame/video/ssozumo.c2
-rw-r--r--src/mame/video/sspeedr.c2
-rw-r--r--src/mame/video/st0016.c4
-rw-r--r--src/mame/video/stactics.c4
-rw-r--r--src/mame/video/stfight.c6
-rw-r--r--src/mame/video/strnskil.c4
-rw-r--r--src/mame/video/stvvdp2.c2
-rw-r--r--src/mame/video/suna8.c4
-rw-r--r--src/mame/video/superchs.c2
-rw-r--r--src/mame/video/suprloco.c4
-rw-r--r--src/mame/video/suprnova.c2
-rw-r--r--src/mame/video/suprridr.c2
-rw-r--r--src/mame/video/system1.c8
-rw-r--r--src/mame/video/tagteam.c2
-rw-r--r--src/mame/video/tail2nos.c2
-rw-r--r--src/mame/video/taito_z.c12
-rw-r--r--src/mame/video/taitoic.c2
-rw-r--r--src/mame/video/taitosj.c4
-rw-r--r--src/mame/video/tankbatt.c2
-rw-r--r--src/mame/video/tatsumi.c4
-rw-r--r--src/mame/video/tceptor.c14
-rw-r--r--src/mame/video/tecmosys.c2
-rw-r--r--src/mame/video/terracre.c4
-rw-r--r--src/mame/video/thedeep.c2
-rw-r--r--src/mame/video/thepit.c4
-rw-r--r--src/mame/video/thief.c4
-rw-r--r--src/mame/video/tigeroad.c2
-rw-r--r--src/mame/video/timelimt.c2
-rw-r--r--src/mame/video/timeplt.c2
-rw-r--r--src/mame/video/tmnt.c14
-rw-r--r--src/mame/video/tnzs.c2
-rw-r--r--src/mame/video/toypop.c2
-rw-r--r--src/mame/video/tp84.c2
-rw-r--r--src/mame/video/trackfld.c2
-rw-r--r--src/mame/video/travrusa.c4
-rw-r--r--src/mame/video/trucocl.c2
-rw-r--r--src/mame/video/tryout.c2
-rw-r--r--src/mame/video/tubep.c14
-rw-r--r--src/mame/video/tunhunt.c2
-rw-r--r--src/mame/video/turbo.c22
-rw-r--r--src/mame/video/tx1.c44
-rw-r--r--src/mame/video/ultratnk.c2
-rw-r--r--src/mame/video/undrfire.c6
-rw-r--r--src/mame/video/vball.c4
-rw-r--r--src/mame/video/vertigo.c4
-rw-r--r--src/mame/video/vicdual.c2
-rw-r--r--src/mame/video/vulgus.c2
-rw-r--r--src/mame/video/wecleman.c4
-rw-r--r--src/mame/video/williams.c2
-rw-r--r--src/mame/video/wiping.c2
-rw-r--r--src/mame/video/wiz.c2
-rw-r--r--src/mame/video/xevious.c6
-rw-r--r--src/mame/video/xorworld.c2
-rw-r--r--src/mame/video/xyonix.c2
-rw-r--r--src/mame/video/yiear.c2
-rw-r--r--src/mame/video/zaccaria.c2
-rw-r--r--src/mame/video/zaxxon.c6
-rw-r--r--src/mame/video/zodiack.c2
1180 files changed, 4251 insertions, 4335 deletions
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index e64e917e5cd..d00dbbfdbfe 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -279,7 +279,7 @@ static CPU_INIT( cquestsnd )
memset(cpustate, 0, sizeof(*cpustate));
cpustate->dac_w = _config->dac_w;
- cpustate->sound_data = (UINT16*)device->machine().region(_config->sound_data_region)->base();
+ cpustate->sound_data = (UINT16*)device->machine().root_device().memregion(_config->sound_data_region)->base();
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 904ed302b41..e9b4d3eb409 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -256,7 +256,7 @@ static CPU_INIT( esrip )
/* Register configuration structure callbacks */
cpustate->fdt_r = _config->fdt_r;
cpustate->fdt_w = _config->fdt_w;
- cpustate->lbrm = (UINT8*)device->machine().region(_config->lbrm_prom)->base();
+ cpustate->lbrm = (UINT8*)device->machine().root_device().memregion(_config->lbrm_prom)->base();
cpustate->status_in = _config->status_in;
cpustate->draw = _config->draw;
diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c
index ebb8b4da5dd..bbf166a2313 100644
--- a/src/emu/cpu/mb86233/mb86233.c
+++ b/src/emu/cpu/mb86233/mb86233.c
@@ -119,7 +119,7 @@ static CPU_INIT( mb86233 )
{
cpustate->fifo_read_cb = _config->fifo_read_cb;
cpustate->fifo_write_cb = _config->fifo_write_cb;
- cpustate->Tables = (UINT32*) device->machine().region(_config->tablergn)->base();
+ cpustate->Tables = (UINT32*) device->machine().root_device().memregion(_config->tablergn)->base();
}
cpustate->RAM = auto_alloc_array(device->machine(), UINT32, 2 * 0x200); /* 2x 2KB */
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index fadc3a086da..63d19082db3 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -1285,7 +1285,7 @@ static UINT64 expression_read_program_direct(address_space *_space, int opcode,
static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size)
{
- const memory_region *region = machine.region(rgntag);
+ memory_region *region = machine.root_device().memregion(rgntag);
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
/* make sure we get a valid base before proceeding */
@@ -1462,7 +1462,7 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data)
{
debugcpu_private *global = machine.debugcpu_data;
- const memory_region *region = machine.region(rgntag);
+ memory_region *region = machine.root_device().memregion(rgntag);
/* make sure we get a valid base before proceeding */
if (region != NULL)
@@ -1571,7 +1571,7 @@ static expression_error::error_code expression_validate(void *param, const char
case EXPSPACE_REGION:
if (name == NULL)
return expression_error::MISSING_MEMORY_NAME;
- if (machine.region(name)->base() == NULL)
+ if (machine.root_device().memregion(name)->base() == NULL)
return expression_error::INVALID_MEMORY_NAME;
break;
diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c
index bc8a4e585ad..cfaafbfdad1 100644
--- a/src/emu/debug/dvmemory.c
+++ b/src/emu/debug/dvmemory.c
@@ -84,7 +84,7 @@ debug_view_memory_source::debug_view_memory_source(const char *name, address_spa
{
}
-debug_view_memory_source::debug_view_memory_source(const char *name, const memory_region &region)
+debug_view_memory_source::debug_view_memory_source(const char *name, memory_region &region)
: debug_view_source(name),
m_space(NULL),
m_memintf(NULL),
@@ -165,7 +165,7 @@ void debug_view_memory::enumerate_sources()
}
// then add all the memory regions
- for (const memory_region *region = machine().first_region(); region != NULL; region = region->next())
+ for (memory_region *region = machine().memory().first_region(); region != NULL; region = region->next())
{
name.printf("Region '%s'", region->name());
m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *region)));
@@ -707,7 +707,7 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data)
// hack for FD1094 editing
#ifdef FD1094_HACK
- if (source.m_base == machine().region("user2"))
+ if (source.m_base == machine().root_device().memregion("user2"))
{
extern void fd1094_regenerate_key(running_machine &machine);
fd1094_regenerate_key(machine());
diff --git a/src/emu/debug/dvmemory.h b/src/emu/debug/dvmemory.h
index 147b63a0fa7..2436b1a6199 100644
--- a/src/emu/debug/dvmemory.h
+++ b/src/emu/debug/dvmemory.h
@@ -53,7 +53,7 @@ class debug_view_memory_source : public debug_view_source
friend class debug_view_memory;
debug_view_memory_source(const char *name, address_space &space);
- debug_view_memory_source(const char *name, const memory_region &region);
+ debug_view_memory_source(const char *name, memory_region &region);
debug_view_memory_source(const char *name, void *base, int element_size, int num_elements);
public:
diff --git a/src/emu/device.c b/src/emu/device.c
index de3437094b9..bd7d8b353fe 100644
--- a/src/emu/device.c
+++ b/src/emu/device.c
@@ -186,11 +186,11 @@ device_t::~device_t()
//-------------------------------------------------
-// subregion - return a pointer to the region
+// memregion - return a pointer to the region
// info for a given region
//-------------------------------------------------
-const memory_region *device_t::subregion(const char *_tag) const
+memory_region *device_t::memregion(const char *_tag) const
{
// safety first
if (this == NULL)
@@ -198,12 +198,12 @@ const memory_region *device_t::subregion(const char *_tag) const
// build a fully-qualified name and look it up
astring fullpath;
- return machine().region(subtag(fullpath, _tag));
+ return machine().memory().region(subtag(fullpath, _tag));
}
//-------------------------------------------------
-// subregion - return a pointer to the memory
+// memregion - return a pointer to the memory
// bank info for a given bank
//-------------------------------------------------
@@ -397,7 +397,7 @@ void device_t::set_machine(running_machine &machine)
void device_t::start()
{
// populate the machine and the region field
- m_region = machine().region(tag());
+ m_region = machine().root_device().memregion(tag());
// find all the registered devices
bool allfound = true;
diff --git a/src/emu/device.h b/src/emu/device.h
index bc59bae536b..b157f4d9a3d 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -183,13 +183,13 @@ public:
device_t *first_subdevice() const { return m_subdevice_list.first(); }
astring &subtag(astring &dest, const char *tag) const;
astring &siblingtag(astring &dest, const char *tag) const { return (this != NULL && m_owner != NULL) ? m_owner->subtag(dest, tag) : dest.cpy(tag); }
- const memory_region *subregion(const char *tag) const;
+ memory_region *memregion(const char *tag) const;
memory_bank *membank(const char *tag) const;
device_t *subdevice(const char *tag) const;
device_t *siblingdevice(const char *tag) const;
template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); }
template<class _DeviceClass> inline _DeviceClass *siblingdevice(const char *tag) const { return downcast<_DeviceClass *>(siblingdevice(tag)); }
- const memory_region *region() const { return m_region; }
+ memory_region *region() const { return m_region; }
// configuration helpers
static void static_set_clock(device_t &device, UINT32 clock);
@@ -296,7 +296,7 @@ protected:
attoseconds_t m_attoseconds_per_clock;// period in attoseconds
device_debug * m_debug;
- const memory_region * m_region; // our device-local region
+ memory_region * m_region; // our device-local region
const machine_config & m_machine_config; // reference to the machine's configuration
const void * m_static_config; // static device configuration
const input_device_default *m_input_defaults; // devices input ports default overrides
diff --git a/src/emu/diimage.c b/src/emu/diimage.c
index 11fdec1f6b9..24b74b10ef9 100644
--- a/src/emu/diimage.c
+++ b/src/emu/diimage.c
@@ -422,7 +422,7 @@ UINT8 *device_image_interface::get_software_region(const char *tag)
return NULL;
sprintf( full_tag, "%s:%s", device().tag(), tag );
- return device().machine().region( full_tag )->base();
+ return device().machine().root_device().memregion( full_tag )->base();
}
@@ -435,7 +435,7 @@ UINT32 device_image_interface::get_software_region_length(const char *tag)
char full_tag[256];
sprintf( full_tag, "%s:%s", device().tag(), tag );
- return device().machine().region( full_tag )->bytes();
+ return device().machine().root_device().memregion( full_tag )->bytes();
}
diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c
index 1abd59f6315..3d23dcbbad5 100644
--- a/src/emu/drawgfx.c
+++ b/src/emu/drawgfx.c
@@ -94,7 +94,7 @@ void gfx_init(running_machine &machine)
for (curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != NULL; curgfx++)
{
const gfx_decode_entry *gfxdecode = &gfxdecodeinfo[curgfx];
- const memory_region *region = (gfxdecode->memory_region != NULL) ? machine.region(gfxdecode->memory_region) : NULL;
+ memory_region *region = (gfxdecode->memory_region != NULL) ? machine.root_device().memregion(gfxdecode->memory_region) : NULL;
UINT32 region_length = (region != NULL) ? (8 * region->bytes()) : 0;
const UINT8 *region_base = (region != NULL) ? region->base() : NULL;
UINT32 xscale = (gfxdecode->xscale == 0) ? 1 : gfxdecode->xscale;
diff --git a/src/emu/imagedev/cartslot.c b/src/emu/imagedev/cartslot.c
index 632da01ce87..3d85bff90a3 100644
--- a/src/emu/imagedev/cartslot.c
+++ b/src/emu/imagedev/cartslot.c
@@ -78,7 +78,7 @@ int cartslot_image_device::load_cartridge(const rom_entry *romrgn, const rom_ent
offset = ROM_GETOFFSET(roment);
size = ROM_GETLENGTH(roment);
flags = ROM_GETFLAGS(roment);
- ptr = ((UINT8 *) device().machine().region(region)->base()) + offset;
+ ptr = ((UINT8 *) device().machine().root_device().memregion(region)->base()) + offset;
if (load)
{
diff --git a/src/emu/machine.c b/src/emu/machine.c
index 6a337643e45..1dc0ef8daf1 100644
--- a/src/emu/machine.c
+++ b/src/emu/machine.c
@@ -150,10 +150,6 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o
m_config(_config),
m_system(_config.gamedrv()),
m_osd(osd),
- m_regionlist(m_respool),
- m_save(*this),
- m_scheduler(*this),
- m_memory(NULL),
m_cheat(NULL),
m_render(NULL),
m_input(NULL),
@@ -176,7 +172,11 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o
m_saveload_schedule(SLS_NONE),
m_saveload_schedule_time(attotime::zero),
m_saveload_searchpath(NULL),
- m_logerror_list(m_respool)
+ m_logerror_list(m_respool),
+
+ m_save(*this),
+ m_memory(*this),
+ m_scheduler(*this)
{
memset(gfx, 0, sizeof(gfx));
memset(&m_base_time, 0, sizeof(m_base_time));
@@ -276,7 +276,7 @@ void running_machine::start()
// first load ROMs, then populate memory, and finally initialize CPUs
// these operations must proceed in this order
rom_init(*this);
- m_memory = auto_alloc(*this, memory_manager(*this));
+ m_memory.initialize();
m_watchdog_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::watchdog_fired), this));
save().save_item(NAME(m_watchdog_enabled));
save().save_item(NAME(m_watchdog_counter));
@@ -606,33 +606,6 @@ void running_machine::resume()
//-------------------------------------------------
-// region_alloc - allocates memory for a region
-//-------------------------------------------------
-
-memory_region *running_machine::region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian)
-{
-mame_printf_verbose("Region '%s' created\n", name);
- // make sure we don't have a region of the same name; also find the end of the list
- memory_region *info = m_regionlist.find(name);
- if (info != NULL)
- fatalerror("region_alloc called with duplicate region name \"%s\"\n", name);
-
- // allocate the region
- return &m_regionlist.append(name, *auto_alloc(*this, memory_region(*this, name, length, width, endian)));
-}
-
-
-//-------------------------------------------------
-// region_free - releases memory for a region
-//-------------------------------------------------
-
-void running_machine::region_free(const char *name)
-{
- m_regionlist.remove(name);
-}
-
-
-//-------------------------------------------------
// add_notifier - add a notifier of the
// given type
//-------------------------------------------------
@@ -1059,38 +1032,6 @@ void running_machine::postload_all_devices()
-/***************************************************************************
- MEMORY REGIONS
-***************************************************************************/
-
-//-------------------------------------------------
-// memory_region - constructor
-//-------------------------------------------------
-
-memory_region::memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian)
- : m_machine(machine),
- m_next(NULL),
- m_name(name),
- m_length(length),
- m_width(width),
- m_endianness(endian)
-{
- assert(width == 1 || width == 2 || width == 4 || width == 8);
- m_base.u8 = auto_alloc_array(machine, UINT8, length);
-}
-
-
-//-------------------------------------------------
-// ~memory_region - destructor
-//-------------------------------------------------
-
-memory_region::~memory_region()
-{
- auto_free(machine(), m_base.v);
-}
-
-
-
//**************************************************************************
// CALLBACK ITEMS
//**************************************************************************
diff --git a/src/emu/machine.h b/src/emu/machine.h
index d794e0100e4..47b67182bd7 100644
--- a/src/emu/machine.h
+++ b/src/emu/machine.h
@@ -160,64 +160,6 @@ typedef struct _debugcpu_private debugcpu_private;
typedef struct _generic_machine_private generic_machine_private;
-// ======================> memory_region
-
-// memory region object; should eventually be renamed memory_region
-class memory_region
-{
- DISABLE_COPYING(memory_region);
-
- friend class running_machine;
- friend class simple_list<memory_region>;
- friend resource_pool_object<memory_region>::~resource_pool_object();
-
- // construction/destruction
- memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian);
- ~memory_region();
-
-public:
- // getters
- running_machine &machine() const { return m_machine; }
- memory_region *next() const { return m_next; }
- UINT8 *base() const { return (this != NULL) ? m_base.u8 : NULL; }
- UINT8 *end() const { return (this != NULL) ? m_base.u8 + m_length : NULL; }
- UINT32 bytes() const { return (this != NULL) ? m_length : 0; }
- const char *name() const { return m_name; }
-
- // flag expansion
- endianness_t endianness() const { return m_endianness; }
- UINT8 width() const { return m_width; }
-
- // data access
- UINT8 &u8(offs_t offset = 0) const { return m_base.u8[offset]; }
- UINT16 &u16(offs_t offset = 0) const { return m_base.u16[offset]; }
- UINT32 &u32(offs_t offset = 0) const { return m_base.u32[offset]; }
- UINT64 &u64(offs_t offset = 0) const { return m_base.u64[offset]; }
-
- // allow passing a region for any common pointer
- operator void *() const { return (this != NULL) ? m_base.v : NULL; }
- operator INT8 *() const { return (this != NULL) ? m_base.i8 : NULL; }
- operator UINT8 *() const { return (this != NULL) ? m_base.u8 : NULL; }
- operator INT16 *() const { return (this != NULL) ? m_base.i16 : NULL; }
- operator UINT16 *() const { return (this != NULL) ? m_base.u16 : NULL; }
- operator INT32 *() const { return (this != NULL) ? m_base.i32 : NULL; }
- operator UINT32 *() const { return (this != NULL) ? m_base.u32 : NULL; }
- operator INT64 *() const { return (this != NULL) ? m_base.i64 : NULL; }
- operator UINT64 *() const { return (this != NULL) ? m_base.u64 : NULL; }
-
-private:
- // internal data
- running_machine & m_machine;
- memory_region * m_next;
- astring m_name;
- generic_ptr m_base;
- UINT32 m_length;
- UINT8 m_width;
- endianness_t m_endianness;
-};
-
-
-
// ======================> system_time
// system time description, both local and UTC
@@ -279,7 +221,7 @@ public:
resource_pool &respool() { return m_respool; }
device_scheduler &scheduler() { return m_scheduler; }
save_manager &save() { return m_save; }
- memory_manager &memory() { assert(m_memory != NULL); return *m_memory; }
+ memory_manager &memory() { return m_memory; }
cheat_manager &cheat() const { assert(m_cheat != NULL); return *m_cheat; }
render_manager &render() const { assert(m_render != NULL); return *m_render; }
input_manager &input() const { assert(m_input != NULL); return *m_input; }
@@ -302,7 +244,6 @@ public:
// additional helpers
emu_options &options() const { return m_config.options(); }
- memory_region *first_region() const { return m_regionlist.first(); }
attotime time() const { return m_scheduler.time(); }
bool scheduled_event_pending() const { return m_exit_pending || m_hard_reset_pending; }
@@ -310,7 +251,6 @@ public:
inline device_t *device(const char *tag) { return root_device().subdevice(tag); }
template<class _DeviceClass> inline _DeviceClass *device(const char *tag) { return downcast<_DeviceClass *>(device(tag)); }
inline const input_port_config *port(const char *tag);
- inline const memory_region *region(const char *tag);
// configuration helpers
device_t &add_dynamic_device(device_t &owner, device_type type, const char *tag, UINT32 clock);
@@ -337,10 +277,6 @@ public:
void base_datetime(system_time &systime);
void current_datetime(system_time &systime);
- // regions
- memory_region *region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian);
- void region_free(const char *name);
-
// watchdog control
void watchdog_reset();
void watchdog_enable(bool enable = true);
@@ -404,13 +340,7 @@ private:
const game_driver & m_system; // reference to the definition of the game machine
osd_interface & m_osd; // reference to OSD system
- // embedded managers and objects
- tagged_list<memory_region> m_regionlist; // list of memory regions
- save_manager m_save; // save manager
- device_scheduler m_scheduler; // scheduler object
-
// managers
- memory_manager * m_memory; // internal data from memory.c
cheat_manager * m_cheat; // internal data from cheat.c
render_manager * m_render; // internal data from render.c
input_manager * m_input; // internal data from input.c
@@ -484,6 +414,11 @@ private:
logerror_callback m_func;
};
simple_list<logerror_callback_item> m_logerror_list;
+
+ // embedded managers and objects
+ save_manager m_save; // save manager
+ memory_manager m_memory; // memory manager
+ device_scheduler m_scheduler; // scheduler object
};
@@ -503,16 +438,5 @@ inline const input_port_config *running_machine::port(const char *tag)
return m_portlist.find(root_device().subtag(fulltag, tag).cstr());
}
-inline const memory_region *running_machine::region(const char *tag)
-{
- // if tag begins with a :, it's absolute
- if (tag[0] == ':')
- return m_regionlist.find(tag);
-
- // otherwise, compute it relative to the root device
- astring fulltag;
- return m_regionlist.find(root_device().subtag(fulltag, tag).cstr());
-}
-
#endif /* __MACHINE_H__ */
diff --git a/src/emu/machine/laserdsc.c b/src/emu/machine/laserdsc.c
index a006eebda22..f5b6c2e0520 100644
--- a/src/emu/machine/laserdsc.c
+++ b/src/emu/machine/laserdsc.c
@@ -294,7 +294,7 @@ void laserdisc_device::static_set_overlay(device_t &device, UINT32 width, UINT32
//-------------------------------------------------
// static_set_overlay - set the overlay visible
-// subregion
+// memregion
//-------------------------------------------------
void laserdisc_device::static_set_overlay_clip(device_t &device, INT32 minx, INT32 maxx, INT32 miny, INT32 maxy)
diff --git a/src/emu/machine/mccs1850.c b/src/emu/machine/mccs1850.c
index d8c06b06ef5..a5a124bf2d9 100644
--- a/src/emu/machine/mccs1850.c
+++ b/src/emu/machine/mccs1850.c
@@ -371,9 +371,9 @@ void mccs1850_device::nvram_default()
{
memset(m_ram, 0xff, RAM_SIZE);
- if (machine().region(tag()) != NULL)
+ if (machine().root_device().memregion(tag()) != NULL)
{
- UINT8 *nvram = machine().region(tag())->base();
+ UINT8 *nvram = machine().root_device().memregion(tag())->base();
// initialize NVRAM
memcpy(m_ram, nvram, 0x20);
diff --git a/src/emu/machine/pls100.c b/src/emu/machine/pls100.c
index cca9c97515d..2f3a0ba2d85 100644
--- a/src/emu/machine/pls100.c
+++ b/src/emu/machine/pls100.c
@@ -31,7 +31,7 @@ const device_type PLS100 = &device_creator<pls100_device>;
inline void pls100_device::parse_fusemap()
{
jed_data jed;
- jedbin_parse(machine().region(tag())->base(), machine().region(tag())->bytes(), &jed);
+ jedbin_parse(machine().root_device().memregion(tag())->base(), machine().root_device().memregion(tag())->bytes(), &jed);
UINT32 fusenum = 0;
m_xor = 0;
@@ -113,7 +113,7 @@ pls100_device::pls100_device(const machine_config &mconfig, const char *tag, dev
void pls100_device::device_start()
{
// parse fusemap
- assert(machine().region(tag()) != NULL);
+ assert(machine().root_device().memregion(tag()) != NULL);
parse_fusemap();
// register for state saving
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 93539489a76..4157aa9fa7b 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -1499,11 +1499,11 @@ static void generate_memdump(running_machine &machine);
//**************************************************************************
-// CORE SYSTEM OPERATIONS
+// MEMORY MANAGER
//**************************************************************************
//-------------------------------------------------
-// memory_init - initialize the memory system
+// memory_manager - constructor
//-------------------------------------------------
memory_manager::memory_manager(running_machine &machine)
@@ -1513,9 +1513,17 @@ memory_manager::memory_manager(running_machine &machine)
{
memset(m_bank_ptr, 0, sizeof(m_bank_ptr));
memset(m_bankd_ptr, 0, sizeof(m_bankd_ptr));
+}
+
+
+//-------------------------------------------------
+// initialize - initialize the memory system
+//-------------------------------------------------
+void memory_manager::initialize()
+{
// loop over devices and spaces within each device
- memory_interface_iterator iter(machine.root_device());
+ memory_interface_iterator iter(machine().root_device());
for (device_memory_interface *memory = iter.first(); memory != NULL; memory = iter.next())
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
{
@@ -1542,21 +1550,16 @@ memory_manager::memory_manager(running_machine &machine)
space->locate_memory();
// register a callback to reset banks when reloading state
- machine.save().register_postload(save_prepost_delegate(FUNC(memory_manager::bank_reattach), this));
+ machine().save().register_postload(save_prepost_delegate(FUNC(memory_manager::bank_reattach), this));
// dump the final memory configuration
- generate_memdump(machine);
+ generate_memdump(machine());
// we are now initialized
m_initialized = true;
}
-
-//**************************************************************************
-// MEMORY BANKING
-//**************************************************************************
-
//-------------------------------------------------
// shared - get a pointer to a shared memory
// region by tag
@@ -1604,6 +1607,33 @@ void memory_manager::dump(FILE *file)
//-------------------------------------------------
+// region_alloc - allocates memory for a region
+//-------------------------------------------------
+
+memory_region *memory_manager::region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian)
+{
+mame_printf_verbose("Region '%s' created\n", name);
+ // make sure we don't have a region of the same name; also find the end of the list
+ memory_region *info = m_regionlist.find(name);
+ if (info != NULL)
+ fatalerror("region_alloc called with duplicate region name \"%s\"\n", name);
+
+ // allocate the region
+ return &m_regionlist.append(name, *global_alloc(memory_region(machine(), name, length, width, endian)));
+}
+
+
+//-------------------------------------------------
+// region_free - releases memory for a region
+//-------------------------------------------------
+
+void memory_manager::region_free(const char *name)
+{
+ m_regionlist.remove(name);
+}
+
+
+//-------------------------------------------------
// generate_memdump - internal memory dump
//-------------------------------------------------
@@ -1789,7 +1819,7 @@ inline void address_space::adjust_addresses(offs_t &start, offs_t &end, offs_t &
void address_space::prepare_map()
{
- const memory_region *devregion = (m_spacenum == AS_0) ? machine().region(m_device.tag()) : NULL;
+ memory_region *devregion = (m_spacenum == AS_0) ? machine().root_device().memregion(m_device.tag()) : NULL;
UINT32 devregionsize = (devregion != NULL) ? devregion->bytes() : 0;
// allocate the address map
@@ -1848,7 +1878,7 @@ void address_space::prepare_map()
device().siblingtag(fulltag, entry->m_region);
// find the region
- const memory_region *region = machine().region(fulltag);
+ memory_region *region = machine().root_device().memregion(fulltag);
if (region == NULL)
fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", m_device.tag(), m_name, entry->m_addrstart, entry->m_addrend, entry->m_region);
@@ -1865,7 +1895,7 @@ void address_space::prepare_map()
device().siblingtag(fulltag, entry->m_region);
// set the memory address
- entry->m_memory = machine().region(fulltag.cstr())->base() + entry->m_rgnoffs;
+ entry->m_memory = machine().root_device().memregion(fulltag.cstr())->base() + entry->m_rgnoffs;
}
}
@@ -2865,7 +2895,7 @@ bool address_space::needs_backing_store(const address_map_entry *entry)
return true;
// if we're reading from RAM or from ROM outside of address space 0 or its region, then yes, we do need backing
- const memory_region *region = machine().region(m_device.tag());
+ memory_region *region = machine().root_device().memregion(m_device.tag());
if (entry->m_read.m_type == AMH_RAM ||
(entry->m_read.m_type == AMH_ROM && (m_spacenum != AS_0 || region == NULL || entry->m_addrstart >= region->bytes())))
return true;
@@ -4143,8 +4173,8 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
}
// register for saving, but only if we're not part of a memory region
- const memory_region *region;
- for (region = space.machine().first_region(); region != NULL; region = region->next())
+ memory_region *region;
+ for (region = space.machine().memory().first_region(); region != NULL; region = region->next())
if (m_data >= region->base() && (m_data + (byteend - bytestart + 1)) < region->end())
{
VPRINTF(("skipping save of this memory block as it is covered by a memory region\n"));
@@ -4416,6 +4446,27 @@ void memory_bank::configure_decrypted_entries(int startentry, int numentries, vo
//**************************************************************************
+// MEMORY REGIONS
+//**************************************************************************
+
+//-------------------------------------------------
+// memory_region - constructor
+//-------------------------------------------------
+
+memory_region::memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian)
+ : m_machine(machine),
+ m_next(NULL),
+ m_name(name),
+ m_buffer(length),
+ m_width(width),
+ m_endianness(endian)
+{
+ assert(width == 1 || width == 2 || width == 4 || width == 8);
+}
+
+
+
+//**************************************************************************
// HANDLER ENTRY
//**************************************************************************
diff --git a/src/emu/memory.h b/src/emu/memory.h
index cb2c4eb47d7..b40f378bffc 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -740,6 +740,62 @@ private:
};
+// ======================> memory_region
+
+// memory region object
+class memory_region
+{
+ DISABLE_COPYING(memory_region);
+
+ friend class memory_manager;
+ friend class simple_list<memory_region>;
+ friend resource_pool_object<memory_region>::~resource_pool_object();
+
+ // construction/destruction
+ memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian);
+
+public:
+ // getters
+ running_machine &machine() const { return m_machine; }
+ memory_region *next() const { return m_next; }
+ UINT8 *base() { return (this != NULL) ? &m_buffer[0] : NULL; }
+ UINT8 *end() { return (this != NULL) ? base() + m_buffer.count() : NULL; }
+ UINT32 bytes() const { return (this != NULL) ? m_buffer.count() : 0; }
+ const char *name() const { return m_name; }
+
+ // flag expansion
+ endianness_t endianness() const { return m_endianness; }
+ UINT8 width() const { return m_width; }
+
+ // data access
+ UINT8 &u8(offs_t offset = 0) { return m_buffer[offset]; }
+ UINT16 &u16(offs_t offset = 0) { return reinterpret_cast<UINT16 *>(base())[offset]; }
+ UINT32 &u32(offs_t offset = 0) { return reinterpret_cast<UINT32 *>(base())[offset]; }
+ UINT64 &u64(offs_t offset = 0) { return reinterpret_cast<UINT64 *>(base())[offset]; }
+
+ // allow passing a region for any common pointer
+ operator void *() { return (this != NULL) ? reinterpret_cast<void *>(base()) : NULL; }
+ operator INT8 *() { return (this != NULL) ? reinterpret_cast<INT8 *>(base()) : NULL; }
+ operator UINT8 *() { return (this != NULL) ? reinterpret_cast<UINT8 *>(base()) : NULL; }
+ operator INT16 *() { return (this != NULL) ? reinterpret_cast<INT16 *>(base()) : NULL; }
+ operator UINT16 *() { return (this != NULL) ? reinterpret_cast<UINT16 *>(base()) : NULL; }
+ operator INT32 *() { return (this != NULL) ? reinterpret_cast<INT32 *>(base()) : NULL; }
+ operator UINT32 *() { return (this != NULL) ? reinterpret_cast<UINT32 *>(base()) : NULL; }
+ operator INT64 *() { return (this != NULL) ? reinterpret_cast<INT64 *>(base()) : NULL; }
+ operator UINT64 *() { return (this != NULL) ? reinterpret_cast<UINT64 *>(base()) : NULL; }
+
+private:
+ // internal data
+ running_machine & m_machine;
+ memory_region * m_next;
+ astring m_name;
+ dynamic_buffer m_buffer;
+ UINT8 m_width;
+ endianness_t m_endianness;
+};
+
+
+
// ======================> memory_manager
// holds internal state for the memory system
@@ -748,14 +804,17 @@ class memory_manager
friend class address_space;
friend class address_table;
friend class device_t;
+ friend class memory_block;
public:
// construction/destruction
memory_manager(running_machine &machine);
+ void initialize();
// getters
running_machine &machine() const { return m_machine; }
address_space *first_space() const { return m_spacelist.first(); }
+ memory_region *first_region() const { return m_regionlist.first(); }
// get a pointer to a shared memory region by tag
memory_share *shared(const char *tag);
@@ -767,10 +826,15 @@ public:
// pointers to a bank pointer (internal usage only)
UINT8 **bank_pointer_addr(UINT8 index, bool decrypted = false) { return decrypted ? &m_bankd_ptr[index] : &m_bank_ptr[index]; }
+ // regions
+ memory_region *region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian);
+ void region_free(const char *name);
+
private:
// internal helpers
memory_bank *first_bank() const { return m_banklist.first(); }
- memory_bank *bank(const char *tag) const { return m_bankmap.find_hash_only(tag); }
+ memory_bank *bank(const char *tag) const { return m_bankmap.find(tag); }
+ memory_region *region(const char *tag) { return m_regionlist.find(tag); }
void bank_reattach();
// internal state
@@ -788,6 +852,8 @@ private:
UINT8 m_banknext; // next bank to allocate
tagged_list<memory_share> m_sharelist; // map for share lookups
+
+ tagged_list<memory_region> m_regionlist; // list of memory regions
};
diff --git a/src/emu/romload.c b/src/emu/romload.c
index a4138fcfea5..bd3f966b68b 100644
--- a/src/emu/romload.c
+++ b/src/emu/romload.c
@@ -518,7 +518,7 @@ static void display_rom_load_results(rom_load_data *romdata)
static void region_post_process(rom_load_data *romdata, const char *rgntag, bool invert)
{
- const memory_region *region = romdata->machine().region(rgntag);
+ memory_region *region = romdata->machine().root_device().memregion(rgntag);
UINT8 *base;
int i, j;
@@ -832,7 +832,7 @@ static void copy_rom_data(rom_load_data *romdata, const rom_entry *romp)
fatalerror("Error in RomModule definition: COPY has an invalid length\n");
/* make sure the source was valid */
- const memory_region *region = romdata->machine().region(srcrgntag);
+ memory_region *region = romdata->machine().root_device().memregion(srcrgntag);
if (region == NULL)
fatalerror("Error in RomModule definition: COPY from an invalid region\n");
@@ -1328,18 +1328,18 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
/* if this is a device region, override with the device width and endianness */
endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
UINT8 width = ROMREGION_GETWIDTH(region) / 8;
- const memory_region *memregion = romdata->machine().region(regiontag);
+ memory_region *memregion = romdata->machine().root_device().memregion(regiontag);
if (memregion != NULL)
{
if (romdata->machine().device(regiontag) != NULL)
normalize_flags_for_device(romdata->machine(), regiontag, width, endianness);
/* clear old region (todo: should be moved to an image unload function) */
- romdata->machine().region_free(memregion->name());
+ romdata->machine().memory().region_free(memregion->name());
}
/* remember the base and length */
- romdata->region = romdata->machine().region_alloc(regiontag, regionlength, width, endianness);
+ romdata->region = romdata->machine().memory().region_alloc(regiontag, regionlength, width, endianness);
LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base()));
/* clear the region if it's requested */
@@ -1404,7 +1404,7 @@ static void process_region_list(rom_load_data *romdata)
normalize_flags_for_device(romdata->machine(), regiontag, width, endianness);
/* remember the base and length */
- romdata->region = romdata->machine().region_alloc(regiontag, regionlength, width, endianness);
+ romdata->region = romdata->machine().memory().region_alloc(regiontag, regionlength, width, endianness);
LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base()));
/* clear the region if it's requested */
diff --git a/src/emu/screen.c b/src/emu/screen.c
index 65d904e84b3..aece8df6d93 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -951,7 +951,7 @@ void screen_device::finalize_burnin()
scaledvis.min_y = m_visarea.min_y * m_burnin.height() / m_height;
scaledvis.max_y = m_visarea.max_y * m_burnin.height() / m_height;
- // wrap a bitmap around the subregion we care about
+ // wrap a bitmap around the memregion we care about
bitmap_argb32 finalmap(scaledvis.width(), scaledvis.height());
int srcwidth = m_burnin.width();
int srcheight = m_burnin.height();
diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c
index 3c13dfda578..cd64ee811e1 100644
--- a/src/emu/sound/2610intf.c
+++ b/src/emu/sound/2610intf.c
@@ -164,8 +164,8 @@ static DEVICE_START( ym2610 )
pcmbufa = *device->region();
pcmsizea = device->region()->bytes();
name.printf("%s.deltat", device->tag());
- pcmbufb = (void *)(device->machine().region(name)->base());
- pcmsizeb = device->machine().region(name)->bytes();
+ pcmbufb = (void *)(device->machine().root_device().memregion(name)->base());
+ pcmsizeb = device->machine().root_device().memregion(name)->bytes();
if (pcmbufb == NULL || pcmsizeb == 0)
{
pcmbufb = pcmbufa;
diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c
index 25948e43fab..3d568c64642 100644
--- a/src/emu/sound/digitalk.c
+++ b/src/emu/sound/digitalk.c
@@ -648,7 +648,7 @@ static DEVICE_START(digitalker)
{
digitalker *dg = get_safe_token(device);
dg->device = device;
- dg->rom = device->machine().region(device->tag())->base();
+ dg->rom = device->machine().root_device().memregion(device->tag())->base();
dg->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, dg, digitalker_update);
dg->dac_index = 128;
dg->data = 0xff;
diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c
index 6ce1f3378b8..6a1bc548138 100644
--- a/src/emu/sound/es5506.c
+++ b/src/emu/sound/es5506.c
@@ -913,10 +913,10 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / (16*32), chip, es5506_update);
/* initialize the regions */
- chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine().region(intf->region0)->base() : NULL;
- chip->region_base[1] = intf->region1 ? (UINT16 *)device->machine().region(intf->region1)->base() : NULL;
- chip->region_base[2] = intf->region2 ? (UINT16 *)device->machine().region(intf->region2)->base() : NULL;
- chip->region_base[3] = intf->region3 ? (UINT16 *)device->machine().region(intf->region3)->base() : NULL;
+ chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine().root_device().memregion(intf->region0)->base() : NULL;
+ chip->region_base[1] = intf->region1 ? (UINT16 *)device->machine().root_device().memregion(intf->region1)->base() : NULL;
+ chip->region_base[2] = intf->region2 ? (UINT16 *)device->machine().root_device().memregion(intf->region2)->base() : NULL;
+ chip->region_base[3] = intf->region3 ? (UINT16 *)device->machine().root_device().memregion(intf->region3)->base() : NULL;
/* initialize the rest of the structure */
chip->device = device;
diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c
index f686fe280ee..6aa5806d873 100644
--- a/src/emu/sound/fm.c
+++ b/src/emu/sound/fm.c
@@ -4230,17 +4230,17 @@ void ym2610_reset_chip(void *chip)
/* setup PCM buffers again */
name.printf("%s",dev->tag());
- F2610->pcmbuf = (const UINT8 *)dev->machine().region(name)->base();
- F2610->pcm_size = dev->machine().region(name)->bytes();
+ F2610->pcmbuf = (const UINT8 *)dev->machine().root_device().memregion(name)->base();
+ F2610->pcm_size = dev->machine().root_device().memregion(name)->bytes();
name.printf("%s.deltat",dev->tag());
- F2610->deltaT.memory = (UINT8 *)dev->machine().region(name)->base();
+ F2610->deltaT.memory = (UINT8 *)dev->machine().root_device().memregion(name)->base();
if(F2610->deltaT.memory == NULL)
{
F2610->deltaT.memory = (UINT8*)F2610->pcmbuf;
F2610->deltaT.memory_size = F2610->pcm_size;
}
else
- F2610->deltaT.memory_size = dev->machine().region(name)->bytes();
+ F2610->deltaT.memory_size = dev->machine().root_device().memregion(name)->bytes();
/* Reset Prescaler */
OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */
diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c
index 549d196d362..248737ab3a6 100644
--- a/src/emu/sound/gaelco.c
+++ b/src/emu/sound/gaelco.c
@@ -260,7 +260,7 @@ static DEVICE_START( gaelco )
info->banks[j] = intf->banks[j];
}
info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 8000, info, gaelco_update);
- info->snd_data = (UINT8 *)device->machine().region(intf->gfxregion)->base();
+ info->snd_data = (UINT8 *)device->machine().root_device().memregion(intf->gfxregion)->base();
if (info->snd_data == NULL)
info->snd_data = *device->region();
diff --git a/src/emu/sound/i5000.c b/src/emu/sound/i5000.c
index 12eb02a472a..e989dee37f3 100644
--- a/src/emu/sound/i5000.c
+++ b/src/emu/sound/i5000.c
@@ -43,8 +43,8 @@ void i5000snd_device::device_start()
// create the stream
m_stream = machine().sound().stream_alloc(*this, 0, 2, clock() / 0x400, this);
- m_rom_base = (UINT16 *)device().machine().region(":i5000snd")->base();
- m_rom_mask = device().machine().region(":i5000snd")->bytes() / 2 - 1;
+ m_rom_base = (UINT16 *)device().machine().root_device().memregion(":i5000snd")->base();
+ m_rom_mask = device().machine().root_device().memregion(":i5000snd")->bytes() / 2 - 1;
}
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index 61411651a89..c9ebe0069ac 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -221,7 +221,7 @@ static DEVICE_START( k053260 )
ic->mode = 0;
- const memory_region *region = (ic->intf->rgnoverride != NULL) ? device->machine().region(ic->intf->rgnoverride) : device->region();
+ memory_region *region = (ic->intf->rgnoverride != NULL) ? device->machine().root_device().memregion(ic->intf->rgnoverride) : device->region();
ic->rom = *region;
ic->rom_size = region->bytes();
diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c
index 25bad3fc9c9..fbe32e56999 100644
--- a/src/emu/sound/k054539.c
+++ b/src/emu/sound/k054539.c
@@ -317,7 +317,7 @@ void k054539_device::init_chip()
cur_ptr = 0;
memset(ram, 0, 0x4000);
- const memory_region *reg = (rgnoverride != NULL) ? machine().region(rgnoverride) : region();
+ memory_region *reg = (rgnoverride != NULL) ? machine().root_device().memregion(rgnoverride) : region();
rom = *reg;
rom_size = reg->bytes();
rom_mask = 0xffffffffU;
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index fef1b4f35d2..68aec49747c 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -1415,7 +1415,7 @@ static DEVICE_START( tmsprom )
tms->rom = *device->region();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No rom region found");
- tms->prom = device->machine().region(tms->intf->prom_region)->base();
+ tms->prom = device->machine().root_device().memregion(tms->intf->prom_region)->base();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No prom region found");
tms->device = device;
diff --git a/src/emu/sound/votrax.c b/src/emu/sound/votrax.c
index f1a48d4707a..cc92bc59e07 100644
--- a/src/emu/sound/votrax.c
+++ b/src/emu/sound/votrax.c
@@ -1167,7 +1167,7 @@ void votrax_sc01_device::device_start()
m_master_clock_freq = clock();
m_stream = stream_alloc(0, 1, m_master_clock_freq / 16);
m_phoneme_timer = timer_alloc();
- m_rom = subregion("phoneme")->base();
+ m_rom = memregion("phoneme")->base();
// reset inputs
m_inflection = 0;
diff --git a/src/emu/sound/ymz770.c b/src/emu/sound/ymz770.c
index 6c7c1de07a8..b6aefefb9cf 100644
--- a/src/emu/sound/ymz770.c
+++ b/src/emu/sound/ymz770.c
@@ -733,7 +733,7 @@ void ymz770_device::device_start()
channels[i].decoder = new amm;
}
- rom_base = device().machine().region(":ymz770")->base();
+ rom_base = device().machine().root_device().memregion(":ymz770")->base();
save_item(NAME(cur_reg));
for (int i = 0; i < 8; i++)
diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c
index 856fe49ecfe..fa0d05ebd24 100644
--- a/src/emu/sound/zsg2.c
+++ b/src/emu/sound/zsg2.c
@@ -228,7 +228,7 @@ static DEVICE_START( zsg2 )
info->stream = device->machine().sound().stream_alloc(*device, 0, 2, info->sample_rate, info, update_stereo);
- info->bank_samples = device->machine().region(intf->samplergn)->base();
+ info->bank_samples = device->machine().root_device().memregion(intf->samplergn)->base();
}
/**************************************************************************
diff --git a/src/emu/video/315_5124.c b/src/emu/video/315_5124.c
index 39d9f7be72f..58a182f250e 100644
--- a/src/emu/video/315_5124.c
+++ b/src/emu/video/315_5124.c
@@ -1616,7 +1616,7 @@ void sega315_5124_device::device_start()
/* Allocate video RAM */
astring tempstring;
- m_CRAM = machine().region_alloc(subtag(tempstring,"vdp_cram"), SEGA315_5378_CRAM_SIZE, 1, ENDIANNESS_LITTLE);
+ m_CRAM = machine().memory().region_alloc(subtag(tempstring,"vdp_cram"), SEGA315_5378_CRAM_SIZE, 1, ENDIANNESS_LITTLE);
m_line_buffer = auto_alloc_array(machine(), int, 256 * 5);
m_frame_timing = (m_is_pal) ? pal_192 : ntsc_192;
diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c
index 18281e4016f..ea5d97a6040 100644
--- a/src/emu/video/generic.c
+++ b/src/emu/video/generic.c
@@ -160,7 +160,7 @@ PALETTE_INIT( monochrome_green )
PALETTE_INIT( RRRR_GGGG_BBBB )
{
- 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/emu/video/hd61830.c b/src/emu/video/hd61830.c
index 1e25af33484..1e67270a80e 100644
--- a/src/emu/video/hd61830.c
+++ b/src/emu/video/hd61830.c
@@ -478,7 +478,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect,
addr = 160*7 + (md - 0xe0) * 11 + cl;
}
- data = subregion("hd61830")->u8(addr);
+ data = memregion("hd61830")->u8(addr);
}
int cursor = m_mcr & MODE_CURSOR;
diff --git a/src/emu/video/pc_cga.c b/src/emu/video/pc_cga.c
index 2a5844b8d89..2b3ffea6d32 100644
--- a/src/emu/video/pc_cga.c
+++ b/src/emu/video/pc_cga.c
@@ -292,7 +292,7 @@ static int internal_pc_cga_video_start(running_machine &machine)
memset(&cga, 0, sizeof(cga));
cga.update_row = NULL;
- cga.chr_gen = machine.region( "gfx1" )->base() + 0x1000;
+ cga.chr_gen = machine.root_device().memregion( "gfx1" )->base() + 0x1000;
state_save_register_item(machine, "pccga", NULL, 0, cga.mode_control);
state_save_register_item(machine, "pccga", NULL, 0, cga.color_select);
@@ -386,7 +386,7 @@ static VIDEO_START( pc_cga32k )
SCREEN_UPDATE_RGB32( mc6845_cga )
{
- UINT8 *gfx = screen.machine().region("gfx1")->base();
+ UINT8 *gfx = screen.machine().root_device().memregion("gfx1")->base();
mc6845_device *mc6845 = screen.machine().device<mc6845_device>(CGA_MC6845_NAME);
mc6845->screen_update( screen, bitmap, cliprect);
@@ -407,12 +407,12 @@ SCREEN_UPDATE_RGB32( mc6845_cga )
static VIDEO_START( cga_poisk2 )
{
VIDEO_START_CALL(pc_cga);
- cga.chr_gen = machine.region( "gfx1" )->base() + 0x0000;
+ cga.chr_gen = machine.root_device().memregion( "gfx1" )->base() + 0x0000;
}
static SCREEN_UPDATE_RGB32( cga_poisk2 )
{
- UINT8 *gfx = screen.machine().region("gfx1")->base();
+ UINT8 *gfx = screen.machine().root_device().memregion("gfx1")->base();
mc6845_device *mc6845 = screen.machine().device<mc6845_device>(CGA_MC6845_NAME);
mc6845->screen_update( screen, bitmap, cliprect);
@@ -1103,7 +1103,7 @@ static void pc_cga_plantronics_w(running_machine &machine, int data)
static WRITE8_HANDLER ( char_ram_w )
{
- UINT8 *gfx = space->machine().region("gfx1")->base();
+ UINT8 *gfx = space->machine().root_device().memregion("gfx1")->base();
logerror("write char ram %04x %02x\n",offset,data);
gfx[offset + 0x0000] = data;
gfx[offset + 0x0800] = data;
@@ -1116,7 +1116,7 @@ static WRITE32_HANDLER( char_ram_32_w ) { write32le_with_write8_handler(char_r
static READ8_HANDLER ( char_ram_r )
{
- UINT8 *gfx = space->machine().region("gfx1")->base();
+ UINT8 *gfx = space->machine().root_device().memregion("gfx1")->base();
return gfx[offset];
}
@@ -1629,7 +1629,7 @@ static VIDEO_START( pc1512 )
static SCREEN_UPDATE_RGB32( mc6845_pc1512 )
{
- UINT8 *gfx = screen.machine().region("gfx1")->base();
+ UINT8 *gfx = screen.machine().root_device().memregion("gfx1")->base();
mc6845_device *mc6845 = screen.machine().device<mc6845_device>(CGA_MC6845_NAME);
mc6845->screen_update(screen, bitmap, cliprect);
diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c
index a29f758b3a3..1c9d006b847 100644
--- a/src/emu/video/tms9927.c
+++ b/src/emu/video/tms9927.c
@@ -274,7 +274,7 @@ static DEVICE_START( tms9927 )
/* get the self-load PROM */
if (tms->intf->selfload_region != NULL)
{
- tms->selfload = device->machine().region(tms->intf->selfload_region)->base();
+ tms->selfload = device->machine().root_device().memregion(tms->intf->selfload_region)->base();
assert(tms->selfload != NULL);
}
}
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index a309ca3cbf6..e12016138b3 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -133,7 +133,7 @@ void atarijsa_init(running_machine &machine, const char *testport, int testmask)
test_mask = testmask;
/* predetermine the bank base */
- rgn = machine.region("jsa")->base();
+ rgn = machine.root_device().memregion("jsa")->base();
bank_base = &rgn[0x03000];
bank_source_data = &rgn[0x10000];
@@ -161,8 +161,8 @@ void atarijsa_init(running_machine &machine, const char *testport, int testmask)
/* the upper 128k is fixed, the lower 128k is bankswitched */
for (rgn = 0; rgn < ARRAY_LENGTH(regions); rgn++)
{
- UINT8 *base = machine.region(regions[rgn])->base();
- if (base != NULL && machine.region(regions[rgn])->bytes() >= 0x80000)
+ UINT8 *base = machine.root_device().memregion(regions[rgn])->base();
+ if (base != NULL && machine.root_device().memregion(regions[rgn])->bytes() >= 0x80000)
{
const char *bank = (rgn != 2) ? "bank12" : "bank14";
const char *bank_plus_1 = (rgn != 2) ? "bank13" : "bank15";
diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c
index 6609bd23358..a466e9c1fc2 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -165,8 +165,8 @@ void cage_init(running_machine &machine, offs_t speedup)
state->irqhandler = NULL;
- machine.root_device().membank("bank10")->set_base(machine.region("cageboot")->base());
- machine.root_device().membank("bank11")->set_base(machine.region("cage")->base());
+ machine.root_device().membank("bank10")->set_base(machine.root_device().memregion("cageboot")->base());
+ machine.root_device().membank("bank11")->set_base(machine.root_device().memregion("cage")->base());
state->cpu = machine.device<cpu_device>("cage");
cage_cpu_clock_period = attotime::from_hz(state->cpu->clock());
diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c
index 08f44b19f8a..eaaa9be2f58 100644
--- a/src/mame/audio/cclimber.c
+++ b/src/mame/audio/cclimber.c
@@ -17,16 +17,16 @@ static SAMPLES_START( cclimber_sh_start )
{
running_machine &machine = device.machine();
samplebuf = 0;
- if (machine.region("samples")->base())
- samplebuf = auto_alloc_array(machine, INT16, 2 * machine.region("samples")->bytes());
+ if (machine.root_device().memregion("samples")->base())
+ samplebuf = auto_alloc_array(machine, INT16, 2 * machine.root_device().memregion("samples")->bytes());
}
static void cclimber_play_sample(running_machine &machine, int start,int freq,int volume)
{
int len;
- int romlen = machine.region("samples")->bytes();
- const UINT8 *rom = machine.region("samples")->base();
+ int romlen = machine.root_device().memregion("samples")->bytes();
+ const UINT8 *rom = machine.root_device().memregion("samples")->base();
samples_device *samples = machine.device<samples_device>("samples");
diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c
index 00efe76b564..64b29be3b4c 100644
--- a/src/mame/audio/cinemat.c
+++ b/src/mame/audio/cinemat.c
@@ -1612,7 +1612,7 @@ static MACHINE_RESET( qb3_sound )
/* this patch prevents the sound ROM from eating itself when command $0A is sent */
/* on a cube rotate */
- machine.region("audiocpu")->base()[0x11dc] = 0x09;
+ state->memregion("audiocpu")->base()[0x11dc] = 0x09;
}
diff --git a/src/mame/audio/circus.c b/src/mame/audio/circus.c
index 5751b6cf53d..314ae123dca 100644
--- a/src/mame/audio/circus.c
+++ b/src/mame/audio/circus.c
@@ -174,7 +174,7 @@ WRITE8_MEMBER(circus_state::circus_clown_z_w)
{
m_clown_z = (data & 0x0f);
- *(machine().region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
+ *(machine().root_device().memregion("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
/* Bits 4-6 enable/disable trigger different events */
switch (m_game_id)
diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c
index dd6e7672ebc..c26cd4bc7f5 100644
--- a/src/mame/audio/cyberbal.c
+++ b/src/mame/audio/cyberbal.c
@@ -20,7 +20,7 @@ void cyberbal_sound_reset(running_machine &machine)
cyberbal_state *state = machine.driver_data<cyberbal_state>();
/* reset the sound system */
- state->m_bank_base = &machine.region("audiocpu")->base()[0x10000];
+ state->m_bank_base = &state->memregion("audiocpu")->base()[0x10000];
state->membank("soundbank")->set_base(&state->m_bank_base[0x0000]);
state->m_fast_68k_int = state->m_io_68k_int = 0;
state->m_sound_data_from_68k = state->m_sound_data_from_6502 = 0;
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index 69fc8d271f4..0d2e15a0867 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -955,8 +955,8 @@ void dcs_init(running_machine &machine)
dcs.dmadac[0] = machine.device<dmadac_sound_device>("dac");
/* configure boot and sound ROMs */
- dcs.bootrom = (UINT16 *)machine.region("dcs")->base();
- dcs.bootrom_words = machine.region("dcs")->bytes() / 2;
+ dcs.bootrom = (UINT16 *)machine.root_device().memregion("dcs")->base();
+ dcs.bootrom_words = machine.root_device().memregion("dcs")->bytes() / 2;
dcs.sounddata = dcs.bootrom;
dcs.sounddata_words = dcs.bootrom_words;
dcs.sounddata_banks = dcs.sounddata_words / 0x1000;
@@ -1008,8 +1008,8 @@ void dcs2_init(running_machine &machine, int dram_in_mb, offs_t polling_offset)
dcs.dmadac[1] = machine.device<dmadac_sound_device>("dac2");
/* always boot from the base of "dcs" */
- dcs.bootrom = (UINT16 *)machine.region("dcs")->base();
- dcs.bootrom_words = machine.region("dcs")->bytes() / 2;
+ dcs.bootrom = (UINT16 *)machine.root_device().memregion("dcs")->base();
+ dcs.bootrom_words = machine.root_device().memregion("dcs")->bytes() / 2;
/* supports both RAM and ROM variants */
if (dram_in_mb != 0)
diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c
index f3135881035..969f4a83111 100644
--- a/src/mame/audio/dkong.c
+++ b/src/mame/audio/dkong.c
@@ -1116,7 +1116,7 @@ static SOUND_START( dkong)
{
dkong_state *state = machine.driver_data<dkong_state>();
- state->m_snd_rom = machine.region("soundcpu")->base();
+ state->m_snd_rom = state->memregion("soundcpu")->base();
}
diff --git a/src/mame/audio/exidy440.c b/src/mame/audio/exidy440.c
index 0636a9880ac..61cc35c8861 100644
--- a/src/mame/audio/exidy440.c
+++ b/src/mame/audio/exidy440.c
@@ -175,7 +175,7 @@ static DEVICE_START( exidy440_sound )
state->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock(), NULL, channel_update);
/* allocate the sample cache */
- length = machine.region("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
+ length = machine.root_device().memregion("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
state->sound_cache = (sound_cache_entry *)auto_alloc_array(machine, UINT8, length);
/* determine the hard end of the cache and reset */
@@ -696,7 +696,7 @@ static INT16 *find_or_add_to_sound_cache(device_t *device, int address, int leng
if (current->address == address && current->length == length && current->bits == bits && current->frequency == frequency)
return current->data;
- return add_to_sound_cache(device, &device->machine().region("cvsd")->base()[address], address, length, bits, frequency);
+ return add_to_sound_cache(device, &device->machine().root_device().memregion("cvsd")->base()[address], address, length, bits, frequency);
}
diff --git a/src/mame/audio/flower.c b/src/mame/audio/flower.c
index e6038fc88d0..2598a795b0d 100644
--- a/src/mame/audio/flower.c
+++ b/src/mame/audio/flower.c
@@ -190,8 +190,8 @@ static DEVICE_START( flower_sound )
/* extract globals from the interface */
state->m_last_channel = state->m_channel_list + 8;
- state->m_sample_rom = machine.region("sound1")->base();
- state->m_volume_rom = machine.region("sound2")->base();
+ state->m_sample_rom = machine.root_device().memregion("sound1")->base();
+ state->m_volume_rom = machine.root_device().memregion("sound2")->base();
/* register for savestates */
for (i = 0; i < 8; i++)
diff --git a/src/mame/audio/gomoku.c b/src/mame/audio/gomoku.c
index 2256c9100c8..99dff9de13f 100644
--- a/src/mame/audio/gomoku.c
+++ b/src/mame/audio/gomoku.c
@@ -192,7 +192,7 @@ static DEVICE_START( gomoku_sound )
state->m_num_voices = MAX_VOICES;
state->m_last_channel = state->m_channel_list + state->m_num_voices;
- state->m_sound_rom = machine.region("gomoku")->base();
+ state->m_sound_rom = machine.root_device().memregion("gomoku")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->m_sound_enable = 1;
diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c
index 40649b6969b..4ec64efdf66 100644
--- a/src/mame/audio/harddriv.c
+++ b/src/mame/audio/harddriv.c
@@ -24,8 +24,8 @@
void hdsnd_init(running_machine &machine)
{
harddriv_state *state = machine.driver_data<harddriv_state>();
- state->m_rombase = (UINT8 *)machine.region("serialroms")->base();
- state->m_romsize = machine.region("serialroms")->bytes();
+ state->m_rombase = (UINT8 *)state->memregion("serialroms")->base();
+ state->m_romsize = state->memregion("serialroms")->bytes();
}
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index d5f222df36f..779a713c154 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -551,7 +551,7 @@ static DEVICE_START( common_sh_start )
/* if we have a 2151, install an externally driven DAC stream */
if (state->m_has_ym2151)
{
- state->m_ext_base = machine.region("dac")->base();
+ state->m_ext_base = machine.root_device().memregion("dac")->base();
state->m_extern_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update);
}
diff --git a/src/mame/audio/m72.c b/src/mame/audio/m72.c
index 2847d5d9dae..4b3377446a9 100644
--- a/src/mame/audio/m72.c
+++ b/src/mame/audio/m72.c
@@ -124,8 +124,8 @@ static DEVICE_START( m72_audio )
{
m72_audio_state *state = get_safe_token(device);
- state->samples = device->machine().region("samples")->base();
- state->samples_size = device->machine().region("samples")->bytes();
+ state->samples = device->machine().root_device().memregion("samples")->base();
+ state->samples_size = device->machine().root_device().memregion("samples")->bytes();
state->space = device->machine().device("soundcpu")->memory().space(AS_IO);
state->dac = device->machine().device("dac");
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index ff0d1df3416..ec47aa95440 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -416,7 +416,7 @@ static SOUND_START( mario )
mario_state *state = machine.driver_data<mario_state>();
device_t *audiocpu = machine.device("audiocpu");
#if USE_8039
- UINT8 *SND = machine.region("audiocpu")->base();
+ UINT8 *SND = machine.root_device().memregion("audiocpu")->base();
SND[0x1001] = 0x01;
#endif
@@ -426,8 +426,8 @@ static SOUND_START( mario )
{
state->m_eabank = "bank1";
audiocpu->memory().space(AS_PROGRAM)->install_read_bank(0x000, 0x7ff, "bank1");
- state->membank("bank1")->configure_entry(0, machine.region("audiocpu")->base());
- state->membank("bank1")->configure_entry(1, machine.region("audiocpu")->base() + 0x1000);
+ state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base());
+ state->membank("bank1")->configure_entry(1, state->memregion("audiocpu")->base() + 0x1000);
}
state->save_item(NAME(state->m_last));
@@ -482,8 +482,8 @@ READ8_MEMBER(mario_state::mario_sh_t1_r)
READ8_MEMBER(mario_state::mario_sh_tune_r)
{
- UINT8 *SND = machine().region("audiocpu")->base();
- UINT16 mask = machine().region("audiocpu")->bytes()-1;
+ UINT8 *SND = memregion("audiocpu")->base();
+ UINT16 mask = memregion("audiocpu")->bytes()-1;
UINT8 p2 = I8035_P2_R(*&space);
if ((p2 >> 7) & 1)
diff --git a/src/mame/audio/midway.c b/src/mame/audio/midway.c
index 84887eb5fee..6a7f9b1ba97 100644
--- a/src/mame/audio/midway.c
+++ b/src/mame/audio/midway.c
@@ -231,7 +231,7 @@ void midway_ssio_device::compute_ay8910_modulation()
//
// loop over all possible values of the duty cycle
- UINT8 *prom = machine().region("proms")->base();
+ UINT8 *prom = memregion("proms")->base();
for (int volval = 0; volval < 16; volval++)
{
// loop over all the clocks until we run out; look up in the PROM
@@ -449,6 +449,27 @@ MACHINE_CONFIG_END
//-------------------------------------------------
+// ROM definitions
+//-------------------------------------------------
+
+ROM_START( midway_ssio )
+ ROM_REGION( 0x0020, "proms", 0 )
+ ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
+ROM_END
+
+
+//-------------------------------------------------
+// device_mconfig_additions - return a pointer to
+// the device's machine fragment
+//-------------------------------------------------
+
+const rom_entry *midway_ssio_device::device_rom_region() const
+{
+ return ROM_NAME(midway_ssio);
+}
+
+
+//-------------------------------------------------
// device_mconfig_additions - return a pointer to
// the device's machine fragment
//-------------------------------------------------
diff --git a/src/mame/audio/midway.h b/src/mame/audio/midway.h
index 328fdd3e940..13751868a8f 100644
--- a/src/mame/audio/midway.h
+++ b/src/mame/audio/midway.h
@@ -121,6 +121,7 @@ public:
protected:
// device-level overrides
+ virtual const rom_entry *device_rom_region() const;
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
virtual void device_start();
diff --git a/src/mame/audio/polepos.c b/src/mame/audio/polepos.c
index 67238761223..cc098f60f52 100644
--- a/src/mame/audio/polepos.c
+++ b/src/mame/audio/polepos.c
@@ -80,7 +80,7 @@ static STREAM_UPDATE( engine_sound_update )
/* determine the volume */
slot = (state->m_sample_msb >> 3) & 7;
volume = volume_table[slot];
- base = &device->machine().region("engine")->base()[slot * 0x800];
+ base = &device->machine().root_device().memregion("engine")->base()[slot * 0x800];
/* fill in the sample */
while (samples--)
diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c
index d44a373a1d3..a7a648f2cc3 100644
--- a/src/mame/audio/segag80r.c
+++ b/src/mame/audio/segag80r.c
@@ -488,7 +488,7 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
INLINE void sega005_update_sound_data(running_machine &machine)
{
segag80r_state *state = machine.driver_data<segag80r_state>();
- UINT8 newval = machine.region("005")->base()[state->m_sound_addr];
+ UINT8 newval = state->memregion("005")->base()[state->m_sound_addr];
UINT8 diff = newval ^ state->m_sound_data;
//mame_printf_debug(" [%03X] = %02X\n", state->m_sound_addr, newval);
@@ -589,7 +589,7 @@ DEVICE_GET_INFO( sega005_sound )
static STREAM_UPDATE( sega005_stream_update )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
- const UINT8 *sound_prom = device->machine().region("proms")->base();
+ const UINT8 *sound_prom = state->memregion("proms")->base();
int i;
/* no implementation yet */
@@ -881,7 +881,7 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
tms36xx_note_w(tms, 0, data & 15);
/* Top four data lines address an 82S123 ROM that enables/disables voices */
- enable_val = device->machine().region("prom")->base()[(data & 0xF0) >> 4];
+ enable_val = device->machine().root_device().memregion("prom")->base()[(data & 0xF0) >> 4];
tms3617_enable_w(tms, enable_val >> 2);
}
@@ -963,7 +963,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
case 3:
state->m_sound_addr &= 0xfff;
{
- int numroms = device->machine().region("n7751")->bytes() / 0x1000;
+ int numroms = state->memregion("n7751")->bytes() / 0x1000;
if (!(data & 0x01) && numroms >= 1) state->m_sound_addr |= 0x0000;
if (!(data & 0x02) && numroms >= 2) state->m_sound_addr |= 0x1000;
if (!(data & 0x04) && numroms >= 3) state->m_sound_addr |= 0x2000;
@@ -977,7 +977,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
READ8_MEMBER(segag80r_state::n7751_rom_r)
{
/* read from BUS */
- return machine().region("n7751")->base()[m_sound_addr];
+ return memregion("n7751")->base()[m_sound_addr];
}
diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c
index def30f88400..710363a1d15 100644
--- a/src/mame/audio/segasnd.c
+++ b/src/mame/audio/segasnd.c
@@ -155,7 +155,7 @@ static DEVICE_START( speech_sound )
{
speech_state *state = get_safe_speech(device);
- state->speech = device->machine().region("speech")->base();
+ state->speech = device->machine().root_device().memregion("speech")->base();
}
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index e81263e9c2d..bd8a7abdf33 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -106,7 +106,7 @@ void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length)
{
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();
int i;
space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
@@ -190,7 +190,7 @@ static DEVICE_START( seibu_adpcm )
state->m_playing = 0;
state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, seibu_adpcm_callback);
- state->m_base = machine.region(intf->rom_region)->base();
+ state->m_base = machine.root_device().memregion(intf->rom_region)->base();
state->m_adpcm.reset();
}
@@ -217,8 +217,8 @@ DEVICE_GET_INFO( seibu_adpcm )
void seibu_adpcm_decrypt(running_machine &machine, const char *region)
{
- UINT8 *ROM = machine.region(region)->base();
- int len = machine.region(region)->bytes();
+ UINT8 *ROM = machine.root_device().memregion(region)->base();
+ int len = machine.root_device().memregion(region)->bytes();
int i;
for (i = 0; i < len; i++)
@@ -346,8 +346,8 @@ void seibu_ym2203_irqhandler(device_t *device, int linestate)
MACHINE_RESET( seibu_sound )
{
- int romlength = machine.region("audiocpu")->bytes();
- UINT8 *rom = machine.region("audiocpu")->base();
+ int romlength = machine.root_device().memregion("audiocpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
sound_cpu = machine.device("audiocpu");
update_irq_lines(machine, VECTOR_INIT);
diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c
index 1cb4c4ad871..bfc307bb5d0 100644
--- a/src/mame/audio/snes_snd.c
+++ b/src/mame/audio/snes_snd.c
@@ -1171,7 +1171,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
if ((data & 0x80) != (spc700->ram[0xf1] & 0x80))
{
if (data & 0x80)
- memcpy(spc700->ipl_region, device->machine().region("user5")->base(), 64);
+ memcpy(spc700->ipl_region, device->machine().root_device().memregion("user5")->base(), 64);
else
memcpy(spc700->ipl_region, &spc700->ram[0xffc0], 64);
}
@@ -1319,7 +1319,7 @@ static DEVICE_START( snes_sound )
spc700->ram[0xf1] = 0x80;
/* put IPL image at the top of RAM */
- memcpy(spc700->ipl_region, machine.region("user5")->base(), 64);
+ memcpy(spc700->ipl_region, machine.root_device().memregion("user5")->base(), 64);
/* Initialize the timers */
spc700->timer[0] = machine.scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c
index 365477c80c8..beede4e6b17 100644
--- a/src/mame/audio/snk6502.c
+++ b/src/mame/audio/snk6502.c
@@ -654,7 +654,7 @@ static DEVICE_START( snk6502_sound )
snk6502_sound_state *state = get_safe_token(device);
state->m_samples = device->machine().device<samples_device>("samples");
- state->m_ROM = device->machine().region("snk6502")->base();
+ state->m_ROM = device->machine().root_device().memregion("snk6502")->base();
// adjusted
snk6502_set_music_freq(device->machine(), 43000);
diff --git a/src/mame/audio/suna8.c b/src/mame/audio/suna8.c
index 2aaafb99240..337e6a1348d 100644
--- a/src/mame/audio/suna8.c
+++ b/src/mame/audio/suna8.c
@@ -52,8 +52,8 @@ SAMPLES_START( suna8_sh_start )
{
suna8_state *state = device.machine().driver_data<suna8_state>();
running_machine &machine = device.machine();
- 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);
diff --git a/src/mame/audio/taito_en.c b/src/mame/audio/taito_en.c
index f066c62ab87..737e2818467 100644
--- a/src/mame/audio/taito_en.c
+++ b/src/mame/audio/taito_en.c
@@ -49,7 +49,7 @@ static WRITE16_HANDLER(f3_68000_share_w)
static WRITE16_HANDLER( f3_es5505_bank_w )
{
- UINT32 max_banks_this_game=(space->machine().region("ensoniq.0")->bytes()/0x200000)-1;
+ UINT32 max_banks_this_game=(space->machine().root_device().memregion("ensoniq.0")->bytes()/0x200000)-1;
#if 0
{
@@ -222,7 +222,7 @@ static READ16_HANDLER(es5510_dsp_r)
static WRITE16_HANDLER(es5510_dsp_w)
{
- UINT8 *snd_mem = (UINT8 *)space->machine().region("ensoniq.0")->base();
+ UINT8 *snd_mem = (UINT8 *)space->machine().root_device().memregion("ensoniq.0")->base();
// if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0)
// logerror("%06x: DSP write offset %04x %04x\n",cpu_get_pc(&space->device()),offset,data);
@@ -304,7 +304,7 @@ ADDRESS_MAP_END
SOUND_RESET( taito_f3_soundsystem_reset )
{
/* Sound cpu program loads to 0xc00000 so we use a bank */
- UINT16 *ROM = (UINT16 *)machine.region("audiocpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("audiocpu")->base();
UINT16 *sound_ram = (UINT16 *)machine.memory().shared("share1")->ptr();
machine.root_device().membank("bank1")->set_base(&ROM[0x80000]);
machine.root_device().membank("bank2")->set_base(&ROM[0x90000]);
diff --git a/src/mame/audio/targ.c b/src/mame/audio/targ.c
index bc9872b8960..660547bc51c 100644
--- a/src/mame/audio/targ.c
+++ b/src/mame/audio/targ.c
@@ -115,7 +115,7 @@ WRITE8_HANDLER( targ_audio_2_w )
if ((data & 0x01) && !(port_2_last & 0x01))
{
samples_device *samples = space->machine().device<samples_device>("samples");
- UINT8 *prom = space->machine().region("targ")->base();
+ UINT8 *prom = space->machine().root_device().memregion("targ")->base();
tone_pointer = (tone_pointer + 1) & 0x0f;
diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c
index e82ac5336ba..4e08e6a8e31 100644
--- a/src/mame/audio/williams.c
+++ b/src/mame/audio/williams.c
@@ -302,7 +302,7 @@ machine_config_constructor williams_cvsd_sound_device::device_mconfig_additions(
void williams_cvsd_sound_device::device_start()
{
// configure master CPU banks
- UINT8 *rom = subregion("cpu")->base();
+ UINT8 *rom = memregion("cpu")->base();
for (int bank = 0; bank < 16; bank++)
{
//
@@ -650,7 +650,7 @@ machine_config_constructor williams_narc_sound_device::device_mconfig_additions(
void williams_narc_sound_device::device_start()
{
// configure master CPU banks
- UINT8 *rom = subregion("cpu0")->base();
+ UINT8 *rom = memregion("cpu0")->base();
for (int bank = 0; bank < 16; bank++)
{
//
@@ -664,7 +664,7 @@ void williams_narc_sound_device::device_start()
membank("masterupper")->set_base(&rom[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
// configure slave CPU banks
- rom = subregion("cpu1")->base();
+ rom = memregion("cpu1")->base();
for (int bank = 0; bank < 16; bank++)
{
//
@@ -929,12 +929,12 @@ machine_config_constructor williams_adpcm_sound_device::device_mconfig_additions
void williams_adpcm_sound_device::device_start()
{
// configure banks
- UINT8 *rom = subregion("cpu")->base();
+ UINT8 *rom = memregion("cpu")->base();
membank("rombank")->configure_entries(0, 8, &rom[0x10000], 0x8000);
membank("romupper")->set_base(&rom[0x10000 + 0x4000 + 7 * 0x8000]);
// expand ADPCM data
- rom = subregion("oki")->base();
+ rom = memregion("oki")->base();
// it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000
membank("okibank")->configure_entry(0, &rom[0x40000]);
membank("okibank")->configure_entry(1, &rom[0x40000]);
diff --git a/src/mame/audio/wiping.c b/src/mame/audio/wiping.c
index eb148a95440..ee4a664f5e4 100644
--- a/src/mame/audio/wiping.c
+++ b/src/mame/audio/wiping.c
@@ -193,8 +193,8 @@ static DEVICE_START( wiping_sound )
state->m_num_voices = 8;
state->m_last_channel = state->m_channel_list + state->m_num_voices;
- state->m_sound_rom = machine.region("samples")->base();
- state->m_sound_prom = machine.region("soundproms")->base();
+ state->m_sound_rom = machine.root_device().memregion("samples")->base();
+ state->m_sound_prom = machine.root_device().memregion("soundproms")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->m_sound_enable = 1;
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, machin