summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
commit18f33f4eff805592f984a31f55513bce4a219ee5 (patch)
tree9e8dfdf1452e3d97a95936db2e9c740efa258306
parent776d29c90f2a6c3c234597eb950410b95c5addec (diff)
Changed device->subregion to device->memregion. Moved
memory_region management into the memory manager instead of directly in the machine. Hid the global region method; now all regions must be looked up relative to a device. If you're a member function, you can just use memregion("tag") directly. If you're a global function or a device referencing global regions, use machine().root_device().memregion("tag") to look up regions relative to the root. S&R to convert all references: machine([()]*)\.region machine\1\.root_device\(\).subregion Then remove redundant machine().root_device() within src/mame: ([ \t])machine\(\)\.root_device\(\)\. \1 And use state->memregion() if we have a state variable present: (state *= *[^;]+driver_data[^}]+)([^ \t]*)machine[()]*\.root_device\(\)\. \1state-> Finally some cleanup: screen.state-> state-> device->state-> state-> space->state-> state-> And a few hand-tweaks.
-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, machine.region("user2")->base(), 0x4000);
+ state->membank("bank2")->configure_entries(0, 2, state->memregion("user2")->base(), 0x4000);
state->membank("bank2")->set_entry(0);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x81, 0x81, write8_delegate(FUNC(galivan_state::youmab_81_w),state)); // ?? often, alternating values
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 63f4f274682..aced2842a55 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -275,7 +275,7 @@ WRITE8_MEMBER(galpani2_state::galpani2_coin_lockout_w)
static WRITE8_DEVICE_HANDLER( galpani2_oki1_bank_w )
{
- UINT8 *ROM = device->machine().region("oki1")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("oki1")->base();
logerror("%s : %s bank %08X\n",device->machine().describe_context(),device->tag(),data);
memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000);
}
@@ -349,8 +349,8 @@ ADDRESS_MAP_END
READ16_MEMBER(galpani2_state::galpani2_bankedrom_r)
{
- UINT16 *ROM = (UINT16 *) machine().region( "user1" )->base();
- size_t len = machine().region( "user1" )->bytes() / 2;
+ UINT16 *ROM = (UINT16 *) memregion( "user1" )->base();
+ size_t len = memregion( "user1" )->bytes() / 2;
offset += (0x800000/2) * (*m_rombank & 0x0003);
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 2c0b13d97db..0da0d925935 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -400,7 +400,7 @@ static SCREEN_UPDATE_RGB32(galpani3)
state->m_sprite_bitmap_1.fill(0x0000, cliprect);
- state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, &state->m_spriteram32[0], 0x4000, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_spc_regs );
+ state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, &state->m_spriteram32[0], 0x4000, screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), state->m_spc_regs );
// ignoring priority bits for now..
for (y=0;y<240;y++)
@@ -748,7 +748,7 @@ WRITE16_MEMBER(galpani3_state::galpani3_regs1_go_w)
{
UINT32 address = m_regs1_address_regs[1]| (m_regs1_address_regs[0]<<16);
- UINT8* rledata = machine().region("gfx2")->base();
+ UINT8* rledata = memregion("gfx2")->base();
printf("galpani3_regs1_go_w? %08x\n",address );
if ((data==0x2000) || (data==0x3000)) gp3_do_rle(address, m_framebuffer1, rledata);
@@ -766,7 +766,7 @@ WRITE16_MEMBER(galpani3_state::galpani3_regs2_go_w)
{
UINT32 address = m_regs2_address_regs[1]| (m_regs2_address_regs[0]<<16);
- UINT8* rledata = machine().region("gfx2")->base();
+ UINT8* rledata = memregion("gfx2")->base();
printf("galpani3_regs2_go_w? %08x\n", address );
@@ -788,7 +788,7 @@ WRITE16_MEMBER(galpani3_state::galpani3_regs3_go_w)
{
UINT32 address = m_regs3_address_regs[1]| (m_regs3_address_regs[0]<<16);
- UINT8* rledata = machine().region("gfx2")->base();
+ UINT8* rledata = memregion("gfx2")->base();
printf("galpani3_regs3_go_w? %08x\n",address );
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index 1691bf24b9c..e8b27396f6f 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -170,7 +170,7 @@ WRITE16_MEMBER(galpanic_state::galpanic_6295_bankswitch_w)
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = machine().region("oki")->base();
+ UINT8 *rom = memregion("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
@@ -183,7 +183,7 @@ WRITE16_MEMBER(galpanic_state::galpanica_6295_bankswitch_w)
{
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = machine().region("oki")->base();
+ UINT8 *rom = memregion("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
}
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index bf58f828125..90c8ff930ff 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -220,7 +220,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
else // disable RAM access (reads go to BIOS ROM)
{
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base() + 0x30000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base() + 0x30000);
}
break;
}
@@ -614,7 +614,7 @@ static MACHINE_START(gamecstl)
static MACHINE_RESET(gamecstl)
{
- machine.root_device().membank("bank1")->set_base(machine.region("bios")->base() + 0x30000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x30000);
device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c
index 245ee5f8b5e..60e16ba3d3d 100644
--- a/src/mame/drivers/gaplus.c
+++ b/src/mame/drivers/gaplus.c
@@ -872,11 +872,11 @@ static DRIVER_INIT( gaplus )
UINT8 *rom;
int i;
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] >> 4;
- rom = machine.region("gfx2")->base() + 0x6000;
+ rom = machine.root_device().memregion("gfx2")->base() + 0x6000;
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] << 4;
}
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index 2cd7192a1fc..69aeb15b302 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -1621,7 +1621,7 @@ ROM_END
static void gauntlet_common_init(running_machine &machine, int slapstic, int vindctr2)
{
gauntlet_state *state = machine.driver_data<gauntlet_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->m_eeprom_default = NULL;
atarigen_slapstic_init(machine.device("maincpu"), 0x038000, 0, slapstic);
@@ -1657,7 +1657,7 @@ static DRIVER_INIT( gauntlet2 )
static DRIVER_INIT( vindctr2 )
{
- UINT8 *gfx2_base = machine.region("gfx2")->base();
+ UINT8 *gfx2_base = machine.root_device().memregion("gfx2")->base();
UINT8 *data = auto_alloc_array(machine, UINT8, 0x8000);
int i;
diff --git a/src/mame/drivers/gberet.c b/src/mame/drivers/gberet.c
index ad1bcbe3c99..cf8898b1fee 100644
--- a/src/mame/drivers/gberet.c
+++ b/src/mame/drivers/gberet.c
@@ -573,7 +573,7 @@ ROM_END
static DRIVER_INIT( mrgoemon )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index c28fe3a8554..1a9ce532ade 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -268,7 +268,7 @@ static const k051960_interface gbusters_k051960_intf =
static MACHINE_START( gbusters )
{
gbusters_state *state = machine.driver_data<gbusters_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
@@ -288,7 +288,7 @@ static MACHINE_START( gbusters )
static MACHINE_RESET( gbusters )
{
gbusters_state *state = machine.driver_data<gbusters_state>();
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
konami_configure_set_lines(machine.device("maincpu"), gbusters_banking);
diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c
index ff42457e5bd..209d1e4de10 100644
--- a/src/mame/drivers/gcpinbal.c
+++ b/src/mame/drivers/gcpinbal.c
@@ -214,7 +214,7 @@ static void gcp_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("msm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("msm")->base();
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_start] & 0x0f) : (ROM[state->m_adpcm_start] & 0xf0) >> 4));
msm5205_data_w(device, state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index aca599fba44..01e06d0c930 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -269,68 +269,68 @@ static READ8_DEVICE_HANDLER( portC_r )
WRITE8_MEMBER(gei_state::banksel_main_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x8000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x8000);
}
WRITE8_MEMBER(gei_state::banksel_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
}
WRITE8_MEMBER(gei_state::banksel_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x18000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000);
}
WRITE8_MEMBER(gei_state::banksel_3_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x20000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x20000);
}
WRITE8_MEMBER(gei_state::banksel_4_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x28000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x28000);
}
WRITE8_MEMBER(gei_state::banksel_5_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x30000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x30000);
}
WRITE8_MEMBER(gei_state::banksel_1_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
}
WRITE8_MEMBER(gei_state::banksel_2_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x14000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x14000);
}
WRITE8_MEMBER(gei_state::banksel_3_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x18000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000);
}
WRITE8_MEMBER(gei_state::banksel_4_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1c000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1c000);
}
WRITE8_MEMBER(gei_state::banksel_5_1_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x20000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x20000);
}
WRITE8_MEMBER(gei_state::banksel_1_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x12000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x12000);
}
WRITE8_MEMBER(gei_state::banksel_2_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x16000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x16000);
}
WRITE8_MEMBER(gei_state::banksel_3_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1a000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1a000);
}
WRITE8_MEMBER(gei_state::banksel_4_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1e000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1e000);
}
WRITE8_MEMBER(gei_state::banksel_5_2_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x22000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x22000);
}
WRITE8_MEMBER(gei_state::geimulti_bank_w)
@@ -358,36 +358,36 @@ WRITE8_MEMBER(gei_state::geimulti_bank_w)
}
if (bank != -1)
- membank("bank1")->set_base(machine().region("bank")->base() + bank*0x8000);
+ membank("bank1")->set_base(machine().root_device().memregion("bank")->base() + bank*0x8000);
}
READ8_MEMBER(gei_state::banksel_1_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
return 0x03;
};
READ8_MEMBER(gei_state::banksel_2_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x18000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000);
return 0x03;
}
READ8_MEMBER(gei_state::banksel_3_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x20000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x20000);
return 0x03;
}
READ8_MEMBER(gei_state::banksel_4_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x28000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x28000);
return 0x03;
}
READ8_MEMBER(gei_state::banksel_5_r)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x30000);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x30000);
return 0x03;
}
@@ -1873,12 +1873,12 @@ ROM_END
static DRIVER_INIT( setbank )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base() + 0x2000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x2000);
}
static DRIVER_INIT( geimulti )
{
- machine.root_device().membank("bank1")->set_base(machine.region("bank")->base() + 0x0000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bank")->base() + 0x0000);
}
GAME( 1982, jokpoker, 0, gselect, gselect, setbank, ROT0, "Greyhound Electronics", "Joker Poker (Version 16.03B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index 7fe00b6b67b..b4ddd72e669 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -269,7 +269,7 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
break;
case NAND_M_READ :
{
- UINT8 *flash = (UINT8 *)device->machine().region( "user1")->base();
+ UINT8 *flash = (UINT8 *)device->machine().root_device().memregion( "user1")->base();
if (nand.byte_addr < 0x200)
{
data = *(flash + nand.page_addr * 0x200 + nand.byte_addr);
diff --git a/src/mame/drivers/ginganin.c b/src/mame/drivers/ginganin.c
index 335dfd7ce13..4e953bb6a2d 100644
--- a/src/mame/drivers/ginganin.c
+++ b/src/mame/drivers/ginganin.c
@@ -380,7 +380,7 @@ static DRIVER_INIT( ginganin )
UINT16 *rom;
/* main cpu patches */
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/* avoid writes to rom getting to the log */
rom[0x408 / 2] = 0x6000;
rom[0x40a / 2] = 0x001c;
@@ -388,7 +388,7 @@ static DRIVER_INIT( ginganin )
/* sound cpu patches */
/* let's clear the RAM: ROM starts at 0x4000 */
- memset(machine.region("audiocpu")->base(), 0, 0x800);
+ memset(machine.root_device().memregion("audiocpu")->base(), 0, 0x800);
}
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index c446f2a5051..5b7620d6652 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -194,7 +194,7 @@ TODO:
/*Rom bankswitching*/
WRITE8_MEMBER(gladiatr_state::gladiatr_bankswitch_w)
{
- UINT8 *rom = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *rom = memregion("maincpu")->base() + 0x10000;
membank("bank1")->set_base(rom + 0x6000 * (data & 0x01));
}
@@ -256,7 +256,7 @@ static MACHINE_RESET( gladiator )
TAITO8741_start(&gladiator_8741interface);
/* 6809 bank memory set */
{
- UINT8 *rom = machine.region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base() + 0x10000;
machine.root_device().membank("bank2")->set_base(rom);
machine.device("audiocpu")->reset();
}
@@ -279,7 +279,7 @@ static void gladiator_ym_irq(device_t *device, int irq)
/*Sound Functions*/
static WRITE8_DEVICE_HANDLER( glad_adpcm_w )
{
- UINT8 *rom = device->machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = device->machine().root_device().memregion("audiocpu")->base() + 0x10000;
/* bit6 = bank offset */
device->machine().root_device().membank("bank2")->set_base(rom + ((data & 0x40) ? 0xc000 : 0));
@@ -956,7 +956,7 @@ static DRIVER_INIT( gladiatr )
UINT8 *rom;
int i,j;
- rom = machine.region("gfx2")->base();
+ rom = machine.root_device().memregion("gfx2")->base();
// unpack 3bpp graphics
for (j = 3; j >= 0; j--)
{
@@ -970,7 +970,7 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x14000, rom + 0x18000, 0x4000);
- rom = machine.region("gfx3")->base();
+ rom = machine.root_device().memregion("gfx3")->base();
// unpack 3bpp graphics
for (j = 5; j >= 0; j--)
{
@@ -987,7 +987,7 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x24000, rom + 0x28000, 0x4000);
/* make sure bank is valid in cpu-reset */
- rom = machine.region("audiocpu")->base() + 0x10000;
+ rom = machine.root_device().memregion("audiocpu")->base() + 0x10000;
machine.root_device().membank("bank2")->set_base(rom);
}
@@ -1005,14 +1005,14 @@ static DRIVER_INIT(ppking)
UINT8 *rom;
int i,j;
- rom = machine.region("gfx2")->base();
+ rom = machine.root_device().memregion("gfx2")->base();
// unpack 3bpp graphics
for (i = 0; i < 0x2000; i++)
{
rom[i+0x2000] = rom[i] >> 4;
}
- rom = machine.region("gfx3")->base();
+ rom = machine.root_device().memregion("gfx3")->base();
// unpack 3bpp graphics
for (j = 1; j >= 0; j--)
{
diff --git a/src/mame/drivers/glass.c b/src/mame/drivers/glass.c
index 38ff14c9cc5..62525ecf4b3 100644
--- a/src/mame/drivers/glass.c
+++ b/src/mame/drivers/glass.c
@@ -54,7 +54,7 @@ GFXDECODE_END
WRITE16_MEMBER(glass_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7)
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f) * 0x10000], 0x10000);
@@ -297,10 +297,10 @@ static void glass_ROM16_split_gfx( running_machine &machine, const char *src_reg
int i;
/* get a pointer to the source data */
- UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
+ UINT8 *src = (UINT8 *)machine.root_device().memregion(src_reg)->base();
/* get a pointer to the destination data */
- UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
+ UINT8 *dst = (UINT8 *)machine.root_device().memregion(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length / 2; i++)
diff --git a/src/mame/drivers/gng.c b/src/mame/drivers/gng.c
index 24784fbfbb5..d25cceca5b2 100644
--- a/src/mame/drivers/gng.c
+++ b/src/mame/drivers/gng.c
@@ -304,7 +304,7 @@ static MACHINE_START( gng )
{
gng_state *state = machine.driver_data<gng_state>();
- UINT8 *rombase = machine.region("maincpu")->base();
+ UINT8 *rombase = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x2000);
state->membank("bank1")->configure_entry(4, &rombase[0x4000]);
diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c
index 07ec632f3d2..0305269590f 100644
--- a/src/mame/drivers/go2000.c
+++ b/src/mame/drivers/go2000.c
@@ -310,7 +310,7 @@ static SCREEN_UPDATE_IND16(go2000)
static MACHINE_START( go2000 )
{
go2000_state *state = machine.driver_data<go2000_state>();
- UINT8 *SOUND = machine.region("soundcpu")->base();
+ UINT8 *SOUND = state->memregion("soundcpu")->base();
int i;
for (i = 0; i < 8; i++)
diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c
index 89589aafbbc..5ca3ccb6c2c 100644
--- a/src/mame/drivers/goal92.c
+++ b/src/mame/drivers/goal92.c
@@ -291,7 +291,7 @@ GFXDECODE_END
static MACHINE_START( goal92 )
{
goal92_state *state = machine.driver_data<goal92_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/goindol.c b/src/mame/drivers/goindol.c
index 7bf30dc8c1c..bb2559f7d5c 100644
--- a/src/mame/drivers/goindol.c
+++ b/src/mame/drivers/goindol.c
@@ -220,7 +220,7 @@ GFXDECODE_END
static MACHINE_START( goindol )
{
goindol_state *state = machine.driver_data<goindol_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
@@ -383,7 +383,7 @@ ROM_END
static DRIVER_INIT( goindol )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* I hope that's all patches to avoid protection */
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index 8ba7ab944c0..369099ae0c2 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -1049,7 +1049,7 @@ static SCREEN_UPDATE_IND16( goldnpkr )
static PALETTE_INIT( goldnpkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* prom bits
7654 3210
---- ---x red component.
@@ -1093,7 +1093,7 @@ static PALETTE_INIT( goldnpkr )
static PALETTE_INIT( witchcrd )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/*
This hardware has a feature called BLUE KILLER.
Using the original intensity line, the PCB has a bridge
@@ -1141,7 +1141,7 @@ static PALETTE_INIT( witchcrd )
static PALETTE_INIT( wcrdxtnd )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/*
Using the original intensity line, the PCB has a bridge
that allow (as default) turn the background dark blue.
@@ -9368,7 +9368,7 @@ static DRIVER_INIT( royale )
{
/* $60bb, NOPing the ORA #$F0 (after read the PIA1 port B */
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x60bb] = 0xea;
// ROM[0x60bc] = 0xea;
@@ -9398,8 +9398,8 @@ static DRIVER_INIT( flcnw )
/* Attempt to decrypt the MCU program (we're sooo close!) */
- UINT8 *ROM = machine.region("mcu")->base();
- int size = machine.region("mcu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("mcu")->base();
+ int size = machine.root_device().memregion("mcu")->bytes();
int start = 0x0000;
int i;
@@ -9417,7 +9417,7 @@ static DRIVER_INIT( vkdlsa )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe097] = 0xea;
ROM[0xe098] = 0xea;
@@ -9429,7 +9429,7 @@ static DRIVER_INIT( vkdlsb )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe87b] = 0xea;
ROM[0xe87c] = 0xea;
@@ -9441,7 +9441,7 @@ static DRIVER_INIT( vkdlsc )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x453a] = 0xea;
ROM[0x453b] = 0xea;
@@ -9453,7 +9453,7 @@ static DRIVER_INIT( vkdlsww )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xf2c9] = 0xea;
ROM[0xf2ca] = 0xea;
@@ -9465,7 +9465,7 @@ static DRIVER_INIT( vkdlswwa )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xdf80] = 0xea;
ROM[0xdf81] = 0xea;
@@ -9477,7 +9477,7 @@ static DRIVER_INIT( vkdlswwc )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe42f] = 0xea;
ROM[0xe430] = 0xea;
@@ -9489,7 +9489,7 @@ static DRIVER_INIT( vkdlswwd )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe442] = 0xea;
ROM[0xe443] = 0xea;
@@ -9501,7 +9501,7 @@ static DRIVER_INIT( vkdlswwh )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe4d5] = 0xea;
ROM[0xe4d6] = 0xea;
@@ -9513,7 +9513,7 @@ static DRIVER_INIT( vkdlswwl )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe87c] = 0xea;
ROM[0xe87d] = 0xea;
@@ -9525,7 +9525,7 @@ static DRIVER_INIT( vkdlswwo )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe7d5] = 0xea;
ROM[0xe7d6] = 0xea;
@@ -9537,7 +9537,7 @@ static DRIVER_INIT( vkdlswwp )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe7d9] = 0xea;
ROM[0xe7da] = 0xea;
@@ -9549,7 +9549,7 @@ static DRIVER_INIT( vkdlswwr )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe7f7] = 0xea;
ROM[0xe7f8] = 0xea;
@@ -9561,7 +9561,7 @@ static DRIVER_INIT( vkdlswws )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe8a5] = 0xea;
ROM[0xe8a6] = 0xea;
@@ -9573,7 +9573,7 @@ static DRIVER_INIT( vkdlswwt )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xe955] = 0xea;
ROM[0xe956] = 0xea;
@@ -9585,7 +9585,7 @@ static DRIVER_INIT( vkdlswwu )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xee6b] = 0xea;
ROM[0xee6c] = 0xea;
@@ -9597,7 +9597,7 @@ static DRIVER_INIT( vkdlswwv )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xf052] = 0xea;
ROM[0xf053] = 0xea;
@@ -9729,7 +9729,7 @@ static DRIVER_INIT( wstrike )
after compare with a string inside the Dallas TK RAM
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0xf2e1] = 0xea;
ROM[0xf2e2] = 0xea;
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index 1590dd43801..fe824d833d6 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -5946,7 +5946,7 @@ static PALETTE_INIT(cm)
for (i = 0; i < 0x100; i++)
{
UINT8 data;
- UINT8*proms = machine.region("proms")->base();
+ UINT8*proms = machine.root_device().memregion("proms")->base();
data = proms[0x000 + i] | (proms[0x100 + i] << 4);
@@ -5961,7 +5961,7 @@ static PALETTE_INIT(cmast91)
{
int r,g,b;
- UINT8*proms = machine.region("proms")->base();
+ UINT8*proms = machine.root_device().memregion("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -5979,7 +5979,7 @@ static PALETTE_INIT(lucky8)
UINT8 data;
UINT8 *proms;
- proms = machine.region("proms")->base();
+ proms = machine.root_device().memregion("proms")->base();
for (i = 0; i < 0x100; i++)
{
@@ -5988,7 +5988,7 @@ static PALETTE_INIT(lucky8)
palette_set_color_rgb(machine, i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
}
- proms = machine.region("proms2")->base();
+ proms = machine.root_device().memregion("proms2")->base();
for (i=0; i < 0x20; i++)
{
data = proms[i];
@@ -6361,7 +6361,7 @@ static PALETTE_INIT(magodds)
{
int r,g,b;
- UINT8*proms = machine.region("proms")->base();
+ UINT8*proms = machine.root_device().memregion("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -8433,7 +8433,7 @@ YM2203
static DRIVER_INIT(magoddsc)
{
int A;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x8000;A++)
{
@@ -10058,7 +10058,7 @@ ROM_END
static DRIVER_INIT(goldstar)
{
int A;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
{
@@ -10143,8 +10143,8 @@ static UINT8 chry10_decrypt(UINT8 cipherText)
static DRIVER_INIT( chry10 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
int start = 0;
int i;
@@ -10167,8 +10167,8 @@ static DRIVER_INIT( chry10 )
static DRIVER_INIT( cb3 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
int start = 0;
int i;
@@ -10186,7 +10186,7 @@ static DRIVER_INIT( cb3 )
static DRIVER_INIT( chrygld )
{
int A;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
do_blockswaps(machine, ROM);
// a data bitswap
@@ -10202,7 +10202,7 @@ static DRIVER_INIT( chrygld )
static DRIVER_INIT(cm)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -10213,7 +10213,7 @@ static DRIVER_INIT(cm)
static DRIVER_INIT(cmv4)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -10224,7 +10224,7 @@ static DRIVER_INIT(cmv4)
static DRIVER_INIT(cmast91)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -10235,7 +10235,7 @@ static DRIVER_INIT(cmast91)
static DRIVER_INIT(lucky8a)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x0010] = 0x21;
}
@@ -10243,7 +10243,7 @@ static DRIVER_INIT(lucky8a)
static DRIVER_INIT( nfb96sea )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
@@ -10276,7 +10276,7 @@ READ8_MEMBER(goldstar_state::fixedvala8_r)
static DRIVER_INIT( schery97 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10304,7 +10304,7 @@ READ8_MEMBER(goldstar_state::fixedval38_r)
static DRIVER_INIT( schery97a )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10333,7 +10333,7 @@ READ8_MEMBER(goldstar_state::fixedvalea_r)
static DRIVER_INIT( skill98 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10360,7 +10360,7 @@ READ8_MEMBER(goldstar_state::fixedval68_r)
static DRIVER_INIT( nfb96_c1 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10387,7 +10387,7 @@ READ8_MEMBER(goldstar_state::fixedval58_r)
static DRIVER_INIT( nfb96_c2 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10424,7 +10424,7 @@ READ8_MEMBER(goldstar_state::fixedvalaa_r)
static DRIVER_INIT( nfb96_d )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10457,7 +10457,7 @@ READ8_MEMBER(goldstar_state::fixedvalbe_r)
static DRIVER_INIT( nfb96_dk )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10489,7 +10489,7 @@ READ8_MEMBER(goldstar_state::fixedval84_r)
static DRIVER_INIT( rp35 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10517,7 +10517,7 @@ READ8_MEMBER(goldstar_state::fixedvalb2_r)
static DRIVER_INIT( rp36 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10545,7 +10545,7 @@ READ8_MEMBER(goldstar_state::fixedval48_r)
static DRIVER_INIT( rp36c3 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10579,7 +10579,7 @@ READ8_MEMBER(goldstar_state::fixedval74_r)
static DRIVER_INIT( po33 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10613,7 +10613,7 @@ READ8_MEMBER(goldstar_state::fixedvalc7_r)
static DRIVER_INIT( match133 )
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10637,7 +10637,7 @@ static DRIVER_INIT( match133 )
static DRIVER_INIT(cherrys)
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
unsigned char rawData[256] = {
0xCC, 0xCD, 0xCE, 0xCF, 0xC8, 0xC9, 0xCA, 0xCB, 0xC4, 0xC5, 0xC6, 0xC7,
@@ -10674,21 +10674,21 @@ static DRIVER_INIT(cherrys)
/* todo: remove these patches! */
static DRIVER_INIT( unkch1 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x9d52] = 0x00;
ROM[0x9d53] = 0x00;
}
static DRIVER_INIT( unkch3 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x9b86] = 0x00;
ROM[0x9b87] = 0x00;
}
static DRIVER_INIT( unkch4 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x9a6e] = 0x00;
ROM[0x9a6f] = 0x00;
}
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index 56348e39784..e1fe9ba557d 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -125,7 +125,7 @@ static void gpworld_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,
int i;
- UINT8 *GFX = machine.region("gfx2")->base();
+ UINT8 *GFX = state->memregion("gfx2")->base();
/* Heisted from Daphne which heisted it from MAME */
for (i = 0; i < 0x800; i += 8)
diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c
index 6bd10fb5574..b976db6d9e1 100644
--- a/src/mame/drivers/groundfx.c
+++ b/src/mame/drivers/groundfx.c
@@ -453,8 +453,8 @@ READ32_MEMBER(groundfx_state::irq_speedup_r_groundfx)
static DRIVER_INIT( groundfx )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx3")->base();
- int size=machine.region("gfx3")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int size=machine.root_device().memregion("gfx3")->bytes();
int data;
/* Speedup handlers */
diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c
index 5f83780b326..936d57d5297 100644
--- a/src/mame/drivers/gstriker.c
+++ b/src/mame/drivers/gstriker.c
@@ -213,7 +213,7 @@ WRITE8_MEMBER(gstriker_state::gs_sh_pending_command_clear_w)
WRITE8_MEMBER(gstriker_state::gs_sh_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x8000;
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index 5f5708a0180..f4f856e4159 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -903,7 +903,7 @@ ROM_END
static DRIVER_INIT( gsword )
{
#if 0
- UINT8 *ROM2 = machine.region("sub")->base();
+ UINT8 *ROM2 = machine.root_device().memregion("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x71e] = 0; /* patch for sound protection or time out function */
@@ -919,7 +919,7 @@ static DRIVER_INIT( gsword )
static DRIVER_INIT( gsword2 )
{
#if 0
- UINT8 *ROM2 = machine.region("sub")->base();
+ UINT8 *ROM2 = machine.root_device().memregion("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x726] = 0; /* patch for sound protection or time out function */
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index 94fea7584ef..be0e347f7ca 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -1165,7 +1165,7 @@ static DRIVER_INIT(gticlub)
state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
- K001005_preprocess_texture_data(machine.region("gfx1")->base(), machine.region("gfx1")->bytes(), 1);
+ K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 1);
}
static DRIVER_INIT(hangplt)
@@ -1173,8 +1173,8 @@ static DRIVER_INIT(hangplt)
gticlub_state *state = machine.driver_data<gticlub_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
state->m_sharc_dataram_1 = auto_alloc_array(machine, UINT32, 0x100000/4);
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index a114ac79124..fadefe86604 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -319,7 +319,7 @@ static TIMER_CALLBACK( fdc_data_callback )
{
guab_state *state = machine.driver_data<guab_state>();
struct wd1770 &fdc = state->m_fdc;
- UINT8* disk = (UINT8*)machine.region("user1")->base();
+ UINT8* disk = (UINT8*)state->memregion("user1")->base();
int more_data = 0;
/*
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index e03363525cb..d7dc78ccee7 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -364,7 +364,7 @@ GFXDECODE_END
static MACHINE_START( gundealr )
{
gundealr_state *state = machine.driver_data<gundealr_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c
index 35b4bfe67cb..15ef83a2238 100644
--- a/src/mame/drivers/gunpey.c
+++ b/src/mame/drivers/gunpey.c
@@ -134,7 +134,7 @@ WRITE8_MEMBER(gunpey_state::gunpey_blitter_w)
{
UINT16 *blit_buffer = m_blit_buffer;
UINT16 *blit_ram = m_blit_ram;
- UINT8 *blit_rom = machine().region("blit_data")->base();
+ UINT8 *blit_rom = memregion("blit_data")->base();
int x,y;
blit_ram[offset] = data;
@@ -307,7 +307,7 @@ INPUT_PORTS_END
static PALETTE_INIT( gunpey )
{
int i,r,g,b,val;
- UINT8 *blit_rom = machine.region("blit_data")->base();
+ UINT8 *blit_rom = machine.root_device().memregion("blit_data")->base();
for (i = 0; i < 512; i+=2)
{
@@ -384,7 +384,7 @@ ROM_END
static DRIVER_INIT( gunpey )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch SLOOOOW cycle checks ... */
rom[0x848b5] = 0x7e;
diff --git a/src/mame/drivers/gunsmoke.c b/src/mame/drivers/gunsmoke.c
index 72a7d6ff701..85c2d4f9b2d 100644
--- a/src/mame/drivers/gunsmoke.c
+++ b/src/mame/drivers/gunsmoke.c
@@ -274,7 +274,7 @@ GFXDECODE_END
static MACHINE_START( gunsmoke )
{
gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
- UINT8 *rombase = machine.region("maincpu")->base();
+ UINT8 *rombase = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x4000);
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index f01c225a064..38a05067677 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -1167,7 +1167,7 @@ static void halleys_decode_rgb(running_machine &machine, UINT32 *r, UINT32 *g, U
sram_189 = state->m_generic_paletteram_8;
// each of the three 32-byte 6330 PROM is wired to an RGB component output
- prom_6330 = machine.region("proms")->base();
+ prom_6330 = state->memregion("proms")->base();
// latch1 holds 8 bits from the selected palette RAM address
latch1_273 = sram_189[addr];
@@ -2187,7 +2187,7 @@ static void init_common(running_machine &machine)
// decrypt main program ROM
- rom = state->m_cpu1_base = machine.region("maincpu")->base();
+ rom = state->m_cpu1_base = state->memregion("maincpu")->base();
buf = state->m_gfx1_base;
for (i=0; i<0x10000; i++)
@@ -2200,7 +2200,7 @@ static void init_common(running_machine &machine)
// swap graphics ROM addresses and unpack each pixel
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
buf = state->m_gfx_plane02;
for (i=0xffff; i>=0; i--)
diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c
index 5b543f0e762..f8cb2f270b0 100644
--- a/src/mame/drivers/harddriv.c
+++ b/src/mame/drivers/harddriv.c
@@ -3924,7 +3924,7 @@ static void init_ds3(running_machine &machine)
static void init_dsk(running_machine &machine)
{
harddriv_state *state = machine.driver_data<harddriv_state>();
- UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr3 = state->memregion("user3")->base();
/* install ASIC61 */
state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x85c000, 0x85c7ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
@@ -3958,7 +3958,7 @@ static void init_dsk(running_machine &machine)
static void init_dsk2(running_machine &machine)
{
harddriv_state *state = machine.driver_data<harddriv_state>();
- UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr3 = state->memregion("user3")->base();
/* install ASIC65 */
state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w));
diff --git a/src/mame/drivers/hcastle.c b/src/mame/drivers/hcastle.c
index 1e7175177ba..90ead108346 100644
--- a/src/mame/drivers/hcastle.c
+++ b/src/mame/drivers/hcastle.c
@@ -179,7 +179,7 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( hcastle )
{
hcastle_state *state = machine.driver_data<hcastle_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index 06aac0cdcab..30d5b174b7c 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -243,7 +243,7 @@ WRITE16_MEMBER(highvdeo_state::tv_vcf_paletteram_w)
WRITE16_MEMBER(highvdeo_state::tv_vcf_bankselect_w)
{
UINT32 bankaddress;
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
/* bits 0, 1 select the ROM bank */
bankaddress = (data & 0x03) * 0x40000;
@@ -378,7 +378,7 @@ WRITE16_MEMBER(highvdeo_state::tv_tcf_paletteram_w)
WRITE16_MEMBER(highvdeo_state::tv_tcf_bankselect_w)
{
UINT32 bankaddress;
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
/* bits 0, 1, 2 select the ROM bank */
bankaddress = (data & 0x07) * 0x40000;
@@ -494,7 +494,7 @@ READ16_MEMBER(highvdeo_state::brasil_status_r)
WRITE16_MEMBER(highvdeo_state::brasil_status_w)
{
UINT32 bankaddress;
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
switch(data & 3) //data & 7?
{
diff --git a/src/mame/drivers/himesiki.c b/src/mame/drivers/himesiki.c
index c272193dec4..76ee2ddc86f 100644
--- a/src/mame/drivers/himesiki.c
+++ b/src/mame/drivers/himesiki.c
@@ -269,7 +269,7 @@ GFXDECODE_END
static MACHINE_START( himesiki )
{
himesiki_state *state = machine.driver_data<himesiki_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index b3f2272f770..888cf8923f6 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -117,7 +117,7 @@ static SCREEN_UPDATE_IND16(hitpoker)
READ8_MEMBER(hitpoker_state::hitpoker_vram_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
if(m_pic_data & 0x10)
return m_videoram[offset];
@@ -127,7 +127,7 @@ READ8_MEMBER(hitpoker_state::hitpoker_vram_r)
WRITE8_MEMBER(hitpoker_state::hitpoker_vram_w)
{
-// UINT8 *ROM = machine().region("maincpu")->base();
+// UINT8 *ROM = memregion("maincpu")->base();
// if(m_sys_regs[0x00] & 0x10)
m_videoram[offset] = data;
@@ -135,7 +135,7 @@ WRITE8_MEMBER(hitpoker_state::hitpoker_vram_w)
READ8_MEMBER(hitpoker_state::hitpoker_cram_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
if(m_pic_data & 0x10)
return m_colorram[offset];
@@ -150,7 +150,7 @@ WRITE8_MEMBER(hitpoker_state::hitpoker_cram_w)
READ8_MEMBER(hitpoker_state::hitpoker_paletteram_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
if(m_pic_data & 0x10)
return m_paletteram[offset];
@@ -517,7 +517,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(hitpoker)
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x1220] = 0x01; //patch eeprom write?
ROM[0x1221] = 0x01;
diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c
index e21e24e7d70..729350123e7 100644
--- a/src/mame/drivers/hnayayoi.c
+++ b/src/mame/drivers/hnayayoi.c
@@ -674,8 +674,8 @@ ROM_END
static DRIVER_INIT( hnfubuki )
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i, j;
/* interestingly, the blitter data has a slight encryption */
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 130acb4846d..cf6defe3300 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -1523,14 +1523,14 @@ static void hng64_reorder(running_machine &machine, UINT8* gfxregion, size_t gfx
static DRIVER_INIT( hng64_reorder_gfx )
{
- hng64_reorder(machine, machine.region("scrtile")->base(), machine.region("scrtile")->bytes());
+ hng64_reorder(machine, machine.root_device().memregion("scrtile")->base(), machine.root_device().memregion("scrtile")->bytes());
}
#define HACK_REGION
#ifdef HACK_REGION
static void hng64_patch_bios_region(running_machine& machine, int region)
{
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("user1")->base();
if ((rom[0x4000]==0xff) && (rom[0x4001] == 0xff))
{
@@ -1576,7 +1576,7 @@ static DRIVER_INIT( fatfurwa )
{
hng64_state *state = machine.driver_data<hng64_state>();
- /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(machine.region("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
+ /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(state->memregion("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
DRIVER_INIT_CALL(hng64_fght);
state->m_mcu_type = FIGHT_MCU;
}
@@ -1661,7 +1661,7 @@ static MACHINE_RESET(hyperneo)
{
hng64_state *state = machine.driver_data<hng64_state>();
int i;
- const UINT8 *rom = machine.region("user2")->base();
+ const UINT8 *rom = state->memregion("user2")->base();
/* Sound CPU */
UINT8 *RAM = (UINT8*)state->m_soundram;
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index b20e934f59a..afc00c1e370 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -291,7 +291,7 @@ READ8_MEMBER(homedata_state::mrokumei_sound_io_r)
if (m_sndbank & 4)
return(soundlatch_byte_r(space, 0));
else
- return machine().region("audiocpu")->base()[0x10000 + offset + (m_sndbank & 1) * 0x10000];
+ return memregion("audiocpu")->base()[0x10000 + offset + (m_sndbank & 1) * 0x10000];
}
WRITE8_MEMBER(homedata_state::mrokumei_sound_bank_w)
@@ -509,7 +509,7 @@ WRITE8_MEMBER(homedata_state::pteacher_upd7807_portc_w)
WRITE8_MEMBER(homedata_state::bankswitch_w)
{
- int last_bank = (machine().region("maincpu")->bytes() - 0x10000) / 0x4000;
+ int last_bank = (machine().root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
/* last bank is fixed and is #0 for us, other banks start from #1 (hence data+1 below)*/
if (data < last_bank)
@@ -1149,10 +1149,10 @@ static MACHINE_START( homedata )
static MACHINE_START( reikaids )
{
homedata_state *state = machine.driver_data<homedata_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0xc000], 0x4000);
- state->membank("bank2")->configure_entries(0, 4, machine.region("audiocpu")->base(), 0x10000);
+ state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
@@ -1166,10 +1166,10 @@ static MACHINE_START( reikaids )
static MACHINE_START( pteacher )
{
homedata_state *state = machine.driver_data<homedata_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
- state->membank("bank2")->configure_entries(0, 4, machine.region("audiocpu")->base(), 0x10000);
+ state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
diff --git a/src/mame/drivers/homerun.c b/src/mame/drivers/homerun.c
index 29454b17907..e73d6845024 100644
--- a/src/mame/drivers/homerun.c
+++ b/src/mame/drivers/homerun.c
@@ -193,7 +193,7 @@ GFXDECODE_END
static MACHINE_START( homerun )
{
homerun_state *state = machine.driver_data<homerun_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entry(0, &ROM[0x00000]);
state->membank("bank1")->configure_entries(1, 7, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index f9540f79aa8..5d5b0e67924 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -597,7 +597,7 @@ WRITE32_MEMBER(hornet_state::comm1_w)
WRITE32_MEMBER(hornet_state::comm_rombank_w)
{
int bank = data >> 24;
- UINT8 *usr3 = machine().region("user3")->base();
+ UINT8 *usr3 = memregion("user3")->base();
if (usr3 != NULL)
membank("bank1")->set_entry(bank & 0x7f);
}
@@ -893,11 +893,11 @@ static MACHINE_START( hornet )
static MACHINE_RESET( hornet )
{
- UINT8 *usr3 = machine.region("user3")->base();
- UINT8 *usr5 = machine.region("user5")->base();
+ UINT8 *usr3 = machine.root_device().memregion("user3")->base();
+ UINT8 *usr5 = machine.root_device().memregion("user5")->base();
if (usr3 != NULL)
{
- machine.root_device().membank("bank1")->configure_entries(0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ machine.root_device().membank("bank1")->configure_entries(0, machine.root_device().memregion("user3")->bytes() / 0x40000, usr3, 0x40000);
machine.root_device().membank("bank1")->set_entry(0);
}
@@ -1014,12 +1014,12 @@ MACHINE_CONFIG_END
static MACHINE_RESET( hornet_2board )
{
- UINT8 *usr3 = machine.region("user3")->base();
- UINT8 *usr5 = machine.region("user5")->base();
+ UINT8 *usr3 = machine.root_device().memregion("user3")->base();
+ UINT8 *usr5 = machine.root_device().memregion("user5")->base();
if (usr3 != NULL)
{
- machine.root_device().membank("bank1")->configure_entries(0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ machine.root_device().membank("bank1")->configure_entries(0, machine.root_device().memregion("user3")->bytes() / 0x40000, usr3, 0x40000);
machine.root_device().membank("bank1")->set_entry(0);
}
cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
@@ -1244,7 +1244,7 @@ static DRIVER_INIT(hornet)
{
hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
@@ -1255,8 +1255,8 @@ static DRIVER_INIT(hornet_2board)
{
hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
diff --git a/src/mame/drivers/hshavoc.c b/src/mame/drivers/hshavoc.c
index 264c7804dec..356f4a65e14 100644
--- a/src/mame/drivers/hshavoc.c
+++ b/src/mame/drivers/hshavoc.c
@@ -119,7 +119,7 @@ static DRIVER_INIT(hshavoc)
{
int x;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
static const UINT16 typedat[16] = {
1,1,1,1, 1,1,1,1,
diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c
index 8c552f21674..6a8df189574 100644
--- a/src/mame/drivers/hvyunit.c
+++ b/src/mame/drivers/hvyunit.c
@@ -216,7 +216,7 @@ WRITE8_MEMBER(hvyunit_state::trigger_nmi_on_slave_cpu)
WRITE8_MEMBER(hvyunit_state::master_bankswitch_w)
{
- unsigned char *ROM = machine().region("master")->base();
+ unsigned char *ROM = memregion("master")->base();
int bank = data & 7;
ROM = &ROM[0x4000 * bank];
membank("bank1")->set_base(ROM);
@@ -275,7 +275,7 @@ WRITE8_MEMBER(hvyunit_state::hu_colorram_w)
WRITE8_MEMBER(hvyunit_state::slave_bankswitch_w)
{
- unsigned char *ROM = machine().region("slave")->base();
+ unsigned char *ROM = memregion("slave")->base();
int bank = (data & 0x03);
m_port0_data = data;
ROM = &ROM[0x4000 * bank];
@@ -308,7 +308,7 @@ WRITE8_MEMBER(hvyunit_state::coin_count_w)
WRITE8_MEMBER(hvyunit_state::sound_bankswitch_w)
{
- unsigned char *ROM = machine().region("soundcpu")->base();
+ unsigned char *ROM = memregion("soundcpu")->base();
int bank = data & 0x3;
ROM = &ROM[0x4000 * bank];
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index 0558644587f..fa66282400a 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -201,8 +201,8 @@ static TIMER_CALLBACK( magerror_irq_callback )
READ16_MEMBER(hyprduel_state::hyprduel_bankedrom_r)
{
- UINT8 *ROM = machine().region("gfx1")->base();
- size_t len = machine().region("gfx1")->bytes();
+ UINT8 *ROM = memregion("gfx1")->base();
+ size_t len = memregion("gfx1")->bytes();
offset = offset * 2 + 0x10000 * (*m_rombank);
@@ -286,8 +286,8 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
if (offset == 0xc / 2)
{
- UINT8 *src = machine().region("gfx1")->base();
- size_t src_len = machine().region("gfx1")->bytes();
+ UINT8 *src = memregion("gfx1")->base();
+ size_t src_len = memregion("gfx1")->bytes();
UINT32 tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2];
UINT32 src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2];
diff --git a/src/mame/drivers/ichiban.c b/src/mame/drivers/ichiban.c
index 543395f4eb7..30b259cac8e 100644
--- a/src/mame/drivers/ichiban.c
+++ b/src/mame/drivers/ichiban.c
@@ -104,7 +104,7 @@ GFXDECODE_END
void ichibanjyan_state::machine_start()
{
- UINT8 *ROM = machine().region("code")->base();
+ UINT8 *ROM = memregion("code")->base();
membank("bank1")->configure_entries(0, 4, ROM, 0x8000);
}
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index fe865e391eb..9e30a1ec8f4 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -783,8 +783,8 @@ ROM_END
static DRIVER_INIT( jingbell )
{
int i;
- UINT8 *rom = (UINT8 *)machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *rom = (UINT8 *)machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
for (i=0; i<size; i++)
{
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index d18249fe0d6..3b50c1e7c18 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -415,10 +415,10 @@ WRITE16_MEMBER(igs011_state::igs011_blit_flags_w)
UINT8 trans_pen, clear_pen, pen_hi, *dest;
UINT8 pen = 0;
- UINT8 *gfx = machine().region("blitter")->base();
- UINT8 *gfx2 = machine().region("blitter_hi")->base();
- int gfx_size = machine().region("blitter")->bytes();
- int gfx2_size = machine().region("blitter_hi")->bytes();
+ UINT8 *gfx = memregion("blitter")->base();
+ UINT8 *gfx2 = memregion("blitter_hi")->base();
+ int gfx_size = memregion("blitter")->bytes();
+ int gfx2_size = memregion("blitter_hi")->bytes();
const rectangle &clip = machine().primary_screen->visible_area();
@@ -559,7 +559,7 @@ READ16_MEMBER(igs011_state::igs_5_dips_r){ return igs_dips_r(5); }
static void wlcc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -583,7 +583,7 @@ static void wlcc_decrypt(running_machine &machine)
static void lhb_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -608,7 +608,7 @@ static void lhb_decrypt(running_machine &machine)
static void drgnwrld_type3_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -636,7 +636,7 @@ static void drgnwrld_type3_decrypt(running_machine &machine)
static void drgnwrld_type2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -669,7 +669,7 @@ static void drgnwrld_type2_decrypt(running_machine &machine)
static void drgnwrld_type1_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -699,7 +699,7 @@ static void lhb2_decrypt(running_machine &machine)
{
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -740,7 +740,7 @@ static void nkishusp_decrypt(running_machine &machine)
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -770,7 +770,7 @@ static void nkishusp_decrypt(running_machine &machine)
static void vbowlj_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -804,7 +804,7 @@ static void vbowlj_decrypt(running_machine &machine)
static void dbc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -854,7 +854,7 @@ static void dbc_decrypt(running_machine &machine)
static void ryukobou_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
for (i=0; i<rom_size/2; i++)
@@ -886,7 +886,7 @@ static void lhb2_decrypt_gfx(running_machine &machine)
{
int i;
unsigned rom_size = 0x200000;
- UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -901,7 +901,7 @@ static void drgnwrld_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x400000;
- UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -1014,7 +1014,7 @@ WRITE16_MEMBER(igs011_state::igs011_prot_addr_w)
// m_prot2 = 0x00;
address_space *sp = machine().device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
// Plug previous address range with ROM access
sp->install_rom(m_prot1_addr + 0, m_prot1_addr + 9, rom + m_prot1_addr);
@@ -1757,7 +1757,7 @@ READ16_MEMBER(igs011_state::vbowl_igs003_r)
// V0400O
static DRIVER_INIT( drgnwrld )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1783,7 +1783,7 @@ static DRIVER_INIT( drgnwrld )
static DRIVER_INIT( drgnwrldv30 )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1808,7 +1808,7 @@ static DRIVER_INIT( drgnwrldv30 )
static DRIVER_INIT( drgnwrldv21 )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type2_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1838,7 +1838,7 @@ static DRIVER_INIT( drgnwrldv21 )
static DRIVER_INIT( drgnwrldv21j )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1865,7 +1865,7 @@ static DRIVER_INIT( drgnwrldv21j )
static DRIVER_INIT( drgnwrldv20j )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1903,7 +1903,7 @@ static DRIVER_INIT( drgnwrldv11h )
static DRIVER_INIT( drgnwrldv10c )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1929,7 +1929,7 @@ static DRIVER_INIT( drgnwrldv10c )
static DRIVER_INIT( lhb )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb_decrypt(machine);
@@ -1939,7 +1939,7 @@ static DRIVER_INIT( lhb )
static DRIVER_INIT( lhbv33c )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb_decrypt(machine);
@@ -1949,7 +1949,7 @@ static DRIVER_INIT( lhbv33c )
static DRIVER_INIT( dbc )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
dbc_decrypt(machine);
@@ -1979,7 +1979,7 @@ static DRIVER_INIT( dbc )
static DRIVER_INIT( ryukobou )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
ryukobou_decrypt(machine);
@@ -1993,7 +1993,7 @@ static DRIVER_INIT( ryukobou )
static DRIVER_INIT( xymg )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb_decrypt(machine);
/*
@@ -2027,7 +2027,7 @@ static DRIVER_INIT( xymg )
static DRIVER_INIT( wlcc )
{
-// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
wlcc_decrypt(machine);
/*
@@ -2051,7 +2051,7 @@ static DRIVER_INIT( wlcc )
static DRIVER_INIT( lhb2 )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
lhb2_decrypt(machine);
lhb2_decrypt_gfx(machine);
@@ -2073,8 +2073,8 @@ static DRIVER_INIT( lhb2 )
static DRIVER_INIT( vbowl )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.root_device().memregion("blitter")->base();
int i;
vbowlj_decrypt(machine);
@@ -2098,8 +2098,8 @@ static DRIVER_INIT( vbowl )
static DRIVER_INIT( vbowlj )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.root_device().memregion("blitter")->base();
int i;
vbowlj_decrypt(machine);
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index e81877deee1..ce1f5ae7760 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -219,8 +219,8 @@ WRITE16_MEMBER(igs017_state::spriteram_lsb_w)
static void expand_sprites(running_machine &machine)
{
igs017_state *state = machine.driver_data<igs017_state>();
- UINT8 *rom = machine.region("sprites")->base();
- int size = machine.region("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
+ int size = state->memregion("sprites")->bytes();
int i;
state->m_sprites_gfx_size = size / 2 * 3;
@@ -421,8 +421,8 @@ static SCREEN_UPDATE_IND16( igs017 )
static void decrypt_program_rom(running_machine &machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
{
- int length = machine.region("maincpu")->bytes();
- UINT8 *rom = machine.region("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -474,7 +474,7 @@ static void decrypt_program_rom(running_machine &machine, int mask, int a7, int
static void iqblocka_patch_rom(running_machine &machine)
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// rom[0x7b64] = 0xc9;
@@ -515,8 +515,8 @@ static DRIVER_INIT( iqblockf )
static void tjsb_decrypt_sprites(running_machine &machine)
{
- int length = machine.region("sprites")->bytes();
- UINT8 *rom = machine.region("sprites")->base();
+ int length = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i, addr;
@@ -551,7 +551,7 @@ static DRIVER_INIT( tjsb )
static void mgcs_decrypt_program_rom(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
@@ -600,8 +600,8 @@ static void mgcs_decrypt_program_rom(running_machine &machine)
static void mgcs_decrypt_tiles(running_machine &machine)
{
- int length = machine.region("tilemaps")->bytes();
- UINT8 *rom = machine.region("tilemaps")->base();
+ int length = machine.root_device().memregion("tilemaps")->bytes();
+ UINT8 *rom = machine.root_device().memregion("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -617,8 +617,8 @@ static void mgcs_decrypt_tiles(running_machine &machine)
static void mgcs_flip_sprites(running_machine &machine)
{
- int length = machine.region("sprites")->bytes();
- UINT8 *rom = machine.region("sprites")->base();
+ int length = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
int i;
for (i = 0;i < length;i+=2)
@@ -638,7 +638,7 @@ static void mgcs_flip_sprites(running_machine &machine)
static void mgcs_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x4e036/2] = 0x6006;
@@ -664,7 +664,7 @@ static DRIVER_INIT( mgcs )
// decryption is incomplete, the first part of code doesn't seem right.
static DRIVER_INIT( tarzan )
{
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int i;
int size = 0x40000;
@@ -690,7 +690,7 @@ static DRIVER_INIT( tarzan )
// by iq_132
static DRIVER_INIT( tarzana )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
int size = 0x80000;
@@ -763,7 +763,7 @@ static DRIVER_INIT( starzan )
{
int size = 0x040000;
- UINT8 *data = machine.region("maincpu")->base();
+ UINT8 *data = machine.root_device().memregion("maincpu")->base();
UINT8 *code = auto_alloc_array(machine, UINT8, size);
memcpy(code, data, size);
@@ -781,7 +781,7 @@ static DRIVER_INIT( starzan )
static DRIVER_INIT( sdmg2 )
{
int i;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
@@ -838,7 +838,7 @@ static DRIVER_INIT( sdmg2 )
static DRIVER_INIT( mgdha )
{
int i;
- UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int rom_size = 0x80000;
@@ -873,7 +873,7 @@ static DRIVER_INIT( mgdh )
{
DRIVER_INIT_CALL( mgdha );
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// additional protection
rom[0x4ad50/2] = 0x4e71;
@@ -885,7 +885,7 @@ static DRIVER_INIT( mgdh )
static void lhzb2_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Prot. checks:
rom[0x14786/2] = 0x6044; // 014786: 6744 beq $147cc
@@ -896,8 +896,8 @@ static void lhzb2_patch_rom(running_machine &machine)
static void lhzb2_decrypt_tiles(running_machine &machine)
{
- int length = machine.region("tilemaps")->bytes();
- UINT8 *rom = machine.region("tilemaps")->base();
+ int length = machine.root_device().memregion("tilemaps")->bytes();
+ UINT8 *rom = machine.root_device().memregion("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -914,8 +914,8 @@ static void lhzb2_decrypt_tiles(running_machine &machine)
static void lhzb2_decrypt_sprites(running_machine &machine)
{
- int length = machine.region("sprites")->bytes();
- UINT8 *rom = machine.region("sprites")->base();
+ int length = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *rom = machine.root_device().memregion("sprites")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i, addr;
@@ -940,7 +940,7 @@ static void lhzb2_decrypt_sprites(running_machine &machine)
static DRIVER_INIT( lhzb2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -1033,7 +1033,7 @@ static DRIVER_INIT( lhzb2 )
static void lhzb2a_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Prot. checks:
rom[0x09c52/2] = 0x6026; // 009C52: 6726 beq $9c7a
@@ -1049,7 +1049,7 @@ static void lhzb2a_patch_rom(running_machine &machine)
static DRIVER_INIT( lhzb2a )
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
@@ -1114,7 +1114,7 @@ static DRIVER_INIT( lhzb2a )
static void slqz2_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Prot. checks:
rom[0x1489c/2] = 0x6044; // 01489C: 6744 beq $148e2
@@ -1125,8 +1125,8 @@ static void slqz2_patch_rom(running_machine &machine)
static void slqz2_decrypt_tiles(running_machine &machine)
{
- int length = machine.region("tilemaps")->bytes();
- UINT8 *rom = machine.region("tilemaps")->base();
+ int length = machine.root_device().memregion("tilemaps")->bytes();
+ UINT8 *rom = machine.root_device().memregion("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -1143,7 +1143,7 @@ static void slqz2_decrypt_tiles(running_machine &machine)
static DRIVER_INIT( slqz2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x80000;
diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c
index 8bf2214a7b9..2aedb1ec1c5 100644
--- a/src/mame/drivers/igs_m027.c
+++ b/src/mame/drivers/igs_m027.c
@@ -254,7 +254,7 @@ static void sdwx_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x80000;
- UINT8 *src = (UINT8 *) (machine.region("gfx1")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("gfx1")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -758,7 +758,7 @@ ROM_END
static void pgm_create_dummy_internal_arm_region(running_machine &machine)
{
- UINT16 *temp16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// fill with RX 14
int i;
@@ -785,7 +785,7 @@ static void sdwx_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -831,7 +831,7 @@ static const UINT8 hauntedh_tab[0x100] = {
static void hauntedh_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x080000;
@@ -876,7 +876,7 @@ static const UINT8 chessc2_tab[0x100] = {
static void chessc2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -921,7 +921,7 @@ static const UINT8 klxyj_tab[0x100] = {
static void klxyj_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -965,7 +965,7 @@ static const UINT8 big2_tab[0x100] = {
static void big2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1009,7 +1009,7 @@ static const UINT8 gonefsh2_tab[0x100] = {
static void gonefsh2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1053,7 +1053,7 @@ static const UINT8 sddz_tab[0x100] = {
static void sddz_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1097,7 +1097,7 @@ static const UINT8 lhzb3_tab[0x100] = {
static void lhzb3_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1141,7 +1141,7 @@ static const UINT8 mgfx_tab[0x100] = {
static void mgfx_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
@@ -1185,7 +1185,7 @@ static const UINT8 lhzb4_tab[0x100] = {
static void lhzb4_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine.region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x80000;
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index a8854f64223..6f51f76859f 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -343,7 +343,7 @@ CUSTOM_INPUT_MEMBER(igspoker_state::hopper_r)
READ8_MEMBER(igspoker_state::exp_rom_r)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
return rom[offset+0x10000];
}
@@ -1919,7 +1919,7 @@ ROM_END
static DRIVER_INIT( cpoker )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1933,7 +1933,7 @@ static DRIVER_INIT( cpoker )
static DRIVER_INIT( cpokert )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -1963,7 +1963,7 @@ static DRIVER_INIT( cpokert )
static DRIVER_INIT( cska )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1980,7 +1980,7 @@ static DRIVER_INIT( cska )
static DRIVER_INIT( igs_ncs )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -2141,7 +2141,7 @@ Clocks
static DRIVER_INIT( igs_ncs2 )
{
- UINT8 *src = (UINT8 *) (machine.region("maincpu")->base());
+ UINT8 *src = (UINT8 *) (machine.root_device().memregion("maincpu")->base());
int i;
for(i = 0; i < 0x10000; i++)
@@ -2218,8 +2218,8 @@ static DRIVER_INIT( chleague )
int length;
UINT8 *rom;
- rom = machine.region("maincpu")->base();
- length = machine.region("maincpu")->bytes();
+ rom = machine.root_device().memregion("maincpu")->base();
+ length = machine.root_device().memregion("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2282,8 +2282,8 @@ static DRIVER_INIT( number10 )
UINT8 *tmp;
UINT8 *rom;
- rom = machine.region("maincpu")->base();
- length = machine.region("maincpu")->bytes();
+ rom = machine.root_device().memregion("maincpu")->base();
+ length = machine.root_device().memregion("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2312,8 +2312,8 @@ static DRIVER_INIT( number10 )
rom[0xeed] = 0xc3;
/* Descramble graphic */
- rom = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ rom = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
tmp = auto_alloc_array(machine, UINT8, length);
memcpy(tmp,rom,length);
for (A = 0;A < length;A++)
@@ -2361,7 +2361,7 @@ ROM_END
static DRIVER_INIT( cpokerpk )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A=0x0714; A < 0xF000; A+=0x1000)
rom[A] ^= 0x20;
@@ -2415,7 +2415,7 @@ ROM_END
static DRIVER_INIT( pktet346 )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
diff --git a/src/mame/drivers/intrscti.c b/src/mame/drivers/intrscti.c
index 692fdb2fade..a1471e38ed2 100644
--- a/src/mame/drivers/intrscti.c
+++ b/src/mame/drivers/intrscti.c
@@ -131,7 +131,7 @@ ROM_END
static DRIVER_INIT( intrscti )
{
- UINT8 *cpu = machine.region( "maincpu" )->base();
+ UINT8 *cpu = machine.root_device().memregion( "maincpu" )->base();
int i;
for (i=0x8000;i<0x8fff;i++)
{
diff --git a/src/mame/drivers/inufuku.c b/src/mame/drivers/inufuku.c
index 9cc9d1cb28f..60eeafe064b 100644
--- a/src/mame/drivers/inufuku.c
+++ b/src/mame/drivers/inufuku.c
@@ -314,7 +314,7 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( inufuku )
{
inufuku_state *state = machine.driver_data<inufuku_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/iqblock.c b/src/mame/drivers/iqblock.c
index e5dcfdb307e..1c00afaa917 100644
--- a/src/mame/drivers/iqblock.c
+++ b/src/mame/drivers/iqblock.c
@@ -95,7 +95,7 @@ WRITE8_MEMBER(iqblock_state::iqblock_irqack_w)
READ8_MEMBER(iqblock_state::extrarom_r)
{
- return machine().region("user1")->base()[offset];
+ return memregion("user1")->base()[offset];
}
@@ -431,7 +431,7 @@ ROM_END
static DRIVER_INIT( iqblock )
{
iqblock_state *state = machine.driver_data<iqblock_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -454,7 +454,7 @@ static DRIVER_INIT( iqblock )
static DRIVER_INIT( grndtour )
{
iqblock_state *state = machine.driver_data<iqblock_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
/* decrypt the program ROM */
diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c
index 9f3b79b2d9a..67eaf6f15a1 100644
--- a/src/mame/drivers/istellar.c
+++ b/src/mame/drivers/istellar.c
@@ -274,7 +274,7 @@ INPUT_PORTS_END
static PALETTE_INIT( istellar )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* Oddly enough, the top 4 bits of each byte is 0 */
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index f7cc08901bd..de20516833e 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -625,7 +625,7 @@ READ32_MEMBER(itech32_state::gtclass_prot_result_r)
WRITE8_MEMBER(itech32_state::sound_bank_w)
{
- membank("bank1")->set_base(&machine().region("soundcpu")->base()[0x10000 + data * 0x4000]);
+ membank("bank1")->set_base(&machine().root_device().memregion("soundcpu")->base()[0x10000 + data * 0x4000]);
}
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index 4daeb5f0487..73ff7a54ead 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -657,7 +657,7 @@ static MACHINE_RESET( itech8 )
/* make sure bank 0 is selected */
if (main_cpu_type == M6809 || main_cpu_type == HD6309)
{
- state->membank("bank1")->set_base(&machine.region("maincpu")->base()[0x4000]);
+ state->membank("bank1")->set_base(&state->memregion("maincpu")->base()[0x4000]);
machine.device("maincpu")->reset();
}
@@ -705,7 +705,7 @@ WRITE8_MEMBER(itech8_state::blitter_w)
{
/* bit 0x20 on address 7 controls CPU banking */
if (offset / 2 == 7)
- membank("bank1")->set_base(&machine().region("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
/* the rest is handled by the video hardware */
itech8_blitter_w(space, offset, data);
@@ -715,7 +715,7 @@ WRITE8_MEMBER(itech8_state::blitter_w)
WRITE8_MEMBER(itech8_state::rimrockn_bank_w)
{
/* banking is controlled here instead of by the blitter output */
- membank("bank1")->set_base(&machine().region("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
}
diff --git a/src/mame/drivers/itgambl2.c b/src/mame/drivers/itgambl2.c
index c7ca873ce7c..4fc4bbaf6f3 100644
--- a/src/mame/drivers/itgambl2.c
+++ b/src/mame/drivers/itgambl2.c
@@ -86,7 +86,7 @@ static SCREEN_UPDATE_RGB32( itgambl2 )
{
itgambl2_state *state = screen.machine().driver_data<itgambl2_state>();
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("gfx1")->base();
+ const UINT8 *blit_ram = state->memregion("gfx1")->base();
if(screen.machine().input().code_pressed(KEYCODE_Z))
state->m_test_x++;
diff --git a/src/mame/drivers/itgambl3.c b/src/mame/drivers/itgambl3.c
index 6a19248aa15..30801e5a934 100644
--- a/src/mame/drivers/itgambl3.c
+++ b/src/mame/drivers/itgambl3.c
@@ -74,7 +74,7 @@ static SCREEN_UPDATE_RGB32( itgambl3 )
{
itgambl3_state *state = screen.machine().driver_data<itgambl3_state>();
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("gfx1")->base();
+ const UINT8 *blit_ram = state->memregion("gfx1")->base();
if(screen.machine().input().code_pressed(KEYCODE_Z))
state->m_test_x++;
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 4529a594adf..acff3f65694 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -109,7 +109,7 @@ READ8_MEMBER(jack_state::striv_question_r)
// Read the actual byte from question roms
else
{
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
int real_address;
real_address = m_question_address | (offset & 0x3f0) | m_remap_address[offset & 0x0f];
@@ -1298,7 +1298,7 @@ static void treahunt_decode( running_machine &machine )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x4000);
int data;
@@ -1373,7 +1373,7 @@ static DRIVER_INIT( loverboy )
code, the protection device is disabled or changes behaviour via
writes at 0xf000 and 0xf008. -AS
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
ROM[0x13] = 0x01;
ROM[0x12] = 0x9d;
@@ -1384,7 +1384,7 @@ static DRIVER_INIT( loverboy )
static DRIVER_INIT( striv )
{
jack_state *state = machine.driver_data<jack_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 data;
int A;
diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c
index 7f75e890a8f..67c9fa64dd1 100644
--- a/src/mame/drivers/jackal.c
+++ b/src/mame/drivers/jackal.c
@@ -114,7 +114,7 @@ READ8_MEMBER(jackal_state::jackal_spriteram_r)
WRITE8_MEMBER(jackal_state::jackal_rambank_w)
{
- UINT8 *rgn = machine().region("master")->base();
+ UINT8 *rgn = memregion("master")->base();
if (data & 0x04)
popmessage("jackal_rambank_w %02x", data);
@@ -328,7 +328,7 @@ static INTERRUPT_GEN( jackal_interrupt )
static MACHINE_START( jackal )
{
jackal_state *state = machine.driver_data<jackal_state>();
- UINT8 *ROM = machine.region("master")->base();
+ UINT8 *ROM = state->memregion("master")->base();
state->membank("bank1")->configure_entry(0, &ROM[0x04000]);
state->membank("bank1")->configure_entry(1, &ROM[0x14000]);
@@ -343,7 +343,7 @@ static MACHINE_START( jackal )
static MACHINE_RESET( jackal )
{
jackal_state *state = machine.driver_data<jackal_state>();
- UINT8 *rgn = machine.region("master")->base();
+ UINT8 *rgn = state->memregion("master")->base();
// HACK: running at the nominal clock rate, music stops working
// at the beginning of the game. This fixes it.
diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c
index ab756f5ae7c..38da3b5c1b2 100644
--- a/src/mame/drivers/jackie.c
+++ b/src/mame/drivers/jackie.c
@@ -346,7 +346,7 @@ WRITE8_MEMBER(jackie_state::igs_irqack_w)
READ8_MEMBER(jackie_state::expram_r)
{
- UINT8 *rom = machine().region("gfx3")->base();
+ UINT8 *rom = memregion("gfx3")->base();
offset += m_exp_bank * 0x8000;
// logerror("PC %06X: %04x = %02x\n",cpu_get_pc(&space.device()),offset,rom[offset]);
@@ -540,7 +540,7 @@ static DRIVER_INIT( jackie )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0xf000;A++)
{
diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c
index 4f5e32b5c1e..a40d539c841 100644
--- a/src/mame/drivers/jackpool.c
+++ b/src/mame/drivers/jackpool.c
@@ -296,7 +296,7 @@ ROM_END
static DRIVER_INIT( jackpool )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/* patch NVRAM routine */
rom[0x9040/2] = 0x6602;
diff --git a/src/mame/drivers/jaguar.c b/src/mame/drivers/jaguar.c
index bc1f29b9313..87c91597a1e 100644
--- a/src/mame/drivers/jaguar.c
+++ b/src/mame/drivers/jaguar.c
@@ -491,7 +491,7 @@ static IRQ_CALLBACK(jaguar_irq_callback)
static MACHINE_RESET( cojag )
{
cojag_state *state = machine.driver_data<cojag_state>();
- UINT8 *rom = machine.region("user2")->base();
+ UINT8 *rom = state->memregion("user2")->base();
/* 68020 only: copy the interrupt vectors into RAM */
if (!cojag_is_r3000)
@@ -719,7 +719,7 @@ WRITE32_MEMBER(cojag_state::misc_control_w)
}
/* adjust banking */
- if (machine().region("user2")->base())
+ if (machine().root_device().memregion("user2")->base())
{
membank("bank2")->set_entry((data >> 1) & 7);
membank("bank9")->set_entry((data >> 1) & 7);
@@ -899,7 +899,7 @@ WRITE32_MEMBER(cojag_state::latch_w)
logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(&space.device()), data);
/* adjust banking */
- if (machine().region("user2")->base())
+ if (machine().root_device().memregion("user2")->base())
{
if (cojag_is_r3000)
membank("bank1")->set_entry(data & 1);
@@ -1831,7 +1831,7 @@ MACHINE_CONFIG_END
static void jaguar_fix_endian( running_machine &machine, UINT32 addr, UINT32 size )
{
- UINT8 j[4], *RAM = machine.region("maincpu")->base();
+ UINT8 j[4], *RAM = machine.root_device().memregion("maincpu")->base();
UINT32 i;
size += addr;
logerror("File Loaded to address range %X to %X\n",addr,size-1);
@@ -1871,7 +1871,7 @@ static QUICKLOAD_LOAD( jaguar )
memset(jaguar_shared_ram, 0, 0x200000);
quickload_size = MIN(quickload_size, 0x200000 - quickload_begin);
- image.fread( &image.device().machine().region("maincpu")->base()[quickload_begin], quickload_size);
+ image.fread( &image.device().machine().root_device().memregion("maincpu")->base()[quickload_begin], quickload_size);
jaguar_fix_endian(image.device().machine(), quickload_begin, quickload_size);
@@ -1916,7 +1916,7 @@ static QUICKLOAD_LOAD( jaguar )
{
memset(jaguar_shared_ram, 0, 0x200000);
image.fseek(0, SEEK_SET);
- image.fread( &image.device().machine().region("maincpu")->base()[start-skip], quickload_size);
+ image.fread( &image.device().machine().root_device().memregion("maincpu")->base()[start-skip], quickload_size);
quickload_begin = start;
jaguar_fix_endian(image.device().machine(), (start-skip)&0xfffffc, quickload_size);
}
@@ -1955,7 +1955,7 @@ static DEVICE_IMAGE_LOAD( jaguar )
}
/* Load cart into memory */
- image.fread( &image.device().machine().region("maincpu")->base()[0x800000+load_offset], size);
+ image.fread( &image.device().machine().root_device().memregion("maincpu")->base()[0x800000+load_offset], size);
}
else
{
diff --git a/src/mame/drivers/jailbrek.c b/src/mame/drivers/jailbrek.c
index b0a57de5269..8658af1ffb0 100644
--- a/src/mame/drivers/jailbrek.c
+++ b/src/mame/drivers/jailbrek.c
@@ -404,7 +404,7 @@ ROM_END
static DRIVER_INIT( jailbrek )
{
- UINT8 *SPEECH_ROM = machine.region("vlm")->base();
+ UINT8 *SPEECH_ROM = machine.root_device().memregion("vlm")->base();
int ind;
/*
@@ -416,7 +416,7 @@ static DRIVER_INIT( jailbrek )
represents address line A13.)
*/
- if (machine.region("vlm")->bytes() == 0x4000)
+ if (machine.root_device().memregion("vlm")->bytes() == 0x4000)
{
for (ind = 0; ind < 0x2000; ++ind)
{
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 9b9693edf7e..7dc61aad3f8 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -353,7 +353,7 @@ priority = 8, then 4, 2 and finally 1).
static void jalmah_priority_system(running_machine &machine)
{
jalmah_state *state = machine.driver_data<jalmah_state>();
- UINT8 *pri_rom = machine.region("user1")->base();
+ UINT8 *pri_rom = state->memregion("user1")->base();
UINT8 i;
UINT8 prinum[0x10];
@@ -950,7 +950,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okirom_w)
{
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = machine().region("oki")->base();
+ UINT8 *oki = memregion("oki")->base();
m_oki_rom = data & 1;
@@ -967,7 +967,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okibank_w)
{
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = machine().region("oki")->base();
+ UINT8 *oki = memregion("oki")->base();
m_oki_bank = data & 3;
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index 7ed9038bbab..1f8cc272dcd 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -89,7 +89,7 @@ public:
/* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */
static PALETTE_INIT( jangou )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double weights_rg[3], weights_b[2];
@@ -168,7 +168,7 @@ w [$17]
static UINT8 jangou_gfx_nibble( running_machine &machine, UINT16 niboffset )
{
- const UINT8 *const blit_rom = machine.region("gfx")->base();
+ const UINT8 *const blit_rom = machine.root_device().memregion("gfx")->base();
if (niboffset & 1)
return (blit_rom[(niboffset >> 1) & 0xffff] & 0xf0) >> 4;
@@ -1371,7 +1371,7 @@ static DRIVER_INIT (luckygrl)
{
// this is WRONG
int A;
- UINT8 *ROM = machine.region("cpu0")->base();
+ UINT8 *ROM = machine.root_device().memregion("cpu0")->base();
unsigned char patn1[32] = {
0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0,
diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c
index 6ceb5dfe048..733bfc2d2f8 100644
--- a/src/mame/drivers/jantotsu.c
+++ b/src/mame/drivers/jantotsu.c
@@ -200,7 +200,7 @@ WRITE8_MEMBER(jantotsu_state::bankaddr_w)
static PALETTE_INIT( jantotsu )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2, r, g, b;
int i;
@@ -300,7 +300,7 @@ static void jan_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index 53d91ac59dd..cbf6caa1ad5 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -394,8 +394,8 @@ static SCREEN_UPDATE_IND16(jchan)
state->m_sprite_bitmap_1->fill(0x0000, cliprect);
state->m_sprite_bitmap_2->fill(0x0000, cliprect);
- state->m_spritegen1->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_sprite_regs32_1 );
- state->m_spritegen2->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen.machine().region("gfx2")->base(), screen.machine().region ("gfx2")->bytes(), state->m_sprite_regs32_2 );
+ state->m_spritegen1->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), state->m_sprite_regs32_1 );
+ state->m_spritegen2->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen.machine().root_device().memregion("gfx2")->base(), state->memregion ("gfx2")->bytes(), state->m_sprite_regs32_2 );
// ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes
for (y=0;y<240;y++)
diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c
index a590bf4d13c..33f76fc495e 100644
--- a/src/mame/drivers/jedi.c
+++ b/src/mame/drivers/jedi.c
@@ -162,7 +162,7 @@ static MACHINE_START( jedi )
state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(32), 32);
/* configure the banks */
- state->membank("bank1")->configure_entries(0, 3, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 3, state->memregion("maincpu")->base() + 0x10000, 0x4000);
/* set up save state */
state->save_item(NAME(state->m_nvram_enabled));
diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c
index 40945cb4308..14bfd7238a8 100644
--- a/src/mame/drivers/jokrwild.c
+++ b/src/mame/drivers/jokrwild.c
@@ -553,7 +553,7 @@ static DRIVER_INIT( jokrwild )
*****************************************************************************/
{
int i, offs;
- UINT8 *srcp = machine.region( "maincpu" )->base();
+ UINT8 *srcp = machine.root_device().memregion( "maincpu" )->base();
for (i = 0x8000; i < 0x10000; i++)
{
diff --git a/src/mame/drivers/jollyjgr.c b/src/mame/drivers/jollyjgr.c
index 0ca9bed75be..5b99e4dd576 100644
--- a/src/mame/drivers/jollyjgr.c
+++ b/src/mame/drivers/jollyjgr.c
@@ -402,7 +402,7 @@ INPUT_PORTS_END
static PALETTE_INIT( jollyjgr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* tilemap / sprites palette */
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index 44f98d71e19..e96d0cb2755 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -430,7 +430,7 @@ INPUT_PORTS_END
static PALETTE_INIT(jongkyo)
{
int i;
- UINT8* proms = machine.region("proms")->base();
+ UINT8* proms = machine.root_device().memregion("proms")->base();
for (i = 0; i < 0x40; i++)
{
int data = proms[i];
@@ -550,7 +550,7 @@ ROM_END
static DRIVER_INIT( jongkyo )
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* first of all, do a simple bitswap */
for (i = 0x6000; i < 0x9000; ++i)
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index 5e3acbb1fbb..5de9eccc62e 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -5449,8 +5449,8 @@ DRIVER_INIT( j6fbcrz )
int i;
- UINT8 *src1 = machine.region( "maincpu" )->base();
- UINT8 *src2 = machine.region( "encrypted" )->base();
+ UINT8 *src1 = machine.root_device().memregion( "maincpu" )->base();
+ UINT8 *src2 = machine.root_device().memregion( "encrypted" )->base();
for (i=0;i<0x040000;i++)
{
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index 64345535658..3a10138f822 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -249,7 +249,7 @@ static void sys5_draw_lamps(jpmsys5_state *state)
WRITE16_MEMBER(jpmsys5_state::rombank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
data &= 0x1f;
membank("bank1")->set_base(&rom[0x20000 + 0x20000 * data]);
}
@@ -643,7 +643,7 @@ static ACIA6850_INTERFACE( acia2_if )
static MACHINE_START( jpmsys5v )
{
jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base()+0x20000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base()+0x20000);
state->m_touch_timer = machine.scheduler().timer_alloc(FUNC(touch_cb));
}
@@ -794,7 +794,7 @@ INPUT_PORTS_END
static MACHINE_START( jpmsys5 )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base()+0x20000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base()+0x20000);
}
static MACHINE_RESET( jpmsys5 )
diff --git a/src/mame/drivers/jrpacman.c b/src/mame/drivers/jrpacman.c
index 98f2e54d0cd..33b909af22d 100644
--- a/src/mame/drivers/jrpacman.c
+++ b/src/mame/drivers/jrpacman.c
@@ -392,7 +392,7 @@ static DRIVER_INIT( jrpacman )
{ 0,0 }
};
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i, j, A;
for (i = A = 0; table[i].count; i++)
diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c
index c8c92895c77..8169bfa03b5 100644
--- a/src/mame/drivers/junofrst.c
+++ b/src/mame/drivers/junofrst.c
@@ -143,7 +143,7 @@ WRITE8_MEMBER(junofrst_state::junofrst_blitter_w)
if (offset == 3)
{
int i;
- UINT8 *gfx_rom = machine().region("gfx1")->base();
+ UINT8 *gfx_rom = memregion("gfx1")->base();
offs_t src = ((m_blitterdata[2] << 8) | m_blitterdata[3]) & 0xfffc;
offs_t dest = (m_blitterdata[0] << 8) | m_blitterdata[1];
@@ -529,7 +529,7 @@ static DRIVER_INIT( junofrst )
{
UINT8 *decrypted = konami1_decode(machine, "maincpu");
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x1000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypted + 0x10000, 0x1000);
}
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index 2faa2401a67..487fdd756a5 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -807,8 +807,8 @@ ADDRESS_MAP_END
static void kaneko16_common_oki_bank_w( running_machine& machine, const char *bankname, const char* tag, int bank, size_t fixedsize, size_t bankedsize )
{
UINT32 bankaddr;
- UINT8* samples = machine.region(tag)->base();
- size_t length = machine.region(tag)->bytes();
+ UINT8* samples = machine.root_device().memregion(tag)->base();
+ size_t length = machine.root_device().memregion(tag)->bytes();
bankaddr = fixedsize + (bankedsize * bank);
@@ -2235,8 +2235,8 @@ MACHINE_CONFIG_END
*/
static void kaneko16_unscramble_tiles(running_machine &machine, const char *region)
{
- UINT8 *RAM = machine.region(region)->base();
- int size = machine.region(region)->bytes();
+ UINT8 *RAM = machine.root_device().memregion(region)->base();
+ int size = machine.root_device().memregion(region)->bytes();
int i;
if (RAM == NULL) return;
@@ -2261,11 +2261,11 @@ static void kaneko16_expand_sample_banks(running_machine &machine, const char *r
int bank;
UINT8 *src0;
- if (machine.region(region)->bytes() < 0x40000 * 16)
+ if (machine.root_device().memregion(region)->bytes() < 0x40000 * 16)
fatalerror("gtmr SOUND1 region too small");
/* bank 0 maps to itself, so we just leave it alone */
- src0 = machine.region(region)->base();
+ src0 = machine.root_device().memregion(region)->base();
for (bank = 15; bank > 0; bank--)
{
UINT8 *srcn = src0 + 0x10000 * (bank < 3 ? 3 : bank);
diff --git a/src/mame/drivers/kangaroo.c b/src/mame/drivers/kangaroo.c
index ac05cbeb75d..1ffa9c7e762 100644
--- a/src/mame/drivers/kangaroo.c
+++ b/src/mame/drivers/kangaroo.c
@@ -174,7 +174,7 @@
static MACHINE_START( kangaroo )
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("gfx1")->base(), 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("gfx1")->base(), 0x2000);
}
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 5c004211321..602d3317c67 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -1153,7 +1153,7 @@ static DRIVER_INIT( wndrplnt )
static DRIVER_INIT( chelnov )
{
karnov_state *state = machine.driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
state->m_microcontroller_id = CHELNOV;
state->m_coin_mask = 0xe0;
@@ -1164,7 +1164,7 @@ static DRIVER_INIT( chelnov )
static DRIVER_INIT( chelnovu )
{
karnov_state *state = machine.driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
state->m_microcontroller_id = CHELNOVU;
state->m_coin_mask = 0xe0;
@@ -1175,7 +1175,7 @@ static DRIVER_INIT( chelnovu )
static DRIVER_INIT( chelnovj )
{
karnov_state *state = machine.driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)state->memregion("maincpu")->base();
state->m_microcontroller_id = CHELNOVJ;
state->m_coin_mask = 0xe0;
diff --git a/src/mame/drivers/kas89.c b/src/mame/drivers/kas89.c
index 33e9d400085..56343a269f0 100644
--- a/src/mame/drivers/kas89.c
+++ b/src/mame/drivers/kas89.c
@@ -865,8 +865,8 @@ ROM_END
static DRIVER_INIT(kas89)
{
int i;
- UINT8 *mem = machine.region("maincpu")->base();
- int memsize = machine.region("maincpu")->bytes();
+ UINT8 *mem = machine.root_device().memregion("maincpu")->base();
+ int memsize = machine.root_device().memregion("maincpu")->bytes();
UINT8 *buf;
/* Unscrambling data lines */
diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c
index 0fa6c6f5ebd..ed4a505a1f6 100644
--- a/src/mame/drivers/kchamp.c
+++ b/src/mame/drivers/kchamp.c
@@ -724,7 +724,7 @@ static UINT8 *decrypt_code(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
space->set_decrypted_region(0x0000, 0xffff, decrypted);
@@ -739,7 +739,7 @@ static UINT8 *decrypt_code(running_machine &machine)
static DRIVER_INIT( kchampvs )
{
kchamp_state *state = machine.driver_data<kchamp_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
UINT8 *decrypted = decrypt_code(machine);
int A;
diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c
index ee1b7f2b160..e7f1b5717e9 100644
--- a/src/mame/drivers/kickgoal.c
+++ b/src/mame/drivers/kickgoal.c
@@ -810,7 +810,7 @@ ROM_END
static DRIVER_INIT( kickgoal )
{
#if 0 /* we should find a real fix instead */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/* fix "bug" that prevents game from writing to EEPROM */
rom[0x12b0/2] = 0x0001;
diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c
index 0ed35509b28..bb1a27465ce 100644
--- a/src/mame/drivers/kingdrby.c
+++ b/src/mame/drivers/kingdrby.c
@@ -954,7 +954,7 @@ static const ym2203_interface cowrace_ym2203_interface =
static PALETTE_INIT(kingdrby)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
@@ -980,8 +980,8 @@ static PALETTE_INIT(kingdrby)
static PALETTE_INIT(kingdrbb)
{
- UINT8 *raw_prom = machine.region("raw_prom")->base();
- UINT8 *prom = machine.region("proms")->base();
+ UINT8 *raw_prom = machine.root_device().memregion("raw_prom")->base();
+ UINT8 *prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c
index a3b8a5b1bb7..3eb46b22e01 100644
--- a/src/mame/drivers/kingobox.c
+++ b/src/mame/drivers/kingobox.c
@@ -788,7 +788,7 @@ ROM_END
static DRIVER_INIT( ringking3 )
{
int i;
- UINT8 *RAM = machine.region("proms")->base();
+ UINT8 *RAM = machine.root_device().memregion("proms")->base();
/* expand the first color PROM to look like the kingofb ones... */
for (i = 0; i < 0x100; i++)
@@ -798,8 +798,8 @@ static DRIVER_INIT( ringking3 )
static DRIVER_INIT( ringkingw )
{
int i,j,k;
- UINT8 *PROMS = machine.region("proms")->base();
- UINT8 *USER1 = machine.region("user1")->base();
+ UINT8 *PROMS = machine.root_device().memregion("proms")->base();
+ UINT8 *USER1 = machine.root_device().memregion("user1")->base();
/* change the PROMs encode in a simple format to use kingofb decode */
for(i = 0, j = 0; j < 0x40; i++, j++)
diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c
index 210188748b4..6c1890e00dd 100644
--- a/src/mame/drivers/kingpin.c
+++ b/src/mame/drivers/kingpin.c
@@ -178,7 +178,7 @@ static DRIVER_INIT( kingpin )
kingpin_state *state = machine.driver_data<kingpin_state>();
/* Hacks to keep the emu a'runnin */
- state->m_code_base = machine.region("maincpu")->base();
+ state->m_code_base = state->memregion("maincpu")->base();
state->m_code_base[0x17d4] = 0xc3; /* Maybe sound related? */
}
diff --git a/src/mame/drivers/koikoi.c b/src/mame/drivers/koikoi.c
index d9e496079c6..4a934376a91 100644
--- a/src/mame/drivers/koikoi.c
+++ b/src/mame/drivers/koikoi.c
@@ -87,7 +87,7 @@ static TILE_GET_INFO( get_tile_info )
static PALETTE_INIT( koikoi )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c
index 412b3dbedd9..e79677c37f7 100644
--- a/src/mame/drivers/konamigq.c
+++ b/src/mame/drivers/konamigq.c
@@ -321,7 +321,7 @@ static DRIVER_INIT( konamigq )
psx_driver_init(machine);
- state->m_p_n_pcmram = machine.region( "shared" )->base() + 0x80000;
+ state->m_p_n_pcmram = state->memregion( "shared" )->base() + 0x80000;
}
static void konamigq_exit(running_machine &machine)
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index d2b3507c7fa..44a9c93131a 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -923,14 +923,14 @@ READ32_MEMBER(konamigx_state::gx6bppspr_r)
READ32_MEMBER(konamigx_state::type1_roz_r1)
{
- UINT32 *ROM = (UINT32 *)machine().region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)machine().root_device().memregion("gfx3")->base();
return ROM[offset];
}
READ32_MEMBER(konamigx_state::type1_roz_r2)
{
- UINT32 *ROM = (UINT32 *)machine().region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)machine().root_device().memregion("gfx3")->base();
ROM += (0x600000/2);
@@ -3754,7 +3754,7 @@ static DRIVER_INIT(konamigx)
case 2: // tkmmpzdm hack
{
- UINT32 *rom = (UINT32*)machine.region("maincpu")->base();
+ UINT32 *rom = (UINT32*)state->memregion("maincpu")->base();
// The display is initialized after POST but the copyright screen disabled
// planes B,C,D and didn't bother restoring them. I've spent a good
diff --git a/src/mame/drivers/konendev.c b/src/mame/drivers/konendev.c
index 0ff5bd01e8d..c437f5f2c7d 100644
--- a/src/mame/drivers/konendev.c
+++ b/src/mame/drivers/konendev.c
@@ -161,8 +161,8 @@ ROM_END
DRIVER_INIT( konendev )
{
- UINT8 *src = machine.region( "maincpu" )->base();
- size_t srcsize = machine.region( "maincpu" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
+ size_t srcsize = machine.root_device().memregion( "maincpu" )->bytes();
for (int i = 0; i < srcsize; i += 2)
{
int temp = src[i];
diff --git a/src/mame/drivers/ksayakyu.c b/src/mame/drivers/ksayakyu.c
index 22ec7d30e93..8f538067c7d 100644
--- a/src/mame/drivers/ksayakyu.c
+++ b/src/mame/drivers/ksayakyu.c
@@ -250,7 +250,7 @@ GFXDECODE_END
static MACHINE_START( ksayakyu )
{
ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c
index a27d747c70c..a12a7971dfe 100644
--- a/src/mame/drivers/kungfur.c
+++ b/src/mame/drivers/kungfur.c
@@ -191,7 +191,7 @@ static WRITE8_DEVICE_HANDLER( kungfur_adpcm2_w )
static void kfr_adpcm1_int(device_t *device)
{
kungfur_state *state = device->machine().driver_data<kungfur_state>();
- UINT8 *ROM = device->machine().region("adpcm1")->base();
+ UINT8 *ROM = state->memregion("adpcm1")->base();
UINT8 data = ROM[state->m_adpcm_pos[0] & 0x1ffff];
msm5205_data_w(device, state->m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf);
@@ -202,7 +202,7 @@ static void kfr_adpcm1_int(device_t *device)
static void kfr_adpcm2_int(device_t *device)
{
kungfur_state *state = device->machine().driver_data<kungfur_state>();
- UINT8 *ROM = device->machine().region("adpcm2")->base();
+ UINT8 *ROM = state->memregion("adpcm2")->base();
UINT8 data = ROM[state->m_adpcm_pos[1] & 0x3ffff];
msm5205_data_w(device, state->m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf);
diff --git a/src/mame/drivers/labyrunr.c b/src/mame/drivers/labyrunr.c
index feee71d1a19..49a3e6bbbf9 100644
--- a/src/mame/drivers/labyrunr.c
+++ b/src/mame/drivers/labyrunr.c
@@ -180,7 +180,7 @@ static const ym2203_interface ym2203_interface_2 =
static MACHINE_START( labyrunr )
{
labyrunr_state *state = machine.driver_data<labyrunr_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index 5db4a857dd8..adbf04633da 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -1045,8 +1045,8 @@ static DRIVER_INIT( dorodon )
offs_t i;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x6000);
- UINT8 *rom = machine.region("maincpu")->base();
- UINT8 *table = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT8 *table = machine.root_device().memregion("user1")->base();
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c
index 71384b2c684..ace6812dcc3 100644
--- a/src/mame/drivers/lastduel.c
+++ b/src/mame/drivers/lastduel.c
@@ -479,7 +479,7 @@ static MACHINE_START( lastduel )
static MACHINE_START( madgear )
{
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index eeafb46f5c6..ef99e215c11 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -148,7 +148,7 @@ static SCREEN_UPDATE_IND16( lastfght )
#if 1
// gfx roms viewer (toggle with enter, use pgup/down to browse)
int x, y, count = 0;
- UINT8 *gfxdata = screen.machine().region("gfx1")->base();
+ UINT8 *gfxdata = screen.machine().root_device().memregion("gfx1")->base();
UINT8 data;
if (screen.machine().input().code_pressed_once(KEYCODE_ENTER)) state->m_view_roms ^= 1;
@@ -156,7 +156,7 @@ static SCREEN_UPDATE_IND16( lastfght )
{
if (screen.machine().input().code_pressed_once(KEYCODE_PGDN)) state->m_base += 512 * 256;
if (screen.machine().input().code_pressed_once(KEYCODE_PGUP)) state->m_base -= 512 * 256;
- state->m_base %= screen.machine().region("gfx1")->bytes();
+ state->m_base %= state->memregion("gfx1")->bytes();
count = state->m_base;
@@ -330,7 +330,7 @@ WRITE16_MEMBER(lastfght_state::lastfght_blit_w)
if (ACCESSING_BITS_8_15)
{
int x, y, addr;
- UINT8 *gfxdata = machine().region( "gfx1" )->base();
+ UINT8 *gfxdata = memregion( "gfx1" )->base();
bitmap_ind16 &dest = m_bitmap[m_dest];
#if 0
@@ -621,7 +621,7 @@ ROM_END
static DRIVER_INIT(lastfght)
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
// pass initial check (protection ? hw?)
rom[0x00354 / 2] = 0x403e;
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index a01a486508e..17d46d8f15c 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -789,7 +789,7 @@ ROM_END
static DRIVER_INIT( lazercmd )
{
int i, y;
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -818,7 +818,7 @@ static DRIVER_INIT( lazercmd )
static DRIVER_INIT( medlanes )
{
int i, y;
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -847,7 +847,7 @@ static DRIVER_INIT( medlanes )
static DRIVER_INIT( bbonk )
{
int i, y;
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
diff --git a/src/mame/drivers/legionna.c b/src/mame/drivers/legionna.c
index 29f62078ed3..d7373da40af 100644
--- a/src/mame/drivers/legionna.c
+++ b/src/mame/drivers/legionna.c
@@ -2188,7 +2188,7 @@ ROM_END
static DRIVER_INIT( cupsoc )
{
#if CUPSOC_DEBUG_MODE
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/*Press p1 button 3 to enter into debug mode during gameplay*/
ROM[0xffffb/2] = 0x0000;
@@ -2200,13 +2200,13 @@ static DRIVER_INIT( cupsoc )
static DRIVER_INIT( denjinmk )
{
/* problem with audio comms? */
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
ROM[0x5fe4/2] = 0x4e71;
}
static DRIVER_INIT( legiongfx )
{
- descramble_legionnaire_gfx( machine, machine.region("gfx5")->base() );
+ descramble_legionnaire_gfx( machine, machine.root_device().memregion("gfx5")->base() );
}
diff --git a/src/mame/drivers/leland.c b/src/mame/drivers/leland.c
index 498c22f6fe6..e8d0f668c68 100644
--- a/src/mame/drivers/leland.c
+++ b/src/mame/drivers/leland.c
@@ -1995,9 +1995,9 @@ static DRIVER_INIT( cerberus )
leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->m_update_master_bank = cerberus_bankswitch;
- state->membank("bank1")->set_base(machine.region("master")->base() + 0x2000);
- state->membank("bank2")->set_base(machine.region("master")->base() + 0xa000);
- state->membank("bank3")->set_base(machine.region("slave")->base() + 0x2000);
+ state->membank("bank1")->set_base(state->memregion("master")->base() + 0x2000);
+ state->membank("bank2")->set_base(state->memregion("master")->base() + 0xa000);
+ state->membank("bank3")->set_base(state->memregion("slave")->base() + 0x2000);
/* set up the master CPU I/O ports */
init_master_ports(machine, 0x40, 0x80);
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index 2b20e85ab1e..06f327b9aa3 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -579,7 +579,7 @@ static const k054539_interface k054539_config =
static MACHINE_START( lethalen )
{
lethal_state *state = machine.driver_data<lethal_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 0x20, &ROM[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
@@ -601,7 +601,7 @@ static MACHINE_START( lethalen )
static MACHINE_RESET( lethalen )
{
lethal_state *state = machine.driver_data<lethal_state>();
- UINT8 *prgrom = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 *prgrom = (UINT8 *)state->memregion("maincpu")->base();
int i;
state->membank("bank2")->set_base(&prgrom[0x48000]);
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 7f720f14f0d..453c7b21afe 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -27,7 +27,7 @@
READ8_MEMBER(liberate_state::deco16_bank_r)
{
- const UINT8 *ROM = machine().region("user1")->base();
+ const UINT8 *ROM = memregion("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (m_bank)
@@ -76,7 +76,7 @@ WRITE8_MEMBER(liberate_state::deco16_bank_w)
READ8_MEMBER(liberate_state::prosoccr_bank_r)
{
- const UINT8 *ROM = machine().region("user1")->base();
+ const UINT8 *ROM = memregion("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (m_bank)
@@ -105,7 +105,7 @@ READ8_MEMBER(liberate_state::prosoccr_bank_r)
READ8_MEMBER(liberate_state::prosoccr_charram_r)
{
- UINT8 *SRC_GFX = machine().region("shared_gfx")->base();
+ UINT8 *SRC_GFX = memregion("shared_gfx")->base();
if (m_gfx_rom_readback)
{
@@ -126,7 +126,7 @@ READ8_MEMBER(liberate_state::prosoccr_charram_r)
WRITE8_MEMBER(liberate_state::prosoccr_charram_w)
{
- UINT8 *FG_GFX = machine().region("fg_gfx")->base();
+ UINT8 *FG_GFX = memregion("fg_gfx")->base();
if (m_bank)
{
@@ -182,7 +182,7 @@ WRITE8_MEMBER(liberate_state::prosoccr_io_bank_w)
READ8_MEMBER(liberate_state::prosport_charram_r)
{
- UINT8 *FG_GFX = machine().region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = memregion("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -202,7 +202,7 @@ READ8_MEMBER(liberate_state::prosport_charram_r)
WRITE8_MEMBER(liberate_state::prosport_charram_w)
{
- UINT8 *FG_GFX = machine().region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = memregion("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -1350,7 +1350,7 @@ static void sound_cpu_decrypt(running_machine &machine)
{
address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
int i;
/* Bit swapping on sound cpu - Opcodes only */
@@ -1362,7 +1362,7 @@ static void sound_cpu_decrypt(running_machine &machine)
static DRIVER_INIT( prosport )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i;
/* Main cpu has the nibbles swapped */
@@ -1384,7 +1384,7 @@ static DRIVER_INIT( liberate )
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
space->set_decrypted_region(0x0000, 0xffff, decrypted);
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 3b89928ee6f..d9a2b3b018d 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -371,8 +371,8 @@ static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectan
limenko_state *state = machine.driver_data<limenko_state>();
int i;
- UINT8 *base_gfx = machine.region("gfx1")->base();
- UINT8 *gfx_max = base_gfx + machine.region("gfx1")->bytes();
+ UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT8 *gfx_max = base_gfx + state->memregion("gfx1")->bytes();
UINT8 *gfxdata;
gfx_element gfx(machine);
@@ -1066,8 +1066,8 @@ static DRIVER_INIT( sb2003 )
static DRIVER_INIT( spotty )
{
limenko_state *state = machine.driver_data<limenko_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src = machine.region("user2")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src = state->memregion("user2")->base();
int x;
/* expand 4bpp roms to 8bpp space */
diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c
index 7ce627c7279..172722d1d2e 100644
--- a/src/mame/drivers/littlerb.c
+++ b/src/mame/drivers/littlerb.c
@@ -503,7 +503,7 @@ static TIMER_DEVICE_CALLBACK( littlerb_scanline )
if((scanline % 2) == 0)
{
UINT8 res;
- UINT8 *sample_rom = timer.machine().region("samples")->base();
+ UINT8 *sample_rom = state->memregion("samples")->base();
res = sample_rom[state->m_sound_pointer_l|(state->m_sound_index_l<<10)|0x40000];
dac_signed_w(state->m_dacl, 0, res);
diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c
index 43949d9839c..3714506f895 100644
--- a/src/mame/drivers/lkage.c
+++ b/src/mame/drivers/lkage.c
@@ -159,7 +159,7 @@ ADDRESS_MAP_END
READ8_MEMBER(lkage_state::port_fetch_r)
{
- return machine().region("user1")->base()[offset];
+ return memregion("user1")->base()[offset];
}
static ADDRESS_MAP_START( lkage_io_map, AS_IO, 8, lkage_state )
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index dd1ad19aab5..4fa2113f8c3 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -145,7 +145,7 @@ public:
static PALETTE_INIT( looping )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -900,8 +900,8 @@ ROM_END
static DRIVER_INIT( looping )
{
looping_state *state = machine.driver_data<looping_state>();
- int length = machine.region("maincpu")->bytes();
- UINT8 *rom = machine.region("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
state->m_cop_io = auto_alloc_array(machine, UINT8, 0x08);
diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c
index 924fd5843cc..cab22273790 100644
--- a/src/mame/drivers/lordgun.c
+++ b/src/mame/drivers/lordgun.c
@@ -57,7 +57,7 @@ Notes:
static DRIVER_INIT( lordgun )
{
int i;
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Decryption
@@ -82,7 +82,7 @@ static DRIVER_INIT( lordgun )
// From XingXing:
static DRIVER_INIT( aliencha )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Protection
@@ -106,7 +106,7 @@ static DRIVER_INIT( aliencha )
static DRIVER_INIT( alienchac )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// Protection
diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c
index f4a022ca0de..d2bd2c26261 100644
--- a/src/mame/drivers/lsasquad.c
+++ b/src/mame/drivers/lsasquad.c
@@ -567,7 +567,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lsasquad )
{
lsasquad_state *state = machine.driver_data<lsasquad_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/ltcasino.c b/src/mame/drivers/ltcasino.c
index 7bd9f2876c7..fa56a9e384c 100644
--- a/src/mame/drivers/ltcasino.c
+++ b/src/mame/drivers/ltcasino.c
@@ -712,7 +712,7 @@ ROM_END
static DRIVER_INIT(mv4in1)
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for(i=0;i<0x10000;i++)
rom[i]=BITSWAP8(rom[i],7,6,5,4,3,1,2,0);
}
diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c
index 6e248b35d5c..343500bca5a 100644
--- a/src/mame/drivers/luckgrln.c
+++ b/src/mame/drivers/luckgrln.c
@@ -1026,7 +1026,7 @@ static DRIVER_INIT( luckgrln )
{
int i;
UINT8 x,v;
- UINT8* rom = machine.region("rom_data")->base();
+ UINT8* rom = machine.root_device().memregion("rom_data")->base();
for (i=0;i<0x20000;i++)
{
diff --git a/src/mame/drivers/lucky74.c b/src/mame/drivers/lucky74.c
index b0e2a698acf..a01160a575e 100644
--- a/src/mame/drivers/lucky74.c
+++ b/src/mame/drivers/lucky74.c
@@ -1130,7 +1130,7 @@ static void lucky74_adpcm_int(device_t *device)
if (state->m_adpcm_data == -1)
{
/* transferring 1st nibble */
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
diff --git a/src/mame/drivers/lwings.c b/src/mame/drivers/lwings.c
index 4667aff3772..a7b76ff0a1f 100644
--- a/src/mame/drivers/lwings.c
+++ b/src/mame/drivers/lwings.c
@@ -748,7 +748,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( lwings )
{
lwings_state *state = machine.driver_data<lwings_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index 79b7dff39d8..19fda4eb463 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -964,7 +964,7 @@ ROM_END
static DRIVER_INIT( firebarr )
{
m107_state *state = machine.driver_data<m107_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
@@ -975,7 +975,7 @@ static DRIVER_INIT( firebarr )
static DRIVER_INIT( dsoccr94 )
{
m107_state *state = machine.driver_data<m107_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x07, write16_delegate(FUNC(m107_state::m107_bankswitch_w),state));
diff --git a/src/mame/drivers/m58.c b/src/mame/drivers/m58.c
index 4d2a22ff802..234a0f366f0 100644
--- a/src/mame/drivers/m58.c
+++ b/src/mame/drivers/m58.c
@@ -434,7 +434,7 @@ static DRIVER_INIT( yard85 )
// on these sets the content of the sprite color PROM needs reversing
// are the proms on the other sets from bootleg boards, or hand modified?
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x10);
- UINT8* region = machine.region("proms")->base();
+ UINT8* region = machine.root_device().memregion("proms")->base();
int i;
for (i=0;i<0x10;i++)
diff --git a/src/mame/drivers/m62.c b/src/mame/drivers/m62.c
index d269fec3eb3..415360141f8 100644
--- a/src/mame/drivers/m62.c
+++ b/src/mame/drivers/m62.c
@@ -2158,50 +2158,50 @@ ROM_END
static DRIVER_INIT( battroad )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun2 )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun4 )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( kidniki )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
/* in Kid Niki, bank 0 has code falling from 7fff to 8000, */
/* so I have to copy it there because bank switching wouldn't catch it */
memcpy(ROM + 0x08000, ROM + 0x10000, 0x2000);
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunkr )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunk2 )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x20000, 0x1000);
- machine.root_device().membank("bank2")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x20000, 0x1000);
+ machine.root_device().membank("bank2")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x1000);
}
static DRIVER_INIT( youjyudn )
{
/* configure memory banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
GAME( 1984, kungfum, 0, kungfum, kungfum, 0, ROT0, "Irem", "Kung-Fu Master", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index e8b30cf375b..7ff4bf2df6e 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -180,7 +180,7 @@ public:
static PALETTE_INIT( m63 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 256; i++)
@@ -432,7 +432,7 @@ READ8_MEMBER(m63_state::snddata_r)
switch (m_p2 & 0xf0)
{
case 0x60: return soundlatch_byte_r(space, 0); ;
- case 0x70: return machine().region("user1")->base()[((m_p1 & 0x1f) << 8) | offset];
+ case 0x70: return memregion("user1")->base()[((m_p1 & 0x1f) << 8) | offset];
}
return 0xff;
}
@@ -696,8 +696,8 @@ static SAMPLES_START( fghtbskt_sh_start )
{
running_machine &machine = device.machine();
m63_state *state = machine.driver_data<m63_state>();
- int i, len = machine.region("samples")->bytes();
- UINT8 *ROM = machine.region("samples")->base();
+ int i, len = machine.root_device().memregion("samples")->bytes();
+ UINT8 *ROM = state->memregion("samples")->base();
state->m_samplebuf = auto_alloc_array(machine, INT16, len);
state->save_pointer(NAME(state->m_samplebuf), len);
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index f406b34544b..b726b3724a3 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -299,7 +299,7 @@ static INTERRUPT_GEN( m72_mcu_int )
READ8_MEMBER(m72_state::m72_mcu_sample_r)
{
UINT8 sample;
- sample = machine().region("samples")->base()[m_mcu_sample_addr++];
+ sample = memregion("samples")->base()[m_mcu_sample_addr++];
return sample;
}
@@ -383,7 +383,7 @@ INLINE DRIVER_INIT( m72_8751 )
* prefetching on the V30.
*/
{
- UINT8 *rom=machine.region("mcu")->base();
+ UINT8 *rom=state->memregion("mcu")->base();
rom[0x12d+5] += 1; printf(" 5: %d\n", rom[0x12d+5]);
rom[0x12d+8] += 5; printf(" 8: %d\n", rom[0x12d+8]);
@@ -423,8 +423,8 @@ the NMI handler in the other games.
#if 0
static int find_sample(int num)
{
- UINT8 *rom = machine.region("samples")->base();
- int len = machine.region("samples")->bytes();
+ UINT8 *rom = machine.root_device().memregion("samples")->base();
+ int len = machine.root_device().memregion("samples")->bytes();
int addr = 0;
while (num--)
diff --git a/src/mame/drivers/m79amb.c b/src/mame/drivers/m79amb.c
index 2144f5e0231..88ed1232a38 100644
--- a/src/mame/drivers/m79amb.c
+++ b/src/mame/drivers/m79amb.c
@@ -290,7 +290,7 @@ static const UINT8 lut_pos[0x20] = {
static DRIVER_INIT( m79amb )
{
m79amb_state *state = machine.driver_data<m79amb_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i, j;
/* PROM data is active low */
diff --git a/src/mame/drivers/m90.c b/src/mame/drivers/m90.c
index 746577e1c46..1ed445f4dd6 100644
--- a/src/mame/drivers/m90.c
+++ b/src/mame/drivers/m90.c
@@ -1186,7 +1186,7 @@ ROM_END
static DRIVER_INIT( quizf1 )
{
m90_state *state = machine.driver_data<m90_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("user1")->base(), 0x10000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("user1")->base(), 0x10000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x04, 0x05, write16_delegate(FUNC(m90_state::quizf1_bankswitch_w),state));
}
@@ -1194,7 +1194,7 @@ static DRIVER_INIT( quizf1 )
static DRIVER_INIT( bomblord )
{
- UINT16 *ROM = (UINT16 *)(machine.region("maincpu")->base());
+ UINT16 *ROM = (UINT16 *)(machine.root_device().memregion("maincpu")->base());
for (int i = 0; i < 0x100000 / 2; i += 4)
{
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index 0caf2d38ef6..da2c8105393 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -252,14 +252,14 @@ static TIMER_DEVICE_CALLBACK( m92_scanline_interrupt )
READ16_MEMBER(m92_state::m92_eeprom_r)
{
- UINT8 *RAM = machine().region("eeprom")->base();
+ UINT8 *RAM = memregion("eeprom")->base();
// logerror("%05x: EEPROM RE %04x\n",cpu_get_pc(&space.device()),offset);
return RAM[offset] | 0xff00;
}
WRITE16_MEMBER(m92_state::m92_eeprom_w)
{
- UINT8 *RAM = machine().region("eeprom")->base();
+ UINT8 *RAM = memregion("eeprom")->base();
// logerror("%05x: EEPROM WR %04x\n",cpu_get_pc(&space.device()),offset);
if (ACCESSING_BITS_0_7)
RAM[offset] = data;
@@ -2060,7 +2060,7 @@ ROM_END
static DRIVER_INIT( m92 )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
@@ -2072,7 +2072,7 @@ static DRIVER_INIT( m92 )
static DRIVER_INIT( m92_alt )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
@@ -2093,7 +2093,7 @@ static DRIVER_INIT( lethalth )
static DRIVER_INIT( m92_bank )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),state));
@@ -2106,7 +2106,7 @@ static DRIVER_INIT( m92_bank )
static DRIVER_INIT( majtitl2 )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),state));
@@ -2122,7 +2122,7 @@ static DRIVER_INIT( majtitl2 )
static DRIVER_INIT( ppan )
{
m92_state *state = machine.driver_data<m92_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0xa0000]);
state->m_game_kludge = 0;
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index 2f067cd560c..7e75025615f 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -136,14 +136,14 @@ READ8_MEMBER(macs_state::macs_input_r)
WRITE8_MEMBER(macs_state::macs_rom_bank_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
m_st0016_rom_bank=data;
}
WRITE8_MEMBER(macs_state::macs_output_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
switch(offset)
{
@@ -676,11 +676,11 @@ static MACHINE_RESET(macs)
730E: ED B0 ldir
...
*/
- memcpy(macs_ram1 + 0x0e9f, machine.region("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x1e9f, machine.region("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x0e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x1e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x0800, machine.region("user1")->base()+0x73fa, 0x507);
- memcpy(macs_ram1 + 0x1800, machine.region("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x0800, machine.root_device().memregion("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x1800, state->memregion("user1")->base()+0x73fa, 0x507);
#define MAKEJMP(n,m) macs_ram2[(n) - 0xe800 + 0]=0xc3;\
macs_ram2[(n) - 0xe800 + 1]=(m)&0xff;\
@@ -716,10 +716,10 @@ static MACHINE_RESET(macs)
macs_ram1[0x1ff9]=0x07;
#endif
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 );
+ state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x10000 );
state->membank("bank2")->set_base(macs_ram1+0x800);
state->membank("bank3")->set_base(macs_ram1+0x10000);
- state->membank("bank4")->set_base(machine.region("maincpu")->base() );
+ state->membank("bank4")->set_base(machine.root_device().memregion("maincpu")->base() );
}
static DRIVER_INIT(macs)
diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c
index df6ad4a721d..27f297582f9 100644
--- a/src/mame/drivers/madalien.c
+++ b/src/mame/drivers/madalien.c
@@ -25,7 +25,7 @@ INPUT_CHANGED_MEMBER(madalien_state::coin_inserted)
INLINE UINT8 shift_common(running_machine &machine, UINT8 hi, UINT8 lo)
{
- const UINT8 *table = machine.region("user2")->base();
+ const UINT8 *table = machine.root_device().memregion("user2")->base();
return table[((hi & 0x07) << 8) | lo];
}
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index 00dd08bd381..cd6721acfa9 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -351,7 +351,7 @@ ROM_END
static DRIVER_INIT( madmotor )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0x00000;i < 0x80000;i++)
diff --git a/src/mame/drivers/magicard.c b/src/mame/drivers/magicard.c
index 2ea224832f8..0242ebcec23 100644
--- a/src/mame/drivers/magicard.c
+++ b/src/mame/drivers/magicard.c
@@ -693,7 +693,7 @@ INPUT_PORTS_END
static MACHINE_RESET( magicard )
{
magicard_state *state = machine.driver_data<magicard_state>();
- UINT16 *src = (UINT16*)machine.region("maincpu" )->base();
+ UINT16 *src = (UINT16*)state->memregion("maincpu" )->base();
UINT16 *dst = state->m_magicram;
memcpy (dst, src, 0x80000);
machine.device("maincpu")->reset();
diff --git a/src/mame/drivers/magictg.c b/src/mame/drivers/magictg.c
index f33178a4533..19dc5c8943d 100644
--- a/src/mame/drivers/magictg.c
+++ b/src/mame/drivers/magictg.c
@@ -229,7 +229,7 @@ void magictg_state::machine_start()
void magictg_state::machine_reset()
{
- UINT8 *adsp_boot = (UINT8*)machine().region("adsp")->base();
+ UINT8 *adsp_boot = (UINT8*)machine().root_device().memregion("adsp")->base();
zr36120_reset();
@@ -752,7 +752,7 @@ WRITE16_MEMBER( magictg_state::adsp_control_w )
if (data > 0)
{
address_space* addr_space;
- UINT8* adsp_rom = (UINT8*)space.machine().region("adsp")->base();
+ UINT8* adsp_rom = (UINT8*)space.machine().root_device().memregion("adsp")->base();
UINT32 page = (m_adsp_regs.bdma_control >> 8) & 0xff;
UINT32 dir = (m_adsp_regs.bdma_control >> 2) & 1;
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index 5a5543ddb2a..db4c2fd4aff 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -201,7 +201,7 @@ static MACHINE_START( magtouch )
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, magtouch_set_keyb_int);
- machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.region("game_prg")->base(), 0x8000 );
+ machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.root_device().memregion("game_prg")->base(), 0x8000 );
machine.root_device().membank("rombank")->set_entry(0);
// microtouch_init(machine, magtouch_microtouch_tx_callback, NULL);
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index 91c70118961..1980517236d 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -412,7 +412,7 @@ static const k051960_interface mainevt_k051960_intf =
static MACHINE_START( mainevt )
{
mainevt_state *state = machine.driver_data<mainevt_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/majorpkr.c b/src/mame/drivers/majorpkr.c
index de34566264c..bb091ad7282 100644
--- a/src/mame/drivers/majorpkr.c
+++ b/src/mame/drivers/majorpkr.c
@@ -1083,7 +1083,7 @@ ROM_END
static DRIVER_INIT( majorpkr )
{
- UINT8 * ROM = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 * ROM = (UINT8 *)machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("rom_bank")->configure_entries(0, 4, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index 0ba3c202116..f02522d0558 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -370,7 +370,7 @@ static MACHINE_START( malzak )
{
malzak_state *state = machine.driver_data<malzak_state>();
- state->membank("bank1")->configure_entries(0, 2, machine.region("user2")->base(), 0x400);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("user2")->base(), 0x400);
state->m_s2636_0 = machine.device("s2636_0");
state->m_s2636_1 = machine.device("s2636_1");
diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c
index bffb31df78d..ab35bfbc891 100644
--- a/src/mame/drivers/marinedt.c
+++ b/src/mame/drivers/marinedt.c
@@ -187,7 +187,7 @@ READ8_MEMBER(marinedt_state::marinedt_obj1_x_r)
//xxxx---- unknown
//----xxxx x pos in tile ram
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (RAM[0x430e])
--m_cx;
@@ -445,7 +445,7 @@ GFXDECODE_END
static PALETTE_INIT( marinedt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,b,g;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c
index 3ac72c9aa9d..35fc1ba3bf7 100644
--- a/src/mame/drivers/mastboy.c
+++ b/src/mame/drivers/mastboy.c
@@ -542,7 +542,7 @@ READ8_MEMBER(mastboy_state::banked_ram_r)
if (bank>0x3) // ROM access
{
- UINT8 *src = machine().region( "gfx1" )->base();
+ UINT8 *src = memregion( "gfx1" )->base();
bank &=0x3;
return src[offset+(bank*0x4000)];
}
@@ -558,7 +558,7 @@ READ8_MEMBER(mastboy_state::banked_ram_r)
UINT8 *src;
int bank;
bank = m_bank & 0x7f;
- src = machine().region ( "user1" )->base() + bank * 0x4000;
+ src = memregion ( "user1" )->base() + bank * 0x4000;
return src[offset];
}
}
@@ -997,7 +997,7 @@ ROM_END
static DRIVER_INIT( mastboy )
{
mastboy_state *state = machine.driver_data<mastboy_state>();
- state->m_vram = machine.region( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way
+ state->m_vram = state->memregion( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way
}
GAME( 1991, mastboy, 0, mastboy, mastboy, mastboy, ROT0, "Gaelco", "Master Boy (Spanish, PCB Rev A)", 0 )
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index a9b66c24218..8a8d5c54bcd 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -503,7 +503,7 @@ ROM_END
static DRIVER_INIT( a600xl )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
memcpy( rom + 0x5000, rom + 0xd000, 0x800 );
}
diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c
index de6ab52ed1c..443ab31372f 100644
--- a/src/mame/drivers/maygay1b.c
+++ b/src/mame/drivers/maygay1b.c
@@ -4420,7 +4420,7 @@ static DRIVER_INIT( m1 )
//AM_RANGE(0x2420, 0x2421) AM_WRITE(latch_ch2_w ) // oki
// if there is no OKI region disable writes here, the rom might be missing, so alert user
- UINT8 *okirom = machine.region( "oki" )->base();
+ UINT8 *okirom = machine.root_device().memregion( "oki" )->base();
if (!okirom) {
maygay1b_state *state = machine.driver_data<maygay1b_state>();
@@ -4429,7 +4429,7 @@ static DRIVER_INIT( m1 )
// print out the rom id / header info to give us some hints
// note this isn't always correct, alley cat has 'Calpsyo' still in the ident string?
{
- UINT8 *cpu = machine.region( "maincpu" )->base();
+ UINT8 *cpu = machine.root_device().memregion( "maincpu" )->base();
int base = 0xff20;
for (int i=0;i<14;i++)
{
diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c
index 7b217deb2ec..860a7274494 100644
--- a/src/mame/drivers/mayumi.c
+++ b/src/mame/drivers/mayumi.c
@@ -351,7 +351,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( mayumi )
{
mayumi_state *state = machine.driver_data<mayumi_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index 9215c77586b..8b700dec6b3 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -361,14 +361,14 @@ WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w)/* mazer blazer */
{
m_gfx_rom_bank = data;
- membank("bank1")->set_base(machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
}
WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w_gg)/* great guns */
{
m_gfx_rom_bank = data >> 1;
- membank("bank1")->set_base(machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
}
@@ -411,7 +411,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_cmd_param_r)
READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
{
- UINT8 * rom = machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
+ UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -557,7 +557,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r)
{
- UINT8 * rom = machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
+ UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -1713,7 +1713,7 @@ static DRIVER_INIT( mazerbla )
static DRIVER_INIT( greatgun )
{
mazerbla_state *state = machine.driver_data<mazerbla_state>();
- UINT8 *rom = machine.region("sub2")->base();
+ UINT8 *rom = state->memregion("sub2")->base();
state->m_game_id = GREATGUN;
diff --git a/src/mame/drivers/mcatadv.c b/src/mame/drivers/mcatadv.c
index 3b82e5d07ba..77e4217310e 100644
--- a/src/mame/drivers/mcatadv.c
+++ b/src/mame/drivers/mcatadv.c
@@ -428,7 +428,7 @@ static const ym2610_interface mcatadv_ym2610_interface =
static MACHINE_START( mcatadv )
{
mcatadv_state *state = machine.driver_data<mcatadv_state>();
- UINT8 *ROM = machine.region("soundcpu")->base();
+ UINT8 *ROM = state->memregion("soundcpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank1")->set_entry(1);
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index 9f94a29ca4f..3f111f88b8f 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -1784,9 +1784,6 @@ ROM_START( solarfox )
ROM_LOAD( "sfvid.1b", 0x2000, 0x2000, CRC(78801e83) SHA1(23b5811a03fe4ad576c5313d2205203577300159) )
ROM_LOAD( "sfvid.1d", 0x4000, 0x2000, CRC(4d8445cf) SHA1(fbe427da0e758b79eb2230713f2cd12e6f8bdeb7) )
ROM_LOAD( "sfvid.1e", 0x6000, 0x2000, CRC(3da25495) SHA1(e7b703bc8caca7497af92efc869c6f1b7dbc8bf1) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1814,9 +1811,6 @@ ROM_START( kick )
ROM_LOAD( "2700b-v2.1d", 0x2000, 0x2000, CRC(565ea97d) SHA1(4a30a371ad407bf774cf08bf528f824675383698) )
ROM_LOAD( "2800c-v2.1b", 0x4000, 0x2000, CRC(f3be56a1) SHA1(eb3eb0379a918a2959565572d88f9b0f021d1c2a) )
ROM_LOAD( "2900d-v2.1a", 0x6000, 0x2000, CRC(77da795e) SHA1(ebebc8551e7a7534d89bb8458eb2576713cfbeaf) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( kickman )
@@ -1843,9 +1837,6 @@ ROM_START( kickman )
ROM_LOAD( "2700b-v2.1d", 0x2000, 0x2000, CRC(565ea97d) SHA1(4a30a371ad407bf774cf08bf528f824675383698) )
ROM_LOAD( "2800c-v2.1b", 0x4000, 0x2000, CRC(f3be56a1) SHA1(eb3eb0379a918a2959565572d88f9b0f021d1c2a) )
ROM_LOAD( "2900d-v2.1a", 0x6000, 0x2000, CRC(77da795e) SHA1(ebebc8551e7a7534d89bb8458eb2576713cfbeaf) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( kickc )
@@ -1872,9 +1863,6 @@ ROM_START( kickc )
ROM_LOAD( "2700-b.1d", 0x2000, 0x2000, CRC(78eda36c) SHA1(5cf9da6f364f586f324e7ac529db0dc273498320) )
ROM_LOAD( "2800-c.1b", 0x4000, 0x2000, CRC(c93e0170) SHA1(a7efdb6fd13dccd8d8d10de61b87585828bde6ac) )
ROM_LOAD( "2900-d.1a", 0x6000, 0x2000, CRC(91e59383) SHA1(bf87642cc747f1abbd80c6f529adfa60a1d9bc9e) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1901,9 +1889,6 @@ ROM_START( shollow )
ROM_LOAD( "sh-fg.01", 0x2000, 0x2000, CRC(ba1a38b4) SHA1(cee5f0a66e40c779f1bfbb4bfafe5301385e7dae) )
ROM_LOAD( "sh-fg.02", 0x4000, 0x2000, CRC(6b57f6da) SHA1(71165df59dd5ca037116dc0f46fd4f6aac6dbfd1) )
ROM_LOAD( "sh-fg.03", 0x6000, 0x2000, CRC(37ea9d07) SHA1(82e006b01ee12390308be530d4b68fc2404b6b91) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( shollow2 )
@@ -1929,9 +1914,6 @@ ROM_START( shollow2 )
ROM_LOAD( "sh-fg.01", 0x2000, 0x2000, CRC(ba1a38b4) SHA1(cee5f0a66e40c779f1bfbb4bfafe5301385e7dae) )
ROM_LOAD( "sh-fg.02", 0x4000, 0x2000, CRC(6b57f6da) SHA1(71165df59dd5ca037116dc0f46fd4f6aac6dbfd1) )
ROM_LOAD( "sh-fg.03", 0x6000, 0x2000, CRC(37ea9d07) SHA1(82e006b01ee12390308be530d4b68fc2404b6b91) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
/*
@@ -1962,9 +1944,6 @@ ROM_START( tron )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2001,9 +1980,6 @@ ROM_START( tron2 )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2040,9 +2016,6 @@ ROM_START( tron3 )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2079,9 +2052,6 @@ ROM_START( tron4 )
ROM_LOAD( "vgc.cb1", 0x4000, 0x2000, CRC(3329f9d4) SHA1(11f4d744374e475d2c5b195a9f70888414529dd3) )
ROM_LOAD( "vga.a1", 0x6000, 0x2000, CRC(9743f873) SHA1(71ed80ecd8caaf9fce1d7010f95c4678c9bd7102) )
- ROM_REGION( 0x0020, "proms", 0 ) /* PROM's located on the Super Sound I/O Board (90913) */
- ROM_LOAD( "9860-07axn-axhd.d12", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* N82S123 */
-
ROM_REGION( 0x0005, "scpu_pals", 0) /* PAL's located on the Super CPU Board (90010) */
ROM_LOAD( "0066-313bx-xxqx.a12.bin", 0x0000, 0x0001, NO_DUMP)
ROM_LOAD( "0066-315bx-xxqx.b12.bin", 0x0000, 0x0001, NO_DUMP)
@@ -2113,9 +2083,6 @@ ROM_START( kroozr )
ROM_LOAD( "kozmkvid.1d", 0x2000, 0x2000, CRC(4e23b35b) SHA1(322221ea207ad0eeb0e711f3af473f71b70f7128) )
ROM_LOAD( "kozmkvid.1b", 0x4000, 0x2000, CRC(c6041ba7) SHA1(9bd55f06d360657af5c56062053221dd24027978) )
ROM_LOAD( "kozmkvid.1a", 0x6000, 0x2000, CRC(b57fb0ff) SHA1(e4dde9fb09a0e5051352ba05d776ebbe0cd81504) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2141,9 +2108,6 @@ ROM_START( domino )
ROM_LOAD( "dmanfg1.bin", 0x2000, 0x2000, CRC(16aa4b9b) SHA1(700f7dc3ce20dacce38dc40783b28fc9b4c1443a) )
ROM_LOAD( "dmanfg2.bin", 0x4000, 0x2000, CRC(4a8e76b8) SHA1(563b9db39940060265b771f3b0c4a2055963cf2b) )
ROM_LOAD( "dmanfg3.bin", 0x6000, 0x2000, CRC(1f39257e) SHA1(645f9b7e8bd2254167d15567c3bd577d3a574f7d) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2168,9 +2132,6 @@ ROM_START( wacko )
ROM_LOAD( "wackovid.1d", 0x2000, 0x2000, CRC(a02f1672) SHA1(1d1b7eada4dae5e31dc1474b13cefd71926cbfc7) )
ROM_LOAD( "wackovid.1b", 0x4000, 0x2000, CRC(7d899790) SHA1(aa320f4ac41d2a1acec4880a8d95dfe6406e210e) )
ROM_LOAD( "wackovid.1a", 0x6000, 0x2000, CRC(080be3ad) SHA1(ead2be17d749a15841123e42d434aab573870fba) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2195,9 +2156,6 @@ ROM_START( twotiger )
ROM_LOAD( "vid_c1", 0x2000, 0x2000, CRC(62ed737b) SHA1(954c1f17da2ceb77e710faf0822d29381b873a07) )
ROM_LOAD( "vid_b1", 0x4000, 0x2000, CRC(0939921e) SHA1(f52d3475232557959e501f70765a4ad472300e84) )
ROM_LOAD( "vid_a1", 0x6000, 0x2000, CRC(ef515824) SHA1(983af762733405b96351ef4910f4f4be40c4880e) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( twotigerc )
@@ -2221,9 +2179,6 @@ ROM_START( twotigerc )
ROM_LOAD( "2tgrfg1.bin", 0x2000, 0x2000, CRC(fbcaffa5) SHA1(5145cd7cc08552388b8662b5d159b3af6344c51a) )
ROM_LOAD( "2tgrfg2.bin", 0x4000, 0x2000, CRC(08e3e1a6) SHA1(c9c5ce072b235a299a3151f984d73bab97289e19) )
ROM_LOAD( "2tgrfg3.bin", 0x6000, 0x2000, CRC(9b22697b) SHA1(4c3fa30ce1b645ab18c0e53ce0f3754133a267ad) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2254,9 +2209,6 @@ ROM_START( journey )
ROM_LOAD( "a4", 0xa000, 0x2000, CRC(765876a7) SHA1(9c477f5fae068f7e424939652e959711b3ad3a80) )
ROM_LOAD( "a1", 0xc000, 0x2000, CRC(4af986f8) SHA1(56af9525a404bcf6d76b19318efe541189844210) )
ROM_LOAD( "a2", 0xe000, 0x2000, CRC(b30cd2a7) SHA1(df1b36a3481fdec49f73d504f23951070c121291) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2286,9 +2238,6 @@ ROM_START( tapper )
ROM_LOAD( "tapfg4.bin", 0x14000, 0x4000, CRC(32674ee6) SHA1(402c166d50b4a693959b3f0706a7931a5daef6ce) )
ROM_LOAD( "tapfg7.bin", 0x18000, 0x4000, CRC(070b4c81) SHA1(95879a455ecfe2e3de7fe2a75078f9e6934960f5) )
ROM_LOAD( "tapfg6.bin", 0x1c000, 0x4000, CRC(a37aef36) SHA1(a24696f16d467d9eea4f25aef5f4c5ff55bf51ff) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( tappera )
@@ -2317,9 +2266,6 @@ ROM_START( tappera )
ROM_LOAD( "fg4_a4.128", 0x14000, 0x4000, CRC(082a4059) SHA1(52672b853d67432fd80e4612fa54208c225d2444) )
ROM_LOAD( "fg7_a1.128", 0x18000, 0x4000, CRC(3b476abe) SHA1(6fe170695386fc77310384a5590a7cc3671ae853) )
ROM_LOAD( "fg6_a2.128", 0x1c000, 0x4000, CRC(6717264c) SHA1(5a6d30974e73f952694b8c09fb3a5393a76db4f2) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( sutapper )
@@ -2348,9 +2294,6 @@ ROM_START( sutapper )
ROM_LOAD( "5800", 0x14000, 0x4000, CRC(ebf1f948) SHA1(251cf018da8db11c3844123255082146b22507e5) )
ROM_LOAD( "5801", 0x18000, 0x4000, CRC(d70defa7) SHA1(e8ceabe94080eb28aa393b97ec54729cf8aba001) )
ROM_LOAD( "5802", 0x1c000, 0x4000, CRC(d4f114b9) SHA1(58ae647b4fd0f48af4158b85e29c813605d930d3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
ROM_START( rbtapper )
@@ -2379,9 +2322,6 @@ ROM_START( rbtapper )
ROM_LOAD( "rbtfg4.bin", 0x14000, 0x4000, CRC(8c79e7d7) SHA1(e2a427324fc1d4422e50a1ab79822aff0290e109) )
ROM_LOAD( "rbtfg7.bin", 0x18000, 0x4000, CRC(8dbf0c36) SHA1(dab52db0bca13b9f3470060bc3babe4a6c2cdcc8) )
ROM_LOAD( "rbtfg6.bin", 0x1c000, 0x4000, CRC(441201a0) SHA1(400d390729601610b152e21da55399399830221f) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
@@ -2410,9 +2350,6 @@ ROM_START( timber )
ROM_LOAD( "timfg4.bin", 0x14000, 0x4000, CRC(b7105eb7) SHA1(913687f0e5dd105a3dfdc0afd1b5610b27124451) )
ROM_LOAD( "timfg7.bin", 0x18000, 0x4000, CRC(d9c27475) SHA1(24a7e6200e4f3514d4d3f25b2ffe3338c0c2a495) )
ROM_LOAD( "timfg6.bin", 0x1c000, 0x4000, CRC(244778e8) SHA1(494bc1e627997cd4f1d5267c5fafd0779ccf9255) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -2442,9 +2379,6 @@ ROM_START( dotron )
ROM_LOAD( "loc-d.cp7", 0x0a000, 0x2000, CRC(5e8a3ef3) SHA1(74983c922eae1326ecd0ff14000851e0b424cc61) )
ROM_LOAD( "loc-a.cp0", 0x0c000, 0x2000, CRC(b35f5374) SHA1(3f330ffde52ac57c02dfdf8e105aefcc10f87a0b) )
ROM_LOAD( "loc-b.cp9", 0x0e000, 0x2000, CRC(565a5c48) SHA1(9dfafd58bd552bfda4e1799a175735ecc1369ba3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( dotrona )
@@ -2473,9 +2407,6 @@ ROM_START( dotrona )
ROM_LOAD( "loc-d.cp7", 0x0a000, 0x2000, CRC(5e8a3ef3) SHA1(74983c922eae1326ecd0ff14000851e0b424cc61) )
ROM_LOAD( "loc-a.cp0", 0x0c000, 0x2000, CRC(b35f5374) SHA1(3f330ffde52ac57c02dfdf8e105aefcc10f87a0b) )
ROM_LOAD( "loc-b.cp9", 0x0e000, 0x2000, CRC(565a5c48) SHA1(9dfafd58bd552bfda4e1799a175735ecc1369ba3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
ROM_START( dotrone )
@@ -2511,7 +2442,6 @@ ROM_START( dotrone )
ROM_LOAD( "loc-b.cp9", 0x0e000, 0x2000, CRC(565a5c48) SHA1(9dfafd58bd552bfda4e1799a175735ecc1369ba3) )
ROM_REGION( 0x0040, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_LOAD( "edotlamp.u2", 0x0020, 0x0020, CRC(fb58b867) SHA1(45beb55f2c2e9197f091fc06e9a2f595e57e5c93) ) /* lamp sequencer PROM */
ROM_END
@@ -2550,9 +2480,6 @@ ROM_START( nflfoot )
ROM_LOAD( "nflvidfg.cp7", 0x0a000, 0x2000, CRC(73f62392) SHA1(18f28be7264f8edff38f8a6aa067eeb1970f544c) )
ROM_LOAD( "nflvidfg.c10", 0x0c000, 0x2000, CRC(1766dcc7) SHA1(df499e3c66ae702d2d56e6cd095a754665569fcd) )
ROM_LOAD( "nflvidfg.cp9", 0x0e000, 0x2000, CRC(46558146) SHA1(4bedfae8cf0fcb9d837706ee13fbe3944ab47216) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "5784", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) )
ROM_END
@@ -2581,9 +2508,6 @@ ROM_START( demoderb )
ROM_LOAD( "dd_fg-6.a7", 0x14000, 0x4000, CRC(abfb9a8b) SHA1(14ab416bc76db25ad97353c9072048c64ec95344) )
ROM_LOAD( "dd_fg-3.a10", 0x18000, 0x4000, CRC(801d9b86) SHA1(5a8c72d1060eea1a3ad67b98aa6eff13f6837af6) )
ROM_LOAD( "dd_fg-7.a9", 0x1c000, 0x4000, CRC(0ec3f60a) SHA1(4176b246b0ea7bce9498c20e12678f16f7173529) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index 4a0a9f7187d..98e7b909496 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -1388,9 +1388,6 @@ ROM_START( spyhunt )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "cpu_alph.10g", 0x00000, 0x1000, CRC(936dc87f) SHA1(cdf73bea82481fbc300ec5a1fbbe8d662007c56b) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1431,9 +1428,6 @@ ROM_START( spyhuntp )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "sh_mb_1.bin", 0x00000, 0x0800, CRC(5c74c9f0) SHA1(e42789d14e5510d1dcf4a30f6bd40a40ab46f7f3) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1469,9 +1463,6 @@ ROM_START( crater )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "crcpu.10g", 0x00000, 0x1000, CRC(6fe53c8d) SHA1(ceb04916af42d58f3173e5986756a0db8be11999) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
@@ -1511,9 +1502,6 @@ ROM_START( turbotag )
ROM_REGION( 0x01000, "gfx3", 0 )
ROM_LOAD( "ttan.bin", 0x00000, 0x1000, CRC(aa0b1471) SHA1(e3dd69f1a14926c6b709d6b19d9e90a1f0867465) )
-
- ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "82s123.12d", 0x0000, 0x0020, CRC(e1281ee9) SHA1(9ac9b01d24affc0ee9227a4364c4fd8f8290343a) ) /* from shollow, assuming it's the same */
ROM_END
diff --git a/src/mame/drivers/meadows.c b/src/mame/drivers/meadows.c
index 9d69202cf70..446732d900a 100644
--- a/src/mame/drivers/meadows.c
+++ b/src/mame/drivers/meadows.c
@@ -872,12 +872,12 @@ static DRIVER_INIT( gypsyjug )
0x01,0x80, 0x03,0xc0, 0x03,0xc0, 0x01,0x80
};
int i;
- UINT8 *gfx2 = machine.region("gfx2")->base();
- UINT8 *gfx3 = machine.region("gfx3")->base();
- UINT8 *gfx4 = machine.region("gfx4")->base();
- UINT8 *gfx5 = machine.region("gfx5")->base();
- int len3 = machine.region("gfx3")->bytes();
- int len4 = machine.region("gfx4")->bytes();
+ UINT8 *gfx2 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *gfx3 = machine.root_device().memregion("gfx3")->base();
+ UINT8 *gfx4 = machine.root_device().memregion("gfx4")->base();
+ UINT8 *gfx5 = machine.root_device().memregion("gfx5")->base();
+ int len3 = machine.root_device().memregion("gfx3")->bytes();
+ int len4 = machine.root_device().memregion("gfx4")->bytes();
memcpy(gfx3,gfx2,len3);
@@ -896,8 +896,8 @@ static DRIVER_INIT( minferno )
UINT8 *mem;
/* create an inverted copy of the graphics data */
- mem = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ mem = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
for (i = 0; i < length/2; i++)
mem[i] = ~mem[i + length/2];
}
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index 51d1d026488..6c5ded705d6 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -1045,7 +1045,7 @@ static MACHINE_START(mediagx)
static MACHINE_RESET(mediagx)
{
mediagx_state *state = machine.driver_data<mediagx_state>();
- UINT8 *rom = machine.region("bios")->base();
+ UINT8 *rom = state->memregion("bios")->base();
device_set_irq_callback(machine.device("maincpu"), irq_callback);
diff --git a/src/mame/drivers/megadrvb.c b/src/mame/drivers/megadrvb.c
index e791fa55912..55de0266ded 100644
--- a/src/mame/drivers/megadrvb.c
+++ b/src/mame/drivers/megadrvb.c
@@ -659,7 +659,7 @@ static DRIVER_INIT( aladmdb )
* Game does a check @ 1afc00 with work RAM fff57c that makes it play like the original console version (i.e. 8 energy hits instead of 2)
*/
#if ENERGY_CONSOLE_MODE
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x1afc08/2] = 0x6600;
#endif
@@ -675,7 +675,7 @@ static DRIVER_INIT( aladmdb )
// after this decode look like intentional changes
static DRIVER_INIT( mk3mdb )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (int x = 0x000001; x < 0x100001; x += 2)
{
@@ -726,7 +726,7 @@ static DRIVER_INIT( ssf2mdb )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x400000, 0x5fffff, "bank5");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x400000, 0x5fffff);
- machine.root_device().membank("bank5")->set_base(machine.region( "maincpu" )->base() + 0x400000 );
+ machine.root_device().membank("bank5")->set_base(machine.root_device().memregion( "maincpu" )->base() + 0x400000 );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(ssf2mdb_dsw_r) );
@@ -736,7 +736,7 @@ static DRIVER_INIT( ssf2mdb )
static DRIVER_INIT( srmdb )
{
- UINT8* rom = machine.region("maincpu")->base();
+ UINT8* rom = machine.root_device().memregion("maincpu")->base();
/* todo, reduce bitswaps to single swap */
for (int x = 0x00001; x < 0x40000; x += 2)
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index c957779673c..ee993c5c434 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -427,7 +427,7 @@ static READ16_HANDLER( megaplay_io_read )
static READ8_HANDLER( bank_r )
{
mplay_state *state = space->machine().driver_data<mplay_state>();
- UINT8* bank = space->machine().region("mtbios")->base();
+ UINT8* bank = state->memregion("mtbios")->base();
UINT32 fulladdress = state->m_mp_bios_bank_addr + offset;
if ((fulladdress >= 0x000000) && (fulladdress <= 0x3fffff)) // ROM Addresses
@@ -450,7 +450,7 @@ static READ8_HANDLER( bank_r )
}
else
{
- return space->machine().region("maincpu")->base()[fulladdress ^ 1];
+ return space->machine().root_device().memregion("maincpu")->base()[fulladdress ^ 1];
}
}
else if (fulladdress >= 0xa10000 && fulladdress <= 0xa1001f) // IO Acess
@@ -828,9 +828,9 @@ ROM_END
static void mplay_start(running_machine &machine)
{
- UINT8 *src = machine.region("mtbios")->base();
- UINT8 *instruction_rom = machine.region("user1")->base();
- UINT8 *game_rom = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("mtbios")->base();
+ UINT8 *instruction_rom = machine.root_device().memregion("user1")->base();
+ UINT8 *game_rom = machine.root_device().memregion("maincpu")->base();
int offs;
memmove(src + 0x10000, src + 0x8000, 0x18000); // move bios..
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index dc30899430d..d7e1351f8aa 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -1380,7 +1380,7 @@ WRITE16_MEMBER(megasys1_state::protection_peekaboo_w)
if ((m_protection_val & 0x90) == 0x90)
{
- UINT8 *RAM = machine().region("oki1")->base();
+ UINT8 *RAM = memregion("oki1")->base();
int new_bank = (m_protection_val & 0x7) % 7;
if (m_bank != new_bank)
@@ -3587,8 +3587,8 @@ ROM_END
static void rodlandj_gfx_unmangle(running_machine &machine, const char *region)
{
- UINT8 *rom = machine.region(region)->base();
- int size = machine.region(region)->bytes();
+ UINT8 *rom = machine.root_device().memregion(region)->base();
+ int size = machine.root_device().memregion(region)->bytes();
UINT8 *buffer;
int i;
@@ -3619,8 +3619,8 @@ static void rodlandj_gfx_unmangle(running_machine &machine, const char *region)
static void jitsupro_gfx_unmangle(running_machine &machine, const char *region)
{
- UINT8 *rom = machine.region(region)->base();
- int size = machine.region(region)->bytes();
+ UINT8 *rom = machine.root_device().memregion(region)->base();
+ int size = machine.root_device().memregion(region)->bytes();
UINT8 *buffer;
int i;
@@ -3673,7 +3673,7 @@ static void stdragona_gfx_unmangle(running_machine &machine, const char *region)
static DRIVER_INIT( 64street )
{
megasys1_state *state = machine.driver_data<megasys1_state>();
-// UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+// UINT16 *RAM = (UINT16 *) state->memregion("maincpu")->base();
// RAM[0x006b8/2] = 0x6004; // d8001 test
// RAM[0x10EDE/2] = 0x6012; // watchdog
@@ -3686,7 +3686,7 @@ static DRIVER_INIT( 64street )
READ16_MEMBER(megasys1_state::megasys1A_mcu_hs_r)
{
- UINT16 *ROM = (UINT16 *) machine().region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) memregion("maincpu")->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
@@ -3827,7 +3827,7 @@ static DRIVER_INIT( hayaosi1 )
READ16_MEMBER(megasys1_state::iganinju_mcu_hs_r)
{
- UINT16 *ROM = (UINT16 *) machine().region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) memregion("maincpu")->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
@@ -3867,7 +3867,7 @@ static DRIVER_INIT( iganinju )
phantasm_rom_decode(machine, "maincpu");
- //RAM = (UINT16 *) machine.region("maincpu")->base();
+ //RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
megasys1_state *state = machine.driver_data<megasys1_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_r),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x2f000, 0x2f009, write16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_w),state));
@@ -3887,7 +3887,7 @@ static DRIVER_INIT( jitsupro )
{
device_t *oki1 = machine.device("oki1");
device_t *oki2 = machine.device("oki2");
- //UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ //UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
astyanax_rom_decode(machine, "maincpu"); // Code
@@ -3955,7 +3955,7 @@ static DRIVER_INIT( soldam )
READ16_MEMBER(megasys1_state::stdragon_mcu_hs_r)
{
- UINT16 *ROM = (UINT16 *) machine().region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) memregion("maincpu")->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
@@ -4026,7 +4026,7 @@ READ16_MEMBER(megasys1_state::monkelf_input_r)
static DRIVER_INIT( monkelf )
{
megasys1_state *state = machine.driver_data<megasys1_state>();
- UINT16 *ROM = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16*)state->memregion("maincpu")->base();
ROM[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap?
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::monkelf_input_r),state));
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 96c33bc867f..8adfe1a2275 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -222,9 +222,9 @@ static TIMER_CALLBACK( megatech_z80_run_state )
UINT8* game_region;
sprintf(tempname, "game%d", param);
- game_region = machine.region(tempname)->base();
+ game_region = machine.root_device().memregion(tempname)->base();
- memcpy(machine.region("maincpu")->base(), game_region, 0x400000);
+ memcpy(state->memregion("maincpu")->base(), game_region, 0x400000);
if (!state->m_cart_is_genesis[param])
{
@@ -252,7 +252,7 @@ static TIMER_CALLBACK( megatech_z80_stop_state )
printf("megatech_select_game %d\n", param+1);
sprintf(tempname, "game%d", param);
- game_region = machine.region(tempname)->base();
+ game_region = machine.root_device().memregion(tempname)->base();
cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, ASSERT_LINE);
cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_RESET, ASSERT_LINE);
@@ -274,8 +274,8 @@ static TIMER_CALLBACK( megatech_z80_stop_state )
else
{
/* no cart.. */
- memset(machine.region("mtbios")->base() + 0x8000, 0x00, 0x8000);
- memset(machine.region("maincpu")->base(), 0x00, 0x400000);
+ memset(machine.root_device().memregion("mtbios")->base() + 0x8000, 0x00, 0x8000);
+ memset(machine.root_device().memregion("maincpu")->base(), 0x00, 0x400000);
}
return;
@@ -436,7 +436,7 @@ static DRIVER_INIT(mt_slot)
static DRIVER_INIT(mt_crt)
{
mtech_state *state = machine.driver_data<mtech_state>();
- UINT8* pin = machine.region("sms_pin")->base();
+ UINT8* pin = state->memregion("sms_pin")->base();
DRIVER_INIT_CALL(mt_slot);
state->m_cart_is_genesis[0] = !pin[0] ? 1 : 0;;
@@ -556,7 +556,7 @@ static DEVICE_IMAGE_LOAD( megatech_cart )
return IMAGE_INIT_FAIL;
//printf("load list\n");
- UINT8 *ROM = image.device().machine().region(this_cart->region)->base();
+ UINT8 *ROM = image.device().machine().root_device().memregion(this_cart->region)->base();
//printf("load list2\n");
UINT32 length = image.get_software_region_length("rom");
memcpy(ROM, image.get_software_region("rom"), length);
diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c
index cf8627ae32c..bc2bd2ce259 100644
--- a/src/mame/drivers/meijinsn.c
+++ b/src/mame/drivers/meijinsn.c
@@ -248,7 +248,7 @@ static VIDEO_START(meijinsn)
static PALETTE_INIT( meijinsn )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_b[2] = { 470, 220 };
static const int resistances_rg[3] = { 1000, 470, 220 };
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index fdf660f9874..305f8c0d3af 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -100,7 +100,7 @@ static MACHINE_START(merit)
READ8_MEMBER(merit_state::questions_r)
{
- UINT8 *questions = machine().region("user1")->base();
+ UINT8 *questions = memregion("user1")->base();
int address;
switch(m_question_address >> 16)
@@ -220,9 +220,9 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine().region("gfx1")->base();
- gfx[1] = device->machine().region("gfx2")->base();
- rlen = device->machine().region("gfx2")->bytes();
+ gfx[0] = device->machine().root_device().memregion("gfx1")->base();
+ gfx[1] = device->machine().root_device().memregion("gfx2")->base();
+ rlen = state->memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
for (cx = 0; cx < x_count; cx++)
@@ -1215,8 +1215,8 @@ void merit_state::dodge_nvram_init(nvram_device &nvram, void *base, size_t size)
static MACHINE_START(casino5)
{
MACHINE_START_CALL(merit);
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x2000, 0x2000);
- machine.root_device().membank("bank2")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x6000, 0x2000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x2000);
+ machine.root_device().membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x6000, 0x2000);
machine.root_device().membank("bank1")->set_entry(0);
machine.root_device().membank("bank2")->set_entry(0);
}
@@ -2021,7 +2021,7 @@ static DRIVER_INIT( key_7 )
static DRIVER_INIT( couple )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
#if 0 //quick rom compare test
{
@@ -2048,7 +2048,7 @@ static DRIVER_INIT( dtrvwz5 )
{
merit_state *state = machine.driver_data<merit_state>();
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
/* fill b000 - b0ff with ret 0xc9 */
for ( i = 0xb000; i < 0xb100; i++ )
ROM[i] = 0xc9;
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 82a00f82865..e57bcfddca3 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -484,7 +484,7 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_questions_bank_w)
return;
}
- dst = machine().region("maincpu")->base() + 0x70000 + 2;
+ dst = memregion("maincpu")->base() + 0x70000 + 2;
if (data == 0)
{
@@ -513,7 +513,7 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_questions_bank_w)
default: logerror( "meritm_crt250_questions_bank_w: unknown data = %02x\n", data ); return;
}
logerror( "Reading question byte at %06X\n", questions_address | m_questions_loword_address);
- *dst = machine().region("extra")->base()[questions_address | m_questions_loword_address];
+ *dst = memregion("extra")->base()[questions_address | m_questions_loword_address];
}
};
@@ -989,7 +989,7 @@ static MACHINE_START(merit_common)
static MACHINE_START(meritm_crt250)
{
meritm_state *state = machine.driver_data<meritm_state>();
- state->membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base(), 0x10000);
+ state->membank("bank1")->configure_entries(0, 8, state->memregion("maincpu")->base(), 0x10000);
state->m_bank = 0xff;
meritm_crt250_switch_banks(machine);
MACHINE_START_CALL(merit_common);
@@ -1016,8 +1016,8 @@ static MACHINE_START(meritm_crt260)
state->m_ram = auto_alloc_array(machine, UINT8, 0x8000 );
machine.device<nvram_device>("nvram")->set_base(state->m_ram, 0x8000);
memset(state->m_ram, 0x00, 0x8000);
- state->membank("bank1")->configure_entries(0, 128, machine.region("maincpu")->base(), 0x8000);
- state->membank("bank2")->configure_entries(0, 128, machine.region("maincpu")->base(), 0x8000);
+ state->membank("bank1")->configure_entries(0, 128, machine.root_device().memregion("maincpu")->base(), 0x8000);
+ state->membank("bank2")->configure_entries(0, 128, state->memregion("maincpu")->base(), 0x8000);
state->membank("bank3")->configure_entries(0, 4, state->m_ram, 0x2000);
state->m_bank = 0xff;
state->m_psd_a15 = 0;
diff --git a/src/mame/drivers/mermaid.c b/src/mame/drivers/mermaid.c
index 675d78bfbb8..b5c0a6a7a79 100644
--- a/src/mame/drivers/mermaid.c
+++ b/src/mame/drivers/mermaid.c
@@ -419,7 +419,7 @@ static void rougien_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c
index 42a41f445ea..da4ec0e88b8 100644
--- a/src/mame/drivers/metalmx.c
+++ b/src/mame/drivers/metalmx.c
@@ -770,7 +770,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( metalmx )
{
- UINT8 *adsp_boot = (UINT8*)machine.region("adsp")->base();
+ UINT8 *adsp_boot = (UINT8*)machine.root_device().memregion("adsp")->base();
metalmx_state *state = machine.driver_data<metalmx_state>();
state->m_adsp->load_boot_data(adsp_boot, state->m_adsp_internal_program_ram);
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index e38e8e5e780..e16dabc5a82 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -397,7 +397,7 @@ WRITE16_MEMBER(metro_state::metro_soundstatus_w)
WRITE8_MEMBER(metro_state::metro_sound_rombank_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("audiocpu")->base();
+ UINT8 *ROM = memregion("audiocpu")->base();
bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x03) * 0x4000;
if (bankaddress < 0x10000) bankaddress = 0x0000;
@@ -408,7 +408,7 @@ WRITE8_MEMBER(metro_state::metro_sound_rombank_w)
WRITE8_MEMBER(metro_state::daitorid_sound_rombank_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("audiocpu")->base();
+ UINT8 *ROM = memregion("audiocpu")->base();
bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x07) * 0x4000;
if (bankaddress < 0x10000) bankaddress = 0x10000;
@@ -590,8 +590,8 @@ WRITE16_MEMBER(metro_state::metro_coin_lockout_4words_w)
READ16_MEMBER(metro_state::metro_bankedrom_r)
{
- UINT8 *ROM = machine().region("gfx1")->base();
- size_t len = machine().region("gfx1")->bytes();
+ UINT8 *ROM = memregion("gfx1")->base();
+ size_t len = memregion("gfx1")->bytes();
offset = offset * 2 + 0x10000 * (*m_rombank);
@@ -680,8 +680,8 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
if (offset == 0x0c / 2)
{
- UINT8 *src = machine().region("gfx1")->base();
- size_t src_len = machine().region("gfx1")->bytes();
+ UINT8 *src = memregion("gfx1")->base();
+ size_t src_len = memregion("gfx1")->bytes();
UINT32 tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2];
UINT32 src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2];
@@ -1692,7 +1692,7 @@ WRITE16_MEMBER(metro_state::blzntrnd_sound_w)
WRITE8_MEMBER(metro_state::blzntrnd_sh_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x4000;
@@ -5995,8 +5995,8 @@ static DRIVER_INIT( balcube )
{
metro_state *state = machine.driver_data<metro_state>();
- const size_t len = machine.region("gfx1")->bytes();
- UINT8 *src = machine.region("gfx1")->base();
+ const size_t len = machine.root_device().memregion("gfx1")->bytes();
+ UINT8 *src = state->memregion("gfx1")->base();
UINT8 *end = src + len;
while (src < end)
@@ -6016,7 +6016,7 @@ static DRIVER_INIT( balcube )
static DRIVER_INIT( dharmak )
{
- UINT8 *src = machine.region( "gfx1" )->base();
+ UINT8 *src = machine.root_device().memregion( "gfx1" )->base();
int i;
for (i = 0; i < 0x200000; i += 4)
diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c
index 8fe6f698184..dde5db1a6a3 100644
--- a/src/mame/drivers/mexico86.c
+++ b/src/mame/drivers/mexico86.c
@@ -421,7 +421,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( mexico86 )
{
mexico86_state *state = machine.driver_data<mexico86_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c
index c52b15a38bd..d6006be3de6 100644
--- a/src/mame/drivers/midas.c
+++ b/src/mame/drivers/midas.c
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT( livequiz )
{
- UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
// PROTECTION CHECKS
rom[0x13345a/2] = 0x4e75;
diff --git a/src/mame/drivers/midqslvr.c b/src/mame/drivers/midqslvr.c
index faecef5c218..ea225139224 100644
--- a/src/mame/drivers/midqslvr.c
+++ b/src/mame/drivers/midqslvr.c
@@ -134,7 +134,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
state->membank("bios_bank")->set_base(state->m_bios_ram);
else // disable RAM access (reads go to BIOS ROM)
- state->membank("bios_bank")->set_base(busdevice->machine().region("bios")->base() + 0x70000);
+ state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x70000);
break;
}
case 0x5a: // PAM1
@@ -142,12 +142,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("video_bank1")->set_base(state->m_isa_ram1);
else
- state->membank("video_bank1")->set_base(busdevice->machine().region("video_bios")->base() + 0);
+ state->membank("video_bank1")->set_base(state->memregion("video_bios")->base() + 0);
if (data & 0x10)
state->membank("video_bank2")->set_base(state->m_isa_ram2);
else
- state->membank("video_bank2")->set_base(busdevice->machine().region("video_bios")->base() + 0x4000);
+ state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
break;
}
@@ -156,12 +156,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
else
- state->membank("bios_ext1")->set_base(busdevice->machine().region("bios")->base() + 0x60000);
+ state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0x60000);
if (data & 0x10)
state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram);
else
- state->membank("bios_ext2")->set_base(busdevice->machine().region("bios")->base() + 0x64000);
+ state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x64000);
break;
}
@@ -170,12 +170,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
else
- state->membank("bios_ext3")->set_base(busdevice->machine().region("bios")->base() + 0x68000);
+ state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x68000);
if (data & 0x10)
state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram);
else
- state->membank("bios_ext4")->set_base(busdevice->machine().region("bios")->base() + 0x6c000);
+ state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0x6c000);
break;
}
@@ -674,13 +674,13 @@ static MACHINE_START( midqslvr )
static MACHINE_RESET( midqslvr )
{
- machine.root_device().membank("bios_bank")->set_base(machine.region("bios")->base() + 0x70000);
- machine.root_device().membank("bios_ext1")->set_base(machine.region("bios")->base() + 0x60000);
- machine.root_device().membank("bios_ext2")->set_base(machine.region("bios")->base() + 0x64000);
- machine.root_device().membank("bios_ext3")->set_base(machine.region("bios")->base() + 0x68000);
- machine.root_device().membank("bios_ext4")->set_base(machine.region("bios")->base() + 0x6c000);
- machine.root_device().membank("video_bank1")->set_base(machine.region("video_bios")->base() + 0);
- machine.root_device().membank("video_bank2")->set_base(machine.region("video_bios")->base() + 0x4000);
+ machine.root_device().membank("bios_bank")->set_base(machine.root_device().memregion("bios")->base() + 0x70000);
+ machine.root_device().membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0x60000);
+ machine.root_device().membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x64000);
+ machine.root_device().membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x68000);
+ machine.root_device().membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0x6c000);
+ machine.root_device().membank("video_bank1")->set_base(machine.root_device().memregion("video_bios")->base() + 0);
+ machine.root_device().membank("video_bank2")->set_base(machine.root_device().memregion("video_bios")->base() + 0x4000);
}
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index fa0b28be63d..c31851316f8 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -56,7 +56,7 @@ static MACHINE_RESET( midvunit )
dcs_reset_w(machine, 1);
dcs_reset_w(machine, 0);
- memcpy(state->m_ram_base, machine.region("user1")->base(), 0x20000*4);
+ memcpy(state->m_ram_base, state->memregion("user1")->base(), 0x20000*4);
machine.device("maincpu")->reset();
state->m_timer[0] = machine.device<timer_device>("timer0");
@@ -70,7 +70,7 @@ static MACHINE_RESET( midvplus )
dcs_reset_w(machine, 1);
dcs_reset_w(machine, 0);
- memcpy(state->m_ram_base, machine.region("user1")->base(), 0x20000*4);
+ memcpy(state->m_ram_base, state->memregion("user1")->base(), 0x20000*4);
machine.device("maincpu")->reset();
state->m_timer[0] = machine.device<timer_device>("timer0");
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index c45df570ca8..a43d6c8664e 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -92,7 +92,7 @@ static MACHINE_START( midzeus )
static MACHINE_RESET( midzeus )
{
- memcpy(ram_base, machine.region("user1")->base(), 0x40000*4);
+ memcpy(ram_base, machine.root_device().memregion("user1")->base(), 0x40000*4);
*ram_base <<= 1;
machine.device("maincpu")->reset();
@@ -1441,7 +1441,7 @@ static DRIVER_INIT( crusnexo )
{
dcs2_init(machine, 0, 0);
midway_ioasic_init(machine, MIDWAY_IOASIC_STANDARD, 472/* or 476,477,478,110 */, 99, NULL);
- machine.root_device().membank("bank1")->configure_entries(0, 3, machine.region("user2")->base(), 0x400000*4);
+ machine.root_device().membank("bank1")->configure_entries(0, 3, machine.root_device().memregion("user2")->base(), 0x400000*4);
midzeus_state *state = machine.driver_data<midzeus_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x9b0004, 0x9b0007, read32_delegate(FUNC(midzeus_state::crusnexo_leds_r),state), write32_delegate(FUNC(midzeus_state::crusnexo_leds_w),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler (0x8d0009, 0x8d000a, write32_delegate(FUNC(midzeus_state::keypad_select_w),state));
@@ -1452,7 +1452,7 @@ static DRIVER_INIT( thegrid )
{
dcs2_init(machine, 0, 0);
midway_ioasic_init(machine, MIDWAY_IOASIC_STANDARD, 474/* or 491 */, 99, NULL);
- machine.root_device().membank("bank1")->configure_entries(0, 3, machine.region("user2")->base(), 0x400000*4);
+ machine.root_device().membank("bank1")->configure_entries(0, 3, machine.root_device().memregion("user2")->base(), 0x400000*4);
}
diff --git a/src/mame/drivers/miniboy7.c b/src/mame/drivers/miniboy7.c
index c6f0c757649..8b17fe79de6 100644
--- a/src/mame/drivers/miniboy7.c
+++ b/src/mame/drivers/miniboy7.c
@@ -219,7 +219,7 @@ static SCREEN_UPDATE_IND16( miniboy7 )
static PALETTE_INIT( miniboy7 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* FIXME... Can't get the correct palette.
sometimes RGB bits are inverted, disregarding the 4th bit.
diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c
index b9bc7f87a2a..a768acd90d2 100644
--- a/src/mame/drivers/mirax.c
+++ b/src/mame/drivers/mirax.c
@@ -130,7 +130,7 @@ public:
static PALETTE_INIT( mirax )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
@@ -535,8 +535,8 @@ ROM_END
static DRIVER_INIT( mirax )
{
mirax_state *state = machine.driver_data<mirax_state>();
- UINT8 *DATA = machine.region("data_code")->base();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *DATA = machine.root_device().memregion("data_code")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
int i;
for(i=0x0000;i<0x4000;i++)
diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c
index d4c584c36d9..2f2710aae90 100644
--- a/src/mame/drivers/missb2.c
+++ b/src/mame/drivers/missb2.c
@@ -72,7 +72,7 @@ static SCREEN_UPDATE_IND16( missb2 )
sx = 0;
- prom = screen.machine().region("proms")->base();
+ prom = screen.machine().root_device().memregion("proms")->base();
for (offs = 0; offs < state->m_objectram.bytes(); offs += 4)
{
/* skip empty sprites */
@@ -573,8 +573,8 @@ ROM_END
static void configure_banks( running_machine& machine )
{
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *SLAVE = machine.region("slave")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *SLAVE = machine.root_device().memregion("slave")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index a0dd94530d2..94965f82c2b 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -501,7 +501,7 @@ DIRECT_UPDATE_MEMBER(missile_state::missile_direct_handler)
/* ROM? */
else if (address >= 0x5000)
{
- direct.explicit_configure(0x5000 | offset, 0x7fff | offset, 0x7fff, direct.space().machine().region("maincpu")->base() + 0x5000);
+ direct.explicit_configure(0x5000 | offset, 0x7fff | offset, 0x7fff, direct.space().machine().root_device().memregion("maincpu")->base() + 0x5000);
return ~0;
}
@@ -514,7 +514,7 @@ static MACHINE_START( missile )
{
missile_state *state = machine.driver_data<missile_state>();
/* initialize globals */
- state->m_writeprom = machine.region("proms")->base();
+ state->m_writeprom = state->memregion("proms")->base();
state->m_flipscreen = 0;
/* set up an opcode base handler since we use mapped handlers for RAM */
@@ -786,7 +786,7 @@ READ8_MEMBER(missile_state::missile_r)
/* ROM */
else if (offset >= 0x5000)
- result = machine().region("maincpu")->base()[offset];
+ result = memregion("maincpu")->base()[offset];
/* POKEY */
else if (offset < 0x4800)
@@ -1199,7 +1199,7 @@ ROM_END
static DRIVER_INIT( suprmatk )
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x40; i++)
{
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index 386e1848d06..f86a6588ec6 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -2105,14 +2105,14 @@ ROM_END
static void bootleg_decode( running_machine &machine )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x50000);
- machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, machine.region("maincpu")->base() + 0x60000, 0x4000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x50000);
+ machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x60000, 0x4000);
}
static void configure_banks( running_machine &machine )
{
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
@@ -2161,7 +2161,7 @@ static DRIVER_INIT( spang )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
spang_decode(machine);
configure_banks(machine);
}
@@ -2171,7 +2171,7 @@ static DRIVER_INIT( spangbl )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
bootleg_decode(machine);
configure_banks(machine);
}
@@ -2181,7 +2181,7 @@ static DRIVER_INIT( spangj )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
spangj_decode(machine);
configure_banks(machine);
}
@@ -2190,7 +2190,7 @@ static DRIVER_INIT( sbbros )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 3;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xe000]; /* NVRAM */
sbbros_decode(machine);
configure_banks(machine);
}
@@ -2255,7 +2255,7 @@ static DRIVER_INIT( block )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 2;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xff80]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xff80]; /* NVRAM */
block_decode(machine);
configure_banks(machine);
}
@@ -2264,7 +2264,7 @@ static DRIVER_INIT( blockbl )
mitchell_state *state = machine.driver_data<mitchell_state>();
state->m_input_type = 2;
state->m_nvram_size = 0x80;
- state->m_nvram = &machine.region("maincpu")->base()[0xff80]; /* NVRAM */
+ state->m_nvram = &state->memregion("maincpu")->base()[0xff80]; /* NVRAM */
bootleg_decode(machine);
configure_banks(machine);
}
@@ -2272,9 +2272,9 @@ static DRIVER_INIT( blockbl )
static DRIVER_INIT( mstworld )
{
/* descramble the program rom .. */
- int len = machine.region("maincpu")->bytes();
+ int len = machine.root_device().memregion("maincpu")->bytes();
UINT8* source = auto_alloc_array(machine, UINT8, len);
- UINT8* dst = machine.region("maincpu")->base() ;
+ UINT8* dst = machine.root_device().memregion("maincpu")->base() ;
int x;
static const int tablebank[]=
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index 623c8c4918a..0aa333bfb11 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -74,7 +74,7 @@ static DEVICE_START( mjkjidai_adpcm )
state->m_playing = 0;
state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, mjkjidai_adpcm_callback);
- state->m_base = machine.region("adpcm")->base();
+ state->m_base = machine.root_device().memregion("adpcm")->base();
state->m_adpcm.reset();
}
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index a32b8fb92b4..2f79d2971d6 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -166,7 +166,7 @@ static SCREEN_UPDATE_IND16( mjsister )
static TIMER_CALLBACK( dac_callback )
{
mjsister_state *state = machine.driver_data<mjsister_state>();
- UINT8 *DACROM = machine.region("samples")->base();
+ UINT8 *DACROM = state->memregion("samples")->base();
dac_data_w(state->m_dac, DACROM[(state->m_dac_bank * 0x10000 + state->m_dac_adr++) & 0x1ffff]);
@@ -449,9 +449,9 @@ static void mjsister_redraw(mjsister_state *state)
static MACHINE_START( mjsister )
{
mjsister_state *state = machine.driver_data<mjsister_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
- machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
state->m_maincpu = machine.device("maincpu");
state->m_dac = machine.device("dac");
diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c
index f1ab0b1ec0d..1907e495b8d 100644
--- a/src/mame/drivers/mlanding.c
+++ b/src/mame/drivers/mlanding.c
@@ -271,7 +271,7 @@ WRITE16_MEMBER(mlanding_state::ml_output_w)
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
data=0;
- device->machine().root_device().membank("bank1")->set_base(device->machine().region("audiocpu")->base() + ((data) & 0x03) * 0x4000 + 0x10000 );
+ device->machine().root_device().membank("bank1")->set_base(device->machine().root_device().memregion("audiocpu")->base() + ((data) & 0x03) * 0x4000 + 0x10000 );
}
static void ml_msm5205_vck(device_t *device)
@@ -288,7 +288,7 @@ static void ml_msm5205_vck(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) );
msm5205_data_w(device,state->m_adpcm_data & 0xf);
@@ -846,7 +846,7 @@ ROM_END
static DRIVER_INIT(mlanding)
{
-// UINT8 *rom = machine.region("sub")->base();
+// UINT8 *rom = machine.root_device().memregion("sub")->base();
// rom[0x88b]=0x4e;
// rom[0x88a]=0x71;
}
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index b886e28907d..5667f42dcae 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -664,7 +664,7 @@ WRITE16_MEMBER(model1_state::bank_w)
if(ACCESSING_BITS_0_7) {
switch(data & 0xf) {
case 0x1: // 100000-1fffff data roms banking
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x1000000 + 0x100000*((data >> 4) & 0xf));
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1000000 + 0x100000*((data >> 4) & 0xf));
logerror("BANK %x\n", 0x1000000 + 0x100000*((data >> 4) & 0xf));
break;
case 0x2: // 200000-2fffff data roms banking (unused, all known games have only one bank)
@@ -735,7 +735,7 @@ static TIMER_DEVICE_CALLBACK( model1_interrupt )
static MACHINE_RESET(model1)
{
model1_state *state = machine.driver_data<model1_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x1000000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x1000000);
irq_init(machine);
model1_tgp_reset(machine, !strcmp(machine.system().name, "swa") || !strcmp(machine.system().name, "wingwar") || !strcmp(machine.system().name, "wingwaru") || !strcmp(machine.system().name, "wingwarj"));
if (!strcmp(machine.system().name, "swa"))
@@ -755,7 +755,7 @@ static MACHINE_RESET(model1)
static MACHINE_RESET(model1_vr)
{
model1_state *state = machine.driver_data<model1_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x1000000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x1000000);
irq_init(machine);
model1_vr_tgp_reset(machine);
state->m_sound_irq = 3;
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 83ee7ee5e49..2ba52ce5497 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -356,11 +356,11 @@ static MACHINE_RESET(model2o)
static MACHINE_RESET(model2_scsp)
{
model2_state *state = machine.driver_data<model2_state>();
- state->membank("bank4")->set_base(machine.region("scsp")->base() + 0x200000);
- state->membank("bank5")->set_base(machine.region("scsp")->base() + 0x600000);
+ state->membank("bank4")->set_base(machine.root_device().memregion("scsp")->base() + 0x200000);
+ state->membank("bank5")->set_base(machine.root_device().memregion("scsp")->base() + 0x600000);
// copy the 68k vector table into RAM
- memcpy(state->m_soundram, machine.region("audiocpu")->base() + 0x80000, 16);
+ memcpy(state->m_soundram, state->memregion("audiocpu")->base() + 0x80000, 16);
machine.device("audiocpu")->reset();
scsp_set_ram_base(machine.device("scsp"), state->m_soundram);
}
@@ -1153,7 +1153,7 @@ WRITE32_MEMBER(model2_state::model2_prot_w)
READ32_MEMBER(model2_state::maxx_r)
{
- UINT32 *ROM = (UINT32 *)machine().region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)machine().root_device().memregion("maincpu")->base();
if (offset <= 0x1f/4)
{
@@ -1844,9 +1844,9 @@ ADDRESS_MAP_END
WRITE16_MEMBER(model2_state::model2snd_ctrl)
{
// handle sample banking
- if (machine().region("scsp")->bytes() > 0x800000)
+ if (machine().root_device().memregion("scsp")->bytes() > 0x800000)
{
- UINT8 *snd = machine().region("scsp")->base();
+ UINT8 *snd = memregion("scsp")->base();
if (data & 0x20)
{
membank("bank4")->set_base(snd + 0x200000);
@@ -5117,7 +5117,7 @@ static DRIVER_INIT( genprot )
static DRIVER_INIT( pltkids )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
state->m_protstate = state->m_protpos = 0;
@@ -5129,7 +5129,7 @@ static DRIVER_INIT( pltkids )
static DRIVER_INIT( zerogun )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
state->m_protstate = state->m_protpos = 0;
@@ -5173,7 +5173,7 @@ WRITE32_MEMBER(model2_state::jaleco_network_w)
static DRIVER_INIT( sgt24h )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),state), write32_delegate(FUNC(model2_state::jaleco_network_w),state));
@@ -5196,7 +5196,7 @@ static DRIVER_INIT( overrev )
static DRIVER_INIT( doa )
{
model2_state *state = machine.driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state));
state->m_protstate = state->m_protpos = 0;
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index cc5cf95af10..a127090078e 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1277,13 +1277,13 @@ static void model3_init(running_machine &machine, int step)
state->m_sound_irq_enable = 0;
state->m_sound_timer->adjust(attotime::never);
- state->membank("bank1")->set_base(machine.region( "user1" )->base() + 0x800000 ); /* banked CROM */
+ state->membank("bank1")->set_base(machine.root_device().memregion( "user1" )->base() + 0x800000 ); /* banked CROM */
- state->membank("bank4")->set_base(machine.region("samples")->base() + 0x200000);
- state->membank("bank5")->set_base(machine.region("samples")->base() + 0x600000);
+ state->membank("bank4")->set_base(machine.root_device().memregion("samples")->base() + 0x200000);
+ state->membank("bank5")->set_base(machine.root_device().memregion("samples")->base() + 0x600000);
// copy the 68k vector table into RAM
- memcpy(state->m_soundram, machine.region("audiocpu")->base()+0x80000, 16);
+ memcpy(state->m_soundram, state->memregion("audiocpu")->base()+0x80000, 16);
machine.device("audiocpu")->reset();
model3_machine_init(machine, step); // step 1.5
@@ -1589,7 +1589,7 @@ WRITE64_MEMBER(model3_state::model3_sys_w)
data >>= 56;
data = (~data) & 0x7;
- membank("bank1")->set_base(machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ membank("bank1")->set_base(machine().root_device().memregion( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
}
if (ACCESSING_BITS_24_31)
{
@@ -1845,8 +1845,8 @@ WRITE64_MEMBER(model3_state::daytona2_rombank_w)
{
data >>= 56;
data = (~data) & 0xf;
- membank("bank1")->set_base(machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
- membank("bank2")->set_base(machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ membank("bank1")->set_base(machine().root_device().memregion( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ membank("bank2")->set_base(machine().root_device().memregion( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
}
}
@@ -5044,9 +5044,9 @@ ROM_END
WRITE16_MEMBER(model3_state::model3snd_ctrl)
{
// handle sample banking
- if (machine().region("scsp2")->bytes() > 0x800000)
+ if (machine().root_device().memregion("scsp2")->bytes() > 0x800000)
{
- UINT8 *snd = machine().region("scsp2")->base();
+ UINT8 *snd = memregion("scsp2")->base();
if (data & 0x20)
{
membank("bank4")->set_base(snd + 0x200000);
@@ -5302,9 +5302,9 @@ static void interleave_vroms(running_machine &machine)
model3_state *state = machine.driver_data<model3_state>();
int start;
int i,j,x;
- UINT16 *vrom1 = (UINT16*)machine.region("user3")->base();
- UINT16 *vrom2 = (UINT16*)machine.region("user4")->base();
- int vrom_length = machine.region("user3")->bytes();
+ UINT16 *vrom1 = (UINT16*)machine.root_device().memregion("user3")->base();
+ UINT16 *vrom2 = (UINT16*)machine.root_device().memregion("user4")->base();
+ int vrom_length = state->memregion("user3")->bytes();
UINT16 *vrom;
state->m_vrom = auto_alloc_array(machine, UINT32, 0x4000000/4);
@@ -5369,7 +5369,7 @@ static DRIVER_INIT( model3_20 )
static DRIVER_INIT( lostwsga )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */
@@ -5381,7 +5381,7 @@ static DRIVER_INIT( lostwsga )
static DRIVER_INIT( scud )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
@@ -5394,7 +5394,7 @@ static DRIVER_INIT( scud )
static DRIVER_INIT( scudp )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
@@ -5412,7 +5412,7 @@ static DRIVER_INIT( scudp )
static DRIVER_INIT( lemans24 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_15);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),state), write64_delegate(FUNC(model3_state::scsi_w),state));
@@ -5426,7 +5426,7 @@ static DRIVER_INIT( lemans24 )
static DRIVER_INIT( vf3 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_10);
@@ -5440,7 +5440,7 @@ static DRIVER_INIT( vf3 )
static DRIVER_INIT( vs215 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
rom[(0x70dde0^4)/4] = 0x60000000;
rom[(0x70e6f0^4)/4] = 0x60000000;
@@ -5461,7 +5461,7 @@ static DRIVER_INIT( vs215 )
static DRIVER_INIT( vs29815 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
rom[(0x6028ec^4)/4] = 0x60000000;
rom[(0x60290c^4)/4] = 0x60000000;
@@ -5481,7 +5481,7 @@ static DRIVER_INIT( vs29815 )
static DRIVER_INIT( bass )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
rom[(0x7999a8^4)/4] = 0x60000000;
rom[(0x7999c8^4)/4] = 0x60000000;
@@ -5513,7 +5513,7 @@ static DRIVER_INIT( getbass )
static DRIVER_INIT( vs2 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5523,7 +5523,7 @@ static DRIVER_INIT( vs2 )
static DRIVER_INIT( vs298 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5534,7 +5534,7 @@ static DRIVER_INIT( vs298 )
static DRIVER_INIT( vs2v991 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5544,7 +5544,7 @@ static DRIVER_INIT( vs2v991 )
static DRIVER_INIT( vs299b )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5554,7 +5554,7 @@ static DRIVER_INIT( vs299b )
static DRIVER_INIT( vs299a )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5564,7 +5564,7 @@ static DRIVER_INIT( vs299a )
static DRIVER_INIT( vs299 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5575,7 +5575,7 @@ static DRIVER_INIT( vs299 )
static DRIVER_INIT( harley )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
state->m_network_ram = auto_alloc_array_clear(machine, UINT64, 0x10000);
@@ -5591,7 +5591,7 @@ static DRIVER_INIT( harley )
static DRIVER_INIT( harleyb )
{
model3_state *state = machine.driver_data<model3_state>();
- //UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ //UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
state->m_network_ram = auto_alloc_array_clear(machine, UINT64, 0x10000);
@@ -5607,7 +5607,7 @@ static DRIVER_INIT( harleyb )
static DRIVER_INIT( srally2 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x7c0c4^4)/4] = 0x60000000;
@@ -5617,7 +5617,7 @@ static DRIVER_INIT( srally2 )
static DRIVER_INIT( swtrilgy )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0xf0e48^4)/4] = 0x60000000;
@@ -5628,7 +5628,7 @@ static DRIVER_INIT( swtrilgy )
static DRIVER_INIT( swtrilga )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0xf6dd0^4)/4] = 0x60000000;
@@ -5636,7 +5636,7 @@ static DRIVER_INIT( swtrilga )
static DRIVER_INIT( von2 )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x189168^4)/4] = 0x60000000;
@@ -5648,7 +5648,7 @@ static DRIVER_INIT( von2 )
static DRIVER_INIT( dirtdvls )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x0600a0^4)/4] = 0x60000000;
@@ -5662,7 +5662,7 @@ static DRIVER_INIT( dirtdvls )
static DRIVER_INIT( daytona2 )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),state));
@@ -5677,7 +5677,7 @@ static DRIVER_INIT( daytona2 )
static DRIVER_INIT( dayto2pe )
{
model3_state *state = machine.driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)state->memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),state));
@@ -5692,7 +5692,7 @@ static DRIVER_INIT( dayto2pe )
static DRIVER_INIT( spikeout )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x6059cc^4)/4] = 0x60000000;
@@ -5701,7 +5701,7 @@ static DRIVER_INIT( spikeout )
static DRIVER_INIT( spikeofe )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x6059cc^4)/4] = 0x60000000;
@@ -5710,7 +5710,7 @@ static DRIVER_INIT( spikeofe )
static DRIVER_INIT( eca )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x535580^4)/4] = 0x60000000;
@@ -5720,7 +5720,7 @@ static DRIVER_INIT( eca )
static DRIVER_INIT( skichamp )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x5263c8^4)/4] = 0x60000000;
@@ -5731,7 +5731,7 @@ static DRIVER_INIT( skichamp )
static DRIVER_INIT( oceanhun )
{
- UINT32 *rom = (UINT32*)machine.region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.root_device().memregion("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x57995c^4)/4] = 0x60000000; // decrementer
diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c
index 02a56ef5180..458b7aee275 100644
--- a/src/mame/drivers/mogura.c
+++ b/src/mame/drivers/mogura.c
@@ -32,7 +32,7 @@ public:
static PALETTE_INIT( mogura )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, j;
j = 0;
diff --git a/src/mame/drivers/momoko.c b/src/mame/drivers/momoko.c
index cd818b81d13..8e1d27e2552 100644
--- a/src/mame/drivers/momoko.c
+++ b/src/mame/drivers/momoko.c
@@ -228,7 +228,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( momoko )
{
momoko_state *state = machine.driver_data<momoko_state>();
- UINT8 *BG_MAP = machine.region("user1")->base();
+ UINT8 *BG_MAP = state->memregion("user1")->base();
state->membank("bank1")->configure_entries(0, 32, &BG_MAP[0x0000], 0x1000);
diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c
index 254f3bb10e0..5c37fb44e5f 100644
--- a/src/mame/drivers/moo.c
+++ b/src/mame/drivers/moo.c
@@ -180,7 +180,7 @@ READ16_MEMBER(moo_state::sound_status_r)
WRITE8_MEMBER(moo_state::sound_bankswitch_w)
{
- membank("bank1")->set_base(machine().region("soundcpu")->base() + 0x10000 + (data&0xf)*0x4000);
+ membank("bank1")->set_base(machine().root_device().memregion("soundcpu")->base() + 0x10000 + (data&0xf)*0x4000);
}
diff --git a/src/mame/drivers/mouser.c b/src/mame/drivers/mouser.c
index f4a36edfea3..eaf32f1f255 100644
--- a/src/mame/drivers/mouser.c
+++ b/src/mame/drivers/mouser.c
@@ -295,9 +295,9 @@ static DRIVER_INIT( mouser )
offs_t i;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x6000);
- UINT8 *table = machine.region("user1")->base();
+ UINT8 *table = machine.root_device().memregion("user1")->base();
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c
index 3b069954284..965ece3a033 100644
--- a/src/mame/drivers/mpu4.c
+++ b/src/mame/drivers/mpu4.c
@@ -464,7 +464,7 @@ static MACHINE_RESET( mpu4 )
/* init rom bank, some games don't set this, and will assume bank 0,set 0 */
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &rom[0x01000], 0x10000);
@@ -528,7 +528,7 @@ WRITE8_MEMBER(mpu4_state::bankswitch_w)
READ8_MEMBER(mpu4_state::bankswitch_r)
{
- return machine().root_device().membank("bank1")->entry();
+ return membank("bank1")->entry();
}
@@ -15233,13 +15233,13 @@ void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
DRIVER_INIT( crystal )
{
DRIVER_INIT_CALL(m_frkstn);
- descramble_crystal(machine.region( "maincpu" )->base(), 0x0000, 0x10000, 0x00);
+ descramble_crystal(machine.root_device().memregion( "maincpu" )->base(), 0x0000, 0x10000, 0x00);
}
DRIVER_INIT( crystali )
{
DRIVER_INIT_CALL(m_frkstn);
- descramble_crystal(machine.region( "maincpu" )->base(), 0x0000, 0x10000, 0xff); // invert after decrypt?!
+ descramble_crystal(machine.root_device().memregion( "maincpu" )->base(), 0x0000, 0x10000, 0xff); // invert after decrypt?!
}
diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c
index ab58fdb5a45..67d21fef681 100644
--- a/src/mame/drivers/mpu4vid.c
+++ b/src/mame/drivers/mpu4vid.c
@@ -2112,7 +2112,7 @@ GFXDECODE_END
static PALETTE_INIT( dealem )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, len;
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
@@ -2123,7 +2123,7 @@ static PALETTE_INIT( dealem )
3, resistances_rg, weights_g, 1000, 0,
2, resistances_b, weights_b, 1000, 0);
- len = machine.region("proms")->bytes();
+ len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len; i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -2883,7 +2883,7 @@ static DRIVER_INIT (prizeinv)
void mpu4vid_char_cheat(running_machine& machine, int address)
{
mpu4_state *state = machine.driver_data<mpu4_state>();
- UINT8* cheattable = machine.region( "video" )->base()+address;
+ UINT8* cheattable = state->memregion( "video" )->base()+address;
state->m_current_chr_table = blank_data;
for (int i=0;i<72;i++)
{
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index 8fc3fe2b307..d79f698e28e 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -87,7 +87,7 @@ static WRITE8_DEVICE_HANDLER( mquake_cia_0_portb_w )
static READ8_HANDLER( es5503_sample_r )
{
- UINT8 *rom = space->machine().region("es5503")->base();
+ UINT8 *rom = space->machine().root_device().memregion("es5503")->base();
es5503_device *es5503 = space->machine().device<es5503_device>("es5503");
return rom[offset + (es5503->get_channel_strobe() * 0x10000)];
@@ -445,7 +445,7 @@ static DRIVER_INIT(mquake)
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
}
diff --git a/src/mame/drivers/mrdo.c b/src/mame/drivers/mrdo.c
index 23c274d39da..3f8d7c96147 100644
--- a/src/mame/drivers/mrdo.c
+++ b/src/mame/drivers/mrdo.c
@@ -34,7 +34,7 @@ There's a chance that certain bootlegs might have the different 8/20 MHz XTALS.
/* if a read from this address doesn't return the value it expects. */
READ8_MEMBER(mrdo_state::mrdo_SECRE_r)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
return RAM[cpu_get_reg(&space.device(), Z80_HL)];
}
diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c
index c86384d9070..c1865efec79 100644
--- a/src/mame/drivers/ms32.c
+++ b/src/mame/drivers/ms32.c
@@ -1381,7 +1381,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ms32 )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base());
machine.root_device().membank("bank4")->set_entry(0);
machine.root_device().membank("bank5")->set_entry(1);
irq_init(machine);
@@ -2202,8 +2202,8 @@ static void configure_banks(running_machine &machine)
{
ms32_state *state = machine.driver_data<ms32_state>();
state_save_register_global(machine, state->m_to_main);
- state->membank("bank4")->configure_entries(0, 16, machine.region("audiocpu")->base() + 0x14000, 0x4000);
- state->membank("bank5")->configure_entries(0, 16, machine.region("audiocpu")->base() + 0x14000, 0x4000);
+ state->membank("bank4")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base() + 0x14000, 0x4000);
+ state->membank("bank5")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
}
static DRIVER_INIT( ms32_common )
@@ -2262,7 +2262,7 @@ static DRIVER_INIT (47pie2)
static DRIVER_INIT (f1superb)
{
#if 0 // we shouldn't need this hack, something else is wrong, and the x offsets are never copied either, v70 problems??
- UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.root_device().memregion("maincpu")->base();
pROM[0x19d04/4]=0x167a021a; // bne->br : sprite Y offset table is always copied to RAM
#endif
DRIVER_INIT_CALL(ss92046_01);
diff --git a/src/mame/drivers/multfish.c b/src/mame/drivers/multfish.c
index 901edba0692..8fbbebdf359 100644
--- a/src/mame/drivers/multfish.c
+++ b/src/mame/drivers/multfish.c
@@ -471,7 +471,7 @@ A12 <-> A13
*/
UINT32 i,j,jscr,romoffset;
- UINT8 *multfish_gfx = machine.region("gfx")->base();
+ UINT8 *multfish_gfx = machine.root_device().memregion("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
@@ -543,7 +543,7 @@ INLINE void rom_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor
static void lottery_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
{
- UINT8 *multfish_gfx = machine.region("gfx")->base();
+ UINT8 *multfish_gfx = machine.root_device().memregion("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
/* ROMs decode */
@@ -584,7 +584,7 @@ INLINE void roment_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32
static void ent_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
{
- UINT8 *multfish_gfx = machine.region("gfx")->base();
+ UINT8 *multfish_gfx = machine.root_device().memregion("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
/* ROMs decode */
@@ -1009,7 +1009,7 @@ static MACHINE_RESET( multfish )
{
multfish_state *state = machine.driver_data<multfish_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base(), 0x4000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("maincpu")->base(), 0x4000);
state->membank("bank1")->set_entry(0);
state->m_disp_enable = 0;
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index df7289240aa..18a363d2d5f 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -196,7 +196,7 @@ static void set_videorom_bank(running_machine& machine, int start, int count, in
/* count determines the size of the area mapped in KB */
for (i = 0; i < count; i++, offset += 0x400)
{
- machine.root_device().membank(banknames[i + start])->set_base(machine.region("gfx1")->base() + offset);
+ machine.root_device().membank(banknames[i + start])->set_base(machine.root_device().memregion("gfx1")->base() + offset);
}
}
@@ -293,8 +293,8 @@ CUSTOM_INPUT_MEMBER(multigam_state::multigam_inputs_r)
WRITE8_MEMBER(multigam_state::multigam_switch_prg_rom)
{
/* switch PRG rom */
- UINT8* dst = machine().region("maincpu")->base();
- UINT8* src = machine().region("user1")->base();
+ UINT8* dst = memregion("maincpu")->base();
+ UINT8* src = memregion("user1")->base();
if (data & 0x80)
{
@@ -313,7 +313,7 @@ WRITE8_MEMBER(multigam_state::multigam_switch_prg_rom)
WRITE8_MEMBER(multigam_state::multigam_switch_gfx_rom)
{
- membank("bank1")->set_base(machine().region("gfx1")->base() + (0x2000 * (data & 0x3f)));
+ membank("bank1")->set_base(machine().root_device().memregion("gfx1")->base() + (0x2000 * (data & 0x3f)));
set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
m_game_gfx_bank = data;
};
@@ -323,7 +323,7 @@ WRITE8_MEMBER(multigam_state::multigam_mapper2_w)
{
if (m_game_gfx_bank & 0x80)
{
- membank("bank1")->set_base(machine().region("gfx1")->base() + (0x2000 * ((data & 0x3) + (m_game_gfx_bank & 0x3c))));
+ membank("bank1")->set_base(machine().root_device().memregion("gfx1")->base() + (0x2000 * ((data & 0x3) + (m_game_gfx_bank & 0x3c))));
}
else
{
@@ -408,7 +408,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
if (m_multigam3_mmc3_last_bank != (data & 0xc0))
{
int bank;
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
/* reset the banks */
if (m_multigam3_mmc3_command & 0x40)
@@ -461,7 +461,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
case 6: /* program banking */
{
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
if (m_multigam3_mmc3_command & 0x40)
{
/* high bank */
@@ -486,7 +486,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
case 7: /* program banking */
{
/* mid bank */
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
m_multigam3_mmc3_banks[1] = data & bankmask;
bank = m_multigam3_mmc3_banks[1] * 0x2000;
@@ -515,7 +515,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
}
else
{
- membank("bank10")->set_base(machine().region("maincpu")->base() + 0x6000);
+ membank("bank10")->set_base(machine().root_device().memregion("maincpu")->base() + 0x6000);
}
if (data & 0x40)
{
@@ -544,7 +544,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
static void multigam_init_mmc3(running_machine &machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
{
multigam_state *state = machine.driver_data<multigam_state>();
- UINT8* dst = machine.region("maincpu")->base();
+ UINT8* dst = state->memregion("maincpu")->base();
// Tom & Jerry in Super Game III enables 6000 ram, but does not read/write it
// however, it expects ROM from 6000 there (code jumps to $6xxx)
@@ -588,8 +588,8 @@ WRITE8_MEMBER(multigam_state::multigm3_switch_gfx_rom)
WRITE8_MEMBER(multigam_state::multigm3_switch_prg_rom)
{
/* switch PRG rom */
- UINT8* dst = machine().region("maincpu")->base();
- UINT8* src = machine().region("user1")->base();
+ UINT8* dst = memregion("maincpu")->base();
+ UINT8* src = memregion("user1")->base();
if (data == 0xa8)
{
@@ -599,7 +599,7 @@ WRITE8_MEMBER(multigam_state::multigm3_switch_prg_rom)
else
{
space.install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigm3_mapper2_w),this) );
- membank("bank10")->set_base(machine().region("maincpu")->base() + 0x6000);
+ membank("bank10")->set_base(machine().root_device().memregion("maincpu")->base() + 0x6000);
}
if (data & 0x80)
@@ -651,7 +651,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(multigam_state::multigam3_mapper02_rom_switch_w)
{
- UINT8* mem = machine().region("maincpu")->base();
+ UINT8* mem = memregion("maincpu")->base();
int bankmask = (m_mapper02_prg_size/0x4000) - 1;
memcpy(mem + 0x8000, m_mapper02_prg_base + 0x4000*(data & bankmask), 0x4000);
}
@@ -660,7 +660,7 @@ static void multigam_init_mapper02(running_machine &machine, UINT8* prg_base, in
{
multigam_state *state = machine.driver_data<multigam_state>();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
- UINT8* mem = machine.region("maincpu")->base();
+ UINT8* mem = state->memregion("maincpu")->base();
memcpy(mem + 0x8000, prg_base + prg_size - 0x8000, 0x8000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigam3_mapper02_rom_switch_w),state));
@@ -780,7 +780,7 @@ WRITE8_MEMBER(multigam_state::mmc1_rom_switch_w)
case 3: /* program banking */
{
int bank = (m_mmc1_shiftreg & m_mmc1_rom_mask) * 0x4000;
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
if (!m_size16k)
{
@@ -813,7 +813,7 @@ WRITE8_MEMBER(multigam_state::mmc1_rom_switch_w)
static void multigam_init_mmc1(running_machine &machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
{
multigam_state *state = machine.driver_data<multigam_state>();
- UINT8* dst = machine.region("maincpu")->base();
+ UINT8* dst = state->memregion("maincpu")->base();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000);
@@ -856,7 +856,7 @@ static void supergm3_set_bank(running_machine &machine)
{
multigam_state *state = machine.driver_data<multigam_state>();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
- UINT8* mem = machine.region("maincpu")->base();
+ UINT8* mem = state->memregion("maincpu")->base();
// video bank
if (state->m_supergm3_chr_bank == 0x10 ||
@@ -897,14 +897,14 @@ static void supergm3_set_bank(running_machine &machine)
{
// mapper 02
multigam_init_mapper02(machine,
- machine.region("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
+ machine.root_device().memregion("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
0x20000);
}
else if (state->m_supergm3_chr_bank & 0x10)
{
// MMC3
multigam_init_mmc3(machine,
- machine.region("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
+ machine.root_device().memregion("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
(state->m_supergm3_prg_bank & 0x20) ? 0x20000 : 0x40000,
(state->m_supergm3_chr_bank & 0x0f)*0x80);
}
@@ -912,7 +912,7 @@ static void supergm3_set_bank(running_machine &machine)
{
//MMC1
multigam_init_mmc1(machine,
- machine.region("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
+ machine.root_device().memregion("user1")->base() + (state->m_supergm3_prg_bank & 0x1f)*0x20000,
0x20000,
(state->m_supergm3_chr_bank & 0x0f)*0x80/4 );
}
@@ -1139,7 +1139,7 @@ static MACHINE_START( multigam )
machine.device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),state), write8_delegate(FUNC(multigam_state::multigam_nt_w),state));
machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
- state->membank("bank1")->set_base(machine.region("gfx1")->base());
+ state->membank("bank1")->set_base(state->memregion("gfx1")->base());
}
static MACHINE_START( multigm3 )
@@ -1373,8 +1373,8 @@ static DRIVER_INIT(multigm3)
const UINT8 decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a };
- multigm3_decrypt(machine.region("maincpu")->base(), machine.region("maincpu")->bytes(), decode );
- multigm3_decrypt(machine.region("user1")->base(), machine.region("user1")->bytes(), decode );
+ multigm3_decrypt(machine.root_device().memregion("maincpu")->base(), machine.root_device().memregion("maincpu")->bytes(), decode );
+ multigm3_decrypt(machine.root_device().memregion("user1")->base(), machine.root_device().memregion("user1")->bytes(), decode );
state->m_multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -1391,7 +1391,7 @@ static DRIVER_INIT(multigmt)
int i;
int addr;
- rom = machine.region("maincpu")->base();
+ rom = machine.root_device().memregion("maincpu")->base();
size = 0x8000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
@@ -1401,7 +1401,7 @@ static DRIVER_INIT(multigmt)
rom[i] = buf[addr];
}
- rom = machine.region("user1")->base();
+ rom = machine.root_device().memregion("user1")->base();
size = 0x80000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
@@ -1409,7 +1409,7 @@ static DRIVER_INIT(multigmt)
addr = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,8,11,12,10,9,7,6,5,4,3,2,1,0);
rom[i] = buf[addr];
}
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
size = 0x80000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
diff --git a/src/mame/drivers/murogmbl.c b/src/mame/drivers/murogmbl.c
index 2b653132b5d..e33ec3e2b7a 100644
--- a/src/mame/drivers/murogmbl.c
+++ b/src/mame/drivers/murogmbl.c
@@ -51,7 +51,7 @@ public:
static PALETTE_INIT( murogmbl )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/mustache.c b/src/mame/drivers/mustache.c
index 173991329e3..73d1fd8a75e 100644
--- a/src/mame/drivers/mustache.c
+++ b/src/mame/drivers/mustache.c
@@ -252,10 +252,10 @@ static DRIVER_INIT( mustache )
{
int i;
- int G1 = machine.region("gfx1")->bytes()/3;
- int G2 = machine.region("gfx2")->bytes()/2;
- UINT8 *gfx1 = machine.region("gfx1")->base();
- UINT8 *gfx2 = machine.region("gfx2")->base();
+ int G1 = machine.root_device().memregion("gfx1")->bytes()/3;
+ int G2 = machine.root_device().memregion("gfx2")->bytes()/2;
+ UINT8 *gfx1 = machine.root_device().memregion("gfx1")->base();
+ UINT8 *gfx2 = machine.root_device().memregion("gfx2")->base();
UINT8 *buf=auto_alloc_array(machine, UINT8, G2*2);
/* BG data lines */
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index 6645514c881..f564298824c 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -557,7 +557,7 @@ ADDRESS_MAP_END
static void reset_sound_region(running_machine &machine)
{
mystwarr_state *state = machine.driver_data<mystwarr_state>();
- state->membank("bank2")->set_base(machine.region("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
+ state->membank("bank2")->set_base(state->memregion("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
}
WRITE8_MEMBER(mystwarr_state::sound_bankswitch_w)
diff --git a/src/mame/drivers/namcofl.c b/src/mame/drivers/namcofl.c
index eedd1682762..08d8aa00757 100644
--- a/src/mame/drivers/namcofl.c
+++ b/src/mame/drivers/namcofl.c
@@ -188,11 +188,11 @@ WRITE32_MEMBER(namcofl_state::namcofl_sysreg_w)
if (data == 0) // RAM at 00000000, ROM at 10000000
{
membank("bank1")->set_base(m_workram );
- membank("bank2")->set_base(machine().region("maincpu")->base() );
+ membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() );
}
else // ROM at 00000000, RAM at 10000000
{
- membank("bank1")->set_base(machine().region("maincpu")->base() );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() );
membank("bank2")->set_base(m_workram );
}
}
@@ -580,7 +580,7 @@ static MACHINE_RESET( namcofl )
machine.scheduler().timer_set(machine.primary_screen->time_until_pos(machine.primary_screen->visible_area().max_y + 3), FUNC(network_interrupt_callback));
machine.scheduler().timer_set(machine.primary_screen->time_until_pos(machine.primary_screen->visible_area().max_y + 1), FUNC(vblank_interrupt_callback));
- state->membank("bank1")->set_base(machine.region("maincpu")->base() );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() );
state->membank("bank2")->set_base(state->m_workram );
memset(state->m_workram, 0x00, 0x100000);
@@ -811,7 +811,7 @@ static void namcofl_common_init(running_machine &machine)
namcofl_state *state = machine.driver_data<namcofl_state>();
state->m_workram = auto_alloc_array(machine, UINT32, 0x100000/4);
- state->membank("bank1")->set_base(machine.region("maincpu")->base() );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() );
state->membank("bank2")->set_base(state->m_workram );
}
diff --git a/src/mame/drivers/namcoic.c b/src/mame/drivers/namcoic.c
index 1c740a14756..8b5e89f6dfd 100644
--- a/src/mame/drivers/namcoic.c
+++ b/src/mame/drivers/namcoic.c
@@ -1101,7 +1101,7 @@ roz_get_info( running_machine &machine, tile_data &tileinfo, int tile_index, int
break;
}
SET_TILE_INFO( mRozGfxBank,mangle,0/*color*/,0/*flag*/ );
- tileinfo.mask_data = 32*tile + (UINT8 *)machine.region( mRozMaskRegion )->base();
+ tileinfo.mask_data = 32*tile + (UINT8 *)machine.root_device().memregion( mRozMaskRegion )->base();
} /* roz_get_info */
static
@@ -1604,7 +1604,7 @@ namco_road_set_transparent_color(pen_t pen)
void
namco_road_draw(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
{
- const UINT8 *clut = (const UINT8 *)machine.region("user3")->base();
+ const UINT8 *clut = (const UINT8 *)machine.root_device().memregion("user3")->base();
unsigned yscroll;
int i;
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index dec2f34c685..066ab34f354 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -1067,7 +1067,7 @@ MACHINE_CONFIG_END
static void init_namcona1( running_machine &machine, int gametype )
{
namcona1_state *state = machine.driver_data<namcona1_state>();
- UINT16 *pMem = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *pMem = (UINT16 *)state->memregion( "maincpu" )->base();
state->m_gametype = gametype;
state->m_mpBank0 = &pMem[0x80000/2];
diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c
index 1f15352dea4..5f63eac3e53 100644
--- a/src/mame/drivers/namconb1.c
+++ b/src/mame/drivers/namconb1.c
@@ -608,7 +608,7 @@ static MACHINE_START(namconb)
static DRIVER_INIT( nebulray )
{
- UINT8 *pMem = (UINT8 *)machine.region(NAMCONB1_TILEMASKREGION)->base();
+ UINT8 *pMem = (UINT8 *)machine.root_device().memregion(NAMCONB1_TILEMASKREGION)->base();
size_t numBytes = (0xfe7-0xe6f)*8;
memset( &pMem[0xe6f*8], 0, numBytes );
diff --git a/src/mame/drivers/namcos10.c b/src/mame/drivers/namcos10.c
index bd0e52ce737..8d2724d17af 100644
--- a/src/mame/drivers/namcos10.c
+++ b/src/mame/drivers/namcos10.c
@@ -339,7 +339,7 @@ WRITE32_MEMBER(namcos10_state::bank_w)
READ32_MEMBER(namcos10_state::range_r)
{
- UINT32 data32 = ((const UINT32 *)(machine().region("user1")->base()))[offset+bank_base];
+ UINT32 data32 = ((const UINT32 *)(machine().root_device().memregion("user1")->base()))[offset+bank_base];
UINT16 d16;
if(ACCESSING_BITS_16_31)
@@ -491,8 +491,8 @@ ADDRESS_MAP_END
static void memn_driver_init( running_machine &machine )
{
namcos10_state *state = machine.driver_data<namcos10_state>();
- UINT8 *BIOS = (UINT8 *)machine.region( "user1" )->base();
- state->nand_base = (UINT8 *)machine.region( "user2" )->base();
+ UINT8 *BIOS = (UINT8 *)machine.root_device().memregion( "user1" )->base();
+ state->nand_base = (UINT8 *)state->memregion( "user2" )->base();
state->nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 );
state->nand_copy( (UINT32 *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 );
@@ -503,7 +503,7 @@ static void memn_driver_init( running_machine &machine )
static void decrypt_bios( running_machine &machine, const char *regionName, int start, int b15, int b14, int b13, int b12, int b11, int b10, int b9, int b8,
int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0 )
{
- const memory_region *region = machine.region( regionName );
+ memory_region *region = machine.root_device().memregion( regionName );
UINT16 *BIOS = (UINT16 *)( region->base() + start );
int len = (region->bytes()-start)/2;
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index f3e139fd0f0..3aa18febbc5 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -877,8 +877,8 @@ static void namcos11_init_common(running_machine &machine, int n_daughterboard)
// init banks
int bank;
- UINT32 len = machine.region( "user2" )->bytes();
- UINT8 *rgn = machine.region( "user2" )->base();
+ UINT32 len = machine.root_device().memregion( "user2" )->bytes();
+ UINT8 *rgn = machine.root_device().memregion( "user2" )->base();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f000000, 0x1f0fffff, "bank1" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f100000, 0x1f1fffff, "bank2" );
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index 1c3c2eab129..4cf9a46ce33 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1208,8 +1208,8 @@ static void namcos12_rom_read( namcos12_state *state, UINT32 n_address, INT32 n_
verboselog( state->machine(), 1, "namcos12_rom_read( %08x, %08x ) game %08x\n", n_address, n_size, n_offset );
}
- source = (UINT16 *) state->machine().region( n_region )->base();
- n_romleft = ( state->machine().region( n_region )->bytes() - n_offset ) / 4;
+ source = (UINT16 *) state->machine().root_device().memregion( n_region )->base();
+ n_romleft = ( state->machine().root_device().memregion( n_region )->bytes() - n_offset ) / 4;
if( n_size > n_romleft )
{
verboselog( state->machine(), 1, "namcos12_rom_read dma truncated %d to %d passed end of rom\n", n_size, n_romleft );
@@ -1321,7 +1321,7 @@ static void system11gun_install( running_machine &machine )
WRITE32_MEMBER(namcos12_state::kcoff_w)
{
- membank( "bank2" )->set_base( machine().region( "user1" )->base() + 0x20280 );
+ membank( "bank2" )->set_base( memregion( "user1" )->base() + 0x20280 );
}
WRITE32_MEMBER(namcos12_state::kcon_w)
@@ -1627,7 +1627,7 @@ static DRIVER_INIT( namcos12 )
psx_driver_init(machine);
- state->membank("bank1")->configure_entries(0, machine.region( "user2" )->bytes() / 0x200000, machine.region( "user2" )->base(), 0x200000 );
+ state->membank("bank1")->configure_entries(0, machine.root_device().memregion( "user2" )->bytes() / 0x200000, state->memregion( "user2" )->base(), 0x200000 );
state->m_s12_porta = 0;
state->m_s12_rtcstate = 0;
@@ -1652,7 +1652,7 @@ static DRIVER_INIT( ptblank2 )
DRIVER_INIT_CALL(namcos12);
/* patch out wait for dma 5 to complete */
- *( (UINT32 *)( machine.region( "user1" )->base() + 0x331c4 ) ) = 0;
+ *( (UINT32 *)( machine.root_device().memregion( "user1" )->base() + 0x331c4 ) ) = 0;
system11gun_install(machine);
}
diff --git a/src/mame/drivers/namcos2.c b/src/mame/drivers/namcos2.c
index 73f90cf8a62..4c50f65916e 100644
--- a/src/mame/drivers/namcos2.c
+++ b/src/mame/drivers/namcos2.c
@@ -5100,7 +5100,7 @@ static DRIVER_INIT( metlhawk )
{
/* unscramble sprites */
int i, j, k, l;
- UINT8 *data = machine.region("gfx1")->base();
+ UINT8 *data = machine.root_device().memregion("gfx1")->base();
for(i=0; i<0x200000; i+=32*32)
{
for(j=0; j<32*32; j+=32*4)
@@ -5217,7 +5217,7 @@ static DRIVER_INIT( bubbletr ){
static DRIVER_INIT( luckywld ){
- UINT8 *pData = (UINT8 *)machine.region( "gfx5" )->base();
+ UINT8 *pData = (UINT8 *)machine.root_device().memregion( "gfx5" )->base();
int i;
for( i=0; i<32*0x4000; i++ )
{ /* unscramble gfx mask */
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index 3075b9886c8..af8e57f18f5 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -313,7 +313,7 @@ CPU68 PCB:
static INT32
ReadPointROMData( running_machine &machine, unsigned offset )
{
- const INT32 *pPointData = (INT32 *)machine.region( "user2" )->base();
+ const INT32 *pPointData = (INT32 *)machine.root_device().memregion( "user2" )->base();
INT32 result = pPointData[offset];
return result;
}
@@ -590,7 +590,7 @@ static int
InitDSP( running_machine &machine )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.region("dspmaster")->base();
+ UINT16 *pMem = (UINT16 *)state->memregion("dspmaster")->base();
/**
* DSP BIOS tests "CPU ID" on startup
* "JAPAN (C)1990 NAMCO LTD. by H.F "
@@ -1222,7 +1222,7 @@ WRITE16_MEMBER(namcos21_state::winrun_dsp_pointrom_addr_w)
READ16_MEMBER(namcos21_state::winrun_dsp_pointrom_data_r)
{
- UINT16 *ptrom = (UINT16 *)machine().region("user2")->base();
+ UINT16 *ptrom = (UINT16 *)machine().root_device().memregion("user2")->base();
return ptrom[m_winrun_pointrom_addr++];
} /* winrun_dsp_pointrom_data_r */
@@ -1264,7 +1264,7 @@ ADDRESS_MAP_END
READ16_MEMBER(namcos21_state::gpu_data_r)
{
- const UINT16 *pSrc = (UINT16 *)machine().region( "user3" )->base();
+ const UINT16 *pSrc = (UINT16 *)machine().root_device().memregion( "user3" )->base();
return pSrc[offset];
}
@@ -1282,7 +1282,7 @@ WRITE16_MEMBER(namcos21_state::winrun_dspbios_w)
COMBINE_DATA( &m_winrun_dspbios[offset] );
if( offset==0xfff )
{
- UINT16 *mem = (UINT16 *)machine().region("dsp")->base();
+ UINT16 *mem = (UINT16 *)machine().root_device().memregion("dsp")->base();
memcpy( mem, m_winrun_dspbios, 0x2000 );
m_winrun_dsp_alive = 1;
}
@@ -2245,7 +2245,7 @@ static void namcos21_init( running_machine &machine, int game_type )
namcos21_state *state = machine.driver_data<namcos21_state>();
namcos2_gametype = game_type;
state->m_pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
- state->m_mpDataROM = (UINT16 *)machine.region( "user1" )->base();
+ state->m_mpDataROM = (UINT16 *)state->memregion( "user1" )->base();
InitDSP(machine);
state->m_mbNeedsKickstart = 20;
if( game_type==NAMCOS21_CYBERSLED )
@@ -2257,7 +2257,7 @@ static void namcos21_init( running_machine &machine, int game_type )
static DRIVER_INIT( winrun )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.region("dsp")->base();
+ UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
@@ -2265,7 +2265,7 @@ static DRIVER_INIT( winrun )
state->m_winrun_dspcomram = auto_alloc_array(machine, UINT16, 0x1000*2);
namcos2_gametype = NAMCOS21_WINRUN91;
- state->m_mpDataROM = (UINT16 *)machine.region( "user1" )->base();
+ state->m_mpDataROM = (UINT16 *)state->memregion( "user1" )->base();
state->m_pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
state->m_pointram_idx = 0;
state->m_mbNeedsKickstart = 0;
@@ -2289,7 +2289,7 @@ static DRIVER_INIT( cybsled )
static DRIVER_INIT( solvalou )
{
- UINT16 *mem = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem = (UINT16 *)machine.root_device().memregion("maincpu")->base();
mem[0x20ce4/2+1] = 0x0000; // $200128
mem[0x20cf4/2+0] = 0x4e71; // 2nd ptr_booting
mem[0x20cf4/2+1] = 0x4e71;
@@ -2301,13 +2301,13 @@ static DRIVER_INIT( solvalou )
static DRIVER_INIT( driveyes )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.region("dsp")->base();
+ UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
state->m_winrun_dspcomram = auto_alloc_array(machine, UINT16, 0x1000*2);
namcos2_gametype = NAMCOS21_DRIVERS_EYES;
- state->m_mpDataROM = (UINT16 *)machine.region( "user1" )->base();
+ state->m_mpDataROM = (UINT16 *)state->memregion( "user1" )->base();
state->m_pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
state->m_pointram_idx = 0;
state->m_mbNeedsKickstart = 0;
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index afe1da47429..9f44243bfe8 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -1933,9 +1933,9 @@ static NVRAM_HANDLER( namcos22 )
else
{
memset( state->m_nvmem, 0x00, state->m_nvmem.bytes() );
- if (machine.region("nvram")->bytes() == state->m_nvmem.bytes())
+ if (machine.root_device().memregion("nvram")->bytes() == state->m_nvmem.bytes())
{
- UINT8* nvram = machine.region("nvram")->base();
+ UINT8* nvram = machine.root_device().memregion("nvram")->base();
for( i=0; i<state->m_nvmem.bytes()/4; i++ )
{
@@ -5538,7 +5538,7 @@ static DRIVER_INIT( airco22 )
static DRIVER_INIT( propcycl )
{
- UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.root_device().memregion("maincpu")->base();
/* patch out strange routine (uninitialized-eprom related?) */
pROM[0x1992C/4] = 0x4E754E75;
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index 8d8fc697e26..ab89fd76360 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -3070,14 +3070,14 @@ static DRIVER_INIT(ss23)
{
namcos23_state *state = machine.driver_data<namcos23_state>();
render_t &render = state->m_render;
- state->m_ptrom = (const UINT32 *)machine.region("pointrom")->base();
- state->m_tmlrom = (const UINT16 *)machine.region("textilemapl")->base();
- state->m_tmhrom = machine.region("textilemaph")->base();
- state->m_texrom = machine.region("textile")->base();
-
- state->m_tileid_mask = (machine.region("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
- state->m_tile_mask = machine.region("textile")->bytes()/256 - 1;
- state->m_ptrom_limit = machine.region("pointrom")->bytes()/4;
+ state->m_ptrom = (const UINT32 *)machine.root_device().memregion("pointrom")->base();
+ state->m_tmlrom = (const UINT16 *)machine.root_device().memregion("textilemapl")->base();
+ state->m_tmhrom = machine.root_device().memregion("textilemaph")->base();
+ state->m_texrom = machine.root_device().memregion("textile")->base();
+
+ state->m_tileid_mask = (machine.root_device().memregion("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
+ state->m_tile_mask = machine.root_device().memregion("textile")->bytes()/256 - 1;
+ state->m_ptrom_limit = state->memregion("pointrom")->bytes()/4;
state->m_mi_rd = state->m_mi_wr = state->m_im_rd = state->m_im_wr = 0;
state->m_jvssense = 1;
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index 99a8c0bea25..cff065b6cde 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -184,18 +184,18 @@ TODO:
WRITE8_MEMBER(namcos86_state::bankswitch1_w)
{
- UINT8 *base = machine().region("cpu1")->base() + 0x10000;
+ UINT8 *base = memregion("cpu1")->base() + 0x10000;
/* if the ROM expansion module is available, don't do anything. This avoids conflict */
/* with bankswitch1_ext_w() in wndrmomo */
- if (machine().region("user1")->base()) return;
+ if (machine().root_device().memregion("user1")->base()) return;
membank("bank1")->set_base(base + ((data & 0x03) * 0x2000));
}
WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w)
{
- UINT8 *base = machine().region("user1")->base();
+ UINT8 *base = memregion("user1")->base();
if (base == 0) return;
@@ -204,7 +204,7 @@ WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w)
WRITE8_MEMBER(namcos86_state::bankswitch2_w)
{
- UINT8 *base = machine().region("cpu2")->base() + 0x10000;
+ UINT8 *base = memregion("cpu2")->base() + 0x10000;
membank("bank2")->set_base(base + ((data & 0x03) * 0x2000));
}
@@ -294,7 +294,7 @@ WRITE8_MEMBER(namcos86_state::namcos86_led_w)
WRITE8_MEMBER(namcos86_state::cus115_w)
{
/* make sure the expansion board is present */
- if (!machine().region("user1")->base())
+ if (!machine().root_device().memregion("user1")->base())
{
popmessage("expansion board not present");
return;
@@ -324,7 +324,7 @@ WRITE8_MEMBER(namcos86_state::cus115_w)
static MACHINE_RESET( namco86 )
{
- UINT8 *base = machine.region("cpu1")->base() + 0x10000;
+ UINT8 *base = machine.root_device().memregion("cpu1")->base() + 0x10000;
machine.root_device().membank("bank1")->set_base(base);
}
@@ -1471,8 +1471,8 @@ static DRIVER_INIT( namco86 )
UINT8 *buffer;
/* shuffle tile ROMs so regular gfx unpack routines can be used */
- gfx = machine.region("gfx1")->base();
- size = machine.region("gfx1")->bytes() * 2 / 3;
+ gfx = machine.root_device().memregion("gfx1")->base();
+ size = machine.root_device().memregion("gfx1")->bytes() * 2 / 3;
buffer = auto_alloc_array(machine, UINT8, size );
{
@@ -1496,8 +1496,8 @@ static DRIVER_INIT( namco86 )
auto_free( machine, buffer );
}
- gfx = machine.region("gfx2")->base();
- size = machine.region("gfx2")->bytes() * 2 / 3;
+ gfx = machine.root_device().memregion("gfx2")->base();
+ size = machine.root_device().memregion("gfx2")->bytes() * 2 / 3;
buffer = auto_alloc_array(machine, UINT8, size );
{
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index 632ed2de3fb..0712d20c7ad 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -7388,7 +7388,7 @@ ROM_END
static DRIVER_INIT( atomiswave )
{
- UINT64 *ROM = (UINT64 *)machine.region("awflash")->base();
+ UINT64 *ROM = (UINT64 *)machine.root_device().memregion("awflash")->base();
// patch out long startup delay
ROM[0x98e/8] = (ROM[0x98e/8] & U64(0xffffffffffff)) | (UINT64)0x0009<<48;
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index 38dba3f4370..f496e150aae 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -846,7 +846,7 @@ static DRIVER_INIT( popflame )
READ8_MEMBER(naughtyb_state::trvmstr_questions_r)
{
- return machine().region("user1")->base()[m_question_offset];
+ return memregion("user1")->base()[m_question_offset];
}
WRITE8_MEMBER(naughtyb_state::trvmstr_questions_w)
diff --git a/src/mame/drivers/nbmj8688.c b/src/mame/drivers/nbmj8688.c
index fd4c0680594..940c5008674 100644
--- a/src/mame/drivers/nbmj8688.c
+++ b/src/mame/drivers/nbmj8688.c
@@ -67,8 +67,8 @@ static DRIVER_INIT( otonano )
static DRIVER_INIT( mjcamera )
{
- UINT8 *rom = machine.region("voice")->base() + 0x20000;
- UINT8 *prot = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x20000;
+ UINT8 *prot = machine.root_device().memregion("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -87,7 +87,7 @@ static DRIVER_INIT( mjcamera )
static DRIVER_INIT( kanatuen )
{
/* uses the same protection data as mjcamer, but a different check */
- UINT8 *rom = machine.region("voice")->base() + 0x30000;
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x30000;
rom[0x0004] = 0x09;
rom[0x0103] = 0x0e;
@@ -101,7 +101,7 @@ static DRIVER_INIT( kyuhito )
{
#if 1
/* uses the same protection data as ????, but a different check */
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x0149] = 0x00;
rom[0x014a] = 0x00;
@@ -113,8 +113,8 @@ static DRIVER_INIT( kyuhito )
static DRIVER_INIT( idhimitu )
{
- UINT8 *rom = machine.region("voice")->base() + 0x20000;
- UINT8 *prot = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x20000;
+ UINT8 *prot = machine.root_device().memregion("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -138,8 +138,8 @@ static DRIVER_INIT( kaguya )
static DRIVER_INIT( kaguya2 )
{
- UINT8 *rom = machine.region("voice")->base() + 0x20000;
- UINT8 *prot = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("voice")->base() + 0x20000;
+ UINT8 *prot = machine.root_device().memregion("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
diff --git a/src/mame/drivers/nbmj8891.c b/src/mame/drivers/nbmj8891.c
index 5fc8c38666a..d3f68896189 100644
--- a/src/mame/drivers/nbmj8891.c
+++ b/src/mame/drivers/nbmj8891.c
@@ -61,7 +61,7 @@ TODO:
static DRIVER_INIT( gionbana )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -85,7 +85,7 @@ static DRIVER_INIT( mgion )
static DRIVER_INIT( omotesnd )
{
#if 0
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -100,7 +100,7 @@ static DRIVER_INIT( omotesnd )
#endif
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x0106] = 0x00;
@@ -135,7 +135,7 @@ static DRIVER_INIT( msjiken )
static DRIVER_INIT( telmahjn )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -153,7 +153,7 @@ static DRIVER_INIT( telmahjn )
static DRIVER_INIT( mgmen89 )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -171,8 +171,8 @@ static DRIVER_INIT( mgmen89 )
static DRIVER_INIT( mjfocus )
{
- UINT8 *prot = machine.region("protection")->base();
- UINT8 *ram = machine.region("maincpu")->base() + 0xf800;
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
+ UINT8 *ram = machine.root_device().memregion("maincpu")->base() + 0xf800;
int i;
/* need to clear RAM otherwise it doesn't boot... */
@@ -194,7 +194,7 @@ static DRIVER_INIT( mjfocus )
static DRIVER_INIT( mjfocusm )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x014e] = 0x00;
@@ -206,7 +206,7 @@ static DRIVER_INIT( mjfocusm )
static DRIVER_INIT( scandal )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00;
@@ -223,10 +223,10 @@ static DRIVER_INIT( mjnanpas )
{
/* they forgot to enable the protection check in this game... */
#if 0
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
- machine.region("maincpu")->base()[0x003d] = 0x01; // force the protection check to be executed
+ machine.root_device().memregion("maincpu")->base()[0x003d] = 0x01; // force the protection check to be executed
/* this is one possible way to rearrange the protection ROM data to get the
expected 0xfe1a checksum. It's probably completely wrong! But since the
@@ -284,7 +284,7 @@ static DRIVER_INIT( hanaoji )
static DRIVER_INIT( pairsnb )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -302,7 +302,7 @@ static DRIVER_INIT( pairsnb )
static DRIVER_INIT( pairsten )
{
- UINT8 *prot = machine.region("protection")->base();
+ UINT8 *prot = machine.root_device().memregion("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
diff --git a/src/mame/drivers/nbmj8900.c b/src/mame/drivers/nbmj8900.c
index 9c6d8abfdb0..75eb71e0009 100644
--- a/src/mame/drivers/nbmj8900.c
+++ b/src/mame/drivers/nbmj8900.c
@@ -45,7 +45,7 @@ TODO:
static DRIVER_INIT( ohpaipee )
{
#if 0
- UINT8 *prot = machine.region("protdata")->base();
+ UINT8 *prot = machine.root_device().memregion("protdata")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -59,7 +59,7 @@ static DRIVER_INIT( ohpaipee )
prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
}
#else
- unsigned char *ROM = machine.region("maincpu")->base();
+ unsigned char *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x00e4] = 0x00;
@@ -78,7 +78,7 @@ static DRIVER_INIT( ohpaipee )
static DRIVER_INIT( togenkyo )
{
#if 0
- UINT8 *prot = machine.region("protdata")->base();
+ UINT8 *prot = machine.root_device().memregion("protdata")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -91,7 +91,7 @@ static DRIVER_INIT( togenkyo )
prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
}
#else
- unsigned char *ROM = machine.region("maincpu")->base();
+ unsigned char *ROM = machine.root_device().memregion("maincpu")->base();
// Protection ROM check skip
ROM[0x010b] = 0x00;
diff --git a/src/mame/drivers/nbmj8991.c b/src/mame/drivers/nbmj8991.c
index d6aa00e5450..a25bbcc3c11 100644
--- a/src/mame/drivers/nbmj8991.c
+++ b/src/mame/drivers/nbmj8991.c
@@ -70,7 +70,7 @@ static MACHINE_RESET( nbmj8991 )
device_t *audiocpu = machine.device("audiocpu");
if (audiocpu != NULL && audiocpu->type() == Z80)
{
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x8000, 0x8000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x8000, 0x8000);
machine.root_device().membank("bank1")->set_entry(0);
}
MACHINE_RESET_CALL(nb1413m3);
@@ -108,7 +108,7 @@ static DRIVER_INIT( vanilla )
static DRIVER_INIT( finalbny )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00;
@@ -134,7 +134,7 @@ static DRIVER_INIT( hyouban )
static DRIVER_INIT( galkaika )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
@@ -145,7 +145,7 @@ static DRIVER_INIT( galkaika )
static DRIVER_INIT( tokyogal )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
@@ -156,7 +156,7 @@ static DRIVER_INIT( tokyogal )
static DRIVER_INIT( tokimbsj )
{
#if 1
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index 7b92e988a62..426556ee567 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -40,7 +40,7 @@ Notes:
WRITE8_MEMBER(nbmj9195_state::nbmj9195_soundbank_w)
{
- UINT8 *SNDROM = machine().region("audiocpu")->base();
+ UINT8 *SNDROM = memregion("audiocpu")->base();
membank("bank1")->set_base(&SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -662,7 +662,7 @@ static DRIVER_INIT( nbmj9195 )
{
nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
// sound program patch
ROM[0x0213] = 0x00; // DI -> NOP
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 8122e27b2b1..0c83802540d 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -9456,8 +9456,8 @@ static DRIVER_INIT( kof2002b )
kof2002_decrypt_68k(machine);
neo_pcm2_swap(machine, 0);
neogeo_cmc50_m1_decrypt(machine);
- kof2002b_gfx_decrypt(machine, machine.region("sprites")->base(),0x4000000);
- kof2002b_gfx_decrypt(machine, machine.region("fixed")->base(),0x20000);
+ kof2002b_gfx_decrypt(machine, machine.root_device().memregion("sprites")->base(),0x4000000);
+ kof2002b_gfx_decrypt(machine, machine.root_device().memregion("fixed")->base(),0x20000);
}
static DRIVER_INIT( kf2k2pls )
@@ -9560,7 +9560,7 @@ static DRIVER_INIT( mslug5 )
static TIMER_CALLBACK( ms5pcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( ms5pcb )
@@ -9597,7 +9597,7 @@ static DRIVER_INIT( ms5plus )
static TIMER_CALLBACK( svcpcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( svcpcb )
@@ -9700,7 +9700,7 @@ static DRIVER_INIT( kf2k3pcb )
incorrect */
{
int i;
- UINT8* rom = machine.region("audiocpu")->base();
+ UINT8* rom = state->memregion("audiocpu")->base();
for (i = 0; i < 0x90000; i++)
{
rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2);
@@ -9835,7 +9835,7 @@ static DRIVER_INIT( mvs )
static READ16_HANDLER( sbp_lowerrom_r )
{
- UINT16* rom = (UINT16*)space->machine().region("maincpu")->base();
+ UINT16* rom = (UINT16*)space->machine().root_device().memregion("maincpu")->base();
UINT16 origdata = rom[(offset+(0x200/2))];
UINT16 data = BITSWAP16(origdata, 11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4);
int realoffset = 0x200+(offset*2);
@@ -9881,7 +9881,7 @@ static DRIVER_INIT(sbp )
/* the game code clears the text overlay used ingame immediately after writing it.. why? protection? sloppy code that the hw ignores? imperfect emulation? */
{
- UINT16* rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[0x2a6f8/2] = 0x4e71;
rom[0x2a6fa/2] = 0x4e71;
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 10a1d244856..518ae9cdb2f 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -641,7 +641,7 @@ static void set_main_cpu_vector_table_source( running_machine &machine, UINT8 da
static void _set_main_cpu_bank_address( running_machine &machine )
{
neogeo_state *state = machine.driver_data<neogeo_state>();
- state->membank(NEOGEO_BANK_CARTRIDGE)->set_base(&machine.region("maincpu")->base()[state->m_main_cpu_bank_address]);
+ state->membank(NEOGEO_BANK_CARTRIDGE)->set_base(&state->memregion("maincpu")->base()[state->m_main_cpu_bank_address]);
}
@@ -660,7 +660,7 @@ void neogeo_set_main_cpu_bank_address( address_space *space, UINT32 bank_address
WRITE16_MEMBER(neogeo_state::main_cpu_bank_select_w)
{
UINT32 bank_address;
- UINT32 len = machine().region("maincpu")->bytes();
+ UINT32 len = memregion("maincpu")->bytes();
if ((len <= 0x100000) && (data & 0x07))
logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", cpu_get_pc(&space.device()), data);
@@ -684,11 +684,11 @@ static void main_cpu_banking_init( running_machine &machine )
address_space *mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* create vector banks */
- machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.region("mainbios")->base());
- machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(1, machine.region("maincpu")->base());
+ machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.root_device().memregion("mainbios")->base());
+ machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(1, machine.root_device().memregion("maincpu")->base());
/* set initial main CPU bank */
- if (machine.region("maincpu")->bytes() > 0x100000)
+ if (machine.root_device().memregion("maincpu")->bytes() > 0x100000)
neogeo_set_main_cpu_bank_address(mainspace, 0x100000);
else
neogeo_set_main_cpu_bank_address(mainspace, 0x000000);
@@ -760,7 +760,7 @@ static void _set_audio_cpu_rom_source( address_space *space )
{
neogeo_state *state = space->machine().driver_data<neogeo_state>();
-/* if (!machine.region("audiobios")->base()) */
+/* if (!state->memregion("audiobios")->base()) */
state->m_audio_cpu_rom_source = 1;
state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->set_entry(state->m_audio_cpu_rom_source);
@@ -795,14 +795,14 @@ static void audio_cpu_banking_init( running_machine &machine )
UINT32 address_mask;
/* audio bios/cartridge selection */
- if (machine.region("audiobios")->base())
- state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, machine.region("audiobios")->base());
- state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, machine.region("audiocpu")->base());
+ if (machine.root_device().memregion("audiobios")->base())
+ state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, machine.root_device().memregion("audiobios")->base());
+ state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, machine.root_device().memregion("audiocpu")->base());
/* audio banking */
- address_mask = machine.region("audiocpu")->bytes() - 0x10000 - 1;
+ address_mask = machine.root_device().memregion("audiocpu")->bytes() - 0x10000 - 1;
- rgn = machine.region("audiocpu")->base();
+ rgn = state->memregion("audiocpu")->base();
for (region = 0; region < 4; region++)
{
for (bank = 0; bank < 0x100; bank++)
@@ -990,7 +990,7 @@ static MACHINE_START( neogeo )
machine.device<nvram_device>("saveram")->set_base(save_ram, 0x10000);
/* set the BIOS bank */
- state->membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base());
+ state->membank(NEOGEO_BANK_BIOS)->set_base(state->memregion("mainbios")->base());
/* set the initial main CPU bank */
main_cpu_banking_init(machine);
@@ -1279,63 +1279,63 @@ DEVICE_IMAGE_LOAD( neo_cartridge )
{
// create memory regions
size = image.get_software_region_length("maincpu");
- image.device().machine().region_free(":maincpu");
- image.device().machine().region_alloc(":maincpu",size, 2, ENDIANNESS_BIG);
- memcpy(image.device().machine().region("maincpu")->base(),image.get_software_region("maincpu"),size);
+ image.device().machine().memory().region_free(":maincpu");
+ image.device().machine().memory().region_alloc(":maincpu",size, 2, ENDIANNESS_BIG);
+ memcpy(image.device().machine().root_device().memregion("maincpu")->base(),image.get_software_region("maincpu"),size);
// for whatever reason (intentional, or design flaw) software loaded via software lists is swapped in endianess vs. the standard ROM loading, regardless of the above. Swap it to keep consistency
for (int i=0; i<size/2;i++)
{
- UINT16* ROM = (UINT16*)image.device().machine().region("maincpu")->base();
+ UINT16* ROM = (UINT16*)image.device().machine().root_device().memregion("maincpu")->base();
ROM[i] = ((ROM[i]&0xff00)>>8) | ((ROM[i]&0x00ff)<<8);
}
size = image.get_software_region_length("fixed");
- image.device().machine().region_free(":fixed");
- image.device().machine().region_alloc(":fixed",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("fixed")->base(),image.get_software_region("fixed"),size);
+ image.device().machine().memory().region_free(":fixed");
+ image.device().machine().memory().region_alloc(":fixed",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("fixed")->base(),image.get_software_region("fixed"),size);
if(image.get_software_region("audiocpu") != NULL)
{
size = image.get_software_region_length("audiocpu");
- image.device().machine().region_free(":audiocpu");
- image.device().machine().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("audiocpu")->base(),image.get_software_region("audiocpu"),size);
- memcpy(image.device().machine().region("audiocpu")->base()+0x10000,image.get_software_region("audiocpu"),size); // avoid reloading in XML, should just improve banking instead tho?
+ image.device().machine().memory().region_free(":audiocpu");
+ image.device().machine().memory().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("audiocpu")->base(),image.get_software_region("audiocpu"),size);
+ memcpy(image.device().machine().root_device().memregion("audiocpu")->base()+0x10000,image.get_software_region("audiocpu"),size); // avoid reloading in XML, should just improve banking instead tho?
}
size = image.get_software_region_length("ymsnd");
- image.device().machine().region_free(":ymsnd");
- image.device().machine().region_alloc(":ymsnd",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("ymsnd")->base(),image.get_software_region("ymsnd"),size);
+ image.device().machine().memory().region_free(":ymsnd");
+ image.device().machine().memory().region_alloc(":ymsnd",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("ymsnd")->base(),image.get_software_region("ymsnd"),size);
if(image.get_software_region("ymsnd.deltat") != NULL)
{
size = image.get_software_region_length("ymsnd.deltat");
- image.device().machine().region_free(":ymsnd.deltat");
- image.device().machine().region_alloc(":ymsnd.deltat",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("ymsnd.deltat")->base(),image.get_software_region("ymsnd.deltat"),size);
+ image.device().machine().memory().region_free(":ymsnd.deltat");
+ image.device().machine().memory().region_alloc(":ymsnd.deltat",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("ymsnd.deltat")->base(),image.get_software_region("ymsnd.deltat"),size);
}
else
- image.device().machine().region_free(":ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games
+ image.device().machine().memory().region_free(":ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games
ym->reset();
size = image.get_software_region_length("sprites");
- image.device().machine().region_free(":sprites");
- image.device().machine().region_alloc(":sprites",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("sprites")->base(),image.get_software_region("sprites"),size);
+ image.device().machine().memory().region_free(":sprites");
+ image.device().machine().memory().region_alloc(":sprites",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("sprites")->base(),image.get_software_region("sprites"),size);
if(image.get_software_region("audiocrypt") != NULL) // encrypted Z80 code
{
size = image.get_software_region_length("audiocrypt");
- image.device().machine().region_alloc(":audiocrypt",size,1, ENDIANNESS_LITTLE);
- memcpy(image.device().machine().region("audiocrypt")->base(),image.get_software_region("audiocrypt"),size);
+ image.device().machine().memory().region_alloc(":audiocrypt",size,1, ENDIANNESS_LITTLE);
+ memcpy(image.device().machine().root_device().memregion("audiocrypt")->base(),image.get_software_region("audiocrypt"),size);
// allocate the audiocpu region to decrypt data into
- image.device().machine().region_free(":audiocpu");
- image.device().machine().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
+ image.device().machine().memory().region_free(":audiocpu");
+ image.device().machine().memory().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
}
// setup cartridge ROM area
image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x000080,0x0fffff,"cart_rom");
- image.device().machine().root_device().membank("cart_rom")->set_base(&image.device().machine().region("maincpu")->base()[0x80]);
+ image.device().machine().root_device().membank("cart_rom")->set_base(&image.device().machine().root_device().memregion("maincpu")->base()[0x80]);
// handle possible protection
mvs_install_protection(image);
diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c
index 213ca58bb08..3c56514595c 100644
--- a/src/mame/drivers/neoprint.c
+++ b/src/mame/drivers/neoprint.c
@@ -273,7 +273,7 @@ WRITE8_MEMBER(neoprint_state::nprsp_bank_w)
READ16_MEMBER(neoprint_state::rom_window_r)
{
- UINT16 *rom = (UINT16 *)machine().region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("maincpu")->base();
return rom[offset | 0x80000/2 | m_bank_val*0x40000/2];
}
@@ -592,7 +592,7 @@ ROM_END
/* FIXME: get rid of these two, probably something to do with irq3 and camera / printer devices */
static DRIVER_INIT( npcartv1 )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
ROM[0x1260/2] = 0x4e71;
@@ -602,14 +602,14 @@ static DRIVER_INIT( npcartv1 )
static DRIVER_INIT( 98best44 )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
ROM[0x1312/2] = 0x4e71;
}
static DRIVER_INIT( nprsp )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
ROM[0x13a4/2] = 0x4e71;
ROM[0x13bc/2] = 0x4e71;
diff --git a/src/mame/drivers/nexus3d.c b/src/mame/drivers/nexus3d.c
index 87b41c08a9e..e28887a85e7 100644
--- a/src/mame/drivers/nexus3d.c
+++ b/src/mame/drivers/nexus3d.c
@@ -263,8 +263,8 @@ static DRIVER_INIT( nexus3d )
{
nexus3d_state *state = machine.driver_data<nexus3d_state>();
// the first part of the flash ROM automatically gets copied to RAM
- memcpy( state->m_mainram, machine.region("user1")->base(), 4 * 1024);
- state->m_flash_region = machine.region("user1")->base();
+ memcpy( state->m_mainram, machine.root_device().memregion("user1")->base(), 4 * 1024);
+ state->m_flash_region = state->memregion("user1")->base();
}
GAME( 2005, acheart, 0, nexus3d, nexus3d, nexus3d, ROT0, "Examu", "Arcana Heart",GAME_IS_SKELETON )
diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c
index 57380905bd3..51e1bd44cfc 100644
--- a/src/mame/drivers/nightgal.c
+++ b/src/mame/drivers/nightgal.c
@@ -112,7 +112,7 @@ static SCREEN_UPDATE_IND16( nightgal )
static UINT8 nightgal_gfx_nibble( running_machine &machine, int niboffset )
{
- UINT8 *blit_rom = machine.region("gfx1")->base();
+ UINT8 *blit_rom = machine.root_device().memregion("gfx1")->base();
if (niboffset & 1)
{
@@ -250,7 +250,7 @@ WRITE8_MEMBER(nightgal_state::sexygal_nsc_true_blitter_w)
/* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */
static PALETTE_INIT( nightgal )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double weights_rg[3], weights_b[2];
@@ -1226,7 +1226,7 @@ ROM_END
static DRIVER_INIT( royalqn )
{
- UINT8 *ROM = machine.region("sub")->base();
+ UINT8 *ROM = machine.root_device().memregion("sub")->base();
/* patch open bus / protection */
ROM[0xc27e] = 0x02;
@@ -1235,7 +1235,7 @@ static DRIVER_INIT( royalqn )
static DRIVER_INIT( ngalsumr )
{
- UINT8 *ROM = machine.region("sub")->base();
+ UINT8 *ROM = machine.root_device().memregion("sub")->base();
/* patch protection */
ROM[0xd6ce] = 0x02;
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index 044cb08c96b..e9068884e2e 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -175,15 +175,15 @@ static INTERRUPT_GEN( ninjakd2_interrupt )
static MACHINE_RESET( ninjakd2 )
{
/* initialize main Z80 bank */
- machine.root_device().membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->set_entry(0);
}
static void robokid_init_banks(running_machine &machine)
{
/* initialize main Z80 bank */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base(), 0x4000);
- machine.root_device().membank("bank1")->configure_entries(2, 14, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(2, 14, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->set_entry(0);
}
@@ -228,8 +228,8 @@ static SAMPLES_START( ninjakd2_init_samples )
{
ninjakd2_state *state = device.machine().driver_data<ninjakd2_state>();
running_machine &machine = device.machine();
- const UINT8* const rom = machine.region("pcm")->base();
- const int length = machine.region("pcm")->bytes();
+ const UINT8* const rom = machine.root_device().memregion("pcm")->base();
+ const int length = state->memregion("pcm")->bytes();
INT16* sampledata = auto_alloc_array(machine, INT16, length);
int i;
@@ -244,12 +244,12 @@ static SAMPLES_START( ninjakd2_init_samples )
WRITE8_MEMBER(ninjakd2_state::ninjakd2_pcm_play_w)
{
samples_device *samples = machine().device<samples_device>("pcm");
- const UINT8* const rom = machine().region("pcm")->base();
+ const UINT8* const rom = memregion("pcm")->base();
// only Ninja Kid II uses this
if (rom)
{
- const int length = machine().region("pcm")->bytes();
+ const int length = memregion("pcm")->bytes();
const int start = data << 8;
@@ -1425,9 +1425,9 @@ by one place all the intervening bits.
static void lineswap_gfx_roms(running_machine &machine, const char *region, const int bit)
{
- const int length = machine.region(region)->bytes();
+ const int length = machine.root_device().memregion(region)->bytes();
- UINT8* const src = machine.region(region)->base();
+ UINT8* const src = machine.root_device().memregion(region)->base();
UINT8* const temp = auto_alloc_array(machine, UINT8, length);
@@ -1472,7 +1472,7 @@ static DRIVER_INIT( ninjakd2 )
static DRIVER_INIT( bootleg )
{
address_space *space = machine.device("soundcpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("soundcpu")->base() + 0x10000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("soundcpu")->base() + 0x10000);
gfx_unscramble(machine);
}
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index bceb8cb0291..50f02a52988 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -757,7 +757,7 @@ static MACHINE_START( ninjaw )
{
ninjaw_state *state = machine.driver_data<ninjaw_state>();
- state->membank("bank10")->configure_entries(0, 8, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 8, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c
index 3794dcbec98..a9ce1c5ccd5 100644
--- a/src/mame/drivers/niyanpai.c
+++ b/src/mame/drivers/niyanpai.c
@@ -55,7 +55,7 @@ Memo:
static void niyanpai_soundbank_w(running_machine &machine, int data)
{
- UINT8 *SNDROM = machine.region("audiocpu")->base();
+ UINT8 *SNDROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->set_base(&SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -266,7 +266,7 @@ static MACHINE_RESET( niyanpai )
static DRIVER_INIT( niyanpai )
{
niyanpai_state *state = machine.driver_data<niyanpai_state>();
- UINT8 *SNDROM = machine.region("audiocpu")->base();
+ UINT8 *SNDROM = state->memregion("audiocpu")->base();
// sound program patch
SNDROM[0x0213] = 0x00; // DI -> NOP
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index 2744b8d0e7b..f19220f48a6 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -214,7 +214,7 @@ WRITE16_MEMBER(nmk16_state::ssmissin_sound_w)
WRITE8_MEMBER(nmk16_state::ssmissin_soundbank_w)
{
- UINT8 *rom = machine().region("oki1")->base();
+ UINT8 *rom = memregion("oki1")->base();
int bank;
bank = data & 0x3;
@@ -275,14 +275,14 @@ WRITE16_MEMBER(nmk16_state::macross2_sound_command_w)
WRITE8_MEMBER(nmk16_state::macross2_sound_bank_w)
{
- UINT8 *rom = machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
membank("bank1")->set_base(rom + (data & 0x07) * 0x4000);
}
WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_0_w)
{
- UINT8 *rom = machine().region("oki1")->base();
+ UINT8 *rom = memregion("oki1")->base();
data &= 3;
if (data != 3)
@@ -291,7 +291,7 @@ WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_0_w)
WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_1_w)
{
- UINT8 *rom = machine().region("oki2")->base();
+ UINT8 *rom = memregion("oki2")->base();
data &= 3;
if (data != 3)
@@ -1067,7 +1067,7 @@ WRITE8_MEMBER(nmk16_state::okibank_w)
WRITE8_MEMBER(nmk16_state::raphero_sound_rombank_w)
{
- membank("bank1")->set_base(machine().region("audiocpu")->base() + 0x10000 + (data & 0x07) * 0x4000);
+ membank("bank1")->set_base(machine().root_device().memregion("audiocpu")->base() + 0x10000 + (data & 0x07) * 0x4000);
}
static ADDRESS_MAP_START( raphero_sound_mem_map, AS_PROGRAM, 8, nmk16_state )
@@ -4406,16 +4406,16 @@ static void decode_gfx(running_machine &machine)
/* background */
- rom = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_bg[bjtwin_address_map_bg0(A)]);
}
/* sprites */
- rom = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (A = 0;A < len;A += 2)
{
UINT16 tmp = decode_word( rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]);
@@ -4444,8 +4444,8 @@ static void decode_tdragonb(running_machine &machine)
{0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0},
};
- rom = machine.region("maincpu")->base();
- len = machine.region("maincpu")->bytes();
+ rom = machine.root_device().memregion("maincpu")->base();
+ len = machine.root_device().memregion("maincpu")->bytes();
for (A = 0;A < len;A += 2)
{
int h = A+NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = A+NATIVE_ENDIAN_VALUE_LE_BE(0,1);
@@ -4454,15 +4454,15 @@ static void decode_tdragonb(running_machine &machine)
rom[l] = tmp & 0xff;
}
- rom = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
}
- rom = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
@@ -4481,15 +4481,15 @@ static void decode_ssmissin(running_machine &machine)
{0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0},
};
- rom = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
}
- rom = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
@@ -4504,7 +4504,7 @@ static DRIVER_INIT( nmk )
static DRIVER_INIT( hachamf )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
//rom[0x0006/2] = 0x7dc2; /* replace reset vector with the "real" one */
@@ -4515,7 +4515,7 @@ static DRIVER_INIT( hachamf )
static DRIVER_INIT( tdragonb )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
decode_tdragonb(machine);
@@ -4526,7 +4526,7 @@ static DRIVER_INIT( tdragonb )
static DRIVER_INIT( tdragon )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
//rom[0x94b0/2] = 0; /* Patch out JMP to shared memory (protection) */
//rom[0x94b2/2] = 0x92f4;
@@ -4560,7 +4560,7 @@ static DRIVER_INIT( bjtwin )
* 008F7E: 207C 000F 9000 movea.l #$f9000, A0
*/
#if 0
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x09172/2] = 0x6006; /* patch checksum error */
rom[0x08f74/2] = 0x4e71;
#endif
@@ -4974,8 +4974,8 @@ static void decryptcode( running_machine &machine, int a23, int a22, int a21, in
int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 )
{
int i;
- UINT8 *RAM = machine.region( "maincpu" )->base();
- size_t size = machine.region( "maincpu" )->bytes();
+ UINT8 *RAM = machine.root_device().memregion( "maincpu" )->base();
+ size_t size = machine.root_device().memregion( "maincpu" )->bytes();
UINT8 *buffer = auto_alloc_array(machine, UINT8, size );
memcpy( buffer, RAM, size );
diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c
index 0d7ae6d5d07..efedadc1e19 100644
--- a/src/mame/drivers/norautp.c
+++ b/src/mame/drivers/norautp.c
@@ -3395,21 +3395,21 @@ ROM_END
*/
//static DRIVER_INIT( norautrh )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x1110] = 0x00;
// ROM[0x1111] = 0x00;
//}
//static DRIVER_INIT( norautpn )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x0827] = 0x00;
// ROM[0x0828] = 0x00;
//}
//static DRIVER_INIT( norautu )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x083c] = 0x00;
// ROM[0x083d] = 0x00;
// ROM[0x083e] = 0x00;
@@ -3417,7 +3417,7 @@ ROM_END
//static DRIVER_INIT( gtipoker )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x0cc6] = 0x00;
// ROM[0x0cc7] = 0x00;
// ROM[0x0cc8] = 0x00;
@@ -3428,7 +3428,7 @@ ROM_END
//static DRIVER_INIT( dphl )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x1510] = 0x00;
// ROM[0x1511] = 0x00;
// ROM[0x1512] = 0x00;
@@ -3436,7 +3436,7 @@ ROM_END
//static DRIVER_INIT( dphla )
//{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x0b09] = 0x00;
// ROM[0x0b0a] = 0x00;
// ROM[0x0b0b] = 0x00;
@@ -3446,9 +3446,9 @@ static DRIVER_INIT( enc )
{
/* Attempt to decrypt the program ROM */
-// UINT8 *rom = machine.region("maincpu")->base();
+// UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// UINT8 *buffer;
-// int size = 0x2000; //machine.region("maincpu")->bytes();
+// int size = 0x2000; //machine.root_device().memregion("maincpu")->bytes();
// int start = 0;
// int i;
@@ -3485,7 +3485,7 @@ static DRIVER_INIT( deb )
/* Just for debugging purposes */
/* Should be removed soon */
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x02f7] = 0xca;
ROM[0x02f8] = 0x18;
ROM[0x206c] = 0xff;
@@ -3495,7 +3495,7 @@ static DRIVER_INIT( ssa )
/* Passing the video PPI handshaking lines */
/* Just for debugging purposes */
{
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x073b] = 0x00;
// ROM[0x073c] = 0x00;
diff --git a/src/mame/drivers/nova2001.c b/src/mame/drivers/nova2001.c
index ece120fb81e..0d34b85bcd0 100644
--- a/src/mame/drivers/nova2001.c
+++ b/src/mame/drivers/nova2001.c
@@ -980,9 +980,9 @@ This code is overly generic because it is used for several games in ninjakd2.c
static void lineswap_gfx_roms(running_machine &machine, const char *region, const int bit)
{
- const int length = machine.region(region)->bytes();
+ const int length = machine.root_device().memregion(region)->bytes();
- UINT8* const src = machine.region(region)->base();
+ UINT8* const src = machine.root_device().memregion(region)->base();
UINT8* const temp = auto_alloc_array(machine, UINT8, length);
diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c
index 9fc3215ffbc..e7dfef19bf3 100644
--- a/src/mame/drivers/nss.c
+++ b/src/mame/drivers/nss.c
@@ -394,13 +394,13 @@ READ8_MEMBER(nss_state::m50458_r)
if(m_m50458_rom_bank)
{
- UINT8 *gfx_rom = machine().region("m50458_gfx")->base();
+ UINT8 *gfx_rom = memregion("m50458_gfx")->base();
return gfx_rom[offset & 0xfff];
}
else
{
- UINT8 *gfx_ram = machine().region("m50458_vram")->base();
+ UINT8 *gfx_ram = memregion("m50458_vram")->base();
return gfx_ram[offset & 0xfff];
}
@@ -415,7 +415,7 @@ WRITE8_MEMBER(nss_state::m50458_w)
logerror("Warning: write to M50458 GFX ROM!\n");
else
{
- UINT8 *gfx_ram = machine().region("m50458_vram")->base();
+ UINT8 *gfx_ram = memregion("m50458_vram")->base();
gfx_ram[offset & 0xfff] = data;
}
@@ -510,7 +510,7 @@ ADDRESS_MAP_END
static MACHINE_START( nss )
{
nss_state *state = machine.driver_data<nss_state>();
- UINT8 *ROM = machine.region("bios")->base();
+ UINT8 *ROM = state->memregion("bios")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x8000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index 0e898db70cd..daabe814cd7 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -739,7 +739,7 @@ static DRIVER_INIT(nwktr)
{
nwktr_state *state = machine.driver_data<nwktr_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_NWKTR);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
state->m_sharc_dataram = auto_alloc_array(machine, UINT32, 0x100000/4);
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c
index 6c76b80f961..02f29645b24 100644
--- a/src/mame/drivers/nycaptor.c
+++ b/src/mame/drivers/nycaptor.c
@@ -331,7 +331,7 @@ READ8_MEMBER(nycaptor_state::nycaptor_generic_control_r)
WRITE8_MEMBER(nycaptor_state::nycaptor_generic_control_w)
{
m_generic_control_reg = data;
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
}
static ADDRESS_MAP_START( nycaptor_master_map, AS_PROGRAM, 8, nycaptor_state )
@@ -436,7 +436,7 @@ WRITE8_MEMBER(nycaptor_state::cyclshtg_generic_control_w)
int bank = (data >> 2) & 3;
m_generic_control_reg = data;
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + bank*0x4000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + bank*0x4000 );
}
@@ -1354,7 +1354,7 @@ static DRIVER_INIT( bronx )
{
nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
for (i = 0; i < 0x20000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
@@ -1366,7 +1366,7 @@ static DRIVER_INIT( colt )
{
nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
for (i = 0; i < 0x20000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
diff --git a/src/mame/drivers/ohmygod.c b/src/mame/drivers/ohmygod.c
index ea2c4b9a5c7..c127e9eeb6b 100644
--- a/src/mame/drivers/ohmygod.c
+++ b/src/mame/drivers/ohmygod.c
@@ -22,7 +22,7 @@ WRITE16_MEMBER(ohmygod_state::ohmygod_ctrl_w)
if (ACCESSING_BITS_0_7)
{
- UINT8 *rom = machine().region("oki")->base();
+ UINT8 *rom = memregion("oki")->base();
/* ADPCM bank switch */
if (m_sndbank != ((data >> m_adpcm_bank_shift) & 0x0f))
@@ -306,7 +306,7 @@ static MACHINE_START( ohmygod )
static MACHINE_RESET( ohmygod )
{
ohmygod_state *state = machine.driver_data<ohmygod_state>();
- UINT8 *rom = machine.region("oki")->base();
+ UINT8 *rom = state->memregion("oki")->base();
state->m_sndbank = 0;
memcpy(rom + 0x20000, rom + 0x40000 + 0x20000 * state->m_sndbank, 0x20000);
diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c
index 37af890928e..dcdee4aa7e5 100644
--- a/src/mame/drivers/ojankohs.c
+++ b/src/mame/drivers/ojankohs.c
@@ -808,7 +808,7 @@ static MACHINE_START( common )
static MACHINE_START( ojankohs )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x40, &ROM[0x10000], 0x4000);
@@ -817,7 +817,7 @@ static MACHINE_START( ojankohs )
static MACHINE_START( ojankoy )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x20, &ROM[0x10000], 0x4000);
@@ -826,7 +826,7 @@ static MACHINE_START( ojankoy )
static MACHINE_START( ojankoc )
{
- UINT8 *ROM = machine.region("user1")->base();
+ UINT8 *ROM = machine.root_device().memregion("user1")->base();
machine.root_device().membank("bank1")->configure_entries(0, 0x10, &ROM[0x0000], 0x8000);
diff --git a/src/mame/drivers/olibochu.c b/src/mame/drivers/olibochu.c
index 1b9ee4053ef..dcf3cf9a7bc 100644
--- a/src/mame/drivers/olibochu.c
+++ b/src/mame/drivers/olibochu.c
@@ -87,7 +87,7 @@ public:
static PALETTE_INIT( olibochu )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index 096f3cd6e5f..a4089cc5f6a 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -589,8 +589,8 @@ ROM_END
static DRIVER_INIT( omegrace )
{
- int i, len = machine.region("user1")->bytes();
- UINT8 *prom = machine.region("user1")->base();
+ int i, len = machine.root_device().memregion("user1")->bytes();
+ UINT8 *prom = machine.root_device().memregion("user1")->base();
/* Omega Race has two pairs of the state PROM output
* lines swapped before going into the decoder.
diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c
index cecb9bdf858..2104b0c271a 100644
--- a/src/mame/drivers/onetwo.c
+++ b/src/mame/drivers/onetwo.c
@@ -348,7 +348,7 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( onetwo )
{
onetwo_state *state = machine.driver_data<onetwo_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index 654bb512f11..63680a883d8 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -476,7 +476,7 @@ static void opwolf_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data[chip] = device->machine().region("adpcm")->base()[state->m_adpcm_pos[chip]];
+ state->m_adpcm_data[chip] = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos[chip]];
state->m_adpcm_pos[chip] = (state->m_adpcm_pos[chip] + 1) & 0x7ffff;
msm5205_data_w(device, state->m_adpcm_data[chip] >> 4);
}
@@ -979,7 +979,7 @@ ROM_END
static DRIVER_INIT( opwolf )
{
opwolf_state *state = machine.driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
@@ -989,14 +989,14 @@ static DRIVER_INIT( opwolf )
state->m_opwolf_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff);
state->m_opwolf_gun_yoffs = 0x1c - (rom[0x03ffae / 2] & 0xff);
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( opwolfb )
{
opwolf_state *state = machine.driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
@@ -1004,7 +1004,7 @@ static DRIVER_INIT( opwolfb )
state->m_opwolf_gun_xoffs = -2;
state->m_opwolf_gun_yoffs = 17;
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c
index d20ebec8ec6..6c63eac64c3 100644
--- a/src/mame/drivers/othello.c
+++ b/src/mame/drivers/othello.c
@@ -100,7 +100,7 @@ static MC6845_UPDATE_ROW( update_row )
UINT32 data_address;
UINT32 tmp;
- const UINT8 *gfx = device->machine().region("gfx")->base();
+ const UINT8 *gfx = state->memregion("gfx")->base();
for(cx = 0; cx < x_count; ++cx)
{
@@ -283,7 +283,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
READ8_MEMBER(othello_state::n7751_rom_r)
{
- return machine().region("n7751data")->base()[m_sound_addr];
+ return memregion("n7751data")->base()[m_sound_addr];
}
READ8_MEMBER(othello_state::n7751_command_r)
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index f1e62af93ee..69805436955 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -674,7 +674,7 @@ static MACHINE_START( othunder )
{
othunder_state *state = machine.driver_data<othunder_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c
index 9189135f249..f20a01f3dfe 100644
--- a/src/mame/drivers/pachifev.c
+++ b/src/mame/drivers/pachifev.c
@@ -261,7 +261,7 @@ static void pf_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) );
msm5205_data_w(device,state->m_adpcm_data & 0xf);
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index 6501f6856aa..e00c3a09c1e 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -373,7 +373,7 @@ Boards:
static MACHINE_RESET( mschamp )
{
- UINT8 *rom = machine.region("maincpu")->base() + 0x10000;
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base() + 0x10000;
int whichbank = input_port_read(machine, "GAME") & 1;
machine.root_device().membank("bank1")->configure_entries(0, 2, &rom[0x0000], 0x8000);
@@ -650,7 +650,7 @@ WRITE8_MEMBER(pacman_state::bigbucks_bank_w)
READ8_MEMBER(pacman_state::bigbucks_question_r)
{
- UINT8 *question = machine().region("user1")->base();
+ UINT8 *question = memregion("user1")->base();
UINT8 ret;
ret = question[(m_bigbucks_bank << 16) | (offset ^ 0xffff)];
@@ -754,7 +754,7 @@ WRITE8_MEMBER(pacman_state::rocktrv2_question_bank_w)
READ8_MEMBER(pacman_state::rocktrv2_question_r)
{
- UINT8 *question = machine().region("user1")->base();
+ UINT8 *question = memregion("user1")->base();
return question[offset | (m_rocktrv2_question_bank * 0x8000)];
}
@@ -843,17 +843,17 @@ READ8_MEMBER(pacman_state::pacman_read_nop)
#define mspacman_disable_decode_latch(m) m.root_device().membank("bank1")->set_entry(0)
// any access to these ROM addresses disables the decoder, and all you see is the original Pac-Man code
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x0038){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x0038]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x03b0){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x03b0]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x1600){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x1600]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x2120){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x2120]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x3ff0){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x3ff0]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x8000){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x8000]; }
-READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x97f0){ mspacman_disable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x97f0]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x0038){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x0038]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x03b0){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x03b0]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x1600){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x1600]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x2120){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x2120]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x3ff0){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x3ff0]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x8000){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x8000]; }
+READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x97f0){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x97f0]; }
WRITE8_MEMBER(pacman_state::mspacman_disable_decode_w){ mspacman_disable_decode_latch(machine()); }
// any access to these ROM addresses enables the decoder, and you'll see the Ms. Pac-Man code
-READ8_MEMBER(pacman_state::mspacman_enable_decode_r_0x3ff8){ mspacman_enable_decode_latch(machine()); return machine().region("maincpu")->base()[offset+0x3ff8+0x10000]; }
+READ8_MEMBER(pacman_state::mspacman_enable_decode_r_0x3ff8){ mspacman_enable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x3ff8+0x10000]; }
WRITE8_MEMBER(pacman_state::mspacman_enable_decode_w){ mspacman_enable_decode_latch(machine()); }
@@ -5466,7 +5466,7 @@ static void maketrax_rom_decode(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
@@ -5499,7 +5499,7 @@ static void korosuke_rom_decode(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
@@ -5535,10 +5535,10 @@ static DRIVER_INIT( ponpoko )
int i, j;
UINT8 *RAM, temp;
- int length = machine.region("gfx1")->bytes()/2;
+ int length = machine.root_device().memregion("gfx1")->bytes()/2;
/* Characters */
- RAM = machine.region("gfx1")->base();
+ RAM = machine.root_device().memregion("gfx1")->base();
for (i = 0;i < length;i += 0x10)
{
for (j = 0; j < 8; j++)
@@ -5550,7 +5550,7 @@ static DRIVER_INIT( ponpoko )
}
/* Sprites */
- RAM = machine.region("gfx1")->base()+length;
+ RAM = machine.root_device().memregion("gfx1")->base()+length;
for (i = 0;i < length;i += 0x20)
{
for (j = 0; j < 8; j++)
@@ -5588,7 +5588,7 @@ static DRIVER_INIT( eyes )
/* CPU ROMs */
/* Data lines D3 and D5 swapped */
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x4000; i++)
{
RAM[i] = BITSWAP8(RAM[i],7,6,3,4,5,2,1,0);
@@ -5598,8 +5598,8 @@ static DRIVER_INIT( eyes )
/* Graphics ROMs */
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0;i < len;i += 8)
eyes_decode(&RAM[i]);
}
@@ -5672,10 +5672,10 @@ static DRIVER_INIT( mspacman )
/* CPU ROMs */
/* Pac-Man code is in low bank */
- ROM = machine.region("maincpu")->base();
+ ROM = machine.root_device().memregion("maincpu")->base();
/* decrypted Ms. Pac-Man code is in high bank */
- DROM = &machine.region("maincpu")->base()[0x10000];
+ DROM = &machine.root_device().memregion("maincpu")->base()[0x10000];
/* copy ROMs into decrypted bank */
for (i = 0; i < 0x1000; i++)
@@ -5722,8 +5722,8 @@ static DRIVER_INIT( woodpek )
/* Graphics ROMs */
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0;i < len;i += 8)
eyes_decode(&RAM[i]);
}
@@ -5740,7 +5740,7 @@ static DRIVER_INIT( jumpshot )
static DRIVER_INIT( drivfrcp )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&ROM[0 * 0x2000]);
machine.root_device().membank("bank2")->set_base(&ROM[1 * 0x2000]);
machine.root_device().membank("bank3")->set_base(&ROM[2 * 0x2000]);
@@ -5749,7 +5749,7 @@ static DRIVER_INIT( drivfrcp )
static DRIVER_INIT( 8bpm )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* Data lines D0 and D6 swapped */
@@ -5766,7 +5766,7 @@ static DRIVER_INIT( 8bpm )
static DRIVER_INIT( porky )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* Data lines D0 and D4 swapped */
@@ -5789,7 +5789,7 @@ static DRIVER_INIT( porky )
static DRIVER_INIT( rocktrv2 )
{
/* hack to pass the rom check for the bad rom */
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x7ffe] = 0xa7;
ROM[0x7fee] = 0x6d;
@@ -5801,7 +5801,7 @@ socket and run through the 74298. Clock is tied to system clock. */
static DRIVER_INIT( mspacmbe )
{
UINT8 temp;
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i;
/* Address lines A1 and A0 swapped if A2=0 */
diff --git a/src/mame/drivers/panicr.c b/src/mame/drivers/panicr.c
index 79fd4f698b6..15e733563b5 100644
--- a/src/mame/drivers/panicr.c
+++ b/src/mame/drivers/panicr.c
@@ -93,7 +93,7 @@ public:
static PALETTE_INIT( panicr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -151,8 +151,8 @@ static TILE_GET_INFO( get_bgtile_info )
{
int code,attr;
- code=machine.region("user1")->base()[tile_index];
- attr=machine.region("user2")->base()[tile_index];
+ code=machine.root_device().memregion("user1")->base()[tile_index];
+ attr=machine.root_device().memregion("user2")->base()[tile_index];
code+=((attr&7)<<8);
SET_TILE_INFO(
1,
@@ -469,8 +469,8 @@ static DRIVER_INIT( panicr )
int size;
int i;
- rom = machine.region("gfx1")->base();
- size = machine.region("gfx1")->bytes();
+ rom = machine.root_device().memregion("gfx1")->base();
+ size = machine.root_device().memregion("gfx1")->bytes();
// text data lines
for (i = 0;i < size/2;i++)
@@ -492,8 +492,8 @@ static DRIVER_INIT( panicr )
}
- rom = machine.region("gfx2")->base();
- size = machine.region("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
+ size = machine.root_device().memregion("gfx2")->bytes();
// tiles data lines
for (i = 0;i < size/4;i++)
@@ -519,8 +519,8 @@ static DRIVER_INIT( panicr )
}
- rom = machine.region("gfx3")->base();
- size = machine.region("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
+ size = machine.root_device().memregion("gfx3")->bytes();
// sprites data lines
for (i = 0;i < size/2;i++)
@@ -545,8 +545,8 @@ static DRIVER_INIT( panicr )
//rearrange bg tilemaps a bit....
- rom = machine.region("user1")->base();
- size = machine.region("user1")->bytes();
+ rom = machine.root_device().memregion("user1")->base();
+ size = machine.root_device().memregion("user1")->bytes();
memcpy(buf,rom, size);
{
@@ -558,8 +558,8 @@ static DRIVER_INIT( panicr )
}
}
- rom = machine.region("user2")->base();
- size = machine.region("user2")->bytes();
+ rom = machine.root_device().memregion("user2")->base();
+ size = machine.root_device().memregion("user2")->bytes();
memcpy(buf,rom, size);
{
diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c
index 0942e495b06..2acf3bbd8ca 100644
--- a/src/mame/drivers/paradise.c
+++ b/src/mame/drivers/paradise.c
@@ -47,7 +47,7 @@ penky: we need to delay the irqs at startup or it won't boot. Either one of
WRITE8_MEMBER(paradise_state::paradise_rombank_w)
{
int bank = data;
- int bank_n = machine().region("maincpu")->bytes() / 0x4000 - 1;
+ int bank_n = memregion("maincpu")->bytes() / 0x4000 - 1;
if (bank >= bank_n)
{
@@ -629,8 +629,8 @@ GFXDECODE_END
static MACHINE_START( paradise )
{
paradise_state *state = machine.driver_data<paradise_state>();
- int bank_n = machine.region("maincpu")->bytes() / 0x4000 - 1;
- UINT8 *ROM = machine.region("maincpu")->base();
+ int bank_n = machine.root_device().memregion("maincpu")->bytes() / 0x4000 - 1;
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 3, &ROM[0x00000], 0x4000);
state->membank("bank1")->configure_entries(3, bank_n - 3, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/parodius.c b/src/mame/drivers/parodius.c
index 1886a213dcb..8cb82ef642d 100644
--- a/src/mame/drivers/parodius.c
+++ b/src/mame/drivers/parodius.c
@@ -248,7 +248,7 @@ static const k05324x_interface parodius_k05324x_intf =
static MACHINE_START( parodius )
{
parodius_state *state = machine.driver_data<parodius_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 14, &ROM[0x10000], 0x4000);
state->membank("bank1")->configure_entries(14, 2, &ROM[0x08000], 0x4000);
diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c
index 79959763be4..956f66aaf46 100644
--- a/src/mame/drivers/pasha2.c
+++ b/src/mame/drivers/pasha2.c
@@ -127,7 +127,7 @@ WRITE16_MEMBER(pasha2_state::pasha2_misc_w)
case 0xb000:
case 0xc000:
case 0xd000:
- membank("bank1")->set_base(machine().region("user2")->base() + 0x400 * (bank - 0x8000)); break;
+ membank("bank1")->set_base(machine().root_device().memregion("user2")->base() + 0x400 * (bank - 0x8000)); break;
}
}
}
@@ -476,7 +476,7 @@ static DRIVER_INIT( pasha2 )
pasha2_state *state = machine.driver_data<pasha2_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x95744, 0x95747, read16_delegate(FUNC(pasha2_state::pasha2_speedup_r), state));
- state->membank("bank1")->set_base(machine.region("user2")->base());
+ state->membank("bank1")->set_base(state->memregion("user2")->base());
}
GAME( 1998, pasha2, 0, pasha2, pasha2, pasha2, ROT0, "Dong Sung", "Pasha Pasha 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/pastelg.c b/src/mame/drivers/pastelg.c
index 8e389083676..8aba35434de 100644
--- a/src/mame/drivers/pastelg.c
+++ b/src/mame/drivers/pastelg.c
@@ -45,7 +45,7 @@ static DRIVER_INIT( pastelg )
READ8_MEMBER(pastelg_state::pastelg_sndrom_r)
{
- UINT8 *ROM = machine().region("voice")->base();
+ UINT8 *ROM = memregion("voice")->base();
return ROM[pastelg_blitter_src_addr_r(&space) & 0x7fff];
}
diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c
index 755568a13f9..99c884ef595 100644
--- a/src/mame/drivers/pbaction.c
+++ b/src/mame/drivers/pbaction.c
@@ -481,7 +481,7 @@ READ8_MEMBER(pbaction_state::pbactio3_prot_kludge_r)
static DRIVER_INIT( pbactio3 )
{
int i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* first of all, do a simple bitswap */
for (i = 0; i < 0xc000; i++)
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index 4850f63b4b9..4c114f72546 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -232,7 +232,7 @@ static MACHINE_START( streetg2 )
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, streetg2_set_keyb_int);
- machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.region("game_prg")->base(), 0x8000 );
+ machine.root_device().membank("rombank")->configure_entries(0, 0x80, machine.root_device().memregion("game_prg")->base(), 0x8000 );
machine.root_device().membank("rombank")->set_entry(0);
//microtouch_init(machine, pcat_nit_microtouch_tx_callback, NULL);
diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c
index 56698948441..79311e0ca69 100644
--- a/src/mame/drivers/pcktgal.c
+++ b/src/mame/drivers/pcktgal.c
@@ -24,7 +24,7 @@
WRITE8_MEMBER(pcktgal_state::pcktgal_bank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (data & 1) { membank("bank1")->set_base(&RAM[0x4000]); }
else { membank("bank1")->set_base(&RAM[0x10000]); }
@@ -413,7 +413,7 @@ static DRIVER_INIT( deco222 )
int A;
address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
space->set_decrypted_region(0x8000, 0xffff, decrypted);
@@ -421,17 +421,17 @@ static DRIVER_INIT( deco222 )
for (A = 0x8000;A < 0x18000;A++)
decrypted[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1);
- machine.root_device().membank("bank3")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank3")->configure_decrypted_entries(0, 2, &decrypted[0x8000], 0x4000);
}
static DRIVER_INIT( graphics )
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i,j,temp[16];
- machine.root_device().membank("bank3")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
/* Tile graphics roms have some swapped lines, original version only */
for (i = 0x00000;i < len;i += 32)
diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c
index 9e47424084a..f9314561cca 100644
--- a/src/mame/drivers/pcxt.c
+++ b/src/mame/drivers/pcxt.c
@@ -109,7 +109,7 @@ static SCREEN_UPDATE_RGB32( tetriskr )
pcxt_state *state = screen.machine().driver_data<pcxt_state>();
int x,y;
int yi;
- const UINT8 *bg_rom = screen.machine().region("gfx2")->base();
+ const UINT8 *bg_rom = state->memregion("gfx2")->base();
//popmessage("%04x",m_start_offs);
@@ -199,7 +199,7 @@ WRITE8_MEMBER(pcxt_state::disk_iobank_w)
if (newbank != m_bank)
{
m_bank = newbank;
- membank("bank1")->set_base(machine().region("game_prg")->base() + 0x10000 * m_bank );
+ membank("bank1")->set_base(machine().root_device().memregion("game_prg")->base() + 0x10000 * m_bank );
}
m_lastvalue = data;
diff --git a/src/mame/drivers/pengadvb.c b/src/mame/drivers/pengadvb.c
index 53c5fe68e68..e31c6ef0694 100644
--- a/src/mame/drivers/pengadvb.c
+++ b/src/mame/drivers/pengadvb.c
@@ -60,7 +60,7 @@ static void mem_map_banks(running_machine &machine)
case 0:
// BIOS
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
- state->membank("bank1")->set_base(machine.region("maincpu")->base());
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base());
break;
default:
@@ -75,16 +75,16 @@ static void mem_map_banks(running_machine &machine)
// BIOS
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
- state->membank("bank21")->set_base(machine.region("maincpu")->base() + 0x4000);
- state->membank("bank22")->set_base(machine.region("maincpu")->base() + 0x4000 + 0x2000);
+ state->membank("bank21")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000);
+ state->membank("bank22")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000 + 0x2000);
break;
case 1:
// game
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
- state->membank("bank21")->set_base(machine.region("game")->base() + state->m_mem_banks[0]*0x2000);
- state->membank("bank22")->set_base(machine.region("game")->base() + state->m_mem_banks[1]*0x2000);
+ state->membank("bank21")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[0]*0x2000);
+ state->membank("bank22")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[1]*0x2000);
break;
default:
@@ -99,8 +99,8 @@ static void mem_map_banks(running_machine &machine)
// game
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0x9fff, "bank31" );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xbfff, "bank32" );
- state->membank("bank31")->set_base(machine.region("game")->base() + state->m_mem_banks[2]*0x2000);
- state->membank("bank32")->set_base(machine.region("game")->base() + state->m_mem_banks[3]*0x2000);
+ state->membank("bank31")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[2]*0x2000);
+ state->membank("bank32")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[3]*0x2000);
break;
default:
@@ -289,8 +289,8 @@ MACHINE_CONFIG_END
static void pengadvb_decrypt(running_machine &machine, const char* region)
{
- UINT8 *mem = machine.region(region)->base();
- int memsize = machine.region(region)->bytes();
+ UINT8 *mem = machine.root_device().memregion(region)->base();
+ int memsize = machine.root_device().memregion(region)->bytes();
UINT8 *buf;
int i;
diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c
index bc264e929e8..ce8dc12ffa1 100644
--- a/src/mame/drivers/pengo.c
+++ b/src/mame/drivers/pengo.c
@@ -692,7 +692,7 @@ static DRIVER_INIT( penta )
};
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 117637f2377..3234f3bb94f 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -285,7 +285,7 @@ static const mc6845_interface mc6845_intf =
static void peplus_load_superdata(running_machine &machine, const char *bank_name)
{
peplus_state *state = machine.driver_data<peplus_state>();
- UINT8 *super_data = machine.region(bank_name)->base();
+ UINT8 *super_data = state->memregion(bank_name)->base();
/* Distribute Superboard Data */
memcpy(state->m_s3000_ram, &super_data[0x3000], 0x1000);
@@ -700,7 +700,7 @@ static SCREEN_UPDATE_IND16( peplus )
static PALETTE_INIT( peplus )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* prom bits
7654 3210
---- -xxx red component.
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index d6b88c029dc..4a29c150b02 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -3570,11 +3570,11 @@ ROM_END
static void expand_32x32x5bpp(running_machine &machine)
{
- UINT8 *src = machine.region( "tiles" )->base();
+ UINT8 *src = machine.root_device().memregion( "tiles" )->base();
gfx_layout glcopy;
glcopy = *(&pgm32_charlayout);
- size_t srcsize = machine.region( "tiles" )->bytes();
+ size_t srcsize = machine.root_device().memregion( "tiles" )->bytes();
int cnt, pix;
size_t gfx2_size_needed = ((srcsize/5)*8)+0x1000;
UINT8 *dst = auto_alloc_array(machine, UINT8, gfx2_size_needed);
@@ -3613,8 +3613,8 @@ static void expand_32x32x5bpp(running_machine &machine)
static void expand_colourdata( running_machine &machine )
{
pgm_state *state = machine.driver_data<pgm_state>();
- UINT8 *src = machine.region( "sprcol" )->base();
- size_t srcsize = machine.region( "sprcol" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "sprcol" )->base();
+ size_t srcsize = state->memregion( "sprcol" )->bytes();
int cnt;
size_t needed = srcsize / 2 * 3;
@@ -3645,7 +3645,7 @@ void pgm_basic_init( running_machine &machine, bool set_bank)
{
pgm_state *state = machine.driver_data<pgm_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
if (set_bank) state->membank("bank1")->set_base(&ROM[0x100000]);
expand_32x32x5bpp(machine);
diff --git a/src/mame/drivers/pgm2.c b/src/mame/drivers/pgm2.c
index 20652475e95..6f643622218 100644
--- a/src/mame/drivers/pgm2.c
+++ b/src/mame/drivers/pgm2.c
@@ -286,7 +286,7 @@ static void iga_u12_decode(UINT16* rom, int len, int ixor)
static DRIVER_INIT( orleg2 )
{
- UINT16 *src = (UINT16 *)machine.region("spritesa")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("spritesa")->base();
iga_u12_decode(src, 0x2000000, 0x4761);
iga_u16_decode(src, 0x2000000, 0xc79f);
@@ -294,7 +294,7 @@ static DRIVER_INIT( orleg2 )
static DRIVER_INIT( kov2nl )
{
- UINT16 *src = (UINT16 *)machine.region("spritesa")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("spritesa")->base();
iga_u12_decode(src, 0x2000000, 0xa193);
iga_u16_decode(src, 0x2000000, 0xb780);
diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c
index fce13e77f0b..565c6b5b3e2 100644
--- a/src/mame/drivers/phoenix.c
+++ b/src/mame/drivers/phoenix.c
@@ -446,7 +446,7 @@ static const ay8910_interface survival_ay8910_interface =
static MACHINE_RESET( phoenix )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base() + 0x4000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000);
}
diff --git a/src/mame/drivers/photon.c b/src/mame/drivers/photon.c
index 9b7307f774d..67d4ec9f553 100644
--- a/src/mame/drivers/photon.c
+++ b/src/mame/drivers/photon.c
@@ -33,8 +33,8 @@ public:
static void pk8000_set_bank(running_machine &machine,UINT8 data)
{
- UINT8 *rom = machine.region("maincpu")->base();
- UINT8 *ram = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ram = machine.root_device().memregion("maincpu")->base();
UINT8 block1 = data & 3;
UINT8 block2 = (data >> 2) & 3;
UINT8 block3 = (data >> 4) & 3;
@@ -199,7 +199,7 @@ static VIDEO_START( photon )
static SCREEN_UPDATE_IND16( photon )
{
- return pk8000_video_update(screen, bitmap, cliprect, screen.machine().region("maincpu")->base());
+ return pk8000_video_update(screen, bitmap, cliprect, screen.machine().root_device().memregion("maincpu")->base());
}
static MACHINE_CONFIG_START( photon, photon_state )
diff --git a/src/mame/drivers/photon2.c b/src/mame/drivers/photon2.c
index 5650e451a67..dca0437c2a5 100644
--- a/src/mame/drivers/photon2.c
+++ b/src/mame/drivers/photon2.c
@@ -198,7 +198,7 @@ WRITE8_MEMBER(photon2_state::photon2_membank_w)
logerror( "Unknown banking write: %02X\n", data);
}
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x4000*bank );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x4000*bank );
}
READ8_MEMBER(photon2_state::photon2_fe_r)
@@ -312,7 +312,7 @@ static TIMER_DEVICE_CALLBACK( spec_interrupt_hack )
static MACHINE_RESET( photon2 )
{
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base());
}
static MACHINE_CONFIG_START( photon2, photon2_state )
diff --git a/src/mame/drivers/pingpong.c b/src/mame/drivers/pingpong.c
index 2d492da3d51..58404d5e6d2 100644
--- a/src/mame/drivers/pingpong.c
+++ b/src/mame/drivers/pingpong.c
@@ -36,7 +36,7 @@ WRITE8_MEMBER(pingpong_state::cashquiz_question_bank_low_w)
static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" };
const char *bank = bankname[data & 7];
int bankaddr = m_question_addr_high | ((data - 0x60) * 0x100);
- UINT8 *questions = machine().region("user1")->base() + bankaddr;
+ UINT8 *questions = memregion("user1")->base() + bankaddr;
membank(bank)->set_base(questions);
}
@@ -559,7 +559,7 @@ ROM_END
static DRIVER_INIT( merlinmm )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* decrypt program code */
@@ -573,12 +573,12 @@ static DRIVER_INIT( cashquiz )
int i;
/* decrypt program code */
- ROM = machine.region("maincpu")->base();
+ ROM = machine.root_device().memregion("maincpu")->base();
for( i = 0; i < 0x4000; i++ )
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
/* decrypt questions */
- ROM = machine.region("user1")->base();
+ ROM = machine.root_device().memregion("user1")->base();
for( i = 0; i < 0x40000; i++ )
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
@@ -598,14 +598,14 @@ static DRIVER_INIT( cashquiz )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5700, 0x57ff, "bank8");
// setup default banks
- state->membank("bank1")->set_base(machine.region("user1")->base() + 0x100*0 );
- state->membank("bank2")->set_base(machine.region("user1")->base() + 0x100*1 );
- state->membank("bank3")->set_base(machine.region("user1")->base() + 0x100*2 );
- state->membank("bank4")->set_base(machine.region("user1")->base() + 0x100*3 );
- state->membank("bank5")->set_base(machine.region("user1")->base() + 0x100*4 );
- state->membank("bank6")->set_base(machine.region("user1")->base() + 0x100*5 );
- state->membank("bank7")->set_base(machine.region("user1")->base() + 0x100*6 );
- state->membank("bank8")->set_base(machine.region("user1")->base() + 0x100*7 );
+ state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + 0x100*0 );
+ state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base() + 0x100*1 );
+ state->membank("bank3")->set_base(machine.root_device().memregion("user1")->base() + 0x100*2 );
+ state->membank("bank4")->set_base(machine.root_device().memregion("user1")->base() + 0x100*3 );
+ state->membank("bank5")->set_base(machine.root_device().memregion("user1")->base() + 0x100*4 );
+ state->membank("bank6")->set_base(machine.root_device().memregion("user1")->base() + 0x100*5 );
+ state->membank("bank7")->set_base(machine.root_device().memregion("user1")->base() + 0x100*6 );
+ state->membank("bank8")->set_base(state->memregion("user1")->base() + 0x100*7 );
}
diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c
index 35173ef31ad..c2d8277f922 100644
--- a/src/mame/drivers/pipedrm.c
+++ b/src/mame/drivers/pipedrm.c
@@ -595,11 +595,11 @@ static MACHINE_START( pipedrm )
state->m_subcpu = machine.device("sub");
/* initialize main Z80 bank */
- state->membank("bank1")->configure_entries(0, 8, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ state->membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
state->membank("bank1")->set_entry(0);
/* initialize sound bank */
- state->membank("bank2")->configure_entries(0, 2, machine.region("sub")->base() + 0x10000, 0x8000);
+ state->membank("bank2")->configure_entries(0, 2, state->memregion("sub")->base() + 0x10000, 0x8000);
state->membank("bank2")->set_entry(0);
/* state save */
diff --git a/src/mame/drivers/pipeline.c b/src/mame/drivers/pipeline.c
index 4bf8a2308f4..e35f64602cb 100644
--- a/src/mame/drivers/pipeline.c
+++ b/src/mame/drivers/pipeline.c
@@ -367,8 +367,8 @@ static const ym2203_interface ym2203_config =
static PALETTE_INIT(pipeline)
{
int r,g,b,i,c;
- UINT8 *prom1 = &machine.region("proms")->base()[0x000];
- UINT8 *prom2 = &machine.region("proms")->base()[0x100];
+ UINT8 *prom1 = &machine.root_device().memregion("proms")->base()[0x000];
+ UINT8 *prom2 = &machine.root_device().memregion("proms")->base()[0x100];
for(i=0;i<0x100;i++)
{
diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c
index 1b588e5942a..31b6e92e4d1 100644
--- a/src/mame/drivers/pirates.c
+++ b/src/mame/drivers/pirates.c
@@ -342,11 +342,11 @@ static void pirates_decrypt_68k(running_machine &machine)
UINT16 *buf, *rom;
int i;
- rom_size = machine.region("maincpu")->bytes();
+ rom_size = machine.root_device().memregion("maincpu")->bytes();
buf = auto_alloc_array(machine, UINT16, rom_size/2);
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/2; i++)
@@ -371,11 +371,11 @@ static void pirates_decrypt_p(running_machine &machine)
UINT8 *buf, *rom;
int i;
- rom_size = machine.region("gfx1")->bytes();
+ rom_size = machine.root_device().memregion("gfx1")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("gfx1")->base();
+ rom = machine.root_device().memregion("gfx1")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/4; i++)
@@ -395,11 +395,11 @@ static void pirates_decrypt_s(running_machine &machine)
UINT8 *buf, *rom;
int i;
- rom_size = machine.region("gfx2")->bytes();
+ rom_size = machine.root_device().memregion("gfx2")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("gfx2")->base();
+ rom = machine.root_device().memregion("gfx2")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/4; i++)
@@ -420,11 +420,11 @@ static void pirates_decrypt_oki(running_machine &machine)
UINT8 *buf, *rom;
int i;
- rom_size = machine.region("oki")->bytes();
+ rom_size = machine.root_device().memregion("oki")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("oki")->base();
+ rom = machine.root_device().memregion("oki")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size; i++)
@@ -438,7 +438,7 @@ static void pirates_decrypt_oki(running_machine &machine)
static DRIVER_INIT( pirates )
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
pirates_decrypt_68k(machine);
pirates_decrypt_p(machine);
diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c
index 2fe7649da6c..4e09041b32f 100644
--- a/src/mame/drivers/playmark.c
+++ b/src/mame/drivers/playmark.c
@@ -167,7 +167,7 @@ static WRITE8_DEVICE_HANDLER( playmark_oki_banking_w )
{
state->m_old_oki_bank = data & 7;
- if (((state->m_old_oki_bank - 1) * 0x40000) < device->machine().region("oki")->bytes())
+ if (((state->m_old_oki_bank - 1) * 0x40000) < state->memregion("oki")->bytes())
{
downcast<okim6295_device *>(device)->set_bank_base(0x40000 * (state->m_old_oki_bank - 1));
}
@@ -1678,8 +1678,8 @@ static UINT8 playmark_asciitohex(UINT8 data)
static DRIVER_INIT( bigtwin )
{
playmark_state *state = machine.driver_data<playmark_state>();
- UINT8 *playmark_PICROM_HEX = machine.region("user1")->base();
- UINT16 *playmark_PICROM = (UINT16 *)machine.region("audiocpu")->base();
+ UINT8 *playmark_PICROM_HEX = machine.root_device().memregion("user1")->base();
+ UINT16 *playmark_PICROM = (UINT16 *)state->memregion("audiocpu")->base();
INT32 offs, data;
UINT16 src_pos = 0;
UINT16 dst_pos = 0;
diff --git a/src/mame/drivers/pluto5.c b/src/mame/drivers/pluto5.c
index e8ecb606992..e22c4bee9c4 100644
--- a/src/mame/drivers/pluto5.c
+++ b/src/mame/drivers/pluto5.c
@@ -499,18 +499,18 @@ extern void astra_addresslines( UINT16* src, size_t srcsize, int small );
static DRIVER_INIT( hb )
{
- astra_addresslines( (UINT16*)machine.region( "maincpu" )->base(), machine.region( "maincpu" )->bytes(), 0 );
+ astra_addresslines( (UINT16*)machine.root_device().memregion( "maincpu" )->base(), machine.root_device().memregion( "maincpu" )->bytes(), 0 );
#if 0
{
- UINT8* ROM = machine.region( "maincpu" )->base();
+ UINT8* ROM = machine.root_device().memregion( "maincpu" )->base();
FILE *fp;
char filename[256];
sprintf(filename,"%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
- fwrite(ROM, machine.region( "maincpu" )->bytes(), 1, fp);
+ fwrite(ROM, machine.root_device().memregion( "maincpu" )->bytes(), 1, fp);
fclose(fp);
}
}
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index 4efa4f030e4..cbffc795c00 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -135,7 +135,7 @@ WRITE32_MEMBER(polygonet_state::polygonet_eeprom_w)
READ32_MEMBER(polygonet_state::ttl_rom_r)
{
UINT32 *ROM;
- ROM = (UINT32 *)machine().region("gfx1")->base();
+ ROM = (UINT32 *)machine().root_device().memregion("gfx1")->base();
return ROM[offset];
}
@@ -144,7 +144,7 @@ READ32_MEMBER(polygonet_state::ttl_rom_r)
READ32_MEMBER(polygonet_state::psac_rom_r)
{
UINT32 *ROM;
- ROM = (UINT32 *)machine().region("gfx2")->base();
+ ROM = (UINT32 *)machine().root_device().memregion("gfx2")->base();
return ROM[offset];
}
@@ -545,7 +545,7 @@ ADDRESS_MAP_END
static void reset_sound_region(running_machine &machine)
{
polygonet_state *state = machine.driver_data<polygonet_state>();
- state->membank("bank2")->set_base(machine.region("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
+ state->membank("bank2")->set_base(state->memregion("soundcpu")->base() + 0x10000 + state->m_cur_sound_region*0x4000);
}
WRITE8_MEMBER(polygonet_state::sound_bankswitch_w)
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index de120edd67c..21040bf00b0 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -378,7 +378,7 @@ ROM_END
static DRIVER_INIT(pip)
{
-// UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+// UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// rom[0x2696/2] = 0x4e71;
// rom[0x26a0/2] = 0x4e71;
pc_vga_init(machine, vga_setting, NULL);
diff --git a/src/mame/drivers/pokechmp.c b/src/mame/drivers/pokechmp.c
index 4f052fc20c0..05ff356853b 100644
--- a/src/mame/drivers/pokechmp.c
+++ b/src/mame/drivers/pokechmp.c
@@ -53,7 +53,7 @@ ClawGrip, Jul 2006
WRITE8_MEMBER(pokechmp_state::pokechmp_bank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (data == 0x00)
{
@@ -262,7 +262,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( pokechmp )
{
- machine.root_device().membank("bank3")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/poker72.c b/src/mame/drivers/poker72.c
index fa94061849a..5c4d2e8ab27 100644
--- a/src/mame/drivers/poker72.c
+++ b/src/mame/drivers/poker72.c
@@ -77,7 +77,7 @@ WRITE8_MEMBER(poker72_state::poker72_paletteram_w)
WRITE8_MEMBER(poker72_state::output_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
printf("%02x\n",data);
@@ -339,7 +339,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_RESET( poker72 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&ROM[0]);
}
@@ -393,7 +393,7 @@ ROM_END
static DRIVER_INIT( poker72 )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x4a9] = 0x28;
}
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index e86e26640d8..c2503fd91bd 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -378,9 +378,9 @@ static const namco_51xx_interface namco_51xx_intf =
static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
{
- UINT32 length = device->machine().region("52xx")->bytes();
+ UINT32 length = device->machine().root_device().memregion("52xx")->bytes();
logerror("ROM @ %04X\n", offset);
- return (offset < length) ? device->machine().region("52xx")->base()[offset] : 0xff;
+ return (offset < length) ? device->machine().root_device().memregion("52xx")->base()[offset] : 0xff;
}
static READ8_DEVICE_HANDLER( namco_52xx_si_r )
diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c
index 5a8ade99473..3b2b34d20d0 100644
--- a/src/mame/drivers/policetr.c
+++ b/src/mame/drivers/policetr.c
@@ -186,7 +186,7 @@ CUSTOM_INPUT_MEMBER(policetr_state::bsmt_status_r)
READ32_MEMBER(policetr_state::bsmt2000_data_r)
{
- return machine().region("bsmt")->base()[m_bsmt_data_bank * 0x10000 + m_bsmt_data_offset] << 8;
+ return memregion("bsmt")->base()[m_bsmt_data_bank * 0x10000 + m_bsmt_data_offset] << 8;
}
diff --git a/src/mame/drivers/poo.c b/src/mame/drivers/poo.c
index 3696edbaf4b..9678240ae6d 100644
--- a/src/mame/drivers/poo.c
+++ b/src/mame/drivers/poo.c
@@ -291,7 +291,7 @@ GFXDECODE_END
static PALETTE_INIT( unclepoo )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
diff --git a/src/mame/drivers/poolshrk.c b/src/mame/drivers/poolshrk.c
index 9d353d25917..200fc8268d3 100644
--- a/src/mame/drivers/poolshrk.c
+++ b/src/mame/drivers/poolshrk.c
@@ -14,8 +14,8 @@ Atari Poolshark Driver
static DRIVER_INIT( poolshrk )
{
- UINT8* pSprite = machine.region("gfx1")->base();
- UINT8* pOffset = machine.region("proms")->base();
+ UINT8* pSprite = machine.root_device().memregion("gfx1")->base();
+ UINT8* pOffset = machine.root_device().memregion("proms")->base();
int i;
int j;
diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c
index 96d97d20b88..7c005c4cf60 100644
--- a/src/mame/drivers/popeye.c
+++ b/src/mame/drivers/popeye.c
@@ -620,7 +620,7 @@ static DRIVER_INIT( skyskipr )
{
popeye_state *state = machine.driver_data<popeye_state>();
UINT8 *buffer;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int len = 0x10000;
/* decrypt the program ROMs */
@@ -642,7 +642,7 @@ static DRIVER_INIT( popeye )
{
popeye_state *state = machine.driver_data<popeye_state>();
UINT8 *buffer;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int len = 0x10000;
/* decrypt the program ROMs */
diff --git a/src/mame/drivers/powerbal.c b/src/mame/drivers/powerbal.c
index 7261176cbff..d0e31cf69ea 100644
--- a/src/mame/drivers/powerbal.c
+++ b/src/mame/drivers/powerbal.c
@@ -70,7 +70,7 @@ static WRITE16_DEVICE_HANDLER( oki_banking )
{
int addr = 0x40000 * ((data & 3) - 1);
- if (addr < device->machine().region("oki")->bytes())
+ if (addr < device->machine().root_device().memregion("oki")->bytes())
downcast<okim6295_device *>(device)->set_bank_base(addr);
}
}
diff --git a/src/mame/drivers/powerins.c b/src/mame/drivers/powerins.c
index 1f014df42dd..86678701c1c 100644
--- a/src/mame/drivers/powerins.c
+++ b/src/mame/drivers/powerins.c
@@ -48,7 +48,7 @@ WRITE16_MEMBER(powerins_state::powerins_okibank_w)
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = machine().region("oki1")->base();
+ UINT8 *RAM = memregion("oki1")->base();
int new_bank = data & 0x7;
if (new_bank != m_oki_bank)
diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c
index 4a1ec5b1016..5a3a2a34dc3 100644
--- a/src/mame/drivers/ppmast93.c
+++ b/src/mame/drivers/ppmast93.c
@@ -171,7 +171,7 @@ WRITE8_MEMBER(ppmast93_state::ppmast93_bgram_w)
WRITE8_MEMBER(ppmast93_state::ppmast93_port4_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int bank;
coin_counter_w(machine(), 0, data & 0x08);
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index ee28c4ef725..a3b3ed59fea 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -212,7 +212,7 @@ READ8_MEMBER(progolf_state::audio_command_r)
READ8_MEMBER(progolf_state::progolf_videoram_r)
{
UINT8 *videoram = m_videoram;
- UINT8 *gfx_rom = machine().region("gfx1")->base();
+ UINT8 *gfx_rom = memregion("gfx1")->base();
if (offset >= 0x0800)
{
@@ -389,7 +389,7 @@ static const mc6845_interface mc6845_intf =
static PALETTE_INIT( progolf )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
@@ -502,7 +502,7 @@ static DRIVER_INIT( progolf )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);
@@ -516,7 +516,7 @@ static DRIVER_INIT( progolfa )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index ad5bf4d1cff..d8b74ab13d5 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -1811,8 +1811,8 @@ static DRIVER_INIT( sngkace )
psikyo_state *state = machine.driver_data<psikyo_state>();
{
- UINT8 *RAM = machine.region("ymsnd")->base();
- int len = machine.region("ymsnd")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("ymsnd")->base();
+ int len = state->memregion("ymsnd")->bytes();
int i;
/* Bit 6&7 of the samples are swapped. Naughty, naughty... */
@@ -1832,13 +1832,13 @@ static DRIVER_INIT( sngkace )
state->m_ka302c_banking = 0; // SH201B doesn't have any gfx banking
/* setup audiocpu banks */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x8000);
/* Enable other regions */
#if 0
if (!strcmp(machine.system().name,"sngkace"))
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x995] = 0x4e;
ROM[0x994] = 0x71;
ROM[0x997] = 0x4e;
@@ -1892,7 +1892,7 @@ static DRIVER_INIT( tengai )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( gunbird )
@@ -1909,7 +1909,7 @@ static DRIVER_INIT( gunbird )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
@@ -1933,7 +1933,7 @@ static DRIVER_INIT( s1945 )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945a )
@@ -1956,7 +1956,7 @@ static DRIVER_INIT( s1945a )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945j )
@@ -1979,7 +1979,7 @@ static DRIVER_INIT( s1945j )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945jn )
@@ -1996,7 +1996,7 @@ static DRIVER_INIT( s1945jn )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- state->membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945bl )
@@ -2011,7 +2011,7 @@ static DRIVER_INIT( s1945bl )
state->m_ka302c_banking = 1;
- state->membank("okibank")->configure_entries(0, 4, machine.region("oki")->base() + 0x30000, 0x10000);
+ state->membank("okibank")->configure_entries(0, 4, state->memregion("oki")->base() + 0x30000, 0x10000);
state->membank("okibank")->set_entry(0);
}
diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c
index 2e83eae39d8..be4c724236d 100644
--- a/src/mame/drivers/psikyo4.c
+++ b/src/mame/drivers/psikyo4.c
@@ -319,7 +319,7 @@ WRITE32_MEMBER(psikyo4_state::ps4_vidregs_w)
if (offset == 2) /* Configure bank for gfx test */
{
if (ACCESSING_BITS_0_15) // Bank
- membank("bank2")->set_base(machine().region("gfx1")->base() + 0x2000 * (m_vidregs[offset] & 0x1fff)); /* Bank comes from vidregs */
+ membank("bank2")->set_base(machine().root_device().memregion("gfx1")->base() + 0x2000 * (m_vidregs[offset] & 0x1fff)); /* Bank comes from vidregs */
}
}
@@ -328,8 +328,8 @@ WRITE32_MEMBER(psikyo4_state::ps4_vidregs_w)
static void set_hotgmck_pcm_bank( running_machine &machine, int n )
{
psikyo4_state *state = machine.driver_data<psikyo4_state>();
- UINT8 *ymf_pcmbank = machine.region("ymf")->base() + 0x200000;
- UINT8 *pcm_rom = machine.region("ymfsource")->base();
+ UINT8 *ymf_pcmbank = machine.root_device().memregion("ymf")->base() + 0x200000;
+ UINT8 *pcm_rom = state->memregion("ymfsource")->base();
memcpy(ymf_pcmbank + n * 0x100000, pcm_rom + PCM_BANK_NO_LEGACY(n) * 0x100000, 0x100000);
}
@@ -955,8 +955,8 @@ static void hotgmck_pcm_bank_postload(running_machine &machine)
static void install_hotgmck_pcm_bank(running_machine &machine)
{
psikyo4_state *state = machine.driver_data<psikyo4_state>();
- UINT8 *ymf_pcm = machine.region("ymf")->base();
- UINT8 *pcm_rom = machine.region("ymfsource")->base();
+ UINT8 *ymf_pcm = machine.root_device().memregion("ymf")->base();
+ UINT8 *pcm_rom = state->memregion("ymfsource")->base();
memcpy(ymf_pcm, pcm_rom, 0x200000);
@@ -970,7 +970,7 @@ static void install_hotgmck_pcm_bank(running_machine &machine)
static DRIVER_INIT( hotgmck )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
install_hotgmck_pcm_bank(machine); // Banked PCM ROM
}
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index f936393625c..2bc4fe43708 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -799,7 +799,7 @@ static MACHINE_START( psikyosh )
state->m_maincpu = machine.device("maincpu");
- state->membank("bank2")->configure_entries(0, 0x1000, machine.region("gfx1")->base(), 0x20000);
+ state->membank("bank2")->configure_entries(0, 0x1000, state->memregion("gfx1")->base(), 0x20000);
}
@@ -1218,7 +1218,7 @@ static DRIVER_INIT( s1945ii )
static DRIVER_INIT( daraku )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
@@ -1230,14 +1230,14 @@ static DRIVER_INIT( sbomberb )
static DRIVER_INIT( gunbird2 )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( s1945iii )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&RAM[0x100000]);
sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
diff --git a/src/mame/drivers/psychic5.c b/src/mame/drivers/psychic5.c
index 9f0cba2db16..8deb4472291 100644
--- a/src/mame/drivers/psychic5.c
+++ b/src/mame/drivers/psychic5.c
@@ -354,7 +354,7 @@ READ8_MEMBER(psychic5_state::psychic5_bankselect_r)
WRITE8_MEMBER(psychic5_state::psychic5_bankselect_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bankaddress;
if (m_bank_latch != data)
@@ -367,7 +367,7 @@ WRITE8_MEMBER(psychic5_state::psychic5_bankselect_w)
WRITE8_MEMBER(psychic5_state::bombsa_bankselect_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bankaddress;
if (m_bank_latch != data)
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index 8d424c46ac7..935e3239844 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -143,7 +143,7 @@ static TILE_GET_INFO( get_pturn_bg_tile_info )
{
pturn_state *state = machine.driver_data<pturn_state>();
int tileno,palno;
- tileno = machine.region("user1")->base()[tile_index];
+ tileno = state->memregion("user1")->base()[tile_index];
palno=state->m_bgpalette;
if(palno==1)
{
diff --git a/src/mame/drivers/puckpkmn.c b/src/mame/drivers/puckpkmn.c
index a9b510d8cea..9838f2406e0 100644
--- a/src/mame/drivers/puckpkmn.c
+++ b/src/mame/drivers/puckpkmn.c
@@ -260,8 +260,8 @@ Screenshots available on my site at http://guru.mameworld.info/oldnews2001.html
static DRIVER_INIT( puckpkmn )
{
- UINT8 *rom = machine.region("maincpu")->base();
- size_t len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ size_t len = machine.root_device().memregion("maincpu")->bytes();
int i;
for (i = 0; i < len; i++)
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index f0bd872467d..3b0a8b08310 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -119,7 +119,7 @@ WRITE16_MEMBER(qdrmfgp_state::gp2_control_w)
READ16_MEMBER(qdrmfgp_state::v_rom_r)
{
device_t *k056832 = machine().device("k056832");
- UINT8 *mem8 = machine().region("gfx1")->base();
+ UINT8 *mem8 = memregion("gfx1")->base();
int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
offset += bank * 0x800 * 4;
@@ -650,7 +650,7 @@ static MACHINE_START( qdrmfgp2 )
static MACHINE_RESET( qdrmfgp )
{
qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
- state->m_sndram = machine.region("konami")->base() + 0x100000;
+ state->m_sndram = state->memregion("konami")->base() + 0x100000;
/* reset the IDE controller */
state->m_gp2_irq_control = 0;
diff --git a/src/mame/drivers/qix.c b/src/mame/drivers/qix.c
index d4812e317f8..907228ffbd0 100644
--- a/src/mame/drivers/qix.c
+++ b/src/mame/drivers/qix.c
@@ -1278,8 +1278,8 @@ static DRIVER_INIT( kram3 )
********************************/
i = 0;
- //patch = machine.region("user1")->base();
- rom = machine.region("maincpu")->base();
+ //patch = machine.root_device().memregion("user1")->base();
+ rom = machine.root_device().memregion("maincpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x6000);
mainspace->set_decrypted_region(0xa000, 0xffff, decrypted);
@@ -1291,8 +1291,8 @@ static DRIVER_INIT( kram3 )
}
i = 0;
- //patch = machine.region("user2")->base();
- rom = machine.region("videocpu")->base();
+ //patch = machine.root_device().memregion("user2")->base();
+ rom = machine.root_device().memregion("videocpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x6000);
videospace->set_decrypted_region(0xa000, 0xffff, decrypted);
@@ -1308,8 +1308,8 @@ static DRIVER_INIT( kram3 )
static DRIVER_INIT( zookeep )
{
/* configure the banking */
- machine.root_device().membank("bank1")->configure_entry(0, machine.region("videocpu")->base() + 0xa000);
- machine.root_device().membank("bank1")->configure_entry(1, machine.region("videocpu")->base() + 0x10000);
+ machine.root_device().membank("bank1")->configure_entry(0, machine.root_device().memregion("videocpu")->base() + 0xa000);
+ machine.root_device().membank("bank1")->configure_entry(1, machine.root_device().memregion("videocpu")->base() + 0x10000);
machine.root_device().membank("bank1")->set_entry(0);
}
diff --git a/src/mame/drivers/queen.c b/src/mame/drivers/queen.c
index 90830e0a781..dbc78a199dd 100644
--- a/src/mame/drivers/queen.c
+++ b/src/mame/drivers/queen.c
@@ -143,7 +143,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
state->membank("bios_bank")->set_base(state->m_bios_ram);
else // disable RAM access (reads go to BIOS ROM)
- state->membank("bios_bank")->set_base(busdevice->machine().region("bios")->base() + 0x10000);
+ state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x10000);
break;
}
case 0x5a: // PAM1
@@ -151,12 +151,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("video_bank1")->set_base(state->m_isa_ram1);
else
- state->membank("video_bank1")->set_base(busdevice->machine().region("video_bios")->base() + 0);
+ state->membank("video_bank1")->set_base(state->memregion("video_bios")->base() + 0);
if (data & 0x10)
state->membank("video_bank2")->set_base(state->m_isa_ram2);
else
- state->membank("video_bank2")->set_base(busdevice->machine().region("video_bios")->base() + 0x4000);
+ state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
break;
}
@@ -165,12 +165,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
else
- state->membank("bios_ext1")->set_base(busdevice->machine().region("bios")->base() + 0);
+ state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0);
if (data & 0x10)
state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram);
else
- state->membank("bios_ext2")->set_base(busdevice->machine().region("bios")->base() + 0x4000);
+ state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x4000);
break;
}
@@ -179,12 +179,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
else
- state->membank("bios_ext3")->set_base(busdevice->machine().region("bios")->base() + 0x8000);
+ state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x8000);
if (data & 0x10)
state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram);
else
- state->membank("bios_ext4")->set_base(busdevice->machine().region("bios")->base() + 0xc000);
+ state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0xc000);
break;
}
@@ -658,13 +658,13 @@ static MACHINE_START( queen )
static MACHINE_RESET( queen )
{
- machine.root_device().membank("bios_bank")->set_base(machine.region("bios")->base() + 0x30000);
- machine.root_device().membank("bios_ext1")->set_base(machine.region("bios")->base() + 0x20000);
- machine.root_device().membank("bios_ext2")->set_base(machine.region("bios")->base() + 0x24000);
- machine.root_device().membank("bios_ext3")->set_base(machine.region("bios")->base() + 0x28000);
- machine.root_device().membank("bios_ext4")->set_base(machine.region("bios")->base() + 0x2c000);
- machine.root_device().membank("video_bank1")->set_base(machine.region("video_bios")->base() + 0);
- machine.root_device().membank("video_bank2")->set_base(machine.region("video_bios")->base() + 0x4000);
+ machine.root_device().membank("bios_bank")->set_base(machine.root_device().memregion("bios")->base() + 0x30000);
+ machine.root_device().membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0x20000);
+ machine.root_device().membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x24000);
+ machine.root_device().membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x28000);
+ machine.root_device().membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0x2c000);
+ machine.root_device().membank("video_bank1")->set_base(machine.root_device().memregion("video_bios")->base() + 0);
+ machine.root_device().membank("video_bank2")->set_base(machine.root_device().memregion("video_bios")->base() + 0x4000);
}
diff --git a/src/mame/drivers/quizdna.c b/src/mame/drivers/quizdna.c
index c25f91b980a..ee034ef275d 100644
--- a/src/mame/drivers/quizdna.c
+++ b/src/mame/drivers/quizdna.c
@@ -18,13 +18,13 @@ Quiz Gekiretsu Scramble (Gakuen Paradise 2) (c) 1993 Face
WRITE8_MEMBER(quizdna_state::quizdna_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(&ROM[0x10000+0x4000*(data & 0x3f)]);
}
WRITE8_MEMBER(quizdna_state::gekiretu_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(&ROM[0x10000+0x4000*((data & 0x3f) ^ 0x0a)]);
}
diff --git a/src/mame/drivers/quizo.c b/src/mame/drivers/quizo.c
index 154627ce8a8..be3e283d555 100644
--- a/src/mame/drivers/quizo.c
+++ b/src/mame/drivers/quizo.c
@@ -51,7 +51,7 @@ static const UINT8 rombankLookup[]={ 2, 3, 4, 4, 4, 4, 4, 5, 0, 1};
static PALETTE_INIT(quizo)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 16;i++)
{
@@ -129,7 +129,7 @@ WRITE8_MEMBER(quizo_state::port60_w)
data=0;
}
m_port60=data;
- membank("bank1")->set_base(&machine().region("user1")->base()[rombankLookup[data]*0x4000] );
+ membank("bank1")->set_base(&machine().root_device().memregion("user1")->base()[rombankLookup[data]*0x4000] );
}
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, quizo_state )
diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c
index 8d8142a1d73..8cf944f466f 100644
--- a/src/mame/drivers/quizpun2.c
+++ b/src/mame/drivers/quizpun2.c
@@ -249,7 +249,7 @@ READ8_MEMBER(quizpun2_state::quizpun2_protection_r)
case STATE_EEPROM_R: // EEPROM read
{
- UINT8 *eeprom = machine().region("eeprom")->base();
+ UINT8 *eeprom = memregion("eeprom")->base();
ret = eeprom[prot.addr];
break;
}
@@ -276,7 +276,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w)
{
case STATE_EEPROM_W:
{
- UINT8 *eeprom = machine().region("eeprom")->base();
+ UINT8 *eeprom = memregion("eeprom")->base();
eeprom[prot.addr] = data;
prot.addr++;
if ((prot.addr % 8) == 0)
@@ -343,7 +343,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w)
WRITE8_MEMBER(quizpun2_state::quizpun2_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(&ROM[ 0x10000 + 0x2000 * (data & 0x1f) ] );
}
diff --git a/src/mame/drivers/quizshow.c b/src/mame/drivers/quizshow.c
index 5fba7464402..c21e9cc69c1 100644
--- a/src/mame/drivers/quizshow.c
+++ b/src/mame/drivers/quizshow.c
@@ -425,8 +425,8 @@ ROM_END
static DRIVER_INIT( quizshow )
{
- UINT8 *gfxdata = machine.region("user1")->base();
- UINT8 *dest = machine.region("gfx1")->base();
+ UINT8 *gfxdata = machine.root_device().memregion("user1")->base();
+ UINT8 *dest = machine.root_device().memregion("gfx1")->base();
int tile, line;
diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c
index eafa8a62c49..3aa310e7fcc 100644
--- a/src/mame/drivers/r2dx_v33.c
+++ b/src/mame/drivers/r2dx_v33.c
@@ -227,7 +227,7 @@ static SCREEN_UPDATE_IND16( rdx_v33 )
if(frame == 5)
{
int i,data;
- static UINT8 *rom = space->machine().region("mainprg")->base();
+ static UINT8 *rom = space->machine().root_device().memregion("mainprg")->base();
for(i=0;i<0x800;i+=2)
{
@@ -733,7 +733,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(rdx_v33)
{
- machine.root_device().membank("bank1")->configure_entries(0, 0x20, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("bank1")->configure_entries(0, 0x20, machine.root_device().memregion("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
@@ -742,7 +742,7 @@ static DRIVER_INIT(rdx_v33)
static DRIVER_INIT(nzerotea)
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
zeroteam_decrypt_sprites(machine);
diff --git a/src/mame/drivers/rabbit.c b/src/mame/drivers/rabbit.c
index fe5385e473c..08c156f8be2 100644
--- a/src/mame/drivers/rabbit.c
+++ b/src/mame/drivers/rabbit.c
@@ -520,7 +520,7 @@ READ32_MEMBER(rabbit_state::randomrabbits)
/* rom bank is used when testing roms, not currently hooked up */
WRITE32_MEMBER(rabbit_state::rabbit_rombank_w)
{
- UINT8 *dataroms = machine().region("gfx1")->base();
+ UINT8 *dataroms = memregion("gfx1")->base();
#if 0
int bank;
printf("rabbit rombank %08x\n",data);
@@ -546,7 +546,7 @@ static TIMER_CALLBACK( rabbit_blit_done )
static void rabbit_do_blit(running_machine &machine)
{
rabbit_state *state = machine.driver_data<rabbit_state>();
- UINT8 *blt_data = machine.region("gfx1")->base();
+ UINT8 *blt_data = state->memregion("gfx1")->base();
int blt_source = (state->m_blitterregs[0]&0x000fffff)>>0;
int blt_column = (state->m_blitterregs[1]&0x00ff0000)>>16;
int blt_line = (state->m_blitterregs[1]&0x000000ff);
diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c
index aee2e4a19a1..bc08876b975 100644
--- a/src/mame/drivers/raiden.c
+++ b/src/mame/drivers/raiden.c
@@ -548,7 +548,7 @@ bit-swapping */
static void common_decrypt(running_machine &machine)
{
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0; i < 0x20000; i++)
@@ -560,7 +560,7 @@ static void common_decrypt(running_machine &machine)
RAM[0xc0000/2 + i] = data;
}
- RAM = (UINT16 *)machine.region("sub")->base();
+ RAM = (UINT16 *)machine.root_device().memregion("sub")->base();
for (i = 0; i < 0x20000; i++)
{
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index 855d59072ce..6412624adda 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -2894,25 +2894,25 @@ ROM_END
static DRIVER_INIT (raiden2)
{
- machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
}
static DRIVER_INIT (raidendx)
{
- machine.root_device().membank("mainbank")->configure_entries(0, 0x10, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("mainbank")->configure_entries(0, 0x10, machine.root_device().memregion("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
}
static DRIVER_INIT (xsedae)
{
/* doesn't have banking */
- //machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ //machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
}
static DRIVER_INIT (zeroteam)
{
- machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.region("mainprg")->base(), 0x20000);
+ machine.root_device().membank("mainbank")->configure_entries(0, 2, machine.root_device().memregion("mainprg")->base(), 0x20000);
zeroteam_decrypt_sprites(machine);
}
diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c
index ffa0f761150..2a88c6f3eca 100644
--- a/src/mame/drivers/rainbow.c
+++ b/src/mame/drivers/rainbow.c
@@ -875,7 +875,7 @@ ROM_END
static DRIVER_INIT( rbisland )
{
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
@@ -884,7 +884,7 @@ static DRIVER_INIT( rbisland )
static DRIVER_INIT( rbislande )
{
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
diff --git a/src/mame/drivers/rampart.c b/src/mame/drivers/rampart.c
index 29435711eb9..7693e1c6760 100644
--- a/src/mame/drivers/rampart.c
+++ b/src/mame/drivers/rampart.c
@@ -479,7 +479,7 @@ ROM_END
static DRIVER_INIT( rampart )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
memcpy(&rom[0x140000], &rom[0x40000], 0x8000);
atarigen_slapstic_init(machine.device("maincpu"), 0x140000, 0x438000, 118);
diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c
index efdb361528d..0a5c01c0218 100644
--- a/src/mame/drivers/rastan.c
+++ b/src/mame/drivers/rastan.c
@@ -177,7 +177,7 @@ static void rastan_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
@@ -359,7 +359,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( rastan )
{
rastan_state *state = machine.driver_data<rastan_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entry(0, &ROM[0x00000]);
state->membank("bank1")->configure_entries(1, 3, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c
index af811ca5db0..b9e79cc83b4 100644
--- a/src/mame/drivers/redclash.c
+++ b/src/mame/drivers/redclash.c
@@ -539,9 +539,9 @@ ROM_END
static DRIVER_INIT( redclash )
{
int i,j;
- const UINT8 *src = machine.region("gfx2")->base();
- UINT8 *dst = machine.region("gfx3")->base();
- int len = machine.region("gfx3")->bytes();
+ const UINT8 *src = machine.root_device().memregion("gfx2")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx3")->base();
+ int len = machine.root_device().memregion("gfx3")->bytes();
/* rearrange the sprite graphics */
for (i = 0;i < len;i++)
diff --git a/src/mame/drivers/relief.c b/src/mame/drivers/relief.c
index 04f4d2fc304..74724654b96 100644
--- a/src/mame/drivers/relief.c
+++ b/src/mame/drivers/relief.c
@@ -444,7 +444,7 @@ ROM_END
static DRIVER_INIT( relief )
{
- UINT8 *sound_base = machine.region("oki")->base();
+ UINT8 *sound_base = machine.root_device().memregion("oki")->base();
/* expand the ADPCM data to avoid lots of memcpy's during gameplay */
/* the upper 128k is fixed, the lower 128k is bankswitched */
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 61b4d5797e9..907aeec9a22 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -165,7 +165,7 @@ static DEVICE_START( renegade_adpcm )
renegade_adpcm_state *state = get_safe_token(device);
state->m_playing = 0;
state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, renegade_adpcm_callback);
- state->m_base = device->machine().region("adpcm")->base();
+ state->m_base = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm.reset();
}
@@ -240,7 +240,7 @@ static const UINT8 kuniokun_xor_table[0x2a] =
static void setbank(running_machine &machine)
{
renegade_state *state = machine.driver_data<renegade_state>();
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&RAM[state->m_bank ? 0x10000 : 0x4000]);
}
diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c
index 511326da0a1..a6567fa8835 100644
--- a/src/mame/drivers/rltennis.c
+++ b/src/mame/drivers/rltennis.c
@@ -162,9 +162,9 @@ static MACHINE_START( rltennis )
state->m_screen = machine.device( "screen");
state->m_dac_1 = machine.device("dac1");
state->m_dac_2 = machine.device("dac2");
- state->m_samples_1 = machine.region("samples1")->base();
- state->m_samples_2 = machine.region("samples2")->base();
- state->m_gfx = machine.region("gfx1")->base();
+ state->m_samples_1 = machine.root_device().memregion("samples1")->base();
+ state->m_samples_2 = machine.root_device().memregion("samples2")->base();
+ state->m_gfx = state->memregion("gfx1")->base();
state->m_timer = machine.scheduler().timer_alloc(FUNC(sample_player));
}
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index af0b4e0c220..186da5fef2e 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -155,7 +155,7 @@ logerror("%04x: keyboard_w %02x\n",cpu_get_pc(&space.device()),data);
READ8_MEMBER(rmhaihai_state::samples_r)
{
- return machine().region("adpcm")->base()[offset];
+ return memregion("adpcm")->base()[offset];
}
static WRITE8_DEVICE_HANDLER( adpcm_w )
@@ -181,7 +181,7 @@ WRITE8_MEMBER(rmhaihai_state::ctrl_w)
WRITE8_MEMBER(rmhaihai_state::themj_rombank_w)
{
- UINT8 *rom = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *rom = memregion("maincpu")->base() + 0x10000;
int bank = data & 0x03;
logerror("banksw %d\n",bank);
membank("bank1")->set_base(rom + bank*0x4000);
@@ -665,8 +665,8 @@ ROM_END
static DRIVER_INIT( rmhaihai )
{
- UINT8 *rom = machine.region("gfx1")->base();
- int size = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int size = machine.root_device().memregion("gfx1")->bytes();
int a,b;
size /= 2;
diff --git a/src/mame/drivers/rockrage.c b/src/mame/drivers/rockrage.c
index 737c877a0a5..4823fbb7eb6 100644
--- a/src/mame/drivers/rockrage.c
+++ b/src/mame/drivers/rockrage.c
@@ -237,7 +237,7 @@ static const k007420_interface rockrage_k007420_intf =
static MACHINE_START( rockrage )
{
rockrage_state *state = machine.driver_data<rockrage_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/rocnrope.c b/src/mame/drivers/rocnrope.c
index 82717fc1e67..046bd89cd85 100644
--- a/src/mame/drivers/rocnrope.c
+++ b/src/mame/drivers/rocnrope.c
@@ -25,7 +25,7 @@
/* Roc'n'Rope has the IRQ vectors in RAM. The rom contains $FFFF at this address! */
WRITE8_MEMBER(rocnrope_state::rocnrope_interrupt_vector_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
RAM[0xfff2 + offset] = data;
}
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index 3e62bafa40f..d7a4be56362 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -1558,8 +1558,8 @@ static DRIVER_INIT( nitrobal )
static DRIVER_INIT( schmeisr )
{
- const UINT8 *src = machine.region("gfx2")->base();
- UINT8 *dst = machine.region("gfx1")->base();
+ const UINT8 *src = machine.root_device().memregion("gfx2")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
memcpy(dst, src, 0x20000);
memcpy(dst + 0x20000, src + 0x80000, 0x20000);
diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c
index d0ec636f16e..1a3148cf0c7 100644
--- a/src/mame/drivers/rollerg.c
+++ b/src/mame/drivers/rollerg.c
@@ -249,7 +249,7 @@ static const k053252_interface rollerg_k053252_intf =
static MACHINE_START( rollerg )
{
rollerg_state *state = machine.driver_data<rollerg_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
state->membank("bank1")->configure_entries(6, 2, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/roul.c b/src/mame/drivers/roul.c
index 663b1dfb0ea..9f1c14d39bc 100644
--- a/src/mame/drivers/roul.c
+++ b/src/mame/drivers/roul.c
@@ -88,7 +88,7 @@ public:
static PALETTE_INIT( roul )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit6, bit7, bit0, bit1, r, g, b;
int i;
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index c6b21e601e3..1075cdd93a0 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -957,7 +957,7 @@ READ8_MEMBER(route16_state::routex_prot_read)
static DRIVER_INIT( route16 )
{
- UINT8 *ROM = machine.region("cpu1")->base();
+ UINT8 *ROM = machine.root_device().memregion("cpu1")->base();
/* Is this actually a bootleg? some of the protection has
been removed */
@@ -972,7 +972,7 @@ static DRIVER_INIT( route16 )
static DRIVER_INIT( route16a )
{
- UINT8 *ROM = machine.region("cpu1")->base();
+ UINT8 *ROM = machine.root_device().memregion("cpu1")->base();
/* TO DO : Replace these patches with simulation of the protection device */
/* patch the protection */
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index cd514e735f7..b0e314881d3 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -196,8 +196,8 @@ public:
static PALETTE_INIT( royalmah )
{
offs_t i;
- const UINT8 *prom = machine.region("proms")->base();
- int len = machine.region("proms")->bytes();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
+ int len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len; i++)
{
@@ -231,8 +231,8 @@ static PALETTE_INIT( royalmah )
static PALETTE_INIT( mjderngr )
{
offs_t i;
- const UINT8 *prom = machine.region("proms")->base();
- int len = machine.region("proms")->bytes();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
+ int len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len / 2; i++)
{
@@ -386,7 +386,7 @@ READ8_MEMBER(royalmah_state::suzume_dsw_r)
WRITE8_MEMBER(royalmah_state::suzume_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
m_suzume_bank = data;
@@ -402,7 +402,7 @@ logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
WRITE8_MEMBER(royalmah_state::mjapinky_bank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
m_rombank = data;
membank("bank1")->set_base(ROM + 0x10000 + 0x8000 * data);
}
@@ -418,12 +418,12 @@ WRITE8_MEMBER(royalmah_state::mjapinky_palbank_w)
READ8_MEMBER(royalmah_state::mjapinky_dsw_r)
{
if (m_rombank == 0x0e) return input_port_read(machine(), "DSW3");
- else return *(machine().region("maincpu")->base() + 0x10000 + 0x8000 * m_rombank);
+ else return *(machine().root_device().memregion("maincpu")->base() + 0x10000 + 0x8000 * m_rombank);
}
WRITE8_MEMBER(royalmah_state::tontonb_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
@@ -441,7 +441,7 @@ logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
/* bits 5 and 6 seem to affect which Dip Switch to read in 'majs101b' */
WRITE8_MEMBER(royalmah_state::dynax_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
//logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
@@ -470,7 +470,7 @@ READ8_MEMBER(royalmah_state::daisyari_dsw_r)
WRITE8_MEMBER(royalmah_state::daisyari_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
m_dsw_select = (data & 0xc);
@@ -498,7 +498,7 @@ READ8_MEMBER(royalmah_state::mjclub_dsw_r)
WRITE8_MEMBER(royalmah_state::mjclub_bank_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int address;
m_dsw_select = data & 0xc0;
@@ -727,7 +727,7 @@ WRITE8_MEMBER(royalmah_state::jansou_6402_w)
READ8_MEMBER(royalmah_state::jansou_6403_r)
{
- UINT8 *GFXROM = machine().region("gfx1")->base();
+ UINT8 *GFXROM = memregion("gfx1")->base();
int d0 = GFXROM[m_gfx_adr];
int d1 = GFXROM[m_gfx_adr+1];
int c0 = m_jansou_colortable[d1 & 0x0f] & 0x0f;
@@ -828,7 +828,7 @@ READ8_MEMBER(royalmah_state::janptr96_dsw_r)
WRITE8_MEMBER(royalmah_state::janptr96_rombank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(ROM + 0x10000 + 0x8000 * data);
}
@@ -880,7 +880,7 @@ WRITE8_MEMBER(royalmah_state::mjifb_coin_counter_w)
READ8_MEMBER(royalmah_state::mjifb_rom_io_r)
{
if (m_mjifb_rom_enable)
- return ((UINT8*)(machine().region("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
+ return ((UINT8*)(machine().root_device().memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
offset += 0x8000;
@@ -989,7 +989,7 @@ ADDRESS_MAP_END
READ8_MEMBER(royalmah_state::mjdejavu_rom_io_r)
{
if (m_mjifb_rom_enable)
- return ((UINT8*)(machine().region("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
+ return ((UINT8*)(machine().root_device().memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset];
offset += 0x8000;
@@ -1050,7 +1050,7 @@ READ8_MEMBER(royalmah_state::mjtensin_p3_r)
static void mjtensin_update_rombank(running_machine &machine)
{
royalmah_state *state = machine.driver_data<royalmah_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
}
WRITE8_MEMBER(royalmah_state::mjtensin_p4_w)
{
@@ -1092,7 +1092,7 @@ ADDRESS_MAP_END
static void cafetime_update_rombank(running_machine &machine)
{
royalmah_state *state = machine.driver_data<royalmah_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x10000 + state->m_rombank * 0x8000 );
}
WRITE8_MEMBER(royalmah_state::cafetime_p4_w)
{
@@ -1177,7 +1177,7 @@ WRITE8_MEMBER(royalmah_state::mjvegasa_rombank_w)
READ8_MEMBER(royalmah_state::mjvegasa_rom_io_r)
{
if ((m_rombank & 0x70) != 0x70)
- return machine().region("maincpu")->base()[0x10000 + m_rombank * 0x8000 + offset];
+ return memregion("maincpu")->base()[0x10000 + m_rombank * 0x8000 + offset];
offset += 0x8000;
@@ -4710,7 +4710,7 @@ ROM_START( jansoua )
ROM_END
-static DRIVER_INIT( ippatsu ) { machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base() + 0x8000 ); }
+static DRIVER_INIT( ippatsu ) { machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x8000 ); }
static DRIVER_INIT( janptr96 )
{
diff --git a/src/mame/drivers/rpunch.c b/src/mame/drivers/rpunch.c
index f1cb0e2335e..ddd29c0f017 100644
--- a/src/mame/drivers/rpunch.c
+++ b/src/mame/drivers/rpunch.c
@@ -132,7 +132,7 @@ static void ym2151_irq_gen(device_t *device, int state)
static MACHINE_RESET( rpunch )
{
- UINT8 *snd = machine.region("upd")->base();
+ UINT8 *snd = machine.root_device().memregion("upd")->base();
memcpy(snd, snd + 0x20000, 0x20000);
}
@@ -198,7 +198,7 @@ static WRITE8_DEVICE_HANDLER( upd_control_w )
rpunch_state *state = device->machine().driver_data<rpunch_state>();
if ((data & 1) != state->m_upd_rom_bank)
{
- UINT8 *snd = device->machine().region("upd")->base();
+ UINT8 *snd = state->memregion("upd")->base();
state->m_upd_rom_bank = data & 1;
memcpy(snd, snd + 0x20000 * (state->m_upd_rom_bank + 1), 0x20000);
}
diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c
index 7d9d124782e..a03114b2695 100644
--- a/src/mame/drivers/rungun.c
+++ b/src/mame/drivers/rungun.c
@@ -366,7 +366,7 @@ static const k053252_interface rng_k053252_intf =
static MACHINE_START( rng )
{
rungun_state *state = machine.driver_data<rungun_state>();
- UINT8 *ROM = machine.region("soundcpu")->base();
+ UINT8 *ROM = state->memregion("soundcpu")->base();
state->membank("bank2")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c
index 31507bffc3c..e1a490fc9ad 100644
--- a/src/mame/drivers/sandscrp.c
+++ b/src/mame/drivers/sandscrp.c
@@ -269,7 +269,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sandscrp_state::sandscrp_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bank = data & 0x07;
if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(&space.device()),data);
diff --git a/src/mame/drivers/sangho.c b/src/mame/drivers/sangho.c
index 7b6454ee382..ab94364672b 100644
--- a/src/mame/drivers/sangho.c
+++ b/src/mame/drivers/sangho.c
@@ -79,7 +79,7 @@ static void pzlestar_map_banks(running_machine &machine)
case 2:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff);
- state->membank("bank1")->set_base(machine.region("user1")->base()+ 0x10000);
+ state->membank("bank1")->set_base(state->memregion("user1")->base()+ 0x10000);
break;
case 1:
case 3:
@@ -101,12 +101,12 @@ static void pzlestar_map_banks(running_machine &machine)
case 2:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
- state->membank("bank2")->set_base(machine.region("user1")->base()+ 0x18000);
+ state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base()+ 0x18000);
break;
case 3:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
- state->membank("bank2")->set_base(machine.region("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000) + 0x4000);
+ state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000) + 0x4000);
break;
case 1:
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x4000, 0x7fff);
@@ -127,7 +127,7 @@ static void pzlestar_map_banks(running_machine &machine)
case 3:
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff);
- state->membank("bank3")->set_base(machine.region("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000));
+ state->membank("bank3")->set_base(machine.root_device().memregion("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000));
break;
case 1:
case 2:
@@ -198,18 +198,18 @@ static void sexyboom_map_bank(running_machine &machine, int bank)
else
{
// rom 0
- state->membank(read_bank_name)->set_base(machine.region("user1")->base()+0x4000*banknum);
+ state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x4000*banknum);
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
}
else if (banktype == 0x82)
{
- state->membank(read_bank_name)->set_base(machine.region("user1")->base()+0x20000+banknum*0x4000);
+ state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x20000+banknum*0x4000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
else if (banktype == 0x80)
{
- state->membank(read_bank_name)->set_base(machine.region("user1")->base()+0x120000+banknum*0x4000);
+ state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x120000+banknum*0x4000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
else
diff --git a/src/mame/drivers/saturn.c b/src/mame/drivers/saturn.c
index 360d6f4c45f..2570e83b408 100644
--- a/src/mame/drivers/saturn.c
+++ b/src/mame/drivers/saturn.c
@@ -2154,7 +2154,7 @@ struct cdrom_interface saturn_cdrom =
static DEVICE_IMAGE_LOAD( sat_cart )
{
- UINT8 *ROM = image.device().machine().region("maincpu")->base()+0x080000;
+ UINT8 *ROM = image.device().machine().root_device().memregion("maincpu")->base()+0x080000;
UINT32 length;
if (image.software_entry() != NULL)
@@ -2359,7 +2359,7 @@ static DEVICE_IMAGE_LOAD( stv_cart )
if (image.software_entry() == NULL)
return IMAGE_INIT_FAIL;
- UINT8 *ROM = image.device().machine().region(this_cart->region)->base();
+ UINT8 *ROM = image.device().machine().root_device().memregion(this_cart->region)->base();
UINT32 length = image.get_software_region_length("rom");
memcpy(ROM, image.get_software_region("rom"), length);
diff --git a/src/mame/drivers/sauro.c b/src/mame/drivers/sauro.c
index 04e8b7bc762..864020f4f73 100644
--- a/src/mame/drivers/sauro.c
+++ b/src/mame/drivers/sauro.c
@@ -554,7 +554,7 @@ static DRIVER_INIT( tecfri )
/* This game doesn't like all memory to be initialized to zero, it won't
initialize the high scores */
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
memset(&RAM[0xe000], 0, 0x100);
RAM[0xe000] = 1;
diff --git a/src/mame/drivers/savquest.c b/src/mame/drivers/savquest.c
index d0c71f80dff..a8cde432075 100644
--- a/src/mame/drivers/savquest.c
+++ b/src/mame/drivers/savquest.c
@@ -110,7 +110,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
else // disable RAM access (reads go to BIOS ROM)
{
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base() + 0x20000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base() + 0x20000);
}
break;
}
@@ -531,7 +531,7 @@ static MACHINE_START( savquest )
static MACHINE_RESET( savquest )
{
- machine.root_device().membank("bank1")->set_base(machine.region("bios")->base() + 0x20000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x20000);
}
diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c
index f79fe366da1..149a0d4937d 100644
--- a/src/mame/drivers/sbowling.c
+++ b/src/mame/drivers/sbowling.c
@@ -75,7 +75,7 @@ public:
static TILE_GET_INFO( get_sb_tile_info )
{
sbowling_state *state = machine.driver_data<sbowling_state>();
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = state->memregion("user1")->base();
int tileno = rom[tile_index + state->m_bgmap * 1024];
SET_TILE_INFO(0, tileno, 0, 0);
@@ -342,7 +342,7 @@ GFXDECODE_END
static PALETTE_INIT( sbowling )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_rg[3] = { 470, 270, 100 };
diff --git a/src/mame/drivers/scregg.c b/src/mame/drivers/scregg.c
index fa792f2cf14..ee7c51cd200 100644
--- a/src/mame/drivers/scregg.c
+++ b/src/mame/drivers/scregg.c
@@ -396,7 +396,7 @@ static DRIVER_INIT( rockduck )
{
// rd2.rdh and rd1.rdj are bitswapped, but not rd3.rdg .. are they really from the same board?
int x;
- UINT8 *src = machine.region( "gfx1" )->base();
+ UINT8 *src = machine.root_device().memregion( "gfx1" )->base();
for (x = 0x2000; x < 0x6000; x++)
{
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 1ec556936bb..17c1f5308c1 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -118,8 +118,8 @@ static MACHINE_RESET( segac2 )
/* determine how many sound banks */
state->m_sound_banks = 0;
- if (machine.region("upd")->base())
- state->m_sound_banks = machine.region("upd")->bytes() / 0x20000;
+ if (machine.root_device().memregion("upd")->base())
+ state->m_sound_banks = state->memregion("upd")->bytes() / 0x20000;
/* reset the protection */
state->m_prot_write_buf = 0;
@@ -2088,7 +2088,7 @@ static DRIVER_INIT( ichirj )
static DRIVER_INIT( ichirjbl )
{
/* when did this actually work? - the protection is patched but the new check fails? */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x390/2] = 0x6600;
segac2_common_init(machine, NULL);
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index bcc453a1670..f436851a178 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -437,10 +437,10 @@ WRITE8_MEMBER( systeme_state::bank_write )
void systeme_state::driver_start()
{
/* Allocate video RAM */
- m_vdp1_vram = machine().region_alloc("vdp1_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
- m_vdp2_vram = machine().region_alloc("vdp2_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
+ m_vdp1_vram = machine().memory().region_alloc("vdp1_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
+ m_vdp2_vram = machine().memory().region_alloc("vdp2_vram", 2 * 0x4000, 1, ENDIANNESS_LITTLE);
- membank("bank1")->configure_entries(0, 16, machine().region("maincpu")->base() + 0x10000, 0x4000);
+ membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
if ( !strcmp( system().name, "ridleofp" ) )
{
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index a7d8b59196f..b6ba355d4a3 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -1405,7 +1405,7 @@ static void monsterb_expand_gfx(running_machine &machine, const char *region)
/* expand the background ROMs; A11/A12 of each ROM is independently controlled via */
/* banking */
- dest = machine.region(region)->base();
+ dest = machine.root_device().memregion(region)->base();
temp = auto_alloc_array(machine, UINT8, 0x4000);
memcpy(temp, dest, 0x4000);
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index 9a4e57e066c..c36bce22ec2 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -1762,7 +1762,7 @@ static DRIVER_INIT( enduror )
static DRIVER_INIT( endurobl )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
hangon_generic_init(machine);
@@ -1776,7 +1776,7 @@ static DRIVER_INIT( endurobl )
static DRIVER_INIT( endurob2 )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
hangon_generic_init(machine);
diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c
index e95abeb8f71..158abc5d358 100644
--- a/src/mame/drivers/segald.c
+++ b/src/mame/drivers/segald.c
@@ -597,7 +597,7 @@ ROM_END
static DRIVER_INIT( astron )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 2, &ROM[0x8000], 0x4000);
}
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index 652ee4d2228..1b78acd047a 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -2126,22 +2126,22 @@ static DRIVER_INIT( outrunb )
state->m_custom_io_w = outrun_custom_io_w;
/* main CPU: swap bits 11,12 and 6,7 */
- word = (UINT16 *)machine.region("maincpu")->base();
- length = machine.region("maincpu")->bytes() / 2;
+ word = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ length = machine.root_device().memregion("maincpu")->bytes() / 2;
for (i = 0; i < length; i++)
word[i] = BITSWAP16(word[i], 15,14,11,12,13,10,9,8,6,7,5,4,3,2,1,0);
/* sub CPU: swap bits 14,15 and 2,3 */
- word = (UINT16 *)machine.region("sub")->base();
- length = machine.region("sub")->bytes() / 2;
+ word = (UINT16 *)machine.root_device().memregion("sub")->base();
+ length = machine.root_device().memregion("sub")->bytes() / 2;
for (i = 0; i < length; i++)
word[i] = BITSWAP16(word[i], 14,15,13,12,11,10,9,8,7,6,5,4,2,3,1,0);
/* road gfx */
/* rom a-2.bin: swap bits 6,7 */
/* rom a-3.bin: swap bits 5,6 */
- byte = machine.region("gfx3")->base();
- length = machine.region("gfx3")->bytes() / 2;
+ byte = machine.root_device().memregion("gfx3")->base();
+ length = machine.root_device().memregion("gfx3")->bytes() / 2;
for (i = 0; i < length; i++)
{
byte[i] = BITSWAP8(byte[i], 6,7,5,4,3,2,1,0);
@@ -2149,8 +2149,8 @@ static DRIVER_INIT( outrunb )
}
/* Z80 code: swap bits 5,6 */
- byte = machine.region("soundcpu")->base();
- length = machine.region("soundcpu")->bytes();
+ byte = machine.root_device().memregion("soundcpu")->base();
+ length = machine.root_device().memregion("soundcpu")->bytes();
for (i = 0; i < length; i++)
byte[i] = BITSWAP8(byte[i], 7,5,6,4,3,2,1,0);
}
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index eca68a68fe9..d38bf800ec3 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -451,7 +451,7 @@ static WRITE8_HANDLER( n7751_command_w )
*/
segas1x_state *state = space->machine().driver_data<segas1x_state>();
- int numroms = space->machine().region("n7751data")->bytes() / 0x8000;
+ int numroms = state->memregion("n7751data")->bytes() / 0x8000;
state->m_n7751_rom_address &= 0x3fff;
state->m_n7751_rom_address |= (data & 0x01) << 14;
if (!(data & 0x02) && numroms >= 1) state->m_n7751_rom_address |= 0x00000;
@@ -496,7 +496,7 @@ static READ8_HANDLER( n7751_rom_r )
{
/* read from BUS */
segas1x_state *state = space->machine().driver_data<segas1x_state>();
- return space->machine().region("n7751data")->base()[state->m_n7751_rom_address];
+ return state->memregion("n7751data")->base()[state->m_n7751_rom_address];
}
@@ -973,11 +973,11 @@ static READ8_HANDLER( mcu_io_r )
return maincpu_byte_r(space->machine(), 0x840001 ^ offset);
case 5:
- return space->machine().region("maincpu")->base()[0x00000 + offset];
+ return space->machine().root_device().memregion("maincpu")->base()[0x00000 + offset];
case 6:
- return space->machine().region("maincpu")->base()[0x10000 + offset];
+ return space->machine().root_device().memregion("maincpu")->base()[0x10000 + offset];
case 7:
- return space->machine().region("maincpu")->base()[0x20000 + offset];
+ return state->memregion("maincpu")->base()[0x20000 + offset];
default:
logerror("%03X: MCU movx read mode %02X offset %04X\n",
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index ad7671c583e..c9a06a99cda 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1319,7 +1319,7 @@ static WRITE16_HANDLER( unknown_rgn2_w )
static WRITE8_DEVICE_HANDLER( upd7759_control_w )
{
segas1x_state *state = device->machine().driver_data<segas1x_state>();
- int size = device->machine().region("soundcpu")->bytes() - 0x10000;
+ int size = state->memregion("soundcpu")->bytes() - 0x10000;
if (size > 0)
{
int bankoffs = 0;
@@ -1376,7 +1376,7 @@ static WRITE8_DEVICE_HANDLER( upd7759_control_w )
bankoffs += (data & 0x07) * 0x04000;
break;
}
- state->membank("bank1")->set_base(device->machine().region("soundcpu")->base() + 0x10000 + (bankoffs % size));
+ state->membank("bank1")->set_base(device->machine().root_device().memregion("soundcpu")->base() + 0x10000 + (bankoffs % size));
}
}
@@ -6822,8 +6822,8 @@ static WRITE16_HANDLER( isgsm_cart_addr_low_w )
// when reading from this port the data is xored by a fixed value depending on the cart
static READ16_HANDLER( isgsm_cart_data_r )
{
- int size = space->machine().region("gamecart_rgn")->bytes();
- UINT8* rgn = space->machine().region("gamecart_rgn")->base();
+ int size = space->machine().root_device().memregion("gamecart_rgn")->bytes();
+ UINT8* rgn = space->machine().root_device().memregion("gamecart_rgn")->base();
isgsm_cart_addr++;
@@ -6847,16 +6847,16 @@ static WRITE16_HANDLER( isgsm_data_w )
switch (isgsm_type&0x0f)
{
- case 0x0: dest = space->machine().region("gfx2")->base();
+ case 0x0: dest = space->machine().root_device().memregion("gfx2")->base();
break;
- case 0x1: dest = space->machine().region("gfx1")->base();
+ case 0x1: dest = space->machine().root_device().memregion("gfx1")->base();
break;
- case 0x2: dest = space->machine().region("soundcpu")->base();
+ case 0x2: dest = space->machine().root_device().memregion("soundcpu")->base();
break;
- case 0x3: dest = space->machine().region("maincpu")->base();
+ case 0x3: dest = space->machine().root_device().memregion("maincpu")->base();
break;
default: // no other cases?
@@ -6967,7 +6967,7 @@ static WRITE16_HANDLER( isgsm_data_w )
dest[isgsm_addr] = byte;
- if (dest == space->machine().region("gfx1")->base())
+ if (dest == space->machine().root_device().memregion("gfx1")->base())
{
// we need to re-decode the tiles if writing to this area to keep MAME happy
@@ -7061,14 +7061,14 @@ static WRITE16_HANDLER( isgsm_main_bank_change_w )
// other values on real hw have strange results, change memory mapping etc??
if (data==1)
{
- space->machine().root_device().membank(ISGSM_MAIN_BANK)->set_base(space->machine().region("maincpu")->base());
+ space->machine().root_device().membank(ISGSM_MAIN_BANK)->set_base(space->machine().root_device().memregion("maincpu")->base());
}
}
static MACHINE_START( isgsm )
{
- machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.region("gamecart_rgn")->base());
- machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.region("bios")->base());
+ machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.root_device().memregion("gamecart_rgn")->base());
+ machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.root_device().memregion("bios")->base());
}
static ADDRESS_MAP_START( isgsm_map, AS_PROGRAM, 16, segas1x_state )
@@ -7219,8 +7219,8 @@ static MACHINE_RESET( isgsm )
for (int i = 0; i < 16; i++)
segaic16_sprites_set_bank(machine, 0, i, i);
- machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.region("gamecart_rgn")->base());
- machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.region("bios")->base());
+ machine.root_device().membank(ISGSM_CART_BANK)->set_base(machine.root_device().memregion("gamecart_rgn")->base());
+ machine.root_device().membank(ISGSM_MAIN_BANK)->set_base(machine.root_device().memregion("bios")->base());
devtag_reset( machine, "maincpu" );
}
@@ -7248,7 +7248,7 @@ DRIVER_INIT( isgsm )
// decrypt the bios...
UINT16* temp = (UINT16*)malloc(0x20000);
- UINT16* rom = (UINT16*)machine.region("bios")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("bios")->base();
int i;
for (i=0;i<0x10000;i++)
@@ -7265,7 +7265,7 @@ DRIVER_INIT( shinfz )
DRIVER_INIT_CALL( isgsm );
UINT16* temp = (UINT16*)malloc(0x200000);
- UINT16* rom = (UINT16*)machine.region("gamecart_rgn")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("gamecart_rgn")->base();
int i;
for (i=0;i<0x100000;i++)
@@ -7285,7 +7285,7 @@ DRIVER_INIT( tetrbx )
DRIVER_INIT_CALL( isgsm );
UINT16* temp = (UINT16*)malloc(0x80000);
- UINT16* rom = (UINT16*)machine.region("gamecart_rgn")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("gamecart_rgn")->base();
int i;
for (i=0;i<0x80000/2;i++)
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index abfb12d60e6..68993a569aa 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -429,7 +429,7 @@ static WRITE16_HANDLER( rom_5987_bank_w )
/* sprite banking */
else
{
- int maxbanks = space->machine().region("gfx2")->bytes() / 0x40000;
+ int maxbanks = space->machine().root_device().memregion("gfx2")->bytes() / 0x40000;
if (data >= maxbanks)
data = 255;
segaic16_sprites_set_bank(space->machine(), 0, (offset - 8) * 2 + 0, data * 2 + 0);
@@ -587,7 +587,7 @@ static WRITE16_HANDLER( wwally_custom_io_w )
static WRITE8_HANDLER( soundbank_w )
{
- space->machine().root_device().membank("bank1")->set_base(space->machine().region("soundcpu")->base() + 0x10000 + 0x2000 * data);
+ space->machine().root_device().membank("bank1")->set_base(space->machine().root_device().memregion("soundcpu")->base() + 0x10000 + 0x2000 * data);
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index d64e43e9fed..a8ca2a33b83 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -433,7 +433,7 @@ WRITE16_MEMBER( segas24_state::fdc_w )
break;
case 0x9:
logerror("Read multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track);
- fdc_pt = machine().region("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
+ fdc_pt = memregion("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
fdc_span = track_size;
fdc_status = 3;
fdc_drq = 1;
@@ -441,7 +441,7 @@ WRITE16_MEMBER( segas24_state::fdc_w )
break;
case 0xb:
logerror("Write multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track);
- fdc_pt = machine().region("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
+ fdc_pt = memregion("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
fdc_span = track_size;
fdc_status = 3;
fdc_drq = 1;
@@ -712,7 +712,7 @@ void segas24_state::reset_control_w(UINT8 data)
void segas24_state::reset_bank()
{
- if (machine().region("romboard")->base())
+ if (machine().root_device().memregion("romboard")->base())
{
membank("bank1")->set_entry(curbank & 15);
membank("bank2")->set_entry(curbank & 15);
@@ -1262,9 +1262,9 @@ static MACHINE_START( system24 )
{
segas24_state *state = machine.driver_data<segas24_state>();
if (state->track_size)
- machine.device<nvram_device>("floppy_nvram")->set_base(machine.region("floppy")->base(), 2*state->track_size);
+ machine.device<nvram_device>("floppy_nvram")->set_base(machine.root_device().memregion("floppy")->base(), 2*state->track_size);
- UINT8 *usr1 = machine.region("romboard")->base();
+ UINT8 *usr1 = state->memregion("romboard")->base();
if (usr1)
{
state->membank("bank1")->configure_entries(0, 16, usr1, 0x40000);
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 80a79503764..acd05e67954 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -1130,14 +1130,14 @@ static void ym3438_irq_handler(device_t *device, int state)
WRITE8_MEMBER(segas32_state::sound_bank_lo_w)
{
m_sound_bank = (m_sound_bank & ~0x3f) | (data & 0x3f);
- membank("bank1")->set_base(machine().region("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
+ membank("bank1")->set_base(machine().root_device().memregion("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
}
WRITE8_MEMBER(segas32_state::sound_bank_hi_w)
{
m_sound_bank = (m_sound_bank & 0x3f) | ((data & 0x04) << 4) | ((data & 0x03) << 7);
- membank("bank1")->set_base(machine().region("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
+ membank("bank1")->set_base(machine().root_device().memregion("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank);
}
@@ -4145,7 +4145,7 @@ static DRIVER_INIT( jpark )
{
segas32_state *state = machine.driver_data<segas32_state>();
/* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */
- UINT16 *pROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *pROM = (UINT16 *)state->memregion("maincpu")->base();
segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state));
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index dbd7fc8b4f2..17998afe9e9 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -995,8 +995,8 @@ READ8_MEMBER(seibuspi_state::z80_coin_r)
READ32_MEMBER(seibuspi_state::soundrom_r)
{
- UINT8 *sound = (UINT8*)machine().region("user2")->base();
- UINT16 *sound16 = (UINT16*)machine().region("user2")->base();
+ UINT8 *sound = (UINT8*)machine().root_device().memregion("user2")->base();
+ UINT16 *sound16 = (UINT16*)machine().root_device().memregion("user2")->base();
if (mem_mask == 0x000000ff)
{
@@ -1812,9 +1812,9 @@ static MACHINE_RESET( spi )
{
seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
- UINT8 *sound = machine.region("ymf")->base();
+ UINT8 *sound = machine.root_device().memregion("ymf")->base();
- UINT8 *rombase = machine.region("user1")->base();
+ UINT8 *rombase = state->memregion("user1")->base();
UINT8 flash_data = rombase[0x1ffffc];
cputag_set_input_line(machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE );
@@ -1897,7 +1897,7 @@ static MACHINE_START( sxx2f )
static MACHINE_RESET( sxx2f )
{
seibuspi_state *state = machine.driver_data<seibuspi_state>();
- UINT8 *rom = machine.region("soundcpu")->base();
+ UINT8 *rom = state->memregion("soundcpu")->base();
state->membank("bank4")->set_base(state->m_z80_rom);
state->membank("bank5")->set_base(state->m_z80_rom);
@@ -2075,9 +2075,9 @@ static void init_spi(running_machine &machine)
state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0");
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
- seibuspi_text_decrypt(machine.region("gfx1")->base());
- seibuspi_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
- seibuspi_sprite_decrypt(machine.region("gfx3")->base(), 0x400000);
+ seibuspi_text_decrypt(machine.root_device().memregion("gfx1")->base());
+ seibuspi_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_sprite_decrypt(state->memregion("gfx3")->base(), 0x400000);
}
static DRIVER_INIT( rdft )
@@ -2146,9 +2146,9 @@ static void init_rf2(running_machine &machine)
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0282AC, 0x0282AF, read32_delegate(FUNC(seibuspi_state::rf2_speedup_r),state));
- seibuspi_rise10_text_decrypt(machine.region("gfx1")->base());
- seibuspi_rise10_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
- seibuspi_rise10_sprite_decrypt(machine.region("gfx3")->base(), 0x600000);
+ seibuspi_rise10_text_decrypt(machine.root_device().memregion("gfx1")->base());
+ seibuspi_rise10_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_rise10_sprite_decrypt(state->memregion("gfx3")->base(), 0x600000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
}
@@ -2171,9 +2171,9 @@ static void init_rfjet(running_machine &machine)
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x002894c, 0x002894f, read32_delegate(FUNC(seibuspi_state::rfjet_speedup_r),state));
- seibuspi_rise11_text_decrypt(machine.region("gfx1")->base());
- seibuspi_rise11_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
- seibuspi_rise11_sprite_decrypt_rfjet(machine.region("gfx3")->base(), 0x800000);
+ seibuspi_rise11_text_decrypt(machine.root_device().memregion("gfx1")->base());
+ seibuspi_rise11_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_rise11_sprite_decrypt_rfjet(state->memregion("gfx3")->base(), 0x800000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
}
@@ -2237,11 +2237,11 @@ MACHINE_CONFIG_END
static DRIVER_INIT( sys386f2 )
{
int i, j;
- UINT16 *src = (UINT16 *)machine.region("gfx3")->base();
+ UINT16 *src = (UINT16 *)machine.root_device().memregion("gfx3")->base();
UINT16 tmp[0x40 / 2], Offset;
// sprite_reorder() only
- for(i = 0; i < machine.region("gfx3")->bytes() / 0x40; i++)
+ for(i = 0; i < machine.root_device().memregion("gfx3")->bytes() / 0x40; i++)
{
memcpy(tmp, src, 0x40);
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index e3f51c7302f..2b352030c3b 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -2975,7 +2975,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(seta_state::sub_bankswitch_w)
{
- UINT8 *rom = machine().region("sub")->base();
+ UINT8 *rom = memregion("sub")->base();
int bank = data >> 4;
membank("bank1")->set_base(&rom[bank * 0x4000 + 0xc000]);
@@ -10533,7 +10533,7 @@ static DRIVER_INIT( arbalest )
static DRIVER_INIT( metafox )
{
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
/* This game uses the 21c000-21ffff area for protection? */
// machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x21c000, 0x21ffff);
@@ -10556,7 +10556,7 @@ static DRIVER_INIT ( blandia )
rom_size = 0x80000;
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("gfx2")->base() + 0x40000;
+ rom = machine.root_device().memregion("gfx2")->base() + 0x40000;
for (rpos = 0; rpos < rom_size/2; rpos++) {
buf[rpos+0x40000] = rom[rpos*2];
@@ -10565,7 +10565,7 @@ static DRIVER_INIT ( blandia )
memcpy( rom, buf, rom_size );
- rom = machine.region("gfx3")->base() + 0x40000;
+ rom = machine.root_device().memregion("gfx3")->base() + 0x40000;
for (rpos = 0; rpos < rom_size/2; rpos++) {
buf[rpos+0x40000] = rom[rpos*2];
@@ -10594,7 +10594,7 @@ static DRIVER_INIT( zombraid )
static DRIVER_INIT( kiwame )
{
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
/* WARNING: This game writes to the interrupt vector
table. Lev 1 routine address is stored at $100 */
@@ -10616,8 +10616,8 @@ static DRIVER_INIT( wiggie )
UINT8 temp[16];
int i,j;
- src = machine.region("maincpu")->base();
- len = machine.region("maincpu")->bytes();
+ src = machine.root_device().memregion("maincpu")->base();
+ len = machine.root_device().memregion("maincpu")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -10647,7 +10647,7 @@ static DRIVER_INIT( wiggie )
static DRIVER_INIT( crazyfgt )
{
//seta_state *state = machine.driver_data<seta_state>();
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
// protection check at boot
RAM[0x1078/2] = 0x4e71;
@@ -10666,7 +10666,7 @@ static DRIVER_INIT( crazyfgt )
static DRIVER_INIT( inttoote )
{
//seta_state *state = machine.driver_data<seta_state>();
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// missing / unused video regs
seta_state *state = machine.driver_data<seta_state>();
@@ -10682,7 +10682,7 @@ static DRIVER_INIT( inttoote )
static DRIVER_INIT( inttootea )
{
//seta_state *state = machine.driver_data<seta_state>();
- //UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ //UINT16 *ROM = (UINT16 *)state->memregion( "maincpu" )->base();
// missing / unused video regs
seta_state *state = machine.driver_data<seta_state>();
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index 20c090c3d03..d7988e4a19e 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -122,8 +122,8 @@ WRITE16_MEMBER(seta2_state::seta2_sound_bank_w)
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *ROM = machine().region( "x1snd" )->base();
- int banks = (machine().region( "x1snd" )->bytes() - 0x100000) / 0x20000;
+ UINT8 *ROM = memregion( "x1snd" )->base();
+ int banks = (machine().root_device().memregion( "x1snd" )->bytes() - 0x100000) / 0x20000;
if (data >= banks)
{
logerror("CPU #0 PC %06X: invalid sound bank %04X\n",cpu_get_pc(&space.device()),data);
@@ -325,7 +325,7 @@ ADDRESS_MAP_END
READ16_MEMBER(seta2_state::pzlbowl_protection_r)
{
UINT32 address = (space.read_word(0x20ba16) << 16) | space.read_word(0x20ba18);
- return machine().region("maincpu")->base()[address - 2];
+ return memregion("maincpu")->base()[address - 2];
}
READ16_MEMBER(seta2_state::pzlbowl_coins_r)
@@ -2408,8 +2408,8 @@ ROM_END
static DRIVER_INIT( funcube2 )
{
- UINT32 *main_cpu = (UINT32 *) machine.region("maincpu")->base();
- UINT16 *sub_cpu = (UINT16 *) machine.region("sub")->base();
+ UINT32 *main_cpu = (UINT32 *) machine.root_device().memregion("maincpu")->base();
+ UINT16 *sub_cpu = (UINT16 *) machine.root_device().memregion("sub")->base();
main_cpu[0xa5c/4] = 0x4e713e3c; // PIC protection?
main_cpu[0xa74/4] = 0x4e713e3c;
@@ -2421,8 +2421,8 @@ static DRIVER_INIT( funcube2 )
static DRIVER_INIT( funcube3 )
{
- UINT32 *main_cpu = (UINT32 *) machine.region("maincpu")->base();
- UINT16 *sub_cpu = (UINT16 *) machine.region("sub")->base();
+ UINT32 *main_cpu = (UINT32 *) machine.root_device().memregion("maincpu")->base();
+ UINT16 *sub_cpu = (UINT16 *) machine.root_device().memregion("sub")->base();
main_cpu[0x008bc/4] = 0x4a804e71;
main_cpu[0x19f0c/4] = 0x4e714e71;
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index 879a3d5bc54..a22bf375f8f 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -173,7 +173,7 @@ READ16_MEMBER(sf_state::button2_r)
WRITE8_MEMBER(sf_state::sound2_bank_w)
{
- membank("bank1")->set_base(machine().region("audio2")->base() + 0x8000 * (data + 1));
+ membank("bank1")->set_base(machine().root_device().memregion("audio2")->base() + 0x8000 * (data + 1));
}
diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c
index 8a4696b196c..3b5fa927019 100644
--- a/src/mame/drivers/sfbonus.c
+++ b/src/mame/drivers/sfbonus.c
@@ -1080,7 +1080,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sfbonus_state::sfbonus_bank_w)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
UINT8 bank;
bank = data & 7;
@@ -1214,7 +1214,7 @@ GFXDECODE_END
static MACHINE_RESET( sfbonus )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->set_base(&ROM[0]);
}
@@ -1233,12 +1233,12 @@ static NVRAM_HANDLER( sfbonus )
}
else
{
- UINT8* defaultram = machine.region("defaults")->base();
+ UINT8* defaultram = machine.root_device().memregion("defaults")->base();
memset(state->m_nvram,0x00,state->m_nvram.bytes());
if (defaultram)
if ((defaultram[0x02]==0x00) && (defaultram[0x03]==0x00)) // hack! rom region optional regions get cleared with garbage if no rom is present, this is not good!
- memcpy(state->m_nvram, machine.region("defaults")->base(), machine.region("defaults")->bytes());
+ memcpy(state->m_nvram, machine.root_device().memregion("defaults")->base(), machine.root_device().memregion("defaults")->bytes());
}
}
}
@@ -5733,9 +5733,9 @@ static DRIVER_INIT( sfbonus_common)
// dummy.rom helper
{
- UINT8 *ROM = machine.region("maincpu")->base();
- int length = machine.region("maincpu")->bytes();
- UINT8* ROM2 = machine.region("user1")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
+ UINT8* ROM2 = state->memregion("user1")->base();
if (ROM2)
{
@@ -5785,9 +5785,9 @@ static void sfbonus_bitswap( running_machine& machine,
{
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
- for(i = 0; i < machine.region("maincpu")->bytes(); i++)
+ for(i = 0; i < machine.root_device().memregion("maincpu")->bytes(); i++)
{
UINT8 x = ROM[i];
diff --git a/src/mame/drivers/sfkick.c b/src/mame/drivers/sfkick.c
index 8a027043d4b..ff9b7ec84b7 100644
--- a/src/mame/drivers/sfkick.c
+++ b/src/mame/drivers/sfkick.c
@@ -108,7 +108,7 @@ static void sfkick_remap_banks(running_machine &machine)
{
case 0: /* bios */
{
- UINT8 *mem = machine.region("bios")->base();
+ UINT8 *mem = state->memregion("bios")->base();
state->membank("bank1")->set_base(mem);
state->membank("bank2")->set_base(mem+0x2000);
}
@@ -116,7 +116,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 1: /* ext rom */
{
- UINT8 *mem = machine.region("extrom")->base();
+ UINT8 *mem = machine.root_device().memregion("extrom")->base();
state->membank("bank1")->set_base(mem+0x4000);
state->membank("bank2")->set_base(mem+0x6000);
}
@@ -124,7 +124,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank1")->set_base(mem+0x2000*state->m_bank[0]);
state->membank("bank2")->set_base(mem+0x2000*state->m_bank[1]);
}
@@ -132,7 +132,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 3: /* unknown */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank1")->set_base(mem+0x18000);
state->membank("bank2")->set_base(mem+0x18000);
}
@@ -144,7 +144,7 @@ static void sfkick_remap_banks(running_machine &machine)
{
case 0: /* bios - upper part */
{
- UINT8 *mem = machine.region("bios")->base();
+ UINT8 *mem = machine.root_device().memregion("bios")->base();
state->membank("bank3")->set_base(mem+0x4000);
state->membank("bank4")->set_base(mem+0x6000);
}
@@ -153,7 +153,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 1: /* unknown */
case 3:
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank3")->set_base(mem+0x18000);
state->membank("bank4")->set_base(mem+0x18000);
}
@@ -161,7 +161,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank3")->set_base(mem+0x2000*state->m_bank[2]);
state->membank("bank4")->set_base(mem+0x2000*state->m_bank[3]);
}
@@ -173,7 +173,7 @@ static void sfkick_remap_banks(running_machine &machine)
{
case 0: /* cartridge */
{
- UINT8 *mem = machine.region("cartridge")->base();
+ UINT8 *mem = machine.root_device().memregion("cartridge")->base();
state->membank("bank5")->set_base(mem+0x4000);
state->membank("bank6")->set_base(mem+0x6000);
}
@@ -182,7 +182,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 1: /* unknown */
case 3:
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank5")->set_base(mem+0x18000);
state->membank("bank6")->set_base(mem+0x18000);
}
@@ -190,7 +190,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank5")->set_base(mem+0x2000*state->m_bank[4]);
state->membank("bank6")->set_base(mem+0x2000*state->m_bank[5]);
}
@@ -203,7 +203,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 0: /* unknown */
case 1:
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank7")->set_base(mem+0x18000);
state->membank("bank8")->set_base(mem+0x18000);
}
@@ -211,7 +211,7 @@ static void sfkick_remap_banks(running_machine &machine)
case 2: /* banked */
{
- UINT8 *mem = machine.region("banked")->base();
+ UINT8 *mem = machine.root_device().memregion("banked")->base();
state->membank("bank7")->set_base(mem+0x2000*state->m_bank[6]);
state->membank("bank8")->set_base(mem+0x2000*state->m_bank[7]);
}
diff --git a/src/mame/drivers/shangha3.c b/src/mame/drivers/shangha3.c
index b3a216b34dd..d527e119f5b 100644
--- a/src/mame/drivers/shangha3.c
+++ b/src/mame/drivers/shangha3.c
@@ -58,7 +58,7 @@ WRITE16_MEMBER(shangha3_state::shangha3_prot_w)
READ16_MEMBER(shangha3_state::heberpop_gfxrom_r)
{
- UINT8 *ROM = machine().region("gfx1")->base();
+ UINT8 *ROM = memregion("gfx1")->base();
return ROM[2*offset] | (ROM[2*offset+1] << 8);
}
diff --git a/src/mame/drivers/shangkid.c b/src/mame/drivers/shangkid.c
index 3e70aee0e31..b13ea64c790 100644
--- a/src/mame/drivers/shangkid.c
+++ b/src/mame/drivers/shangkid.c
@@ -134,8 +134,8 @@ static DRIVER_INIT( shangkid )
state->m_gfx_type = 1;
/* set up banking */
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x8000, 0x8000);
- state->membank("bank2")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x0000, 0x10000);
+ state->membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x8000, 0x8000);
+ state->membank("bank2")->configure_entries(0, 2, state->memregion("audiocpu")->base() + 0x0000, 0x10000);
}
/***************************************************************************************/
diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c
index c4ee7e5f0cb..6174093d35a 100644
--- a/src/mame/drivers/shootout.c
+++ b/src/mame/drivers/shootout.c
@@ -409,9 +409,9 @@ ROM_END
static DRIVER_INIT( shootout )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- int length = machine.region("maincpu")->bytes();
+ int length = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length - 0x8000);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
space->set_decrypted_region(0x8000, 0xffff, decrypt);
@@ -419,13 +419,13 @@ static DRIVER_INIT( shootout )
for (A = 0x8000;A < length;A++)
decrypt[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x40) >> 1) | ((rom[A] & 0x20) << 1);
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x8000, 0x4000);
}
static DRIVER_INIT( shootouj )
{
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c
index 4431ed2ec68..ff1c67e9bdb 100644
--- a/src/mame/drivers/shougi.c
+++ b/src/mame/drivers/shougi.c
@@ -133,7 +133,7 @@ public:
static PALETTE_INIT( shougi )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_b[2] = { 470, 220 };
static const int resistances_rg[3] = { 1000, 470, 220 };
diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c
index 7cd9525aefd..c2f12b7dee5 100644
--- a/src/mame/drivers/sidearms.c
+++ b/src/mame/drivers/sidearms.c
@@ -44,7 +44,7 @@ Notes:
WRITE8_MEMBER(sidearms_state::sidearms_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
/* bits 0 and 1 select the ROM bank */
@@ -124,7 +124,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sidearms_state::whizz_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bank = 0;
switch (data & 0xC0)
diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c
index fe49a60b24c..c9cd6430724 100644
--- a/src/mame/drivers/sigmab52.c
+++ b/src/mame/drivers/sigmab52.c
@@ -294,7 +294,7 @@ READ8_MEMBER(sigmab52_state::unk_f700_r)
WRITE8_MEMBER(sigmab52_state::unk_f710_w)
{
- membank("bank1" )->set_base(&machine().region("maincpu")->base()[0x10000 + ((data&0x80)?0x4000:0x0000)]);
+ membank("bank1" )->set_base(&machine().root_device().memregion("maincpu")->base()[0x10000 + ((data&0x80)?0x4000:0x0000)]);
}
READ8_MEMBER(sigmab52_state::unk_f721_r)
@@ -542,11 +542,11 @@ static INTERRUPT_GEN( timer_irq )
static MACHINE_START(jwildb52)
{
- machine.root_device().membank("bank1")->set_base(&machine.region("maincpu")->base()[0x10000 + 0x0000]);
+ machine.root_device().membank("bank1")->set_base(&machine.root_device().memregion("maincpu")->base()[0x10000 + 0x0000]);
- machine.root_device().membank("bank2")->set_base(&machine.region("maincpu")->base()[0x10000 + 0xf800]);
+ machine.root_device().membank("bank2")->set_base(&machine.root_device().memregion("maincpu")->base()[0x10000 + 0xf800]);
- machine.root_device().membank("bank3")->set_base(&machine.region("maincpu")->base()[0x10000 + 0x8000]);
+ machine.root_device().membank("bank3")->set_base(&machine.root_device().memregion("maincpu")->base()[0x10000 + 0x8000]);
/*
@@ -560,7 +560,7 @@ static MACHINE_START(jwildb52)
*/
{
- UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("gfx1")->base();
int i;
device_t *hd63484 = machine.device("hd63484");
diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c
index b0a9bb517d1..8dbba694a03 100644
--- a/src/mame/drivers/sigmab98.c
+++ b/src/mame/drivers/sigmab98.c
@@ -542,7 +542,7 @@ WRITE8_MEMBER(sigmab98_state::animalc_rombank_w)
return;
}
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
switch ( m_reg )
{
case 0x0f:
@@ -898,7 +898,7 @@ READ8_MEMBER(sigmab98_state::haekaka_b000_r)
case 0x1d:
case 0x1e:
case 0x1f:
- return machine().region("maincpu")->base()[offset + 0xb400 + 0x1000 * (m_rombank-0x10)];
+ return memregion("maincpu")->base()[offset + 0xb400 + 0x1000 * (m_rombank-0x10)];
case 0x65: // SPRITERAM
if (offset < 0x1000)
@@ -1010,7 +1010,7 @@ WRITE8_MEMBER(sigmab98_state::itazuram_rombank_w)
return;
}
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
switch ( m_reg )
{
case 0x0d:
@@ -1374,7 +1374,7 @@ READ8_MEMBER(sigmab98_state::tdoboon_c000_r)
case 0x1d:
case 0x1e:
case 0x1f:
- return machine().region("maincpu")->base()[offset + 0xc400 + 0x1000 * (m_rombank-0x10)];
+ return memregion("maincpu")->base()[offset + 0xc400 + 0x1000 * (m_rombank-0x10)];
case 0x64: // SPRITERAM
if (offset < 0x1000)
@@ -1897,7 +1897,7 @@ ROM_END
static DRIVER_INIT( gegege )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// Protection?
rom[0x0bdd] = 0xc9;
@@ -1946,7 +1946,7 @@ ROM_END
static DRIVER_INIT( pepsiman )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// Protection?
rom[0x058a] = 0xc9;
@@ -1997,7 +1997,7 @@ ROM_END
static DRIVER_INIT( ucytokyu )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// Protection?
rom[0x0bfa] = 0xc9;
@@ -2150,7 +2150,7 @@ static DRIVER_INIT( itazuram )
{
sigmab98_state *state = machine.driver_data<sigmab98_state>();
// ROM banks
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
state->membank("rombank0")->set_base(rom + 0x3400);
state->membank("rombank1")->set_base(rom + 0x4400);
state->m_rombank = 0x0f;
diff --git a/src/mame/drivers/silkroad.c b/src/mame/drivers/silkroad.c
index 4a44dfc3806..21ace1bc908 100644
--- a/src/mame/drivers/silkroad.c
+++ b/src/mame/drivers/silkroad.c
@@ -327,7 +327,7 @@ static DRIVER_INIT( silkroad )
verified as correct... problem with the original which the gfx
hardware didn't care about? */
- UINT8 *src = machine.region("gfx1")->base()+0x1000000;
+ UINT8 *src = machine.root_device().memregion("gfx1")->base()+0x1000000;
int len = 0x0200000;
UINT8 *buffer;
diff --git a/src/mame/drivers/silvmil.c b/src/mame/drivers/silvmil.c
index 036870fa9f3..af2de9792ef 100644
--- a/src/mame/drivers/silvmil.c
+++ b/src/mame/drivers/silvmil.c
@@ -409,8 +409,8 @@ ROM_END
static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 7144369b2ae..5f5edaef491 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -1022,8 +1022,8 @@ ROM_END
static DRIVER_INIT( simpl156 )
{
- UINT8 *rom = machine.region("okimusic")->base();
- int length = machine.region("okimusic")->bytes();
+ UINT8 *rom = machine.root_device().memregion("okimusic")->base();
+ int length = machine.root_device().memregion("okimusic")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c
index 11f99fe0078..b1ea7c1319c 100644
--- a/src/mame/drivers/skimaxx.c
+++ b/src/mame/drivers/skimaxx.c
@@ -138,8 +138,8 @@ READ32_MEMBER(skimaxx_state::skimaxx_blitter_r)
static VIDEO_START( skimaxx )
{
skimaxx_state *state = machine.driver_data<skimaxx_state>();
- state->m_blitter_gfx = (UINT16 *) machine.region( "blitter" )->base();
- state->m_blitter_gfx_len = machine.region( "blitter" )->bytes() / 2;
+ state->m_blitter_gfx = (UINT16 *) machine.root_device().memregion( "blitter" )->base();
+ state->m_blitter_gfx_len = state->memregion( "blitter" )->bytes() / 2;
state->m_bg_buffer = auto_alloc_array(machine, UINT32, 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2); // 2 buffers
state->m_bg_buffer_back = state->m_bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 0;
diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c
index d8b347c6356..7984c6d0be6 100644
--- a/src/mame/drivers/skullxbo.c
+++ b/src/mame/drivers/skullxbo.c
@@ -619,7 +619,7 @@ ROM_END
static DRIVER_INIT( skullxbo )
{
atarijsa_init(machine, "FF5802", 0x0080);
- memset(machine.region("gfx1")->base() + 0x170000, 0, 0x20000);
+ memset(machine.root_device().memregion("gfx1")->base() + 0x170000, 0, 0x20000);
}
diff --git a/src/mame/drivers/skyarmy.c b/src/mame/drivers/skyarmy.c
index c30ac7d8648..417d530db7c 100644
--- a/src/mame/drivers/skyarmy.c
+++ b/src/mame/drivers/skyarmy.c
@@ -87,7 +87,7 @@ WRITE8_MEMBER(skyarmy_state::skyarmy_colorram_w)
static PALETTE_INIT( skyarmy )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 32;i++)
diff --git a/src/mame/drivers/skyfox.c b/src/mame/drivers/skyfox.c
index 52bc699d282..4a9c301262d 100644
--- a/src/mame/drivers/skyfox.c
+++ b/src/mame/drivers/skyfox.c
@@ -432,8 +432,8 @@ ROM_END
/* Untangle the graphics: cut each 32x32x8 tile in 16 8x8x8 tiles */
static DRIVER_INIT( skyfox )
{
- UINT8 *RAM = machine.region("gfx1")->base();
- UINT8 *end = RAM + machine.region("gfx1")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("gfx1")->base();
+ UINT8 *end = RAM + machine.root_device().memregion("gfx1")->bytes();
UINT8 buf[32 * 32];
while (RAM < end)
diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c
index 91ed7aa8bdc..5997ab03506 100644
--- a/src/mame/drivers/skykid.c
+++ b/src/mame/drivers/skykid.c
@@ -92,7 +92,7 @@ static MACHINE_START( skykid )
{
skykid_state *state = machine.driver_data<skykid_state>();
/* configure the banks */
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x10000, 0x2000);
state_save_register_global(machine, state->m_inputport_selected);
}
@@ -638,7 +638,7 @@ static DRIVER_INIT( skykid )
int i;
/* unpack the third sprite ROM */
- rom = machine.region("gfx3")->base() + 0x4000;
+ rom = machine.root_device().memregion("gfx3")->base() + 0x4000;
for (i = 0;i < 0x2000;i++)
{
rom[i + 0x4000] = rom[i]; // sprite set #1, plane 3
diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c
index 28d78435b61..bf014700219 100644
--- a/src/mame/drivers/slapfght.c
+++ b/src/mame/drivers/slapfght.c
@@ -1829,7 +1829,7 @@ static DRIVER_INIT( getstarj )
static DRIVER_INIT( gtstarb1 )
{
slapfght_state *state = machine.driver_data<slapfght_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->m_getstar_id = GTSTARB1;
getstar_init(machine);
diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c
index 9163651d2a2..83c7a7180d2 100644
--- a/src/mame/drivers/slapshot.c
+++ b/src/mame/drivers/slapshot.c
@@ -524,7 +524,7 @@ static MACHINE_START( slapshot )
{
slapshot_state *state = machine.driver_data<slapshot_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
@@ -730,8 +730,8 @@ ROM_END
static DRIVER_INIT( slapshot )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx2")->base();
- int size = machine.region("gfx2")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx2")->base();
+ int size = machine.root_device().memregion("gfx2")->bytes();
int data;
offset = size / 2;
diff --git a/src/mame/drivers/sliver.c b/src/mame/drivers/sliver.c
index 76a2eb20602..59ba3f18f18 100644
--- a/src/mame/drivers/sliver.c
+++ b/src/mame/drivers/sliver.c
@@ -165,7 +165,7 @@ static void blit_gfx(running_machine &machine)
{
sliver_state *state = machine.driver_data<sliver_state>();
int tmpptr=0;
- const UINT8 *rom = machine.region("user1")->base();
+ const UINT8 *rom = state->memregion("user1")->base();
while (tmpptr < state->m_fptr)
{
@@ -239,7 +239,7 @@ static void render_jpeg(running_machine &machine)
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
- jpeg_mem_src(&cinfo, machine.region("user2")->base()+addr, machine.region("user2")->bytes()-addr);
+ jpeg_mem_src(&cinfo, machine.root_device().memregion("user2")->base()+addr, machine.root_device().memregion("user2")->bytes()-addr);
jpeg_read_header(&cinfo, TRUE);
jpeg_start_decompress(&cinfo);
@@ -349,7 +349,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(sliver_state::oki_setbank)
{
- UINT8 *sound = machine().region("oki")->base();
+ UINT8 *sound = memregion("oki")->base();
int bank=(data^0xff)&3; //xor or not ?
memcpy(sound+0x20000, sound+0x100000+0x20000*bank, 0x20000);
}
diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c
index 4c93fcae745..96cf5a19721 100644
--- a/src/mame/drivers/slotcarn.c
+++ b/src/mame/drivers/slotcarn.c
@@ -112,9 +112,9 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine().region("gfx1")->base();
- gfx[1] = device->machine().region("gfx2")->base();
- rlen = device->machine().region("gfx2")->bytes();
+ gfx[0] = device->machine().root_device().memregion("gfx1")->base();
+ gfx[1] = device->machine().root_device().memregion("gfx2")->base();
+ rlen = state->memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
for (cx = 0; cx < x_count; cx++)
diff --git a/src/mame/drivers/sms.c b/src/mame/drivers/sms.c
index ef194ac1284..7312bf54a24 100644
--- a/src/mame/drivers/sms.c
+++ b/src/mame/drivers/sms.c
@@ -533,7 +533,7 @@ ADDRESS_MAP_END
static MACHINE_START( sms )
{
smsmfg_state *state = machine.driver_data<smsmfg_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("questions")->base(), 0x4000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("questions")->base(), 0x4000);
state_save_register_global(machine, state->m_communication_port_status);
state_save_register_global_array(machine, state->m_communication_port);
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index 77b3638812d..c75ca0fa7ed 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -650,7 +650,7 @@ static DRIVER_INIT(kinstb)
{
snesb_state *state = machine.driver_data<snesb_state>();
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = state->memregion("user3")->base();
for (i = 0; i < 0x400000; i++)
{
@@ -671,7 +671,7 @@ static DRIVER_INIT(kinstb)
static DRIVER_INIT( ffight2b )
{
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
for(i = 0; i < 0x200000; i++)
{
@@ -715,7 +715,7 @@ static DRIVER_INIT( ffight2b )
static DRIVER_INIT( iron )
{
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
for (i = 0; i < 0x140000; i++)
{
@@ -740,7 +740,7 @@ static DRIVER_INIT( iron )
static DRIVER_INIT( denseib )
{
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
INT32 i;
for (i = 0; i < 0x200000; i++)
@@ -790,8 +790,8 @@ static const UINT8 address_substitution_high[] =
static DRIVER_INIT( sblast2b )
{
int i, cipherText, plainText, newAddress;
- UINT8 *src = machine.region("user7")->base();
- UINT8 *dst = machine.region("user3")->base();
+ UINT8 *src = machine.root_device().memregion("user7")->base();
+ UINT8 *dst = machine.root_device().memregion("user3")->base();
for (i =0; i < 0x80000 * 3; i++)
{
@@ -841,7 +841,7 @@ static DRIVER_INIT( sblast2b )
static DRIVER_INIT( endless )
{
INT32 i;
- UINT8 *rom = machine.region("user3")->base();
+ UINT8 *rom = machine.root_device().memregion("user3")->base();
/* there is more to this, 0x800 based block swaps? */
for (i = 0; i < 0x200000; i++)
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index 5affde5a403..dbf07048958 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -89,7 +89,7 @@ Notes:
a bug. The service mode functionality is very limited anyway. To get past the
failed ROM test and see the service mode, use this ROM patch:
- UINT8 *mem = machine.region("maincpu")->base();
+ UINT8 *mem = machine.root_device().memregion("maincpu")->base();
mem[0x3a5d] = mem[0x3a5e] = mem[0x3a5f] = 0;
- The "SNK Wave" custom sound circuitry is only actually used by marvins and
diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c
index eaaca24d985..116d301c67b 100644
--- a/src/mame/drivers/snk68.c
+++ b/src/mame/drivers/snk68.c
@@ -1040,7 +1040,7 @@ ROM_END
static DRIVER_INIT( searchar )
{
- machine.root_device().membank("bank1")->set_base(machine.region("user1")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
}
/******************************************************************************/
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index f7fa1ec161f..c415b424e6e 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -418,13 +418,13 @@ static void sb3_play_music(running_machine &machine, int data)
{
case 0x23:
case 0x26:
- snd = machine.region("oki")->base();
+ snd = machine.root_device().memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x00000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
case 0x24:
- snd = machine.region("oki")->base();
+ snd = machine.root_device().memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x20000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
@@ -437,7 +437,7 @@ static void sb3_play_music(running_machine &machine, int data)
case 0x2b:
case 0x2c:
case 0x2d:
- snd = machine.region("oki")->base();
+ snd = state->memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x40000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
@@ -1516,7 +1516,7 @@ static const ym2151_interface ym2151_config =
static MACHINE_RESET (semiprot)
{
snowbros_state *state = machine.driver_data<snowbros_state>();
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+ UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
int i;
for (i = 0;i < 0x200/2;i++)
@@ -1526,7 +1526,7 @@ static MACHINE_RESET (semiprot)
static MACHINE_RESET (finalttr)
{
snowbros_state *state = machine.driver_data<snowbros_state>();
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+ UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
int i;
for (i = 0;i < 0x200/2;i++)
@@ -2337,7 +2337,7 @@ READ16_MEMBER(snowbros_state::moremorp_0a_read)
static DRIVER_INIT( moremorp )
{
//snowbros_state *state = machine.driver_data<snowbros_state>();
-// UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+// UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
// int i;
// for (i = 0;i < 0x200/2;i++)
@@ -2352,8 +2352,8 @@ static DRIVER_INIT( moremorp )
static DRIVER_INIT( cookbib2 )
{
//snowbros_state *state = machine.driver_data<snowbros_state>();
-// UINT16 *HCROM = (UINT16*)machine.region("maincpu")->base();
-// UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+// UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
+// UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
// int i;
// state->m_hyperpac_ram[0xf000/2] = 0x46fc;
// state->m_hyperpac_ram[0xf002/2] = 0x2700;
@@ -2719,8 +2719,8 @@ READ16_MEMBER(snowbros_state::_4in1_02_read)
static DRIVER_INIT(4in1boot)
{
UINT8 *buffer;
- UINT8 *src = machine.region("maincpu")->base();
- int len = machine.region("maincpu")->bytes();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
+ int len = machine.root_device().memregion("maincpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
@@ -2734,8 +2734,8 @@ static DRIVER_INIT(4in1boot)
auto_free(machine, buffer);
}
- src = machine.region("soundcpu")->base();
- len = machine.region("soundcpu")->bytes();
+ src = machine.root_device().memregion("soundcpu")->base();
+ len = machine.root_device().memregion("soundcpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
@@ -2753,8 +2753,8 @@ static DRIVER_INIT(4in1boot)
static DRIVER_INIT(snowbro3)
{
UINT8 *buffer;
- UINT8 *src = machine.region("maincpu")->base();
- int len = machine.region("maincpu")->bytes();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
+ int len = machine.root_device().memregion("maincpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c
index a0f9b0b94cf..2e1021bc8e1 100644
--- a/src/mame/drivers/sothello.c
+++ b/src/mame/drivers/sothello.c
@@ -80,7 +80,7 @@ public:
WRITE8_MEMBER(sothello_state::bank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bank=0;
switch(data^0xff)
{
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 672c1525f0c..0b65ecb9a28 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -78,7 +78,7 @@ static void spd_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * chip;
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * chip;
state->m_adpcm_data[chip] = ROM[state->m_adpcm_pos[chip]++];
msm5205_data_w(device,state->m_adpcm_data[chip] >> 4);
diff --git a/src/mame/drivers/speedspn.c b/src/mame/drivers/speedspn.c
index ea73867d06a..bc3c1fdc414 100644
--- a/src/mame/drivers/speedspn.c
+++ b/src/mame/drivers/speedspn.c
@@ -65,7 +65,7 @@ WRITE8_MEMBER(speedspn_state::speedspn_banked_rom_change)
{
/* is this weird banking some form of protection? */
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
int addr;
switch (data)
diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c
index 0c39c09a4dc..a83dce3e326 100644
--- a/src/mame/drivers/spiders.c
+++ b/src/mame/drivers/spiders.c
@@ -545,7 +545,7 @@ static READ8_DEVICE_HANDLER( gfx_rom_r )
if (state->m_gfx_rom_ctrl_mode)
{
- UINT8 *rom = device->machine().region("gfx1")->base();
+ UINT8 *rom = state->memregion("gfx1")->base();
ret = rom[state->m_gfx_rom_address];
diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c
index 8567a0c04d2..12dad8f2baa 100644
--- a/src/mame/drivers/splash.c
+++ b/src/mame/drivers/splash.c
@@ -1016,7 +1016,7 @@ static DRIVER_INIT( splash10 )
static DRIVER_INIT( roldfrog )
{
splash_state *state = machine.driver_data<splash_state>();
- UINT8 * ROM = (UINT8 *)machine.region("audiocpu")->base();
+ UINT8 * ROM = (UINT8 *)state->memregion("audiocpu")->base();
state->membank("sound_bank")->configure_entries(0, 16, &ROM[0x10000], 0x8000);
state->m_bitmap_type = 1;
@@ -1026,7 +1026,7 @@ static DRIVER_INIT( roldfrog )
static DRIVER_INIT( rebus )
{
splash_state *state = machine.driver_data<splash_state>();
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)state->memregion("maincpu")->base();
state->m_bitmap_type = 1;
state->m_sprite_attr2_shift = 0;
@@ -1056,7 +1056,7 @@ static DRIVER_INIT( rebus )
static DRIVER_INIT( funystrp )
{
splash_state *state = machine.driver_data<splash_state>();
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
state->m_bitmap_type = 0;
state->m_sprite_attr2_shift = 0;
@@ -1095,7 +1095,7 @@ static DRIVER_INIT( funystrp )
ROM[0x11730/2] = 0x7001;
ROM[0x11f80/2] = 0x7001;
- ROM = (UINT16 *)machine.region("audiocpu")->base();
+ ROM = (UINT16 *)state->memregion("audiocpu")->base();
state->membank("sound_bank")->configure_entries(0, 16, &ROM[0x00000], 0x8000);
diff --git a/src/mame/drivers/splus.c b/src/mame/drivers/splus.c
index b682398aadd..f6026fcd9d6 100644
--- a/src/mame/drivers/splus.c
+++ b/src/mame/drivers/splus.c
@@ -578,7 +578,7 @@ static DRIVER_INIT( splus )
{
splus_state *state = machine.driver_data<splus_state>();
- UINT8 *reel_data = machine.region( "reeldata" )->base();
+ UINT8 *reel_data = state->memregion( "reeldata" )->base();
// Load Reel Data
memcpy(state->m_reel_ram, &reel_data[0x0000], 0x2000);
diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c
index 333c9a8fbba..612b8328d24 100644
--- a/src/mame/drivers/spoker.c
+++ b/src/mame/drivers/spoker.c
@@ -575,7 +575,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( spk116it )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -682,7 +682,7 @@ ROM_END
static DRIVER_INIT( 3super8 )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int i;
/* Decryption is probably done using one macrocell/output on an address decoding pal which we do not have a dump of */
@@ -700,8 +700,8 @@ static DRIVER_INIT( 3super8 )
/* cheesy hack: take gfx roms from spk116it and rearrange them for this game needs */
{
- UINT8 *src = machine.region("rep_gfx")->base();
- UINT8 *dst = machine.region("gfx1")->base();
+ UINT8 *src = machine.root_device().memregion("rep_gfx")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
UINT8 x;
for(x=0;x<3;x++)
diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c
index c7d56045d00..fab1405d33f 100644
--- a/src/mame/drivers/spool99.c
+++ b/src/mame/drivers/spool99.c
@@ -159,7 +159,7 @@ WRITE8_MEMBER(spool99_state::spool99_cram_w)
READ8_MEMBER(spool99_state::spool99_io_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
// if(!(io_switch))
{
@@ -229,7 +229,7 @@ ADDRESS_MAP_END
READ8_MEMBER(spool99_state::vcarn_io_r)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
// if(!(io_switch))
{
@@ -419,7 +419,7 @@ static DRIVER_INIT( spool99 )
{
spool99_state *state = machine.driver_data<spool99_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
// vram = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(state->m_main, ROM, 0x100);
}
diff --git a/src/mame/drivers/sprcros2.c b/src/mame/drivers/sprcros2.c
index 02180074d4d..a5268fec8ab 100644
--- a/src/mame/drivers/sprcros2.c
+++ b/src/mame/drivers/sprcros2.c
@@ -64,7 +64,7 @@ Notes:
WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w)
{
- UINT8 *RAM = machine().region("master")->base();
+ UINT8 *RAM = memregion("master")->base();
//76543210
//x------- unused
@@ -85,7 +85,7 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w)
WRITE8_MEMBER(sprcros2_state::sprcros2_s_port3_w)
{
- UINT8 *RAM = machine().region("slave")->base();
+ UINT8 *RAM = memregion("slave")->base();
//76543210
//xxxx---- unused
diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c
index 6630fd0f857..52a967069f9 100644
--- a/src/mame/drivers/spy.c
+++ b/src/mame/drivers/spy.c
@@ -498,7 +498,7 @@ static const k051960_interface spy_k051960_intf =
static MACHINE_START( spy )
{
spy_state *state = machine.driver_data<spy_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000);
diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c
index ae51fe9820a..85d9248e033 100644
--- a/src/mame/drivers/srmp2.c
+++ b/src/mame/drivers/srmp2.c
@@ -171,7 +171,7 @@ static WRITE16_DEVICE_HANDLER( srmp2_adpcm_code_w )
*/
srmp2_state *state = device->machine().driver_data<srmp2_state>();
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = state->memregion("adpcm")->base();
state->m_adpcm_sptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
state->m_adpcm_eptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
@@ -195,7 +195,7 @@ static WRITE8_DEVICE_HANDLER( srmp3_adpcm_code_w )
*/
srmp2_state *state = device->machine().driver_data<srmp2_state>();
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = state->memregion("adpcm")->base();
state->m_adpcm_sptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
state->m_adpcm_eptr = (ROM[((state->m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
@@ -212,7 +212,7 @@ static WRITE8_DEVICE_HANDLER( srmp3_adpcm_code_w )
static void srmp2_adpcm_int(device_t *device)
{
srmp2_state *state = device->machine().driver_data<srmp2_state>();
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = state->memregion("adpcm")->base();
if (state->m_adpcm_sptr)
{
@@ -357,7 +357,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_rombank_w)
xxx- ---- : ADPCM ROM bank
*/
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
int addr;
m_adpcm_bank = ((data & 0xe0) >> 5);
@@ -507,7 +507,7 @@ WRITE8_MEMBER(srmp2_state::rmgoldyh_rombank_w)
xxx- ---- : ADPCM ROM bank
*/
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
int addr;
m_adpcm_bank = ((data & 0xe0) >> 5);
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index 58fad461ddd..f8550bbc112 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -268,7 +268,7 @@ WRITE32_MEMBER(srmp5_state::spr_w)
READ32_MEMBER(srmp5_state::data_r)
{
UINT32 data;
- const UINT8 *usr = machine().region("user2")->base();
+ const UINT8 *usr = memregion("user2")->base();
data=((m_databank>>4)&0xf)*0x100000; //guess
data=usr[data+offset*2]+usr[data+offset*2+1]*256;
diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c
index fb340d3ed11..05d3fdb924c 100644
--- a/src/mame/drivers/srmp6.c
+++ b/src/mame/drivers/srmp6.c
@@ -333,7 +333,7 @@ WRITE16_MEMBER(srmp6_state::video_regs_w)
case 0x5e/2: // bank switch, used by ROM check
{
- const UINT8 *rom = machine().region("nile")->base();
+ const UINT8 *rom = memregion("nile")->base();
LOG(("%x\n",data));
membank("bank1")->set_base((UINT16 *)(rom + (data & 0x0f)*0x200000));
break;
@@ -418,7 +418,7 @@ WRITE16_MEMBER(srmp6_state::srmp6_dma_w)
COMBINE_DATA(&dmaram[offset]);
if (offset==13 && dmaram[offset]==0x40)
{
- const UINT8 *rom = machine().region("nile")->base();
+ const UINT8 *rom = memregion("nile")->base();
UINT32 srctab=2*((((UINT32)dmaram[5])<<16)|dmaram[4]);
UINT32 srcdata=2*((((UINT32)dmaram[11])<<16)|dmaram[10]);
UINT32 len=4*(((((UINT32)dmaram[7]&3)<<16)|dmaram[6])+1); //??? WRONG!
diff --git a/src/mame/drivers/srumbler.c b/src/mame/drivers/srumbler.c
index 225146d8632..f0078a9cb59 100644
--- a/src/mame/drivers/srumbler.c
+++ b/src/mame/drivers/srumbler.c
@@ -28,9 +28,9 @@ WRITE8_MEMBER(srumbler_state::srumbler_bankswitch_w)
that as well to be 100% accurate.
*/
int i;
- UINT8 *ROM = machine().region("user1")->base();
- UINT8 *prom1 = machine().region("proms")->base() + (data & 0xf0);
- UINT8 *prom2 = machine().region("proms")->base() + 0x100 + ((data & 0x0f) << 4);
+ UINT8 *ROM = memregion("user1")->base();
+ UINT8 *prom1 = memregion("proms")->base() + (data & 0xf0);
+ UINT8 *prom2 = memregion("proms")->base() + 0x100 + ((data & 0x0f) << 4);
for (i = 0x05;i < 0x10;i++)
{
diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c
index 567885a8bd9..db1fbed206d 100644
--- a/src/mame/drivers/ssfindo.c
+++ b/src/mame/drivers/ssfindo.c
@@ -485,7 +485,7 @@ WRITE32_MEMBER(ssfindo_state::PS7500_IO_w)
READ32_MEMBER(ssfindo_state::io_r)
{
- UINT16 *FLASH = (UINT16 *)machine().region("user2")->base(); //16 bit - WORD access
+ UINT16 *FLASH = (UINT16 *)machine().root_device().memregion("user2")->base(); //16 bit - WORD access
int adr=m_flashAdr*0x200+(m_flashOffset);
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 367311c6d77..29aa157cdf7 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -492,7 +492,7 @@ static DRIVER_INIT( sshangha )
#if SSHANGHA_HACK
/* This is a hack to allow you to use the extra features
of the first "Unused" Dip Switch (see notes above). */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0x000384/2] = 0x4e71;
RAM[0x000386/2] = 0x4e71;
RAM[0x000388/2] = 0x4e71;
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index 657d048d485..8259e5c5f17 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -193,7 +193,7 @@ static MC6845_UPDATE_ROW( ssingles_update_row )
UINT32 tile_address;
UINT16 cell,palette;
UINT8 b0,b1;
- const UINT8 *gfx = device->machine().region("gfx1")->base();
+ const UINT8 *gfx = state->memregion("gfx1")->base();
for(cx=0;cx<x_count;++cx)
{
@@ -231,7 +231,7 @@ static MC6845_UPDATE_ROW( atamanot_update_row )
UINT32 tile_address;
UINT16 cell,palette;
UINT8 b0,b1;
- const UINT8 *gfx = device->machine().region("gfx1")->base();
+ const UINT8 *gfx = state->memregion("gfx1")->base();
for(cx=0;cx<x_count;++cx)
{
@@ -293,14 +293,14 @@ static const mc6845_interface atamanot_mc6845_intf =
WRITE8_MEMBER(ssingles_state::ssingles_videoram_w)
{
- UINT8 *vram = machine().region("vram")->base();
+ UINT8 *vram = memregion("vram")->base();
vram[offset] = data;
m_videoram[offset]=data;
}
WRITE8_MEMBER(ssingles_state::ssingles_colorram_w)
{
- UINT8 *cram = machine().region("cram")->base();
+ UINT8 *cram = memregion("cram")->base();
cram[offset] = data;
m_colorram[offset]=data;
}
diff --git a/src/mame/drivers/ssrj.c b/src/mame/drivers/ssrj.c
index 48a396c7a09..f34b0295c5a 100644
--- a/src/mame/drivers/ssrj.c
+++ b/src/mame/drivers/ssrj.c
@@ -37,7 +37,7 @@ HW info :
static MACHINE_RESET(ssrj)
{
ssrj_state *state = machine.driver_data<ssrj_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
memset(&rom[0xc000], 0 ,0x3fff); /* req for some control types */
state->m_oldport = 0x80;
diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c
index 33b14dc785c..14ebabf9044 100644
--- a/src/mame/drivers/sstrangr.c
+++ b/src/mame/drivers/sstrangr.c
@@ -92,7 +92,7 @@ static SCREEN_UPDATE_RGB32( sstrngr2 )
get_pens(pens);
- color_map_base = &screen.machine().region("proms")->base()[state->m_flip_screen ? 0x0000 : 0x0200];
+ color_map_base = &state->memregion("proms")->base()[state->m_flip_screen ? 0x0000 : 0x0200];
for (offs = 0; offs < 0x2000; offs++)
{
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 8b0edb2fb51..f4b0312626d 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -326,7 +326,7 @@ static MACHINE_RESET( ssv )
ssv_state *state = machine.driver_data<ssv_state>();
state->m_requested_int = 0;
device_set_irq_callback(machine.device("maincpu"), ssv_irq_callback);
- state->membank("bank1")->set_base(machine.region("user1")->base());
+ state->membank("bank1")->set_base(state->memregion("user1")->base());
}
@@ -549,8 +549,8 @@ WRITE16_MEMBER(ssv_state::gdfs_blitram_w)
UINT32 dst = (gdfs_blitram[0xc4/2] + (gdfs_blitram[0xc6/2] << 16)) << 4;
UINT32 len = (gdfs_blitram[0xc8/2]) << 4;
- UINT8 *rom = machine().region("gfx2")->base();
- size_t size = machine().region("gfx2")->bytes();
+ UINT8 *rom = memregion("gfx2")->base();
+ size_t size = memregion("gfx2")->bytes();
if ( (src+len <= size) && (dst+len <= 4 * 0x100000) )
{
@@ -962,8 +962,8 @@ ADDRESS_MAP_END
READ16_MEMBER(ssv_state::eaglshot_gfxrom_r)
{
- UINT8 *rom = machine().region("gfx1")->base();
- size_t size = machine().region("gfx1")->bytes();
+ UINT8 *rom = memregion("gfx1")->base();
+ size_t size = memregion("gfx1")->bytes();
offset = offset * 2 + m_gfxrom_select * 0x200000;
@@ -2648,9 +2648,9 @@ static void init_hypreac2(running_machine &machine)
// massages the data from the BPMicro-compatible dump to runnable form
static void init_st010(running_machine &machine)
{
- UINT8 *dspsrc = (UINT8 *)machine.region("st010")->base();
- UINT32 *dspprg = (UINT32 *)machine.region("dspprg")->base();
- UINT16 *dspdata = (UINT16 *)machine.region("dspdata")->base();
+ UINT8 *dspsrc = (UINT8 *)machine.root_device().memregion("st010")->base();
+ UINT32 *dspprg = (UINT32 *)machine.root_device().memregion("dspprg")->base();
+ UINT16 *dspdata = (UINT16 *)machine.root_device().memregion("dspdata")->base();
// copy DSP program
for (int i = 0; i < 0x10000; i+= 4)
@@ -2677,7 +2677,7 @@ static DRIVER_INIT( meosism ) { init_ssv(machine, 0); }
static DRIVER_INIT( mslider ) { init_ssv(machine, 0); }
static DRIVER_INIT( ryorioh ) { init_ssv(machine, 0); }
static DRIVER_INIT( srmp4 ) { init_ssv(machine, 0);
-// ((UINT16 *)machine.region("user1")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */
+// ((UINT16 *)machine.root_device().memregion("user1")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */
}
static DRIVER_INIT( srmp7 ) { init_ssv(machine, 0); }
static DRIVER_INIT( stmblade ) { init_ssv(machine, 0); init_st010(machine); }
diff --git a/src/mame/drivers/st0016.c b/src/mame/drivers/st0016.c
index 9cfb82bcf57..1bf9d7e5b11 100644
--- a/src/mame/drivers/st0016.c
+++ b/src/mame/drivers/st0016.c
@@ -70,7 +70,7 @@ WRITE8_MEMBER(st0016_state::mux_select_w)
WRITE8_MEMBER(st0016_state::st0016_rom_bank_w)
{
- membank("bank1")->set_base(machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 );
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + (data* 0x4000) + 0x10000 );
st0016_rom_bank=data;
}
@@ -681,13 +681,13 @@ static DRIVER_INIT(nratechu)
static DRIVER_INIT(mayjinsn)
{
st0016_game=4|0x80;
- machine.root_device().membank("bank2")->set_base(machine.region("user1")->base());
+ machine.root_device().membank("bank2")->set_base(machine.root_device().memregion("user1")->base());
}
static DRIVER_INIT(mayjisn2)
{
st0016_game=4;
- machine.root_device().membank("bank2")->set_base(machine.region("user1")->base());
+ machine.root_device().membank("bank2")->set_base(machine.root_device().memregion("user1")->base());
}
/*************************************
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index 5ffe006f684..0d929de0111 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -502,7 +502,7 @@ static DRIVER_INIT( starwars )
starwars_mproc_init(machine);
/* initialize banking */
- state->membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x6000, 0x10000 - 0x6000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x6000, 0x10000 - 0x6000);
state->membank("bank1")->set_entry(0);
}
@@ -510,7 +510,7 @@ static DRIVER_INIT( starwars )
static DRIVER_INIT( esb )
{
starwars_state *state = machine.driver_data<starwars_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
/* init the slapstic */
slapstic_init(machine, 101);
diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c
index 37dc4431cad..c7959bd36ca 100644
--- a/src/mame/drivers/statriv2.c
+++ b/src/mame/drivers/statriv2.c
@@ -224,8 +224,8 @@ static INTERRUPT_GEN( statriv2_interrupt )
READ8_MEMBER(statriv2_state::question_data_r)
{
- const UINT8 *qrom = machine().region("questions")->base();
- UINT32 qromsize = machine().region("questions")->bytes();
+ const UINT8 *qrom = memregion("questions")->base();
+ UINT32 qromsize = memregion("questions")->bytes();
UINT32 address;
if (m_question_offset_high == 0xff)
@@ -1102,8 +1102,8 @@ static DRIVER_INIT( addr_lmhe )
* *
\***************************************************/
- UINT8 *qrom = machine.region("questions")->base();
- UINT32 length = machine.region("questions")->bytes();
+ UINT8 *qrom = machine.root_device().memregion("questions")->base();
+ UINT32 length = machine.root_device().memregion("questions")->bytes();
UINT32 address;
for (address = 0; address < length; address++)
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 1b124cee94c..eb9a9b8de79 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -401,7 +401,7 @@ DRIVER_INIT(magzun)
/* Program ROM patches, don't understand how to avoid these two checks ... */
{
- UINT32 *ROM = (UINT32 *)machine.region("game0")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("game0")->base();
ROM[0x90054/4] = 0x00e00001; // END error
@@ -1098,7 +1098,7 @@ by Sega titles,and this is a Sunsoft game)It's likely to be a left-over...
static DRIVER_INIT( sanjeon )
{
- UINT8 *src = machine.region ( "game0" )->base();
+ UINT8 *src = machine.root_device().memregion ( "game0" )->base();
int x;
for (x=0;x<0x3000000;x++)
diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c
index 5f03e39c0cd..e433213ed68 100644
--- a/src/mame/drivers/sub.c
+++ b/src/mame/drivers/sub.c
@@ -386,9 +386,9 @@ GFXDECODE_END
static PALETTE_INIT( sub )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
- UINT8* lookup = machine.region("proms2")->base();
+ UINT8* lookup = machine.root_device().memregion("proms2")->base();
/* allocate the colortable */
machine.colortable = colortable_alloc(machine, 0x100);
diff --git a/src/mame/drivers/subsino.c b/src/mame/drivers/subsino.c
index ab856a7327c..95ee82ee7fc 100644
--- a/src/mame/drivers/subsino.c
+++ b/src/mame/drivers/subsino.c
@@ -548,7 +548,7 @@ static SCREEN_UPDATE_IND16( stisub_reels )
static PALETTE_INIT( subsino_2proms )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
@@ -575,7 +575,7 @@ static PALETTE_INIT( subsino_2proms )
static PALETTE_INIT( subsino_3proms )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i,r,g,b,val;
int bit0,bit1,bit2;
@@ -3362,7 +3362,7 @@ ROM_END
static DRIVER_INIT( smoto16 )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
rom[0x12d0] = 0x20; // "ERROR 951010"
}
@@ -3512,13 +3512,13 @@ static DRIVER_INIT( sharkpye )
static DRIVER_INIT( smoto20 )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
rom[0x12e1] = 0x20; // "ERROR 951010"
}
static DRIVER_INIT( tisub )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
DRIVER_INIT_CALL(victor5);
@@ -3533,7 +3533,7 @@ static DRIVER_INIT( tisub )
static DRIVER_INIT( tisuba )
{
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
DRIVER_INIT_CALL(victor5);
@@ -3549,7 +3549,7 @@ static DRIVER_INIT( tisuba )
static DRIVER_INIT( stisub )
{
subsino_state *state = machine.driver_data<subsino_state>();
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = state->memregion( "maincpu" )->base();
rom[0x1005] = 0x1d; //patch protection check
rom[0x7ab] = 0x18; //patch "winning protection" check
rom[0x957] = 0x18; //patch "losing protection" check
diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c
index 1ba6311193d..6a26f130663 100644
--- a/src/mame/drivers/subsino2.c
+++ b/src/mame/drivers/subsino2.c
@@ -2362,7 +2362,7 @@ ROM_END
static DRIVER_INIT( bishjan )
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
// patch serial protection test (it always enters test mode on boot otherwise)
rom[0x042EA/2] = 0x4008;
@@ -2426,7 +2426,7 @@ ROM_END
static DRIVER_INIT( expcard )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xed4dc-0xc0000] = 0xeb;
@@ -2524,7 +2524,7 @@ DRIVER_INIT( mtrain )
subsino_decrypt(machine, crsbingo_bitswaps, crsbingo_xors, 0x8000);
// patch serial protection test (it always enters test mode on boot otherwise)
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x0cec] = 0x18;
rom[0xb037] = 0x18;
@@ -2578,7 +2578,7 @@ ROM_END
static DRIVER_INIT( saklove )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch serial protection test (it always enters test mode on boot otherwise)
rom[0x0e029] = 0xeb;
@@ -2638,7 +2638,7 @@ ROM_END
static DRIVER_INIT( xplan )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xeded9-0xc0000] = 0xeb;
@@ -2698,7 +2698,7 @@ ROM_END
static DRIVER_INIT( xtrain )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xe190f-0xc0000] = 0xeb;
@@ -2743,7 +2743,7 @@ DRIVER_INIT( wtrnymph )
subsino_decrypt(machine, victor5_bitswaps, victor5_xors, 0x8000);
// patch serial protection test (it always enters test mode on boot otherwise)
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x0d79] = 0x18;
rom[0xc1cf] = 0x18;
rom[0xc2a9] = 0x18;
diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c
index 79c3162f2d5..04aec0f63b3 100644
--- a/src/mame/drivers/suna16.c
+++ b/src/mame/drivers/suna16.c
@@ -260,7 +260,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna16_state::bssoccer_pcm_1_bankswitch_w)
{
- UINT8 *RAM = machine().region("pcm1")->base();
+ UINT8 *RAM = memregion("pcm1")->base();
int bank = data & 7;
if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
membank("bank1")->set_base(&RAM[bank * 0x10000 + 0x1000]);
@@ -268,7 +268,7 @@ WRITE8_MEMBER(suna16_state::bssoccer_pcm_1_bankswitch_w)
WRITE8_MEMBER(suna16_state::bssoccer_pcm_2_bankswitch_w)
{
- UINT8 *RAM = machine().region("pcm2")->base();
+ UINT8 *RAM = memregion("pcm2")->base();
int bank = data & 7;
if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
membank("bank2")->set_base(&RAM[bank * 0x10000 + 0x1000]);
@@ -322,7 +322,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna16_state::uballoon_pcm_1_bankswitch_w)
{
- UINT8 *RAM = machine().region("pcm1")->base();
+ UINT8 *RAM = memregion("pcm1")->base();
int bank = data & 1;
if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
membank("bank1")->set_base(&RAM[bank * 0x10000 + 0x400]);
@@ -1087,7 +1087,7 @@ ROM_END
static DRIVER_INIT( uballoon )
{
- UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
// Patch out the protection checks
RAM[0x0113c/2] = 0x4e71; // bne $646
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 07d2dc8347a..16e75a64497 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -60,7 +60,7 @@ Notes:
static DRIVER_INIT( hardhead )
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0; i < 0x8000; i++)
@@ -75,15 +75,15 @@ static DRIVER_INIT( hardhead )
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0) ^ 0x58;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/* Non encrypted bootleg */
static DRIVER_INIT( hardhedb )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x48000);
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x48000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -95,8 +95,8 @@ static DRIVER_INIT( hardhedb )
static UINT8 *brickzn_decrypt(running_machine &machine)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
int i;
@@ -137,7 +137,7 @@ static UINT8 *brickzn_decrypt(running_machine &machine)
static DRIVER_INIT( brickzn )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = brickzn_decrypt(machine);
int i;
@@ -162,13 +162,13 @@ static DRIVER_INIT( brickzn )
decrypt[0x24b5] = 0x00; // HALT -> NOP
decrypt[0x2583] = 0x00; // HALT -> NOP
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x10000, 0x4000);
}
static DRIVER_INIT( brickzn3 )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = brickzn_decrypt(machine);
int i;
@@ -193,7 +193,7 @@ static DRIVER_INIT( brickzn3 )
decrypt[0x2487] = 0x00; // HALT -> NOP
decrypt[0x256c] = 0x00; // HALT -> NOP
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x10000, 0x4000);
}
@@ -205,8 +205,8 @@ static DRIVER_INIT( brickzn3 )
static DRIVER_INIT( hardhea2 )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -280,7 +280,7 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x41;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine.root_device().membank("bank2")->configure_entries(0, 2, auto_alloc_array(machine, UINT8, 0x2000 * 2), 0x2000);
}
@@ -292,8 +292,8 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
static DRIVER_INIT( starfigh )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -349,7 +349,7 @@ static DRIVER_INIT( starfigh )
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x45;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
@@ -360,8 +360,8 @@ static DRIVER_INIT( starfigh )
static DRIVER_INIT( sparkman )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.region("maincpu")->base();
- size_t size = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -417,7 +417,7 @@ static DRIVER_INIT( sparkman )
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x44;
}
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -2355,7 +2355,7 @@ ROM_END
static DRIVER_INIT( suna8 )
{
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
/* Working Games */
diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c
index 9d0a571b843..f11d0eef237 100644
--- a/src/mame/drivers/supdrapo.c
+++ b/src/mame/drivers/supdrapo.c
@@ -126,7 +126,7 @@ static SCREEN_UPDATE_IND16( supdrapo )
/*Maybe bit 2 & 3 of the second color prom are intensity bits? */
static PALETTE_INIT( sdpoker )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c
index eceb40daf16..b15398d4e6e 100644
--- a/src/mame/drivers/superdq.c
+++ b/src/mame/drivers/superdq.c
@@ -82,7 +82,7 @@ static SCREEN_UPDATE_IND16( superdq )
static PALETTE_INIT( superdq )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances[3] = { 820, 390, 200 };
double rweights[3], gweights[3], bweights[2];
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 8e5fe73e933..47fa32441a5 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -112,8 +112,8 @@ static SAMPLES_START( pbillian_sh_start )
{
superqix_state *state = device.machine().driver_data<superqix_state>();
running_machine &machine = device.machine();
- UINT8 *src = machine.region("samples")->base();
- int i, len = machine.region("samples")->bytes();
+ UINT8 *src = machine.root_device().memregion("samples")->base();
+ int i, len = state->memregion("samples")->bytes();
/* convert 8-bit unsigned samples to 8-bit signed */
state->m_samplebuf = auto_alloc_array(machine, INT16, len);
@@ -124,8 +124,8 @@ static SAMPLES_START( pbillian_sh_start )
WRITE8_MEMBER(superqix_state::pbillian_sample_trigger_w)
{
samples_device *samples = machine().device<samples_device>("samples");
- UINT8 *src = machine().region("samples")->base();
- int len = machine().region("samples")->bytes();
+ UINT8 *src = memregion("samples")->base();
+ int len = memregion("samples")->bytes();
int start,end;
start = data << 7;
@@ -548,7 +548,7 @@ static void machine_init_common(running_machine &machine)
static MACHINE_START( superqix )
{
/* configure the banks */
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine_init_common(machine);
}
@@ -556,7 +556,7 @@ static MACHINE_START( superqix )
static MACHINE_START( pbillian )
{
/* configure the banks */
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
machine_init_common(machine);
}
@@ -1363,8 +1363,8 @@ static DRIVER_INIT( perestro )
int i,j;
/* decrypt program code; the address lines are shuffled around in a non-trivial way */
- src = machine.region("maincpu")->base();
- len = machine.region("maincpu")->bytes();
+ src = machine.root_device().memregion("maincpu")->base();
+ len = machine.root_device().memregion("maincpu")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1383,8 +1383,8 @@ static DRIVER_INIT( perestro )
}
/* decrypt gfx ROMs; simple bit swap on the address lines */
- src = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ src = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1394,8 +1394,8 @@ static DRIVER_INIT( perestro )
}
}
- src = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ src = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1405,8 +1405,8 @@ static DRIVER_INIT( perestro )
}
}
- src = machine.region("gfx3")->base();
- len = machine.region("gfx3")->bytes();
+ src = machine.root_device().memregion("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
diff --git a/src/mame/drivers/supertnk.c b/src/mame/drivers/supertnk.c
index 98d8c2eb4a4..498dfb0f2c3 100644
--- a/src/mame/drivers/supertnk.c
+++ b/src/mame/drivers/supertnk.c
@@ -140,7 +140,7 @@ WRITE8_MEMBER(supertnk_state::supertnk_bankswitch_0_w)
bank_address = 0x10000 + (m_rom_bank * 0x1000);
- membank("bank1")->set_base(&machine().region("maincpu")->base()[bank_address]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[bank_address]);
}
@@ -152,7 +152,7 @@ WRITE8_MEMBER(supertnk_state::supertnk_bankswitch_1_w)
bank_address = 0x10000 + (m_rom_bank * 0x1000);
- membank("bank1")->set_base(&machine().region("maincpu")->base()[bank_address]);
+ membank("bank1")->set_base(&machine().root_device().memregion("maincpu")->base()[bank_address]);
}
@@ -187,7 +187,7 @@ static VIDEO_START( supertnk )
{
supertnk_state *state = machine.driver_data<supertnk_state>();
offs_t i;
- const UINT8 *prom = machine.region("proms")->base();
+ const UINT8 *prom = state->memregion("proms")->base();
for (i = 0; i < NUM_PENS; i++)
{
@@ -490,8 +490,8 @@ static DRIVER_INIT( supertnk )
{
/* decode the TMS9980 ROMs */
offs_t offs;
- UINT8 *rom = machine.region("maincpu")->base();
- size_t len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ size_t len = machine.root_device().memregion("maincpu")->bytes();
for (offs = 0; offs < len; offs++)
{
diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c
index 1ea44de6ee9..2066e6a89ef 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -257,7 +257,7 @@ static READ8_DEVICE_HANDLER( rom_bank_select_r )
static WRITE8_DEVICE_HANDLER( rom_bank_select_w )
{
suprgolf_state *state = device->machine().driver_data<suprgolf_state>();
- UINT8 *region_base = device->machine().region("user1")->base();
+ UINT8 *region_base = state->memregion("user1")->base();
state->m_rom_bank = data;
@@ -272,7 +272,7 @@ static WRITE8_DEVICE_HANDLER( rom_bank_select_w )
WRITE8_MEMBER(suprgolf_state::rom2_bank_select_w)
{
- UINT8 *region_base = machine().region("user2")->base();
+ UINT8 *region_base = memregion("user2")->base();
// mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,cpu_get_previouspc(&space.device()));
membank("bank1")->set_base(region_base + (data&0x0f) * 0x4000);
@@ -638,7 +638,7 @@ ROM_END
static DRIVER_INIT( suprgolf )
{
- UINT8 *ROM = machine.region("user2")->base();
+ UINT8 *ROM = machine.root_device().memregion("user2")->base();
ROM[0x74f4-0x4000] = 0x00;
ROM[0x74f5-0x4000] = 0x00;
diff --git a/src/mame/drivers/suprloco.c b/src/mame/drivers/suprloco.c
index fc735279004..24e63e32bc8 100644
--- a/src/mame/drivers/suprloco.c
+++ b/src/mame/drivers/suprloco.c
@@ -258,9 +258,9 @@ static DRIVER_INIT( suprloco )
int i, j, k, color_source, color_dest;
UINT8 *source, *dest, *lookup;
- source = machine.region("gfx1")->base();
+ source = machine.root_device().memregion("gfx1")->base();
dest = source + 0x6000;
- lookup = machine.region("proms")->base() + 0x0200;
+ lookup = machine.root_device().memregion("proms")->base() + 0x0200;
for (i = 0; i < 0x80; i++, lookup += 8)
{
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index bb22fd8499b..a406738d066 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -431,7 +431,7 @@ static MACHINE_RESET(skns)
else
hit.disconnect= 0;
- state->membank("bank1")->set_base(machine.region("user1")->base());
+ state->membank("bank1")->set_base(state->memregion("user1")->base());
}
@@ -665,7 +665,7 @@ WRITE32_MEMBER(skns_state::skns_io_w)
WRITE32_MEMBER(skns_state::skns_v3t_w)
{
- UINT8 *btiles = machine().region("gfx3")->base();
+ UINT8 *btiles = memregion("gfx3")->base();
COMBINE_DATA(&m_v3t_ram[offset]);
diff --git a/src/mame/drivers/suprslam.c b/src/mame/drivers/suprslam.c
index 5d3fd078397..737f558b8b8 100644
--- a/src/mame/drivers/suprslam.c
+++ b/src/mame/drivers/suprslam.c
@@ -114,7 +114,7 @@ WRITE8_MEMBER(suprslam_state::pending_command_clear_w)
WRITE8_MEMBER(suprslam_state::suprslam_sh_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x8000;
diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c
index 41967f13946..1c8fe1b3b61 100644
--- a/src/mame/drivers/surpratk.c
+++ b/src/mame/drivers/surpratk.c
@@ -191,7 +191,7 @@ static const k05324x_interface surpratk_k05324x_intf =
static MACHINE_START( surpratk )
{
surpratk_state *state = machine.driver_data<surpratk_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 28, &ROM[0x10000], 0x2000);
state->membank("bank1")->configure_entries(28, 4, &ROM[0x08000], 0x2000);
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index 9a1170efb90..0694cb43a28 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -356,12 +356,12 @@ static const UINT8 cc_ex[0x100] = {
static MACHINE_START( system1 )
{
system1_state *state = machine.driver_data<system1_state>();
- UINT32 numbanks = (machine.region("maincpu")->bytes() - 0x10000) / 0x4000;
+ UINT32 numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
if (numbanks > 0)
- state->membank("bank1")->configure_entries(0, numbanks, machine.region("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, numbanks, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
else
- state->membank("bank1")->configure_entry(0, machine.region("maincpu")->base() + 0x8000);
+ state->membank("bank1")->configure_entry(0, state->memregion("maincpu")->base() + 0x8000);
state->membank("bank1")->set_entry(0);
z80_set_cycle_tables(machine.device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
@@ -583,7 +583,7 @@ READ8_MEMBER(system1_state::mcu_io_r)
return machine().device<z80_device>("maincpu")->space(AS_PROGRAM)->read_byte(offset);
case 1:
- return machine().region("maincpu")->base()[offset + 0x10000];
+ return memregion("maincpu")->base()[offset + 0x10000];
case 2:
return machine().device<z80_device>("maincpu")->space(AS_IO)->read_byte(offset);
@@ -4651,12 +4651,12 @@ static DRIVER_INIT( myherok )
/* additionally to the usual protection, all the program ROMs have data lines */
/* D0 and D1 swapped. */
- rom = machine.region("maincpu")->base();
+ rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0xc000;A++)
rom[A] = (rom[A] & 0xfc) | ((rom[A] & 1) << 1) | ((rom[A] & 2) >> 1);
/* the tile gfx ROMs are mangled as well: */
- rom = machine.region("tiles")->base();
+ rom = machine.root_device().memregion("tiles")->base();
/* the first ROM has data lines D0 and D6 swapped. */
for (A = 0x0000;A < 0x4000;A++)
@@ -4691,7 +4691,7 @@ static DRIVER_INIT( myherok )
READ8_MEMBER(system1_state::nob_start_r)
{
/* in reality, it's likely some M1-dependent behavior */
- return (cpu_get_pc(&space.device()) <= 0x0003) ? 0x80 : machine().region("maincpu")->base()[1];
+ return (cpu_get_pc(&space.device()) <= 0x0003) ? 0x80 : memregion("maincpu")->base()[1];
}
static DRIVER_INIT( nob )
@@ -4717,7 +4717,7 @@ static DRIVER_INIT( nobb )
/* Patch to get PRG ROMS ('T', 'R' and 'S) status as "GOOD" in the "test mode" */
/* not really needed */
-// UINT8 *ROM = machine.region("maincpu")->base();
+// UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
// ROM[0x3296] = 0x18; // 'jr' instead of 'jr z' - 'T' (PRG Main ROM)
// ROM[0x32be] = 0x18; // 'jr' instead of 'jr z' - 'R' (Banked ROM 1)
@@ -4730,7 +4730,7 @@ static DRIVER_INIT( nobb )
/* Patch to get sound in later levels(the program enters into a tight loop)*/
address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
- UINT8 *ROM2 = machine.region("soundcpu")->base();
+ UINT8 *ROM2 = machine.root_device().memregion("soundcpu")->base();
ROM2[0x02f9] = 0x28;//'jr z' instead of 'jr'
@@ -4747,7 +4747,7 @@ static DRIVER_INIT( nobb )
static DRIVER_INIT( bootleg )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x10000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x10000);
DRIVER_INIT_CALL(bank00);
}
@@ -4755,14 +4755,14 @@ static DRIVER_INIT( bootleg )
static DRIVER_INIT( bootsys2 )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x20000);
- machine.root_device().membank("bank1")->configure_decrypted_entries(0, 4, machine.region("maincpu")->base() + 0x30000, 0x4000);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x20000);
+ machine.root_device().membank("bank1")->configure_decrypted_entries(0, 4, machine.root_device().memregion("maincpu")->base() + 0x30000, 0x4000);
DRIVER_INIT_CALL(bank0c);
}
static DRIVER_INIT( choplift )
{
- UINT8 *mcurom = machine.region("mcu")->base();
+ UINT8 *mcurom = machine.root_device().memregion("mcu")->base();
/* the ROM dump we have is bad; the following patches make it work */
mcurom[0x100] = 0x55; /* D5 in current dump */
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 0fbc47647b9..2f3a9d406ff 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -389,7 +389,7 @@ READ8_MEMBER(segas1x_bootleg_state::tturfbl_soundbank_r)
WRITE8_MEMBER(segas1x_bootleg_state::tturfbl_soundbank_w)
{
- UINT8 *mem = machine().region("soundcpu")->base();
+ UINT8 *mem = memregion("soundcpu")->base();
switch(data)
{
@@ -460,11 +460,11 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( upd7759_bank_w ) //*
{
- int offs, size = device->machine().region("soundcpu")->bytes() - 0x10000;
+ int offs, size = device->machine().root_device().memregion("soundcpu")->bytes() - 0x10000;
upd7759_reset_w(device, data & 0x40);
offs = 0x10000 + (data * 0x4000) % size;
- device->machine().root_device().membank("bank1")->set_base(device->machine().region("soundcpu")->base() + offs);
+ device->machine().root_device().membank("bank1")->set_base(device->machine().root_device().memregion("soundcpu")->base() + offs);
}
@@ -1039,7 +1039,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(segas1x_bootleg_state::sys18_soundbank_w)
{
- UINT8 *mem = machine().region("soundcpu")->base();
+ UINT8 *mem = memregion("soundcpu")->base();
int rom = (data >> 6) & 3;
int bank = (data & 0x3f);
int mask = m_sound_info[rom * 2 + 0];
@@ -1203,7 +1203,7 @@ READ8_MEMBER(segas1x_bootleg_state::shdancbl_soundbank_r)
WRITE8_MEMBER(segas1x_bootleg_state::shdancbl_bankctrl_w)
{
- UINT8 *mem = machine().region("soundcpu")->base();
+ UINT8 *mem = memregion("soundcpu")->base();
switch (data)
{
@@ -3349,8 +3349,8 @@ static DRIVER_INIT( goldnaxeb1 )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int i;
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *KEY = machine.region("decryption")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *KEY = state->memregion("decryption")->base();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 data[0x1000];
@@ -3393,7 +3393,7 @@ static DRIVER_INIT( bayrouteb1 )
// decrypt
DRIVER_INIT_CALL( goldnaxeb1 );
- ROM2 = (UINT16*)machine.region("maincpu")->base();
+ ROM2 = (UINT16*)state->memregion("maincpu")->base();
decrypted_region2 = (UINT16*)state->m_decrypted_region;
// patch interrupt vector
@@ -3408,7 +3408,7 @@ static DRIVER_INIT( bayrouteb1 )
static DRIVER_INIT( bayrouteb2 )
{
- UINT8 *mem = machine.region("soundcpu")->base();
+ UINT8 *mem = machine.root_device().memregion("soundcpu")->base();
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3426,7 +3426,7 @@ static DRIVER_INIT( goldnaxeb2 )
static DRIVER_INIT( tturfbl )
{
- UINT8 *mem = machine.region("soundcpu")->base();
+ UINT8 *mem = machine.root_device().memregion("soundcpu")->base();
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3462,7 +3462,7 @@ static DRIVER_INIT( fpointbl )
/* Tetris-based */
static DRIVER_INIT( beautyb )
{
- UINT16*rom = (UINT16*)machine.region( "maincpu" )->base();
+ UINT16*rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base();
int x;
for (x = 0; x < 0x8000; x++)
@@ -3481,7 +3481,7 @@ static DRIVER_INIT( beautyb )
static DRIVER_INIT( shdancbl )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- UINT8 *mem = machine.region("soundcpu")->base();;
+ UINT8 *mem = state->memregion("soundcpu")->base();;
/* Copy first 32K of IC45 to Z80 address space */
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3496,7 +3496,7 @@ static DRIVER_INIT( shdancbl )
static DRIVER_INIT( mwalkbl )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- UINT8 *RAM = machine.region("soundcpu")->base();
+ UINT8 *RAM = state->memregion("soundcpu")->base();
static const int mwalk_sound_info[] =
{
0x0f, 0x00000, // ROM #1 = 128K
@@ -3518,7 +3518,7 @@ static DRIVER_INIT( mwalkbl )
static DRIVER_INIT( astormbl )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- UINT8 *RAM = machine.region("soundcpu")->base();
+ UINT8 *RAM = state->memregion("soundcpu")->base();
static const int astormbl_sound_info[] =
{
0x0f, 0x00000, // ROM #1 = 128K
diff --git a/src/mame/drivers/tail2nos.c b/src/mame/drivers/tail2nos.c
index 5b6449d5254..7a4fe809376 100644
--- a/src/mame/drivers/tail2nos.c
+++ b/src/mame/drivers/tail2nos.c
@@ -208,7 +208,7 @@ static const k051316_interface tail2nos_k051316_intf =
static MACHINE_START( tail2nos )
{
tail2nos_state *state = machine.driver_data<tail2nos_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank3")->configure_entries(0, 2, &ROM[0x10000], 0x8000);
state->membank("bank3")->set_entry(0);
@@ -227,8 +227,8 @@ static MACHINE_RESET( tail2nos )
tail2nos_state *state = machine.driver_data<tail2nos_state>();
/* point to the extra ROMs */
- state->membank("bank1")->set_base(machine.region("user1")->base());
- state->membank("bank2")->set_base(machine.region("user2")->base());
+ state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
+ state->membank("bank2")->set_base(state->memregion("user2")->base());
state->m_charbank = 0;
state->m_charpalette = 0;
diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c
index d4d0b828bb2..9c76fbbb2f4 100644
--- a/src/mame/drivers/taito_b.c
+++ b/src/mame/drivers/taito_b.c
@@ -2794,7 +2794,7 @@ MACHINE_CONFIG_END
#if 0
static void ryujin_patch(void)
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[ 0x62/2 ] = 1;
//0 (already in rom) - Taito Corporation 1993
//1 - Taito America corp with blue FBI logo
@@ -2849,7 +2849,7 @@ MACHINE_CONFIG_END
#if 0
static void sbm_patch(void)
{
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[ 0x7ffff/2 ] = 2; //US version
}
#endif
@@ -3707,7 +3707,7 @@ ROM_END
static DRIVER_INIT( taito_b )
{
- machine.root_device().membank("bank1")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
GAME( 1989, masterw, 0, masterw, masterw, taito_b, ROT270, "Taito Corporation Japan", "Master of Weapon (World)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c
index 56e84b1af3b..7ecbe0685ec 100644
--- a/src/mame/drivers/taito_f2.c
+++ b/src/mame/drivers/taito_f2.c
@@ -3013,7 +3013,7 @@ static MACHINE_START( common )
static MACHINE_START( f2 )
{
MACHINE_START_CALL(common);
- machine.root_device().membank("bank2")->configure_entries(0, 8, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ machine.root_device().membank("bank2")->configure_entries(0, 8, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_CONFIG_START( taito_f2, taitof2_state )
@@ -5274,7 +5274,7 @@ static DRIVER_INIT( finalb )
int i;
UINT8 data;
UINT32 offset;
- UINT8 *gfx = machine.region("gfx2")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx2")->base();
offset = 0x100000;
for (i = 0x180000; i < 0x200000; i++)
@@ -5310,8 +5310,8 @@ static DRIVER_INIT( cameltry )
static DRIVER_INIT( mjnquest )
{
taitof2_state *state = machine.driver_data<taitof2_state>();
- int i, len = machine.region("gfx2")->bytes();
- UINT8 *gfx = machine.region("gfx2")->base();
+ int i, len = machine.root_device().memregion("gfx2")->bytes();
+ UINT8 *gfx = state->memregion("gfx2")->base();
/* the bytes in each longword are in reversed order, put them in the
order used by the other games. */
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index acb1898493c..b945ab251f9 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -121,7 +121,7 @@ WRITE32_MEMBER(taito_f3_state::f3_sound_reset_1_w)
WRITE32_MEMBER(taito_f3_state::f3_sound_bankswitch_w)
{
if (m_f3_game==KIRAMEKI) {
- UINT16 *rom = (UINT16 *)machine().region("audiocpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("audiocpu")->base();
UINT32 idx;
idx = (offset << 1) & 0x1e;
@@ -3666,8 +3666,8 @@ static void tile_decode(running_machine &machine)
{
UINT8 lsb,msb;
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx2")->base();
- int size=machine.region("gfx2")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx2")->base();
+ int size=machine.root_device().memregion("gfx2")->bytes();
int data;
/* Setup ROM formats:
@@ -3699,8 +3699,8 @@ static void tile_decode(running_machine &machine)
offset+=4;
}
- gfx = machine.region("gfx1")->base();
- size=machine.region("gfx1")->bytes();
+ gfx = machine.root_device().memregion("gfx1")->base();
+ size=machine.root_device().memregion("gfx1")->bytes();
offset = size/2;
for (i = size/2+size/4; i<size; i++)
@@ -3781,7 +3781,7 @@ static DRIVER_INIT( trstaroj )
static DRIVER_INIT( scfinals )
{
taito_f3_state *state = machine.driver_data<taito_f3_state>();
- UINT32 *RAM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *RAM = (UINT32 *)state->memregion("maincpu")->base();
/* Doesn't boot without this - eprom related? */
RAM[0x5af0/4]=0x4e710000|(RAM[0x5af0/4]&0xffff);
@@ -3868,7 +3868,7 @@ WRITE32_MEMBER(taito_f3_state::bubsympb_oki_w)
//if (mem_mask==0x000000ff) downcast<okim6295_device *>(device)->write(0,data&0xff);
if (ACCESSING_BITS_16_23)
{
- UINT8 *snd = machine().region("oki")->base();
+ UINT8 *snd = memregion("oki")->base();
int bank = (data & 0x000f0000) >> 16;
// almost certainly wrong
memcpy(snd+0x30000, snd+0x80000+0x30000+bank*0x10000, 0x10000);
@@ -3889,7 +3889,7 @@ static DRIVER_INIT( bubsympb )
/* expand gfx rom */
{
int i;
- UINT8 *gfx = machine.region("gfx2")->base();
+ UINT8 *gfx = state->memregion("gfx2")->base();
for (i=0x200000;i<0x400000; i+=4)
{
@@ -3941,7 +3941,7 @@ static DRIVER_INIT( landmakr )
static DRIVER_INIT( landmkrp )
{
taito_f3_state *state = machine.driver_data<taito_f3_state>();
- UINT32 *RAM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *RAM = (UINT32 *)state->memregion("maincpu")->base();
/* For some reason the least significant byte in the last 2 long words of
ROM is swapped. As the roms have been verified ok, I assume this is some
@@ -3989,7 +3989,7 @@ static DRIVER_INIT( pbobbl2p )
// which eventually causes the game to crash
// -- protection check?? or some kind of checksum fail?
- UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)state->memregion("maincpu")->base();
/* protection? */
ROM[0x40090/4]=0x00004e71|(ROM[0x40090/4]&0xffff0000);
diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c
index 78c3e387659..e2fdbacc79e 100644
--- a/src/mame/drivers/taito_h.c
+++ b/src/mame/drivers/taito_h.c
@@ -518,7 +518,7 @@ static MACHINE_RESET( taitoh )
static MACHINE_START( taitoh )
{
taitoh_state *state = machine.driver_data<taitoh_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index 55304550517..49a5d7b5b97 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -173,7 +173,7 @@ static void machine_reset(running_machine &machine)
}
state->m_cur_rombank = state->m_cur_rombank2 = 0;
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000);
+ state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x10000);
gfx_element_set_source(machine.gfx[2], state->m_rambanks);
@@ -377,7 +377,7 @@ WRITE8_MEMBER(taitol_state::rombankswitch_w)
//logerror("robs %d, %02x (%04x)\n", offset, data, cpu_get_pc(&space.device()));
m_cur_rombank = data;
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + 0x2000 * m_cur_rombank);
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + 0x2000 * m_cur_rombank);
}
}
@@ -397,7 +397,7 @@ WRITE8_MEMBER(taitol_state::rombank2switch_w)
//logerror("robs2 %02x (%04x)\n", data, cpu_get_pc(&space.device()));
m_cur_rombank2 = data;
- membank("bank6")->set_base(machine().region("slave")->base() + 0x10000 + 0x4000 * m_cur_rombank2);
+ membank("bank6")->set_base(machine().root_device().memregion("slave")->base() + 0x10000 + 0x4000 * m_cur_rombank2);
}
}
@@ -596,7 +596,7 @@ static void champwr_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0x1ffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
@@ -740,7 +740,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(taitol_state::sound_bankswitch_w)
{
- UINT8 *RAM = machine().region("audiocpu")->base();
+ UINT8 *RAM = memregion("audiocpu")->base();
int banknum = (data - 1) & 3;
membank ("bank7")->set_base (&RAM [0x10000 + (banknum * 0x4000)]);
@@ -1784,7 +1784,7 @@ static WRITE8_DEVICE_HANDLER( portA_w )
if (state->m_cur_bank != (data & 0x03))
{
int bankaddress;
- UINT8 *RAM = device->machine().region("audiocpu")->base();
+ UINT8 *RAM = state->memregion("audiocpu")->base();
state->m_cur_bank = data & 0x03;
bankaddress = 0x10000 + (state->m_cur_bank - 1) * 0x4000;
@@ -2722,7 +2722,7 @@ static DRIVER_INIT( plottinga )
v |= 1 << (7 - j);
tab[i] = v;
}
- p = machine.region("maincpu")->base();
+ p = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x20000; i++)
{
*p = tab[*p];
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index 3a32dae892b..f1390a12435 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -412,7 +412,7 @@ static void reset_sound_region(running_machine &machine)
{
taitox_state *state = machine.driver_data<taitox_state>();
- state->membank("bank2")->set_base(machine.region("audiocpu")->base() + (state->m_banknum * 0x4000) + 0x10000 );
+ state->membank("bank2")->set_base(state->memregion("audiocpu")->base() + (state->m_banknum * 0x4000) + 0x10000 );
}
WRITE8_MEMBER(taitox_state::sound_bankswitch_w)
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index 53e34bc0b2d..bedc843964c 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -3060,9 +3060,9 @@ static MACHINE_START( bshark )
static MACHINE_START( taitoz )
{
- int banks = (machine.region("audiocpu")->bytes() - 0xc000) / 0x4000;
+ int banks = (machine.root_device().memregion("audiocpu")->bytes() - 0xc000) / 0x4000;
- machine.root_device().membank("bank10")->configure_entries(0, banks, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ machine.root_device().membank("bank10")->configure_entries(0, banks, machine.root_device().memregion("audiocpu")->base() + 0xc000, 0x4000);
machine.save().register_postload(save_prepost_delegate(FUNC(taitoz_postload), &machine));
diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c
index 5751c3d5019..9672a735a06 100644
--- a/src/mame/drivers/taitoair.c
+++ b/src/mame/drivers/taitoair.c
@@ -669,7 +669,7 @@ static const tc0140syt_interface airsys_tc0140syt_intf =
static MACHINE_START( taitoair )
{
taitoair_state *state = machine.driver_data<taitoair_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
int i;
state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index 8c9e6b1541a..9eb9c2bfc21 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -919,7 +919,7 @@ ADDRESS_MAP_END
READ16_MEMBER(taitojc_state::dsp_rom_r)
{
- UINT16 *rom = (UINT16*)machine().region("gfx2")->base();
+ UINT16 *rom = (UINT16*)machine().root_device().memregion("gfx2")->base();
UINT16 data = rom[m_dsp_rom_pos++];
//mame_printf_debug("dsp_rom_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(&space.device()));
diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c
index 342f7ecf24f..c8e918ee6db 100644
--- a/src/mame/drivers/taitowlf.c
+++ b/src/mame/drivers/taitowlf.c
@@ -73,7 +73,7 @@ public:
static SCREEN_UPDATE_RGB32( taitowlf )
{
int x,y,count;
- const UINT8 *blit_ram = screen.machine().region("user5")->base();
+ const UINT8 *blit_ram = screen.machine().root_device().memregion("user5")->base();
bitmap.fill(get_black_pen(screen.machine()), cliprect);
@@ -148,7 +148,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
else // disable RAM access (reads go to BIOS ROM)
{
- state->membank("bank1")->set_base(busdevice->machine().region("user1")->base() + 0x30000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("user1")->base() + 0x30000);
}
break;
}
@@ -539,7 +539,7 @@ static MACHINE_START(taitowlf)
static MACHINE_RESET(taitowlf)
{
- machine.root_device().membank("bank1")->set_base(machine.region("user1")->base() + 0x30000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + 0x30000);
}
diff --git a/src/mame/drivers/tank8.c b/src/mame/drivers/tank8.c
index 9e49c66e2c2..d4dbf198ced 100644
--- a/src/mame/drivers/tank8.c
+++ b/src/mame/drivers/tank8.c
@@ -464,10 +464,10 @@ ROM_END
static DRIVER_INIT( decode )
{
- const UINT8* DECODE = machine.region("user1")->base();
+ const UINT8* DECODE = machine.root_device().memregion("user1")->base();
- UINT8* p1 = machine.region("maincpu")->base() + 0x00000;
- UINT8* p2 = machine.region("maincpu")->base() + 0x10000;
+ UINT8* p1 = machine.root_device().memregion("maincpu")->base() + 0x00000;
+ UINT8* p2 = machine.root_device().memregion("maincpu")->base() + 0x10000;
int i;
diff --git a/src/mame/drivers/tankbust.c b/src/mame/drivers/tankbust.c
index 720a84ef51d..3f53472ce85 100644
--- a/src/mame/drivers/tankbust.c
+++ b/src/mame/drivers/tankbust.c
@@ -99,8 +99,8 @@ WRITE8_MEMBER(tankbust_state::tankbust_e0xx_w)
case 7: /* 0xe007 bankswitch */
/* bank 1 at 0x6000-9fff = from 0x10000 when bit0=0 else from 0x14000 */
/* bank 2 at 0xa000-bfff = from 0x18000 when bit0=0 else from 0x1a000 */
- membank("bank1")->set_base(machine().region("maincpu")->base() + 0x10000 + ((data&1) * 0x4000) );
- membank("bank2")->set_base(machine().region("maincpu")->base() + 0x18000 + ((data&1) * 0x2000) ); /* verified (the game will reset after the "game over" otherwise) */
+ membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + ((data&1) * 0x4000) );
+ membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0x18000 + ((data&1) * 0x2000) ); /* verified (the game will reset after the "game over" otherwise) */
break;
}
}
@@ -115,7 +115,7 @@ READ8_MEMBER(tankbust_state::debug_output_area_r)
static PALETTE_INIT( tankbust )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 128; i++)
diff --git a/src/mame/drivers/taotaido.c b/src/mame/drivers/taotaido.c
index 594ed0a8cfa..a12efd1cbc0 100644
--- a/src/mame/drivers/taotaido.c
+++ b/src/mame/drivers/taotaido.c
@@ -123,7 +123,7 @@ WRITE8_MEMBER(taotaido_state::pending_command_clear_w)
WRITE8_MEMBER(taotaido_state::taotaido_sh_bankswitch_w)
{
- UINT8 *rom = machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
membank("bank1")->set_base(rom + (data & 0x03) * 0x8000);
}
diff --git a/src/mame/drivers/targeth.c b/src/mame/drivers/targeth.c
index 3f5c7e1e2df..01d677a02dc 100644
--- a/src/mame/drivers/targeth.c
+++ b/src/mame/drivers/targeth.c
@@ -51,7 +51,7 @@ static TIMER_DEVICE_CALLBACK(targeth_interrupt )
WRITE16_MEMBER(targeth_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c
index 4ec06e9f152..1ddd71f89dd 100644
--- a/src/mame/drivers/tatsumi.c
+++ b/src/mame/drivers/tatsumi.c
@@ -1284,9 +1284,9 @@ ROM_END
static DRIVER_INIT( apache3 )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src1 = machine.region("gfx2")->base();
- UINT8 *src2 = machine.region("gfx3")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *src2 = state->memregion("gfx3")->base();
int i;
for (i=0; i<0x100000; i+=32) {
@@ -1299,10 +1299,10 @@ static DRIVER_INIT( apache3 )
}
// Copy sprite & palette data out of GFX rom area
- state->m_rom_sprite_lookup1 = machine.region("gfx2")->base();
- state->m_rom_sprite_lookup2 = machine.region("gfx3")->base();
- state->m_rom_clut0 = machine.region("gfx2")->base()+ 0x100000 - 0x800;
- state->m_rom_clut1 = machine.region("gfx3")->base()+ 0x100000 - 0x800;
+ state->m_rom_sprite_lookup1 = machine.root_device().memregion("gfx2")->base();
+ state->m_rom_sprite_lookup2 = machine.root_device().memregion("gfx3")->base();
+ state->m_rom_clut0 = machine.root_device().memregion("gfx2")->base()+ 0x100000 - 0x800;
+ state->m_rom_clut1 = machine.root_device().memregion("gfx3")->base()+ 0x100000 - 0x800;
tatsumi_reset(machine);
@@ -1312,9 +1312,9 @@ static DRIVER_INIT( apache3 )
static DRIVER_INIT( roundup5 )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src1 = machine.region("gfx2")->base();
- UINT8 *src2 = machine.region("gfx3")->base();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *src2 = state->memregion("gfx3")->base();
int i;
for (i=0; i<0xc0000; i+=32) {
@@ -1327,10 +1327,10 @@ static DRIVER_INIT( roundup5 )
}
// Copy sprite & palette data out of GFX rom area
- state->m_rom_sprite_lookup1 = machine.region("gfx2")->base();
- state->m_rom_sprite_lookup2 = machine.region("gfx3")->base();
- state->m_rom_clut0 = machine.region("gfx2")->base()+ 0xc0000 - 0x800;
- state->m_rom_clut1 = machine.region("gfx3")->base()+ 0xc0000 - 0x800;
+ state->m_rom_sprite_lookup1 = machine.root_device().memregion("gfx2")->base();
+ state->m_rom_sprite_lookup2 = machine.root_device().memregion("gfx3")->base();
+ state->m_rom_clut0 = machine.root_device().memregion("gfx2")->base()+ 0xc0000 - 0x800;
+ state->m_rom_clut1 = machine.root_device().memregion("gfx3")->base()+ 0xc0000 - 0x800;
tatsumi_reset(machine);
}
@@ -1338,11 +1338,11 @@ static DRIVER_INIT( roundup5 )
static DRIVER_INIT( cyclwarr )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.region("gfx1")->base();
- UINT8 *src1 = machine.region("gfx2")->base();
- int len1 = machine.region("gfx2")->bytes();
- UINT8 *src2 = machine.region("gfx3")->base();
- int len2 = machine.region("gfx3")->bytes();
+ UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ int len1 = machine.root_device().memregion("gfx2")->bytes();
+ UINT8 *src2 = machine.root_device().memregion("gfx3")->base();
+ int len2 = state->memregion("gfx3")->bytes();
int i;
for (i=0; i<len1; i+=32) {
memcpy(dst,src1,32);
@@ -1353,19 +1353,19 @@ static DRIVER_INIT( cyclwarr )
src2+=32;
}
- dst = machine.region("maincpu")->base();
+ dst = machine.root_device().memregion("maincpu")->base();
memcpy(state->m_cyclwarr_cpua_ram,dst,8);
state->membank("bank1")->set_base(dst);
- dst = machine.region("sub")->base();
+ dst = machine.root_device().memregion("sub")->base();
memcpy(state->m_cyclwarr_cpub_ram,dst,8);
state->membank("bank2")->set_base(dst);
// Copy sprite & palette data out of GFX rom area
- state->m_rom_sprite_lookup1 = machine.region("gfx2")->base();
- state->m_rom_sprite_lookup2 = machine.region("gfx3")->base();
- state->m_rom_clut0 = machine.region("gfx2")->base() + len1 - 0x1000;
- state->m_rom_clut1 = machine.region("gfx3")->base() + len2 - 0x1000;
+ state->m_rom_sprite_lookup1 = machine.root_device().memregion("gfx2")->base();
+ state->m_rom_sprite_lookup2 = machine.root_device().memregion("gfx3")->base();
+ state->m_rom_clut0 = machine.root_device().memregion("gfx2")->base() + len1 - 0x1000;
+ state->m_rom_clut1 = machine.root_device().memregion("gfx3")->base() + len2 - 0x1000;
tatsumi_reset(machine);
}
diff --git a/src/mame/drivers/tattack.c b/src/mame/drivers/tattack.c
index 397eb6826e9..6c7ab467405 100644
--- a/src/mame/drivers/tattack.c
+++ b/src/mame/drivers/tattack.c
@@ -238,7 +238,7 @@ ROM_END
static DRIVER_INIT(tattack)
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x1b4]=0;
rom[0x1b5]=0;
diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c
index c018b8b9353..2e416c5d44d 100644
--- a/src/mame/drivers/tbowl.c
+++ b/src/mame/drivers/tbowl.c
@@ -34,7 +34,7 @@ note: check this, its borrowed from tecmo.c / wc90.c at the moment and could wel
WRITE8_MEMBER(tbowl_state::tbowlb_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
@@ -44,7 +44,7 @@ WRITE8_MEMBER(tbowl_state::tbowlb_bankswitch_w)
WRITE8_MEMBER(tbowl_state::tbowlc_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("sub")->base();
+ UINT8 *RAM = memregion("sub")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
@@ -166,7 +166,7 @@ static void tbowl_adpcm_int(device_t *device)
tbowl_state *state = device->machine().driver_data<tbowl_state>();
int num = (strcmp(device->tag(), ":msm1") == 0) ? 0 : 1;
if (state->m_adpcm_pos[num] >= state->m_adpcm_end[num] ||
- state->m_adpcm_pos[num] >= device->machine().region("adpcm")->bytes()/2)
+ state->m_adpcm_pos[num] >= state->memregion("adpcm")->bytes()/2)
msm5205_reset_w(device,1);
else if (state->m_adpcm_data[num] != -1)
{
@@ -175,7 +175,7 @@ static void tbowl_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * num;
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * num;
state->m_adpcm_data[num] = ROM[state->m_adpcm_pos[num]++];
msm5205_data_w(device,state->m_adpcm_data[num] >> 4);
diff --git a/src/mame/drivers/tcl.c b/src/mame/drivers/tcl.c
index 33d61e94ed4..4bc5dc9efa7 100644
--- a/src/mame/drivers/tcl.c
+++ b/src/mame/drivers/tcl.c
@@ -189,8 +189,8 @@ static DRIVER_INIT(tcl)
/* only the first part is decrypted (and verified)*/
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *dest = machine.region("maincpu")->base();
- int len = machine.region("maincpu")->bytes();
+ UINT8 *dest = machine.root_device().memregion("maincpu")->base();
+ int len = machine.root_device().memregion("maincpu")->bytes();
UINT8 *src = auto_alloc_array(machine, UINT8, len);
int i,idx=0;
diff --git a/src/mame/drivers/tecmo.c b/src/mame/drivers/tecmo.c
index af0e8aa2903..b80cf9e9abc 100644
--- a/src/mame/drivers/tecmo.c
+++ b/src/mame/drivers/tecmo.c
@@ -55,7 +55,7 @@ f80b ????
WRITE8_MEMBER(tecmo_state::tecmo_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
@@ -86,7 +86,7 @@ static void tecmo_adpcm_int(device_t *device)
{
tecmo_state *state = device->machine().driver_data<tecmo_state>();
if (state->m_adpcm_pos >= state->m_adpcm_end ||
- state->m_adpcm_pos >= device->machine().region("adpcm")->bytes())
+ state->m_adpcm_pos >= state->memregion("adpcm")->bytes())
msm5205_reset_w(device,1);
else if (state->m_adpcm_data != -1)
{
@@ -95,7 +95,7 @@ static void tecmo_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine().region("adpcm")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
state->m_adpcm_data = ROM[state->m_adpcm_pos++];
msm5205_data_w(device,state->m_adpcm_data >> 4);
diff --git a/src/mame/drivers/tecmosys.c b/src/mame/drivers/tecmosys.c
index 84a86231f0b..7212ae74f95 100644
--- a/src/mame/drivers/tecmosys.c
+++ b/src/mame/drivers/tecmosys.c
@@ -333,7 +333,7 @@ WRITE8_MEMBER(tecmosys_state::tecmosys_oki_bank_w)
{
UINT8 upperbank = (data & 0x30) >> 4;
UINT8 lowerbank = (data & 0x03) >> 0;
- UINT8* region = machine().region("oki")->base();
+ UINT8* region = memregion("oki")->base();
memcpy( region+0x00000, region+0x80000 + lowerbank * 0x20000, 0x20000 );
memcpy( region+0x20000, region+0x80000 + upperbank * 0x20000, 0x20000 );
@@ -448,7 +448,7 @@ static const ymf262_interface tecmosys_ymf262_interface =
static MACHINE_START( tecmosys )
{
// tecmosys_state *state = machine.driver_data<tecmosys_state>();
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.region("audiocpu")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base(), 0x4000);
}
static MACHINE_CONFIG_START( deroon, tecmosys_state )
@@ -631,8 +631,8 @@ ROM_END
static void tecmosys_descramble(running_machine &machine)
{
- UINT8 *gfxsrc = machine.region( "gfx1" )->base();
- size_t srcsize = machine.region( "gfx1" )->bytes();
+ UINT8 *gfxsrc = machine.root_device().memregion( "gfx1" )->base();
+ size_t srcsize = machine.root_device().memregion( "gfx1" )->bytes();
int i;
for (i=0; i < srcsize; i+=4)
diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c
index c2f62d9313c..f8be8501f5a 100644
--- a/src/mame/drivers/tehkanwc.c
+++ b/src/mame/drivers/tehkanwc.c
@@ -195,7 +195,7 @@ static void tehkanwc_adpcm_int(device_t *device)
{
tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
- UINT8 *SAMPLES = device->machine().region("adpcm")->base();
+ UINT8 *SAMPLES = state->memregion("adpcm")->base();
int msm_data = SAMPLES[state->m_msm_data_offs & 0x7fff];
if (state->m_toggle == 0)
@@ -707,7 +707,7 @@ static DRIVER_INIT( teedoff )
023A: 00 nop
*/
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
ROM[0x0238] = 0x00;
ROM[0x0239] = 0x00;
diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c
index 3a7cead701d..790f2ad6d75 100644
--- a/src/mame/drivers/tetrisp2.c
+++ b/src/mame/drivers/tetrisp2.c
@@ -117,7 +117,7 @@ READ16_MEMBER(tetrisp2_state::rockn_adpcmbank_r)
WRITE16_MEMBER(tetrisp2_state::rockn_adpcmbank_w)
{
- UINT8 *SNDROM = machine().region("ymz")->base();
+ UINT8 *SNDROM = memregion("ymz")->base();
int bank;
m_rockn_adpcmbank = data;
@@ -134,7 +134,7 @@ WRITE16_MEMBER(tetrisp2_state::rockn_adpcmbank_w)
WRITE16_MEMBER(tetrisp2_state::rockn2_adpcmbank_w)
{
- UINT8 *SNDROM = machine().region("ymz")->base();
+ UINT8 *SNDROM = memregion("ymz")->base();
int bank;
char banktable[9][3]=
@@ -181,13 +181,13 @@ WRITE16_MEMBER(tetrisp2_state::nndmseal_sound_bank_w)
if (ACCESSING_BITS_0_7)
{
- UINT8 *rom = machine().region("okisource")->base();
+ UINT8 *rom = memregion("okisource")->base();
if (data & 0x04)
{
m_bank_lo = data & 0x03;
- memcpy(machine().region("oki")->base(), rom + (m_bank_lo * 0x80000), 0x20000);
+ memcpy(machine().root_device().memregion("oki")->base(), rom + (m_bank_lo * 0x80000), 0x20000);
// logerror("PC:%06X sound bank_lo = %02X\n",cpu_get_pc(&space.device()),m_bank_lo);
}
@@ -195,7 +195,7 @@ WRITE16_MEMBER(tetrisp2_state::nndmseal_sound_bank_w)
{
m_bank_hi = data & 0x03;
- memcpy(machine().region("oki")->base() + 0x20000, rom + (m_bank_lo * 0x80000) + (m_bank_hi * 0x20000), 0x20000);
+ memcpy(machine().root_device().memregion("oki")->base() + 0x20000, rom + (m_bank_lo * 0x80000) + (m_bank_hi * 0x20000), 0x20000);
// logerror("PC:%06X sound bank_hi = %02X\n",cpu_get_pc(&space.device()),m_bank_hi);
}
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index c1ed81787c8..2313439f89c 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -53,7 +53,7 @@ WRITE8_MEMBER(thedeep_state::thedeep_sound_w)
static MACHINE_RESET( thedeep )
{
thedeep_state *state = machine.driver_data<thedeep_state>();
- state->membank("bank1")->set_base(machine.region("maincpu")->base() + 0x10000 + 0 * 0x4000);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x10000 + 0 * 0x4000);
state->m_scroll[0] = 0;
state->m_scroll[1] = 0;
state->m_scroll[2] = 0;
@@ -86,7 +86,7 @@ WRITE8_MEMBER(thedeep_state::thedeep_protection_w)
int new_rombank = m_protection_command & 3;
if (m_rombank == new_rombank) break;
m_rombank = new_rombank;
- rom = machine().region("maincpu")->base();
+ rom = memregion("maincpu")->base();
membank("bank1")->set_base(rom + 0x10000 + m_rombank * 0x4000);
/* there's code which falls through from the fixed ROM to bank #1, I have to */
/* copy it there otherwise the CPU bank switching support will not catch it. */
@@ -116,7 +116,7 @@ WRITE8_MEMBER(thedeep_state::thedeep_protection_w)
// d166-d174: hl = (hl + 2*a)
// d175-d181: hl *= e (e must be non zero)
// d182-d19a: hl /= de
- m_protection_data = machine().region("mcu")->base()[0x185+m_protection_index++];
+ m_protection_data = memregion("mcu")->base()[0x185+m_protection_index++];
else
m_protection_data = 0xc9;
@@ -197,7 +197,7 @@ static void thedeep_maincpu_bankswitch(running_machine &machine,UINT8 bank_trig)
if (state->m_rombank == new_rombank)
return;
state->m_rombank = new_rombank;
- rom = machine.region("maincpu")->base();
+ rom = state->memregion("maincpu")->base();
state->membank("bank1")->set_base(rom + 0x10000 + state->m_rombank * 0x4000);
/* there's code which falls through from the fixed ROM to bank #1, I have to */
/* copy it there otherwise the CPU bank switching support will not catch it. */
diff --git a/src/mame/drivers/thepit.c b/src/mame/drivers/thepit.c
index 884fbe89639..8b29dac92b2 100644
--- a/src/mame/drivers/thepit.c
+++ b/src/mame/drivers/thepit.c
@@ -1080,7 +1080,7 @@ READ8_MEMBER(thepit_state::rtriv_question_r)
// Read the actual byte from question roms
else if((offset & 0xc00) == 0xc00)
{
- UINT8 *ROM = machine().region("user1")->base();
+ UINT8 *ROM = memregion("user1")->base();
int real_address;
real_address = (0x8000 * m_question_rom) | m_question_address | (offset & 0x3f0) | m_remap_address[offset & 0x0f];
diff --git a/src/mame/drivers/thief.c b/src/mame/drivers/thief.c
index 3c9fb6e2f0a..a2756914a6d 100644
--- a/src/mame/drivers/thief.c
+++ b/src/mame/drivers/thief.c
@@ -636,8 +636,8 @@ ROM_END
static DRIVER_INIT( thief )
{
- UINT8 *dest = machine.region( "maincpu" )->base();
- const UINT8 *source = machine.region( "cpu1" )->base();
+ UINT8 *dest = machine.root_device().memregion( "maincpu" )->base();
+ const UINT8 *source = machine.root_device().memregion( "cpu1" )->base();
/* C8 is mapped (banked) in CPU1's address space; it contains Z80 code */
memcpy( &dest[0xe010], &source[0x290], 0x20 );
diff --git a/src/mame/drivers/thoop2.c b/src/mame/drivers/thoop2.c
index cf63bc7dc7d..c258da5d174 100644
--- a/src/mame/drivers/thoop2.c
+++ b/src/mame/drivers/thoop2.c
@@ -51,7 +51,7 @@ GFXDECODE_END
WRITE16_MEMBER(thoop2_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c
index 932b0be4b09..6e256acdf48 100644
--- a/src/mame/drivers/thunderx.c
+++ b/src/mame/drivers/thunderx.c
@@ -315,7 +315,7 @@ WRITE8_MEMBER(thunderx_state::thunderx_1f98_w)
WRITE8_MEMBER(thunderx_state::scontra_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int offs;
//logerror("%04x: bank switch %02x\n",cpu_get_pc(&space.device()),data);
@@ -624,7 +624,7 @@ static MACHINE_START( scontra )
static MACHINE_START( thunderx )
{
thunderx_state *state = machine.driver_data<thunderx_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000);
state->membank("bank1")->configure_entries(12, 4, &ROM[0x08000], 0x2000);
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index ac85b8f9b73..f7454b08fb8 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -380,7 +380,7 @@ static void tmaster_draw(running_machine &machine)
tmaster_state *state = machine.driver_data<tmaster_state>();
int x,y,x0,x1,y0,y1,dx,dy,flipx,flipy,sx,sy,sw,sh, addr, mode, layer,buffer, color;
- UINT8 *gfxdata = machine.region( "blitter" )->base() + state->m_gfx_offs;
+ UINT8 *gfxdata = state->memregion( "blitter" )->base() + state->m_gfx_offs;
UINT16 pen;
@@ -642,12 +642,12 @@ WRITE16_MEMBER(tmaster_state::galgames_palette_data_w)
// Sound
READ16_MEMBER(tmaster_state::galgames_okiram_r)
{
- return machine().region("oki")->base()[offset] | 0xff00;
+ return memregion("oki")->base()[offset] | 0xff00;
}
WRITE16_MEMBER(tmaster_state::galgames_okiram_w)
{
if (ACCESSING_BITS_0_7)
- machine().region("oki")->base()[offset] = data & 0xff;
+ memregion("oki")->base()[offset] = data & 0xff;
}
// Carts (preliminary, PIC communication is not implemented)
@@ -882,7 +882,7 @@ static MACHINE_RESET( tmaster )
{
tmaster_state *state = machine.driver_data<tmaster_state>();
state->m_gfx_offs = 0;
- state->m_gfx_size = machine.region("blitter")->bytes();
+ state->m_gfx_size = state->memregion("blitter")->bytes();
state->m_duart68681 = machine.device( "duart68681" );
}
@@ -1621,7 +1621,7 @@ ROM_END
static DRIVER_INIT( tm4k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x834ce/2] = 0x4e75;
@@ -1642,7 +1642,7 @@ Protection resembles that of tm5k rather than tm4ka:
static DRIVER_INIT( tm4ka )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x83476/2] = 0x4e75;
@@ -1664,7 +1664,7 @@ Protection starts:
static DRIVER_INIT( tm4kb )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x82b7a/2] = 0x4e75;
@@ -1685,7 +1685,7 @@ Protection starts:
static DRIVER_INIT( tm5k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x96002/2] = 0x4e75;
@@ -1708,7 +1708,7 @@ Protection starts:
static DRIVER_INIT( tm5kca )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x95ffe/2] = 0x4e75;
@@ -1720,7 +1720,7 @@ static DRIVER_INIT( tm5kca )
static DRIVER_INIT( tm5ka )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x96b30/2] = 0x4e75;
@@ -1741,7 +1741,7 @@ Protection starts:
static DRIVER_INIT( tm7k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x81730/2] = 0x4e75;
@@ -1764,7 +1764,7 @@ Protection starts:
static DRIVER_INIT( tm7ka )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x81594/2] = 0x4e75;
@@ -1787,7 +1787,7 @@ Protection starts:
static DRIVER_INIT( tm7keval ) /* kit came with a security key labeled A-21657-004, which is a TM5000 key */
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x8949e/2] = 0x4e75;
@@ -1810,7 +1810,7 @@ Protection starts:
static DRIVER_INIT( tm8k )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// protection
ROM[0x78b70/2] = 0x4e75;
@@ -1834,7 +1834,7 @@ Protection starts:
static DRIVER_INIT( galgames )
{
tmaster_state *state = machine.driver_data<tmaster_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int cart;
// RAM bank at 0x000000-0x03ffff and 0x200000-0x23ffff
@@ -1856,9 +1856,9 @@ static DRIVER_INIT( galgames )
for (cart = 1; cart <= 4; cart++)
{
- UINT8 *CART = machine.region("maincpu")->base();
+ UINT8 *CART = machine.root_device().memregion("maincpu")->base();
- if (0x200000 * (cart+1) <= machine.region("maincpu")->bytes())
+ if (0x200000 * (cart+1) <= state->memregion("maincpu")->bytes())
CART += 0x200000 * cart;
state->membank(GALGAMES_BANK_200000_R)->configure_entry(GALGAMES_ROM0+cart, CART);
@@ -1868,7 +1868,7 @@ static DRIVER_INIT( galgames )
static DRIVER_INIT( galgame2 )
{
- UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
// Patch BIOS to see the game code as first cartridge (until the PIC therein is emulated)
ROM[0x118da/2] = 0x4a06;
diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c
index ce54e8ad7aa..394711ba80a 100644
--- a/src/mame/drivers/tmmjprd.c
+++ b/src/mame/drivers/tmmjprd.c
@@ -290,7 +290,7 @@ static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap,
static SCREEN_UPDATE_IND16( tmmjprd_left )
{
tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>();
- UINT8* gfxroms = screen.machine().region("gfx2")->base();
+ UINT8* gfxroms = state->memregion("gfx2")->base();
bitmap.fill(get_black_pen(screen.machine()), cliprect);
@@ -325,7 +325,7 @@ static SCREEN_UPDATE_IND16( tmmjprd_left )
static SCREEN_UPDATE_IND16( tmmjprd_right )
{
tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>();
- UINT8* gfxroms = screen.machine().region("gfx2")->base();
+ UINT8* gfxroms = state->memregion("gfx2")->base();
bitmap.fill(get_black_pen(screen.machine()), cliprect);
@@ -385,7 +385,7 @@ static TIMER_CALLBACK( tmmjprd_blit_done )
static void tmmjprd_do_blit(running_machine &machine)
{
tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
- UINT8 *blt_data = machine.region("gfx1")->base();
+ UINT8 *blt_data = state->memregion("gfx1")->base();
int blt_source = (tmmjprd_blitterregs[0]&0x000fffff)>>0;
int blt_column = (tmmjprd_blitterregs[1]&0x00ff0000)>>16;
int blt_line = (tmmjprd_blitterregs[1]&0x000000ff);
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index a0f28a2ceb3..8efaa2389b5 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -278,7 +278,7 @@ static SAMPLES_START( tmnt_decode_sample )
running_machine &machine = device.machine();
tmnt_state *state = machine.driver_data<tmnt_state>();
int i;
- UINT8 *source = machine.region("title")->base();
+ UINT8 *source = state->memregion("title")->base();
state->save_item(NAME(state->m_sampledata));
@@ -925,7 +925,7 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w)
CellSrc = m_tmnt2_1c0800[0x00] | (m_tmnt2_1c0800[0x01] << 16 );
// if (CellDest >= 0x180000 && CellDest < 0x183fe0) {
CellVar -= 0x104000;
- src = (UINT16 *)(machine().region("maincpu")->base() + CellSrc);
+ src = (UINT16 *)(machine().root_device().memregion("maincpu")->base() + CellSrc);
CellVar >>= 1;
@@ -2604,7 +2604,7 @@ static const k054539_interface k054539_config =
static MACHINE_START( prmrsocr )
{
MACHINE_START_CALL(common);
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
}
@@ -4079,8 +4079,8 @@ static DRIVER_INIT( mia )
be shuffled around because the ROMs are connected differently to the
051962 custom IC.
*/
- gfxdata = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ gfxdata = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4100,8 +4100,8 @@ static DRIVER_INIT( mia )
be shuffled around because the ROMs are connected differently to the
051937 custom IC.
*/
- gfxdata = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ gfxdata = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4172,8 +4172,8 @@ static DRIVER_INIT( tmnt )
be shuffled around because the ROMs are connected differently to the
051962 custom IC.
*/
- gfxdata = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ gfxdata = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4193,8 +4193,8 @@ static DRIVER_INIT( tmnt )
be shuffled around because the ROMs are connected differently to the
051937 custom IC.
*/
- gfxdata = machine.region("gfx2")->base();
- len = machine.region("gfx2")->bytes();
+ gfxdata = machine.root_device().memregion("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4211,7 +4211,7 @@ static DRIVER_INIT( tmnt )
temp = auto_alloc_array(machine, UINT8, len);
memcpy(temp, gfxdata, len);
- code_conv_table = &machine.region("proms")->base()[0x0000];
+ code_conv_table = &machine.root_device().memregion("proms")->base()[0x0000];
for (A = 0; A < len / 4; A++)
{
#define CA0 0
diff --git a/src/mame/drivers/tmspoker.c b/src/mame/drivers/tmspoker.c
index 29abb47019f..816442115cc 100644
--- a/src/mame/drivers/tmspoker.c
+++ b/src/mame/drivers/tmspoker.c
@@ -293,7 +293,7 @@ static INTERRUPT_GEN( tmspoker_interrupt )
static MACHINE_START( tmspoker )
{
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 2, &ROM[0], 0x1000);
}
@@ -615,8 +615,8 @@ static DRIVER_INIT( bus )
{
/* decode the TMS9980 ROMs */
offs_t offs;
- UINT8 *rom = machine.region("maincpu")->base();
- const size_t len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ const size_t len = machine.root_device().memregion("maincpu")->bytes();
for (offs = 0; offs < len; offs++)
{
diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c
index 566f42c9272..34489fd8905 100644
--- a/src/mame/drivers/tnzs.c
+++ b/src/mame/drivers/tnzs.c
@@ -639,7 +639,7 @@ static SAMPLES_START( kageki_init_samples )
int start, size;
int i, n;
- src = machine.region("samples")->base() + 0x0090;
+ src = state->memregion("samples")->base() + 0x0090;
for (i = 0; i < MAX_SAMPLES; i++)
{
start = (src[(i * 2) + 1] * 256) + src[(i * 2)];
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index c93eccc3ffb..05d1a0ecfdb 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -431,7 +431,7 @@ static DRIVER_INIT( fixeight )
static DRIVER_INIT( fixeightbl )
{
- UINT8 *ROM = machine.region("oki")->base();
+ UINT8 *ROM = machine.root_device().memregion("oki")->base();
machine.root_device().membank("bank1")->configure_entries(0, 5, &ROM[0x30000], 0x10000);
}
@@ -447,7 +447,7 @@ static DRIVER_INIT( vfive )
static DRIVER_INIT( pipibibsbl )
{
- UINT16 *ROM = (UINT16 *)(machine.region("maincpu")->base());
+ UINT16 *ROM = (UINT16 *)(machine.root_device().memregion("maincpu")->base());
for (int i = 0; i < (0x040000/2); i += 4)
{
@@ -461,7 +461,7 @@ static DRIVER_INIT( pipibibsbl )
static DRIVER_INIT( bgaregga )
{
- UINT8 *Z80 = machine.region("audiocpu")->base();
+ UINT8 *Z80 = machine.root_device().memregion("audiocpu")->base();
// seems to only use banks 0x0a to 0x0f
machine.root_device().membank("bank1")->configure_entries(8, 8, Z80, 0x4000);
@@ -471,7 +471,7 @@ static DRIVER_INIT( bgaregga )
static DRIVER_INIT( batrider )
{
toaplan2_state *state = machine.driver_data<toaplan2_state>();
- UINT8 *Z80 = machine.region("audiocpu")->base();
+ UINT8 *Z80 = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 16, Z80, 0x4000);
state->m_sndirq_line = 4;
@@ -909,7 +909,7 @@ WRITE16_MEMBER(toaplan2_state::batrider_z80_busreq_w)
READ16_MEMBER(toaplan2_state::batrider_z80rom_r)
{
- UINT8 *Z80 = machine().region("audiocpu")->base();
+ UINT8 *Z80 = memregion("audiocpu")->base();
return Z80[offset];
}
diff --git a/src/mame/drivers/toki.c b/src/mame/drivers/toki.c
index 80701106e1e..7c6f51d9e51 100644
--- a/src/mame/drivers/toki.c
+++ b/src/mame/drivers/toki.c
@@ -71,7 +71,7 @@ static void toki_adpcm_int (device_t *device)
static WRITE8_DEVICE_HANDLER( toki_adpcm_control_w )
{
int bankaddress;
- UINT8 *RAM = device->machine().region("audiocpu")->base();
+ UINT8 *RAM = device->machine().root_device().memregion("audiocpu")->base();
/* the code writes either 2 or 3 in the bottom two bits */
@@ -738,7 +738,7 @@ ROM_END
static DRIVER_INIT( toki )
{
- UINT8 *ROM = machine.region("oki")->base();
+ UINT8 *ROM = machine.root_device().memregion("oki")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x20000);
int i;
@@ -761,14 +761,14 @@ static DRIVER_INIT( tokib )
UINT8 *rom;
/* invert the sprite data in the ROMs */
- len = machine.region("gfx2")->bytes();
- rom = machine.region("gfx2")->base();
+ len = machine.root_device().memregion("gfx2")->bytes();
+ rom = machine.root_device().memregion("gfx2")->base();
for (i = 0; i < len; i++)
rom[i] ^= 0xff;
/* merge background tile graphics together */
- len = machine.region("gfx3")->bytes();
- rom = machine.region("gfx3")->base();
+ len = machine.root_device().memregion("gfx3")->bytes();
+ rom = machine.root_device().memregion("gfx3")->base();
for (offs = 0; offs < len; offs += 0x20000)
{
UINT8 *base = &rom[offs];
@@ -781,8 +781,8 @@ static DRIVER_INIT( tokib )
memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800);
}
}
- len = machine.region("gfx4")->bytes();
- rom = machine.region("gfx4")->base();
+ len = machine.root_device().memregion("gfx4")->bytes();
+ rom = machine.root_device().memregion("gfx4")->base();
for (offs = 0; offs < len; offs += 0x20000)
{
UINT8 *base = &rom[offs];
@@ -804,7 +804,7 @@ static DRIVER_INIT(jujub)
/* Program ROMs are bitswapped */
{
int i;
- UINT16 *prgrom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *prgrom = (UINT16*)machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x60000/2; i++)
{
@@ -819,7 +819,7 @@ static DRIVER_INIT(jujub)
{
address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x20000);
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
int i;
memcpy(decrypt,rom,0x20000);
@@ -834,7 +834,7 @@ static DRIVER_INIT(jujub)
}
{
- UINT8 *ROM = machine.region("oki")->base();
+ UINT8 *ROM = machine.root_device().memregion("oki")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x20000);
int i;
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index fb31e9236d6..6610183c547 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -412,7 +412,7 @@ static void topspeed_msm5205_vck( device_t *device )
}
else
{
- state->m_adpcm_data = device->machine().region("adpcm")->base()[state->m_adpcm_pos];
+ state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0x1ffff;
msm5205_data_w(device, state->m_adpcm_data >> 4);
}
@@ -646,7 +646,7 @@ static MACHINE_START( topspeed )
{
topspeed_state *state = machine.driver_data<topspeed_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_subcpu = machine.device("sub");
diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c
index 8015ec9def8..486b3df30b8 100644
--- a/src/mame/drivers/trackfld.c
+++ b/src/mame/drivers/trackfld.c
@@ -1424,7 +1424,7 @@ static DRIVER_INIT( trackfld )
static DRIVER_INIT( atlantol )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt;
int A;
@@ -1454,7 +1454,7 @@ static DRIVER_INIT( atlantol )
static DRIVER_INIT( mastkin )
{
- UINT8 *prom = machine.region("proms")->base();
+ UINT8 *prom = machine.root_device().memregion("proms")->base();
int i;
/* build a fake palette so the screen won't be all black */
@@ -1475,14 +1475,14 @@ static DRIVER_INIT( mastkin )
static DRIVER_INIT( wizzquiz )
{
- UINT8 *ROM = machine.region("maincpu")->base() + 0xe000;
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base() + 0xe000;
int i;
/* decrypt program rom */
for (i = 0; i < 0x2000; i++)
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
- ROM = machine.region("user1")->base();
+ ROM = machine.root_device().memregion("user1")->base();
/* decrypt questions roms */
for (i = 0; i < 0x40000; i++)
diff --git a/src/mame/drivers/travrusa.c b/src/mame/drivers/travrusa.c
index 4fc25c9b448..3027a27015b 100644
--- a/src/mame/drivers/travrusa.c
+++ b/src/mame/drivers/travrusa.c
@@ -453,7 +453,7 @@ ROM_END
static DRIVER_INIT( motorace )
{
int A, j;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(buffer, rom, 0x2000);
@@ -471,7 +471,7 @@ static DRIVER_INIT( motorace )
static DRIVER_INIT( shtridra )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* D3/D4 and D5/D6 swapped */
for (A = 0; A < 0x2000; A++)
diff --git a/src/mame/drivers/trucocl.c b/src/mame/drivers/trucocl.c
index 06320d9542a..b4c0147ea5d 100644
--- a/src/mame/drivers/trucocl.c
+++ b/src/mame/drivers/trucocl.c
@@ -52,7 +52,7 @@ static TIMER_CALLBACK( dac_irq )
static WRITE8_DEVICE_HANDLER( audio_dac_w )
{
trucocl_state *state = device->machine().driver_data<trucocl_state>();
- UINT8 *rom = device->machine().region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int dac_address = ( data & 0xf0 ) << 8;
int sel = ( ( (~data) >> 1 ) & 2 ) | ( data & 1 );
diff --git a/src/mame/drivers/trvmadns.c b/src/mame/drivers/trvmadns.c
index d6f2b3bf948..fbcb34c87f2 100644
--- a/src/mame/drivers/trvmadns.c
+++ b/src/mame/drivers/trvmadns.c
@@ -98,7 +98,7 @@ WRITE8_MEMBER(trvmadns_state::trvmadns_banking_w)
}
else if((data & 0xf0) == 0x80 || (data & 0xf0) == 0x90)
{
- rom = machine().region("user2")->base();
+ rom = memregion("user2")->base();
switch(data & 0xf)
{
@@ -126,7 +126,7 @@ WRITE8_MEMBER(trvmadns_state::trvmadns_banking_w)
//logerror("port80 = %02X\n",data);
}
- rom = machine().region("user1")->base();
+ rom = memregion("user1")->base();
/*
7
diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c
index 75beeba297d..58f50b47c96 100644
--- a/src/mame/drivers/trvquest.c
+++ b/src/mame/drivers/trvquest.c
@@ -45,7 +45,7 @@ static READ8_HANDLER( trvquest_question_r )
{
gameplan_state *state = space->machine().driver_data<gameplan_state>();
- return space->machine().region("questions")->base()[*state->m_trvquest_question * 0x2000 + offset];
+ return state->memregion("questions")->base()[*state->m_trvquest_question * 0x2000 + offset];
}
static WRITE8_DEVICE_HANDLER( trvquest_coin_w )
diff --git a/src/mame/drivers/tryout.c b/src/mame/drivers/tryout.c
index 184ae234ddf..30a870e3d01 100644
--- a/src/mame/drivers/tryout.c
+++ b/src/mame/drivers/tryout.c
@@ -45,7 +45,7 @@ WRITE8_MEMBER(tryout_state::tryout_sound_irq_ack_w)
WRITE8_MEMBER(tryout_state::tryout_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x01) * 0x2000;
diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c
index c4427f369c8..a8af40ac405 100644
--- a/src/mame/drivers/ttchamp.c
+++ b/src/mame/drivers/ttchamp.c
@@ -109,7 +109,7 @@ WRITE16_MEMBER(ttchamp_state::paloff_w)
WRITE16_MEMBER(ttchamp_state::pcup_prgbank_w)
{
int bank;
- UINT8 *ROM1 = machine().region("user1")->base();
+ UINT8 *ROM1 = memregion("user1")->base();
if (ACCESSING_BITS_0_7)
{
@@ -337,7 +337,7 @@ ROM_END
static DRIVER_INIT (ttchamp)
{
- UINT8 *ROM1 = machine.region("user1")->base();
+ UINT8 *ROM1 = machine.root_device().memregion("user1")->base();
machine.root_device().membank("bank1")->set_base(&ROM1[0x120000]);
machine.root_device().membank("bank2")->set_base(&ROM1[0x180000]);
}
diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c
index b1b245b5e77..63846dd7289 100644
--- a/src/mame/drivers/tugboat.c
+++ b/src/mame/drivers/tugboat.c
@@ -51,7 +51,7 @@ public:
just four 1k resistors. */
static PALETTE_INIT( tugboat )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 4ed8704e407..7ef620a4e02 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -490,7 +490,7 @@ static const int tumbleb_sound_lookup[256] = {
/* we use channels 1,2,3 for sound effects, and channel 4 for music */
static void tumbleb2_set_music_bank( running_machine &machine, int bank )
{
- UINT8 *oki = machine.region("oki")->base();
+ UINT8 *oki = machine.root_device().memregion("oki")->base();
memcpy(&oki[0x38000], &oki[0x80000 + 0x38000 + 0x8000 * bank], 0x8000);
}
@@ -783,7 +783,7 @@ WRITE16_MEMBER(tumbleb_state::semicom_soundcmd_w)
WRITE8_MEMBER(tumbleb_state::oki_sound_bank_w)
{
- UINT8 *oki = machine().region("oki")->base();
+ UINT8 *oki = memregion("oki")->base();
memcpy(&oki[0x30000], &oki[(data * 0x10000) + 0x40000], 0x10000);
}
@@ -808,7 +808,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(tumbleb_state::jumppop_z80_bank_w)
{
- membank("bank1")->set_base(machine().region("audiocpu")->base() + 0x10000 + (0x4000 * data));
+ membank("bank1")->set_base(machine().root_device().memregion("audiocpu")->base() + 0x10000 + (0x4000 * data));
}
static ADDRESS_MAP_START( jumppop_sound_map, AS_PROGRAM, 8, tumbleb_state )
@@ -856,8 +856,8 @@ ADDRESS_MAP_END
WRITE8_MEMBER(tumbleb_state::jumpkids_oki_bank_w)
{
- UINT8* sound1 = machine().region("oki")->base();
- UINT8* sound2 = machine().region("oki2")->base();
+ UINT8* sound1 = memregion("oki")->base();
+ UINT8* sound2 = memregion("oki2")->base();
int bank = data & 0x03;
memcpy(sound1 + 0x20000, sound2 + bank * 0x20000, 0x20000);
@@ -2227,8 +2227,8 @@ static MACHINE_RESET (htchctch)
tumbleb_state *state = machine.driver_data<tumbleb_state>();
/* copy protection data every reset */
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
- int i, len = machine.region("user1")->bytes();
+ UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
+ int i, len = state->memregion("user1")->bytes();
for (i = 0; i < len / 2; i++)
state->m_mainram[0x000/2 + i] = PROTDATA[i];
@@ -3362,7 +3362,7 @@ ROM_END
void tumblepb_patch_code(running_machine &machine, UINT16 offset)
{
/* A hack which enables all Dip Switches effects */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[(offset + 0)/2] = 0x0240;
RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0
}
@@ -3371,8 +3371,8 @@ void tumblepb_patch_code(running_machine &machine, UINT16 offset)
static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
@@ -3429,7 +3429,7 @@ static DRIVER_INIT( fncywld )
#if FNCYWLD_HACK
/* This is a hack to allow you to use the extra features
of the 2 first "Unused" Dip Switch (see notes above). */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0x0005fa/2] = 0x4e71;
RAM[0x00060a/2] = 0x4e71;
#endif
@@ -3456,9 +3456,9 @@ static DRIVER_INIT( htchctch )
{
tumbleb_state *state = machine.driver_data<tumbleb_state>();
-// UINT16 *HCROM = (UINT16*)machine.region("maincpu")->base();
- UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
- int i, len = machine.region("user1")->bytes();
+// UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
+ UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
+ int i, len = state->memregion("user1")->bytes();
/* simulate RAM initialization done by the protection MCU */
/* verified on real hardware */
// static const UINT16 htchctch_mcu68k[] =
@@ -3710,7 +3710,7 @@ static DRIVER_INIT( htchctch )
static void suprtrio_decrypt_code(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
UINT16 *buf = auto_alloc_array(machine, UINT16, 0x80000/2);
int i;
@@ -3728,7 +3728,7 @@ static void suprtrio_decrypt_code(running_machine &machine)
static void suprtrio_decrypt_gfx(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine.region("gfx1")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("gfx1")->base();
UINT16 *buf = auto_alloc_array(machine, UINT16, 0x100000/2);
int i;
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index ec9ed274f33..dcd50d91d5f 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -389,7 +389,7 @@ ROM_END
void tumblep_patch_code(UINT16 offset)
{
/* A hack which enables all Dip Switches effects */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[(offset + 0)/2] = 0x0240;
RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0
}
diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c
index 7a745942b04..24954ed8503 100644
--- a/src/mame/drivers/turbo.c
+++ b/src/mame/drivers/turbo.c
@@ -1627,7 +1627,7 @@ static void turbo_rom_decode(running_machine &machine)
2,1,2,1 /* 0x5000-0x5fff */
};
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int offs, i, j;
UINT8 src;
diff --git a/src/mame/drivers/tutankhm.c b/src/mame/drivers/tutankhm.c
index 792b4f95166..d923d09a668 100644
--- a/src/mame/drivers/tutankhm.c
+++ b/src/mame/drivers/tutankhm.c
@@ -198,7 +198,7 @@ static MACHINE_START( tutankhm )
{
tutankhm_state *state = machine.driver_data<tutankhm_state>();
- state->membank("bank1")->configure_entries(0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("maincpu")->base() + 0x10000, 0x1000);
state->m_maincpu = machine.device<cpu_device>("maincpu");
diff --git a/src/mame/drivers/twin16.c b/src/mame/drivers/twin16.c
index a6a1cce64f2..0ed1e5f81a0 100644
--- a/src/mame/drivers/twin16.c
+++ b/src/mame/drivers/twin16.c
@@ -88,7 +88,7 @@ WRITE16_MEMBER(twin16_state::videoram16_w)
READ16_MEMBER(twin16_state::extra_rom_r)
{
- return ((UINT16 *)machine().region("gfx3")->base())[offset];
+ return ((UINT16 *)machine().root_device().memregion("gfx3")->base())[offset];
}
READ16_MEMBER(twin16_state::twin16_gfx_rom1_r)
@@ -1305,7 +1305,7 @@ static void gfx_untangle( running_machine &machine )
int i;
UINT16 *temp = auto_alloc_array(machine, UINT16, 0x200000/2);
- state->m_gfx_rom = (UINT16 *)machine.region("gfx2")->base();
+ state->m_gfx_rom = (UINT16 *)state->memregion("gfx2")->base();
memcpy( temp, state->m_gfx_rom, 0x200000 );
for( i=0; i<0x080000; i++ )
diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c
index 5449e2b50e9..9de55c7018c 100644
--- a/src/mame/drivers/twinkle.c
+++ b/src/mame/drivers/twinkle.c
@@ -712,14 +712,14 @@ WRITE16_MEMBER(twinkle_state::twinkle_spu_ctrl_w)
READ16_MEMBER(twinkle_state::twinkle_waveram_r)
{
- UINT16 *waveram = (UINT16 *)machine().region("rfsnd")->base();
+ UINT16 *waveram = (UINT16 *)machine().root_device().memregion("rfsnd")->base();
return waveram[offset];
}
WRITE16_MEMBER(twinkle_state::twinkle_waveram_w)
{
- UINT16 *waveram = (UINT16 *)machine().region("rfsnd")->base();
+ UINT16 *waveram = (UINT16 *)machine().root_device().memregion("rfsnd")->base();
COMBINE_DATA(&waveram[offset]);
}
diff --git a/src/mame/drivers/umipoker.c b/src/mame/drivers/umipoker.c
index b37abea7e5a..fa61bd5cea0 100644
--- a/src/mame/drivers/umipoker.c
+++ b/src/mame/drivers/umipoker.c
@@ -149,7 +149,7 @@ static SCREEN_UPDATE_IND16( umipoker )
READ8_MEMBER(umipoker_state::z80_rom_readback_r)
{
- UINT8 *ROM = machine().region("audiocpu")->base();
+ UINT8 *ROM = memregion("audiocpu")->base();
return ROM[offset];
}
diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c
index 358fad4d924..019e1cc11be 100644
--- a/src/mame/drivers/undrfire.c
+++ b/src/mame/drivers/undrfire.c
@@ -970,8 +970,8 @@ ROM_END
static DRIVER_INIT( undrfire )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx3")->base();
- int size=machine.region("gfx3")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int size=machine.root_device().memregion("gfx3")->bytes();
int data;
/* make piv tile GFX format suitable for gfxdecode */
@@ -999,8 +999,8 @@ static DRIVER_INIT( undrfire )
static DRIVER_INIT( cbombers )
{
UINT32 offset,i;
- UINT8 *gfx = machine.region("gfx3")->base();
- int size=machine.region("gfx3")->bytes();
+ UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int size=machine.root_device().memregion("gfx3")->bytes();
int data;
diff --git a/src/mame/drivers/unico.c b/src/mame/drivers/unico.c
index 98ee864c00c..5d658951733 100644
--- a/src/mame/drivers/unico.c
+++ b/src/mame/drivers/unico.c
@@ -91,7 +91,7 @@ WRITE16_MEMBER(unico_state::zeropnt_sound_bank_w)
contains garbage. Indeed, only banks 0&1 are used */
int bank = (data >> 8 ) & 1;
- UINT8 *dst = machine().region("oki")->base();
+ UINT8 *dst = memregion("oki")->base();
UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
@@ -180,7 +180,7 @@ WRITE32_MEMBER(unico_state::zeropnt2_sound_bank_w)
if (ACCESSING_BITS_24_31)
{
int bank = ((data >> 24) & 3) % 4;
- UINT8 *dst = machine().region("oki1")->base();
+ UINT8 *dst = memregion("oki1")->base();
UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
}
diff --git a/src/mame/drivers/upscope.c b/src/mame/drivers/upscope.c
index 7018c6c5731..ff20fac87fc 100644
--- a/src/mame/drivers/upscope.c
+++ b/src/mame/drivers/upscope.c
@@ -405,7 +405,7 @@ static DRIVER_INIT( upscope )
/* set up memory */
state->membank("bank1")->configure_entry(0, state->m_chip_ram);
- state->membank("bank1")->configure_entry(1, machine.region("user1")->base());
+ state->membank("bank1")->configure_entry(1, machine.root_device().memregion("user1")->base());
}
diff --git a/src/mame/drivers/usgames.c b/src/mame/drivers/usgames.c
index 2c20b4e848a..eb9a3e3a588 100644
--- a/src/mame/drivers/usgames.c
+++ b/src/mame/drivers/usgames.c
@@ -33,7 +33,7 @@ Sound: AY-3-8912
WRITE8_MEMBER(usgames_state::usgames_rombank_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
// logerror ("BANK WRITE? -%02x-\n",data);
//popmessage("%02x",data);
diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c
index 6af2312ec41..180bd0cca21 100644
--- a/src/mame/drivers/vaportra.c
+++ b/src/mame/drivers/vaportra.c
@@ -855,7 +855,7 @@ C3D54*
static DRIVER_INIT( vaportra )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
int i;
for (i = 0x00000; i < 0x80000; i++)
diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c
index bc4b0a56622..bc2fdda5987 100644
--- a/src/mame/drivers/vball.c
+++ b/src/mame/drivers/vball.c
@@ -157,7 +157,7 @@ WRITE8_MEMBER(vball_state::vball_irq_ack_w)
*/
WRITE8_MEMBER(vball_state::vb_bankswitch_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
membank("bank1")->set_base(&RAM[0x10000 + (0x4000 * (data & 1))]);
if (m_gfxset != ((data & 0x20) ^ 0x20))
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 7ba1080ef3a..17ff01f2895 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -439,7 +439,7 @@ DIRECT_UPDATE_MEMBER(vcombat_state::vcombat_vid_1_direct_handler)
static DRIVER_INIT( vcombat )
{
vcombat_state *state = machine.driver_data<vcombat_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
/* The two i860s execute out of RAM */
address_space *space = machine.device<i860_device>("vid_0")->space(AS_PROGRAM);
diff --git a/src/mame/drivers/vega.c b/src/mame/drivers/vega.c
index 991a3713a6f..7848c6ddf2b 100644
--- a/src/mame/drivers/vega.c
+++ b/src/mame/drivers/vega.c
@@ -106,7 +106,7 @@ UINT8 ascii_to_bin( UINT8 ascii )
DRIVER_INIT(vegaa)
{
UINT8* buf = (UINT8*)malloc(0x10000);
- UINT8* rom = machine.region("maincpu")->base();
+ UINT8* rom = machine.root_device().memregion("maincpu")->base();
int i;
int count = 0;
// last 0xc bytes of file are just some settings, ignore
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index afa8376f0e0..d8ac75f24f2 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -459,7 +459,7 @@ static const k053252_interface esckids_k053252_intf =
static MACHINE_START( vendetta )
{
vendetta_state *state = machine.driver_data<vendetta_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 28, &ROM[0x10000], 0x2000);
state->membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c
index 42c1b6ed4dc..de3f2a5d526 100644
--- a/src/mame/drivers/videopkr.c
+++ b/src/mame/drivers/videopkr.c
@@ -400,7 +400,7 @@ static void count_7dig(unsigned long data, UINT8 index)
static PALETTE_INIT( videopkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int j;
for (j = 0; j < machine.total_colors(); j++)
@@ -427,7 +427,7 @@ static PALETTE_INIT( videopkr )
static PALETTE_INIT( babypkr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int j;
for (j = 0; j < machine.total_colors(); j++)
@@ -458,7 +458,7 @@ static PALETTE_INIT( babypkr )
static PALETTE_INIT( fortune1 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int j;
for (j = 0; j < machine.total_colors(); j++)
diff --git a/src/mame/drivers/vigilant.c b/src/mame/drivers/vigilant.c
index a930c51b6f3..e74a87ee962 100644
--- a/src/mame/drivers/vigilant.c
+++ b/src/mame/drivers/vigilant.c
@@ -26,7 +26,7 @@ Buccaneers has a 5.6888 Mhz and a 18.432 Mhz OSC
WRITE8_MEMBER(vigilant_state::vigilant_bank_select_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + (data & 0x07) * 0x4000;
membank("bank1")->set_base(&RAM[bankaddress]);
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index 4c0f15495e0..b8bba5fb21d 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -1929,7 +1929,7 @@ static MACHINE_START(viper)
/* configure fast RAM regions for DRC */
ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x00ffffff, FALSE, workram);
- ds2430_rom = (UINT8*)machine.region("ds2430")->base();
+ ds2430_rom = (UINT8*)machine.root_device().memregion("ds2430")->base();
}
static MACHINE_RESET(viper)
diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c
index 39f3bf0091a..370fab699b1 100644
--- a/src/mame/drivers/vmetal.c
+++ b/src/mame/drivers/vmetal.c
@@ -119,7 +119,7 @@ READ16_MEMBER(vmetal_state::varia_crom_read)
/* game reads the cgrom, result is 7772, verified to be correct on the real board */
- UINT8 *cgrom = machine().region("gfx1")->base();
+ UINT8 *cgrom = memregion("gfx1")->base();
UINT16 retdat;
offset = offset << 1;
@@ -423,8 +423,8 @@ static TILE_GET_INFO( get_vmetal_mid2tilemap_tile_info )
static void expand_gfx1(running_machine &machine)
{
metro_state *state = machine.driver_data<metro_state>();
- UINT8 *base_gfx = machine.region("gfx1")->base();
- UINT32 length = 2 * machine.region("gfx1")->bytes();
+ UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT32 length = 2 * state->memregion("gfx1")->bytes();
state->m_expanded_gfx1 = auto_alloc_array(machine, UINT8, length);
for (int i = 0; i < length; i += 2)
{
diff --git a/src/mame/drivers/voyager.c b/src/mame/drivers/voyager.c
index 7c24fef2acf..d862b7b8b51 100644
--- a/src/mame/drivers/voyager.c
+++ b/src/mame/drivers/voyager.c
@@ -247,8 +247,8 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
}
#endif
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base() + 0x10000);
- state->membank("bank1")->set_base(busdevice->machine().region("bios")->base());
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base() + 0x10000);
+ state->membank("bank1")->set_base(busdevice->machine().root_device().memregion("bios")->base());
}
break;
}
@@ -720,8 +720,8 @@ static const struct pit8253_config voyager_pit8254_config =
static MACHINE_RESET(voyager)
{
- //machine.root_device().membank("bank1")->set_base(machine.region("bios")->base() + 0x10000);
- machine.root_device().membank("bank1")->set_base(machine.region("bios")->base());
+ //machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("bios")->base());
}
static void set_gate_a20(running_machine &machine, int a20)
diff --git a/src/mame/drivers/wallc.c b/src/mame/drivers/wallc.c
index 2256bf86e3b..3b0398f9b74 100644
--- a/src/mame/drivers/wallc.c
+++ b/src/mame/drivers/wallc.c
@@ -94,7 +94,7 @@ public:
static PALETTE_INIT( wallc )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_rg[2] = { 330, 220 };
@@ -259,7 +259,7 @@ static DRIVER_INIT( wallc )
UINT8 c;
UINT32 i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i=0; i<0x2000*2; i++)
{
@@ -274,7 +274,7 @@ static DRIVER_INIT( wallca )
UINT8 c;
UINT32 i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i=0; i<0x4000; i++)
{
diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c
index 24f06a1a7b8..7c14293851c 100644
--- a/src/mame/drivers/wardner.c
+++ b/src/mame/drivers/wardner.c
@@ -152,7 +152,7 @@ WRITE8_MEMBER(wardner_state::wardner_ramrom_bank_sw)
int bankaddress = 0;
address_space *mainspace;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM);
m_wardner_membank = data;
diff --git a/src/mame/drivers/warpsped.c b/src/mame/drivers/warpsped.c
index 1c9a9efb8d6..ad20b3ce492 100644
--- a/src/mame/drivers/warpsped.c
+++ b/src/mame/drivers/warpsped.c
@@ -121,7 +121,7 @@ static TILE_GET_INFO( get_warpspeed_starfield_tile_info )
UINT8 code = 0x3f;
if ( tile_index & 1 )
{
- code = machine.region("starfield")->base()[tile_index >> 1] & 0x3f;
+ code = machine.root_device().memregion("starfield")->base()[tile_index >> 1] & 0x3f;
}
SET_TILE_INFO(1, code, 0, 0);
}
diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c
index ae08f19d96f..8184e66b5d3 100644
--- a/src/mame/drivers/warriorb.c
+++ b/src/mame/drivers/warriorb.c
@@ -542,7 +542,7 @@ static MACHINE_START( warriorb )
{
warriorb_state *state = machine.driver_data<warriorb_state>();
- state->membank("bank10")->configure_entries(0, 8, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 8, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/wc90.c b/src/mame/drivers/wc90.c
index 042331e34e6..d761cf73327 100644
--- a/src/mame/drivers/wc90.c
+++ b/src/mame/drivers/wc90.c
@@ -83,7 +83,7 @@ voice.ic82 CRC32 abc61f3d SHA1 c6f123d16a26c4d77c635617dd97bb4b906c463a
WRITE8_MEMBER(wc90_state::wc90_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + ( ( data & 0xf8 ) << 8 );
@@ -93,7 +93,7 @@ WRITE8_MEMBER(wc90_state::wc90_bankswitch_w)
WRITE8_MEMBER(wc90_state::wc90_bankswitch1_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("sub")->base();
+ UINT8 *RAM = memregion("sub")->base();
bankaddress = 0x10000 + ( ( data & 0xf8 ) << 8 );
diff --git a/src/mame/drivers/wc90b.c b/src/mame/drivers/wc90b.c
index 59548ee8077..7c4c1469d06 100644
--- a/src/mame/drivers/wc90b.c
+++ b/src/mame/drivers/wc90b.c
@@ -99,7 +99,7 @@ Noted added by ClawGrip 28-Mar-2008:
WRITE8_MEMBER(wc90b_state::wc90b_bankswitch_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
membank("bank1")->set_base(&ROM[bankaddress]);
@@ -108,7 +108,7 @@ WRITE8_MEMBER(wc90b_state::wc90b_bankswitch_w)
WRITE8_MEMBER(wc90b_state::wc90b_bankswitch1_w)
{
int bankaddress;
- UINT8 *ROM = machine().region("sub")->base();
+ UINT8 *ROM = memregion("sub")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
membank("bank2")->set_base(&ROM[bankaddress]);
@@ -123,7 +123,7 @@ WRITE8_MEMBER(wc90b_state::wc90b_sound_command_w)
static WRITE8_DEVICE_HANDLER( adpcm_control_w )
{
int bankaddress;
- UINT8 *ROM = device->machine().region("audiocpu")->base();
+ UINT8 *ROM = device->machine().root_device().memregion("audiocpu")->base();
/* the code writes either 2 or 3 in the bottom two bits */
bankaddress = 0x10000 + (data & 0x01) * 0x4000;
diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c
index 95914623609..db613bfbcad 100644
--- a/src/mame/drivers/wecleman.c
+++ b/src/mame/drivers/wecleman.c
@@ -1218,9 +1218,9 @@ static void wecleman_unpack_sprites(running_machine &machine)
{
const char *region = "gfx1"; // sprites
- const UINT32 len = machine.region(region)->bytes();
- UINT8 *src = machine.region(region)->base() + len / 2 - 1;
- UINT8 *dst = machine.region(region)->base() + len - 1;
+ const UINT32 len = machine.root_device().memregion(region)->bytes();
+ UINT8 *src = machine.root_device().memregion(region)->base() + len / 2 - 1;
+ UINT8 *dst = machine.root_device().memregion(region)->base() + len - 1;
while(dst > src)
{
@@ -1251,7 +1251,7 @@ static DRIVER_INIT( wecleman )
wecleman_state *state = machine.driver_data<wecleman_state>();
int i, len;
UINT8 *RAM;
-// UINT16 *RAM1 = (UINT16 *) machine.region("maincpu")->base(); /* Main CPU patches */
+// UINT16 *RAM1 = (UINT16 *) machine.root_device().memregion("maincpu")->base(); /* Main CPU patches */
// RAM1[0x08c2/2] = 0x601e; // faster self test
/* Decode GFX Roms - Compensate for the address lines scrambling */
@@ -1261,8 +1261,8 @@ static DRIVER_INIT( wecleman )
I hope you'll appreciate this effort! */
/* let's swap even and odd *pixels* of the sprites */
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = state->memregion("gfx1")->bytes();
for (i = 0; i < len; i ++)
{
/* TODO: could be wrong, colors have to be fixed. */
@@ -1271,18 +1271,18 @@ static DRIVER_INIT( wecleman )
RAM[i] = BITSWAP8(RAM[i],7,0,1,2,3,4,5,6);
}
- bitswap(machine, machine.region("gfx1")->base(), machine.region("gfx1")->bytes(),
+ bitswap(machine, machine.root_device().memregion("gfx1")->base(), machine.root_device().memregion("gfx1")->bytes(),
0,1,20,19,18,17,14,9,16,6,4,7,8,15,10,11,13,5,12,3,2);
/* Now we can unpack each nibble of the sprites into a pixel (one byte) */
wecleman_unpack_sprites(machine);
/* Bg & Fg & Txt */
- bitswap(machine, machine.region("gfx2")->base(), machine.region("gfx2")->bytes(),
+ bitswap(machine, machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes(),
20,19,18,17,16,15,12,7,14,4,2,5,6,13,8,9,11,3,10,1,0);
/* Road */
- bitswap(machine, machine.region("gfx3")->base(), machine.region("gfx3")->bytes(),
+ bitswap(machine, machine.root_device().memregion("gfx3")->base(), machine.root_device().memregion("gfx3")->bytes(),
20,19,18,17,16,15,14,7,12,4,2,5,6,13,8,9,11,3,10,1,0);
state->m_spr_color_offs = 0x40;
@@ -1347,7 +1347,7 @@ static void hotchase_sprite_decode( running_machine &machine, int num16_banks, i
UINT8 *base, *temp;
int i;
- base = machine.region("gfx1")->base(); // sprites
+ base = machine.root_device().memregion("gfx1")->base(); // sprites
temp = auto_alloc_array(machine, UINT8, bank_size );
for( i = num16_banks; i >0; i-- ){
@@ -1393,7 +1393,7 @@ static void hotchase_sprite_decode( running_machine &machine, int num16_banks, i
static DRIVER_INIT( hotchase )
{
wecleman_state *state = machine.driver_data<wecleman_state>();
-// UINT16 *RAM1 = (UINT16) machine.region("maincpu")->base(); /* Main CPU patches */
+// UINT16 *RAM1 = (UINT16) machine.root_device().memregion("maincpu")->base(); /* Main CPU patches */
// RAM[0x1140/2] = 0x0015; RAM[0x195c/2] = 0x601A; // faster self test
UINT8 *RAM;
@@ -1401,13 +1401,13 @@ static DRIVER_INIT( hotchase )
/* Decode GFX Roms */
/* Let's swap even and odd bytes of the sprites gfx roms */
- RAM = machine.region("gfx1")->base();
+ RAM = machine.root_device().memregion("gfx1")->base();
/* Now we can unpack each nibble of the sprites into a pixel (one byte) */
hotchase_sprite_decode(machine,3,0x80000*2); // num banks, bank len
/* Let's copy the second half of the fg layer gfx (charset) over the first */
- RAM = machine.region("gfx3")->base();
+ RAM = state->memregion("gfx3")->base();
memcpy(&RAM[0], &RAM[0x10000/2], 0x10000/2);
state->m_spr_color_offs = 0;
diff --git a/src/mame/drivers/welltris.c b/src/mame/drivers/welltris.c
index 52838c084c1..cf5d148af86 100644
--- a/src/mame/drivers/welltris.c
+++ b/src/mame/drivers/welltris.c
@@ -322,7 +322,7 @@ TODO:
WRITE8_MEMBER(welltris_state::welltris_sh_bankswitch_w)
{
- UINT8 *rom = machine().region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
membank("bank1")->set_base(rom + (data & 0x03) * 0x8000);
}
@@ -689,7 +689,7 @@ static DRIVER_INIT( welltris )
{
#if WELLTRIS_4P_HACK
/* A Hack which shows 4 player mode in code which is disabled */
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0xB91C/2] = 0x4e71;
RAM[0xB91E/2] = 0x4e71;
#endif
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 7420d32162b..594ecbe001c 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -946,7 +946,7 @@ static MACHINE_START( wgp )
{
wgp_state *state = machine.driver_data<wgp_state>();
- state->membank("bank10")->configure_entries(0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+ state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
@@ -1262,7 +1262,7 @@ static DRIVER_INIT( wgp )
#if 0
/* Patch for coding error that causes corrupt data in
sprite tilemapping area from $4083c0-847f */
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
ROM[0x25dc / 2] = 0x0602; // faulty value is 0x0206
#endif
}
@@ -1270,7 +1270,7 @@ static DRIVER_INIT( wgp )
static DRIVER_INIT( wgp2 )
{
/* Code patches to prevent failure in memory checks */
- UINT16 *ROM = (UINT16 *)machine.region("sub")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("sub")->base();
ROM[0x8008 / 2] = 0x0;
ROM[0x8010 / 2] = 0x0;
}
diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c
index 25375f4fa9a..f9cf0bec6a7 100644
--- a/src/mame/drivers/wheelfir.c
+++ b/src/mame/drivers/wheelfir.c
@@ -378,7 +378,7 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_blit_w)
cputag_set_input_line(machine(), "maincpu", 1, HOLD_LINE);
{
- UINT8 *rom = machine().region("gfx1")->base();
+ UINT8 *rom = memregion("gfx1")->base();
int width = machine().primary_screen->width();
int height = machine().primary_screen->height();
@@ -788,7 +788,7 @@ static MACHINE_START( wheelfir )
state->m_zoom_table[i]=-1;
}
- UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for(int j=0;j<400;++j)
{
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT(wheelfir)
{
- UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
RAM[0xdd3da/2] = 0x4e71; //hack
}
diff --git a/src/mame/drivers/whitestar.c b/src/mame/drivers/whitestar.c
index f6643d2b9b0..e267d9648a2 100644
--- a/src/mame/drivers/whitestar.c
+++ b/src/mame/drivers/whitestar.c
@@ -98,12 +98,12 @@ WRITE8_MEMBER(whitestar_state::switch_w)
WRITE8_MEMBER(whitestar_state::bank_w)
{
- membank("bank1")->set_base(machine().region("user1")->base() + (data & 0x1f) * 0x4000);
+ membank("bank1")->set_base(machine().root_device().memregion("user1")->base() + (data & 0x1f) * 0x4000);
}
WRITE8_MEMBER(whitestar_state::dmd_bank_w)
{
- membank("dmd_bank1")->set_base(machine().region("dmdcpu")->base() + (data & 0x1f) * 0x4000);
+ membank("dmd_bank1")->set_base(machine().root_device().memregion("dmdcpu")->base() + (data & 0x1f) * 0x4000);
}
READ8_MEMBER(whitestar_state::dmd_latch_r)
@@ -170,8 +170,8 @@ ADDRESS_MAP_END
static MACHINE_RESET( whitestar )
{
- machine.root_device().membank("bank1")->set_base(machine.region("user1")->base());
- machine.root_device().membank("dmd_bank1")->set_base(machine.region("dmdcpu")->base());
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
+ machine.root_device().membank("dmd_bank1")->set_base(machine.root_device().memregion("dmdcpu")->base());
}
static DRIVER_INIT( whitestar )
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index 46fe3fb4670..6d456bc617e 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -2730,7 +2730,7 @@ static DRIVER_INIT( defender )
static DRIVER_INIT( defndjeu )
{
williams_state *state = machine.driver_data<williams_state>();
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = state->memregion("maincpu")->base();
int i;
CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000);
diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c
index 284db339c79..dc5dbc731bb 100644
--- a/src/mame/drivers/wink.c
+++ b/src/mame/drivers/wink.c
@@ -411,7 +411,7 @@ ROM_END
static DRIVER_INIT( wink )
{
UINT32 i;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x8000);
// protection module reverse engineered by HIGHWAYMAN
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c
index 32bc55f5ff8..cb951e82551 100644
--- a/src/mame/drivers/witch.c
+++ b/src/mame/drivers/witch.c
@@ -380,7 +380,7 @@ WRITE8_MEMBER(witch_state::write_a00x)
if(newbank != m_bank)
{
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
m_bank = newbank;
ROM = &ROM[0x10000+0x8000 * newbank + UNBANKED_SIZE];
membank("bank1")->set_base(ROM);
@@ -419,7 +419,7 @@ READ8_MEMBER(witch_state::prot_read_700x)
case 0x25e:
return offset;//enough to pass...
}
- return machine().region("sub")->base()[0x7000+offset];
+ return memregion("sub")->base()[0x7000+offset];
}
/*
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT(witch)
{
witch_state *state = machine.driver_data<witch_state>();
- UINT8 *ROM = (UINT8 *)machine.region("maincpu")->base();
+ UINT8 *ROM = (UINT8 *)state->memregion("maincpu")->base();
state->membank("bank1")->set_base(&ROM[0x10000+UNBANKED_SIZE]);
machine.device("sub")->memory().space(AS_PROGRAM)->install_read_handler(0x7000, 0x700f, read8_delegate(FUNC(witch_state::prot_read_700x), state));
diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c
index c8698f66d9a..8d7fa2d43ae 100644
--- a/src/mame/drivers/wiz.c
+++ b/src/mame/drivers/wiz.c
@@ -1070,8 +1070,8 @@ static DRIVER_INIT( stinger )
{ 5,7,3, 0x28 }
};
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
int A;
const UINT8 *tbl;
diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c
index 2c18374bb76..1350ad85dc1 100644
--- a/src/mame/drivers/xain.c
+++ b/src/mame/drivers/xain.c
@@ -568,8 +568,8 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( xsleena )
{
- machine.root_device().membank("bank1")->configure_entries(0, 2, machine.region("maincpu")->base() + 0x4000, 0xc000);
- machine.root_device().membank("bank2")->configure_entries(0, 2, machine.region("sub")->base() + 0x4000, 0xc000);
+ machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x4000, 0xc000);
+ machine.root_device().membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("sub")->base() + 0x4000, 0xc000);
machine.root_device().membank("bank1")->set_entry(0);
machine.root_device().membank("bank2")->set_entry(0);
}
diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c
index 2d41f9e12d3..7471a7e2a31 100644
--- a/src/mame/drivers/xexex.c
+++ b/src/mame/drivers/xexex.c
@@ -456,7 +456,7 @@ static void xexex_postload(running_machine &machine)
static MACHINE_START( xexex )
{
xexex_state *state = machine.driver_data<xexex_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank2")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank2")->set_entry(0);
@@ -684,8 +684,8 @@ static DRIVER_INIT( xexex )
if (!strcmp(machine.system().name, "xexex"))
{
// Invulnerability
-// *(UINT16 *)(machine.region("maincpu")->base() + 0x648d4) = 0x4a79;
-// *(UINT16 *)(machine.region("maincpu")->base() + 0x00008) = 0x5500;
+// *(UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x648d4) = 0x4a79;
+// *(UINT16 *)(state->memregion("maincpu")->base() + 0x00008) = 0x5500;
state->m_strip_0x1a = 1;
}
}
diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c
index 326dfecec17..a947a3e3669 100644
--- a/src/mame/drivers/xmen.c
+++ b/src/mame/drivers/xmen.c
@@ -295,7 +295,7 @@ INPUT_PORTS_END
static MACHINE_START( xmen )
{
xmen_state *state = machine.driver_data<xmen_state>();
- UINT8 *ROM = machine.region("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
state->membank("bank4")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank4")->set_entry(0);
diff --git a/src/mame/drivers/xorworld.c b/src/mame/drivers/xorworld.c
index c33fb3e1f01..017ee7eb29b 100644
--- a/src/mame/drivers/xorworld.c
+++ b/src/mame/drivers/xorworld.c
@@ -223,7 +223,7 @@ static DRIVER_INIT( xorworld )
/* patch some strange protection (without this, strange characters appear
after level 5 and some pieces don't rotate properly some times) */
- UINT16 *rom = (UINT16 *)(machine.region("maincpu")->base() + 0x1390);
+ UINT16 *rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x1390);
PATCH(0x4239); PATCH(0x00ff); PATCH(0xe196); /* clr.b $ffe196 */
PATCH(0x4239); PATCH(0x00ff); PATCH(0xe197); /* clr.b $ffe197 */
diff --git a/src/mame/drivers/xtom3d.c b/src/mame/drivers/xtom3d.c
index f001604d0f7..f1b9e1f0fd7 100644
--- a/src/mame/drivers/xtom3d.c
+++ b/src/mame/drivers/xtom3d.c
@@ -147,7 +147,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
state->membank("bios_bank")->set_base(state->m_bios_ram);
else // disable RAM access (reads go to BIOS ROM)
- state->membank("bios_bank")->set_base(busdevice->machine().region("bios")->base() + 0x10000);
+ state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x10000);
break;
}
case 0x5a: // PAM1
@@ -155,12 +155,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("video_bank1")->set_base(state->m_isa_ram1);
else
- state->membank("video_bank1")->set_base(busdevice->machine().region("video_bios")->base() + 0);
+ state->membank("video_bank1")->set_base(state->memregion("video_bios")->base() + 0);
if (data & 0x10)
state->membank("video_bank2")->set_base(state->m_isa_ram2);
else
- state->membank("video_bank2")->set_base(busdevice->machine().region("video_bios")->base() + 0x4000);
+ state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
break;
}
@@ -169,12 +169,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
else
- state->membank("bios_ext1")->set_base(busdevice->machine().region("bios")->base() + 0);
+ state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0);
if (data & 0x10)
state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram);
else
- state->membank("bios_ext2")->set_base(busdevice->machine().region("bios")->base() + 0x4000);
+ state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x4000);
break;
}
@@ -183,12 +183,12 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 0x1)
state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
else
- state->membank("bios_ext3")->set_base(busdevice->machine().region("bios")->base() + 0x8000);
+ state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x8000);
if (data & 0x10)
state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram);
else
- state->membank("bios_ext4")->set_base(busdevice->machine().region("bios")->base() + 0xc000);
+ state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0xc000);
break;
}
@@ -666,13 +666,13 @@ static MACHINE_START( xtom3d )
static MACHINE_RESET( xtom3d )
{
- machine.root_device().membank("bios_bank")->set_base(machine.region("bios")->base() + 0x10000);
- machine.root_device().membank("bios_ext1")->set_base(machine.region("bios")->base() + 0);
- machine.root_device().membank("bios_ext2")->set_base(machine.region("bios")->base() + 0x4000);
- machine.root_device().membank("bios_ext3")->set_base(machine.region("bios")->base() + 0x8000);
- machine.root_device().membank("bios_ext4")->set_base(machine.region("bios")->base() + 0xc000);
- machine.root_device().membank("video_bank1")->set_base(machine.region("video_bios")->base() + 0);
- machine.root_device().membank("video_bank2")->set_base(machine.region("video_bios")->base() + 0x4000);
+ machine.root_device().membank("bios_bank")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
+ machine.root_device().membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0);
+ machine.root_device().membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x4000);
+ machine.root_device().membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x8000);
+ machine.root_device().membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0xc000);
+ machine.root_device().membank("video_bank1")->set_base(machine.root_device().memregion("video_bios")->base() + 0);
+ machine.root_device().membank("video_bank2")->set_base(machine.root_device().memregion("video_bios")->base() + 0x4000);
}
diff --git a/src/mame/drivers/xxmissio.c b/src/mame/drivers/xxmissio.c
index 52e268f338b..3ab0739f304 100644
--- a/src/mame/drivers/xxmissio.c
+++ b/src/mame/drivers/xxmissio.c
@@ -79,7 +79,7 @@ static INTERRUPT_GEN( xxmissio_interrupt_s )
static MACHINE_START( xxmissio )
{
- machine.root_device().membank("bank1")->configure_entries(0, 8, machine.region("user1")->base(), 0x4000);
+ machine.root_device().membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("user1")->base(), 0x4000);
machine.root_device().membank("bank1")->set_entry(0);
}
diff --git a/src/mame/drivers/yunsun16.c b/src/mame/drivers/yunsun16.c
index d6dd6dc1ec5..9329a310db9 100644
--- a/src/mame/drivers/yunsun16.c
+++ b/src/mame/drivers/yunsun16.c
@@ -106,7 +106,7 @@ WRITE16_MEMBER(yunsun16_state::yunsun16_sound_bank_w)
if (ACCESSING_BITS_0_7)
{
int bank = data & 3;
- UINT8 *dst = machine().region("oki")->base();
+ UINT8 *dst = memregion("oki")->base();
UINT8 *src = dst + 0x80000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
}
diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c
index ac82e6c8981..743d5d3c289 100644
--- a/src/mame/drivers/yunsung8.c
+++ b/src/mame/drivers/yunsung8.c
@@ -466,8 +466,8 @@ static const msm5205_interface yunsung8_msm5205_interface =
static MACHINE_START( yunsung8 )
{
yunsung8_state *state = machine.driver_data<yunsung8_state>();
- UINT8 *MAIN = machine.region("maincpu")->base();
- UINT8 *AUDIO = machine.region("audiocpu")->base();
+ UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *AUDIO = machine.root_device().memregion("audiocpu")->base();
state->m_videoram_0 = state->m_videoram + 0x0000; // Ram is banked
state->m_videoram_1 = state->m_videoram + 0x2000;
@@ -475,7 +475,7 @@ static MACHINE_START( yunsung8 )
state->membank("bank1")->configure_entries(0, 3, &MAIN[0x00000], 0x4000);
state->membank("bank1")->configure_entries(3, 5, &MAIN[0x10000], 0x4000);
state->membank("bank2")->configure_entries(0, 3, &AUDIO[0x00000], 0x4000);
- machine.root_device().membank("bank2")->configure_entries(3, 5, &AUDIO[0x10000], 0x4000);
+ state->membank("bank2")->configure_entries(3, 5, &AUDIO[0x10000], 0x4000);
state->m_audiocpu = machine.device("audiocpu");
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index dc86bbf2838..8f525530c0b 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -1430,8 +1430,8 @@ static void zaxxonj_decode(running_machine &machine, const char *cputag)
int A;
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region(cputag)->base();
- int size = machine.region(cputag)->bytes();
+ UINT8 *rom = machine.root_device().memregion(cputag)->base();
+ int size = machine.root_device().memregion(cputag)->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
space->set_decrypted_region(0x0000, size - 1, decrypt);
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index 90f72c1c8c8..b9ead50f523 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -684,12 +684,12 @@ READ32_MEMBER(zn_state::capcom_kickharness_r)
WRITE32_MEMBER(zn_state::bank_coh1000c_w)
{
- membank( "bank2" )->set_base( machine().region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
+ membank( "bank2" )->set_base( memregion( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
}
WRITE8_MEMBER(zn_state::qsound_bankswitch_w)
{
- membank( "bank10" )->set_base( machine().region( "audiocpu" )->base() + 0x10000 + ( ( data & 0x0f ) * 0x4000 ) );
+ membank( "bank10" )->set_base( memregion( "audiocpu" )->base() + 0x10000 + ( ( data & 0x0f ) * 0x4000 ) );
}
static INTERRUPT_GEN( qsound_interrupt )
@@ -728,9 +728,9 @@ static DRIVER_INIT( coh1000c )
static MACHINE_RESET( coh1000c )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
- machine.root_device().membank( "bank3" )->set_base( machine.region( "user3" )->base() ); /* country rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user2" )->base() + 0x400000 ); /* banked game rom */
+ machine.root_device().membank( "bank3" )->set_base( machine.root_device().memregion( "user3" )->base() ); /* country rom */
zn_machine_init(machine);
}
@@ -918,7 +918,7 @@ Notes:
WRITE32_MEMBER(zn_state::bank_coh3002c_w)
{
- membank( "bank2" )->set_base( machine().region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
+ membank( "bank2" )->set_base( memregion( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
}
static DRIVER_INIT( coh3002c )
@@ -937,9 +937,9 @@ static DRIVER_INIT( coh3002c )
static MACHINE_RESET( coh3002c )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
- machine.root_device().membank( "bank3" )->set_base( machine.region( "user3" )->base() ); /* country rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user2" )->base() + 0x400000 ); /* banked game rom */
+ machine.root_device().membank( "bank3" )->set_base( machine.root_device().memregion( "user3" )->base() ); /* country rom */
zn_machine_init(machine);
}
@@ -1180,12 +1180,12 @@ WRITE32_MEMBER(zn_state::bank_coh1000t_w)
device_t *mb3773 = machine().device("mb3773");
mb3773_set_ck(mb3773, (data & 0x20) >> 5);
verboselog( machine(), 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
}
WRITE8_MEMBER(zn_state::fx1a_sound_bankswitch_w)
{
- membank( "bank10" )->set_base( machine().region( "audiocpu" )->base() + 0x10000 + ( ( ( data - 1 ) & 0x07 ) * 0x4000 ) );
+ membank( "bank10" )->set_base( memregion( "audiocpu" )->base() + 0x10000 + ( ( ( data - 1 ) & 0x07 ) * 0x4000 ) );
}
READ32_MEMBER(zn_state::taitofx1a_ymsound_r)
@@ -1225,7 +1225,7 @@ static DRIVER_INIT( coh1000ta )
static MACHINE_RESET( coh1000ta )
{
zn_state *state = machine.driver_data<zn_state>();
- state->membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked game rom */
+ state->membank( "bank1" )->set_base( state->memregion( "user2" )->base() ); /* banked game rom */
state->membank( "bank2" )->set_base( state->m_taitofx1_eeprom1 );
zn_machine_init(machine);
}
@@ -1320,7 +1320,7 @@ static MACHINE_RESET( coh1000tb )
{
zn_state *state = machine.driver_data<zn_state>();
- state->membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked game rom */
+ state->membank( "bank1" )->set_base( state->memregion( "user2" )->base() ); /* banked game rom */
state->membank( "bank2" )->set_base( state->m_taitofx1_eeprom1 );
state->membank( "bank3" )->set_base( state->m_taitofx1_eeprom2 );
zn_machine_init(machine);
@@ -1505,7 +1505,7 @@ static DRIVER_INIT( coh1000w )
static MACHINE_RESET( coh1000w )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
zn_machine_init(machine);
devtag_reset(machine, "ide");
@@ -1670,7 +1670,7 @@ WRITE32_MEMBER(zn_state::coh1002e_bank_w)
{
znsecsel_w( space, offset, data, mem_mask );
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
}
WRITE32_MEMBER(zn_state::coh1002e_latch_w)
@@ -1693,7 +1693,7 @@ static DRIVER_INIT( coh1002e )
static MACHINE_RESET( coh1002e )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* banked game rom */
zn_machine_init(machine);
}
@@ -1784,7 +1784,7 @@ WRITE32_MEMBER(zn_state::bam2_mcu_w)
{
if (ACCESSING_BITS_0_15)
{
- membank( "bank2" )->set_base( machine().region( "user2" )->base() + ( ( data & 0xf ) * 0x400000 ) );
+ membank( "bank2" )->set_base( memregion( "user2" )->base() + ( ( data & 0xf ) * 0x400000 ) );
}
else if (ACCESSING_BITS_16_31)
{
@@ -1839,8 +1839,8 @@ static DRIVER_INIT( bam2 )
static MACHINE_RESET( bam2 )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user2" )->base() + 0x400000 ); /* banked game rom */
zn_machine_init(machine);
}
@@ -2176,7 +2176,7 @@ static DRIVER_INIT( coh1000a )
static MACHINE_RESET( coh1000a )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
zn_machine_init(machine);
if( ( !strcmp( machine.system().name, "jdredd" ) ) ||
( !strcmp( machine.system().name, "jdreddb" ) ) )
@@ -2318,7 +2318,7 @@ Notes:
WRITE32_MEMBER(zn_state::coh1001l_bnk_w)
{
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ( ( ( data >> 16 ) & 3 ) * 0x800000 ) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ( ( ( data >> 16 ) & 3 ) * 0x800000 ) );
}
static DRIVER_INIT( coh1001l )
@@ -2332,7 +2332,7 @@ static DRIVER_INIT( coh1001l )
static MACHINE_RESET( coh1001l )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* banked rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* banked rom */
zn_machine_init(machine);
}
@@ -2361,7 +2361,7 @@ Key: Mother KN01
WRITE32_MEMBER(zn_state::coh1002v_bnk_w)
{
- membank( "bank2" )->set_base( machine().region( "user3" )->base() + ( data * 0x100000 ) );
+ membank( "bank2" )->set_base( memregion( "user3" )->base() + ( data * 0x100000 ) );
}
static DRIVER_INIT( coh1002v )
@@ -2376,8 +2376,8 @@ static DRIVER_INIT( coh1002v )
static MACHINE_RESET( coh1002v )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() ); /* fixed game rom */
- machine.root_device().membank( "bank2" )->set_base( machine.region( "user3" )->base() ); /* banked rom */
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
+ machine.root_device().membank( "bank2" )->set_base( machine.root_device().memregion( "user3" )->base() ); /* banked rom */
zn_machine_init(machine);
}
@@ -2546,7 +2546,7 @@ Notes:
WRITE32_MEMBER(zn_state::coh1002m_bank_w)
{
verboselog( machine(), 1, "coh1002m_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
- membank( "bank1" )->set_base( machine().region( "user2" )->base() + ((data>>16) * 0x800000) );
+ membank( "bank1" )->set_base( memregion( "user2" )->base() + ((data>>16) * 0x800000) );
}
READ32_MEMBER(zn_state::cbaj_z80_r)
@@ -2580,7 +2580,7 @@ static DRIVER_INIT( coh1002m )
static MACHINE_RESET( coh1002m )
{
- machine.root_device().membank( "bank1" )->set_base( machine.region( "user2" )->base() );
+ machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() );
zn_machine_init(machine);
}
diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c
index 56a7e8e68ed..a090e5876ca 100644
--- a/src/mame/drivers/zr107.c
+++ b/src/mame/drivers/zr107.c
@@ -838,7 +838,7 @@ static void init_zr107(running_machine &machine)
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
state->m_ccu_vcth = state->m_ccu_vctl = 0;
- K001005_preprocess_texture_data(machine.region("gfx1")->base(), machine.region("gfx1")->bytes(), 0);
+ K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 0);
}
static DRIVER_INIT(zr107)
diff --git a/src/mame/machine/acitya.c b/src/mame/machine/acitya.c
index 5eb5df992a2..5b0e08c6904 100644
--- a/src/mame/machine/acitya.c
+++ b/src/mame/machine/acitya.c
@@ -22,7 +22,7 @@ static void acitya_decrypt_rom_8(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
@@ -58,7 +58,7 @@ static void acitya_decrypt_rom_9(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -91,7 +91,7 @@ static void acitya_decrypt_rom_A(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -124,7 +124,7 @@ static void acitya_decrypt_rom_B(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -184,7 +184,7 @@ READ8_HANDLER( acitya_decrypt_rom )
MACHINE_START( acitya )
{
pacman_state *state = machine.driver_data<pacman_state>();
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -194,7 +194,7 @@ MACHINE_START( acitya )
acitya_decrypt_rom_A(machine);
acitya_decrypt_rom_B(machine);
- machine.root_device().membank("bank1")->configure_entries(0, 4, &RAM[0x10000], 0x4000);
+ state->membank("bank1")->configure_entries(0, 4, &RAM[0x10000], 0x4000);
state_save_register_global(machine, state->m_counter);
}
diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c
index 0923c0dd407..78a49b2ac9d 100644
--- a/src/mame/machine/ajax.c
+++ b/src/mame/machine/ajax.c
@@ -197,8 +197,8 @@ WRITE8_MEMBER(ajax_state::ajax_bankswitch_2_w)
MACHINE_START( ajax )
{
ajax_state *state = machine.driver_data<ajax_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->membank("bank1")->configure_entries(0, 9, &SUB[0x10000], 0x2000);
state->membank("bank2")->configure_entries(0, 12, &MAIN[0x10000], 0x2000);
diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c
index 970c86231d5..d8f0c0e4ab7 100644
--- a/src/mame/machine/archimds.c
+++ b/src/mame/machine/archimds.c
@@ -116,7 +116,7 @@ static TIMER_CALLBACK( vidc_vblank )
static TIMER_CALLBACK( vidc_video_tick )
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- static UINT8 *vram = machine.region("vram")->base();
+ static UINT8 *vram = machine.root_device().memregion("vram")->base();
UINT32 size;
size = vidc_vidend-vidc_vidstart+0x10;
@@ -289,7 +289,7 @@ READ32_HANDLER(archimedes_memc_logical_r)
{
UINT32 *rom;
- rom = (UINT32 *)space->machine().region("maincpu")->base();
+ rom = (UINT32 *)space->machine().root_device().memregion("maincpu")->base();
return rom[offset & 0x1fffff];
}
@@ -355,7 +355,7 @@ READ32_HANDLER(aristmk5_drame_memc_logical_r)
{
UINT32 *rom;
- rom = (UINT32 *)space->machine().region("maincpu")->base();
+ rom = (UINT32 *)space->machine().root_device().memregion("maincpu")->base();
return rom[offset & 0x1fffff];
}
@@ -406,7 +406,7 @@ DIRECT_UPDATE_HANDLER( a310_setopbase )
// if the boot ROM is mapped in, do some trickery to make it show up
if (memc_latchrom)
{
- direct.explicit_configure(0x000000, 0x1fffff, 0x1fffff, *direct.space().machine().region("maincpu"));
+ direct.explicit_configure(0x000000, 0x1fffff, 0x1fffff, *direct.space().machine().root_device().memregion("maincpu"));
}
else // executing from logical memory
{
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index 61c314831e7..a25b33ba052 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -112,7 +112,7 @@ void a600xl_mmu(running_machine &machine, UINT8 new_mmu)
logerror("%s MMU SELFTEST ROM\n", machine.system().name);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x57ff, "bank2");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5000, 0x57ff);
- machine.root_device().membank("bank2")->set_base(machine.region("maincpu")->base() + 0x5000);
+ machine.root_device().membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x5000);
}
}
diff --git a/src/mame/machine/awboard.c b/src/mame/machine/awboard.c
index fca426c3c76..1da16b19472 100644
--- a/src/mame/machine/awboard.c
+++ b/src/mame/machine/awboard.c
@@ -212,7 +212,7 @@ void aw_rom_board::decrypt_region()
if(!keyregion)
return;
- const memory_region *kr = machine().region(keyregion);
+ memory_region *kr = memregion(keyregion);
if(!kr)
return;
diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c
index dc783ac7b32..674da7cfa8d 100644
--- a/src/mame/machine/balsente.c
+++ b/src/mame/machine/balsente.c
@@ -172,9 +172,9 @@ MACHINE_RESET( balsente )
memset(state->m_noise_position, 0, sizeof(state->m_noise_position));
/* point the banks to bank 0 */
- numbanks = (machine.region("maincpu")->bytes() > 0x40000) ? 16 : 8;
- state->membank("bank1")->configure_entries(0, numbanks, &machine.region("maincpu")->base()[0x10000], 0x6000);
- state->membank("bank2")->configure_entries(0, numbanks, &machine.region("maincpu")->base()[0x12000], 0x6000);
+ numbanks = (machine.root_device().memregion("maincpu")->bytes() > 0x40000) ? 16 : 8;
+ state->membank("bank1")->configure_entries(0, numbanks, &machine.root_device().memregion("maincpu")->base()[0x10000], 0x6000);
+ state->membank("bank2")->configure_entries(0, numbanks, &state->memregion("maincpu")->base()[0x12000], 0x6000);
state->membank("bank1")->set_entry(0);
state->membank("bank2")->set_entry(0);
machine.device("maincpu")->reset();
@@ -291,7 +291,7 @@ WRITE8_MEMBER(balsente_state::balsente_rombank2_select_w)
int bank = data & 7;
/* top bit controls which half of the ROMs to use (Name that Tune only) */
- if (machine().region("maincpu")->bytes() > 0x40000) bank |= (data >> 4) & 8;
+ if (machine().root_device().memregion("maincpu")->bytes() > 0x40000) bank |= (data >> 4) & 8;
/* when they set the AB bank, it appears as though the CD bank is reset */
if (data & 0x20)
diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c
index 6a87b5fb306..e171413be59 100644
--- a/src/mame/machine/beezer.c
+++ b/src/mame/machine/beezer.c
@@ -176,7 +176,7 @@ WRITE8_MEMBER(beezer_state::beezer_bankswitch_w)
}
else
{
- UINT8 *rom = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *rom = memregion("maincpu")->base() + 0x10000;
space.install_ram(0xc000, 0xcfff, rom + (data & 0x07) * 0x2000 + ((data & 0x08) ? 0x1000: 0));
}
}
diff --git a/src/mame/machine/bfm_comn.c b/src/mame/machine/bfm_comn.c
index aafa2b4b42c..b94f465a24b 100644
--- a/src/mame/machine/bfm_comn.c
+++ b/src/mame/machine/bfm_comn.c
@@ -21,7 +21,7 @@ void bfm_decode_mainrom(running_machine &machine, const char *rom_region, UINT8*
{
UINT8 *tmp, *rom;
- rom = machine.region(rom_region)->base();
+ rom = machine.root_device().memregion(rom_region)->base();
tmp = auto_alloc_array(machine, UINT8, 0x10000);
{
diff --git a/src/mame/machine/btime.c b/src/mame/machine/btime.c
index 8c87c64f10a..2d70f7fb3ed 100644
--- a/src/mame/machine/btime.c
+++ b/src/mame/machine/btime.c
@@ -6,7 +6,7 @@
READ8_MEMBER(btime_state::mmonkey_protection_r)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
int ret = 0;
if (offset == 0x0000)
@@ -23,7 +23,7 @@ READ8_MEMBER(btime_state::mmonkey_protection_r)
WRITE8_MEMBER(btime_state::mmonkey_protection_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (offset == 0)
{
diff --git a/src/mame/machine/cclimber.c b/src/mame/machine/cclimber.c
index b71b87cb1fc..91436bed849 100644
--- a/src/mame/machine/cclimber.c
+++ b/src/mame/machine/cclimber.c
@@ -7,7 +7,7 @@
static void cclimber_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;
@@ -68,7 +68,7 @@ DRIVER_INIT( cclimberj )
DRIVER_INIT( ckongb )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0x0000;A < 0x6000;A++) /* all the program ROMs are encrypted */
{
@@ -79,7 +79,7 @@ DRIVER_INIT( ckongb )
#if CANNONB_HACK
static void cannonb_patch(running_machine &machine)
{
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
rom[0x2ba0] = 0x21;
rom[0x2ba1] = 0xfb;
@@ -91,7 +91,7 @@ static void cannonb_patch(running_machine &machine)
DRIVER_INIT( cannonb )
{
int A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0x0000;A < 0x1000;A++) /* only first ROM is encrypted */
{
diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c
index 89143cdab17..00a1b47189f 100644
--- a/src/mame/machine/cps2crpt.c
+++ b/src/mame/machine/cps2crpt.c
@@ -633,8 +633,8 @@ static void optimise_sboxes(struct optimised_sbox* out, const struct sbox* in)
static void cps2_decrypt(running_machine &machine, const UINT32 *master_key, UINT32 upper_limit)
{
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 = machine.root_device().memregion("maincpu")->bytes();
UINT16 *dec = auto_alloc_array(machine, UINT16, length/2);
int i;
UINT32 key1[4];
diff --git a/src/mame/machine/dec0.c b/src/mame/machine/dec0.c
index a915b743187..1f301951ea4 100644
--- a/src/mame/machine/dec0.c
+++ b/src/mame/machine/dec0.c
@@ -351,7 +351,7 @@ WRITE16_MEMBER(dec0_state::robocop_68000_share_w)
static void h6280_decrypt(running_machine &machine, const char *cputag)
{
int i;
- UINT8 *RAM = machine.region(cputag)->base();
+ UINT8 *RAM = machine.root_device().memregion(cputag)->base();
/* Read each byte, decrypt it */
for (i = 0x00000; i < 0x10000; i++)
@@ -360,7 +360,7 @@ static void h6280_decrypt(running_machine &machine, const char *cputag)
DRIVER_INIT( hippodrm )
{
- UINT8 *RAM = machine.region("sub")->base();
+ UINT8 *RAM = machine.root_device().memregion("sub")->base();
dec0_state *state = machine.driver_data<dec0_state>();
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x180000, 0x180fff, read16_delegate(FUNC(dec0_state::hippodrm_68000_share_r),state), write16_delegate(FUNC(dec0_state::hippodrm_68000_share_w),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xffc800, 0xffcfff, write16_delegate(FUNC(dec0_state::sprite_mirror_w),state));
@@ -376,7 +376,7 @@ DRIVER_INIT( hippodrm )
DRIVER_INIT( slyspy )
{
- UINT8 *RAM = machine.region("audiocpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("audiocpu")->base();
h6280_decrypt(machine, "audiocpu");
diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c
index 619c48f81d2..823aa288711 100644
--- a/src/mame/machine/deco102.c
+++ b/src/mame/machine/deco102.c
@@ -51,8 +51,8 @@ void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int addre
{
int i;
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.region(cputag)->base();
- int size = machine.region(cputag)->bytes();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion(cputag)->base();
+ int size = machine.root_device().memregion(cputag)->bytes();
UINT16 *opcodes = auto_alloc_array(machine, UINT16, size / 2);
UINT16 *buf = auto_alloc_array(machine, UINT16, size / 2);
diff --git a/src/mame/machine/deco156.c b/src/mame/machine/deco156.c
index 68d464758c7..d362c21f3f8 100644
--- a/src/mame/machine/deco156.c
+++ b/src/mame/machine/deco156.c
@@ -124,8 +124,8 @@ static void decrypt(UINT32 *src, UINT32 *dst, int length)
void deco156_decrypt(running_machine &machine)
{
- UINT32 *rom = (UINT32 *)machine.region("maincpu")->base();
- int length = machine.region("maincpu")->bytes();
+ UINT32 *rom = (UINT32 *)machine.root_device().memregion("maincpu")->base();
+ int length = machine.root_device().memregion("maincpu")->bytes();
UINT32 *buf = auto_alloc_array(machine, UINT32, length/4);
memcpy(buf, rom, length);
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index b22c8e19d61..98ae239fa31 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -297,7 +297,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -377,7 +377,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -457,7 +457,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -537,7 +537,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -619,7 +619,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -687,7 +687,7 @@ static READ8_HANDLER( decocass_type2_r )
{
if (1 == (offset & 1))
{
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = state->memregion("dongle")->base();
data = prom[256 * state->m_type2_d2_latch + state->m_type2_promaddr];
LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", space->machine().time().as_string(6), cpu_get_previouspc(&space->device()), offset, data, 256 * state->m_type2_d2_latch + state->m_type2_promaddr));
}
@@ -771,7 +771,7 @@ static READ8_HANDLER( decocass_type3_r )
{
if (1 == state->m_type3_pal_19)
{
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = state->memregion("dongle")->base();
data = prom[state->m_type3_ctrs];
LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", space->machine().time().as_string(6), cpu_get_previouspc(&space->device()), offset, data, state->m_type3_ctrs));
if (++state->m_type3_ctrs == 4096)
@@ -1024,7 +1024,7 @@ static READ8_HANDLER( decocass_type4_r )
{
if (state->m_type4_latch)
{
- UINT8 *prom = space->machine().region("dongle")->base();
+ UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
data = prom[state->m_type4_ctrs];
LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", space->machine().time().as_string(6), cpu_get_previouspc(&space->device()), offset, data, (data >= 32) ? data : '.', state->m_type4_ctrs));
@@ -1648,7 +1648,7 @@ MACHINE_RESET( csdtenis )
MACHINE_RESET( czeroize )
{
decocass_state *state = machine.driver_data<decocass_state>();
- UINT8 *mem = machine.region("dongle")->base();
+ UINT8 *mem = state->memregion("dongle")->base();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->m_dongle_r = decocass_type3_r;
diff --git a/src/mame/machine/decocrpt.c b/src/mame/machine/decocrpt.c
index 6315a8ee136..63c5509421c 100644
--- a/src/mame/machine/decocrpt.c
+++ b/src/mame/machine/decocrpt.c
@@ -600,8 +600,8 @@ static const UINT8 deco74_swap_table[0x800] =
static void deco_decrypt(running_machine &machine,const char *rgntag,const UINT8 *xor_table,const UINT16 *address_table,const UINT8 *swap_table,int remap_only)
{
- UINT16 *rom = (UINT16 *)machine.region(rgntag)->base();
- int len = machine.region(rgntag)->bytes()/2;
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion(rgntag)->base();
+ int len = machine.root_device().memregion(rgntag)->bytes()/2;
UINT16 *buffer = auto_alloc_array(machine, UINT16, len);
int i;
diff --git a/src/mame/machine/fd1089.c b/src/mame/machine/fd1089.c
index 8c99d94033a..612595b471b 100644
--- a/src/mame/machine/fd1089.c
+++ b/src/mame/machine/fd1089.c
@@ -405,8 +405,8 @@ static void clear_decrypted(running_machine &machine)
static void sys16_decrypt(running_machine &machine, const UINT8 *key,int cputype)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
- int size = machine.region("maincpu")->bytes();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ int size = machine.root_device().memregion("maincpu")->bytes();
int A;
decrypted = auto_alloc_array(machine, UINT16, size/2);
@@ -432,11 +432,11 @@ void *fd1089_get_decrypted_base(void)
void fd1089a_decrypt(running_machine &machine)
{
- sys16_decrypt(machine, machine.region("fd1089a")->base(), FD1089A);
+ sys16_decrypt(machine, machine.root_device().memregion("fd1089a")->base(), FD1089A);
}
void fd1089b_decrypt(running_machine &machine)
{
- sys16_decrypt(machine, machine.region("fd1089b")->base(), FD1089B);
+ sys16_decrypt(machine, machine.root_device().memregion("fd1089b")->base(), FD1089B);
}
diff --git a/src/mame/machine/fddebug.c b/src/mame/machine/fddebug.c
index b60b00f625d..3d32798566f 100644
--- a/src/mame/machine/fddebug.c
+++ b/src/mame/machine/fddebug.c
@@ -482,11 +482,11 @@ void fd1094_init_debugging(running_machine &machine, const char *cpureg, const c
key_changed = changed;
/* set up the regions */
- coderegion = (UINT16 *)machine.region(cpureg)->base();
- coderegion_words = machine.region(cpureg)->bytes() / 2;
- keyregion = (UINT8 *)machine.region(keyreg)->base();
- keystatus = (UINT16 *)machine.region(statreg)->base();
- keystatus_words = machine.region(statreg)->bytes() / 2;
+ coderegion = (UINT16 *)machine.root_device().memregion(cpureg)->base();
+ coderegion_words = machine.root_device().memregion(cpureg)->bytes() / 2;
+ keyregion = (UINT8 *)machine.root_device().memregion(keyreg)->base();
+ keystatus = (UINT16 *)machine.root_device().memregion(statreg)->base();
+ keystatus_words = machine.root_device().memregion(statreg)->bytes() / 2;
assert(coderegion_words == keystatus_words);
/* allocate memory for the ignore table */
diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c
index 772f8c48396..7f6a1e3eb29 100644
--- a/src/mame/machine/gaelco2.c
+++ b/src/mame/machine/gaelco2.c
@@ -22,10 +22,10 @@ static void gaelco2_ROM16_split_gfx(running_machine &machine, const char *src_re
int i;
/* get a pointer to the source data */
- UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
+ UINT8 *src = (UINT8 *)machine.root_device().memregion(src_reg)->base();
/* get a pointer to the destination data */
- UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
+ UINT8 *dst = (UINT8 *)machine.root_device().memregion(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length/2; i++){
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index 302846052c2..612e2124083 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -166,7 +166,7 @@ WRITE8_MEMBER(galaxold_state::zigzag_sillyprotection_w)
DRIVER_INIT( zigzag )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
machine.root_device().membank("bank1")->configure_entries(0, 2, &RAM[0x2000], 0x1000);
machine.root_device().membank("bank2")->configure_entries(0, 2, &RAM[0x2000], 0x1000);
machine.root_device().membank("bank1")->set_entry(0);
@@ -194,7 +194,7 @@ READ8_MEMBER(galaxold_state::dingoe_3001_r)
DRIVER_INIT( dingoe )
{
offs_t i;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x3000; i++)
{
@@ -301,8 +301,8 @@ DRIVER_INIT( mooncrsu )
DRIVER_INIT( mooncrst )
{
- offs_t i, len = machine.region("maincpu")->bytes();
- UINT8 *rom = machine.region("maincpu")->base();
+ offs_t i, len = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (i = 0;i < len;i++)
@@ -320,7 +320,7 @@ DRIVER_INIT( moonqsr )
{
offs_t i;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -378,8 +378,8 @@ Pin layout is such that links can replace the PAL if encryption is not used.
{ 1,4,1,4 }
};
- offs_t i, len = machine.region("maincpu")->bytes();
- UINT8 *rom = machine.region("maincpu")->base();
+ offs_t i, len = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < len; i++)
@@ -399,8 +399,8 @@ DRIVER_INIT( 4in1 )
{
galaxold_state *state = machine.driver_data<galaxold_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- offs_t i, len = machine.region("maincpu")->bytes();
- UINT8 *RAM = machine.region("maincpu")->base();
+ offs_t i, len = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *RAM = state->memregion("maincpu")->base();
/* Decrypt Program Roms */
for (i = 0; i < len; i++)
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index 4a1ded55037..a8a9551a956 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -59,8 +59,8 @@ MACHINE_START( harddriv )
atarigen_init(machine);
/* predetermine memory regions */
- state->m_sim_memory = (UINT16 *)machine.region("user1")->base();
- state->m_sim_memory_size = machine.region("user1")->bytes() / 2;
+ state->m_sim_memory = (UINT16 *)machine.root_device().memregion("user1")->base();
+ state->m_sim_memory_size = state->memregion("user1")->bytes() / 2;
state->m_adsp_pgm_memory_word = (UINT16 *)(reinterpret_cast<UINT8 *>(state->m_adsp_pgm_memory.target()) + 1);
}
diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c
index 162f9cfdd73..8754b90c475 100644
--- a/src/mame/machine/irobot.c
+++ b/src/mame/machine/irobot.c
@@ -101,7 +101,7 @@ WRITE8_MEMBER(irobot_state::irobot_statwr_w)
WRITE8_MEMBER(irobot_state::irobot_out0_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
m_out0 = data;
switch (data & 0x60)
@@ -123,7 +123,7 @@ WRITE8_MEMBER(irobot_state::irobot_out0_w)
WRITE8_MEMBER(irobot_state::irobot_rom_banksel_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
switch ((data & 0x0E) >> 1)
{
@@ -170,7 +170,7 @@ static TIMER_CALLBACK( scanline_callback )
MACHINE_RESET( irobot )
{
irobot_state *state = machine.driver_data<irobot_state>();
- UINT8 *MB = machine.region("mathbox")->base();
+ UINT8 *MB = state->memregion("mathbox")->base();
/* initialize the memory regions */
state->m_mbROM = MB + 0x00000;
@@ -332,7 +332,7 @@ static void irmb_dout(irobot_state *state, const irmb_ops *curop, UINT32 d)
static void load_oproms(running_machine &machine)
{
irobot_state *state = machine.driver_data<irobot_state>();
- UINT8 *MB = machine.region("proms")->base() + 0x20;
+ UINT8 *MB = state->memregion("proms")->base() + 0x20;
int i;
/* allocate RAM */
diff --git a/src/mame/machine/jalcrpt.c b/src/mame/machine/jalcrpt.c
index d8ac6389c01..3fa396af04d 100644
--- a/src/mame/machine/jalcrpt.c
+++ b/src/mame/machine/jalcrpt.c
@@ -4,8 +4,8 @@
void phantasm_rom_decode(running_machine &machine, const char *region)
{
- UINT16 *RAM = (UINT16 *) machine.region(region)->base();
- int i, size = machine.region(region)->bytes();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion(region)->base();
+ int i, size = machine.root_device().memregion(region)->bytes();
if (size > 0x40000) size = 0x40000;
for (i = 0 ; i < size/2 ; i++)
@@ -38,8 +38,8 @@ void phantasm_rom_decode(running_machine &machine, const char *region)
void astyanax_rom_decode(running_machine &machine, const char *region)
{
- UINT16 *RAM = (UINT16 *) machine.region(region)->base();
- int i, size = machine.region(region)->bytes();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion(region)->base();
+ int i, size = machine.root_device().memregion(region)->bytes();
if (size > 0x40000) size = 0x40000;
for (i = 0 ; i < size/2 ; i++)
@@ -72,8 +72,8 @@ void astyanax_rom_decode(running_machine &machine, const char *region)
void rodland_rom_decode(running_machine &machine, const char *region)
{
- UINT16 *RAM = (UINT16 *) machine.region(region)->base();
- int i, size = machine.region(region)->bytes();
+ UINT16 *RAM = (UINT16 *) machine.root_device().memregion(region)->base();
+ int i, size = machine.root_device().memregion(region)->bytes();
if (size > 0x40000) size = 0x40000;
for (i = 0 ; i < size/2 ; i++)
@@ -125,8 +125,8 @@ void ms32_rearrange_sprites(running_machine &machine, const char *region)
UINT8 *result_data;
- source_data = machine.region ( region )->base();
- source_size = machine.region( region )->bytes();
+ source_data = machine.root_device().memregion ( region )->base();
+ source_size = machine.root_device().memregion( region )->bytes();
result_data = auto_alloc_array(machine, UINT8, source_size);
@@ -150,8 +150,8 @@ void decrypt_ms32_tx(running_machine &machine, int addr_xor,int data_xor, const
UINT8 *result_data;
- source_data = machine.region ( region )->base();
- source_size = machine.region( region )->bytes();
+ source_data = machine.root_device().memregion ( region )->base();
+ source_size = machine.root_device().memregion( region )->bytes();
result_data = auto_alloc_array(machine, UINT8, source_size);
@@ -204,8 +204,8 @@ void decrypt_ms32_bg(running_machine &machine, int addr_xor,int data_xor, const
UINT8 *result_data;
- source_data = machine.region ( region )->base();
- source_size = machine.region( region )->bytes();
+ source_data = machine.root_device().memregion ( region )->base();
+ source_size = machine.root_device().memregion( region )->bytes();
result_data = auto_alloc_array(machine, UINT8, source_size);
diff --git a/src/mame/machine/jumpshot.c b/src/mame/machine/jumpshot.c
index 744d895e5fa..0d0eb437cc7 100644
--- a/src/mame/machine/jumpshot.c
+++ b/src/mame/machine/jumpshot.c
@@ -46,7 +46,7 @@ void jumpshot_decode(running_machine &machine)
/* CPU ROMs */
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x4000; i++)
{
RAM[i] = decrypt(i,RAM[i]);
diff --git a/src/mame/machine/kabuki.c b/src/mame/machine/kabuki.c
index f200de06142..e95ce4f1478 100644
--- a/src/mame/machine/kabuki.c
+++ b/src/mame/machine/kabuki.c
@@ -162,9 +162,9 @@ static void kabuki_decode(UINT8 *src,UINT8 *dest_op,UINT8 *dest_data,
static void mitchell_decode(running_machine &machine, int swap_key1,int swap_key2,int addr_key,int xor_key)
{
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine, UINT8, machine.region("maincpu")->bytes());
- int numbanks = (machine.region("maincpu")->bytes() - 0x10000) / 0x4000;
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
+ UINT8 *decrypt = auto_alloc_array(machine, UINT8, machine.root_device().memregion("maincpu")->bytes());
+ int numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
int i;
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -204,7 +204,7 @@ static void cps1_decode(running_machine &machine,int swap_key1,int swap_key2,int
{
address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
kabuki_decode(rom,decrypt,rom,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c
index 4df66810436..dda5d5c8a73 100644
--- a/src/mame/machine/kaneko16.c
+++ b/src/mame/machine/kaneko16.c
@@ -1659,7 +1659,7 @@ static int calc3_decompress_table(running_machine& machine, int tabnum, UINT8* d
kaneko16_state *state = machine.driver_data<kaneko16_state>();
calc3_t &calc3 = state->m_calc3;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8* rom = machine.region("cpu1")->base();
+ UINT8* rom = state->memregion("cpu1")->base();
UINT8 numregions;
UINT16 length;
int local_counter=0;
@@ -1970,7 +1970,7 @@ DRIVER_INIT(calc3_scantables)
{
kaneko16_state *state = machine.driver_data<kaneko16_state>();
calc3_t &calc3 = state->m_calc3;
- UINT8* rom = machine.region("cpu1")->base();
+ UINT8* rom = state->memregion("cpu1")->base();
UINT8 numregions;
int x;
@@ -2283,7 +2283,7 @@ static const UINT8 toybox_mcu_decryption_table_alt[0x100] = {
DRIVER_INIT( decrypt_toybox_rom )
{
- UINT8 *src = (UINT8 *)machine.region("mcudata" )->base();
+ UINT8 *src = (UINT8 *)machine.root_device().memregion("mcudata" )->base();
int i;
@@ -2310,7 +2310,7 @@ DRIVER_INIT( decrypt_toybox_rom )
DRIVER_INIT( decrypt_toybox_rom_alt )
{
- UINT8 *src = (UINT8 *)machine.region("mcudata" )->base();
+ UINT8 *src = (UINT8 *)machine.root_device().memregion("mcudata" )->base();
int i;
@@ -2322,7 +2322,7 @@ DRIVER_INIT( decrypt_toybox_rom_alt )
void toxboy_handle_04_subcommand(running_machine& machine,UINT8 mcu_subcmd, UINT16*mcu_ram)
{
- UINT8 *src = (UINT8 *)machine.region("mcudata")->base()+0x10000;
+ UINT8 *src = (UINT8 *)machine.root_device().memregion("mcudata")->base()+0x10000;
UINT8* dst = (UINT8 *)mcu_ram;
int offs = (mcu_subcmd&0x3f)*8;
diff --git a/src/mame/machine/konami1.c b/src/mame/machine/konami1.c
index a7b5f39928c..caa810bb8e4 100644
--- a/src/mame/machine/konami1.c
+++ b/src/mame/machine/konami1.c
@@ -43,8 +43,8 @@ static UINT8 konami1_decodebyte( UINT8 opcode, UINT16 address )
UINT8 *konami1_decode(running_machine &machine, const char *cpu)
{
address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
- const UINT8 *rom = machine.region(cpu)->base();
- int size = machine.region(cpu)->bytes();
+ const UINT8 *rom = machine.root_device().memregion(cpu)->base();
+ int size = machine.root_device().memregion(cpu)->bytes();
int A;
UINT8 *decrypted = auto_alloc_array(machine, UINT8, size);
diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c
index 472b9dd5435..b29579d62f3 100644
--- a/src/mame/machine/leland.c
+++ b/src/mame/machine/leland.c
@@ -354,13 +354,13 @@ MACHINE_RESET( leland )
state->m_alternate_bank = 0;
/* initialize the master banks */
- state->m_master_length = machine.region("master")->bytes();
- state->m_master_base = machine.region("master")->base();
+ state->m_master_length = machine.root_device().memregion("master")->bytes();
+ state->m_master_base = machine.root_device().memregion("master")->base();
(*state->m_update_master_bank)(machine);
/* initialize the slave banks */
- state->m_slave_length = machine.region("slave")->bytes();
- state->m_slave_base = machine.region("slave")->base();
+ state->m_slave_length = machine.root_device().memregion("slave")->bytes();
+ state->m_slave_base = state->memregion("slave")->base();
if (state->m_slave_length > 0x10000)
state->membank("bank3")->set_base(&state->m_slave_base[0x10000]);
}
@@ -385,8 +385,8 @@ MACHINE_RESET( ataxx )
state->m_master_int_timer->adjust(machine.primary_screen->time_until_pos(8), 8);
/* initialize the XROM */
- state->m_xrom_length = machine.region("user1")->bytes();
- state->m_xrom_base = machine.region("user1")->base();
+ state->m_xrom_length = machine.root_device().memregion("user1")->bytes();
+ state->m_xrom_base = machine.root_device().memregion("user1")->base();
state->m_xrom1_addr = 0;
state->m_xrom2_addr = 0;
@@ -400,13 +400,13 @@ MACHINE_RESET( ataxx )
state->m_master_bank = 0;
/* initialize the master banks */
- state->m_master_length = machine.region("master")->bytes();
- state->m_master_base = machine.region("master")->base();
+ state->m_master_length = machine.root_device().memregion("master")->bytes();
+ state->m_master_base = machine.root_device().memregion("master")->base();
ataxx_bankswitch(machine);
/* initialize the slave banks */
- state->m_slave_length = machine.region("slave")->bytes();
- state->m_slave_base = machine.region("slave")->base();
+ state->m_slave_length = machine.root_device().memregion("slave")->bytes();
+ state->m_slave_base = state->memregion("slave")->base();
if (state->m_slave_length > 0x10000)
state->membank("bank3")->set_base(&state->m_slave_base[0x10000]);
}
@@ -1418,8 +1418,8 @@ READ8_MEMBER(leland_state::leland_raster_r)
void leland_rotate_memory(running_machine &machine, const char *cpuname)
{
int startaddr = 0x10000;
- int banks = (machine.region(cpuname)->bytes() - startaddr) / 0x8000;
- UINT8 *ram = machine.region(cpuname)->base();
+ int banks = (machine.root_device().memregion(cpuname)->bytes() - startaddr) / 0x8000;
+ UINT8 *ram = machine.root_device().memregion(cpuname)->base();
UINT8 temp[0x2000];
int i;
diff --git a/src/mame/machine/mc8123.c b/src/mame/machine/mc8123.c
index 7ac7a4dfd31..2b5e3f6fbab 100644
--- a/src/mame/machine/mc8123.c
+++ b/src/mame/machine/mc8123.c
@@ -381,8 +381,8 @@ void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *k
int fixed_length = numbanks == 1 ? 0xc000 : 0x8000;
UINT8 *decrypted1 = auto_alloc_array(machine, UINT8, fixed_length);
UINT8 *decrypted2 = numbanks > 1 ? auto_alloc_array(machine, UINT8, 0x4000 * numbanks) : 0;
- UINT8 *rom = machine.region(cpu)->base();
- UINT8 *key = machine.region(keyrgn)->base();
+ UINT8 *rom = machine.root_device().memregion(cpu)->base();
+ UINT8 *key = machine.root_device().memregion(keyrgn)->base();
int A, bank;
space->set_decrypted_region(0x0000, fixed_length-1, decrypted1);
diff --git a/src/mame/machine/md_cart.c b/src/mame/machine/md_cart.c
index 74f09cd284c..1b095438f8d 100644
--- a/src/mame/machine/md_cart.c
+++ b/src/mame/machine/md_cart.c
@@ -194,7 +194,7 @@ static int md_get_pcb_id(const char *pcb)
static WRITE16_HANDLER( genesis_ssf2_bank_w )
{
md_cons_state *state = space->machine().driver_data<md_cons_state>();
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
if ((state->m_md_cart.ssf2_lastoff != offset) || (state->m_md_cart.ssf2_lastdata != data))
{
@@ -325,7 +325,7 @@ static WRITE16_HANDLER( l3alt_bank_w )
{
case 0:
{
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
/* printf("%06x data %04x\n",activecpu_get_pc(), data); */
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN + (data & 0xffff) * 0x8000], 0x8000);
}
@@ -355,7 +355,7 @@ static WRITE16_HANDLER( realtec_400000_w )
md_cons_state *state = space->machine().driver_data<md_cons_state>();
int bankdata = (data >> 9) & 0x7;
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->m_md_cart.realtec_old_bank_addr = state->m_md_cart.realtec_bank_addr;
state->m_md_cart.realtec_bank_addr = (state->m_md_cart.realtec_bank_addr & 0x7) | bankdata << 3;
@@ -368,7 +368,7 @@ static WRITE16_HANDLER( realtec_404000_w )
{
md_cons_state *state = space->machine().driver_data<md_cons_state>();
int bankdata = (data >> 8) & 0x3;
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->m_md_cart.realtec_old_bank_addr = state->m_md_cart.realtec_bank_addr;
state->m_md_cart.realtec_bank_addr = (state->m_md_cart.realtec_bank_addr & 0xf8) | bankdata;
@@ -385,7 +385,7 @@ static WRITE16_HANDLER( realtec_404000_w )
*************************************/
static WRITE16_HANDLER( chifi3_bank_w )
{
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
if (data == 0xf100) // *hit player
{
@@ -489,7 +489,7 @@ static READ16_HANDLER( chifi3_prot_r )
*************************************/
static WRITE16_HANDLER( s19in1_bank )
{
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
memcpy(ROM + 0x000000, ROM + 0x400000 + ((offset << 1) * 0x10000), 0x80000);
}
@@ -498,7 +498,7 @@ static WRITE16_HANDLER( s19in1_bank )
*************************************/
static WRITE16_HANDLER( kaiju_bank_w )
{
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
memcpy(ROM + 0x000000, ROM + 0x400000 + (data & 0x7f) * 0x8000, 0x8000);
}
@@ -605,7 +605,7 @@ static READ16_HANDLER( kof99_A13000_r )
static READ16_HANDLER( radica_bank_select )
{
int bank = offset & 0x3f;
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
memcpy(ROM, ROM + 0x400000 + (bank * 0x10000), 0x400000);
return 0;
}
@@ -772,7 +772,7 @@ static READ16_HANDLER( topfig_6F5344_r ) // after char select
static WRITE16_HANDLER( topfig_bank_w )
{
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
if (data == 0x002a)
{
memcpy(ROM + 0x060000, ROM + 0x570000, 0x8000); // == 0x2e*0x8000?!
@@ -819,7 +819,7 @@ static READ16_HANDLER( topfig_645B44_r )
*************************************/
static WRITE16_HANDLER( mc_12in1_bank_w )
{
- UINT8 *ROM = space->machine().region("maincpu")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
logerror("offset %06x", offset << 17);
memcpy(ROM + 0x000000, ROM + VIRGIN_COPY_GEN + ((offset & 0x3f) << 17), 0x100000);
}
@@ -854,7 +854,7 @@ static READ16_HANDLER( genesis_sram_read )
return state->m_md_cart.sram[offset];
else
{
- ROM = space->machine().region("maincpu")->base();
+ ROM = state->memregion("maincpu")->base();
rom_offset = state->m_md_cart.sram_start + (offset << 1);
return (UINT16) ROM[rom_offset] | (ROM[rom_offset + 1] << 8);
@@ -1018,7 +1018,7 @@ static void setup_megadriv_custom_mappers(running_machine &machine)
{
md_cons_state *state = machine.driver_data<md_cons_state>();
UINT32 mirroraddr;
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
switch (state->m_md_cart.type)
{
@@ -1235,7 +1235,7 @@ static void setup_megadriv_custom_mappers(running_machine &machine)
you need to return 1 @ 0xa13002 and 0???1f @ 0xa1303E (it does word reads).
*/
- UINT16 *ROM16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
ROM16[0x0dd19e/2] = 0x47F8;
ROM16[0x0dd1a0/2] = 0xFFF0;
@@ -1254,7 +1254,7 @@ static void setup_megadriv_custom_mappers(running_machine &machine)
002476:6022
*/
- UINT16 *ROM16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
ROM16[0x06036/2] = 0xE000;
ROM16[0x02540/2] = 0x6026;
@@ -1274,7 +1274,7 @@ static void setup_megadriv_custom_mappers(running_machine &machine)
// ROM[0x01ED0/2] = 0xE000;
// ROM[0x02540/2] = 0xE000;
- UINT16 *ROM16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *ROM16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
ROM16[0x06036/2] = 0xE000;
}
@@ -1287,7 +1287,7 @@ static void setup_megadriv_sram(device_image_interface &image)
{
running_machine &machine = image.device().machine();
md_cons_state *state = machine.driver_data<md_cons_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
megadriv_backupram = NULL;
state->m_md_cart.sram = NULL;
state->m_md_cart.sram_start = state->m_md_cart.sram_end = 0;
@@ -1546,7 +1546,7 @@ static int megadrive_load_nonlist(device_image_interface &image)
#endif
// STEP 1: determine the file type (SMD? MD? BIN?)
- rawROM = image.device().machine().region("maincpu")->base();
+ rawROM = state->memregion("maincpu")->base();
ROM = rawROM /*+ 512 */;
state->m_md_cart.last_loaded_image_length = -1;
@@ -1881,7 +1881,7 @@ static DEVICE_IMAGE_DISPLAY_INFO(megadriv)
static int megadrive_load_list(device_image_interface &image)
{
md_cons_state *state = image.device().machine().driver_data<md_cons_state>();
- UINT8 *ROM = image.device().machine().region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT32 length = image.get_software_region_length("rom");
const char *pcb_name;
memcpy(ROM, image.get_software_region("rom"), length);
@@ -1975,15 +1975,15 @@ static DEVICE_IMAGE_LOAD( _32x_cart )
/* Copy the cart image in the locations the driver expects */
// Notice that, by using pick_integer, we are sure the code works on both LE and BE machines
- ROM16 = (UINT16 *) image.device().machine().region("gamecart")->base();
+ ROM16 = (UINT16 *) image.device().machine().root_device().memregion("gamecart")->base();
for (i = 0; i < length; i += 2)
ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
- ROM32 = (UINT32 *) image.device().machine().region("gamecart_sh2")->base();
+ ROM32 = (UINT32 *) image.device().machine().root_device().memregion("gamecart_sh2")->base();
for (i = 0; i < length; i += 4)
ROM32[i / 4] = pick_integer_be(temp_copy, i, 4);
- ROM16 = (UINT16 *) image.device().machine().region("maincpu")->base();
+ ROM16 = (UINT16 *) image.device().machine().root_device().memregion("maincpu")->base();
for (i = 0x00; i < length; i += 2)
ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c
index 8c36a251bd2..6f023e875f5 100644
--- a/src/mame/machine/megadriv.c
+++ b/src/mame/machine/megadriv.c
@@ -2560,7 +2560,7 @@ static WRITE16_HANDLER( _32x_68k_a15106_w )
// install the game rom in the normal 0x000000-0x03fffff space used by the genesis - this allows VDP DMA operations to work as they have to be from this area or RAM
// it should also UNMAP the banked rom area...
- space->install_rom(0x0000100, 0x03fffff, space->machine().region("gamecart")->base() + 0x100);
+ space->install_rom(0x0000100, 0x03fffff, space->machine().root_device().memregion("gamecart")->base() + 0x100);
}
else
{
@@ -2568,7 +2568,7 @@ static WRITE16_HANDLER( _32x_68k_a15106_w )
// this is actually blank / nop area
// we should also map the banked area back (we don't currently unmap it tho)
- space->install_rom(0x0000100, 0x03fffff, space->machine().region("maincpu")->base()+0x100);
+ space->install_rom(0x0000100, 0x03fffff, space->machine().root_device().memregion("maincpu")->base()+0x100);
}
if((a15106_reg & 4) == 0) // clears the FIFO state
@@ -2860,12 +2860,12 @@ static WRITE16_HANDLER( _32x_68k_a15100_w )
if (data & 0x01)
{
_32x_adapter_enabled = 1;
- space->install_rom(0x0880000, 0x08fffff, space->machine().region("gamecart")->base()); // 'fixed' 512kb rom bank
+ space->install_rom(0x0880000, 0x08fffff, space->machine().root_device().memregion("gamecart")->base()); // 'fixed' 512kb rom bank
space->install_read_bank(0x0900000, 0x09fffff, "bank12"); // 'bankable' 1024kb rom bank
- space->machine().root_device().membank("bank12")->set_base(space->machine().region("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
+ space->machine().root_device().membank("bank12")->set_base(space->machine().root_device().memregion("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
- space->install_rom(0x0000000, 0x03fffff, space->machine().region("32x_68k_bios")->base());
+ space->install_rom(0x0000000, 0x03fffff, space->machine().root_device().memregion("32x_68k_bios")->base());
/* VDP area */
space->install_legacy_readwrite_handler(0x0a15180, 0x0a1518b, FUNC(_32x_common_vdp_regs_r), FUNC(_32x_common_vdp_regs_w)); // common / shared VDP regs
@@ -2881,7 +2881,7 @@ static WRITE16_HANDLER( _32x_68k_a15100_w )
{
_32x_adapter_enabled = 0;
- space->install_rom(0x0000000, 0x03fffff, space->machine().region("gamecart")->base());
+ space->install_rom(0x0000000, 0x03fffff, space->machine().root_device().memregion("gamecart")->base());
space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
}
}
@@ -2949,7 +2949,7 @@ static WRITE16_HANDLER( _32x_68k_a15104_w )
_32x_68k_a15104_reg = (_32x_68k_a15104_reg & 0x00ff) | (data & 0xff00);
}
- space->machine().root_device().membank("bank12")->set_base(space->machine().region("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
+ space->machine().root_device().membank("bank12")->set_base(space->machine().root_device().memregion("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
}
/**********************************************************************************************/
@@ -6922,7 +6922,7 @@ static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
int addr = state->m_pmac_read[reg]&0xffff;
if ((mode & 0xfff0) == 0x0800) // ROM, inc 1, verified to be correct
{
- UINT16 *ROM = (UINT16 *) space->machine().region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) space->machine().root_device().memregion("maincpu")->base();
state->m_pmac_read[reg] += 1;
d = ROM[addr|((mode&0xf)<<16)];
}
@@ -7175,7 +7175,7 @@ static void svp_init(running_machine &machine)
state->m_iram = auto_alloc_array(machine, UINT8, 0x800);
state->membank("bank3")->set_base(state->m_iram);
/* SVP ROM just shares m68k region.. */
- ROM = machine.region("maincpu")->base();
+ ROM = state->memregion("maincpu")->base();
state->membank("bank4")->set_base(ROM + 0x800);
megadrive_io_read_data_port_ptr = megadrive_io_read_data_port_svp;
@@ -9933,7 +9933,7 @@ static void megadriv_init_common(running_machine &machine)
some games specify a single address, (start 200001, end 200001)
this usually means there is serial eeprom instead */
int i;
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
mame_printf_debug("DEBUG:: Header: Backup RAM string (ignore for games without)\n");
for (i=0;i<12;i++)
@@ -10093,7 +10093,7 @@ DRIVER_INIT( _32x )
if (_32x_adapter_enabled == 0)
{
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_rom(0x0000000, 0x03fffff, machine.region("gamecart")->base());
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_rom(0x0000000, 0x03fffff, machine.root_device().memregion("gamecart")->base());
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
};
diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c
index a708a0a5001..618c6e518a9 100644
--- a/src/mame/machine/mhavoc.c
+++ b/src/mame/machine/mhavoc.c
@@ -89,7 +89,7 @@ MACHINE_RESET( mhavoc )
state->membank("bank1")->configure_entry(0, state->m_zram0);
state->membank("bank1")->configure_entry(1, state->m_zram1);
- state->membank("bank2")->configure_entries(0, 4, machine.region("alpha")->base() + 0x10000, 0x2000);
+ state->membank("bank2")->configure_entries(0, 4, state->memregion("alpha")->base() + 0x10000, 0x2000);
/* reset RAM/ROM banks to 0 */
state->mhavoc_ram_banksel_w(*space, 0, 0);
diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c
index d599405fb83..1d29b7e2aa2 100644
--- a/src/mame/machine/micro3d.c
+++ b/src/mame/machine/micro3d.c
@@ -320,7 +320,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
case 0x08:
{
int i;
- const UINT16 *rom = (UINT16*)machine().region("vertex")->base();
+ const UINT16 *rom = (UINT16*)machine().root_device().memregion("vertex")->base();
for (i = 0; i <= cnt; ++i)
{
@@ -359,7 +359,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
case 0x0c:
{
int i;
- const UINT16 *rom = (UINT16*)machine().region("vertex")->base();
+ const UINT16 *rom = (UINT16*)machine().root_device().memregion("vertex")->base();
for (i = 0; i <= cnt; ++i)
{
@@ -392,7 +392,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
case 0x0f:
{
int i;
- const UINT16 *rom = (UINT16*)machine().region("vertex")->base();
+ const UINT16 *rom = (UINT16*)machine().root_device().memregion("vertex")->base();
for (i = 0; i <= cnt; ++i, vtx_addr += 4)
{
diff --git a/src/mame/machine/midtunit.c b/src/mame/machine/midtunit.c
index d8dedc242b6..aa19ec1b0c9 100644
--- a/src/mame/machine/midtunit.c
+++ b/src/mame/machine/midtunit.c
@@ -417,7 +417,7 @@ static void init_tunit_generic(running_machine &machine, int sound)
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- base = machine.region("gfx1")->base();
+ base = machine.root_device().memregion("gfx1")->base();
for (i = 0; i < midtunit_gfx_rom_size; i += 4)
{
midtunit_gfx_rom[i + 0] = base[0 * gfx_chunk + i / 4];
diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c
index 6fee9727134..0404308129f 100644
--- a/src/mame/machine/midwunit.c
+++ b/src/mame/machine/midwunit.c
@@ -156,8 +156,8 @@ static void init_wunit_generic(running_machine &machine)
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- midtunit_gfx_rom = base = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ midtunit_gfx_rom = base = machine.root_device().memregion("gfx1")->base();
+ len = state->memregion("gfx1")->bytes();
for (i = 0; i < len / 0x400000; i++)
{
memcpy(state->m_decode_memory, base, 0x400000);
diff --git a/src/mame/machine/midxunit.c b/src/mame/machine/midxunit.c
index 1483255172f..07ae50a7931 100644
--- a/src/mame/machine/midxunit.c
+++ b/src/mame/machine/midxunit.c
@@ -299,8 +299,8 @@ DRIVER_INIT( revx )
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- midtunit_gfx_rom = base = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ midtunit_gfx_rom = base = machine.root_device().memregion("gfx1")->base();
+ len = state->memregion("gfx1")->bytes();
for (i = 0; i < len / 0x200000; i++)
{
memcpy(state->m_decode_memory, base, 0x200000);
diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c
index 0c56cd56ace..76c7347a7a9 100644
--- a/src/mame/machine/midyunit.c
+++ b/src/mame/machine/midyunit.c
@@ -250,7 +250,7 @@ static void init_generic(running_machine &machine, int bpp, int sound, int prot_
int i;
/* load graphics ROMs */
- base = machine.region("gfx1")->base();
+ base = state->memregion("gfx1")->base();
switch (bpp)
{
case 4:
@@ -298,7 +298,7 @@ static void init_generic(running_machine &machine, int bpp, int sound, int prot_
{
case SOUND_CVSD_SMALL:
machine.device("cvsd:cpu")->memory().space(AS_PROGRAM)->install_write_handler(prot_start, prot_end, write8_delegate(FUNC(midyunit_state::cvsd_protection_w),state));
- state->m_cvsd_protection_base = machine.region("cvsdcpu")->base() + 0x10000 + (prot_start - 0x8000);
+ state->m_cvsd_protection_base = machine.root_device().memregion("cvsdcpu")->base() + 0x10000 + (prot_start - 0x8000);
break;
case SOUND_CVSD:
diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c
index 9f43a3731b7..94e7c5112d6 100644
--- a/src/mame/machine/model1.c
+++ b/src/mame/machine/model1.c
@@ -495,7 +495,7 @@ static TGP_FUNCTION( matrix_rotz )
static TGP_FUNCTION( track_read_quad )
{
model1_state *state = machine.driver_data<model1_state>();
- const UINT32 *tgp_data = (const UINT32 *)machine.region("user2")->base();
+ const UINT32 *tgp_data = (const UINT32 *)state->memregion("user2")->base();
UINT32 a = fifoin_pop(state);
int offd;
@@ -885,7 +885,7 @@ static TGP_FUNCTION( f47 )
static TGP_FUNCTION( track_read_info )
{
model1_state *state = machine.driver_data<model1_state>();
- const UINT32 *tgp_data = (const UINT32 *)machine.region("user2")->base();
+ const UINT32 *tgp_data = (const UINT32 *)state->memregion("user2")->base();
UINT16 a = fifoin_pop(state);
int offd;
@@ -1039,7 +1039,7 @@ static void tri_calc_pq(float ax, float ay, float bx, float by, float cx, float
static TGP_FUNCTION( track_lookup )
{
model1_state *state = machine.driver_data<model1_state>();
- const UINT32 *tgp_data = (const UINT32 *)machine.region("user2")->base();
+ const UINT32 *tgp_data = (const UINT32 *)state->memregion("user2")->base();
float a = fifoin_pop_f(state);
UINT32 b = fifoin_pop(state);
float c = fifoin_pop_f(state);
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index ea44d6574c2..867160a075d 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -71,7 +71,7 @@ void n64_periphs::device_start()
void n64_periphs::device_reset()
{
- UINT32 *cart = (UINT32*)machine().region("user2")->base();
+ UINT32 *cart = (UINT32*)machine().root_device().memregion("user2")->base();
maincpu = machine().device("maincpu");
rspcpu = machine().device("rsp");
@@ -1412,7 +1412,7 @@ static TIMER_CALLBACK(pi_dma_callback)
void n64_periphs::pi_dma_tick()
{
- UINT16 *cart16 = (UINT16*)machine().region("user2")->base();
+ UINT16 *cart16 = (UINT16*)machine().root_device().memregion("user2")->base();
UINT16 *dram16 = (UINT16*)rdram;
UINT32 cart_addr = (pi_cart_addr & 0x0fffffff) >> 1;
@@ -1425,12 +1425,12 @@ void n64_periphs::pi_dma_tick()
}
else if((cart_addr & 0x03000000) == 0x03000000 && dd_present)
{
- cart16 = (UINT16*)machine().region("ddipl")->base();
+ cart16 = (UINT16*)machine().root_device().memregion("ddipl")->base();
cart_addr = (pi_cart_addr & 0x003fffff) >> 1;
}
else
{
- cart_addr &= ((machine().region("user2")->bytes() >> 1) - 1);
+ cart_addr &= ((machine().root_device().memregion("user2")->bytes() >> 1) - 1);
}
//printf("%08x Cart, %08x Dram\n", cart_addr << 1, dram_addr << 1); fflush(stdout);
diff --git a/src/mame/machine/namcond1.c b/src/mame/machine/namcond1.c
index f75c75e54e1..6530ebfd6e6 100644
--- a/src/mame/machine/namcond1.c
+++ b/src/mame/machine/namcond1.c
@@ -27,7 +27,7 @@ MACHINE_RESET( namcond1 )
{
namcond1_state *state = machine.driver_data<namcond1_state>();
#ifdef MAME_DEBUG
- /*UINT8 *ROM = machine.region(REGION_CPU1)->base();*/
+ /*UINT8 *ROM = state->memregion(REGION_CPU1)->base();*/
/*UINT32 debug_trigger_addr;*/
/*int i;*/
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index 82c31c54186..86bc12c9506 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -554,7 +554,7 @@ static WRITE8_HANDLER( key_type3_w )
WRITE8_MEMBER(namcos1_state::namcos1_sound_bankswitch_w)
{
- UINT8 *rom = machine().region("audiocpu")->base() + 0xc000;
+ UINT8 *rom = memregion("audiocpu")->base() + 0xc000;
int bank = (data & 0x70) >> 4;
membank("bank17")->set_base(rom + 0x4000 * bank);
@@ -826,7 +826,7 @@ static void namcos1_build_banks(running_machine &machine,read8_space_func key_r,
/* PRG0-PRG7 */
{
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("user1")->base();
namcos1_install_bank(state,0x200,0x3ff,0,rom_w,0,rom);
@@ -920,7 +920,7 @@ WRITE8_MEMBER(namcos1_state::namcos1_mcu_bankswitch_w)
/* bit 0-1 : address line A15-A16 */
addr += (data & 3) * 0x8000;
- membank("bank20")->set_base(machine().region("mcu")->base() + addr);
+ membank("bank20")->set_base(machine().root_device().memregion("mcu")->base() + addr);
}
@@ -1126,7 +1126,7 @@ DRIVER_INIT( bakutotu )
static const UINT8 target[8] = {0x34,0x37,0x35,0x37,0x96,0x00,0x2e,0xed};
UINT8 *rombase, *srcptr, *endptr, *scanptr;
- rombase = machine.region("user1")->base();
+ rombase = machine.root_device().memregion("user1")->base();
srcptr = rombase + 0x1e000;
endptr = srcptr + 0xa000;
diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c
index ba9cb9f6d17..a2af5e69b8c 100644
--- a/src/mame/machine/namcos2.c
+++ b/src/mame/machine/namcos2.c
@@ -154,7 +154,7 @@ READ16_HANDLER( namcos2_68k_eeprom_r ){
/* 68000 Shared memory area - Data ROM area */
/*************************************************************/
READ16_HANDLER( namcos2_68k_data_rom_r ){
- UINT16 *ROM = (UINT16 *)space->machine().region("user1")->base();
+ UINT16 *ROM = (UINT16 *)space->machine().root_device().memregion("user1")->base();
return ROM[offset];
}
@@ -709,8 +709,8 @@ INTERRUPT_GEN( namcos2_68k_gpu_vblank )
WRITE8_HANDLER( namcos2_sound_bankselect_w )
{
- UINT8 *RAM=space->machine().region("audiocpu")->base();
- UINT32 max = (space->machine().region("audiocpu")->bytes() - 0x10000) / 0x4000;
+ UINT8 *RAM=space->machine().root_device().memregion("audiocpu")->base();
+ UINT32 max = (space->machine().root_device().memregion("audiocpu")->bytes() - 0x10000) / 0x4000;
int bank = ( data >> 4 ) % max; /* 991104.CAB */
space->machine().root_device().membank(BANKED_SOUND_ROM)->set_base(&RAM[ 0x10000 + ( 0x4000 * bank ) ] );
}
diff --git a/src/mame/machine/naomi.c b/src/mame/machine/naomi.c
index 4257cd7a6b7..863c82f9237 100644
--- a/src/mame/machine/naomi.c
+++ b/src/mame/machine/naomi.c
@@ -87,9 +87,9 @@ static UINT8 asciihex_to_dec(UINT8 in)
static void create_pic_from_retdat(running_machine& machine)
{
{
- UINT8* hexregion = machine.region("pichex")->base();
- UINT8* retregion = machine.region("picreturn")->base();
- UINT8* newregion = machine.region("pic")->base();
+ UINT8* hexregion = machine.root_device().memregion("pichex")->base();
+ UINT8* retregion = machine.root_device().memregion("picreturn")->base();
+ UINT8* newregion = machine.root_device().memregion("pic")->base();
int outcount = 0;
if (hexregion && retregion && newregion)
diff --git a/src/mame/machine/naomigd.c b/src/mame/machine/naomigd.c
index 200b95c8bcc..6b688ba502e 100644
--- a/src/mame/machine/naomigd.c
+++ b/src/mame/machine/naomigd.c
@@ -394,10 +394,10 @@ void naomi_gdrom_board::device_start()
UINT64 key;
- const UINT8 *picdata = machine().region(pic_tag)->base();
+ const UINT8 *picdata = memregion(pic_tag)->base();
if(picdata) {
- if(machine().region(pic_tag)->bytes() >= 0x4000) {
+ if(machine().root_device().memregion(pic_tag)->bytes() >= 0x4000) {
printf("Real PIC binary found\n");
for(int i=0;i<7;i++)
name[i] = picdata[0x7c0+i*2];
diff --git a/src/mame/machine/naomim1.c b/src/mame/machine/naomim1.c
index 5ee80cc62bd..16d2389d032 100644
--- a/src/mame/machine/naomim1.c
+++ b/src/mame/machine/naomim1.c
@@ -31,7 +31,7 @@ void naomi_m1_board::device_start()
{
naomi_board::device_start();
- const UINT8 *key_data = machine().region(key_tag)->base();
+ const UINT8 *key_data = memregion(key_tag)->base();
key = (key_data[0] << 24) | (key_data[1] << 16) | (key_data[2] << 8) | key_data[3];
buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
diff --git a/src/mame/machine/naomim2.c b/src/mame/machine/naomim2.c
index fd7328010a9..7f2bf4f4bc5 100644
--- a/src/mame/machine/naomim2.c
+++ b/src/mame/machine/naomim2.c
@@ -20,7 +20,7 @@ void naomi_m2_board::device_start()
{
naomi_board::device_start();
- const UINT8 *key_data = machine().region(key_tag)->base();
+ const UINT8 *key_data = memregion(key_tag)->base();
key = (key_data[0] << 24) | (key_data[1] << 16) | (key_data[2] << 8) | key_data[3];
ram = auto_alloc_array(machine(), UINT8, RAM_SIZE);
diff --git a/src/mame/machine/naomim4.c b/src/mame/machine/naomim4.c
index 640f4938e7a..4f3dee94034 100644
--- a/src/mame/machine/naomim4.c
+++ b/src/mame/machine/naomim4.c
@@ -45,7 +45,7 @@ void naomi_m4_board::device_start()
{
naomi_board::device_start();
- const UINT8 *key_data = machine().region(key_tag)->base();
+ const UINT8 *key_data = memregion(key_tag)->base();
key = (key_data[2] << 8) | key_data[3];
iv = (key_data[0] << 8) | key_data[1];
buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
diff --git a/src/mame/machine/nb1413m3.c b/src/mame/machine/nb1413m3.c
index b126367ebb4..ab41650eba0 100644
--- a/src/mame/machine/nb1413m3.c
+++ b/src/mame/machine/nb1413m3.c
@@ -298,8 +298,8 @@ READ8_HANDLER( nb1413m3_sndrom_r )
popmessage("Sound ROM %02X:%05X [B1:%02X B2:%02X]", rombank, offset, nb1413m3_sndrombank1, nb1413m3_sndrombank2);
#endif
- if (offset < space->machine().region(nb1413m3_sndromrgntag)->bytes())
- return space->machine().region(nb1413m3_sndromrgntag)->base()[offset];
+ if (offset < space->machine().root_device().memregion(nb1413m3_sndromrgntag)->bytes())
+ return space->machine().root_device().memregion(nb1413m3_sndromrgntag)->base()[offset];
else
{
popmessage("read past sound ROM length (%05x[%02X])",offset, rombank);
@@ -322,7 +322,7 @@ WRITE8_HANDLER( nb1413m3_sndrombank2_w )
READ8_HANDLER( nb1413m3_gfxrom_r )
{
- UINT8 *GFXROM = space->machine().region("gfx1")->base();
+ UINT8 *GFXROM = space->machine().root_device().memregion("gfx1")->base();
return GFXROM[(0x20000 * (nb1413m3_gfxrombank | ((nb1413m3_sndrombank1 & 0x02) << 3))) + ((0x0200 * nb1413m3_gfxradr_h) + (0x0002 * nb1413m3_gfxradr_l)) + (offset & 0x01)];
}
diff --git a/src/mame/machine/nb1414m4.c b/src/mame/machine/nb1414m4.c
index 6f9b98b5b5a..5f59bf00707 100644
--- a/src/mame/machine/nb1414m4.c
+++ b/src/mame/machine/nb1414m4.c
@@ -31,7 +31,7 @@ Notes:
static void nichibutsu_1414m4_dma(address_space *space,UINT16 src,UINT16 dst,UINT16 size, UINT8 condition,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().region("blit_data")->base();
+ UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
int i;
for(i=0;i<size;i++)
@@ -61,7 +61,7 @@ static void nichibutsu_1414m4_fill(address_space *space,UINT16 dst,UINT8 tile,UI
static void insert_coin_msg(address_space *space,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().region("blit_data")->base();
+ UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
int credit_count = (vram[0xf] & 0xff);
UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
UINT16 dst;
@@ -82,7 +82,7 @@ static void insert_coin_msg(address_space *space,UINT8 *vram)
static void credit_msg(address_space *space,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().region("blit_data")->base();
+ UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
int credit_count = (vram[0xf] & 0xff);
UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
UINT16 dst;
@@ -112,7 +112,7 @@ static void kozure_score_msg(address_space *space,UINT16 dst,UINT8 src_base,UINT
int i;
UINT8 first_digit;
UINT8 res;
- UINT8 * data = (UINT8 *)space->machine().region("blit_data")->base();
+ UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
first_digit = 0;
@@ -140,7 +140,7 @@ static void kozure_score_msg(address_space *space,UINT16 dst,UINT8 src_base,UINT
static void nichibutsu_1414m4_0200(address_space *space, UINT16 mcu_cmd,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().region("blit_data")->base();
+ UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
UINT16 dst;
dst = (data[0x330+((mcu_cmd & 0xf)*2)]<<8)|(data[0x331+((mcu_cmd & 0xf)*2)]&0xff);
@@ -185,7 +185,7 @@ static void nichibutsu_1414m4_0200(address_space *space, UINT16 mcu_cmd,UINT8 *v
*/
static void nichibutsu_1414m4_0600(address_space *space, UINT8 is2p,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().region("blit_data")->base();
+ UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
UINT16 dst;
int i;
@@ -241,7 +241,7 @@ static void nichibutsu_1414m4_0600(address_space *space, UINT8 is2p,UINT8 *vram)
static void nichibutsu_1414m4_0e00(address_space *space,UINT16 mcu_cmd,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().region("blit_data")->base();
+ UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
UINT16 dst;
dst = ((data[0xdf]<<8)|(data[0xe0]&0xff)) & 0x3fff;
diff --git a/src/mame/machine/neoboot.c b/src/mame/machine/neoboot.c
index 8f7453c7468..a75bf4b9f21 100644
--- a/src/mame/machine/neoboot.c
+++ b/src/mame/machine/neoboot.c
@@ -22,8 +22,8 @@
void neogeo_bootleg_cx_decrypt( running_machine &machine )
{
int i;
- int cx_size = machine.region( "sprites" )->bytes();
- UINT8 *rom = machine.region( "sprites" )->base();
+ int cx_size = machine.root_device().memregion( "sprites" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "sprites" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, cx_size );
memcpy( buf, rom, cx_size );
@@ -38,8 +38,8 @@ void neogeo_bootleg_cx_decrypt( running_machine &machine )
void neogeo_bootleg_sx_decrypt( running_machine &machine, int value )
{
- int sx_size = machine.region( "fixed" )->bytes();
- UINT8 *rom = machine.region( "fixed" )->base();
+ int sx_size = machine.root_device().memregion( "fixed" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "fixed" )->base();
int i;
if (value == 1)
@@ -71,9 +71,9 @@ void neogeo_bootleg_sx_decrypt( running_machine &machine, int value )
void kog_px_decrypt( running_machine &machine )
{
/* the protection chip does some *very* strange things to the rom */
- UINT8 *src = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x600000 );
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int i;
static const int sec[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };
@@ -155,10 +155,10 @@ static READ16_HANDLER( kof10th_RAMB_r )
static WRITE16_HANDLER( kof10th_custom_w )
{
if (!kof10thExtraRAMB[0xFFE]) { // Write to RAM bank A
- UINT16 *prom = (UINT16*)space->machine().region( "maincpu" )->base();
+ UINT16 *prom = (UINT16*)space->machine().root_device().memregion( "maincpu" )->base();
COMBINE_DATA(&prom[(0xE0000/2) + (offset & 0xFFFF)]);
} else { // Write S data on-the-fly
- UINT8 *srom = space->machine().region( "fixed" )->base();
+ UINT8 *srom = space->machine().root_device().memregion( "fixed" )->base();
srom[offset] = BITSWAP8(data,7,6,0,4,3,2,1,5);
}
}
@@ -169,7 +169,7 @@ static WRITE16_HANDLER( kof10th_bankswitch_w )
if (offset == 0x5FFF8) { // Standard bankswitch
kof10thBankswitch(space, data);
} else if (offset == 0x5FFFC && kof10thExtraRAMB[0xFFC] != data) { // Special bankswitch
- UINT8 *src = space->machine().region( "maincpu" )->base();
+ UINT8 *src = space->machine().root_device().memregion( "maincpu" )->base();
memcpy (src + 0x10000, src + ((data & 1) ? 0x810000 : 0x710000), 0xcffff);
}
COMBINE_DATA(&kof10thExtraRAMB[offset & 0xFFF]);
@@ -187,7 +187,7 @@ void decrypt_kof10th(running_machine &machine)
{
int i, j;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x900000);
- UINT8 *src = machine.region( "maincpu" )->base();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
memcpy(dst + 0x000000, src + 0x700000, 0x100000); // Correct (Verified in Uni-bios)
memcpy(dst + 0x100000, src + 0x000000, 0x800000);
@@ -215,10 +215,10 @@ void decrypt_kof10th(running_machine &machine)
void decrypt_kf10thep(running_machine &machine)
{
int i;
- UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
- UINT8 *src = machine.region("maincpu")->base();
- UINT16 *buf = (UINT16*)machine.region("audiocrypt")->base();
- UINT8 *srom = (UINT8*)machine.region("fixed")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
+ UINT16 *buf = (UINT16*)machine.root_device().memregion("audiocrypt")->base();
+ UINT8 *srom = (UINT8*)machine.root_device().memregion("fixed")->base();
UINT8 *sbuf = auto_alloc_array(machine, UINT8, 0x20000);
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x200000);
@@ -256,7 +256,7 @@ void decrypt_kf10thep(running_machine &machine)
static void kf2k5uni_px_decrypt( running_machine &machine )
{
int i, j, ofst;
- UINT8 *src = machine.region( "maincpu" )->base();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x80);
for (i = 0; i < 0x800000; i+=0x80)
@@ -276,7 +276,7 @@ static void kf2k5uni_px_decrypt( running_machine &machine )
static void kf2k5uni_sx_decrypt( running_machine &machine )
{
int i;
- UINT8 *srom = machine.region( "fixed" )->base();
+ UINT8 *srom = machine.root_device().memregion( "fixed" )->base();
for (i = 0; i < 0x20000; i++)
srom[i] = BITSWAP8(srom[i], 4, 5, 6, 7, 0, 1, 2, 3);
@@ -285,7 +285,7 @@ static void kf2k5uni_sx_decrypt( running_machine &machine )
static void kf2k5uni_mx_decrypt( running_machine &machine )
{
int i;
- UINT8 *mrom = machine.region( "audiocpu" )->base();
+ UINT8 *mrom = machine.root_device().memregion( "audiocpu" )->base();
for (i = 0; i < 0x30000; i++)
mrom[i] = BITSWAP8(mrom[i], 4, 5, 6, 7, 0, 1, 2, 3);
@@ -343,7 +343,7 @@ void kf2k2mp_decrypt( running_machine &machine )
{
int i,j;
- UINT8 *src = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x80);
memmove(src, src + 0x300000, 0x500000);
@@ -366,7 +366,7 @@ void kf2k2mp_decrypt( running_machine &machine )
void kf2k2mp2_px_decrypt( running_machine &machine )
{
- UINT8 *src = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x600000);
memcpy (dst + 0x000000, src + 0x1C0000, 0x040000);
@@ -388,7 +388,7 @@ static void cthd2003_neogeo_gfx_address_fix_do(running_machine &machine, int sta
int tilesize=128;
UINT8* rom = auto_alloc_array(machine, UINT8, 16*tilesize); // 16 tiles buffer
- UINT8* realrom = machine.region("sprites")->base() + start*tilesize;
+ UINT8* realrom = machine.root_device().memregion("sprites")->base() + start*tilesize;
for (i = 0; i < (end-start)/16; i++) {
for (j = 0; j < 16; j++) {
@@ -441,7 +441,7 @@ static void cthd2003_c(running_machine &machine, int pow)
void decrypt_cthd2003( running_machine &machine )
{
- UINT8 *romdata = machine.region("fixed")->base();
+ UINT8 *romdata = machine.root_device().memregion("fixed")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
@@ -450,7 +450,7 @@ void decrypt_cthd2003( running_machine &machine )
memcpy(tmp+8*96*128, romdata+8*96*128, 8*32*128);
memcpy(romdata, tmp, 8*128*128);
- romdata = machine.region("audiocpu")->base()+0x10000;
+ romdata = machine.root_device().memregion("audiocpu")->base()+0x10000;
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
memcpy(tmp+8*64*128, romdata+8*32*128, 8*32*128);
@@ -482,7 +482,7 @@ void patch_cthd2003( running_machine &machine )
{
/* patches thanks to razoola */
int i;
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
/* special ROM banking handler */
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ffff0, 0x2fffff, FUNC(cthd2003_bankswitch_w));
@@ -525,8 +525,8 @@ void patch_cthd2003( running_machine &machine )
static void ct2k3sp_sx_decrypt( running_machine &machine )
{
- int rom_size = machine.region( "fixed" )->bytes();
- UINT8 *rom = machine.region( "fixed" )->base();
+ int rom_size = machine.root_device().memregion( "fixed" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "fixed" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
int i;
int ofst;
@@ -555,7 +555,7 @@ static void ct2k3sp_sx_decrypt( running_machine &machine )
void decrypt_ct2k3sp( running_machine &machine )
{
- UINT8 *romdata = machine.region("audiocpu")->base()+0x10000;
+ UINT8 *romdata = machine.root_device().memregion("audiocpu")->base()+0x10000;
UINT8*tmp = auto_alloc_array(machine, UINT8, 8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
@@ -575,7 +575,7 @@ void decrypt_ct2k3sp( running_machine &machine )
void decrypt_ct2k3sa( running_machine &machine )
{
- UINT8 *romdata = machine.region("audiocpu")->base()+0x10000;
+ UINT8 *romdata = machine.root_device().memregion("audiocpu")->base()+0x10000;
UINT8*tmp = auto_alloc_array(machine, UINT8, 8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
@@ -592,7 +592,7 @@ void patch_ct2k3sa( running_machine &machine )
{
/* patches thanks to razoola - same as for cthd2003*/
int i;
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
// theres still a problem on the character select screen but it seems to be related to cpu core timing issues,
// overclocking the 68k prevents it.
@@ -633,7 +633,7 @@ void patch_ct2k3sa( running_machine &machine )
void decrypt_kof2k4se_68k( running_machine &machine )
{
- UINT8 *src = machine.region("maincpu")->base()+0x100000;
+ UINT8 *src = machine.root_device().memregion("maincpu")->base()+0x100000;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x400000);
int i;
static const int sec[] = {0x300000,0x200000,0x100000,0x000000};
@@ -653,7 +653,7 @@ void decrypt_kof2k4se_68k( running_machine &machine )
void lans2004_vx_decrypt( running_machine &machine )
{
int i;
- UINT8 *rom = machine.region( "ymsnd" )->base();
+ UINT8 *rom = machine.root_device().memregion( "ymsnd" )->base();
for (i = 0; i < 0xA00000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 5, 4, 3, 2, 6, 7);
}
@@ -662,8 +662,8 @@ void lans2004_decrypt_68k( running_machine &machine )
{
/* Descrambling P ROMs - Thanks to Razoola for the info */
int i;
- UINT8 *src = machine.region( "maincpu" )->base();
- UINT16 *rom = (UINT16*)machine.region( "maincpu" )->base();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x600000);
{
@@ -742,8 +742,8 @@ void svcboot_px_decrypt( running_machine &machine )
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
int i;
- int size = machine.region( "maincpu" )->bytes();
- UINT8 *src = machine.region( "maincpu" )->base();
+ int size = machine.root_device().memregion( "maincpu" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int ofst;
for( i = 0; i < size / 0x100000; i++ ){
@@ -771,8 +771,8 @@ void svcboot_cx_decrypt( running_machine &machine )
{ 3, 0, 2, 1 },
};
int i;
- int size = machine.region( "sprites" )->bytes();
- UINT8 *src = machine.region( "sprites" )->base();
+ int size = machine.root_device().memregion( "sprites" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "sprites" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int ofst;
memcpy( dst, src, size );
@@ -798,8 +798,8 @@ void svcplus_px_decrypt( running_machine &machine )
static const int sec[] = {
0x00, 0x03, 0x02, 0x05, 0x04, 0x01
};
- int size = machine.region( "maincpu" )->bytes();
- UINT8 *src = machine.region( "maincpu" )->base();
+ int size = machine.root_device().memregion( "maincpu" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int i;
int ofst;
@@ -822,7 +822,7 @@ void svcplus_px_decrypt( running_machine &machine )
void svcplus_px_hack( running_machine &machine )
{
/* patched by the protection chip? */
- UINT8 *src = machine.region( "maincpu" )->base();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
src[ 0x0f8010 ] = 0x40;
src[ 0x0f8011 ] = 0x04;
src[ 0x0f8012 ] = 0x00;
@@ -843,8 +843,8 @@ void svcplusa_px_decrypt( running_machine &machine )
static const int sec[] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
- int size = machine.region( "maincpu" )->bytes();
- UINT8 *src = machine.region( "maincpu" )->base();
+ int size = machine.root_device().memregion( "maincpu" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
memcpy( dst, src, size );
for( i = 0; i < 6; i++ ){
@@ -862,8 +862,8 @@ void svcsplus_px_decrypt( running_machine &machine )
static const int sec[] = {
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
- int size = machine.region( "maincpu" )->bytes();
- UINT8 *src = machine.region( "maincpu" )->base();
+ int size = machine.root_device().memregion( "maincpu" )->bytes();
+ UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int i;
int ofst;
@@ -882,7 +882,7 @@ void svcsplus_px_decrypt( running_machine &machine )
void svcsplus_px_hack( running_machine &machine )
{
/* patched by the protection chip? */
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
mem16[0x9e90/2] = 0x000f;
mem16[0x9e92/2] = 0xc9c0;
mem16[0xa10c/2] = 0x4eb9;
@@ -924,7 +924,7 @@ static WRITE16_HANDLER( kof2003_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff1)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)space->machine().region("maincpu")->base();
+ UINT8* mem = (UINT8 *)space->machine().root_device().memregion("maincpu")->base();
cr[BYTE_XOR_LE(0x1ff0)] = 0xa0;
cr[BYTE_XOR_LE(0x1ff1)] &= 0xfe;
@@ -942,7 +942,7 @@ static WRITE16_HANDLER( kof2003p_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff0)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)space->machine().region("maincpu")->base();
+ UINT8* mem = (UINT8 *)space->machine().root_device().memregion("maincpu")->base();
cr[BYTE_XOR_LE(0x1ff0)] &= 0xfe;
cr[BYTE_XOR_LE(0x1ff3)] &= 0x7f;
@@ -960,7 +960,7 @@ void kf2k3bl_px_decrypt( running_machine &machine )
};
int rom_size = 0x800000;
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
memcpy( buf, rom, rom_size );
@@ -982,7 +982,7 @@ void kf2k3bl_install_protection(running_machine &machine)
void kf2k3pl_px_decrypt( running_machine &machine )
{
UINT16*tmp = auto_alloc_array(machine, UINT16, 0x100000/2);
- UINT16*rom = (UINT16*)machine.region( "maincpu" )->base();
+ UINT16*rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base();
int j;
int i;
@@ -1010,7 +1010,7 @@ void kf2k3pl_install_protection(running_machine &machine)
void kf2k3upl_px_decrypt( running_machine &machine )
{
{
- UINT8 *src = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
memmove(src+0x100000, src, 0x600000);
memmove(src, src+0x700000, 0x100000);
}
@@ -1019,8 +1019,8 @@ void kf2k3upl_px_decrypt( running_machine &machine )
int ofst;
int i;
- UINT8 *rom = machine.region( "maincpu" )->base() + 0xfe000;
- UINT8 *buf = machine.region( "maincpu" )->base() + 0xd0610;
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base() + 0xfe000;
+ UINT8 *buf = machine.root_device().memregion( "maincpu" )->base() + 0xd0610;
for( i = 0; i < 0x2000 / 2; i++ ){
ofst = (i & 0xff00) + BITSWAP8( (i & 0x00ff), 7, 6, 0, 4, 3, 2, 1, 5 );
@@ -1040,8 +1040,8 @@ void kf2k3upl_install_protection(running_machine &machine)
void samsho5b_px_decrypt( running_machine &machine )
{
- int px_size = machine.region( "maincpu" )->bytes();
- UINT8 *rom = machine.region( "maincpu" )->base();
+ int px_size = machine.root_device().memregion( "maincpu" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, px_size );
int ofst;
int i;
@@ -1067,8 +1067,8 @@ void samsho5b_px_decrypt( running_machine &machine )
void samsho5b_vx_decrypt( running_machine &machine )
{
- int vx_size = machine.region( "ymsnd" )->bytes();
- UINT8 *rom = machine.region( "ymsnd" )->base();
+ int vx_size = machine.root_device().memregion( "ymsnd" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "ymsnd" )->base();
int i;
for( i = 0; i < vx_size; i++ )
@@ -1084,7 +1084,7 @@ void samsho5b_vx_decrypt( running_machine &machine )
void matrimbl_decrypt( running_machine &machine )
{
/* decrypt Z80 */
- UINT8 *rom = machine.region( "audiocpu" )->base()+0x10000;
+ UINT8 *rom = machine.root_device().memregion( "audiocpu" )->base()+0x10000;
UINT8 *buf = auto_alloc_array(machine, UINT8, 0x20000 );
int i, j=0;
memcpy( buf, rom, 0x20000 );
diff --git a/src/mame/machine/neocrypt.c b/src/mame/machine/neocrypt.c
index 82c2ae70647..1f9d4f1fa4a 100644
--- a/src/mame/machine/neocrypt.c
+++ b/src/mame/machine/neocrypt.c
@@ -535,11 +535,11 @@ static void neogeo_gfx_decrypt(running_machine &machine, int extra_xor)
UINT8 *rom;
int rpos;
- rom_size = machine.region("sprites")->bytes();
+ rom_size = machine.root_device().memregion("sprites")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine.region("sprites")->base();
+ rom = machine.root_device().memregion("sprites")->base();
// Data xor
for (rpos = 0;rpos < rom_size/4;rpos++)
@@ -595,10 +595,10 @@ static void neogeo_gfx_decrypt(running_machine &machine, int extra_xor)
void neogeo_sfix_decrypt(running_machine &machine)
{
int i;
- int rom_size = machine.region("sprites")->bytes();
- int tx_size = machine.region("fixed")->bytes();
- UINT8 *src = machine.region("sprites")->base()+rom_size-tx_size;
- UINT8 *dst = machine.region("fixed")->base();
+ int rom_size = machine.root_device().memregion("sprites")->bytes();
+ int tx_size = machine.root_device().memregion("fixed")->bytes();
+ UINT8 *src = machine.root_device().memregion("sprites")->base()+rom_size-tx_size;
+ UINT8 *dst = machine.root_device().memregion("fixed")->base();
for (i = 0;i < tx_size;i++)
dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
@@ -677,8 +677,8 @@ void svcpcb_gfx_decrypt(running_machine &machine)
static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
int i;
int ofst;
- int rom_size = machine.region( "sprites" )->bytes();
- UINT8 *rom = machine.region( "sprites" )->base();
+ int rom_size = machine.root_device().memregion( "sprites" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "sprites" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for( i = 0; i < rom_size; i++ )
@@ -710,8 +710,8 @@ void svcpcb_gfx_decrypt(running_machine &machine)
void svcpcb_s1data_decrypt(running_machine &machine)
{
int i;
- UINT8 *s1 = machine.region( "fixed" )->base();
- size_t s1_size = machine.region( "fixed" )->bytes();
+ UINT8 *s1 = machine.root_device().memregion( "fixed" )->base();
+ size_t s1_size = machine.root_device().memregion( "fixed" )->bytes();
for( i = 0; i < s1_size; i++ ) // Decrypt S
{
@@ -727,8 +727,8 @@ void kf2k3pcb_gfx_decrypt(running_machine &machine)
static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
int i;
int ofst;
- int rom_size = machine.region( "sprites" )->bytes();
- UINT8 *rom = machine.region( "sprites" )->base();
+ int rom_size = machine.root_device().memregion( "sprites" )->bytes();
+ UINT8 *rom = machine.root_device().memregion( "sprites" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for ( i = 0; i < rom_size; i++ )
@@ -758,26 +758,26 @@ void kf2k3pcb_decrypt_s1data(running_machine &machine)
UINT8 *src;
UINT8 *dst;
int i;
- int tx_size = machine.region( "fixed" )->bytes();
- int srom_size = machine.region( "sprites" )->bytes();
+ int tx_size = machine.root_device().memregion( "fixed" )->bytes();
+ int srom_size = machine.root_device().memregion( "sprites" )->bytes();
- src = machine.region( "sprites" )->base() + srom_size - 0x1000000 - 0x80000; // Decrypt S
- dst = machine.region( "fixed" )->base();
+ src = machine.root_device().memregion( "sprites" )->base() + srom_size - 0x1000000 - 0x80000; // Decrypt S
+ dst = machine.root_device().memregion( "fixed" )->base();
for( i = 0; i < tx_size / 2; i++ )
{
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}
- src = machine.region( "sprites" )->base() + srom_size - 0x80000;
- dst = machine.region( "fixed" )->base() + 0x80000;
+ src = machine.root_device().memregion( "sprites" )->base() + srom_size - 0x80000;
+ dst = machine.root_device().memregion( "fixed" )->base() + 0x80000;
for( i = 0; i < tx_size / 2; i++ )
{
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}
- dst = machine.region( "fixed" )->base();
+ dst = machine.root_device().memregion( "fixed" )->base();
for( i = 0; i < tx_size; i++ )
{
@@ -887,9 +887,9 @@ static int m1_address_scramble(int address, UINT16 key)
void neogeo_cmc50_m1_decrypt(running_machine &machine)
{
- UINT8* rom = machine.region("audiocrypt")->base();
+ UINT8* rom = machine.root_device().memregion("audiocrypt")->base();
size_t rom_size = 0x80000;
- UINT8* rom2 = machine.region("audiocpu")->base();
+ UINT8* rom2 = machine.root_device().memregion("audiocpu")->base();
UINT8* buffer = auto_alloc_array(machine, UINT8, rom_size);
@@ -956,7 +956,7 @@ NeoGeo 'P' ROM encryption
/* Kof98 uses an early encryption, quite different from the others */
void kof98_decrypt_68k(running_machine &machine)
{
- UINT8 *src = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x200000);
int i, j, k;
static const UINT32 sec[]={0x000000,0x100000,0x000004,0x100004,0x10000a,0x00000a,0x10000e,0x00000e};
@@ -1006,7 +1006,7 @@ void kof99_decrypt_68k(running_machine &machine)
UINT16 *rom;
int i,j;
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1025,7 +1025,7 @@ void kof99_decrypt_68k(running_machine &machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x700000/2 + BITSWAP24(i,23,22,21,20,19,18,11,6,14,17,16,5,8,10,12,0,4,3,2,7,9,15,13,1)];
@@ -1039,7 +1039,7 @@ void garou_decrypt_68k(running_machine &machine)
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1047,14 +1047,14 @@ void garou_decrypt_68k(running_machine &machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x710000/2 + BITSWAP24(i,23,22,21,20,19,18,4,5,16,14,7,9,6,13,17,15,3,1,2,12,11,8,10,0)];
}
/* swap address lines for the banked part */
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
for (i = 0;i < 0x800000/2;i+=0x8000/2)
{
UINT16 buffer[0x8000/2];
@@ -1073,7 +1073,7 @@ void garouh_decrypt_68k(running_machine &machine)
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1081,14 +1081,14 @@ void garouh_decrypt_68k(running_machine &machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x7f8000/2 + BITSWAP24(i,23,22,21,20,19,18,5,16,11,2,6,7,17,3,12,8,14,4,0,9,1,10,15,13)];
}
/* swap address lines for the banked part */
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
for (i = 0;i < 0x800000/2;i+=0x8000/2)
{
UINT16 buffer[0x8000/2];
@@ -1107,7 +1107,7 @@ void mslug3_decrypt_68k(running_machine &machine)
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1115,14 +1115,14 @@ void mslug3_decrypt_68k(running_machine &machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x5d0000/2 + BITSWAP24(i,23,22,21,20,19,18,15,2,1,13,3,0,9,6,16,4,11,5,7,12,17,14,10,8)];
}
/* swap address lines for the banked part */
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
for (i = 0;i < 0x800000/2;i+=0x10000/2)
{
UINT16 buffer[0x10000/2];
@@ -1141,7 +1141,7 @@ void kof2000_decrypt_68k(running_machine &machine)
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1160,7 +1160,7 @@ void kof2000_decrypt_68k(running_machine &machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine.region("maincpu")->base();
+ rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x73a000/2 + BITSWAP24(i,23,22,21,20,19,18,8,4,15,13,3,14,16,2,6,17,7,12,10,0,5,11,1,9)];
@@ -1173,7 +1173,7 @@ void kof2002_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000};
- UINT8 *src = machine.region("maincpu")->base()+0x100000;
+ UINT8 *src = machine.root_device().memregion("maincpu")->base()+0x100000;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x400000);
memcpy( dst, src, 0x400000 );
for( i=0; i<8; ++i )
@@ -1188,7 +1188,7 @@ void matrim_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000};
- UINT8 *src = machine.region("maincpu")->base()+0x100000;
+ UINT8 *src = machine.root_device().memregion("maincpu")->base()+0x100000;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x400000);
memcpy( dst, src, 0x400000);
for( i=0; i<8; ++i )
@@ -1203,7 +1203,7 @@ void samsho5_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x000000,0x080000,0x700000,0x680000,0x500000,0x180000,0x200000,0x480000,0x300000,0x780000,0x600000,0x280000,0x100000,0x580000,0x400000,0x380000};
- UINT8 *src = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x800000);
memcpy( dst, src, 0x800000 );
@@ -1219,7 +1219,7 @@ void samsh5sp_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x000000,0x080000,0x500000,0x480000,0x600000,0x580000,0x700000,0x280000,0x100000,0x680000,0x400000,0x780000,0x200000,0x380000,0x300000,0x180000};
- UINT8 *src = machine.region("maincpu")->base();
+ UINT8 *src = machine.root_device().memregion("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x800000);
memcpy( dst, src, 0x800000 );
@@ -1239,7 +1239,7 @@ void mslug5_decrypt_68k(running_machine &machine)
int i;
int ofst;
int rom_size = 0x800000;
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for( i = 0; i < 0x100000; i++ )
@@ -1284,7 +1284,7 @@ void svc_px_decrypt(running_machine &machine)
int i;
int ofst;
int rom_size = 0x800000;
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for( i = 0; i < 0x100000; i++ )
@@ -1328,7 +1328,7 @@ void kf2k3pcb_decrypt_68k(running_machine &machine)
int i;
int ofst;
int rom_size = 0x900000;
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for (i = 0; i < 0x100000; i++)
@@ -1371,7 +1371,7 @@ void kof2003_decrypt_68k(running_machine &machine)
int i;
int ofst;
int rom_size = 0x900000;
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for (i = 0; i < 0x100000; i++)
@@ -1419,7 +1419,7 @@ void kof2003h_decrypt_68k(running_machine &machine)
int i;
int ofst;
int rom_size = 0x900000;
- UINT8 *rom = machine.region( "maincpu" )->base();
+ UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for (i = 0; i < 0x100000; i++)
@@ -1469,8 +1469,8 @@ NeoGeo 'V' (PCM) ROM encryption
/* Neo-Pcm2 Drivers for Encrypted V Roms */
void neo_pcm2_snk_1999(running_machine &machine, int value)
{ /* thanks to Elsemi for the NEO-PCM2 info */
- UINT16 *rom = (UINT16 *)machine.region("ymsnd")->base();
- int size = machine.region("ymsnd")->bytes();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("ymsnd")->base();
+ int size = machine.root_device().memregion("ymsnd")->bytes();
int i, j;
if( rom != NULL )
@@ -1509,7 +1509,7 @@ void neo_pcm2_swap(running_machine &machine, int value)
{0xcb,0x29,0x7d,0x43,0xd2,0x3a,0xc2,0xb4},
{0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62},
{0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62}};
- UINT8 *src = machine.region("ymsnd")->base();
+ UINT8 *src = machine.root_device().memregion("ymsnd")->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, 0x1000000);
int i, j, d;
@@ -1553,7 +1553,7 @@ void kof2003biosdecode(running_machine &machine)
0xd3,0xd2,0x5c,0x5d,0x57,0x56,0xd8,0xd9,
0xd3,0xd2,0x5c,0x5d,0x57,0x56,0xd8,0xd9,
};
- UINT16*src= (UINT16*)machine.region( "mainbios" )->base();
+ UINT16*src= (UINT16*)machine.root_device().memregion( "mainbios" )->base();
UINT16*buf= auto_alloc_array(machine, UINT16, 0x80000/2);
int a,addr;
diff --git a/src/mame/machine/neoprot.c b/src/mame/machine/neoprot.c
index 963a77bd310..422f52edc8c 100644
--- a/src/mame/machine/neoprot.c
+++ b/src/mame/machine/neoprot.c
@@ -119,7 +119,7 @@ void fatfury2_install_protection( running_machine &machine )
static WRITE16_HANDLER ( kof98_prot_w )
{
/* info from razoola */
- UINT16* mem16 = (UINT16*)space->machine().region("maincpu")->base();
+ UINT16* mem16 = (UINT16*)space->machine().root_device().memregion("maincpu")->base();
switch (data)
{
@@ -160,7 +160,7 @@ void install_kof98_protection( running_machine &machine )
void mslugx_install_protection( running_machine &machine )
{
int i;
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
for (i = 0;i < (0x100000/2) - 4;i++)
{
diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c
index 66d599e6189..f2c570fb853 100644
--- a/src/mame/machine/nmk004.c
+++ b/src/mame/machine/nmk004.c
@@ -175,7 +175,7 @@ static void oki_play_sample(int sample_no)
if (sample != 0)
{
- UINT8 *rom = NMK004_state.machine().region((chip == 0) ? "oki1" : "oki2")->base();
+ UINT8 *rom = NMK004_state.machine().root_device().memregion((chip == 0) ? "oki1" : "oki2")->base();
int bank = (byte2 & 0x0c) >> 2;
int vol = (byte2 & 0x70) >> 4;
@@ -1033,7 +1033,7 @@ static TIMER_CALLBACK( real_nmk004_init )
NMK004_state.oki1device = machine.device<okim6295_device>("oki1");
NMK004_state.oki2device = machine.device<okim6295_device>("oki2");
- NMK004_state.rom = machine.region("audiocpu")->base();
+ NMK004_state.rom = machine.root_device().memregion("audiocpu")->base();
ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x2f);
diff --git a/src/mame/machine/nmk112.c b/src/mame/machine/nmk112.c
index 50783dfad52..2097bef12c5 100644
--- a/src/mame/machine/nmk112.c
+++ b/src/mame/machine/nmk112.c
@@ -120,8 +120,8 @@ static DEVICE_START( nmk112 )
}
else
{
- nmk112->rom0 = device->machine().region(intf->rgn0)->base();
- nmk112->size0 = device->machine().region(intf->rgn0)->bytes() - 0x40000;
+ nmk112->rom0 = device->machine().root_device().memregion(intf->rgn0)->base();
+ nmk112->size0 = device->machine().root_device().memregion(intf->rgn0)->bytes() - 0x40000;
}
if (intf->rgn1 == NULL)
@@ -131,8 +131,8 @@ static DEVICE_START( nmk112 )
}
else
{
- nmk112->rom1 = device->machine().region(intf->rgn1)->base();
- nmk112->size1 = device->machine().region(intf->rgn1)->bytes() - 0x40000;
+ nmk112->rom1 = device->machine().root_device().memregion(intf->rgn1)->base();
+ nmk112->size1 = device->machine().root_device().memregion(intf->rgn1)->bytes() - 0x40000;
}
nmk112->page_mask = ~intf->disable_page_mask;
diff --git a/src/mame/machine/opwolf.c b/src/mame/machine/opwolf.c
index 2d925b8be5f..94d6512b6e3 100644
--- a/src/mame/machine/opwolf.c
+++ b/src/mame/machine/opwolf.c
@@ -420,7 +420,7 @@ WRITE16_MEMBER(opwolf_state::opwolf_cchip_data_w)
if (offset == 0x14)
{
#if OPWOLF_READ_COINAGE_FROM_ROM
- UINT16* rom = (UINT16*)machine().region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine().root_device().memregion("maincpu")->base();
UINT32 coin_table[2] = {0, 0};
UINT8 coin_offset[2];
int slot;
diff --git a/src/mame/machine/pacplus.c b/src/mame/machine/pacplus.c
index 6cbcfe3a64e..ae9245dc5a7 100644
--- a/src/mame/machine/pacplus.c
+++ b/src/mame/machine/pacplus.c
@@ -46,7 +46,7 @@ void pacplus_decode(running_machine &machine)
/* CPU ROMs */
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x4000; i++)
{
RAM[i] = decrypt(i,RAM[i]);
diff --git a/src/mame/machine/pgmcrypt.c b/src/mame/machine/pgmcrypt.c
index ab80d0d69ec..abcdfba493b 100644
--- a/src/mame/machine/pgmcrypt.c
+++ b/src/mame/machine/pgmcrypt.c
@@ -27,7 +27,7 @@ void pgm_kov_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -89,7 +89,7 @@ void pgm_kovsh_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -130,7 +130,7 @@ void pgm_dw2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x80000;
@@ -172,7 +172,7 @@ void pgm_photoy2k_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -232,7 +232,7 @@ void pgm_pstar_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x100000;
@@ -272,7 +272,7 @@ void pgm_dw3_decrypt(running_machine &machine)
// UINT16 *src=(UINT16 *) (OP_ROM+0x100000);
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x100000;
@@ -304,7 +304,7 @@ void pgm_killbld_decrypt(running_machine &machine)
// UINT16 *src=(UINT16 *) (OP_ROM+0x100000);
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x200000;
@@ -343,7 +343,7 @@ static const UINT8 dfront_tab[256] = {
void pgm_dfront_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x400000;
@@ -403,7 +403,7 @@ static const UINT8 ddp2_tab[256] = {
void pgm_ddp2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x200000;
@@ -457,7 +457,7 @@ static const UINT8 mm_tab[256] = {
void pgm_mm_decrypt(running_machine &machine) // and dw2001
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x200000;
@@ -516,7 +516,7 @@ static const UINT8 kov2_tab[256] = {
void pgm_kov2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x200000;
@@ -572,7 +572,7 @@ static const UINT8 kov2p_tab[256] = {
void pgm_kov2p_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x200000;
@@ -631,7 +631,7 @@ static const UINT8 puzzli2_tab[256] = {
void pgm_puzzli2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x100000;
@@ -690,7 +690,7 @@ static const UINT8 theglad_tab[256] = {
void pgm_theglad_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x200000;
@@ -750,7 +750,7 @@ static const UINT8 oldsplus_tab[256] = {
void pgm_oldsplus_decrypt(running_machine &machine)
{
int i;
- unsigned short *src = (unsigned short *)(machine.region("maincpu")->base()+0x100000);
+ unsigned short *src = (unsigned short *)(machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -810,7 +810,7 @@ static const UINT8 kovshp_tab[256] = {
void pgm_kovshp_decrypt(running_machine &machine)
{
int i;
- unsigned short *src = (unsigned short *)(machine.region("maincpu")->base()+0x100000);
+ unsigned short *src = (unsigned short *)(machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -870,7 +870,7 @@ static const UINT8 killbldp_tab[256] = {
void pgm_killbldp_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x200000;
@@ -911,7 +911,7 @@ void pgm_killbldp_decrypt(running_machine &machine)
void pgm_svg_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x800000;
@@ -968,7 +968,7 @@ static const unsigned char svgpcb_tab[0x100] = { // not checked
void pgm_svgpcb_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("user1")->base());
int rom_size = 0x800000;
@@ -1014,7 +1014,7 @@ static const UINT8 py2k2_tab[256] = {
void pgm_py2k2_decrypt(running_machine &machine) // and ddpdoj/ddpdojbl
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -1060,7 +1060,7 @@ static const unsigned char ket_tab[256] = {
void pgm_ket_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x400000;
@@ -1106,7 +1106,7 @@ static const unsigned char espgal_tab[256] = {
void pgm_espgal_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
int rom_size = 0x400000;
@@ -1153,7 +1153,7 @@ static const UINT8 happy6in1_tab[256] = { // IGS0008RD1031215
void pgm_happy6_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine.region("user1")->base());
+ UINT16 *src = (UINT16 *) (machine.root_device().memregion("user1")->base());
int rom_size = 0x400000;
diff --git a/src/mame/machine/pgmprot1.c b/src/mame/machine/pgmprot1.c
index eac94f136fb..3c2a1a22a10 100644
--- a/src/mame/machine/pgmprot1.c
+++ b/src/mame/machine/pgmprot1.c
@@ -386,7 +386,7 @@ DRIVER_INIT( kovshxas )
static void pgm_decode_kovlsqh2_tiles( running_machine &machine )
{
int i, j;
- UINT16 *src = (UINT16 *)(machine.region("tiles")->base() + 0x180000);
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("tiles")->base() + 0x180000);
UINT16 *dst = auto_alloc_array(machine, UINT16, 0x800000);
for (i = 0; i < 0x800000 / 2; i++)
@@ -421,7 +421,7 @@ static void pgm_decode_kovlsqh2_sprites( running_machine &machine, UINT8 *src )
static void pgm_decode_kovlsqh2_samples( running_machine &machine )
{
int i;
- UINT8 *src = (UINT8 *)(machine.region("ics")->base() + 0x400000);
+ UINT8 *src = (UINT8 *)(machine.root_device().memregion("ics")->base() + 0x400000);
for (i = 0; i < 0x400000; i+=2) {
src[i + 0x000001] = src[i + 0x400001];
@@ -433,7 +433,7 @@ static void pgm_decode_kovlsqh2_samples( running_machine &machine )
static void pgm_decode_kovqhsgs_program( running_machine &machine )
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
UINT16 *dst = auto_alloc_array(machine, UINT16, 0x400000);
for (i = 0; i < 0x400000 / 2; i++)
@@ -451,7 +451,7 @@ static void pgm_decode_kovqhsgs_program( running_machine &machine )
static void pgm_decode_kovqhsgs2_program( running_machine &machine )
{
int i;
- UINT16 *src = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
+ UINT16 *src = (UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x100000);
UINT16 *dst = auto_alloc_array(machine, UINT16, 0x400000);
for (i = 0; i < 0x400000 / 2; i++)
@@ -472,14 +472,14 @@ DRIVER_INIT( kovlsqh2 )
pgm_decode_kovqhsgs2_program(machine);
pgm_decode_kovlsqh2_tiles(machine);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0800000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1800000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2800000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x1000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x1800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x2000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x2800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprmask")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprmask")->base() + 0x0800000);
pgm_decode_kovlsqh2_samples(machine);
pgm_basic_init(machine);
@@ -493,14 +493,14 @@ DRIVER_INIT( kovqhsgs )
pgm_decode_kovqhsgs_program(machine);
pgm_decode_kovlsqh2_tiles(machine);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0800000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1800000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2800000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x1000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x1800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x2000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprcol")->base() + 0x2800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprmask")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.root_device().memregion("sprmask")->base() + 0x0800000);
pgm_decode_kovlsqh2_samples(machine);
pgm_basic_init(machine);
diff --git a/src/mame/machine/pgmprot2.c b/src/mame/machine/pgmprot2.c
index ecf9438b7c8..5c0e918d160 100644
--- a/src/mame/machine/pgmprot2.c
+++ b/src/mame/machine/pgmprot2.c
@@ -207,7 +207,7 @@ DRIVER_INIT( kov2p )
pgm_kov2p_decrypt(machine);
kov2_latch_init(machine);
- UINT8 *mem8 = (UINT8 *)machine.region("user1")->base();
+ UINT8 *mem8 = (UINT8 *)machine.root_device().memregion("user1")->base();
mem8[0xDE] = 0xC0;
mem8[0xDF] = 0x46;
mem8[0x4ED8] = 0xA8;// B0
@@ -313,7 +313,7 @@ DRIVER_INIT( ddp2 )
DRIVER_INIT( dw2001 )
{
//pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
pgm_basic_init(machine);
kov2_latch_init(machine);
@@ -330,7 +330,7 @@ DRIVER_INIT( dw2001 )
mem16[0x11eb04 / 2] = 0x4e71;
/* patch ARM area with fake code */
- UINT16 *temp16 = (UINT16 *)machine.region("prot")->base();
+ UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("prot")->base();
temp16[(0x0000)/2] = 0xd088;
temp16[(0x0002)/2] = 0xe59f;
temp16[(0x0004)/2] = 0x0680;
@@ -347,7 +347,7 @@ DRIVER_INIT( dw2001 )
DRIVER_INIT( dwpc )
{
//pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
pgm_basic_init(machine);
kov2_latch_init(machine);
@@ -365,7 +365,7 @@ DRIVER_INIT( dwpc )
/* patch ARM area with fake code */
- UINT16 *temp16 = (UINT16 *)machine.region("prot")->base();
+ UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("prot")->base();
temp16[(0x0000)/2] = 0xd088;
temp16[(0x0002)/2] = 0xe59f;
temp16[(0x0004)/2] = 0x0680;
diff --git a/src/mame/machine/pgmprot3.c b/src/mame/machine/pgmprot3.c
index 085be4bae8f..ae6b5064af3 100644
--- a/src/mame/machine/pgmprot3.c
+++ b/src/mame/machine/pgmprot3.c
@@ -199,7 +199,7 @@ static void svg_basic_init(running_machine &machine)
static void pgm_create_dummy_internal_arm_region(running_machine &machine)
{
- UINT16 *temp16 = (UINT16 *)machine.region("prot")->base();
+ UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("prot")->base();
// fill with RX 14
int i;
diff --git a/src/mame/machine/pgmprot4.c b/src/mame/machine/pgmprot4.c
index daff6a9fb00..dc564c73bc7 100644
--- a/src/mame/machine/pgmprot4.c
+++ b/src/mame/machine/pgmprot4.c
@@ -107,17 +107,17 @@ static void IGS022_do_dma(running_machine& machine, UINT16 src, UINT16 dst, UINT
};
*/
int x;
- UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
+ UINT16 *PROTROM = (UINT16*)machine.root_device().memregion("igs022data")->base();
for (x = 0; x < size; x++)
{
- //UINT16 *RAMDUMP = (UINT16*)space->machine().region("user2")->base();
+ //UINT16 *RAMDUMP = (UINT16*)space->machine().root_device().memregion("user2")->base();
//UINT16 dat = RAMDUMP[dst + x];
UINT16 dat2 = PROTROM[src + x];
UINT8 extraoffset = param&0xfe; // the lowest bit changed the table addressing in tests, see 'rawDataOdd' table instead.. it's still related to the main one, not identical
- UINT8* dectable = (UINT8*)machine.region("igs022data")->base();//rawDataEven; // the basic decryption table is at the start of the mcu data rom! at least in killbld
+ UINT8* dectable = (UINT8*)machine.root_device().memregion("igs022data")->base();//rawDataEven; // the basic decryption table is at the start of the mcu data rom! at least in killbld
UINT16 extraxor = ((dectable[((x*2)+0+extraoffset)&0xff]) << 8) | (dectable[((x*2)+1+extraoffset)&0xff] << 0);
dat2 = ((dat2 & 0x00ff)<<8) | ((dat2 & 0xff00)>>8);
@@ -148,7 +148,7 @@ static void IGS022_do_dma(running_machine& machine, UINT16 src, UINT16 dst, UINT
{
/* mode 5 seems to be a straight copy */
int x;
- UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
+ UINT16 *PROTROM = (UINT16*)machine.root_device().memregion("igs022data")->base();
for (x = 0; x < size; x++)
{
UINT16 dat = PROTROM[src + x];
@@ -161,7 +161,7 @@ static void IGS022_do_dma(running_machine& machine, UINT16 src, UINT16 dst, UINT
{
/* mode 6 seems to swap bytes and nibbles */
int x;
- UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
+ UINT16 *PROTROM = (UINT16*)machine.root_device().memregion("igs022data")->base();
for (x = 0; x < size; x++)
{
UINT16 dat = PROTROM[src + x];
@@ -194,7 +194,7 @@ static void IGS022_do_dma(running_machine& machine, UINT16 src, UINT16 dst, UINT
static void IGS022_reset(running_machine& machine)
{
int i;
- UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
+ UINT16 *PROTROM = (UINT16*)machine.root_device().memregion("igs022data")->base();
pgm_022_025_state *state = machine.driver_data<pgm_022_025_state>();
UINT16 tmp;
@@ -534,7 +534,7 @@ DRIVER_INIT( drgw3 )
{
int x;
- UINT16 *RAMDUMP = (UINT16*)machine.region("user2")->base();
+ UINT16 *RAMDUMP = (UINT16*)state->memregion("user2")->base();
for (x=0;x<(0x4000/2);x++)
{
state->m_sharedprotram[x] = RAMDUMP[x];
diff --git a/src/mame/machine/pgmprot5.c b/src/mame/machine/pgmprot5.c
index f54c5a4c0ad..dfff316b4f8 100644
--- a/src/mame/machine/pgmprot5.c
+++ b/src/mame/machine/pgmprot5.c
@@ -66,7 +66,7 @@ static void drgwld2_common_init(running_machine &machine)
DRIVER_INIT( drgw2 )
{ /* incomplete? */
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
@@ -78,7 +78,7 @@ DRIVER_INIT( drgw2 )
DRIVER_INIT( dw2v100x )
{
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
drgwld2_common_init(machine);
mem16[0x131084 / 2] = 0x4e93;
@@ -88,7 +88,7 @@ DRIVER_INIT( dw2v100x )
DRIVER_INIT( drgw2c )
{
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
@@ -100,7 +100,7 @@ DRIVER_INIT( drgw2c )
DRIVER_INIT( drgw2j )
{
- UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
diff --git a/src/mame/machine/pgmprot6.c b/src/mame/machine/pgmprot6.c
index e2da70a88ec..e69a8e14f46 100644
--- a/src/mame/machine/pgmprot6.c
+++ b/src/mame/machine/pgmprot6.c
@@ -86,7 +86,7 @@ static void olds_write_reg( running_machine &machine, UINT16 addr, UINT32 val )
static MACHINE_RESET( olds )
{
pgm_028_025_state *state = machine.driver_data<pgm_028_025_state>();
- UINT16 *mem16 = (UINT16 *)machine.region("user2")->base();
+ UINT16 *mem16 = (UINT16 *)state->memregion("user2")->base();
int i;
MACHINE_RESET_CALL(pgm);
diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c
index 8fed5a603df..b56c67c6718 100644
--- a/src/mame/machine/playch10.c
+++ b/src/mame/machine/playch10.c
@@ -46,7 +46,7 @@ MACHINE_RESET( pc10 )
MACHINE_START( pc10 )
{
playch10_state *state = machine.driver_data<playch10_state>();
- state->m_vrom = machine.region("gfx2")->base();
+ state->m_vrom = machine.root_device().memregion("gfx2")->base();
/* allocate 4K of nametable ram here */
/* move to individual boards as documentation of actual boards allows */
@@ -61,13 +61,13 @@ MACHINE_START( pc10 )
nvram_device *nvram = machine.device<nvram_device>("nvram");
if (nvram != NULL)
- nvram->set_base(machine.region("cart" )->base() + 0x6000, 0x1000);
+ nvram->set_base(state->memregion("cart" )->base() + 0x6000, 0x1000);
}
MACHINE_START( playch10_hboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- state->m_vrom = machine.region("gfx2")->base();
+ state->m_vrom = state->memregion("gfx2")->base();
/* allocate 4K of nametable ram here */
/* move to individual boards as documentation of actual boards allows */
@@ -196,7 +196,7 @@ WRITE8_MEMBER(playch10_state::pc10_prot_w)
/* is the actual protection memory area */
/* setting the whole 0x2000 region every time is a waste */
/* so we just set $ffff with the current value */
- machine().region("maincpu")->base()[0xffff] = pc10_prot_r(space, 0);
+ memregion("maincpu")->base()[0xffff] = pc10_prot_r(space, 0);
}
}
@@ -370,7 +370,7 @@ static void pc10_set_videorom_bank( running_machine &machine, int first, int cou
/* yeah, this is probably a horrible assumption to make.*/
/* but the driver is 100% consistant */
- len = machine.region("gfx2")->bytes();
+ len = state->memregion("gfx2")->bytes();
len /= 0x400; // convert to KB
len /= size; // convert to bank resolution
len--; // convert to mask
@@ -548,7 +548,7 @@ WRITE8_MEMBER(playch10_state::mmc1_rom_switch_w)
case 3: /* program banking */
{
int bank = (m_mmc1_shiftreg & m_mmc1_rom_mask) * 0x4000;
- UINT8 *prg = machine().region("cart")->base();
+ UINT8 *prg = memregion("cart")->base();
if (!size16k)
{
@@ -605,7 +605,7 @@ DRIVER_INIT( pcaboard )
WRITE8_MEMBER(playch10_state::bboard_rom_switch_w)
{
int bankoffset = 0x10000 + ((data & 7) * 0x4000);
- UINT8 *prg = machine().region("cart")->base();
+ UINT8 *prg = memregion("cart")->base();
memcpy(&prg[0x08000], &prg[bankoffset], 0x4000);
}
@@ -613,7 +613,7 @@ WRITE8_MEMBER(playch10_state::bboard_rom_switch_w)
DRIVER_INIT( pcbboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
@@ -661,7 +661,7 @@ DRIVER_INIT( pccboard )
DRIVER_INIT( pcdboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
@@ -736,7 +736,7 @@ WRITE8_MEMBER(playch10_state::eboard_rom_switch_w)
case 0x2000: /* code bank switching */
{
int bankoffset = 0x10000 + (data & 0x0f) * 0x2000;
- UINT8 *prg = machine().region("cart")->base();
+ UINT8 *prg = memregion("cart")->base();
memcpy(&prg[0x08000], &prg[bankoffset], 0x2000);
}
break;
@@ -776,7 +776,7 @@ DRIVER_INIT( pceboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
/* we have no vram, make sure switching games doesn't point to an old allocation */
state->m_vram = NULL;
@@ -804,7 +804,7 @@ DRIVER_INIT( pceboard )
DRIVER_INIT( pcfboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
/* we have no vram, make sure switching games doesn't point to an old allocation */
state->m_vram = NULL;
@@ -867,7 +867,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w)
if (m_gboard_last_bank != (data & 0xc0))
{
int bank;
- UINT8 *prg = machine().region("cart")->base();
+ UINT8 *prg = memregion("cart")->base();
/* reset the banks */
if (m_gboard_command & 0x40)
@@ -920,7 +920,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w)
case 6: /* program banking */
{
- UINT8 *prg = machine().region("cart")->base();
+ UINT8 *prg = memregion("cart")->base();
if (m_gboard_command & 0x40)
{
/* high bank */
@@ -945,7 +945,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w)
case 7: /* program banking */
{
/* mid bank */
- UINT8 *prg = machine().region("cart")->base();
+ UINT8 *prg = memregion("cart")->base();
m_gboard_banks[1] = data & 0x1f;
bank = m_gboard_banks[1] * 0x2000 + 0x10000;
@@ -991,7 +991,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w)
DRIVER_INIT( pcgboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
state->m_vram = NULL;
/* We do manual banking, in case the code falls through */
@@ -1032,7 +1032,7 @@ DRIVER_INIT( pcgboard_type2 )
WRITE8_MEMBER(playch10_state::iboard_rom_switch_w)
{
int bank = data & 7;
- UINT8 *prg = machine().region("cart")->base();
+ UINT8 *prg = memregion("cart")->base();
if (data & 0x10)
pc10_set_mirroring(PPU_MIRROR_HIGH);
@@ -1045,7 +1045,7 @@ WRITE8_MEMBER(playch10_state::iboard_rom_switch_w)
DRIVER_INIT( pciboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
@@ -1115,7 +1115,7 @@ WRITE8_MEMBER(playch10_state::hboard_rom_switch_w)
DRIVER_INIT( pchboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
memcpy(&prg[0x08000], &prg[0x4c000], 0x4000);
memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000);
@@ -1142,7 +1142,7 @@ DRIVER_INIT( pchboard )
DRIVER_INIT( pckboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- UINT8 *prg = machine.region("cart")->base();
+ UINT8 *prg = state->memregion("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
diff --git a/src/mame/machine/r2crypt.c b/src/mame/machine/r2crypt.c
index 0aecfb0bed0..013df9dc696 100644
--- a/src/mame/machine/r2crypt.c
+++ b/src/mame/machine/r2crypt.c
@@ -220,7 +220,7 @@ static UINT32 core_decrypt(UINT32 ciphertext, int i1, int i2, int i3, int i4,
void raiden2_decrypt_sprites(running_machine &machine)
{
- UINT32 *data = (UINT32 *)machine.region("gfx3")->base();
+ UINT32 *data = (UINT32 *)machine.root_device().memregion("gfx3")->base();
for(int i=0; i<0x800000/4; i++)
{
data[i] = core_decrypt(data[i],
@@ -240,7 +240,7 @@ void raiden2_decrypt_sprites(running_machine &machine)
void zeroteam_decrypt_sprites(running_machine &machine)
{
- UINT32 *data = (UINT32 *)machine.region("gfx3")->base();
+ UINT32 *data = (UINT32 *)machine.root_device().memregion("gfx3")->base();
for(int i=0; i<0x400000/4; i++)
{
data[i] = core_decrypt(data[i],
diff --git a/src/mame/machine/s16fd.c b/src/mame/machine/s16fd.c
index 2e8a785134d..405dae94b5e 100644
--- a/src/mame/machine/s16fd.c
+++ b/src/mame/machine/s16fd.c
@@ -203,9 +203,9 @@ void fd1094_driver_init(running_machine &machine, const char* tag, void (*set_de
strcpy(fd1094_cputag, tag);
- fd1094_cpuregion = (UINT16*)machine.region(fd1094_cputag)->base();
- fd1094_cpuregionsize = machine.region(fd1094_cputag)->bytes();
- fd1094_key = machine.region("user1")->base();
+ fd1094_cpuregion = (UINT16*)machine.root_device().memregion(fd1094_cputag)->base();
+ fd1094_cpuregionsize = machine.root_device().memregion(fd1094_cputag)->bytes();
+ fd1094_key = machine.root_device().memregion("user1")->base();
fd1094_set_decrypted = set_decrypted;
/* punt if no key; this allows us to be called even for non-FD1094 games */
@@ -222,7 +222,7 @@ void fd1094_driver_init(running_machine &machine, const char* tag, void (*set_de
/* key debugging */
#if KEY_DEBUGGING
- if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0 && machine.region("user2")->base() != NULL)
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0 && machine.root_device().memregion("user2")->base() != NULL)
{
fd1094_init_debugging(machine, fd1094_cputag, "user1", "user2", key_changed);
}
diff --git a/src/mame/machine/s24fd.c b/src/mame/machine/s24fd.c
index 332154983a0..627ad8f9fd1 100644
--- a/src/mame/machine/s24fd.c
+++ b/src/mame/machine/s24fd.c
@@ -158,7 +158,7 @@ void s24_fd1094_driver_init(running_machine &machine)
s24_fd1094_cpuregion = (UINT16*)machine.memory().shared("share2")->ptr();
s24_fd1094_cpuregionsize = 0x40000;
- s24_fd1094_key = machine.region("fd1094key")->base();
+ s24_fd1094_key = machine.root_device().memregion("fd1094key")->base();
/* punt if no key; this allows us to be called even for non-s24_fd1094 games */
if (!s24_fd1094_key)
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index 6650ecfebd7..d1b02850a3f 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -26,7 +26,7 @@ MACHINE_RESET( scramble )
MACHINE_RESET( explorer )
{
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
RAM[0x47ff] = 0; /* If not set, it doesn't reset after the 1st time */
MACHINE_RESET_CALL(galaxold);
@@ -246,7 +246,7 @@ DRIVER_INIT( mariner )
/* extra ROM */
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5800, 0x67ff, "bank1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5800, 0x67ff);
- machine.root_device().membank("bank1")->set_base(machine.region("maincpu")->base() + 0x5800);
+ machine.root_device().membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x5800);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9008, 0x9008, FUNC(mariner_protection_2_r));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb401, 0xb401, FUNC(mariner_protection_1_r));
@@ -262,12 +262,12 @@ DRIVER_INIT( frogger )
UINT8 *ROM;
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
- ROM = machine.region("audiocpu")->base();
+ ROM = machine.root_device().memregion("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
ROM[A] = BITSWAP8(ROM[A],7,6,5,4,3,2,0,1);
/* likewise, the 2nd gfx ROM has data lines D0 and D1 swapped. Decode it. */
- ROM = machine.region("gfx1")->base();
+ ROM = machine.root_device().memregion("gfx1")->base();
for (A = 0x0800;A < 0x1000;A++)
ROM[A] = BITSWAP8(ROM[A],7,6,5,4,3,2,0,1);
}
@@ -278,7 +278,7 @@ DRIVER_INIT( froggers )
UINT8 *ROM;
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
- ROM = machine.region("audiocpu")->base();
+ ROM = machine.root_device().memregion("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
ROM[A] = BITSWAP8(ROM[A],7,6,5,4,3,2,0,1);
}
@@ -296,7 +296,7 @@ DRIVER_INIT( devilfsh )
/* A2 -> A3 */
/* A3 -> A1 */
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (i = 0; i < 0x10000; i += 16)
{
offs_t j;
@@ -322,13 +322,13 @@ DRIVER_INIT( hotshock )
{
/* protection??? The game jumps into never-neverland here. I think
it just expects a RET there */
- machine.region("maincpu")->base()[0x2ef9] = 0xc9;
+ machine.root_device().memregion("maincpu")->base()[0x2ef9] = 0xc9;
}
DRIVER_INIT( cavelon )
{
scramble_state *state = machine.driver_data<scramble_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
/* banked ROM */
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
@@ -374,7 +374,7 @@ DRIVER_INIT( mimonkey )
{ 0x80,0x87,0x81,0x87,0x83,0x00,0x84,0x01,0x01,0x86,0x86,0x80,0x86,0x00,0x86,0x86 }
};
- UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
int A, ctr = 0, line, col;
for( A = 0; A < 0x4000; A++ )
@@ -422,8 +422,8 @@ DRIVER_INIT( anteater )
* Optimizations done by Fabio Buffoni
*/
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
scratch = alloc_array_or_die(UINT8, len);
@@ -460,8 +460,8 @@ DRIVER_INIT( rescue )
* Optimizations done by Fabio Buffoni
*/
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
scratch = auto_alloc_array(machine, UINT8, len);
@@ -496,8 +496,8 @@ DRIVER_INIT( minefld )
* Code To Decode Minefield by Mike Balfour and Nicola Salmoria
*/
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
scratch = auto_alloc_array(machine, UINT8, len);
@@ -535,8 +535,8 @@ DRIVER_INIT( losttomb )
* Optimizations done by Fabio Buffoni
*/
- RAM = machine.region("gfx1")->base();
- len = machine.region("gfx1")->bytes();
+ RAM = machine.root_device().memregion("gfx1")->base();
+ len = machine.root_device().memregion("gfx1")->bytes();
scratch = alloc_array_or_die(UINT8, len);
@@ -562,7 +562,7 @@ DRIVER_INIT( losttomb )
DRIVER_INIT( hustler )
{
offs_t A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x4000;A++)
@@ -590,7 +590,7 @@ DRIVER_INIT( hustler )
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
{
- rom = machine.region("audiocpu")->base();
+ rom = machine.root_device().memregion("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
@@ -602,7 +602,7 @@ DRIVER_INIT( hustlerd )
{
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
offs_t A;
- UINT8 *rom = machine.region("audiocpu")->base();
+ UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
@@ -612,7 +612,7 @@ DRIVER_INIT( hustlerd )
DRIVER_INIT( billiard )
{
offs_t A;
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
for (A = 0;A < 0x4000;A++)
@@ -642,7 +642,7 @@ DRIVER_INIT( billiard )
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
{
- rom = machine.region("audiocpu")->base();
+ rom = machine.root_device().memregion("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
@@ -670,8 +670,8 @@ DRIVER_INIT( mrkougb )
DRIVER_INIT( ad2083 )
{
UINT8 c;
- int i, len = machine.region("maincpu")->bytes();
- UINT8 *ROM = machine.region("maincpu")->base();
+ int i, len = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
for (i=0; i<len; i++)
{
diff --git a/src/mame/machine/segacrp2.c b/src/mame/machine/segacrp2.c
index ea0db96f5e3..bf439274d54 100644
--- a/src/mame/machine/segacrp2.c
+++ b/src/mame/machine/segacrp2.c
@@ -61,7 +61,7 @@ static void sega_decode_2(running_machine &machine,const char *cputag,
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region(cputag)->base();
+ UINT8 *rom = machine.root_device().memregion(cputag)->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x0000, 0x7fff, decrypted);
diff --git a/src/mame/machine/segacrpt.c b/src/mame/machine/segacrpt.c
index a4dc330d0b4..3f861bfc610 100644
--- a/src/mame/machine/segacrpt.c
+++ b/src/mame/machine/segacrpt.c
@@ -159,7 +159,7 @@
static void lfkp(int mask)
{
int A;
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
for (A = 0x0000;A < 0x8000-14;A++)
@@ -218,9 +218,9 @@ static void sega_decode(running_machine &machine, const char *cputag, const UINT
int A;
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
- int length = machine.region(cputag)->bytes();
+ int length = machine.root_device().memregion(cputag)->bytes();
int cryptlen = MIN(length, 0x8000);
- UINT8 *rom = machine.region(cputag)->base();
+ UINT8 *rom = machine.root_device().memregion(cputag)->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0xc000);
space->set_decrypted_region(0x0000, cryptlen - 1, decrypted);
@@ -440,7 +440,7 @@ void toprollr_decode(running_machine &machine, const char *cputag, const char *r
int A;
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region(regiontag)->base();
+ UINT8 *rom = machine.root_device().memregion(regiontag)->base();
int bankstart;
decrypted = auto_alloc_array(machine, UINT8, 0x6000*3);
@@ -471,7 +471,7 @@ void toprollr_decode(running_machine &machine, const char *cputag, const char *r
rom[A+bankstart] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
}
- machine.root_device().membank("bank1")->configure_entries(0,3, machine.region(regiontag)->base(),0x6000);
+ machine.root_device().membank("bank1")->configure_entries(0,3, machine.root_device().memregion(regiontag)->base(),0x6000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0,3,decrypted,0x6000);
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
space->machine().root_device().membank("bank1")->set_entry(0);
@@ -798,7 +798,7 @@ void jongkyo_decode(running_machine &machine, const char *cputag)
int A;
address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region(cputag)->base();
+ UINT8 *rom = machine.root_device().memregion(cputag)->base();
decrypted = auto_alloc_array(machine, UINT8, 0x9000);
for (A = 0x0000;A < 0x9000;A++)
@@ -830,7 +830,7 @@ void jongkyo_decode(running_machine &machine, const char *cputag)
rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
}
- machine.root_device().membank("bank1")->configure_entries(0,8, machine.region(cputag)->base()+0x7000,0x0400);
+ machine.root_device().membank("bank1")->configure_entries(0,8, machine.root_device().memregion(cputag)->base()+0x7000,0x0400);
machine.root_device().membank("bank1")->configure_decrypted_entries(0,8,decrypted+0x7000,0x0400);
space->set_decrypted_region(0x0000, 0x6bff, decrypted);
machine.root_device().membank("bank1")->set_entry(0);
diff --git a/src/mame/machine/segamsys.c b/src/mame/machine/segamsys.c
index a19616d679e..ac5892ae622 100644
--- a/src/mame/machine/segamsys.c
+++ b/src/mame/machine/segamsys.c
@@ -1613,13 +1613,13 @@ static WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
//printf("bank ram??\n");
break;
case 1:
- memcpy(sms_rom+0x0000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x0000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
break;
case 2:
- memcpy(sms_rom+0x4000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x4000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
break;
case 3:
- memcpy(sms_rom+0x8000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x8000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
break;
}
@@ -1628,19 +1628,19 @@ static WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
static WRITE8_HANDLER( codemasters_rom_bank_0000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x0000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x0000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
}
static WRITE8_HANDLER( codemasters_rom_bank_4000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x4000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x4000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
}
static WRITE8_HANDLER( codemasters_rom_bank_8000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x8000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x8000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
}
@@ -1682,7 +1682,7 @@ void megatech_set_genz80_as_sms_standard_map(running_machine &machine, const cha
/* fixed rom bank area */
sms_rom = (UINT8 *)machine.device(tag)->memory().space(AS_PROGRAM)->install_rom(0x0000, 0xbfff, NULL);
- memcpy(sms_rom, machine.region("maincpu")->base(), 0xc000);
+ memcpy(sms_rom, machine.root_device().memregion("maincpu")->base(), 0xc000);
if (mapper == MAPPER_STANDARD )
{
diff --git a/src/mame/machine/segas32.c b/src/mame/machine/segas32.c
index ddb08de88d5..d789f97908a 100644
--- a/src/mame/machine/segas32.c
+++ b/src/mame/machine/segas32.c
@@ -36,7 +36,7 @@ const UINT8 ga2_v25_opcode_table[256] = {
void decrypt_ga2_protrom(running_machine &machine)
{
int i;
- UINT8 *rom = machine.region("mcu")->base();
+ UINT8 *rom = machine.root_device().memregion("mcu")->base();
UINT8* temp = auto_alloc_array(machine, UINT8, 0x100000);
// make copy of ROM so original can be overwritten
@@ -113,7 +113,7 @@ WRITE16_MEMBER(segas32_state::sonic_level_load_protection)
}
else
{
- const UINT8 *ROM = machine().region("maincpu")->base();
+ const UINT8 *ROM = memregion("maincpu")->base();
level = *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 1);
level |= *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 2) << 8;
}
@@ -163,7 +163,7 @@ WRITE16_MEMBER(segas32_state::brival_protection_w)
};
char ret[32];
int curProtType;
- UINT8 *ROM = machine().region("maincpu")->base();
+ UINT8 *ROM = memregion("maincpu")->base();
switch (offset)
{
diff --git a/src/mame/machine/simpsons.c b/src/mame/machine/simpsons.c
index 5dd8768cd98..e546bf06ba9 100644
--- a/src/mame/machine/simpsons.c
+++ b/src/mame/machine/simpsons.c
@@ -118,11 +118,11 @@ MACHINE_RESET( simpsons )
state->m_video_bank = 0;
/* init the default banks */
- state->membank("bank1")->configure_entries(0, 64, machine.region("maincpu")->base() + 0x10000, 0x2000);
+ state->membank("bank1")->configure_entries(0, 64, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
state->membank("bank1")->set_entry(0);
- state->membank("bank2")->configure_entries(0, 2, machine.region("audiocpu")->base() + 0x10000, 0);
- state->membank("bank2")->configure_entries(2, 6, machine.region("audiocpu")->base() + 0x10000, 0x4000);
+ state->membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0);
+ state->membank("bank2")->configure_entries(2, 6, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
state->membank("bank2")->set_entry(0);
simpsons_video_banking(machine, 0);
diff --git a/src/mame/machine/slapfght.c b/src/mame/machine/slapfght.c
index 692b51819b5..9fa4c3762c0 100644
--- a/src/mame/machine/slapfght.c
+++ b/src/mame/machine/slapfght.c
@@ -65,14 +65,14 @@ WRITE8_MEMBER(slapfght_state::slapfight_port_07_w)
WRITE8_MEMBER(slapfght_state::slapfight_port_08_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
membank("bank1")->set_base(&RAM[0x10000]);
}
WRITE8_MEMBER(slapfght_state::slapfight_port_09_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
membank("bank1")->set_base(&RAM[0x14000]);
}
diff --git a/src/mame/machine/smpc.c b/src/mame/machine/smpc.c
index e2d28d92af4..00ec7c022b7 100644
--- a/src/mame/machine/smpc.c
+++ b/src/mame/machine/smpc.c
@@ -189,12 +189,12 @@ static TIMER_CALLBACK( stv_bankswitch_state )
if(state->m_prev_bankswitch != param)
{
- game_region = machine.region(banknames[param])->base();
+ game_region = machine.root_device().memregion(banknames[param])->base();
if (game_region)
- memcpy(machine.region("abus")->base(), game_region, 0x3000000);
+ memcpy(machine.root_device().memregion("abus")->base(), game_region, 0x3000000);
else
- memset(machine.region("abus")->base(), 0x00, 0x3000000);
+ memset(machine.root_device().memregion("abus")->base(), 0x00, 0x3000000);
state->m_prev_bankswitch = param;
}
diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c
index 82dec0a4a93..c0f52298056 100644
--- a/src/mame/machine/snes.c
+++ b/src/mame/machine/snes.c
@@ -1998,7 +1998,7 @@ DRIVER_INIT( snes )
UINT16 total_blocks, read_blocks;
UINT8 *rom;
- rom = machine.region("user3")->base();
+ rom = machine.root_device().memregion("user3")->base();
snes_ram = auto_alloc_array_clear(machine, UINT8, 0x1400000);
/* all NSS games seem to use MODE 20 */
@@ -2007,7 +2007,7 @@ DRIVER_INIT( snes )
state->m_has_addon_chip = HAS_NONE;
/* Find the number of blocks in this ROM */
- total_blocks = (machine.region("user3")->bytes() / 0x8000);
+ total_blocks = (state->memregion("user3")->bytes() / 0x8000);
read_blocks = 0;
/* Loading all the data blocks from cart, we only partially cover banks 0x00 to 0x7f. Therefore, we
@@ -2064,7 +2064,7 @@ DRIVER_INIT( snes_hirom )
UINT16 total_blocks, read_blocks;
UINT8 *rom;
- rom = machine.region("user3")->base();
+ rom = machine.root_device().memregion("user3")->base();
snes_ram = auto_alloc_array(machine, UINT8, 0x1400000);
memset(snes_ram, 0, 0x1400000);
@@ -2073,7 +2073,7 @@ DRIVER_INIT( snes_hirom )
state->m_has_addon_chip = HAS_NONE;
/* Find the number of blocks in this ROM */
- total_blocks = (machine.region("user3")->bytes() / 0x10000);
+ total_blocks = (state->memregion("user3")->bytes() / 0x10000);
read_blocks = 0;
/* See above for details about the way we fill banks 0x00 to 0x7f */
diff --git a/src/mame/machine/snes7110.c b/src/mame/machine/snes7110.c
index 721683f577e..7f6de55d5e1 100644
--- a/src/mame/machine/snes7110.c
+++ b/src/mame/machine/snes7110.c
@@ -276,7 +276,7 @@ static void SPC7110Decomp_write(SPC7110Decomp *thisptr, UINT8 data)
static UINT8 SPC7110Decomp_dataread(SPC7110Decomp *thisptr)
{
- UINT8 *ROM = thisptr->machine().region("cart")->base();
+ UINT8 *ROM = thisptr->machine().root_device().memregion("cart")->base();
UINT32 size = thisptr->rom_size - 0x100000;
while(thisptr->decomp_offset >= size)
{
@@ -1071,7 +1071,7 @@ static void spc7110_update_time(running_machine &machine, UINT8 offset)
static UINT8 spc7110_mmio_read(address_space *space, UINT32 addr)
{
running_machine &machine = space->machine();
- UINT8 *ROM = machine.region("cart")->base();
+ UINT8 *ROM = machine.root_device().memregion("cart")->base();
addr &= 0xffff;
@@ -1257,7 +1257,7 @@ static UINT8 spc7110_mmio_read(address_space *space, UINT32 addr)
static void spc7110_mmio_write(running_machine &machine, UINT32 addr, UINT8 data)
{
- UINT8 *ROM = machine.region("cart")->base();
+ UINT8 *ROM = machine.root_device().memregion("cart")->base();
addr &= 0xffff;
@@ -1643,7 +1643,7 @@ static void spc7110_mmio_write(running_machine &machine, UINT32 addr, UINT8 data
static UINT8 spc7110_bank7_read(address_space *space, UINT32 offset)
{
- UINT8 *ROM = space->machine().region("cart")->base();
+ UINT8 *ROM = space->machine().root_device().memregion("cart")->base();
UINT32 addr = offset & 0x0fffff;
switch (offset & 0xf00000)
diff --git a/src/mame/machine/snesbsx.c b/src/mame/machine/snesbsx.c
index 3a3266faee5..7fec8916d69 100644
--- a/src/mame/machine/snesbsx.c
+++ b/src/mame/machine/snesbsx.c
@@ -48,7 +48,7 @@ static struct _snes_bsx_state bsx_state;
static void bsx_update_memory_map(void)
{
bsx_state.ram_source = BIT(bsx_state.cart_regs[0x01], 7) ? SNES_BSX_PRAM : SNES_BSX_FLASH;
-// UINT8 *RAM = (bsx_state.cart_regs[0x01] & 0x80) == 0x00 ? space->machine().region("flash")->base() : bsx_state.pram;
+// UINT8 *RAM = (bsx_state.cart_regs[0x01] & 0x80) == 0x00 ? space->machine().root_device().memregion("flash")->base() : bsx_state.pram;
logerror("BSX: updated memory map, current RAM: %d", bsx_state.ram_source);
if (!BIT(bsx_state.cart_regs[0x02], 7))
@@ -149,7 +149,7 @@ static void bsx_init( running_machine &machine )
#ifdef UNUSED_FUNCTION
static READ8_HANDLER( bsx_flash_read )
{
- UINT8 *FLASH = space->machine().region("flash")->base();
+ UINT8 *FLASH = space->machine().root_device().memregion("flash")->base();
if (offset == 0x0002)
{
diff --git a/src/mame/machine/snessdd1.c b/src/mame/machine/snessdd1.c
index c42c3df779b..fcf229b518e 100644
--- a/src/mame/machine/snessdd1.c
+++ b/src/mame/machine/snessdd1.c
@@ -662,7 +662,7 @@ static void sdd1_mmio_write(address_space *space, UINT32 addr, UINT8 data)
static UINT8 sdd1_read(running_machine& machine, UINT32 addr)
{
- unsigned char *ROM = machine.region("cart")->base();
+ unsigned char *ROM = machine.root_device().memregion("cart")->base();
if(snes_sdd1.sdd1_enable & snes_sdd1.xfer_enable)
{
diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c
index 95d7bf5e806..987cd0f377a 100644
--- a/src/mame/machine/starwars.c
+++ b/src/mame/machine/starwars.c
@@ -153,7 +153,7 @@ WRITE8_MEMBER(starwars_state::starwars_adc_select_w)
void starwars_mproc_init(running_machine &machine)
{
starwars_state *state = machine.driver_data<starwars_state>();
- UINT8 *src = machine.region("user2")->base();
+ UINT8 *src = state->memregion("user2")->base();
int cnt, val;
state->m_PROM_STR = auto_alloc_array(machine, UINT8, 1024);
diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c
index 65af9f87f77..bb351f5c756 100644
--- a/src/mame/machine/stfight.c
+++ b/src/mame/machine/stfight.c
@@ -40,7 +40,7 @@ DRIVER_INIT( empcity )
{
stfight_state *state = machine.driver_data<stfight_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;
state->m_decrypt = auto_alloc_array(machine, UINT8, 0x8000);
@@ -103,7 +103,7 @@ MACHINE_RESET( stfight )
// - in fact I don't even know how/where it's switched in!
WRITE8_MEMBER(stfight_state::stfight_bank_w)
{
- UINT8 *ROM2 = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *ROM2 = memregion("maincpu")->base() + 0x10000;
membank("bank1")->set_base(&ROM2[data<<14] );
}
@@ -192,7 +192,7 @@ static const int sampleLimits[] =
void stfight_adpcm_int(device_t *device)
{
stfight_state *state = device->machine().driver_data<stfight_state>();
- UINT8 *SAMPLES = device->machine().region("adpcm")->base();
+ UINT8 *SAMPLES = state->memregion("adpcm")->base();
int adpcm_data = SAMPLES[state->m_adpcm_data_offs & 0x7fff];
// finished playing sample?
diff --git a/src/mame/machine/stvprot.c b/src/mame/machine/stvprot.c
index 848a46561ec..83d221df4b8 100644
--- a/src/mame/machine/stvprot.c
+++ b/src/mame/machine/stvprot.c
@@ -114,7 +114,7 @@ static UINT8 char_offset; //helper to jump the decoding of the NULL chars.
static READ32_HANDLER( twcup98_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().region("abus")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -173,7 +173,7 @@ void install_twcup98_protection(running_machine &machine)
static READ32_HANDLER( sss_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().region("abus")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -238,7 +238,7 @@ void install_sss_protection(running_machine &machine)
static READ32_HANDLER( rsgun_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().region("abus")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -313,7 +313,7 @@ void install_rsgun_protection(running_machine &machine)
static READ32_HANDLER( elandore_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().region("abus")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -420,7 +420,7 @@ static const UINT32 vector_prot[] = { 0x0603B1B2,0x234 };
static READ32_HANDLER( ffreveng_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().region("abus")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -485,11 +485,11 @@ static READ32_HANDLER(astrass_prot_r)
if ( offset == 3 && ctrl_index != -1 )
{
UINT32 data = 0;
- UINT32 *prot_data = (UINT32 *)space->machine().region("user2")->base();
+ UINT32 *prot_data = (UINT32 *)space->machine().root_device().memregion("user2")->base();
data = prot_data[ctrl_index++];
- if ( ctrl_index >= space->machine().region("user2")->bytes()/4 )
+ if ( ctrl_index >= space->machine().root_device().memregion("user2")->bytes()/4 )
{
ctrl_index = -1;
}
@@ -533,7 +533,7 @@ static READ32_HANDLER( decathlt_prot_r )
{
// the offsets written to the protection device definitely only refer to 2 of the roms
// it's a fair assumption to say that only those 2 are connected to the protection device
- UINT8 *ROM = (UINT8 *)space->machine().region("abus")->base()+0x1000000;
+ UINT8 *ROM = (UINT8 *)space->machine().root_device().memregion("abus")->base()+0x1000000;
if (offset==2)
{
diff --git a/src/mame/machine/subsino.c b/src/mame/machine/subsino.c
index a99c9c841b1..f3e61c9e3c1 100644
--- a/src/mame/machine/subsino.c
+++ b/src/mame/machine/subsino.c
@@ -85,7 +85,7 @@ void subsino_decrypt(running_machine& machine, void (*bitswaps)(UINT8 *decrypt,
{
int i;
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8* region = machine.region("maincpu")->base();
+ UINT8* region = machine.root_device().memregion("maincpu")->base();
for (i=0;i<0x10000;i++)
{
diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c
index b96f1954237..28c95fac976 100644
--- a/src/mame/machine/taitosj.c
+++ b/src/mame/machine/taitosj.c
@@ -19,8 +19,8 @@
MACHINE_START( taitosj )
{
taitosj_state *state = machine.driver_data<taitosj_state>();
- state->membank("bank1")->configure_entry(0, machine.region("maincpu")->base() + 0x6000);
- state->membank("bank1")->configure_entry(1, machine.region("maincpu")->base() + 0x10000);
+ state->membank("bank1")->configure_entry(0, machine.root_device().memregion("maincpu")->base() + 0x6000);
+ state->membank("bank1")->configure_entry(1, state->memregion("maincpu")->base() + 0x10000);
state->save_item(NAME(state->m_fromz80));
state->save_item(NAME(state->m_toz80));
diff --git a/src/mame/machine/tatsumi.c b/src/mame/machine/tatsumi.c
index 6d96fab2cec..a111037f039 100644
--- a/src/mame/machine/tatsumi.c
+++ b/src/mame/machine/tatsumi.c
@@ -293,7 +293,7 @@ WRITE16_MEMBER(tatsumi_state::cyclwarr_control_w)
READ16_MEMBER(tatsumi_state::tatsumi_v30_68000_r)
{
- const UINT16* rom=(UINT16*)machine().region("sub")->base();
+ const UINT16* rom=(UINT16*)machine().root_device().memregion("sub")->base();
logerror("%05X:68000_r(%04X),cw=%04X\n", cpu_get_pc(&space.device()), offset*2, m_control_word);
/* Read from 68k RAM */
@@ -302,7 +302,7 @@ logerror("%05X:68000_r(%04X),cw=%04X\n", cpu_get_pc(&space.device()), offset*2,
// hack to make roundup 5 boot
if (cpu_get_pc(&space.device())==0xec575)
{
- UINT8 *dst = machine().region("maincpu")->base();
+ UINT8 *dst = memregion("maincpu")->base();
dst[BYTE_XOR_LE(0xec57a)]=0x46;
dst[BYTE_XOR_LE(0xec57b)]=0x46;
diff --git a/src/mame/machine/theglobp.c b/src/mame/machine/theglobp.c
index ba4e5dc5136..501f6eebf35 100644
--- a/src/mame/machine/theglobp.c
+++ b/src/mame/machine/theglobp.c
@@ -71,7 +71,7 @@ static void theglobp_decrypt_rom_8(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
@@ -108,7 +108,7 @@ static void theglobp_decrypt_rom_9(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -143,7 +143,7 @@ static void theglobp_decrypt_rom_A(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -178,7 +178,7 @@ static void theglobp_decrypt_rom_B(running_machine &machine)
int mem;
UINT8 *RAM;
- RAM = machine.region("maincpu")->base();
+ RAM = machine.root_device().memregion("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -238,7 +238,7 @@ READ8_HANDLER( theglobp_decrypt_rom )
MACHINE_START( theglobp )
{
pacman_state *state = machine.driver_data<pacman_state>();
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c
index cf2b847ede1..8106f3cd9e2 100644
--- a/src/mame/machine/tnzs.c
+++ b/src/mame/machine/tnzs.c
@@ -535,7 +535,7 @@ DRIVER_INIT( tnzsb )
DRIVER_INIT( kabukiz )
{
tnzs_state *state = machine.driver_data<tnzs_state>();
- UINT8 *SOUND = machine.region("audiocpu")->base();
+ UINT8 *SOUND = state->memregion("audiocpu")->base();
state->m_mcu_type = MCU_NONE_KABUKIZ;
state->membank("bank3")->configure_entries(0, 8, &SOUND[0x10000], 0x4000);
@@ -671,8 +671,8 @@ static void tnzs_postload(running_machine &machine)
MACHINE_START( tnzs )
{
tnzs_state *state = machine.driver_data<tnzs_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *SUB = machine.region("sub")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *SUB = state->memregion("sub")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank2")->configure_entries(0, 4, &SUB[0x10000], 0x2000);
@@ -709,8 +709,8 @@ MACHINE_START( tnzs )
MACHINE_START( jpopnics )
{
tnzs_state *state = machine.driver_data<tnzs_state>();
- UINT8 *ROM = machine.region("maincpu")->base();
- UINT8 *SUB = machine.region("sub")->base();
+ UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *SUB = state->memregion("sub")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
state->membank("bank2")->configure_entries(0, 4, &SUB[0x10000], 0x2000);
diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c
index b78a050b9bd..3cd95b30866 100644
--- a/src/mame/machine/tx1.c
+++ b/src/mame/machine/tx1.c
@@ -421,7 +421,7 @@ static void tx1_update_state(running_machine &machine)
tx1_state *state = machine.driver_data<tx1_state>();
math_t &math = state->m_math;
- const UINT16 *prom = (UINT16*)machine.region("au_data")->base() + (0x8000 >> 1);
+ const UINT16 *prom = (UINT16*)state->memregion("au_data")->base() + (0x8000 >> 1);
for (;;)
{
@@ -479,7 +479,7 @@ static void tx1_update_state(running_machine &machine)
data = math.muxlatch;
else if (dsel == 1)
{
- UINT16 *romdata = (UINT16*)machine.region("au_data")->base();
+ UINT16 *romdata = (UINT16*)machine.root_device().memregion("au_data")->base();
UINT16 addr = get_tx1_datarom_addr(math);
data = romdata[addr];
}
@@ -656,7 +656,7 @@ READ16_MEMBER(tx1_state::tx1_math_r)
TODO make this constant somewhere
e.g. math.retval = math.romptr[ get_tx1_datarom_addr() ];
*/
- UINT16 *romdata = (UINT16*)machine().region("au_data")->base();
+ UINT16 *romdata = (UINT16*)machine().root_device().memregion("au_data")->base();
UINT16 addr = get_tx1_datarom_addr(math);
math.retval = romdata[addr];
}
@@ -804,7 +804,7 @@ WRITE16_MEMBER(tx1_state::tx1_math_w)
READ16_MEMBER(tx1_state::tx1_spcs_rom_r)
{
math_t &math = m_math;
- math.cpulatch = *(UINT16*)((UINT8*)machine().region("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
+ math.cpulatch = *(UINT16*)((UINT8*)machine().root_device().memregion("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
if (math.mux == TX1_SEL_ILDEN)
{
@@ -984,7 +984,7 @@ static void buggyboy_update_state(running_machine &machine)
tx1_state *state = machine.driver_data<tx1_state>();
math_t &math = state->m_math;
- const UINT16 *prom = (UINT16*)machine.region("au_data")->base() + (0x8000 >> 1);
+ const UINT16 *prom = (UINT16*)state->memregion("au_data")->base() + (0x8000 >> 1);
for (;;)
{
@@ -1017,7 +1017,7 @@ static void buggyboy_update_state(running_machine &machine)
if (math.mux == BB_MUX_DPROE)
{
- UINT16 *romdata = (UINT16*)machine.region("au_data")->base();
+ UINT16 *romdata = (UINT16*)machine.root_device().memregion("au_data")->base();
UINT16 addr = get_bb_datarom_addr(math);
kick_sn74s516(machine, &romdata[addr], ins);
}
@@ -1133,7 +1133,7 @@ READ16_MEMBER(tx1_state::buggyboy_math_r)
/* /DPROE */
else if ((offset & 0xc00) == 0xc00)
{
- UINT16 *romdata = (UINT16*)machine().region("au_data")->base();
+ UINT16 *romdata = (UINT16*)machine().root_device().memregion("au_data")->base();
UINT16 addr = get_bb_datarom_addr(math);
math.retval = romdata[addr];
@@ -1266,7 +1266,7 @@ WRITE16_MEMBER(tx1_state::buggyboy_math_w)
READ16_MEMBER(tx1_state::buggyboy_spcs_rom_r)
{
math_t &math = m_math;
- math.cpulatch = *(UINT16*)((UINT8*)machine().region("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
+ math.cpulatch = *(UINT16*)((UINT8*)machine().root_device().memregion("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
if (math.mux == BB_MUX_ILDEN)
{
diff --git a/src/mame/machine/vectrex.c b/src/mame/machine/vectrex.c
index f1ba3305675..4350fa79dcf 100644
--- a/src/mame/machine/vectrex.c
+++ b/src/mame/machine/vectrex.c
@@ -67,7 +67,7 @@ static int vectrex_verify_cart(char *data)
DEVICE_IMAGE_LOAD(vectrex_cart)
{
vectrex_state *state = image.device().machine().driver_data<vectrex_state>();
- UINT8 *mem = image.device().machine().region("maincpu")->base();
+ UINT8 *mem = state->memregion("maincpu")->base();
if (image.software_entry() == NULL)
{
image.fread( mem, 0x8000);
diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c
index 787bca931ca..d426e2d3a3c 100644
--- a/src/mame/machine/vsnes.c
+++ b/src/mame/machine/vsnes.c
@@ -202,8 +202,8 @@ MACHINE_START( vsnes )
ppu1_space->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),state), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),state));
- state->m_vrom[0] = machine.region("gfx1")->base();
- state->m_vrom_size[0] = machine.region("gfx1")->bytes();
+ state->m_vrom[0] = machine.root_device().memregion("gfx1")->base();
+ state->m_vrom_size[0] = state->memregion("gfx1")->bytes();
state->m_vrom_banks = state->m_vrom_size[0] / 0x400;
/* establish chr banks */
@@ -227,10 +227,10 @@ MACHINE_START( vsnes )
MACHINE_START( vsdual )
{
vsnes_state *state = machine.driver_data<vsnes_state>();
- state->m_vrom[0] = machine.region("gfx1")->base();
- state->m_vrom[1] = machine.region("gfx2")->base();
- state->m_vrom_size[0] = machine.region("gfx1")->bytes();
- state->m_vrom_size[1] = machine.region("gfx2")->bytes();
+ state->m_vrom[0] = machine.root_device().memregion("gfx1")->base();
+ state->m_vrom[1] = machine.root_device().memregion("gfx2")->base();
+ state->m_vrom_size[0] = machine.root_device().memregion("gfx1")->bytes();
+ state->m_vrom_size[1] = state->memregion("gfx2")->bytes();
/* establish nametable ram */
state->m_nt_ram[0] = auto_alloc_array(machine, UINT8, 0x1000);
@@ -419,7 +419,7 @@ WRITE8_MEMBER(vsnes_state::vskonami_rom_banking)
case 2: /* code bank 1 */
case 4: /* code bank 2 */
{
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
memcpy(&prg[0x08000 + reg * 0x1000], &prg[bankoffset], 0x2000);
}
break;
@@ -438,7 +438,7 @@ DRIVER_INIT( vskonami )
{
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = machine.root_device().memregion("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x18000], 0x8000);
/* banking is done with writes to the $8000-$ffff area */
@@ -454,7 +454,7 @@ WRITE8_MEMBER(vsnes_state::vsgshoe_gun_in0_w)
int addr;
if((data & 0x04) != m_old_bank)
{
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
m_old_bank = data & 0x04;
addr = m_old_bank ? 0x12000: 0x10000;
memcpy(&prg[0x08000], &prg[addr], 0x2000);
@@ -467,7 +467,7 @@ DRIVER_INIT( vsgshoe )
{
vsnes_state *state = machine.driver_data<vsnes_state>();
/* set up the default bank */
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = state->memregion("maincpu")->base();
memcpy (&prg[0x08000], &prg[0x12000], 0x2000);
/* vrom switching is enabled with bit 2 of $4016 */
@@ -562,7 +562,7 @@ WRITE8_MEMBER(vsnes_state::drmario_rom_banking)
case 3: /* program banking */
{
int bank = (m_drmario_shiftreg & 0x03) * 0x4000;
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
if (!m_size16k)
{
@@ -596,7 +596,7 @@ DRIVER_INIT( drmario )
vsnes_state *state = machine.driver_data<vsnes_state>();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = state->memregion("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x10000], 0x4000);
memcpy(&prg[0x0c000], &prg[0x1c000], 0x4000);
@@ -613,7 +613,7 @@ DRIVER_INIT( drmario )
WRITE8_MEMBER(vsnes_state::vsvram_rom_banking)
{
int rombank = 0x10000 + (data & 7) * 0x4000;
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
memcpy(&prg[0x08000], &prg[rombank], 0x4000);
}
@@ -622,7 +622,7 @@ DRIVER_INIT( vsvram )
{
vsnes_state *state = machine.driver_data<vsnes_state>();
/* when starting the game, the 1st 16k and the last 16k are loaded into the 2 banks */
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = state->memregion("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
/* banking is done with writes to the $8000-$ffff area */
@@ -638,7 +638,7 @@ DRIVER_INIT( vsvram )
static void mapper4_set_prg( running_machine &machine )
{
vsnes_state *state = machine.driver_data<vsnes_state>();
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = state->memregion("maincpu")->base();
UINT8 prg_flip = (state->m_MMC3_cmd & 0x40) ? 2 : 0;
memcpy(&prg[0x8000], &prg[0x2000 * (state->m_MMC3_prg_bank[0 ^ prg_flip] & state->m_MMC3_prg_mask) + 0x10000], 0x2000);
@@ -773,9 +773,9 @@ WRITE8_MEMBER(vsnes_state::mapper4_w)
DRIVER_INIT( MMC3 )
{
vsnes_state *state = machine.driver_data<vsnes_state>();
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = machine.root_device().memregion("maincpu")->base();
state->m_IRQ_enable = state->m_IRQ_count = state->m_IRQ_count_latch = 0;
- int MMC3_prg_chunks = (machine.region("maincpu")->bytes() - 0x10000) / 0x4000;
+ int MMC3_prg_chunks = (state->memregion("maincpu")->bytes() - 0x10000) / 0x4000;
state->m_MMC3_prg_bank[0] = state->m_MMC3_prg_bank[2] = 0xfe;
state->m_MMC3_prg_bank[1] = state->m_MMC3_prg_bank[3] = 0xff;
@@ -952,7 +952,7 @@ WRITE8_MEMBER(vsnes_state::mapper68_rom_banking)
case 0x7000:
{
- UINT8 *prg = machine().region("maincpu")->base();
+ UINT8 *prg = memregion("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x10000 + data * 0x4000], 0x4000);
}
break;
@@ -967,7 +967,7 @@ DRIVER_INIT( platoon )
/* when starting a mapper 68 game the first 16K ROM bank in the cart is loaded into $8000
the LAST 16K ROM bank is loaded into $C000. The last 16K of ROM cannot be swapped. */
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = machine.root_device().memregion("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x10000], 0x4000);
memcpy(&prg[0x0c000], &prg[0x2c000], 0x4000);
@@ -1026,7 +1026,7 @@ WRITE8_MEMBER(vsnes_state::vsdual_vrom_banking)
DRIVER_INIT( vsdual )
{
- UINT8 *prg = machine.region("maincpu")->base();
+ UINT8 *prg = machine.root_device().memregion("maincpu")->base();
vsnes_state *state = machine.driver_data<vsnes_state>();
/* vrom switching is enabled with bit 2 of $4016 */
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index 15d8d092a9e..d96c9c6536f 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -369,7 +369,7 @@ static MACHINE_START( williams_common )
williams_state *state = machine.driver_data<williams_state>();
/* configure the memory bank */
state->membank("bank1")->configure_entry(0, state->m_videoram);
- state->membank("bank1")->configure_entry(1, machine.region("maincpu")->base() + 0x10000);
+ state->membank("bank1")->configure_entry(1, state->memregion("maincpu")->base() + 0x10000);
state_save_register_global(machine, state->m_vram_bank);
}
@@ -467,7 +467,7 @@ MACHINE_START( williams2 )
williams_state *state = machine.driver_data<williams_state>();
/* configure memory banks */
state->membank("bank1")->configure_entry(0, state->m_videoram);
- state->membank("bank1")->configure_entries(1, 4, machine.region("maincpu")->base() + 0x10000, 0x10000);
+ state->membank("bank1")->configure_entries(1, 4, state->memregion("maincpu")->base() + 0x10000, 0x10000);
/* register for save states */
state_save_register_global(machine, state->m_vram_bank);
@@ -772,7 +772,7 @@ MACHINE_START( defender )
MACHINE_START_CALL(williams_common);
/* configure the banking and make sure it is reset to 0 */
- machine.root_device().membank("bank1")->configure_entries(0, 9, &machine.region("maincpu")->base()[0x10000], 0x1000);
+ machine.root_device().membank("bank1")->configure_entries(0, 9, &machine.root_device().memregion("maincpu")->base()[0x10000], 0x1000);
machine.save().register_postload(save_prepost_delegate(FUNC(defender_postload), &machine));
}
@@ -879,10 +879,10 @@ MACHINE_START( blaster )
/* banking is different for blaster */
state->membank("bank1")->configure_entry(0, state->m_videoram);
- state->membank("bank1")->configure_entries(1, 16, machine.region("maincpu")->base() + 0x18000, 0x4000);
+ state->membank("bank1")->configure_entries(1, 16, machine.root_device().memregion("maincpu")->base() + 0x18000, 0x4000);
state->membank("bank2")->configure_entry(0, state->m_videoram + 0x4000);
- state->membank("bank2")->configure_entries(1, 16, machine.region("maincpu")->base() + 0x10000, 0x0000);
+ state->membank("bank2")->configure_entries(1, 16, state->memregion("maincpu")->base() + 0x10000, 0x0000);
state_save_register_global(machine, state->m_blaster_bank);
}
diff --git a/src/mame/machine/wrally.c b/src/mame/machine/wrally.c
index 2033075d517..5361bffb224 100644
--- a/src/mame/machine/wrally.c
+++ b/src/mame/machine/wrally.c
@@ -33,7 +33,7 @@ WRITE16_MEMBER(wrally_state::wrally_flipscreen_w)
WRITE16_MEMBER(wrally_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = machine().region("oki")->base();
+ UINT8 *RAM = memregion("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
diff --git a/src/mame/video/1942.c b/src/mame/video/1942.c
index 184e84bbf69..7b274d6d736 100644
--- a/src/mame/video/1942.c
+++ b/src/mame/video/1942.c
@@ -26,7 +26,7 @@
PALETTE_INIT( 1942 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
rgb_t palette[256];
int i, colorbase;
diff --git a/src/mame/video/1943.c b/src/mame/video/1943.c
index 4cd7462044f..53d34c04d8a 100644
--- a/src/mame/video/1943.c
+++ b/src/mame/video/1943.c
@@ -47,7 +47,7 @@ other 2 bits (output & 0x0c) unknown
PALETTE_INIT( 1943 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -167,7 +167,7 @@ WRITE8_MEMBER(_1943_state::c1943_d806_w)
static TILE_GET_INFO( c1943_get_bg2_tile_info )
{
- UINT8 *tilerom = machine.region("gfx5")->base() + 0x8000;
+ UINT8 *tilerom = machine.root_device().memregion("gfx5")->base() + 0x8000;
int offs = tile_index * 2;
int attr = tilerom[offs + 1];
@@ -180,7 +180,7 @@ static TILE_GET_INFO( c1943_get_bg2_tile_info )
static TILE_GET_INFO( c1943_get_bg_tile_info )
{
- UINT8 *tilerom = machine.region("gfx5")->base();
+ UINT8 *tilerom = machine.root_device().memregion("gfx5")->base();
int offs = tile_index * 2;
int attr = tilerom[offs + 1];
diff --git a/src/mame/video/20pacgal.c b/src/mame/video/20pacgal.c
index ca73abcf9c4..2978d2c70b8 100644
--- a/src/mame/video/20pacgal.c
+++ b/src/mame/video/20pacgal.c
@@ -25,7 +25,7 @@
static void get_pens(running_machine &machine, const _20pacgal_state *state, pen_t *pens)
{
offs_t offs;
- UINT8 *color_prom = machine.region("proms")->base() + (NUM_PENS * state->m_game_selected);
+ UINT8 *color_prom = machine.root_device().memregion("proms")->base() + (NUM_PENS * state->m_game_selected);
for (offs = 0; offs < NUM_PENS ;offs++)
{
diff --git a/src/mame/video/40love.c b/src/mame/video/40love.c
index cad9762a406..7ab8901fe1b 100644
--- a/src/mame/video/40love.c
+++ b/src/mame/video/40love.c
@@ -12,7 +12,7 @@
PALETTE_INIT( fortyl )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/8080bw.c b/src/mame/video/8080bw.c
index 39b15ad0ab5..3d3bd26022b 100644
--- a/src/mame/video/8080bw.c
+++ b/src/mame/video/8080bw.c
@@ -122,7 +122,7 @@ SCREEN_UPDATE_RGB32( invadpt2 )
invadpt2_get_pens(pens);
- prom = screen.machine().region("proms")->base();
+ prom = state->memregion("proms")->base();
color_map_base = state->m_color_map ? &prom[0x0400] : &prom[0x0000];
for (offs = 0; offs < state->m_main_ram.bytes(); offs++)
@@ -154,7 +154,7 @@ SCREEN_UPDATE_RGB32( ballbomb )
invadpt2_get_pens(pens);
- prom = screen.machine().region("proms")->base();
+ prom = state->memregion("proms")->base();
color_map_base = state->m_color_map ? &prom[0x0400] : &prom[0x0000];
for (offs = 0; offs < state->m_main_ram.bytes(); offs++)
@@ -186,7 +186,7 @@ SCREEN_UPDATE_RGB32( schaser )
invadpt2_get_pens(pens);
- background_map_base = screen.machine().region("proms")->base();
+ background_map_base = state->memregion("proms")->base();
for (offs = 0; offs < state->m_main_ram.bytes(); offs++)
{
@@ -279,8 +279,8 @@ SCREEN_UPDATE_RGB32( polaris )
invadpt2_get_pens(pens);
- color_map_base = screen.machine().region("proms")->base();
- cloud_gfx = screen.machine().region("user1")->base();
+ color_map_base = screen.machine().root_device().memregion("proms")->base();
+ cloud_gfx = state->memregion("user1")->base();
for (offs = 0; offs < state->m_main_ram.bytes(); offs++)
{
@@ -403,7 +403,7 @@ SCREEN_UPDATE_RGB32( indianbt )
cosmo_get_pens(pens);
- prom = screen.machine().region("proms")->base();
+ prom = state->memregion("proms")->base();
color_map_base = state->m_color_map ? &prom[0x0400] : &prom[0x0000];
for (offs = 0; offs < state->m_main_ram.bytes(); offs++)
diff --git a/src/mame/video/aerofgt.c b/src/mame/video/aerofgt.c
index 39adde0e215..cc15d33a467 100644
--- a/src/mame/video/aerofgt.c
+++ b/src/mame/video/aerofgt.c
@@ -139,7 +139,7 @@ VIDEO_START( spinlbrk )
/* sprite maps are hardcoded in this game */
/* enemy sprites use ROM instead of RAM */
- state->m_spriteram2.set_target(reinterpret_cast<UINT16 *>(machine.region("gfx5")->base()), 0x20000);
+ state->m_spriteram2.set_target(reinterpret_cast<UINT16 *>(state->memregion("gfx5")->base()), 0x20000);
/* front sprites are direct maps */
state->m_spriteram1.set_target(state->m_spriteram2 + state->m_spriteram2.bytes() / 2, 0x4000);
@@ -682,7 +682,7 @@ static void spikes91_draw_sprites( running_machine &machine, bitmap_ind16 &bitma
aerofgt_state *state = machine.driver_data<aerofgt_state>();
int i;
UINT8 *lookup;
- lookup = machine.region("user1")->base();
+ lookup = state->memregion("user1")->base();
state->m_spritepalettebank = 1;
for (i = state->m_spriteram3.bytes() / 2 - 4; i >= 4; i -= 4)
diff --git a/src/mame/video/alpha68k.c b/src/mame/video/alpha68k.c
index 58fe06e83c6..4934801151c 100644
--- a/src/mame/video/alpha68k.c
+++ b/src/mame/video/alpha68k.c
@@ -342,7 +342,7 @@ static void draw_sprites_I( running_machine &machine, bitmap_ind16 &bitmap, cons
alpha68k_state *state = machine.driver_data<alpha68k_state>();
UINT16 *spriteram = state->m_spriteram;
int data, offs, mx, my, tile, color, fy, i;
- UINT8 *color_prom = machine.region("user1")->base();
+ UINT8 *color_prom = state->memregion("user1")->base();
gfx_element *gfx = machine.gfx[0];
for (offs = 0; offs < 0x400; offs += 0x20)
@@ -383,7 +383,7 @@ SCREEN_UPDATE_IND16( alpha68k_I )
PALETTE_INIT( kyros )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -411,7 +411,7 @@ PALETTE_INIT( kyros )
PALETTE_INIT( paddlem )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -453,7 +453,7 @@ static void kyros_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,
UINT16 *spriteram = state->m_spriteram;
int offs, mx, my, color, tile, i, bank, fy, fx;
int data;
- UINT8 *color_prom = machine.region("user1")->base();
+ UINT8 *color_prom = state->memregion("user1")->base();
//AT
for (offs = 0; offs < 0x400; offs += 0x20)
diff --git a/src/mame/video/ambush.c b/src/mame/video/ambush.c
index 2a938eed9d8..1bcc5516c3b 100644
--- a/src/mame/video/ambush.c
+++ b/src/mame/video/ambush.c
@@ -20,7 +20,7 @@
PALETTE_INIT( ambush )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/ampoker2.c b/src/mame/video/ampoker2.c
index 0b1701f7912..5a529daa30e 100644
--- a/src/mame/video/ampoker2.c
+++ b/src/mame/video/ampoker2.c
@@ -73,7 +73,7 @@
PALETTE_INIT( ampoker2 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* - bits -
76543210
RRRGGGBB
diff --git a/src/mame/video/appoooh.c b/src/mame/video/appoooh.c
index ecd84c1b013..7d26f28434b 100644
--- a/src/mame/video/appoooh.c
+++ b/src/mame/video/appoooh.c
@@ -22,7 +22,7 @@
PALETTE_INIT( appoooh )
{
- 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++)
@@ -61,7 +61,7 @@ PALETTE_INIT( appoooh )
PALETTE_INIT( robowres )
{
- 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++)
@@ -195,7 +195,7 @@ WRITE8_MEMBER(appoooh_state::appoooh_out_w)
/* bit 6 ROM bank select */
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
membank("bank1")->set_base(&RAM[data&0x40 ? 0x10000 : 0x0a000]);
}
diff --git a/src/mame/video/arabian.c b/src/mame/video/arabian.c
index 8e8589b0d20..47a6759cec1 100644
--- a/src/mame/video/arabian.c
+++ b/src/mame/video/arabian.c
@@ -154,7 +154,7 @@ PALETTE_INIT( arabian )
VIDEO_START( arabian )
{
arabian_state *state = machine.driver_data<arabian_state>();
- UINT8 *gfxbase = machine.region("gfx1")->base();
+ UINT8 *gfxbase = state->memregion("gfx1")->base();
int offs;
/* allocate a common bitmap to use for both planes */
diff --git a/src/mame/video/archimds.c b/src/mame/video/archimds.c
index 8b436ce1e83..091eac673bd 100644
--- a/src/mame/video/archimds.c
+++ b/src/mame/video/archimds.c
@@ -43,7 +43,7 @@ SCREEN_UPDATE_RGB32( archimds_vidc )
int count;
int x,y,xi;
UINT8 pen;
- static UINT8 *vram = screen.machine().region("vram")->base();
+ static UINT8 *vram = screen.machine().root_device().memregion("vram")->base();
count = (0);
diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c
index a31c19b1659..0edc4eb4665 100644
--- a/src/mame/video/argus.c
+++ b/src/mame/video/argus.c
@@ -369,8 +369,8 @@ static void argus_write_dummy_rams(running_machine &machine, int dramoffs, int v
int voffs;
int offs;
- UINT8 *VROM1 = machine.region("user1")->base(); /* "ag_15.bin" */
- UINT8 *VROM2 = machine.region("user2")->base(); /* "ag_16.bin" */
+ UINT8 *VROM1 = machine.root_device().memregion("user1")->base(); /* "ag_15.bin" */
+ UINT8 *VROM2 = state->memregion("user2")->base(); /* "ag_16.bin" */
/* offset in pattern data */
offs = VROM1[vromoffs] | (VROM1[vromoffs + 1] << 8);
diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c
index d02a19806aa..f52eaa17a64 100644
--- a/src/mame/video/artmagic.c
+++ b/src/mame/video/artmagic.c
@@ -41,8 +41,8 @@ INLINE UINT16 *address_to_vram(artmagic_state *state, offs_t *address)
VIDEO_START( artmagic )
{
artmagic_state *state = machine.driver_data<artmagic_state>();
- state->m_blitter_base = (UINT16 *)machine.region("gfx1")->base();
- state->m_blitter_mask = machine.region("gfx1")->bytes()/2 - 1;
+ state->m_blitter_base = (UINT16 *)machine.root_device().memregion("gfx1")->base();
+ state->m_blitter_mask = state->memregion("gfx1")->bytes()/2 - 1;
state_save_register_global_array(machine, state->m_xor);
state_save_register_global(machine, state->m_is_stoneball);
diff --git a/src/mame/video/atarirle.c b/src/mame/video/atarirle.c
index 26c9c3eba38..14787981b15 100644
--- a/src/mame/video/atarirle.c
+++ b/src/mame/video/atarirle.c
@@ -273,7 +273,7 @@ static DEVICE_START( atarirle )
atarirle_data *mo = get_safe_token(device);
running_machine &machine = device->machine();
const atarirle_desc *desc = (const atarirle_desc *)device->static_config();
- const UINT16 *base = (const UINT16 *)machine.region(desc->region)->base();
+ const UINT16 *base = (const UINT16 *)machine.root_device().memregion(desc->region)->base();
int i, width, height;
/* build and allocate the generic tables */
@@ -303,7 +303,7 @@ static DEVICE_START( atarirle )
mo->maxcolors = desc->maxcolors / 16;
mo->rombase = base;
- mo->romlength = machine.region(desc->region)->bytes();
+ mo->romlength = machine.root_device().memregion(desc->region)->bytes();
mo->objectcount = count_objects(base, mo->romlength);
mo->cliprect = machine.primary_screen->visible_area();
diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c
index b5502117125..f938b93b437 100644
--- a/src/mame/video/atarisy1.c
+++ b/src/mame/video/atarisy1.c
@@ -557,8 +557,8 @@ SCREEN_UPDATE_IND16( atarisy1 )
static void decode_gfx(running_machine &machine, UINT16 *pflookup, UINT16 *molookup)
{
atarisy1_state *state = machine.driver_data<atarisy1_state>();
- UINT8 *prom1 = &machine.region("proms")->u8(0x000);
- UINT8 *prom2 = &machine.region("proms")->u8(0x200);
+ UINT8 *prom1 = &machine.root_device().memregion("proms")->u8(0x000);
+ UINT8 *prom2 = &state->memregion("proms")->u8(0x200);
int obj, i;
/* reset the globals */
@@ -649,7 +649,7 @@ static int get_bank(running_machine &machine, UINT8 prom1, UINT8 prom2, int bpp)
return state->m_bank_gfx[bpp - 4][bank_index];
/* if the bank is out of range, call it 0 */
- const memory_region *tiles = machine.region("tiles");
+ memory_region *tiles = machine.root_device().memregion("tiles");
if (0x80000 * (bank_index - 1) >= tiles->bytes())
return 0;
diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c
index fc1e2302e42..2d3d10a7a32 100644
--- a/src/mame/video/avgdvg.c
+++ b/src/mame/video/avgdvg.c
@@ -484,7 +484,7 @@ static void mhavoc_data(vgdata *vg)
if (vg->pc & 0x2000)
{
- bank = &vg->machine().region("alpha")->base()[0x18000];
+ bank = &vg->machine().root_device().memregion("alpha")->base()[0x18000];
vg->data = bank[(vg->map << 13) | ((vg->pc ^ 1) & 0x1fff)];
}
else
@@ -1206,7 +1206,7 @@ static TIMER_CALLBACK( vg_set_halt_callback )
static TIMER_CALLBACK( run_state_machine )
{
int cycles = 0;
- UINT8 *state_prom = machine.region("user1")->base();
+ UINT8 *state_prom = machine.root_device().memregion("user1")->base();
while (cycles < VGSLICE)
{
diff --git a/src/mame/video/bagman.c b/src/mame/video/bagman.c
index f4ec08cbe17..7b6849950fa 100644
--- a/src/mame/video/bagman.c
+++ b/src/mame/video/bagman.c
@@ -44,7 +44,7 @@ WRITE8_MEMBER(bagman_state::bagman_colorram_w)
***************************************************************************/
PALETTE_INIT( bagman )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
diff --git a/src/mame/video/balsente.c b/src/mame/video/balsente.c
index 66ec2c1a05c..416bec6ceba 100644
--- a/src/mame/video/balsente.c
+++ b/src/mame/video/balsente.c
@@ -22,12 +22,12 @@ VIDEO_START( balsente )
/* reset the system */
state->m_palettebank_vis = 0;
- state->m_sprite_bank[0] = machine.region("gfx1")->base();
- state->m_sprite_bank[1] = machine.region("gfx1")->base() + 0x10000;
+ state->m_sprite_bank[0] = machine.root_device().memregion("gfx1")->base();
+ state->m_sprite_bank[1] = machine.root_device().memregion("gfx1")->base() + 0x10000;
/* determine sprite size */
- state->m_sprite_data = machine.region("gfx1")->base();
- state->m_sprite_mask = machine.region("gfx1")->bytes() - 1;
+ state->m_sprite_data = machine.root_device().memregion("gfx1")->base();
+ state->m_sprite_mask = state->memregion("gfx1")->bytes() - 1;
/* register for saving */
state->save_item(NAME(state->m_expanded_videoram));
diff --git a/src/mame/video/bankp.c b/src/mame/video/bankp.c
index 885d479da4f..e7d3d1e9099 100644
--- a/src/mame/video/bankp.c
+++ b/src/mame/video/bankp.c
@@ -35,7 +35,7 @@
PALETTE_INIT( bankp )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/baraduke.c b/src/mame/video/baraduke.c
index e7f7eeec133..caed0fc5bbd 100644
--- a/src/mame/video/baraduke.c
+++ b/src/mame/video/baraduke.c
@@ -17,7 +17,7 @@
PALETTE_INIT( baraduke )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int bit0,bit1,bit2,bit3,r,g,b;
diff --git a/src/mame/video/bbusters.c b/src/mame/video/bbusters.c
index 01bbceaed60..6d2628e9f52 100644
--- a/src/mame/video/bbusters.c
+++ b/src/mame/video/bbusters.c
@@ -203,7 +203,7 @@ static void bbusters_draw_block(running_machine &machine, bitmap_ind16 &dest,int
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const UINT16 *source, int bank, int colval, int colmask)
{
bbusters_state *state = machine.driver_data<bbusters_state>();
- const UINT8 *scale_table=machine.region("user1")->base();
+ const UINT8 *scale_table=state->memregion("user1")->base();
int offs;
for (offs = 0;offs <0x800 ;offs += 4) {
diff --git a/src/mame/video/bfm_adr2.c b/src/mame/video/bfm_adr2.c
index d70105531ea..3fc7b7d7e6f 100644
--- a/src/mame/video/bfm_adr2.c
+++ b/src/mame/video/bfm_adr2.c
@@ -186,7 +186,7 @@ VIDEO_RESET( adder2 )
adder2_data_to_sc2 = 0;
{
- UINT8 *rom = machine.region("adder2")->base();
+ UINT8 *rom = machine.root_device().memregion("adder2")->base();
machine.root_device().membank("bank2")->configure_entries(0, 4, &rom[0x00000], 0x08000);
@@ -452,7 +452,7 @@ void adder2_decode_char_roms(running_machine &machine)
{
UINT8 *p;
- p = machine.region("gfx1")->base();
+ p = machine.root_device().memregion("gfx1")->base();
if ( p )
{
diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c
index 6dc46221ce0..9ac13119773 100644
--- a/src/mame/video/bking.c
+++ b/src/mame/video/bking.c
@@ -30,7 +30,7 @@
PALETTE_INIT( bking )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 220, 390, 820 };
static const int resistances_b [2] = { 220, 390 };
double rweights[3], gweights[3], bweights[2];
@@ -315,7 +315,7 @@ SCREEN_VBLANK( bking )
if (latch != 0)
{
- const UINT8* MASK = screen.machine().region("user1")->base() + 8 * state->m_hit;
+ const UINT8* MASK = screen.machine().root_device().memregion("user1")->base() + 8 * state->m_hit;
int x;
int y;
diff --git a/src/mame/video/bladestl.c b/src/mame/video/bladestl.c
index eacc4ff002e..09ac6735278 100644
--- a/src/mame/video/bladestl.c
+++ b/src/mame/video/bladestl.c
@@ -5,7 +5,7 @@
PALETTE_INIT( bladestl )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/bogeyman.c b/src/mame/video/bogeyman.c
index 71527cad8a5..179771183fe 100644
--- a/src/mame/video/bogeyman.c
+++ b/src/mame/video/bogeyman.c
@@ -4,7 +4,7 @@
PALETTE_INIT( bogeyman )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* first 16 colors are RAM */
diff --git a/src/mame/video/bombjack.c b/src/mame/video/bombjack.c
index 0cbeaf56dfd..36959b959dc 100644
--- a/src/mame/video/bombjack.c
+++ b/src/mame/video/bombjack.c
@@ -43,7 +43,7 @@ WRITE8_MEMBER(bombjack_state::bombjack_flipscreen_w)
static TILE_GET_INFO( get_bg_tile_info )
{
bombjack_state *state = machine.driver_data<bombjack_state>();
- UINT8 *tilerom = machine.region("gfx4")->base();
+ UINT8 *tilerom = state->memregion("gfx4")->base();
int offs = (state->m_background_image & 0x07) * 0x200 + tile_index;
int code = (state->m_background_image & 0x10) ? tilerom[offs] : 0;
diff --git a/src/mame/video/bosco.c b/src/mame/video/bosco.c
index 51cadf83991..2e9c7362dd2 100644
--- a/src/mame/video/bosco.c
+++ b/src/mame/video/bosco.c
@@ -16,7 +16,7 @@
PALETTE_INIT( bosco )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 32+64);
diff --git a/src/mame/video/brkthru.c b/src/mame/video/brkthru.c
index d249d8172f0..17f695355ea 100644
--- a/src/mame/video/brkthru.c
+++ b/src/mame/video/brkthru.c
@@ -34,7 +34,7 @@
PALETTE_INIT( brkthru )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c
index cf0d5612d96..51f26b9ec53 100644
--- a/src/mame/video/btime.c
+++ b/src/mame/video/btime.c
@@ -30,7 +30,7 @@
PALETTE_INIT( btime )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
@@ -81,7 +81,7 @@ PALETTE_INIT( btime )
PALETTE_INIT( lnc )
{
- 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++)
@@ -377,7 +377,7 @@ static void draw_background( running_machine &machine, bitmap_ind16 &bitmap, con
{
btime_state *state = machine.driver_data<btime_state>();
int i;
- const UINT8 *gfx = machine.region("bg_map")->base();
+ const UINT8 *gfx = state->memregion("bg_map")->base();
int scroll = -(state->m_bnj_scroll2 | ((state->m_bnj_scroll1 & 0x03) << 8));
// One extra iteration for wrap around
diff --git a/src/mame/video/bublbobl.c b/src/mame/video/bublbobl.c
index 79d4a387763..26544466e93 100644
--- a/src/mame/video/bublbobl.c
+++ b/src/mame/video/bublbobl.c
@@ -32,7 +32,7 @@ SCREEN_UPDATE_IND16( bublbobl )
sx = 0;
- prom = screen.machine().region("proms")->base();
+ prom = state->memregion("proms")->base();
for (offs = 0; offs < state->m_objectram.bytes(); offs += 4)
{
/* skip empty sprites */
diff --git a/src/mame/video/buggychl.c b/src/mame/video/buggychl.c
index 2bac6785bed..560582c9244 100644
--- a/src/mame/video/buggychl.c
+++ b/src/mame/video/buggychl.c
@@ -166,7 +166,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
g_profiler.start(PROFILER_USER1);
- gfx = machine.region("gfx2")->base();
+ gfx = state->memregion("gfx2")->base();
for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
{
int sx, sy, flipy, zoom, ch, x, px, y;
diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c
index 7af5477b269..442b529d87a 100644
--- a/src/mame/video/bwing.c
+++ b/src/mame/video/bwing.c
@@ -125,7 +125,7 @@ WRITE8_MEMBER(bwing_state::bwing_scrollreg_w)
}
#if BW_DEBUG
- (machine().region(REGION_CPU1)->base())[0x1b10 + offset] = data;
+ (machine().root_device().memregion(REGION_CPU1)->base())[0x1b10 + offset] = data;
#endif
}
@@ -214,7 +214,7 @@ VIDEO_START( bwing )
fill_srxlat(state->m_srxlat);
- state->m_fgdata = machine.region("gpu")->base();
+ state->m_fgdata = state->memregion("gpu")->base();
state->m_bgdata = state->m_fgdata + 0x1000;
for (i = 0; i < 4; i++)
diff --git a/src/mame/video/calomega.c b/src/mame/video/calomega.c
index 1d887b293bf..7ef0c9ce574 100644
--- a/src/mame/video/calomega.c
+++ b/src/mame/video/calomega.c
@@ -70,7 +70,7 @@ SCREEN_UPDATE_IND16( calomega )
PALETTE_INIT( calomega )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* prom bits
7654 3210
---- ---x red component.
diff --git a/src/mame/video/capbowl.c b/src/mame/video/capbowl.c
index 1c5066a6761..81dffe16d23 100644
--- a/src/mame/video/capbowl.c
+++ b/src/mame/video/capbowl.c
@@ -115,7 +115,7 @@ WRITE8_MEMBER(capbowl_state::bowlrama_blitter_w)
READ8_MEMBER(capbowl_state::bowlrama_blitter_r)
{
- UINT8 data = machine().region("gfx1")->base()[m_blitter_addr];
+ UINT8 data = memregion("gfx1")->base()[m_blitter_addr];
UINT8 result = 0;
switch (offset)
diff --git a/src/mame/video/carjmbre.c b/src/mame/video/carjmbre.c
index 871c0f1a162..cae76d52c35 100644
--- a/src/mame/video/carjmbre.c
+++ b/src/mame/video/carjmbre.c
@@ -32,7 +32,7 @@ static const res_net_info carjmbre_net_info =
PALETTE_INIT( carjmbre )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &carjmbre_decode_info, &carjmbre_net_info);
diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c
index 88689720cf8..01401b66e43 100644
--- a/src/mame/video/carpolo.c
+++ b/src/mame/video/carpolo.c
@@ -66,7 +66,7 @@
PALETTE_INIT( carpolo )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* thanks to Jarek Burczynski for analyzing the circuit */
@@ -190,7 +190,7 @@ static void draw_alpha_line(running_machine &machine, bitmap_ind16 &bitmap, cons
static void remap_sprite_code(running_machine &machine, int bank, int code, int *remapped_code, int *flipy)
{
- UINT8* PROM = machine.region("user1")->base();
+ UINT8* PROM = machine.root_device().memregion("user1")->base();
code = (bank << 4) | code;
*remapped_code = PROM[code] & 0x0f;
diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c
index bfd4840ee63..94119762d01 100644
--- a/src/mame/video/cave.c
+++ b/src/mame/video/cave.c
@@ -515,8 +515,8 @@ static void get_sprite_info_cave( running_machine &machine )
{
cave_state *state = machine.driver_data<cave_state>();
pen_t base_pal = 0;
- const UINT8 *base_gfx = machine.region("sprites")->base();
- int code_max = machine.region("sprites")->bytes() / (16*16);
+ const UINT8 *base_gfx = machine.root_device().memregion("sprites")->base();
+ int code_max = state->memregion("sprites")->bytes() / (16*16);
UINT16 *source;
UINT16 *finish;
@@ -644,8 +644,8 @@ static void get_sprite_info_donpachi( running_machine &machine )
{
cave_state *state = machine.driver_data<cave_state>();
pen_t base_pal = 0;
- const UINT8 *base_gfx = machine.region("sprites")->base();
- int code_max = machine.region("sprites")->bytes() / (16*16);
+ const UINT8 *base_gfx = machine.root_device().memregion("sprites")->base();
+ int code_max = state->memregion("sprites")->bytes() / (16*16);
UINT16 *source;
UINT16 *finish;
diff --git a/src/mame/video/ccastles.c b/src/mame/video/ccastles.c
index a095ddc3b68..806efb79029 100644
--- a/src/mame/video/ccastles.c
+++ b/src/mame/video/ccastles.c
@@ -21,9 +21,9 @@ VIDEO_START( ccastles )
static const int resistances[3] = { 22000, 10000, 4700 };
/* get pointers to our PROMs */
- state->m_syncprom = machine.region("proms")->base() + 0x000;
- state->m_wpprom = machine.region("proms")->base() + 0x200;
- state->m_priprom = machine.region("proms")->base() + 0x300;
+ state->m_syncprom = machine.root_device().memregion("proms")->base() + 0x000;
+ state->m_wpprom = machine.root_device().memregion("proms")->base() + 0x200;
+ state->m_priprom = machine.root_device().memregion("proms")->base() + 0x300;
/* compute the color output resistor weights at startup */
compute_resistor_weights(0, 255, -1.0,
diff --git a/src/mame/video/cclimber.c b/src/mame/video/cclimber.c
index 8ce25a05432..2e135124ee8 100644
--- a/src/mame/video/cclimber.c
+++ b/src/mame/video/cclimber.c
@@ -38,7 +38,7 @@
***************************************************************************/
PALETTE_INIT( cclimber )
{
- 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];
@@ -115,7 +115,7 @@ PALETTE_INIT( cclimber )
PALETTE_INIT( swimmer )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -184,7 +184,7 @@ PALETTE_INIT( swimmer )
PALETTE_INIT( yamato )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* chars - 12 bits RGB */
@@ -252,7 +252,7 @@ PALETTE_INIT( yamato )
PALETTE_INIT( toprollr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0xa0; i++)
@@ -692,7 +692,7 @@ SCREEN_UPDATE_IND16( yamato )
{
cclimber_state *state = screen.machine().driver_data<cclimber_state>();
int i;
- UINT8 *sky_rom = screen.machine().region("user1")->base() + 0x1200;
+ UINT8 *sky_rom = state->memregion("user1")->base() + 0x1200;
for (i = 0; i < 0x100; i++)
{
diff --git a/src/mame/video/centiped.c b/src/mame/video/centiped.c
index 765e6de6615..dcb065cb455 100644
--- a/src/mame/video/centiped.c
+++ b/src/mame/video/centiped.c
@@ -290,7 +290,7 @@ WRITE8_MEMBER(centiped_state::centiped_paletteram_w)
PALETTE_INIT( warlords )
{
- 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++)
@@ -415,7 +415,7 @@ WRITE8_MEMBER(centiped_state::mazeinv_paletteram_w)
m_generic_paletteram_8[offset] = data;
/* the value passed in is a look-up index into the color PROM */
- melliped_mazeinv_set_color(machine(), offset, ~machine().region("proms")->base()[~data & 0x0f]);
+ melliped_mazeinv_set_color(machine(), offset, ~machine().root_device().memregion("proms")->base()[~data & 0x0f]);
}
diff --git a/src/mame/video/chaknpop.c b/src/mame/video/chaknpop.c
index 215004de340..9e11c452be5 100644
--- a/src/mame/video/chaknpop.c
+++ b/src/mame/video/chaknpop.c
@@ -24,7 +24,7 @@
PALETTE_INIT( chaknpop )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 1024; i++)
@@ -154,7 +154,7 @@ static TILE_GET_INFO( chaknpop_get_tx_tile_info )
VIDEO_START( chaknpop )
{
chaknpop_state *state = machine.driver_data<chaknpop_state>();
- UINT8 *RAM = machine.region("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
/* info offset type w h col row */
state->m_tx_tilemap = tilemap_create(machine, chaknpop_get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
diff --git a/src/mame/video/champbas.c b/src/mame/video/champbas.c
index 971ca5e9beb..869f88e3118 100644
--- a/src/mame/video/champbas.c
+++ b/src/mame/video/champbas.c
@@ -22,7 +22,7 @@
PALETTE_INIT( champbas )
{
- 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];
@@ -75,7 +75,7 @@ PALETTE_INIT( champbas )
PALETTE_INIT( exctsccr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/changela.c b/src/mame/video/changela.c
index 7ef399b2511..9fe21eaf44c 100644
--- a/src/mame/video/changela.c
+++ b/src/mame/video/changela.c
@@ -47,7 +47,7 @@ static void draw_obj0( running_machine &machine, bitmap_ind16 &bitmap, int sy )
changela_state *state = machine.driver_data<changela_state>();
int sx, i;
- UINT8* ROM = machine.region("user1")->base();
+ UINT8* ROM = state->memregion("user1")->base();
UINT8* RAM = state->m_spriteram;
for (sx = 0; sx < 256; sx++)
@@ -110,7 +110,7 @@ static void draw_obj1( running_machine &machine, bitmap_ind16 &bitmap )
changela_state *state = machine.driver_data<changela_state>();
int sx, sy;
- UINT8* ROM = machine.region("gfx2")->base();
+ UINT8* ROM = state->memregion("gfx2")->base();
UINT8* RAM = state->m_videoram;
UINT8 reg[4] = { 0 }; /* 4x4-bit registers (U58, U59) */
@@ -175,11 +175,11 @@ static void draw_river( running_machine &machine, bitmap_ind16 &bitmap, int sy )
changela_state *state = machine.driver_data<changela_state>();
int sx, i, j;
- UINT8* ROM = machine.region("user2")->base();
+ UINT8* ROM = machine.root_device().memregion("user2")->base();
UINT8* RAM = state->m_memory_devices + 0x800;
- UINT8* TILE_ROM = machine.region("gfx1")->base();
+ UINT8* TILE_ROM = machine.root_device().memregion("gfx1")->base();
UINT8* TILE_RAM = state->m_memory_devices + 0x1000;
- UINT8* PROM = machine.region("proms")->base();
+ UINT8* PROM = state->memregion("proms")->base();
int preload = ((sy < 32) ? 1 : 0);
@@ -355,14 +355,14 @@ static void draw_tree( running_machine &machine, bitmap_ind16 &bitmap, int sy, i
int sx, i, j;
/* State machine */
- UINT8* ROM = machine.region("user2")->base();
+ UINT8* ROM = machine.root_device().memregion("user2")->base();
UINT8* RAM = state->m_memory_devices + 0x840 + 0x40 * tree_num;
- UINT8* PROM = machine.region("proms")->base();
+ UINT8* PROM = machine.root_device().memregion("proms")->base();
/* Tree Data */
UINT8* RAM2 = state->m_tree_ram + 0x20 * tree_num;
- UINT8* TILE_ROM = (tree_num ? (machine.region("user3")->base() + 0x1000) : (machine.region("gfx1")->base() + 0x2000));
- UINT8* TILE_RAM = (tree_num ? (machine.region("user3")->base()) : (state->m_memory_devices + 0x1800));
+ UINT8* TILE_ROM = (tree_num ? (machine.root_device().memregion("user3")->base() + 0x1000) : (machine.root_device().memregion("gfx1")->base() + 0x2000));
+ UINT8* TILE_RAM = (tree_num ? (state->memregion("user3")->base()) : (state->m_memory_devices + 0x1800));
int preload = ((sy < 32) ? 1 : 0);
diff --git a/src/mame/video/cheekyms.c b/src/mame/video/cheekyms.c
index e41c568c18b..2b81d64ac7e 100644
--- a/src/mame/video/cheekyms.c
+++ b/src/mame/video/cheekyms.c
@@ -17,7 +17,7 @@ Functions to emulate the video hardware of the machine.
PALETTE_INIT( cheekyms )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, j, bit, r, g, b;
for (i = 0; i < 6; i++)
diff --git a/src/mame/video/circusc.c b/src/mame/video/circusc.c
index 62ece8fcb42..b6475999076 100644
--- a/src/mame/video/circusc.c
+++ b/src/mame/video/circusc.c
@@ -32,7 +32,7 @@
PALETTE_INIT( circusc )
{
- 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];
diff --git a/src/mame/video/citycon.c b/src/mame/video/citycon.c
index f78a5881b41..e6ae3fb87fd 100644
--- a/src/mame/video/citycon.c
+++ b/src/mame/video/citycon.c
@@ -35,7 +35,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
citycon_state *state = machine.driver_data<citycon_state>();
- UINT8 *rom = machine.region("gfx4")->base();
+ UINT8 *rom = state->memregion("gfx4")->base();
int code = rom[0x1000 * state->m_bg_image + tile_index];
SET_TILE_INFO(
3 + state->m_bg_image,
diff --git a/src/mame/video/cloud9.c b/src/mame/video/cloud9.c
index f7712b3f2d5..d7cbc7ee28a 100644
--- a/src/mame/video/cloud9.c
+++ b/src/mame/video/cloud9.c
@@ -25,9 +25,9 @@ VIDEO_START( cloud9 )
state->membank("bank1")->set_base(state->m_videoram);
/* get pointers to our PROMs */
- state->m_syncprom = machine.region("proms")->base() + 0x000;
- state->m_wpprom = machine.region("proms")->base() + 0x200;
- state->m_priprom = machine.region("proms")->base() + 0x300;
+ state->m_syncprom = machine.root_device().memregion("proms")->base() + 0x000;
+ state->m_wpprom = machine.root_device().memregion("proms")->base() + 0x200;
+ state->m_priprom = machine.root_device().memregion("proms")->base() + 0x300;
/* compute the color output resistor weights at startup */
compute_resistor_weights(0, 255, -1.0,
diff --git a/src/mame/video/clshroad.c b/src/mame/video/clshroad.c
index e230154c7f1..5be0e56fd72 100644
--- a/src/mame/video/clshroad.c
+++ b/src/mame/video/clshroad.c
@@ -42,7 +42,7 @@ WRITE8_MEMBER(clshroad_state::clshroad_flipscreen_w)
PALETTE_INIT( clshroad )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 256;i++)
palette_set_color_rgb(machine,i, pal4bit(color_prom[i + 256 * 0]),
@@ -52,7 +52,7 @@ PALETTE_INIT( clshroad )
PALETTE_INIT( firebatl )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c
index d1aad8f748d..8da215d151d 100644
--- a/src/mame/video/combatsc.c
+++ b/src/mame/video/combatsc.c
@@ -12,7 +12,7 @@
PALETTE_INIT( combatsc )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
@@ -63,7 +63,7 @@ PALETTE_INIT( combatsc )
PALETTE_INIT( combatscb )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
diff --git a/src/mame/video/compgolf.c b/src/mame/video/compgolf.c
index 007fbbc12ab..62864e9a795 100644
--- a/src/mame/video/compgolf.c
+++ b/src/mame/video/compgolf.c
@@ -11,7 +11,7 @@
PALETTE_INIT( compgolf )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/contra.c b/src/mame/video/contra.c
index bb39dc155b1..b691b2deb63 100644
--- a/src/mame/video/contra.c
+++ b/src/mame/video/contra.c
@@ -22,7 +22,7 @@
PALETTE_INIT( contra )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int chip;
/* allocate the colortable */
diff --git a/src/mame/video/cop01.c b/src/mame/video/cop01.c
index d29b59b3017..1452520a8c9 100644
--- a/src/mame/video/cop01.c
+++ b/src/mame/video/cop01.c
@@ -12,7 +12,7 @@
PALETTE_INIT( cop01 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c
index 7f0f43ae553..39e8aae5657 100644
--- a/src/mame/video/cosmic.c
+++ b/src/mame/video/cosmic.c
@@ -20,7 +20,7 @@ static pen_t panic_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->m_color_registers[0] << 9) | (state->m_color_registers[2] << 10) | ((x >> 4) << 5) | (y >> 3);
- pen_t pen = machine.region("user1")->base()[offs];
+ pen_t pen = state->memregion("user1")->base()[offs];
if (state->m_color_registers[1])
pen >>= 4;
@@ -32,7 +32,7 @@ static pen_t cosmica_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->m_color_registers[0] << 9) | ((x >> 4) << 5) | (y >> 3);
- pen_t pen = machine.region("user1")->base()[offs];
+ pen_t pen = state->memregion("user1")->base()[offs];
if (state->m_color_registers[1]) // 0 according to the schematics, but that breaks alien formation colors
pen >>= 4;
@@ -44,7 +44,7 @@ static pen_t cosmicg_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->m_color_registers[0] << 8) | (state->m_color_registers[1] << 9) | ((y >> 4) << 4) | (x >> 4);
- pen_t pen = machine.region("user1")->base()[offs];
+ pen_t pen = state->memregion("user1")->base()[offs];
/* the upper 4 bits are for cocktail mode support */
return pen & 0x0f;
@@ -54,7 +54,7 @@ static pen_t magspot_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->m_color_registers[0] << 9) | ((x >> 3) << 4) | (y >> 4);
- pen_t pen = machine.region("user1")->base()[offs];
+ pen_t pen = state->memregion("user1")->base()[offs];
if (state->m_color_registers[1])
pen >>= 4;
@@ -77,7 +77,7 @@ static pen_t magspot_map_color( running_machine &machine, UINT8 x, UINT8 y )
PALETTE_INIT( panic )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
@@ -120,7 +120,7 @@ PALETTE_INIT( panic )
PALETTE_INIT( cosmica )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
@@ -182,7 +182,7 @@ PALETTE_INIT( cosmicg )
PALETTE_INIT( magspot )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
@@ -217,7 +217,7 @@ PALETTE_INIT( magspot )
PALETTE_INIT( nomnlnd )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
@@ -324,7 +324,7 @@ static void cosmica_draw_starfield( screen_device &screen, bitmap_ind16 &bitmap,
cosmic_state *state = screen.machine().driver_data<cosmic_state>();
UINT8 y = 0;
UINT8 map = 0;
- UINT8 *PROM = screen.machine().region("user2")->base();
+ UINT8 *PROM = state->memregion("user2")->base();
while (1)
{
@@ -373,8 +373,8 @@ static void devzone_draw_grid( running_machine &machine, bitmap_ind16 &bitmap, c
{
cosmic_state *state = machine.driver_data<cosmic_state>();
UINT8 y;
- UINT8 *horz_PROM = machine.region("user2")->base();
- UINT8 *vert_PROM = machine.region("user3")->base();
+ UINT8 *horz_PROM = machine.root_device().memregion("user2")->base();
+ UINT8 *vert_PROM = state->memregion("user3")->base();
offs_t horz_addr = 0;
UINT8 count = 0;
@@ -433,7 +433,7 @@ static void nomnlnd_draw_background( screen_device &screen, bitmap_ind16 &bitmap
cosmic_state *state = screen.machine().driver_data<cosmic_state>();
UINT8 y = 0;
UINT8 water = screen.frame_number();
- UINT8 *PROM = screen.machine().region("user2")->base();
+ UINT8 *PROM = state->memregion("user2")->base();
/* all positioning is via logic gates:
diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c
index 162bcae4f0a..c518f89ef51 100644
--- a/src/mame/video/cps1.c
+++ b/src/mame/video/cps1.c
@@ -1520,14 +1520,14 @@ static MACHINE_RESET( cps )
if (strcmp(gamename, "sf2rb") == 0)
{
/* Patch out protection check */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0xe5464 / 2] = 0x6012;
}
if (strcmp(gamename, "sf2rb2") == 0)
{
/* Patch out protection check */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0xe5332 / 2] = 0x6014;
}
@@ -1538,13 +1538,13 @@ static MACHINE_RESET( cps )
by the cpu core as a 32-bit branch. This branch would make the
game crash (address error, since it would branch to an odd address)
if location 180ca6 (outside ROM space) isn't 0. Protection check? */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x11756 / 2] = 0x4e71;
}
else if (strcmp(gamename, "ghouls") == 0)
{
/* Patch out self-test... it takes forever */
- UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
rom[0x61964 / 2] = 0x4ef9;
rom[0x61966 / 2] = 0x0000;
rom[0x61968 / 2] = 0x0400;
@@ -1716,9 +1716,9 @@ INLINE int cps2_port( running_machine &machine, int offset )
static void cps1_gfx_decode( running_machine &machine )
{
- int size = machine.region("gfx")->bytes();
+ int size = machine.root_device().memregion("gfx")->bytes();
int i, j, gfxsize;
- UINT8 *cps1_gfx = machine.region("gfx")->base();
+ UINT8 *cps1_gfx = machine.root_device().memregion("gfx")->base();
gfxsize = size / 4;
@@ -1772,11 +1772,11 @@ static void unshuffle( UINT64 *buf, int len )
static void cps2_gfx_decode( running_machine &machine )
{
const int banksize = 0x200000;
- int size = machine.region("gfx")->bytes();
+ int size = machine.root_device().memregion("gfx")->bytes();
int i;
for (i = 0; i < size; i += banksize)
- unshuffle((UINT64 *)(machine.region("gfx")->base() + i), banksize / 8);
+ unshuffle((UINT64 *)(machine.root_device().memregion("gfx")->base() + i), banksize / 8);
cps1_gfx_decode(machine);
}
@@ -2697,7 +2697,7 @@ static void cps1_render_stars( screen_device &screen, bitmap_ind16 &bitmap, cons
{
cps_state *state = screen.machine().driver_data<cps_state>();
int offs;
- UINT8 *stars_rom = screen.machine().region("stars")->base();
+ UINT8 *stars_rom = state->memregion("stars")->base();
if (!stars_rom && (state->m_stars_enabled[0] || state->m_stars_enabled[1]))
{
diff --git a/src/mame/video/crbaloon.c b/src/mame/video/crbaloon.c
index fae31511a9d..d75b675e18e 100644
--- a/src/mame/video/crbaloon.c
+++ b/src/mame/video/crbaloon.c
@@ -101,7 +101,7 @@ static void draw_sprite_and_check_collision(running_machine &machine, bitmap_ind
UINT8 color = state->m_spriteram[0] >> 4;
UINT8 sy = state->m_spriteram[2] - 32;
- UINT8 *gfx = machine.region("gfx2")->base() + (code << 7);
+ UINT8 *gfx = state->memregion("gfx2")->base() + (code << 7);
if (state->flip_screen())
diff --git a/src/mame/video/crgolf.c b/src/mame/video/crgolf.c
index 82f06e32661..d66dfad5a2a 100644
--- a/src/mame/video/crgolf.c
+++ b/src/mame/video/crgolf.c
@@ -51,7 +51,7 @@ READ8_MEMBER(crgolf_state::crgolf_videoram_r)
static void get_pens( running_machine &machine, pen_t *pens )
{
offs_t offs;
- const UINT8 *prom = machine.region("proms")->base();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
for (offs = 0; offs < NUM_PENS; offs++)
{
diff --git a/src/mame/video/cvs.c b/src/mame/video/cvs.c
index 6971d3eeac3..abaff9eb53a 100644
--- a/src/mame/video/cvs.c
+++ b/src/mame/video/cvs.c
@@ -27,7 +27,7 @@
PALETTE_INIT( cvs )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, attr;
/* allocate the colortable */
diff --git a/src/mame/video/darkmist.c b/src/mame/video/darkmist.c
index 8fee3658826..92d3b831616 100644
--- a/src/mame/video/darkmist.c
+++ b/src/mame/video/darkmist.c
@@ -15,8 +15,8 @@ static TILE_GET_INFO( get_bgtile_info )
{
int code,attr,pal;
- code=machine.region("user1")->base()[tile_index]; /* TTTTTTTT */
- attr=machine.region("user2")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
+ code=machine.root_device().memregion("user1")->base()[tile_index]; /* TTTTTTTT */
+ attr=machine.root_device().memregion("user2")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
code+=(attr&3)<<8;
pal=(attr>>4);
@@ -31,8 +31,8 @@ static TILE_GET_INFO( get_fgtile_info )
{
int code,attr,pal;
- code=machine.region("user3")->base()[tile_index]; /* TTTTTTTT */
- attr=machine.region("user4")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
+ code=machine.root_device().memregion("user3")->base()[tile_index]; /* TTTTTTTT */
+ attr=machine.root_device().memregion("user4")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
pal=attr>>4;
code+=(attr&3)<<8;
@@ -71,7 +71,7 @@ static TILE_GET_INFO( get_txttile_info )
PALETTE_INIT(darkmist)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c
index b481357338c..f39a29593fa 100644
--- a/src/mame/video/dcheese.c
+++ b/src/mame/video/dcheese.c
@@ -27,7 +27,7 @@
PALETTE_INIT( dcheese )
{
- const UINT16 *src = (UINT16 *)machine.region("user1")->base();
+ const UINT16 *src = (UINT16 *)machine.root_device().memregion("user1")->base();
int i;
/* really 65536 colors, but they don't use the later ones so we can stay */
@@ -168,8 +168,8 @@ static void do_blit( running_machine &machine )
INT32 dxdy = (INT32)(((state->m_blitter_xparam[6] & 0x0fff) | ((state->m_blitter_xparam[7] & 0x0fff) << 12)) << 12) >> 12;
INT32 dydx = (INT32)(((state->m_blitter_yparam[4] & 0x0fff) | ((state->m_blitter_yparam[5] & 0x0fff) << 12)) << 12) >> 12;
INT32 dydy = (INT32)(((state->m_blitter_yparam[6] & 0x0fff) | ((state->m_blitter_yparam[7] & 0x0fff) << 12)) << 12) >> 12;
- UINT8 *src = machine.region("gfx1")->base();
- UINT32 pagemask = (machine.region("gfx1")->bytes() - 1) / 0x40000;
+ UINT8 *src = machine.root_device().memregion("gfx1")->base();
+ UINT32 pagemask = (state->memregion("gfx1")->bytes() - 1) / 0x40000;
int xstart = state->m_blitter_xparam[14];
int xend = state->m_blitter_xparam[15] + 1;
int ystart = state->m_blitter_yparam[14];
diff --git a/src/mame/video/dday.c b/src/mame/video/dday.c
index 67e1ded1a6c..d5f52535276 100644
--- a/src/mame/video/dday.c
+++ b/src/mame/video/dday.c
@@ -50,7 +50,7 @@ static void start_countdown_timer(running_machine &machine)
PALETTE_INIT( dday )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
palette_set_shadow_factor(machine, 1.0 / 8);
@@ -187,7 +187,7 @@ static TILE_GET_INFO( get_sl_tile_info )
int code, sl_flipx, flipx;
UINT8* sl_map;
- sl_map = &machine.region("user1")->base()[(state->m_sl_image & 0x07) * 0x0200];
+ sl_map = &state->memregion("user1")->base()[(state->m_sl_image & 0x07) * 0x0200];
flipx = (tile_index >> 4) & 0x01;
sl_flipx = (state->m_sl_image >> 3) & 0x01;
diff --git a/src/mame/video/ddribble.c b/src/mame/video/ddribble.c
index ff493fae62c..f470540c4a8 100644
--- a/src/mame/video/ddribble.c
+++ b/src/mame/video/ddribble.c
@@ -12,7 +12,7 @@
PALETTE_INIT( ddribble )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/deadang.c b/src/mame/video/deadang.c
index 5ab7e6b197c..5ded22f5176 100644
--- a/src/mame/video/deadang.c
+++ b/src/mame/video/deadang.c
@@ -39,14 +39,14 @@ static TILEMAP_MAPPER( bg_scan )
static TILE_GET_INFO( get_pf3_tile_info )
{
- const UINT16 *bgMap = (const UINT16 *)machine.region("gfx6")->base();
+ const UINT16 *bgMap = (const UINT16 *)machine.root_device().memregion("gfx6")->base();
int code= bgMap[tile_index];
SET_TILE_INFO(4,code&0x7ff,code>>12,0);
}
static TILE_GET_INFO( get_pf2_tile_info )
{
- const UINT16 *bgMap = (const UINT16 *)machine.region("gfx7")->base();
+ const UINT16 *bgMap = (const UINT16 *)machine.root_device().memregion("gfx7")->base();
int code= bgMap[tile_index];
SET_TILE_INFO(3,code&0x7ff,code>>12,0);
}
diff --git a/src/mame/video/dec8.c b/src/mame/video/dec8.c
index 81d68987bfc..dc77ad90899 100644
--- a/src/mame/video/dec8.c
+++ b/src/mame/video/dec8.c
@@ -77,7 +77,7 @@ sprites.
PALETTE_INIT( ghostb )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/deco_mlc.c b/src/mame/video/deco_mlc.c
index 239c292feea..21838518550 100644
--- a/src/mame/video/deco_mlc.c
+++ b/src/mame/video/deco_mlc.c
@@ -216,8 +216,8 @@ static void draw_sprites(running_machine& machine, bitmap_rgb32 &bitmap,const re
UINT32 *index_ptr=0;
int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1;
int xoffs,yoffs;
- UINT8 *rom = machine.region("gfx2")->base() + 0x20000, *index_ptr8;
- UINT8 *rawrom = machine.region("gfx2")->base();
+ UINT8 *rom = machine.root_device().memregion("gfx2")->base() + 0x20000, *index_ptr8;
+ UINT8 *rawrom = state->memregion("gfx2")->base();
int blockIsTilemapIndex=0;
int sprite2=0,indx2=0,use8bppMode=0;
int yscale,xscale;
diff --git a/src/mame/video/deniam.c b/src/mame/video/deniam.c
index e32e2435133..5d461668ec8 100644
--- a/src/mame/video/deniam.c
+++ b/src/mame/video/deniam.c
@@ -213,7 +213,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
{
deniam_state *state = machine.driver_data<deniam_state>();
int offs;
- UINT8 *gfx = machine.region("gfx2")->base();
+ UINT8 *gfx = state->memregion("gfx2")->base();
for (offs = state->m_spriteram.bytes() / 2 - 8; offs >= 0; offs -= 8)
{
diff --git a/src/mame/video/digdug.c b/src/mame/video/digdug.c
index cd1b3bcd7bd..034dd3fd1e6 100644
--- a/src/mame/video/digdug.c
+++ b/src/mame/video/digdug.c
@@ -23,7 +23,7 @@
PALETTE_INIT( digdug )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 32);
@@ -90,7 +90,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( bg_get_tile_info )
{
- UINT8 *rom = machine.region("gfx4")->base();
+ UINT8 *rom = machine.root_device().memregion("gfx4")->base();
digdug_state *state = machine.driver_data<digdug_state>();
int code = rom[tile_index | (state->m_bg_select << 10)];
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index f11e29b2de0..494601ec2ad 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -201,7 +201,7 @@ static const res_net_info radarscp_grid_net_info =
PALETTE_INIT( dkong2b)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
dkong_state *state = machine.driver_data<dkong_state>();
rgb_t *rgb;
int i;
@@ -232,7 +232,7 @@ PALETTE_INIT( dkong2b)
#ifdef UNUSED_FUNCTION
PALETTE_INIT( dkong4b )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
dkong_state *state = machine.driver_data<dkong_state>();
int i;
int r,g,b;
@@ -272,7 +272,7 @@ PALETTE_INIT( dkong4b )
PALETTE_INIT( radarscp )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
dkong_state *state = machine.driver_data<dkong_state>();
int i;
int r,g,b;
@@ -337,7 +337,7 @@ PALETTE_INIT( radarscp )
PALETTE_INIT( radarscp1 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
dkong_state *state = machine.driver_data<dkong_state>();
int i;
int r,g,b;
@@ -438,7 +438,7 @@ PALETTE_INIT( radarscp1 )
PALETTE_INIT( dkong3 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
dkong_state *state = machine.driver_data<dkong_state>();
rgb_t *rgb;
@@ -937,8 +937,8 @@ VIDEO_START( dkong )
{
case HARDWARE_TRS02:
machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
- state->m_gfx3 = machine.region("gfx3")->base();
- state->m_gfx3_len = machine.region("gfx3")->bytes();
+ state->m_gfx3 = machine.root_device().memregion("gfx3")->base();
+ state->m_gfx3_len = machine.root_device().memregion("gfx3")->bytes();
/* fall through */
case HARDWARE_TKG04:
case HARDWARE_TKG02:
@@ -950,9 +950,9 @@ VIDEO_START( dkong )
state->m_bg_tilemap->set_scrolldx(0, 128);
machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
- state->m_gfx4 = machine.region("gfx4")->base();
- state->m_gfx3 = machine.region("gfx3")->base();
- state->m_gfx3_len = machine.region("gfx3")->bytes();
+ state->m_gfx4 = machine.root_device().memregion("gfx4")->base();
+ state->m_gfx3 = machine.root_device().memregion("gfx3")->base();
+ state->m_gfx3_len = state->memregion("gfx3")->bytes();
break;
default:
diff --git a/src/mame/video/docastle.c b/src/mame/video/docastle.c
index a503ae448e8..3f712999901 100644
--- a/src/mame/video/docastle.c
+++ b/src/mame/video/docastle.c
@@ -31,7 +31,7 @@
PALETTE_INIT( docastle )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 256; i++)
diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c
index a72c34d5c07..6a2bc06c71f 100644
--- a/src/mame/video/dogfgt.c
+++ b/src/mame/video/dogfgt.c
@@ -13,7 +13,7 @@
PALETTE_INIT( dogfgt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* first 16 colors are RAM */
diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c
index 1dac0c9e9db..30eb3d5eaf7 100644
--- a/src/mame/video/dooyong.c
+++ b/src/mame/video/dooyong.c
@@ -629,8 +629,8 @@ VIDEO_START( lastday )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx5")->base();
- state->m_fg_tilerom = machine.region("gfx6")->base();
+ state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
+ state->m_fg_tilerom = state->memregion("gfx6")->base();
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
state->m_bg_gfx = 2;
@@ -669,8 +669,8 @@ VIDEO_START( gulfstrm )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx5")->base();
- state->m_fg_tilerom = machine.region("gfx6")->base();
+ state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
+ state->m_fg_tilerom = state->memregion("gfx6")->base();
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
state->m_bg_gfx = 2;
@@ -708,8 +708,8 @@ VIDEO_START( pollux )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx5")->base();
- state->m_fg_tilerom = machine.region("gfx6")->base();
+ state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
+ state->m_fg_tilerom = state->memregion("gfx6")->base();
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
state->m_bg_gfx = 2;
@@ -744,9 +744,9 @@ VIDEO_START( bluehawk )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx3")->base() + 0x78000;
- state->m_fg_tilerom = machine.region("gfx4")->base() + 0x78000;
- state->m_fg2_tilerom = machine.region("gfx5")->base() + 0x38000;
+ state->m_bg_tilerom = machine.root_device().memregion("gfx3")->base() + 0x78000;
+ state->m_fg_tilerom = machine.root_device().memregion("gfx4")->base() + 0x78000;
+ state->m_fg2_tilerom = state->memregion("gfx5")->base() + 0x38000;
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
state->m_fg2_tilerom2 = NULL;
@@ -785,8 +785,8 @@ VIDEO_START( flytiger )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx3")->base() + 0x78000;
- state->m_fg_tilerom = machine.region("gfx4")->base() + 0x78000;
+ state->m_bg_tilerom = machine.root_device().memregion("gfx3")->base() + 0x78000;
+ state->m_fg_tilerom = state->memregion("gfx4")->base() + 0x78000;
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
state->m_bg_gfx = 2;
@@ -821,8 +821,8 @@ VIDEO_START( primella )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx2")->base() + machine.region("gfx2")->bytes() - 0x8000;
- state->m_fg_tilerom = machine.region("gfx3")->base() + machine.region("gfx3")->bytes() - 0x8000;
+ state->m_bg_tilerom = machine.root_device().memregion("gfx2")->base() + machine.root_device().memregion("gfx2")->bytes() - 0x8000;
+ state->m_fg_tilerom = machine.root_device().memregion("gfx3")->base() + state->memregion("gfx3")->bytes() - 0x8000;
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
state->m_bg_gfx = 1;
@@ -856,14 +856,14 @@ VIDEO_START( rshark )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx5")->base();
- state->m_bg2_tilerom = machine.region("gfx4")->base();
- state->m_fg_tilerom = machine.region("gfx3")->base();
- state->m_fg2_tilerom = machine.region("gfx2")->base();
- state->m_bg_tilerom2 = machine.region("gfx6")->base() + 0x60000;
- state->m_bg2_tilerom2 = machine.region("gfx6")->base() + 0x40000;
- state->m_fg_tilerom2 = machine.region("gfx6")->base() + 0x20000;
- state->m_fg2_tilerom2 = machine.region("gfx6")->base() + 0x00000;
+ state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
+ state->m_bg2_tilerom = machine.root_device().memregion("gfx4")->base();
+ state->m_fg_tilerom = machine.root_device().memregion("gfx3")->base();
+ state->m_fg2_tilerom = machine.root_device().memregion("gfx2")->base();
+ state->m_bg_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x60000;
+ state->m_bg2_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x40000;
+ state->m_fg_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x20000;
+ state->m_fg2_tilerom2 = state->memregion("gfx6")->base() + 0x00000;
state->m_bg_gfx = 4;
state->m_bg2_gfx = 3;
state->m_fg_gfx = 2;
@@ -901,7 +901,7 @@ VIDEO_START( popbingo )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.region("gfx2")->base();
+ state->m_bg_tilerom = state->memregion("gfx2")->base();
state->m_bg_gfx = 1;
/* Create tilemaps */
diff --git a/src/mame/video/dribling.c b/src/mame/video/dribling.c
index 71c35af6bfb..20342ec70e2 100644
--- a/src/mame/video/dribling.c
+++ b/src/mame/video/dribling.c
@@ -17,7 +17,7 @@
PALETTE_INIT( dribling )
{
- const UINT8 *prom = machine.region("proms")->base() + 0x400;
+ const UINT8 *prom = machine.root_device().memregion("proms")->base() + 0x400;
int i;
for (i = 0; i < 256; i++)
@@ -60,8 +60,8 @@ WRITE8_MEMBER(dribling_state::dribling_colorram_w)
SCREEN_UPDATE_IND16( dribling )
{
dribling_state *state = screen.machine().driver_data<dribling_state>();
- UINT8 *prombase = screen.machine().region("proms")->base();
- UINT8 *gfxbase = screen.machine().region("gfx1")->base();
+ UINT8 *prombase = screen.machine().root_device().memregion("proms")->base();
+ UINT8 *gfxbase = state->memregion("gfx1")->base();
int x, y;
/* loop over rows */
diff --git a/src/mame/video/drmicro.c b/src/mame/video/drmicro.c
index 8648c3ebcf1..19e3718b9db 100644
--- a/src/mame/video/drmicro.c
+++ b/src/mame/video/drmicro.c
@@ -60,7 +60,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
PALETTE_INIT( drmicro )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c
index 91a2f50652e..90bc55dd41f 100644
--- a/src/mame/video/dynax.c
+++ b/src/mame/video/dynax.c
@@ -28,7 +28,7 @@
/* 0 B01234 G01234 R01234 */
PALETTE_INIT( sprtmtch )
{
- 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++)
@@ -356,8 +356,8 @@ static int blitter_drawgfx( running_machine &machine, int layer, int mask, const
{
dynax_state *state = machine.driver_data<dynax_state>();
UINT8 cmd;
- UINT8 *ROM = machine.region(gfx)->base();
- size_t ROM_size = machine.region(gfx)->bytes();
+ UINT8 *ROM = machine.root_device().memregion(gfx)->base();
+ size_t ROM_size = state->memregion(gfx)->bytes();
int sx;
@@ -1204,8 +1204,8 @@ static int debug_viewer( running_machine &machine, bitmap_ind16 &bitmap, const r
if (toggle)
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *RAM = machine.region( "gfx1" )->base();
- size_t size = machine.region( "gfx1" )->bytes();
+ UINT8 *RAM = machine.root_device().memregion( "gfx1" )->base();
+ size_t size = state->memregion( "gfx1" )->bytes();
static int i = 0, c = 0, r = 0;
if (machine.input().code_pressed_once(KEYCODE_I)) c = (c - 1) & 0x1f;
diff --git a/src/mame/video/epos.c b/src/mame/video/epos.c
index e5e265af5c0..2ab7ca791e0 100644
--- a/src/mame/video/epos.c
+++ b/src/mame/video/epos.c
@@ -25,8 +25,8 @@
static void get_pens( running_machine &machine, pen_t *pens )
{
offs_t i;
- const UINT8 *prom = machine.region("proms")->base();
- int len = machine.region("proms")->bytes();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
+ int len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len; i++)
{
diff --git a/src/mame/video/equites.c b/src/mame/video/equites.c
index 93831093602..fcb38a8f9f0 100644
--- a/src/mame/video/equites.c
+++ b/src/mame/video/equites.c
@@ -10,7 +10,7 @@
PALETTE_INIT( equites )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 256);
@@ -30,7 +30,7 @@ PALETTE_INIT( equites )
PALETTE_INIT( splndrbt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 256);
@@ -327,7 +327,7 @@ Also, note that sprites are 30x30, not 32x32.
static void splndrbt_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
equites_state *state = machine.driver_data<equites_state>();
- const UINT8 * const xrom = machine.region("user2")->base();
+ const UINT8 * const xrom = state->memregion("user2")->base();
const UINT8 * const yrom = xrom + 0x100;
const gfx_element* const gfx = machine.gfx[2];
int offs;
@@ -405,7 +405,7 @@ static void splndrbt_copy_bg( running_machine &machine, bitmap_ind16 &dst_bitmap
equites_state *state = machine.driver_data<equites_state>();
bitmap_ind16 &src_bitmap = state->m_bg_tilemap->pixmap();
bitmap_ind8 &flags_bitmap = state->m_bg_tilemap->flagsmap();
- const UINT8 * const xrom = machine.region("user1")->base();
+ const UINT8 * const xrom = state->memregion("user1")->base();
const UINT8 * const yrom = xrom + 0x2000;
int scroll_x = state->m_splndrbt_bg_scrollx;
int scroll_y = state->m_splndrbt_bg_scrolly;
diff --git a/src/mame/video/espial.c b/src/mame/video/espial.c
index ef910df56ba..f6766a96eea 100644
--- a/src/mame/video/espial.c
+++ b/src/mame/video/espial.c
@@ -31,7 +31,7 @@
PALETTE_INIT( espial )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/esripsys.c b/src/mame/video/esripsys.c
index 96742fa584d..3ebaa2a1730 100644
--- a/src/mame/video/esripsys.c
+++ b/src/mame/video/esripsys.c
@@ -225,13 +225,13 @@ int esripsys_draw(running_machine &machine, int l, int r, int fig, int attr, int
if (x_flip)
{
- rom_l = machine.region("8bpp_r")->base();
- rom_r = machine.region("8bpp_l")->base();
+ rom_l = machine.root_device().memregion("8bpp_r")->base();
+ rom_r = state->memregion("8bpp_l")->base();
}
else
{
- rom_l = machine.region("8bpp_l")->base();
- rom_r = machine.region("8bpp_r")->base();
+ rom_l = machine.root_device().memregion("8bpp_l")->base();
+ rom_r = machine.root_device().memregion("8bpp_r")->base();
}
for (cnt = 0; cnt <= fig; cnt++)
@@ -294,7 +294,7 @@ int esripsys_draw(running_machine &machine, int l, int r, int fig, int attr, int
/* 4bpp case */
else
{
- const UINT8* const rom = machine.region("4bpp")->base();
+ const UINT8* const rom = machine.root_device().memregion("4bpp")->base();
int ptr = 0;
int cnt;
UINT32 lpos = l;
diff --git a/src/mame/video/exedexes.c b/src/mame/video/exedexes.c
index f10d40b771c..44b7fa6baa4 100644
--- a/src/mame/video/exedexes.c
+++ b/src/mame/video/exedexes.c
@@ -10,8 +10,8 @@
#include "includes/exedexes.h"
-#define TileMap(offs) (machine.region("gfx5")->base()[offs])
-#define BackTileMap(offs) (machine.region("gfx5")->base()[offs+0x4000])
+#define TileMap(offs) (machine.root_device().memregion("gfx5")->base()[offs])
+#define BackTileMap(offs) (machine.root_device().memregion("gfx5")->base()[offs+0x4000])
/***************************************************************************
@@ -33,7 +33,7 @@
PALETTE_INIT( exedexes )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -129,7 +129,7 @@ WRITE8_MEMBER(exedexes_state::exedexes_gfxctrl_w)
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *tilerom = machine.region("gfx5")->base();
+ UINT8 *tilerom = machine.root_device().memregion("gfx5")->base();
int attr = tilerom[tile_index];
int code = attr & 0x3f;
@@ -141,7 +141,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- int code = machine.region("gfx5")->base()[tile_index];
+ int code = machine.root_device().memregion("gfx5")->base()[tile_index];
SET_TILE_INFO(2, code, 0, 0);
}
diff --git a/src/mame/video/exerion.c b/src/mame/video/exerion.c
index 7a1314ffe72..c086da15da4 100644
--- a/src/mame/video/exerion.c
+++ b/src/mame/video/exerion.c
@@ -36,7 +36,7 @@
PALETTE_INIT( exerion )
{
- 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];
@@ -111,7 +111,7 @@ VIDEO_START( exerion )
UINT8 *gfx;
/* get pointers to the mixing and lookup PROMs */
- state->m_background_mixer = machine.region("proms")->base() + 0x320;
+ state->m_background_mixer = machine.root_device().memregion("proms")->base() + 0x320;
/* allocate memory for the decoded background graphics */
state->m_background_gfx[0] = auto_alloc_array(machine, UINT16, 256 * 256 * 4);
@@ -136,7 +136,7 @@ VIDEO_START( exerion )
* Where AA,BB,CC,DD are the 2bpp data for the pixel,and a,b,c,d are the OR
* of these two bits together.
*/
- gfx = machine.region("gfx3")->base();
+ gfx = state->memregion("gfx3")->base();
for (i = 0; i < 4; i++)
{
int y;
diff --git a/src/mame/video/exprraid.c b/src/mame/video/exprraid.c
index 6bd0a80b8b4..f41d3cd2d93 100644
--- a/src/mame/video/exprraid.c
+++ b/src/mame/video/exprraid.c
@@ -45,7 +45,7 @@ WRITE8_MEMBER(exprraid_state::exprraid_scrolly_w)
static TILE_GET_INFO( get_bg_tile_info )
{
exprraid_state *state = machine.driver_data<exprraid_state>();
- UINT8 *tilerom = machine.region("gfx4")->base();
+ UINT8 *tilerom = state->memregion("gfx4")->base();
int data, attr, bank, code, color, flags;
int quadrant = 0, offs;
diff --git a/src/mame/video/f1gp.c b/src/mame/video/f1gp.c
index 75b530077cc..6a4d5018698 100644
--- a/src/mame/video/f1gp.c
+++ b/src/mame/video/f1gp.c
@@ -52,10 +52,10 @@ VIDEO_START( f1gp )
state->m_fg_tilemap->set_transparent_pen(0xff);
- state->m_zoomdata = (UINT16 *)machine.region("gfx4")->base();
+ state->m_zoomdata = (UINT16 *)machine.root_device().memregion("gfx4")->base();
gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_zoomdata);
-// state->save_pointer(NAME(state->m_zoomdata), machine.region("gfx4")->bytes());
+// state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
}
@@ -68,10 +68,10 @@ VIDEO_START( f1gpb )
state->m_fg_tilemap->set_transparent_pen(0xff);
- state->m_zoomdata = (UINT16 *)machine.region("gfx4")->base();
+ state->m_zoomdata = (UINT16 *)machine.root_device().memregion("gfx4")->base();
gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_zoomdata);
-// state->save_pointer(NAME(state->m_zoomdata), machine.region("gfx4")->bytes());
+// state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
}
VIDEO_START( f1gp2 )
diff --git a/src/mame/video/fastfred.c b/src/mame/video/fastfred.c
index 64bfe1e5ba8..194f2ca60a7 100644
--- a/src/mame/video/fastfred.c
+++ b/src/mame/video/fastfred.c
@@ -25,7 +25,7 @@
PALETTE_INIT( fastfred )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[4] = { 1000, 470, 220, 100 };
double rweights[4], gweights[4], bweights[4];
int i;
diff --git a/src/mame/video/fastlane.c b/src/mame/video/fastlane.c
index c694be35f0d..c983ff10913 100644
--- a/src/mame/video/fastlane.c
+++ b/src/mame/video/fastlane.c
@@ -5,7 +5,7 @@
PALETTE_INIT( fastlane )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
diff --git a/src/mame/video/fcombat.c b/src/mame/video/fcombat.c
index 78ecbc97805..e7284c32ace 100644
--- a/src/mame/video/fcombat.c
+++ b/src/mame/video/fcombat.c
@@ -14,8 +14,8 @@ static TILE_GET_INFO( get_bg_tile_info )
//palno = (tile_index - (tile_index / 32 * 16) * 32 * 16) / 32;
- tileno = machine.region("user1")->base()[tile_index];
- palno = 0x18; //machine.region("user2")->base()[tile_index] >> 3;
+ tileno = machine.root_device().memregion("user1")->base()[tile_index];
+ palno = 0x18; //machine.root_device().memregion("user2")->base()[tile_index] >> 3;
SET_TILE_INFO(2, tileno, palno, 0);
}
@@ -39,7 +39,7 @@ static TILE_GET_INFO( get_bg_tile_info )
PALETTE_INIT( fcombat )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/finalizr.c b/src/mame/video/finalizr.c
index 7b99d5d8e74..c8fb8c04103 100644
--- a/src/mame/video/finalizr.c
+++ b/src/mame/video/finalizr.c
@@ -12,7 +12,7 @@
PALETTE_INIT( finalizr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/firetrap.c b/src/mame/video/firetrap.c
index 9c7b6598342..e082d76602e 100644
--- a/src/mame/video/firetrap.c
+++ b/src/mame/video/firetrap.c
@@ -36,7 +36,7 @@
PALETTE_INIT( firetrap )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
diff --git a/src/mame/video/firetrk.c b/src/mame/video/firetrk.c
index 6d4470c3e30..f03393b359e 100644
--- a/src/mame/video/firetrk.c
+++ b/src/mame/video/firetrk.c
@@ -65,7 +65,7 @@ static void prom_to_palette(running_machine &machine, int number, UINT8 val)
PALETTE_INIT( montecar )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
firetrk_state *state = machine.driver_data<firetrk_state>();
int i;
diff --git a/src/mame/video/flower.c b/src/mame/video/flower.c
index c71fc6fa9ef..8f1b4a70e78 100644
--- a/src/mame/video/flower.c
+++ b/src/mame/video/flower.c
@@ -6,7 +6,7 @@
PALETTE_INIT( flower )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/funkybee.c b/src/mame/video/funkybee.c
index 0603514c447..c08df511c24 100644
--- a/src/mame/video/funkybee.c
+++ b/src/mame/video/funkybee.c
@@ -11,7 +11,7 @@
PALETTE_INIT( funkybee )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* first, the character/sprite palette */
diff --git a/src/mame/video/funworld.c b/src/mame/video/funworld.c
index e1f25c118ca..895a9632130 100644
--- a/src/mame/video/funworld.c
+++ b/src/mame/video/funworld.c
@@ -107,7 +107,7 @@
PALETTE_INIT(funworld)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_rb[3] = { 1000, 470, 220 };
static const int resistances_g [2] = { 470, 220 };
diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c
index f5add8c23bb..7f82011f9ac 100644
--- a/src/mame/video/fuukifg2.c
+++ b/src/mame/video/fuukifg2.c
@@ -82,7 +82,7 @@ WRITE16_MEMBER(fuuki16_state::fuuki16_vram_3_w){ fuuki16_vram_w(&space, offset,
#if 0
PALETTE_INIT( fuuki16 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int pen;
/* The game does not initialise the palette at startup. It should
diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c
index 4aa0ab56654..c2042306430 100644
--- a/src/mame/video/gaelco3d.c
+++ b/src/mame/video/gaelco3d.c
@@ -30,8 +30,8 @@ gaelco3d_renderer::gaelco3d_renderer(gaelco3d_state &state)
m_screenbits(state.machine().primary_screen->width(), state.machine().primary_screen->height()),
m_zbuffer(state.machine().primary_screen->width(), state.machine().primary_screen->height()),
m_polygons(0),
- m_texture_size(state.machine().region("gfx1")->bytes()),
- m_texmask_size(state.machine().region("gfx2")->bytes() * 8),
+ m_texture_size(state.machine().root_device().memregion("gfx1")->bytes()),
+ m_texmask_size(state.machine().root_device().memregion("gfx2")->bytes() * 8),
m_texture(auto_alloc_array(state.machine(), UINT8, m_texture_size)),
m_texmask(auto_alloc_array(state.machine(), UINT8, m_texmask_size))
{
@@ -39,7 +39,7 @@ gaelco3d_renderer::gaelco3d_renderer(gaelco3d_state &state)
state_save_register_global_bitmap(state.machine(), &m_zbuffer);
/* first expand the pixel data */
- UINT8 *src = state.machine().region("gfx1")->base();
+ UINT8 *src = state.machine().root_device().memregion("gfx1")->base();
UINT8 *dst = m_texture;
for (int y = 0; y < m_texture_size/4096; y += 2)
for (int x = 0; x < 4096; x += 2)
@@ -51,7 +51,7 @@ gaelco3d_renderer::gaelco3d_renderer(gaelco3d_state &state)
}
/* then expand the mask data */
- src = state.machine().region("gfx2")->base();
+ src = state.machine().root_device().memregion("gfx2")->base();
dst = m_texmask;
for (int y = 0; y < m_texmask_size/4096; y++)
for (int x = 0; x < 4096; x++)
diff --git a/src/mame/video/galaga.c b/src/mame/video/galaga.c
index b7bef81e746..ebbc00b2035 100644
--- a/src/mame/video/galaga.c
+++ b/src/mame/video/galaga.c
@@ -326,7 +326,7 @@ const struct star star_seed_tab[252]=
PALETTE_INIT( galaga )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 32+64);
diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c
index 321ae10edfe..01c3c14bd21 100644
--- a/src/mame/video/galastrm.c
+++ b/src/mame/video/galastrm.c
@@ -90,7 +90,7 @@ static void draw_sprites_pre(running_machine &machine, int x_offs, int y_offs)
{
galastrm_state *state = machine.driver_data<galastrm_state>();
UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c
index 7ffa2f10c63..58c6382a5db 100644
--- a/src/mame/video/galaxian.c
+++ b/src/mame/video/galaxian.c
@@ -255,7 +255,7 @@ static void bullets_draw(running_machine &machine, bitmap_rgb32 &bitmap, const r
PALETTE_INIT( galaxian )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
galaxian_state *state = machine.driver_data<galaxian_state>();
static const int rgb_resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -294,7 +294,7 @@ PALETTE_INIT( galaxian )
2, &rgb_resistances[1], bweights, 470, 0);
/* decode the palette first */
- len = machine.region("proms")->bytes();
+ len = machine.root_device().memregion("proms")->bytes();
for (i = 0; i < len; i++)
{
UINT8 bit0, bit1, bit2, r, g, b;
@@ -1077,7 +1077,7 @@ static int flip_and_clip(rectangle &draw, int xstart, int xend, const rectangle
void amidar_draw_background(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
galaxian_state *state = machine.driver_data<galaxian_state>();
- const UINT8 *prom = machine.region("user1")->base();
+ const UINT8 *prom = state->memregion("user1")->base();
rectangle draw;
int x;
diff --git a/src/mame/video/galaxold.c b/src/mame/video/galaxold.c
index 4e0c5430b98..cdea0fddfda 100644
--- a/src/mame/video/galaxold.c
+++ b/src/mame/video/galaxold.c
@@ -7,7 +7,7 @@
#include "emu.h"
#include "includes/galaxold.h"
-#define STARS_COLOR_BASE (machine.region("proms")->bytes())
+#define STARS_COLOR_BASE (machine.root_device().memregion("proms")->bytes())
#define BULLETS_COLOR_BASE (STARS_COLOR_BASE + 64)
#define BACKGROUND_COLOR_BASE (BULLETS_COLOR_BASE + 2)
@@ -94,12 +94,12 @@ static void dambustr_draw_background(running_machine &machine, bitmap_ind16 &bit
***************************************************************************/
PALETTE_INIT( galaxold )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, len;
/* first, the character/sprite palette */
- len = machine.region("proms")->bytes();
+ len = machine.root_device().memregion("proms")->bytes();
for (i = 0;i < len;i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -169,12 +169,12 @@ PALETTE_INIT( stratgyx )
PALETTE_INIT( rockclim )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, len;
/* first, the character/sprite palette */
- len = machine.region("proms")->bytes();
+ len = machine.root_device().memregion("proms")->bytes();
for (i = 0;i < len;i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -218,7 +218,7 @@ PALETTE_INIT( rockclim )
***************************************************************************/
PALETTE_INIT( darkplnt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
@@ -338,12 +338,12 @@ PALETTE_INIT( mariner )
/* swapped r/g/b hook-up */
PALETTE_INIT( dambustr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int base = BACKGROUND_COLOR_BASE;
int i, len;
/* first, the character/sprite palette */
- len = machine.region("proms")->bytes();
+ len = machine.root_device().memregion("proms")->bytes();
for (i = 0;i < len;i++)
{
@@ -1043,7 +1043,7 @@ static void mariner_modify_charcode(running_machine &machine, UINT16 *code, UINT
/* bit 0 of the PROM controls character banking */
- prom = machine.region("user2")->base();
+ prom = machine.root_device().memregion("user2")->base();
*code |= ((prom[x] & 0x01) << 8);
}
@@ -1230,7 +1230,7 @@ static void stratgyx_draw_background(running_machine &machine, bitmap_ind16 &bit
the green gun if BCG is asserted
bits 2-7 are unconnected */
- prom = machine.region("user1")->base();
+ prom = state->memregion("user1")->base();
for (x = 0; x < 32; x++)
{
@@ -1305,7 +1305,7 @@ static void mariner_draw_background(running_machine &machine, bitmap_ind16 &bitm
line (column) of the screen. The first 0x20 bytes for unflipped,
and the 2nd 0x20 bytes for flipped screen. */
- prom = machine.region("user1")->base();
+ prom = state->memregion("user1")->base();
if (state->m_flipscreen_x)
{
@@ -1606,7 +1606,7 @@ static void mariner_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, c
/* bit 2 of the PROM controls star visibility */
- prom = machine.region("user2")->base();
+ prom = machine.root_device().memregion("user2")->base();
for (offs = 0;offs < STAR_COUNT;offs++)
{
diff --git a/src/mame/video/galivan.c b/src/mame/video/galivan.c
index 2b345338277..03d6c5cbe6c 100644
--- a/src/mame/video/galivan.c
+++ b/src/mame/video/galivan.c
@@ -54,7 +54,7 @@ background: 0x4000 bytes of ROM: 76543210 tile code low bits
PALETTE_INIT( galivan )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -122,7 +122,7 @@ PALETTE_INIT( galivan )
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *BGROM = machine.region("gfx4")->base();
+ UINT8 *BGROM = machine.root_device().memregion("gfx4")->base();
int attr = BGROM[tile_index + 0x4000];
int code = BGROM[tile_index] | ((attr & 0x03) << 8);
SET_TILE_INFO(
@@ -147,7 +147,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( ninjemak_get_bg_tile_info )
{
- UINT8 *BGROM = machine.region("gfx4")->base();
+ UINT8 *BGROM = machine.root_device().memregion("gfx4")->base();
int attr = BGROM[tile_index + 0x4000];
int code = BGROM[tile_index] | ((attr & 0x03) << 8);
SET_TILE_INFO(
@@ -305,7 +305,7 @@ WRITE8_MEMBER(galivan_state::galivan_scrolly_w)
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
galivan_state *state = machine.driver_data<galivan_state>();
- const UINT8 *spritepalettebank = machine.region("user1")->base();
+ const UINT8 *spritepalettebank = state->memregion("user1")->base();
UINT8 *spriteram = state->m_spriteram;
int offs;
diff --git a/src/mame/video/gaplus.c b/src/mame/video/gaplus.c
index da58eba4935..b159cbd9888 100644
--- a/src/mame/video/gaplus.c
+++ b/src/mame/video/gaplus.c
@@ -25,7 +25,7 @@
PALETTE_INIT( gaplus )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/gberet.c b/src/mame/video/gberet.c
index 6db375e9e18..8fda4bf8d3f 100644
--- a/src/mame/video/gberet.c
+++ b/src/mame/video/gberet.c
@@ -23,7 +23,7 @@
PALETTE_INIT( gberet )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/ginganin.c b/src/mame/video/ginganin.c
index 5dc293c39c1..569f3304ec3 100644
--- a/src/mame/video/ginganin.c
+++ b/src/mame/video/ginganin.c
@@ -76,7 +76,7 @@ Note: if MAME_DEBUG is defined, pressing Z with:
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *gfx = machine.region("gfx5")->base();
+ UINT8 *gfx = machine.root_device().memregion("gfx5")->base();
int code = gfx[2 * tile_index + 0] * 256 + gfx[2 * tile_index + 1];
SET_TILE_INFO(
BG_GFX,
diff --git a/src/mame/video/glass.c b/src/mame/video/glass.c
index 0b84a71b4fd..1d7cf27f525 100644
--- a/src/mame/video/glass.c
+++ b/src/mame/video/glass.c
@@ -84,7 +84,7 @@ WRITE16_MEMBER(glass_state::glass_blitter_w)
/* fill the screen bitmap with the current picture */
{
int i, j;
- UINT8 *gfx = (UINT8 *)machine().region("gfx3")->base();
+ UINT8 *gfx = (UINT8 *)machine().root_device().memregion("gfx3")->base();
gfx = gfx + (m_current_command & 0x07) * 0x10000 + (m_current_command & 0x08) * 0x10000 + 0x140;
diff --git a/src/mame/video/goldstar.c b/src/mame/video/goldstar.c
index 73f55b344ba..540d665b4b1 100644
--- a/src/mame/video/goldstar.c
+++ b/src/mame/video/goldstar.c
@@ -408,7 +408,7 @@ SCREEN_UPDATE_IND16( goldstar )
if (state->m_cm_enable_reg &0x04)
{
- if (screen.machine().region("user1")->base())
+ if (screen.machine().root_device().memregion("user1")->base())
{
const gfx_element *gfx = screen.machine().gfx[2];
int girlyscroll = (INT8)((state->m_cm_girl_scroll & 0xf0));
@@ -451,7 +451,7 @@ SCREEN_UPDATE_IND16( bingowng )
if (state->m_cm_enable_reg &0x04)
{
- if (screen.machine().region("user1")->base())
+ if (screen.machine().root_device().memregion("user1")->base())
{
const gfx_element *gfx = screen.machine().gfx[2];
int girlyscroll = (INT8)((state->m_cm_girl_scroll & 0xf0));
diff --git a/src/mame/video/gomoku.c b/src/mame/video/gomoku.c
index 34124786a18..1c18987d08c 100644
--- a/src/mame/video/gomoku.c
+++ b/src/mame/video/gomoku.c
@@ -20,7 +20,7 @@
PALETTE_INIT( gomoku )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int bit0, bit1, bit2, r, g, b;
@@ -106,9 +106,9 @@ WRITE8_MEMBER(gomoku_state::gomoku_bg_dispsw_w)
VIDEO_START( gomoku )
{
gomoku_state *state = machine.driver_data<gomoku_state>();
- UINT8 *GOMOKU_BG_X = machine.region( "user1" )->base();
- UINT8 *GOMOKU_BG_Y = machine.region( "user2" )->base();
- UINT8 *GOMOKU_BG_D = machine.region( "user3" )->base();
+ UINT8 *GOMOKU_BG_X = machine.root_device().memregion( "user1" )->base();
+ UINT8 *GOMOKU_BG_Y = machine.root_device().memregion( "user2" )->base();
+ UINT8 *GOMOKU_BG_D = state->memregion( "user3" )->base();
int x, y;
int bgdata;
int color;
@@ -149,9 +149,9 @@ VIDEO_START( gomoku )
SCREEN_UPDATE_IND16( gomoku )
{
gomoku_state *state = screen.machine().driver_data<gomoku_state>();
- UINT8 *GOMOKU_BG_X = screen.machine().region( "user1" )->base();
- UINT8 *GOMOKU_BG_Y = screen.machine().region( "user2" )->base();
- UINT8 *GOMOKU_BG_D = screen.machine().region( "user3" )->base();
+ UINT8 *GOMOKU_BG_X = screen.machine().root_device().memregion( "user1" )->base();
+ UINT8 *GOMOKU_BG_Y = screen.machine().root_device().memregion( "user2" )->base();
+ UINT8 *GOMOKU_BG_D = state->memregion( "user3" )->base();
int x, y;
int bgram;
int bgoffs;
diff --git a/src/mame/video/gotya.c b/src/mame/video/gotya.c
index 902eed85518..5258260ba14 100644
--- a/src/mame/video/gotya.c
+++ b/src/mame/video/gotya.c
@@ -11,7 +11,7 @@
PALETTE_INIT( gotya )
{
- 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];
diff --git a/src/mame/video/gradius3.c b/src/mame/video/gradius3.c
index fe0e3cd8ed6..433f33da8d1 100644
--- a/src/mame/video/gradius3.c
+++ b/src/mame/video/gradius3.c
@@ -101,7 +101,7 @@ VIDEO_START( gradius3 )
READ16_MEMBER(gradius3_state::gradius3_gfxrom_r)
{
- UINT8 *gfxdata = machine().region("gfx2")->base();
+ UINT8 *gfxdata = memregion("gfx2")->base();
return (gfxdata[2 * offset + 1] << 8) | gfxdata[2 * offset];
}
diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c
index aa1de38e284..9f647734be2 100644
--- a/src/mame/video/grchamp.c
+++ b/src/mame/video/grchamp.c
@@ -14,7 +14,7 @@
PALETTE_INIT( grchamp )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[3] = { 100, 270, 470 };
double rweights[3], gweights[3], bweights[2];
grchamp_state *state = machine.driver_data<grchamp_state>();
@@ -245,7 +245,7 @@ static void draw_objects(running_machine &machine, grchamp_state *state, int y,
*/
- const UINT8 *prom = machine.region("proms")->base() + 0x20;
+ const UINT8 *prom = machine.root_device().memregion("proms")->base() + 0x20;
const gfx_element *gfx;
int change = (state->m_cpu0_out[0] & 0x20) << 3;
int num;
@@ -364,9 +364,9 @@ SCREEN_UPDATE_RGB32( grchamp )
};
grchamp_state *state = screen.machine().driver_data<grchamp_state>();
- const UINT8 *amedata = screen.machine().region("gfx5")->base();
- const UINT8 *headdata = screen.machine().region("gfx6")->base();
- const UINT8 *pldata = screen.machine().region("gfx7")->base();
+ const UINT8 *amedata = screen.machine().root_device().memregion("gfx5")->base();
+ const UINT8 *headdata = screen.machine().root_device().memregion("gfx6")->base();
+ const UINT8 *pldata = state->memregion("gfx7")->base();
bitmap_ind16 &lpixmap = state->m_left_tilemap->pixmap();
bitmap_ind16 &rpixmap = state->m_right_tilemap->pixmap();
bitmap_ind16 &cpixmap = state->m_center_tilemap->pixmap();
diff --git a/src/mame/video/gridlee.c b/src/mame/video/gridlee.c
index 8b1ae40fb07..572979ff831 100644
--- a/src/mame/video/gridlee.c
+++ b/src/mame/video/gridlee.c
@@ -20,7 +20,7 @@
PALETTE_INIT( gridlee )
{
- 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++)
@@ -158,7 +158,7 @@ SCREEN_UPDATE_IND16( gridlee )
}
/* draw the sprite images */
- gfx = screen.machine().region("gfx1")->base();
+ gfx = screen.machine().root_device().memregion("gfx1")->base();
for (i = 0; i < 32; i++)
{
UINT8 *sprite = state->m_spriteram + i * 4;
diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c
index a57dad0437a..3f52b420fc5 100644
--- a/src/mame/video/groundfx.c
+++ b/src/mame/video/groundfx.c
@@ -64,7 +64,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
{
groundfx_state *state = machine.driver_data<groundfx_state>();
UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
diff --git a/src/mame/video/gsword.c b/src/mame/video/gsword.c
index e294b9526fb..450b40eabbc 100644
--- a/src/mame/video/gsword.c
+++ b/src/mame/video/gsword.c
@@ -11,7 +11,7 @@
static PALETTE_INIT( common )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* characters */
@@ -29,7 +29,7 @@ static PALETTE_INIT( common )
PALETTE_INIT( josvolly )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -54,7 +54,7 @@ PALETTE_INIT( josvolly )
PALETTE_INIT( gsword )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c
index 5f19a339c86..c68ad1915a7 100644
--- a/src/mame/video/gticlub.c
+++ b/src/mame/video/gticlub.c
@@ -88,7 +88,7 @@ static UINT32 K001006_r(running_machine &machine, int chip, int offset, UINT32 m
{
case 0x0b: // CG Board ROM read
{
- UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
+ UINT16 *rom = (UINT16*)machine.root_device().memregion("gfx1")->base();
return rom[K001006_addr[chip] / 2] << 16;
}
case 0x0d: // Palette RAM read
@@ -239,7 +239,7 @@ void K001005_init(running_machine &machine)
int height = machine.primary_screen->height();
K001005_zbuffer = auto_bitmap_ind32_alloc(machine, width, height);
- gfxrom = machine.region("gfx1")->base();
+ gfxrom = machine.root_device().memregion("gfx1")->base();
K001005_bitmap[0] = auto_bitmap_rgb32_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
K001005_bitmap[1] = auto_bitmap_rgb32_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
@@ -1539,7 +1539,7 @@ SCREEN_UPDATE_RGB32( gticlub )
int index = (debug_tex_page - 1) * 0x40000;
int pal = debug_tex_palette & 7;
int tp = (debug_tex_palette >> 3) & 1;
- UINT8 *rom = machine.region("gfx1")->base();
+ UINT8 *rom = machine.root_device().memregion("gfx1")->base();
for (y=0; y < 384; y++)
{
diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c
index d999c54caf6..6fb0b8bfacc 100644
--- a/src/mame/video/gunbustr.c
+++ b/src/mame/video/gunbustr.c
@@ -60,7 +60,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
{
gunbustr_state *state = machine.driver_data<gunbustr_state>();
UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
diff --git a/src/mame/video/gunsmoke.c b/src/mame/video/gunsmoke.c
index 00b8d219bfe..ebf61f11b06 100644
--- a/src/mame/video/gunsmoke.c
+++ b/src/mame/video/gunsmoke.c
@@ -18,7 +18,7 @@
PALETTE_INIT( gunsmoke )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -105,7 +105,7 @@ WRITE8_MEMBER(gunsmoke_state::gunsmoke_d806_w)
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *tilerom = machine.region("gfx4")->base();
+ UINT8 *tilerom = machine.root_device().memregion("gfx4")->base();
int offs = tile_index * 2;
int attr = tilerom[offs + 1];
diff --git a/src/mame/video/gyruss.c b/src/mame/video/gyruss.c
index 12638cf200a..e3b8a38ffd2 100644
--- a/src/mame/video/gyruss.c
+++ b/src/mame/video/gyruss.c
@@ -31,7 +31,7 @@
PALETTE_INIT( gyruss )
{
- 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/video/hanaawas.c b/src/mame/video/hanaawas.c
index e1b3ff7657e..f18445ecd88 100644
--- a/src/mame/video/hanaawas.c
+++ b/src/mame/video/hanaawas.c
@@ -17,7 +17,7 @@
PALETTE_INIT( hanaawas )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/hcastle.c b/src/mame/video/hcastle.c
index be88e388202..26cd538554b 100644
--- a/src/mame/video/hcastle.c
+++ b/src/mame/video/hcastle.c
@@ -11,7 +11,7 @@
PALETTE_INIT( hcastle )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int chip;
/* allocate the colortable */
diff --git a/src/mame/video/hexion.c b/src/mame/video/hexion.c
index cbcb4b6b3cd..a64eccbce2d 100644
--- a/src/mame/video/hexion.c
+++ b/src/mame/video/hexion.c
@@ -50,7 +50,7 @@ VIDEO_START( hexion )
state->m_bg_tilemap[1]->set_scrollx(0,-4);
state->m_bg_tilemap[1]->set_scrolly(0,4);
- state->m_vram[0] = machine.region("maincpu")->base() + 0x30000;
+ state->m_vram[0] = state->memregion("maincpu")->base() + 0x30000;
state->m_vram[1] = state->m_vram[0] + 0x2000;
state->m_unkram = state->m_vram[1] + 0x2000;
}
@@ -65,7 +65,7 @@ VIDEO_START( hexion )
WRITE8_MEMBER(hexion_state::hexion_bankswitch_w)
{
- UINT8 *rom = machine().region("maincpu")->base() + 0x10000;
+ UINT8 *rom = memregion("maincpu")->base() + 0x10000;
/* bits 0-3 select ROM bank */
membank("bank1")->set_base(rom + 0x2000 * (data & 0x0f));
@@ -91,7 +91,7 @@ READ8_MEMBER(hexion_state::hexion_bankedram_r)
{
if (m_gfxrom_select && offset < 0x1000)
{
- return machine().region("gfx1")->base()[((m_gfxrom_select & 0x7f) << 12) + offset];
+ return memregion("gfx1")->base()[((m_gfxrom_select & 0x7f) << 12) + offset];
}
else if (m_bankctrl == 0)
{
diff --git a/src/mame/video/higemaru.c b/src/mame/video/higemaru.c
index 25e71d6e124..5b88f8648b1 100644
--- a/src/mame/video/higemaru.c
+++ b/src/mame/video/higemaru.c
@@ -21,7 +21,7 @@ WRITE8_MEMBER(higemaru_state::higemaru_colorram_w)
PALETTE_INIT( higemaru )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/hnayayoi.c b/src/mame/video/hnayayoi.c
index 3a4b6351584..336f4fa9d8f 100644
--- a/src/mame/video/hnayayoi.c
+++ b/src/mame/video/hnayayoi.c
@@ -130,8 +130,8 @@ static void copy_pixel( running_machine &machine, int x, int y, int pen )
WRITE8_MEMBER(hnayayoi_state::dynax_blitter_rev1_start_w)
{
- UINT8 *rom = machine().region("gfx1")->base();
- int romlen = machine().region("gfx1")->bytes();
+ UINT8 *rom = memregion("gfx1")->base();
+ int romlen = memregion("gfx1")->bytes();
int sx = m_blit_dest & 0xff;
int sy = m_blit_dest >> 8;
int x, y;
diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c
index 5479a726828..6b9e0d2335c 100644
--- a/src/mame/video/hng64.c
+++ b/src/mame/video/hng64.c
@@ -2056,11 +2056,11 @@ static void recoverPolygonBlock(running_machine& machine, const UINT16* packet,
//////////////////////////////////////////////*/
// 3d ROM Offset
- UINT16* threeDRoms = (UINT16*)(machine.region("verts")->base());
+ UINT16* threeDRoms = (UINT16*)(machine.root_device().memregion("verts")->base());
UINT32 threeDOffset = (((UINT32)packet[2]) << 16) | ((UINT32)packet[3]);
UINT16* threeDPointer = &threeDRoms[threeDOffset * 3];
- if (threeDOffset >= machine.region("verts")->bytes())
+ if (threeDOffset >= machine.root_device().memregion("verts")->bytes())
{
printf("Strange geometry packet: (ignoring)\n");
printPacket(packet, 1);
@@ -3015,7 +3015,7 @@ INLINE void FillSmoothTexPCHorizontalLine(running_machine &machine,
UINT8 paletteEntry = 0;
float t_coord, s_coord;
- const UINT8 *gfx = machine.region("textures")->base();
+ const UINT8 *gfx = state->memregion("textures")->base();
const UINT8 *textureOffset = &gfx[prOptions.texIndex * 1024 * 1024];
for (; x_start <= x_end; x_start++)
diff --git a/src/mame/video/homedata.c b/src/mame/video/homedata.c
index 352f4c199a0..4b9f93b0d26 100644
--- a/src/mame/video/homedata.c
+++ b/src/mame/video/homedata.c
@@ -41,7 +41,7 @@ static void mrokumei_handleblit( address_space *space, int rom_base )
int dest_addr;
int base_addr;
int opcode, data, num_tiles;
- UINT8 *pBlitData = space->machine().region("user1")->base() + rom_base;
+ UINT8 *pBlitData = state->memregion("user1")->base() + rom_base;
dest_param = state->m_blitter_param[(state->m_blitter_param_count - 4) & 3] * 256 +
state->m_blitter_param[(state->m_blitter_param_count - 3) & 3];
@@ -127,7 +127,7 @@ static void reikaids_handleblit( address_space *space, int rom_base )
int flipx;
int source_addr, base_addr;
int dest_addr;
- UINT8 *pBlitData = space->machine().region("user1")->base() + rom_base;
+ UINT8 *pBlitData = state->memregion("user1")->base() + rom_base;
int opcode, data, num_tiles;
@@ -225,7 +225,7 @@ static void pteacher_handleblit( address_space *space, int rom_base )
int source_addr;
int dest_addr, base_addr;
int opcode, data, num_tiles;
- UINT8 *pBlitData = space->machine().region("user1")->base() + rom_base;
+ UINT8 *pBlitData = state->memregion("user1")->base() + rom_base;
dest_param = state->m_blitter_param[(state->m_blitter_param_count - 4) & 3] * 256 +
state->m_blitter_param[(state->m_blitter_param_count - 3) & 3];
@@ -315,7 +315,7 @@ finish:
PALETTE_INIT( mrokumei )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* initialize 555 RGB palette */
@@ -338,7 +338,7 @@ PALETTE_INIT( mrokumei )
PALETTE_INIT( reikaids )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* initialize 555 RGB palette */
@@ -361,7 +361,7 @@ PALETTE_INIT( reikaids )
PALETTE_INIT( pteacher )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* initialize 555 RGB palette */
@@ -384,7 +384,7 @@ PALETTE_INIT( pteacher )
PALETTE_INIT( mirderby )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -819,7 +819,7 @@ WRITE8_MEMBER(homedata_state::reikaids_blitter_start_w)
WRITE8_MEMBER(homedata_state::pteacher_blitter_start_w)
{
- pteacher_handleblit(&space, (m_blitter_bank >> 5) * 0x10000 & (machine().region("user1")->bytes() - 1));
+ pteacher_handleblit(&space, (m_blitter_bank >> 5) * 0x10000 & (machine().root_device().memregion("user1")->bytes() - 1));
}
diff --git a/src/mame/video/hyhoo.c b/src/mame/video/hyhoo.c
index ba22591099d..840da6d5969 100644
--- a/src/mame/video/hyhoo.c
+++ b/src/mame/video/hyhoo.c
@@ -41,7 +41,7 @@ WRITE8_MEMBER(hyhoo_state::hyhoo_blitter_w)
WRITE8_MEMBER(hyhoo_state::hyhoo_romsel_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
m_gfxrom = (((data & 0xc0) >> 4) + (data & 0x03));
m_highcolorflag = data;
nb1413m3_gfxrombank_w(&space, 0, data);
@@ -64,7 +64,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void hyhoo_gfxdraw(running_machine &machine)
{
hyhoo_state *state = machine.driver_data<hyhoo_state>();
- UINT8 *GFX = machine.region("gfx1")->base();
+ UINT8 *GFX = state->memregion("gfx1")->base();
int x, y;
int dx1, dx2, dy;
@@ -106,7 +106,7 @@ static void hyhoo_gfxdraw(running_machine &machine)
skipy = -1;
}
- gfxlen = machine.region("gfx1")->bytes();
+ gfxlen = machine.root_device().memregion("gfx1")->bytes();
gfxaddr = (state->m_gfxrom << 17) + (state->m_blitter_src_addr << 1);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
diff --git a/src/mame/video/hyperspt.c b/src/mame/video/hyperspt.c
index 4db6b5ba0b9..0a235f10179 100644
--- a/src/mame/video/hyperspt.c
+++ b/src/mame/video/hyperspt.c
@@ -31,7 +31,7 @@
PALETTE_INIT( hyperspt )
{
- 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];
diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c
index a81b0daf064..ccc0222eef1 100644
--- a/src/mame/video/hyprduel.c
+++ b/src/mame/video/hyprduel.c
@@ -348,8 +348,8 @@ static void hyprduel_postload(running_machine &machine)
static void expand_gfx1(hyprduel_state &state)
{
- UINT8 *base_gfx = state.machine().region("gfx1")->base();
- UINT32 length = 2 * state.machine().region("gfx1")->bytes();
+ UINT8 *base_gfx = state.machine().root_device().memregion("gfx1")->base();
+ UINT32 length = 2 * state.machine().root_device().memregion("gfx1")->bytes();
state.m_expanded_gfx1 = auto_alloc_array(state.machine(), UINT8, length);
for (int i = 0; i < length; i += 2)
{
@@ -472,8 +472,8 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
{
hyprduel_state *state = machine.driver_data<hyprduel_state>();
UINT8 *base_gfx4 = state->m_expanded_gfx1;
- UINT8 *base_gfx8 = machine.region("gfx1")->base();
- UINT32 gfx_size = machine.region("gfx1")->bytes();
+ UINT8 *base_gfx8 = machine.root_device().memregion("gfx1")->base();
+ UINT32 gfx_size = state->memregion("gfx1")->bytes();
int max_x = machine.primary_screen->width();
int max_y = machine.primary_screen->height();
diff --git a/src/mame/video/ikki.c b/src/mame/video/ikki.c
index 9b86902483f..ff5bcccb932 100644
--- a/src/mame/video/ikki.c
+++ b/src/mame/video/ikki.c
@@ -13,7 +13,7 @@ Video hardware driver by Uki
PALETTE_INIT( ikki )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
ikki_state *state = machine.driver_data<ikki_state>();
int i;
@@ -128,7 +128,7 @@ SCREEN_UPDATE_IND16( ikki )
{
ikki_state *state = screen.machine().driver_data<ikki_state>();
offs_t offs;
- UINT8 *VIDEOATTR = screen.machine().region("user1")->base();
+ UINT8 *VIDEOATTR = state->memregion("user1")->base();
/* draw bg layer */
diff --git a/src/mame/video/irobot.c b/src/mame/video/irobot.c
index a47d4f495b1..c53d9c3ae5e 100644
--- a/src/mame/video/irobot.c
+++ b/src/mame/video/irobot.c
@@ -39,7 +39,7 @@
PALETTE_INIT( irobot )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* convert the color prom for the text palette */
diff --git a/src/mame/video/ironhors.c b/src/mame/video/ironhors.c
index 0f5285ecc30..714e6c0c98a 100644
--- a/src/mame/video/ironhors.c
+++ b/src/mame/video/ironhors.c
@@ -18,7 +18,7 @@
PALETTE_INIT( ironhors )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[4] = { 2000, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
diff --git a/src/mame/video/itech32.c b/src/mame/video/itech32.c
index 82b518e68a4..f862a7f42e9 100644
--- a/src/mame/video/itech32.c
+++ b/src/mame/video/itech32.c
@@ -184,8 +184,8 @@ VIDEO_START( itech32 )
state->m_videoplane[0][i] = state->m_videoplane[1][i] = 0xff;
/* fetch the GROM base */
- state->m_grom_base = machine.region("gfx1")->base();
- state->m_grom_size = machine.region("gfx1")->bytes();
+ state->m_grom_base = machine.root_device().memregion("gfx1")->base();
+ state->m_grom_size = state->memregion("gfx1")->bytes();
state->m_grom_bank = 0;
state->m_grom_bank_mask = state->m_grom_size >> 24;
if (state->m_grom_bank_mask == 2)
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index 69ed3ec8501..9fa41573eb7 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -175,8 +175,8 @@ VIDEO_START( itech8 )
state->m_page_select = 0xc0;
/* fetch the GROM base */
- state->m_grom_base = machine.region("grom")->base();
- state->m_grom_size = machine.region("grom")->bytes();
+ state->m_grom_base = machine.root_device().memregion("grom")->base();
+ state->m_grom_size = state->memregion("grom")->bytes();
}
diff --git a/src/mame/video/jack.c b/src/mame/video/jack.c
index 409d1c890cf..e020541c79d 100644
--- a/src/mame/video/jack.c
+++ b/src/mame/video/jack.c
@@ -110,7 +110,7 @@ SCREEN_UPDATE_IND16( jack )
PALETTE_INIT( joinem )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/jackal.c b/src/mame/video/jackal.c
index 6557a74abef..a7df8737922 100644
--- a/src/mame/video/jackal.c
+++ b/src/mame/video/jackal.c
@@ -14,7 +14,7 @@
PALETTE_INIT( jackal )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -64,7 +64,7 @@ void jackal_mark_tile_dirty( running_machine &machine, int offset )
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *RAM = machine.region("master")->base();
+ UINT8 *RAM = machine.root_device().memregion("master")->base();
int attr = RAM[0x2000 + tile_index];
int code = RAM[0x2400 + tile_index] + ((attr & 0xc0) << 2) + ((attr & 0x30) << 6);
@@ -83,7 +83,7 @@ VIDEO_START( jackal )
static void draw_background( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
jackal_state *state = machine.driver_data<jackal_state>();
- UINT8 *RAM = machine.region("master")->base();
+ UINT8 *RAM = state->memregion("master")->base();
int i;
state->m_scrollram = &RAM[0x0020];
@@ -206,7 +206,7 @@ static void draw_sprites_region( running_machine &machine, bitmap_ind16 &bitmap,
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
jackal_state *state = machine.driver_data<jackal_state>();
- UINT8 *RAM = machine.region("master")->base();
+ UINT8 *RAM = state->memregion("master")->base();
UINT8 *sr, *ss;
if (state->m_videoctrl[0x03] & 0x08)
diff --git a/src/mame/video/jailbrek.c b/src/mame/video/jailbrek.c
index 5f4a7f07446..52c9a78e7ec 100644
--- a/src/mame/video/jailbrek.c
+++ b/src/mame/video/jailbrek.c
@@ -3,7 +3,7 @@
PALETTE_INIT( jailbrek )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/jedi.c b/src/mame/video/jedi.c
index 5045dd91173..c3cd1d074e1 100644
--- a/src/mame/video/jedi.c
+++ b/src/mame/video/jedi.c
@@ -135,10 +135,10 @@ static void draw_background_and_text(running_machine &machine, jedi_state *state
int y;
int background_line_buffer[0x200]; /* RAM chip at 2A */
- UINT8 *tx_gfx = machine.region("gfx1")->base();
- UINT8 *bg_gfx = machine.region("gfx2")->base();
- UINT8 *prom1 = &machine.region("proms")->base()[0x0000 | ((*state->m_smoothing_table & 0x03) << 8)];
- UINT8 *prom2 = &machine.region("proms")->base()[0x0800 | ((*state->m_smoothing_table & 0x03) << 8)];
+ UINT8 *tx_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT8 *bg_gfx = machine.root_device().memregion("gfx2")->base();
+ UINT8 *prom1 = &machine.root_device().memregion("proms")->base()[0x0000 | ((*state->m_smoothing_table & 0x03) << 8)];
+ UINT8 *prom2 = &machine.root_device().memregion("proms")->base()[0x0800 | ((*state->m_smoothing_table & 0x03) << 8)];
int vscroll = state->m_vscroll;
int hscroll = state->m_hscroll;
int tx_bank = *state->m_foreground_bank;
@@ -234,7 +234,7 @@ static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_rgb
{
offs_t offs;
UINT8 *spriteram = state->m_spriteram;
- UINT8 *gfx3 = machine.region("gfx3")->base();
+ UINT8 *gfx3 = machine.root_device().memregion("gfx3")->base();
for (offs = 0x00; offs < 0x30; offs++)
{
diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c
index d6eb6488b63..7520a41c78b 100644
--- a/src/mame/video/kaneko16.c
+++ b/src/mame/video/kaneko16.c
@@ -236,7 +236,7 @@ VIDEO_START( berlwall )
{
kaneko16_state *state = machine.driver_data<kaneko16_state>();
int sx, x,y;
- UINT8 *RAM = machine.region("gfx3")->base();
+ UINT8 *RAM = state->memregion("gfx3")->base();
/* Render the hi-color static backgrounds held in the ROMs */
diff --git a/src/mame/video/kangaroo.c b/src/mame/video/kangaroo.c
index d2b243fe14c..6fac1876653 100644
--- a/src/mame/video/kangaroo.c
+++ b/src/mame/video/kangaroo.c
@@ -101,8 +101,8 @@ WRITE8_MEMBER(kangaroo_state::kangaroo_video_control_w)
static void blitter_execute( running_machine &machine )
{
kangaroo_state *state = machine.driver_data<kangaroo_state>();
- UINT32 gfxhalfsize = machine.region("gfx1")->bytes() / 2;
- const UINT8 *gfxbase = machine.region("gfx1")->base();
+ UINT32 gfxhalfsize = machine.root_device().memregion("gfx1")->bytes() / 2;
+ const UINT8 *gfxbase = state->memregion("gfx1")->base();
UINT16 src = state->m_video_control[0] + 256 * state->m_video_control[1];
UINT16 dst = state->m_video_control[2] + 256 * state->m_video_control[3];
UINT8 height = state->m_video_control[5];
diff --git a/src/mame/video/karnov.c b/src/mame/video/karnov.c
index fce2304edac..741ea209acf 100644
--- a/src/mame/video/karnov.c
+++ b/src/mame/video/karnov.c
@@ -38,7 +38,7 @@
PALETTE_INIT( karnov )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/kchamp.c b/src/mame/video/kchamp.c
index c7bf7dd325d..2920bb892b2 100644
--- a/src/mame/video/kchamp.c
+++ b/src/mame/video/kchamp.c
@@ -12,7 +12,7 @@
PALETTE_INIT( kchamp )
{
- 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++)
diff --git a/src/mame/video/kingobox.c b/src/mame/video/kingobox.c
index a687ad20539..f33ccd52765 100644
--- a/src/mame/video/kingobox.c
+++ b/src/mame/video/kingobox.c
@@ -123,13 +123,13 @@ static void ringking_get_rgb_data( const UINT8 *color_prom, int i, int *r_data,
PALETTE_INIT( kingofb )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
palette_init_common(machine, color_prom, kingofb_get_rgb_data);
}
PALETTE_INIT( ringking )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
palette_init_common(machine, color_prom, ringking_get_rgb_data);
}
diff --git a/src/mame/video/kncljoe.c b/src/mame/video/kncljoe.c
index 463e5297ef5..12ceac68048 100644
--- a/src/mame/video/kncljoe.c
+++ b/src/mame/video/kncljoe.c
@@ -16,7 +16,7 @@ Knuckle Joe - (c) 1985 Taito Corporation
PALETTE_INIT( kncljoe )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -154,7 +154,7 @@ WRITE8_MEMBER(kncljoe_state::kncljoe_control_w)
if (m_sprite_bank != i)
{
m_sprite_bank = i;
- memset(machine().region("maincpu")->base() + 0xf100, 0, 0x180);
+ memset(machine().root_device().memregion("maincpu")->base() + 0xf100, 0, 0x180);
}
}
diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c
index ef5a5cdd98a..72ec36ae28f 100644
--- a/src/mame/video/konamigx.c
+++ b/src/mame/video/konamigx.c
@@ -1863,7 +1863,7 @@ WRITE32_MEMBER(konamigx_state::konamigx_type3_psac2_bank_w)
static TILE_GET_INFO( get_gx_psac3_tile_info )
{
int tileno, colour, flip;
- UINT8 *tmap = machine.region("gfx4")->base();
+ UINT8 *tmap = machine.root_device().memregion("gfx4")->base();
int base_index = tile_index;
@@ -1884,7 +1884,7 @@ WRITE32_MEMBER(konamigx_state::konamigx_type3_psac2_bank_w)
static TILE_GET_INFO( get_gx_psac3_alt_tile_info )
{
int tileno, colour, flip;
- UINT8 *tmap = machine.region("gfx4")->base()+0x20000;
+ UINT8 *tmap = machine.root_device().memregion("gfx4")->base()+0x20000;
int base_index = tile_index;
diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c
index d5eab225466..4eb053fbba2 100644
--- a/src/mame/video/konamiic.c
+++ b/src/mame/video/konamiic.c
@@ -1287,19 +1287,19 @@ void K055673_vh_start(running_machine &machine, const char *gfx_memory_region, i
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
- K055673_rom = (UINT16 *)machine.region(gfx_memory_region)->base();
+ K055673_rom = (UINT16 *)machine.root_device().memregion(gfx_memory_region)->base();
/* decode the graphics */
switch(layout)
{
case K055673_LAYOUT_GX:
- size4 = (machine.region(gfx_memory_region)->bytes()/(1024*1024))/5;
+ size4 = (machine.root_device().memregion(gfx_memory_region)->bytes()/(1024*1024))/5;
size4 *= 4*1024*1024;
/* set the # of tiles based on the 4bpp section */
K055673_rom = auto_alloc_array(machine, UINT16, size4 * 5 / 2);
d = (UINT8 *)K055673_rom;
// now combine the graphics together to form 5bpp
- s1 = machine.region(gfx_memory_region)->base(); // 4bpp area
+ s1 = machine.root_device().memregion(gfx_memory_region)->base(); // 4bpp area
s2 = s1 + (size4); // 1bpp area
for (i = 0; i < size4; i+= 4)
{
@@ -1315,17 +1315,17 @@ void K055673_vh_start(running_machine &machine, const char *gfx_memory_region, i
break;
case K055673_LAYOUT_RNG:
- total = machine.region(gfx_memory_region)->bytes() / (16*16/2);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16/2);
decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout2, 4);
break;
case K055673_LAYOUT_LE2:
- total = machine.region(gfx_memory_region)->bytes() / (16*16);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16);
decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout3, 4);
break;
case K055673_LAYOUT_GX6:
- total = machine.region(gfx_memory_region)->bytes() / (16*16*6/8);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16*6/8);
decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout4, 4);
break;
@@ -1400,9 +1400,9 @@ WRITE32_HANDLER( K053247_long_w )
// in this window, +0 = 32 bits from one set of ROMs, and +8 = 32 bits from another set
READ16_HANDLER( K055673_rom_word_r ) // 5bpp
{
- UINT8 *ROM8 = (UINT8 *)space->machine().region(K053247_memory_region)->base();
- UINT16 *ROM = (UINT16 *)space->machine().region(K053247_memory_region)->base();
- int size4 = (space->machine().region(K053247_memory_region)->bytes()/(1024*1024))/5;
+ UINT8 *ROM8 = (UINT8 *)space->machine().root_device().memregion(K053247_memory_region)->base();
+ UINT16 *ROM = (UINT16 *)space->machine().root_device().memregion(K053247_memory_region)->base();
+ int size4 = (space->machine().root_device().memregion(K053247_memory_region)->bytes()/(1024*1024))/5;
int romofs;
size4 *= 4*1024*1024; // get offset to 5th bit
@@ -1438,7 +1438,7 @@ READ16_HANDLER( K055673_rom_word_r ) // 5bpp
READ16_HANDLER( K055673_GX6bpp_rom_word_r )
{
- UINT16 *ROM = (UINT16 *)space->machine().region(K053247_memory_region)->base();
+ UINT16 *ROM = (UINT16 *)space->machine().root_device().memregion(K053247_memory_region)->base();
int romofs;
romofs = K053246_regs[6]<<16 | K053246_regs[7]<<8 | K053246_regs[4];
@@ -2076,38 +2076,38 @@ void K056832_vh_start(running_machine &machine, const char *gfx_memory_region, i
switch (bpp)
{
case K056832_BPP_4:
- total = machine.region(gfx_memory_region)->bytes() / (i*4);
- decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout4, 4);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*4);
+ decode_gfx(machine, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout4, 4);
break;
case K056832_BPP_5:
- total = machine.region(gfx_memory_region)->bytes() / (i*5);
- decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout5, 4);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*5);
+ decode_gfx(machine, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout5, 4);
break;
case K056832_BPP_6:
- total = machine.region(gfx_memory_region)->bytes() / (i*6);
- decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout6, 4);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*6);
+ decode_gfx(machine, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout6, 4);
break;
case K056832_BPP_8:
- total = machine.region(gfx_memory_region)->bytes() / (i*8);
- decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout8, 4);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*8);
+ decode_gfx(machine, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout8, 4);
break;
case K056832_BPP_8LE:
- total = machine.region(gfx_memory_region)->bytes() / (i*8);
- decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout8le, 4);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*8);
+ decode_gfx(machine, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout8le, 4);
break;
case K056832_BPP_8TASMAN:
- total = machine.region(gfx_memory_region)->bytes() / (i*8);
- decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*8);
+ decode_gfx(machine, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
break;
case K056832_BPP_4dj:
- total = machine.region(gfx_memory_region)->bytes() / (i*4);
- decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout4dj, 4);
+ total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*4);
+ decode_gfx(machine, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout4dj, 4);
break;
default:
@@ -2120,8 +2120,8 @@ void K056832_vh_start(running_machine &machine, const char *gfx_memory_region, i
K056832_gfxnum = gfx_index;
K056832_callback = callback;
- K056832_rombase = machine.region(gfx_memory_region)->base();
- K056832_NumGfxBanks = machine.region(gfx_memory_region)->bytes() / 0x2000;
+ K056832_rombase = machine.root_device().memregion(gfx_memory_region)->base();
+ K056832_NumGfxBanks = machine.root_device().memregion(gfx_memory_region)->bytes() / 0x2000;
K056832_CurGfxBank = 0;
K056832_use_ext_linescroll = 0;
K056832_uses_tile_banks = 0;
@@ -2215,7 +2215,7 @@ static int K056832_rom_read_b(running_machine &machine, int offset, int blksize,
UINT8 *rombase;
int base, ret;
- rombase = (UINT8 *)machine.region(K056832_memory_region)->base();
+ rombase = (UINT8 *)machine.root_device().memregion(K056832_memory_region)->base();
if ((K056832_rom_half) && (zerosec))
{
@@ -2305,7 +2305,7 @@ READ16_HANDLER( K056832_mw_rom_word_r )
if (!K056832_rombase)
{
- K056832_rombase = space->machine().region(K056832_memory_region)->base();
+ K056832_rombase = space->machine().root_device().memregion(K056832_memory_region)->base();
}
if (K056832_regsb[2] & 0x8)
diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c
index 26325d83a16..4f820fb4447 100644
--- a/src/mame/video/konicdev.c
+++ b/src/mame/video/konicdev.c
@@ -1213,16 +1213,16 @@ static void konami_shuffle_8(UINT8 *buf,int len)
/* helper function to join two 16-bit ROMs and form a 32-bit data stream */
void konamid_rom_deinterleave_2(running_machine &machine, const char *mem_region)
{
- konami_shuffle_16((UINT16 *)machine.region(mem_region)->base(),machine.region(mem_region)->bytes()/2);
+ konami_shuffle_16((UINT16 *)machine.root_device().memregion(mem_region)->base(),machine.root_device().memregion(mem_region)->bytes()/2);
}
/* hacked version of rom_deinterleave_2_half for Lethal Enforcers */
void konamid_rom_deinterleave_2_half(running_machine &machine, const char *mem_region)
{
- UINT8 *rgn = machine.region(mem_region)->base();
+ UINT8 *rgn = machine.root_device().memregion(mem_region)->base();
- konami_shuffle_16((UINT16 *)rgn,machine.region(mem_region)->bytes()/4);
- konami_shuffle_16((UINT16 *)(rgn+machine.region(mem_region)->bytes()/2),machine.region(mem_region)->bytes()/4);
+ konami_shuffle_16((UINT16 *)rgn,machine.root_device().memregion(mem_region)->bytes()/4);
+ konami_shuffle_16((UINT16 *)(rgn+machine.root_device().memregion(mem_region)->bytes()/2),machine.root_device().memregion(mem_region)->bytes()/4);
}
/* helper function to join four 16-bit ROMs and form a 64-bit data stream */
@@ -1259,7 +1259,7 @@ static void deinterleave_gfx(running_machine &machine, const char *gfx_memory_re
konamid_rom_deinterleave_4(machine, gfx_memory_region);
break;
case KONAMI_ROM_SHUFFLE8:
- konami_shuffle_8(machine.region(gfx_memory_region)->base(), machine.region(gfx_memory_region)->bytes());
+ konami_shuffle_8(machine.root_device().memregion(gfx_memory_region)->base(), machine.root_device().memregion(gfx_memory_region)->bytes());
break;
}
}
@@ -2228,11 +2228,11 @@ READ8_DEVICE_HANDLER( k052109_r )
k052109->callback(device->machine(), 0, bank, &code, &color, &flags, &priority);
addr = (code << 5) + (offset & 0x1f);
- addr &= device->machine().region(k052109->memory_region)->bytes() - 1;
+ addr &= device->machine().root_device().memregion(k052109->memory_region)->bytes() - 1;
// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n", cpu_get_pc(&space->device()), offset, k052109->romsubbank, bank, addr);
- return device->machine().region(k052109->memory_region)->base()[addr];
+ return device->machine().root_device().memregion(k052109->memory_region)->base()[addr];
}
}
@@ -2696,13 +2696,13 @@ static DEVICE_START( k052109 )
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine.region(intf->gfx_memory_region)->bytes() / 32;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 32;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x1000;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
break;
default:
@@ -2835,11 +2835,11 @@ static int k051960_fetchromdata( device_t *device, int byte )
k051960->callback(device->machine(), &code, &color, &pri, &shadow);
addr = (code << 7) | (off1 << 2) | byte;
- addr &= device->machine().region(k051960->memory_region)->bytes() - 1;
+ addr &= device->machine().root_device().memregion(k051960->memory_region)->bytes() - 1;
// popmessage("%s: addr %06x", device->machine().describe_context(), addr);
- return device->machine().region(k051960->memory_region)->base()[addr];
+ return device->machine().root_device().memregion(k051960->memory_region)->base()[addr];
}
READ8_DEVICE_HANDLER( k051960_r )
@@ -3248,18 +3248,18 @@ static DEVICE_START( k051960 )
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine.region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
break;
case REVERSE_PLANE_ORDER:
- total = machine.region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout_reverse, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &spritelayout_reverse, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x4000;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout_gradius3, 4);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &spritelayout_gradius3, 4);
break;
default:
@@ -3430,11 +3430,11 @@ READ8_DEVICE_HANDLER( k053244_r )
addr = (k053244->rombank << 19) | ((k053244->regs[11] & 0x7) << 18)
| (k053244->regs[8] << 10) | (k053244->regs[9] << 2)
| ((offset & 3) ^ 1);
- addr &= machine.region(k053244->memory_region)->bytes() - 1;
+ addr &= machine.root_device().memregion(k053244->memory_region)->bytes() - 1;
// popmessage("%s: offset %02x addr %06x", machine.describe_context(), offset & 3, addr);
- return machine.region(k053244->memory_region)->base()[addr];
+ return machine.root_device().memregion(k053244->memory_region)->base()[addr];
}
else if (offset == 0x06)
{
@@ -4059,8 +4059,8 @@ static DEVICE_START( k05324x )
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine.region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
break;
default:
@@ -4284,9 +4284,9 @@ WRITE8_DEVICE_HANDLER( k053247_w )
READ16_DEVICE_HANDLER( k055673_rom_word_r ) // 5bpp
{
k053247_state *k053246 = k053247_get_safe_token(device);
- UINT8 *ROM8 = (UINT8 *)device->machine().region(k053246->memory_region)->base();
- UINT16 *ROM = (UINT16 *)device->machine().region(k053246->memory_region)->base();
- int size4 = (device->machine().region(k053246->memory_region)->bytes() / (1024 * 1024)) / 5;
+ UINT8 *ROM8 = (UINT8 *)device->machine().root_device().memregion(k053246->memory_region)->base();
+ UINT16 *ROM = (UINT16 *)device->machine().root_device().memregion(k053246->memory_region)->base();
+ int size4 = (device->machine().root_device().memregion(k053246->memory_region)->bytes() / (1024 * 1024)) / 5;
int romofs;
size4 *= 4 * 1024 * 1024; // get offset to 5th bit
@@ -4323,7 +4323,7 @@ READ16_DEVICE_HANDLER( k055673_rom_word_r ) // 5bpp
READ16_DEVICE_HANDLER( k055673_GX6bpp_rom_word_r )
{
k053247_state *k053246 = k053247_get_safe_token(device);
- UINT16 *ROM = (UINT16 *)device->machine().region(k053246->memory_region)->base();
+ UINT16 *ROM = (UINT16 *)device->machine().root_device().memregion(k053246->memory_region)->base();
int romofs;
romofs = k053246->kx46_regs[6] << 16 | k053246->kx46_regs[7] << 8 | k053246->kx46_regs[4];
@@ -4363,10 +4363,10 @@ READ8_DEVICE_HANDLER( k053246_r )
int addr;
addr = (k053246->kx46_regs[6] << 17) | (k053246->kx46_regs[7] << 9) | (k053246->kx46_regs[4] << 1) | ((offset & 1) ^ 1);
- addr &= device->machine().region(k053246->memory_region)->bytes() - 1;
+ addr &= device->machine().root_device().memregion(k053246->memory_region)->bytes() - 1;
// if (VERBOSE)
// popmessage("%04x: offset %02x addr %06x", cpu_get_pc(&space->device()), offset, addr);
- return device->machine().region(k053246->memory_region)->base()[addr];
+ return device->machine().root_device().memregion(k053246->memory_region)->base()[addr];
}
else
{
@@ -4895,13 +4895,13 @@ static DEVICE_START( k053247 )
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine.region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
break;
case TASMAN_PLANE_ORDER:
- total = machine.region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &tasman_16x16_layout, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &tasman_16x16_layout, 4);
break;
default:
@@ -4999,19 +4999,19 @@ static DEVICE_START( k055673 )
k053247->screen = machine.device<screen_device>(intf->screen);
- K055673_rom = (UINT16 *)machine.region(intf->gfx_memory_region)->base();
+ K055673_rom = (UINT16 *)machine.root_device().memregion(intf->gfx_memory_region)->base();
/* decode the graphics */
switch (intf->plane_order) /* layout would be more correct than plane_order, but we use k053247_interface */
{
case K055673_LAYOUT_GX:
- size4 = (machine.region(intf->gfx_memory_region)->bytes() / (1024 * 1024)) / 5;
+ size4 = (machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (1024 * 1024)) / 5;
size4 *= 4 * 1024 * 1024;
/* set the # of tiles based on the 4bpp section */
K055673_rom = auto_alloc_array(machine, UINT16, size4 * 5 / 2);
d = (UINT8 *)K055673_rom;
// now combine the graphics together to form 5bpp
- s1 = machine.region(intf->gfx_memory_region)->base(); // 4bpp area
+ s1 = machine.root_device().memregion(intf->gfx_memory_region)->base(); // 4bpp area
s2 = s1 + (size4); // 1bpp area
for (i = 0; i < size4; i+= 4)
{
@@ -5027,17 +5027,17 @@ static DEVICE_START( k055673 )
break;
case K055673_LAYOUT_RNG:
- total = machine.region(intf->gfx_memory_region)->bytes() / (16 * 16 / 2);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (16 * 16 / 2);
decode_gfx(machine, intf->gfx_num, (UINT8 *)K055673_rom, total, &spritelayout2, 4);
break;
case K055673_LAYOUT_LE2:
- total = machine.region(intf->gfx_memory_region)->bytes() / (16 * 16);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (16 * 16);
decode_gfx(machine, intf->gfx_num, (UINT8 *)K055673_rom, total, &spritelayout3, 4);
break;
case K055673_LAYOUT_GX6:
- total = machine.region(intf->gfx_memory_region)->bytes() / (16 * 16 * 6 / 8);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (16 * 16 * 6 / 8);
decode_gfx(machine, intf->gfx_num, (UINT8 *)K055673_rom, total, &spritelayout4, 4);
break;
@@ -5175,11 +5175,11 @@ READ8_DEVICE_HANDLER( k051316_rom_r )
int addr = offset + (k051316->ctrlram[0x0c] << 11) + (k051316->ctrlram[0x0d] << 19);
if (k051316->bpp <= 4)
addr /= 2;
- addr &= device->machine().region(k051316->memory_region)->bytes() - 1;
+ addr &= device->machine().root_device().memregion(k051316->memory_region)->bytes() - 1;
// popmessage("%s: offset %04x addr %04x", device->machine().describe_context(), offset, addr);
- return device->machine().region(k051316->memory_region)->base()[addr];
+ return device->machine().root_device().memregion(k051316->memory_region)->base()[addr];
}
else
{
@@ -5345,22 +5345,22 @@ static DEVICE_START( k051316 )
case -4:
total = 0x400;
is_tail2nos = 1;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
break;
case 4:
- total = machine.region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
break;
case 7:
- total = machine.region(intf->gfx_memory_region)->bytes() / 256;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout7, 7);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 256;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout7, 7);
break;
case 8:
- total = machine.region(intf->gfx_memory_region)->bytes() / 256;
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8, 8);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 256;
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8, 8);
break;
default:
@@ -6381,7 +6381,7 @@ static int k056832_rom_read_b( device_t *device, int offset, int blksize, int bl
UINT8 *rombase;
int base, ret;
- rombase = (UINT8 *)device->machine().region(k056832->memory_region)->base();
+ rombase = (UINT8 *)device->machine().root_device().memregion(k056832->memory_region)->base();
if ((k056832->rom_half) && (zerosec))
{
@@ -6463,7 +6463,7 @@ READ16_DEVICE_HANDLER( k056832_rom_word_r )
int addr = 0x2000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
- k056832->rombase = device->machine().region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 1] | (k056832->rombase[addr] << 8);
}
@@ -6477,7 +6477,7 @@ READ16_DEVICE_HANDLER( k056832_mw_rom_word_r )
int addr;
if (!k056832->rombase)
- k056832->rombase = device->machine().region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
if (k056832->regsb[2] & 0x8)
{
@@ -6540,7 +6540,7 @@ READ16_DEVICE_HANDLER( k056832_bishi_rom_word_r )
int addr = 0x4000 * k056832->cur_gfx_banks + offset;
if (!k056832->rombase)
- k056832->rombase = device->machine().region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 2] | (k056832->rombase[addr] << 8);
}
@@ -6551,7 +6551,7 @@ READ16_DEVICE_HANDLER( k056832_rom_word_8000_r )
int addr = 0x8000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
- k056832->rombase = device->machine().region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 2] | (k056832->rombase[addr] << 8);
}
@@ -6562,7 +6562,7 @@ READ16_DEVICE_HANDLER( k056832_old_rom_word_r )
int addr = 0x2000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
- k056832->rombase = device->machine().region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 1] | (k056832->rombase[addr] << 8);
}
@@ -7849,38 +7849,38 @@ static DEVICE_START( k056832 )
switch (intf->bpp)
{
case K056832_BPP_4:
- total = machine.region(intf->gfx_memory_region)->bytes() / (i * 4);
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 4);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
break;
case K056832_BPP_5:
- total = machine.region(intf->gfx_memory_region)->bytes() / (i * 5);
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout5, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 5);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout5, 4);
break;
case K056832_BPP_6:
- total = machine.region(intf->gfx_memory_region)->bytes() / (i * 6);
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout6, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 6);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout6, 4);
break;
case K056832_BPP_8:
- total = machine.region(intf->gfx_memory_region)->bytes() / (i * 8);
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8, 4);
break;
case K056832_BPP_8LE:
- total = machine.region(intf->gfx_memory_region)->bytes() / (i * 8);
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8le, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8le, 4);
break;
case K056832_BPP_8TASMAN:
- total = machine.region(intf->gfx_memory_region)->bytes() / (i * 8);
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
break;
case K056832_BPP_4dj:
- total = machine.region(intf->gfx_memory_region)->bytes() / (i * 4);
- decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout4dj, 4);
+ total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 4);
+ decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4dj, 4);
break;
default:
@@ -7896,8 +7896,8 @@ static DEVICE_START( k056832 )
k056832->gfxnum = intf->gfx_num;
k056832->callback = intf->callback;
- k056832->rombase = machine.region(intf->gfx_memory_region)->base();
- k056832->num_gfx_banks = machine.region(intf->gfx_memory_region)->bytes() / 0x2000;
+ k056832->rombase = machine.root_device().memregion(intf->gfx_memory_region)->base();
+ k056832->num_gfx_banks = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 0x2000;
k056832->djmain_hack = intf->djmain_hack;
k056832->cur_gfx_banks = 0;
@@ -8495,7 +8495,7 @@ READ32_DEVICE_HANDLER( k001006_r )
{
case 0x0b: // CG Board ROM read
{
- UINT16 *rom = (UINT16*)device->machine().region(k001006->gfx_region)->base();
+ UINT16 *rom = (UINT16*)device->machine().root_device().memregion(k001006->gfx_region)->base();
return rom[k001006->addr / 2] << 16;
}
case 0x0d: // Palette RAM read
@@ -9472,7 +9472,7 @@ static DEVICE_START( k001005 )
height = k001005->screen->height();
k001005->zbuffer = auto_bitmap_ind32_alloc(device->machine(), width, height);
- k001005->gfxrom = device->machine().region(intf->gfx_memory_region)->base();
+ k001005->gfxrom = device->machine().root_device().memregion(intf->gfx_memory_region)->base();
k001005->bitmap[0] = auto_bitmap_rgb32_alloc(device->machine(), k001005->screen->width(), k001005->screen->height());
k001005->bitmap[1] = auto_bitmap_rgb32_alloc(device->machine(), k001005->screen->width(), k001005->screen->height());
diff --git a/src/mame/video/kopunch.c b/src/mame/video/kopunch.c
index 436c73d4058..ae0ff333bef 100644
--- a/src/mame/video/kopunch.c
+++ b/src/mame/video/kopunch.c
@@ -4,7 +4,7 @@
PALETTE_INIT( kopunch )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
color_prom += 24; /* first 24 colors are black */
diff --git a/src/mame/video/ksayakyu.c b/src/mame/video/ksayakyu.c
index f8b12acbd96..6c7d9ae84e5 100644
--- a/src/mame/video/ksayakyu.c
+++ b/src/mame/video/ksayakyu.c
@@ -32,7 +32,7 @@ WRITE8_MEMBER(ksayakyu_state::ksayakyu_videoctrl_w)
PALETTE_INIT( ksayakyu )
{
- const UINT8 *prom = machine.region("proms")->base();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
int r, g, b, i;
for (i = 0; i < 0x100; i++)
@@ -47,8 +47,8 @@ PALETTE_INIT( ksayakyu )
static TILE_GET_INFO( get_ksayakyu_tile_info )
{
- int code = machine.region("user1")->base()[tile_index];
- int attr = machine.region("user1")->base()[tile_index + 0x2000];
+ int code = machine.root_device().memregion("user1")->base()[tile_index];
+ int attr = machine.root_device().memregion("user1")->base()[tile_index + 0x2000];
code += (attr & 3) << 8;
SET_TILE_INFO(1, code, ((attr >> 2) & 0x0f) * 2, (attr & 0x80) ? TILE_FLIPX : 0);
}
diff --git a/src/mame/video/kyugo.c b/src/mame/video/kyugo.c
index 17d58b1cd13..69ad6d8be88 100644
--- a/src/mame/video/kyugo.c
+++ b/src/mame/video/kyugo.c
@@ -47,7 +47,7 @@ VIDEO_START( kyugo )
{
kyugo_state *state = machine.driver_data<kyugo_state>();
- state->m_color_codes = machine.region("proms")->base() + 0x300;
+ state->m_color_codes = state->memregion("proms")->base() + 0x300;
state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
diff --git a/src/mame/video/labyrunr.c b/src/mame/video/labyrunr.c
index 99cb2317e60..a48ea647652 100644
--- a/src/mame/video/labyrunr.c
+++ b/src/mame/video/labyrunr.c
@@ -4,7 +4,7 @@
PALETTE_INIT( labyrunr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
diff --git a/src/mame/video/ladybug.c b/src/mame/video/ladybug.c
index ef169678660..d44ec06783b 100644
--- a/src/mame/video/ladybug.c
+++ b/src/mame/video/ladybug.c
@@ -95,13 +95,13 @@ static void palette_init_common( running_machine &machine, const UINT8 *color_pr
PALETTE_INIT( ladybug )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
palette_init_common(machine, color_prom, 0x20, 0, 5, 2, 6, 4, 7);
}
PALETTE_INIT( sraider )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* the resistor net may be probably different than Lady Bug */
diff --git a/src/mame/video/lasso.c b/src/mame/video/lasso.c
index fcb72643c70..e6e40dbbad5 100644
--- a/src/mame/video/lasso.c
+++ b/src/mame/video/lasso.c
@@ -66,7 +66,7 @@ static rgb_t get_color( int data )
PALETTE_INIT( lasso )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x40; i++)
@@ -76,7 +76,7 @@ PALETTE_INIT( lasso )
PALETTE_INIT( wwjgtin )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -136,7 +136,7 @@ static TILE_GET_INFO( lasso_get_bg_tile_info )
static TILE_GET_INFO( wwjgtin_get_track_tile_info )
{
- UINT8 *ROM = machine.region("user1")->base();
+ UINT8 *ROM = machine.root_device().memregion("user1")->base();
int code = ROM[tile_index];
int color = ROM[tile_index + 0x2000];
diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c
index 2cb79c34e54..62410001efe 100644
--- a/src/mame/video/leland.c
+++ b/src/mame/video/leland.c
@@ -392,9 +392,9 @@ static SCREEN_UPDATE_IND16( leland )
leland_state *state = screen.machine().driver_data<leland_state>();
int y;
- const UINT8 *bg_prom = screen.machine().region("user1")->base();
- const UINT8 *bg_gfx = screen.machine().region("gfx1")->base();
- offs_t bg_gfx_bank_page_size = screen.machine().region("gfx1")->bytes() / 3;
+ const UINT8 *bg_prom = screen.machine().root_device().memregion("user1")->base();
+ const UINT8 *bg_gfx = screen.machine().root_device().memregion("gfx1")->base();
+ offs_t bg_gfx_bank_page_size = state->memregion("gfx1")->bytes() / 3;
offs_t char_bank = (((state->m_gfxbank >> 4) & 0x03) * 0x2000) & (bg_gfx_bank_page_size - 1);
offs_t prom_bank = ((state->m_gfxbank >> 3) & 0x01) * 0x2000;
@@ -461,8 +461,8 @@ static SCREEN_UPDATE_IND16( ataxx )
leland_state *state = screen.machine().driver_data<leland_state>();
int y;
- const UINT8 *bg_gfx = screen.machine().region("gfx1")->base();
- offs_t bg_gfx_bank_page_size = screen.machine().region("gfx1")->bytes() / 6;
+ const UINT8 *bg_gfx = screen.machine().root_device().memregion("gfx1")->base();
+ offs_t bg_gfx_bank_page_size = state->memregion("gfx1")->bytes() / 6;
offs_t bg_gfx_offs_mask = bg_gfx_bank_page_size - 1;
/* for each scanline in the visible region */
diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c
index cb72f4261b2..89bbdad1b2c 100644
--- a/src/mame/video/lethalj.c
+++ b/src/mame/video/lethalj.c
@@ -82,8 +82,8 @@ VIDEO_START( lethalj )
state->m_screenram = auto_alloc_array(machine, UINT16, BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
/* predetermine blitter info */
- state->m_blitter_base = (UINT16 *)machine.region("gfx1")->base();
- state->m_blitter_rows = machine.region("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
+ state->m_blitter_base = (UINT16 *)machine.root_device().memregion("gfx1")->base();
+ state->m_blitter_rows = state->memregion("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
}
diff --git a/src/mame/video/liberate.c b/src/mame/video/liberate.c
index b84513fc4c0..2a5c1e68de2 100644
--- a/src/mame/video/liberate.c
+++ b/src/mame/video/liberate.c
@@ -40,7 +40,7 @@ static TILEMAP_MAPPER( fix_scan )
static TILE_GET_INFO( get_back_tile_info )
{
liberate_state *state = machine.driver_data<liberate_state>();
- const UINT8 *RAM = machine.region("user1")->base();
+ const UINT8 *RAM = state->memregion("user1")->base();
int tile, bank;
/* Convert tile index of 512x512 to paged format */
@@ -253,7 +253,7 @@ WRITE8_MEMBER(liberate_state::prosport_paletteram_w)
PALETTE_INIT( liberate )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, bit0, bit1, bit2, g, r, b;
for (i = 0;i < 32;i++)
diff --git a/src/mame/video/liberatr.c b/src/mame/video/liberatr.c
index 8467edd48b4..67c43994d20 100644
--- a/src/mame/video/liberatr.c
+++ b/src/mame/video/liberatr.c
@@ -68,8 +68,8 @@ void liberatr_state::init_planet(planet &liberatr_planet, UINT8 *planet_rom)
{
UINT16 longitude;
- const UINT8 *latitude_scale = machine().region("user1")->base();
- const UINT8 *longitude_scale = machine().region("user2")->base();
+ const UINT8 *latitude_scale = memregion("user1")->base();
+ const UINT8 *longitude_scale = memregion("user2")->base();
/* for each starting longitude */
for (longitude = 0; longitude < 0x100; longitude++)
@@ -212,8 +212,8 @@ void liberatr_state::init_planet(planet &liberatr_planet, UINT8 *planet_rom)
void liberatr_state::video_start()
{
// for each planet in the planet ROMs
- init_planet(m_planets[0], &machine().region("gfx1")->base()[0x2000]);
- init_planet(m_planets[1], &machine().region("gfx1")->base()[0x0000]);
+ init_planet(m_planets[0], &machine().root_device().memregion("gfx1")->base()[0x2000]);
+ init_planet(m_planets[1], &machine().root_device().memregion("gfx1")->base()[0x0000]);
}
diff --git a/src/mame/video/lockon.c b/src/mame/video/lockon.c
index 4bed0631856..9b3bec0bb16 100644
--- a/src/mame/video/lockon.c
+++ b/src/mame/video/lockon.c
@@ -100,7 +100,7 @@ static const res_net_info lockon_pd_net_info =
PALETTE_INIT( lockon )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 1024; ++i)
@@ -172,7 +172,7 @@ static void scene_draw( running_machine &machine )
UINT32 y;
/* 3bpp characters */
- const UINT8 *const gfx1 = machine.region("gfx2")->base();
+ const UINT8 *const gfx1 = state->memregion("gfx2")->base();
const UINT8 *const gfx2 = gfx1 + 0x10000;
const UINT8 *const gfx3 = gfx1 + 0x20000;
const UINT8 *const clut = gfx1 + 0x30000;
@@ -308,7 +308,7 @@ static void ground_draw( running_machine &machine )
lockon_state *state = machine.driver_data<lockon_state>();
/* ROM pointers */
- const UINT8 *const gfx_rom = machine.region("gfx4")->base();
+ const UINT8 *const gfx_rom = state->memregion("gfx4")->base();
const UINT8 *const lut_rom = gfx_rom + 0x30000 + ((state->m_ground_ctrl >> 2) & 0x3 ? 0x10000 : 0);
const UINT8 *const clut_rom = gfx_rom + 0x50000;
@@ -435,10 +435,10 @@ static void objects_draw( running_machine &machine )
UINT32 offs;
lockon_state *state = machine.driver_data<lockon_state>();
- const UINT8 *const romlut = machine.region("user1")->base();
- const UINT16 *const chklut = (UINT16*)machine.region("user2")->base();
- const UINT8 *const gfxrom = machine.region("gfx5")->base();
- const UINT8 *const sproms = machine.region("proms")->base() + 0x800;
+ const UINT8 *const romlut = state->memregion("user1")->base();
+ const UINT16 *const chklut = (UINT16*)state->memregion("user2")->base();
+ const UINT8 *const gfxrom = state->memregion("gfx5")->base();
+ const UINT8 *const sproms = state->memregion("proms")->base() + 0x800;
for (offs = 0; offs < state->m_objectram_size; offs += 4)
{
@@ -799,7 +799,7 @@ static void rotate_draw( running_machine &machine, bitmap_ind16 &bitmap, const r
static void hud_draw( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
lockon_state *state = machine.driver_data<lockon_state>();
- UINT8 *tile_rom = machine.region("gfx3")->base();
+ UINT8 *tile_rom = state->memregion("gfx3")->base();
UINT32 offs;
for (offs = 0x0; offs <= state->m_hudram_size; offs += 2)
diff --git a/src/mame/video/lucky74.c b/src/mame/video/lucky74.c
index 6c2edb70239..43e829dc818 100644
--- a/src/mame/video/lucky74.c
+++ b/src/mame/video/lucky74.c
@@ -129,7 +129,7 @@ PALETTE_INIT( lucky74 )
We're constructing a double-sized palette with one half for each state.
*/
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistances_rgb[4] = { 2000, 1000, 470, 220 };
double weights_r[4], weights_g[4], weights_b[4];
diff --git a/src/mame/video/lvcards.c b/src/mame/video/lvcards.c
index e8b682fd379..1a9e1b436e4 100644
--- a/src/mame/video/lvcards.c
+++ b/src/mame/video/lvcards.c
@@ -12,7 +12,7 @@
PALETTE_INIT( ponttehk )
{
- 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++ )
@@ -48,7 +48,7 @@ PALETTE_INIT( ponttehk )
PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough.
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for ( i = 0; i < machine.total_colors(); i++ )
diff --git a/src/mame/video/lwings.c b/src/mame/video/lwings.c
index fef6bfb10ef..706e6a56ced 100644
--- a/src/mame/video/lwings.c
+++ b/src/mame/video/lwings.c
@@ -63,8 +63,8 @@ static TILE_GET_INFO( get_bg2_tile_info )
{
lwings_state *state = machine.driver_data<lwings_state>();
int code, color;
- UINT8 *rom = machine.region("gfx5")->base();
- int mask = machine.region("gfx5")->bytes() - 1;
+ UINT8 *rom = machine.root_device().memregion("gfx5")->base();
+ int mask = state->memregion("gfx5")->bytes() - 1;
tile_index = (tile_index + state->m_bg2_image * 0x20) & mask;
code = rom[tile_index];
diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c
index 5c9d715fcdc..2ef6452d3df 100644
--- a/src/mame/video/m107.c
+++ b/src/mame/video/m107.c
@@ -153,7 +153,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
m107_state *state = machine.driver_data<m107_state>();
UINT16 *spriteram = state->m_buffered_spriteram;
int offs;
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = state->memregion("user1")->base();
for (offs = 0;offs < 0x800;offs += 4)
{
diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c
index ff63531a15b..28896e1582a 100644
--- a/src/mame/video/m52.c
+++ b/src/mame/video/m52.c
@@ -19,7 +19,7 @@
PALETTE_INIT( m52 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
const UINT8 *char_pal = color_prom + 0x000;
const UINT8 *back_pal = color_prom + 0x200;
const UINT8 *sprite_pal = color_prom + 0x220;
diff --git a/src/mame/video/m57.c b/src/mame/video/m57.c
index e6cac1e636f..59552150853 100644
--- a/src/mame/video/m57.c
+++ b/src/mame/video/m57.c
@@ -32,7 +32,7 @@
PALETTE_INIT( m57 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 32 * 8 + 16);
diff --git a/src/mame/video/m58.c b/src/mame/video/m58.c
index 4b6d2f8151d..4f4d6f56c12 100644
--- a/src/mame/video/m58.c
+++ b/src/mame/video/m58.c
@@ -21,7 +21,7 @@
PALETTE_INIT( yard )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
const UINT8 *char_lopal = color_prom + 0x000;
const UINT8 *char_hipal = color_prom + 0x100;
const UINT8 *sprite_pal = color_prom + 0x200;
diff --git a/src/mame/video/m62.c b/src/mame/video/m62.c
index 23ea176c528..1bf910ad6e4 100644
--- a/src/mame/video/m62.c
+++ b/src/mame/video/m62.c
@@ -199,7 +199,7 @@ static void m62_amplify_contrast(palette_t *palette, UINT32 numcolors)
PALETTE_INIT( m62 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
@@ -220,7 +220,7 @@ PALETTE_INIT( m62 )
PALETTE_INIT( lotlot )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
@@ -241,7 +241,7 @@ PALETTE_INIT( lotlot )
PALETTE_INIT( battroad )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
@@ -268,7 +268,7 @@ PALETTE_INIT( battroad )
PALETTE_INIT( spelunk2 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c
index be315bf0153..a5de79c329f 100644
--- a/src/mame/video/madalien.c
+++ b/src/mame/video/madalien.c
@@ -16,7 +16,7 @@
static PALETTE_INIT( madalien )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -92,7 +92,7 @@ static TILEMAP_MAPPER( scan_mode3 )
static TILE_GET_INFO( get_tile_info_BG_1 )
{
madalien_state *state = machine.driver_data<madalien_state>();
- UINT8 *map = machine.region("user1")->base() + ((*state->m_video_flags & 0x08) << 6);
+ UINT8 *map = state->memregion("user1")->base() + ((*state->m_video_flags & 0x08) << 6);
SET_TILE_INFO(1, map[tile_index], BIT(*state->m_video_flags, 2) ? 2 : 0, 0);
}
@@ -101,7 +101,7 @@ static TILE_GET_INFO( get_tile_info_BG_1 )
static TILE_GET_INFO( get_tile_info_BG_2 )
{
madalien_state *state = machine.driver_data<madalien_state>();
- UINT8 *map = machine.region("user1")->base() + ((*state->m_video_flags & 0x08) << 6) + 0x80;
+ UINT8 *map = state->memregion("user1")->base() + ((*state->m_video_flags & 0x08) << 6) + 0x80;
SET_TILE_INFO(1, map[tile_index], BIT(*state->m_video_flags, 2) ? 2 : 0, 0);
}
diff --git a/src/mame/video/magmax.c b/src/mame/video/magmax.c
index 9d98585d9fe..a5353613a50 100644
--- a/src/mame/video/magmax.c
+++ b/src/mame/video/magmax.c
@@ -26,7 +26,7 @@ Additional tweaking by Jarek Burczynski
***************************************************************************/
PALETTE_INIT( magmax )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -66,7 +66,7 @@ VIDEO_START( magmax )
{
magmax_state *state = machine.driver_data<magmax_state>();
int i,v;
- UINT8 * prom14D = machine.region("user2")->base();
+ UINT8 * prom14D = state->memregion("user2")->base();
/* Set up save state */
state_save_register_global(machine, state->m_flipscreen);
@@ -101,7 +101,7 @@ SCREEN_UPDATE_IND16( magmax )
else
{
int v;
- UINT8 * rom18B = screen.machine().region("user1")->base();
+ UINT8 * rom18B = state->memregion("user1")->base();
UINT32 scroll_h = (*state->m_scroll_x) & 0x3fff;
UINT32 scroll_v = (*state->m_scroll_y) & 0xff;
diff --git a/src/mame/video/mainsnk.c b/src/mame/video/mainsnk.c
index c6b494f6ee5..c026ec52d8b 100644
--- a/src/mame/video/mainsnk.c
+++ b/src/mame/video/mainsnk.c
@@ -4,7 +4,7 @@
PALETTE_INIT( mainsnk )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int num_colors = 0x400;
diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c
index d66e67f272e..df942a2a7ef 100644
--- a/src/mame/video/mappy.c
+++ b/src/mame/video/mappy.c
@@ -32,7 +32,7 @@
PALETTE_INIT( superpac )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -92,7 +92,7 @@ PALETTE_INIT( superpac )
PALETTE_INIT( mappy )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -164,7 +164,7 @@ PALETTE_INIT( mappy )
PALETTE_INIT( phozon )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[4] = { 2200, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
diff --git a/src/mame/video/marineb.c b/src/mame/video/marineb.c
index 4970cd1eade..b2bfc40f666 100644
--- a/src/mame/video/marineb.c
+++ b/src/mame/video/marineb.c
@@ -12,7 +12,7 @@
PALETTE_INIT( marineb )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/mario.c b/src/mame/video/mario.c
index 8ce5f6636a7..7fd1484c7d3 100644
--- a/src/mame/video/mario.c
+++ b/src/mame/video/mario.c
@@ -64,7 +64,7 @@ static const res_net_info mario_net_info_std =
***************************************************************************/
PALETTE_INIT( mario )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &mario_decode_info, &mario_net_info);
diff --git a/src/mame/video/markham.c b/src/mame/video/markham.c
index ae69da5f14a..3ee81f565f1 100644
--- a/src/mame/video/markham.c
+++ b/src/mame/video/markham.c
@@ -13,7 +13,7 @@
PALETTE_INIT( markham )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/matmania.c b/src/mame/video/matmania.c
index 764975d3516..3e2694bc7ec 100644
--- a/src/mame/video/matmania.c
+++ b/src/mame/video/matmania.c
@@ -43,7 +43,7 @@
***************************************************************************/
PALETTE_INIT( matmania )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 64; i++)
diff --git a/src/mame/video/mcatadv.c b/src/mame/video/mcatadv.c
index 80a31cf6c50..63848401ad1 100644
--- a/src/mame/video/mcatadv.c
+++ b/src/mame/video/mcatadv.c
@@ -60,8 +60,8 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
UINT16 *destline;
UINT8 *priline;
- UINT8 *sprdata = machine.region("gfx1")->base();
- int sprmask = machine.region("gfx1")->bytes()-1;
+ UINT8 *sprdata = machine.root_device().memregion("gfx1")->base();
+ int sprmask = state->memregion("gfx1")->bytes()-1;
int xstart, xend, xinc;
int ystart, yend, yinc;
diff --git a/src/mame/video/mcr68.c b/src/mame/video/mcr68.c
index 9f938021f36..0b2f41cc7f9 100644
--- a/src/mame/video/mcr68.c
+++ b/src/mame/video/mcr68.c
@@ -71,7 +71,7 @@ VIDEO_START( mcr68 )
VIDEO_START( zwackery )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- const UINT8 *colordatabase = (const UINT8 *)machine.region("gfx3")->base();
+ const UINT8 *colordatabase = (const UINT8 *)state->memregion("gfx3")->base();
gfx_element *gfx0 = machine.gfx[0];
gfx_element *gfx2 = machine.gfx[2];
UINT8 *srcdata0, *dest0;
diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c
index 4959a64dcc2..07c64deee91 100644
--- a/src/mame/video/megasys1.c
+++ b/src/mame/video/megasys1.c
@@ -753,7 +753,7 @@ static const struct priority priorities[] =
PALETTE_INIT( megasys1 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
megasys1_state *state = machine.driver_data<megasys1_state>();
int pri_code, offset, i, order;
diff --git a/src/mame/video/megazone.c b/src/mame/video/megazone.c
index 11d3fa371d8..2a57af564db 100644
--- a/src/mame/video/megazone.c
+++ b/src/mame/video/megazone.c
@@ -38,7 +38,7 @@ Changes by Martin M. (pfloyd@gmx.net) 14.10.2001:
PALETTE_INIT( megazone )
{
- 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];
diff --git a/src/mame/video/mermaid.c b/src/mame/video/mermaid.c
index 415297b4e97..0fc7f88529d 100644
--- a/src/mame/video/mermaid.c
+++ b/src/mame/video/mermaid.c
@@ -4,7 +4,7 @@
PALETTE_INIT( mermaid )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -35,7 +35,7 @@ PALETTE_INIT( mermaid )
PALETTE_INIT( rougien )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c
index e6f1be90d81..137f10953fa 100644
--- a/src/mame/video/metro.c
+++ b/src/mame/video/metro.c
@@ -273,8 +273,8 @@ WRITE16_MEMBER(metro_state::metro_window_w)
static void expand_gfx1(metro_state &state)
{
- UINT8 *base_gfx = state.machine().region("gfx1")->base();
- UINT32 length = 2 * state.machine().region("gfx1")->bytes();
+ UINT8 *base_gfx = state.machine().root_device().memregion("gfx1")->base();
+ UINT32 length = 2 * state.machine().root_device().memregion("gfx1")->bytes();
state.m_expanded_gfx1 = auto_alloc_array(state.machine(), UINT8, length);
for (int i = 0; i < length; i += 2)
{
@@ -446,8 +446,8 @@ void metro_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const r
{
metro_state *state = machine.driver_data<metro_state>();
UINT8 *base_gfx4 = state->m_expanded_gfx1;
- UINT8 *base_gfx8 = machine.region("gfx1")->base();
- UINT32 gfx_size = machine.region("gfx1")->bytes();
+ UINT8 *base_gfx8 = machine.root_device().memregion("gfx1")->base();
+ UINT32 gfx_size = state->memregion("gfx1")->bytes();
const rectangle &visarea = machine.primary_screen->visible_area();
int max_x = visarea.max_x + 1;
diff --git a/src/mame/video/mikie.c b/src/mame/video/mikie.c
index 2ba45be2366..cdad06766b3 100644
--- a/src/mame/video/mikie.c
+++ b/src/mame/video/mikie.c
@@ -28,7 +28,7 @@
PALETTE_INIT( mikie )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[4] = { 2200, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
diff --git a/src/mame/video/mjkjidai.c b/src/mame/video/mjkjidai.c
index 51127444b04..51df8d47630 100644
--- a/src/mame/video/mjkjidai.c
+++ b/src/mame/video/mjkjidai.c
@@ -49,7 +49,7 @@ WRITE8_MEMBER(mjkjidai_state::mjkjidai_videoram_w)
WRITE8_MEMBER(mjkjidai_state::mjkjidai_ctrl_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
// logerror("%04x: port c0 = %02x\n",cpu_get_pc(&space.device()),data);
diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c
index c1e09f9af1a..661f3c02d35 100644
--- a/src/mame/video/model1.c
+++ b/src/mame/video/model1.c
@@ -1450,7 +1450,7 @@ VIDEO_START(model1)
state->m_view = auto_alloc_clear(machine, struct view);
- state->m_poly_rom = (UINT32 *)machine.region("user1")->base();
+ state->m_poly_rom = (UINT32 *)state->memregion("user1")->base();
state->m_poly_ram = auto_alloc_array_clear(machine, UINT32, 0x400000);
state->m_tgp_ram = auto_alloc_array_clear(machine, UINT16, 0x100000-0x40000);
state->m_pointdb = auto_alloc_array_clear(machine, struct point, 1000000*2);
diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c
index d06ad831646..3b4c181444a 100644
--- a/src/mame/video/model2.c
+++ b/src/mame/video/model2.c
@@ -2713,10 +2713,10 @@ VIDEO_START(model2)
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model2_exit), &machine));
/* initialize the hardware rasterizer */
- model2_3d_init( machine, (UINT16*)machine.region("user3")->base() );
+ model2_3d_init( machine, (UINT16*)machine.root_device().memregion("user3")->base() );
/* initialize the geometry engine */
- geo_init( machine, (UINT32*)machine.region("user2")->base() );
+ geo_init( machine, (UINT32*)state->memregion("user2")->base() );
}
SCREEN_UPDATE_RGB32(model2)
diff --git a/src/mame/video/momoko.c b/src/mame/video/momoko.c
index 97c0cae2f2f..f91e8283bd9 100644
--- a/src/mame/video/momoko.c
+++ b/src/mame/video/momoko.c
@@ -71,7 +71,7 @@ static void momoko_draw_bg_pri( running_machine &machine, bitmap_ind16 &bitmap,
int xx, sx, sy, px, py, dot;
UINT32 gfxadr;
UINT8 d0, d1;
- UINT8 *BG_GFX = machine.region("gfx2")->base();
+ UINT8 *BG_GFX = machine.root_device().memregion("gfx2")->base();
for (sy = 0; sy < 8; sy++)
{
@@ -107,10 +107,10 @@ SCREEN_UPDATE_IND16( momoko )
int x, y, dx, dy, rx, ry, radr, chr, sy, fx, fy, px, py, offs, col, pri, flip ;
UINT8 *spriteram = state->m_spriteram;
- UINT8 *BG_MAP = screen.machine().region("user1")->base();
- UINT8 *BG_COL_MAP = screen.machine().region("user2")->base();
- UINT8 *FG_MAP = screen.machine().region("user3")->base();
- UINT8 *TEXT_COLOR = screen.machine().region("proms")->base();
+ UINT8 *BG_MAP = screen.machine().root_device().memregion("user1")->base();
+ UINT8 *BG_COL_MAP = screen.machine().root_device().memregion("user2")->base();
+ UINT8 *FG_MAP = screen.machine().root_device().memregion("user3")->base();
+ UINT8 *TEXT_COLOR = state->memregion("proms")->base();
flip = state->m_flipscreen ^ (input_port_read(screen.machine(), "FAKE") & 0x01);
diff --git a/src/mame/video/mouser.c b/src/mame/video/mouser.c
index 5db5754246a..fb578c4152e 100644
--- a/src/mame/video/mouser.c
+++ b/src/mame/video/mouser.c
@@ -18,7 +18,7 @@
PALETTE_INIT( mouser )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/mrdo.c b/src/mame/video/mrdo.c
index bd799c2b4d0..67e600096fe 100644
--- a/src/mame/video/mrdo.c
+++ b/src/mame/video/mrdo.c
@@ -44,7 +44,7 @@
PALETTE_INIT( mrdo )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
const int R1 = 150;
diff --git a/src/mame/video/mrjong.c b/src/mame/video/mrjong.c
index e757d02f100..cb958ce11e2 100644
--- a/src/mame/video/mrjong.c
+++ b/src/mame/video/mrjong.c
@@ -18,7 +18,7 @@
PALETTE_INIT( mrjong )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/munchmo.c b/src/mame/video/munchmo.c
index 8d0b2e0b53c..fb2181b8126 100644
--- a/src/mame/video/munchmo.c
+++ b/src/mame/video/munchmo.c
@@ -4,7 +4,7 @@
PALETTE_INIT( mnchmobl )
{
- 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++)
@@ -82,7 +82,7 @@ static void draw_background( running_machine &machine, bitmap_ind16 &bitmap, con
the tiles in ROM B2.2B
*/
munchmo_state *state = machine.driver_data<munchmo_state>();
- UINT8 *rom = machine.region("gfx2")->base();
+ UINT8 *rom = state->memregion("gfx2")->base();
const gfx_element *gfx = machine.gfx[1];
int offs;
diff --git a/src/mame/video/mustache.c b/src/mame/video/mustache.c
index e74bfc66aca..ed3eec30e1f 100644
--- a/src/mame/video/mustache.c
+++ b/src/mame/video/mustache.c
@@ -12,7 +12,7 @@
PALETTE_INIT(mustache)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 256;i++)
diff --git a/src/mame/video/mw8080bw.c b/src/mame/video/mw8080bw.c
index b33e5da9f9f..088d8ba3d8a 100644
--- a/src/mame/video/mw8080bw.c
+++ b/src/mame/video/mw8080bw.c
@@ -229,7 +229,7 @@ SCREEN_UPDATE_RGB32( phantom2 )
UINT16 cloud_counter = state->m_phantom2_cloud_counter;
- UINT8 *cloud_region = screen.machine().region("proms")->base();
+ UINT8 *cloud_region = state->memregion("proms")->base();
while (1)
{
diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c
index f17c506cc6f..cdc792b9562 100644
--- a/src/mame/video/mystston.c
+++ b/src/mame/video/mystston.c
@@ -75,7 +75,7 @@ static void set_palette(running_machine &machine, mystston_state *state)
static const int resistances_b [2] = { 3300, 1500 };
double weights_rg[3], weights_b[2];
- UINT8 *color_prom = machine.region("proms")->base();
+ UINT8 *color_prom = machine.root_device().memregion("proms")->base();
compute_resistor_weights(0, 255, -1.0,
3, resistances_rg, weights_rg, 0, 4700,
diff --git a/src/mame/video/mystwarr.c b/src/mame/video/mystwarr.c
index 1729adf2118..715d5e38ee2 100644
--- a/src/mame/video/mystwarr.c
+++ b/src/mame/video/mystwarr.c
@@ -15,8 +15,8 @@
// reading the original raw data
static void mystwarr_decode_tiles(running_machine &machine)
{
- UINT8 *s = machine.region("gfx1")->base();
- int len = machine.region("gfx1")->bytes();
+ UINT8 *s = machine.root_device().memregion("gfx1")->base();
+ int len = machine.root_device().memregion("gfx1")->bytes();
UINT8 *pFinish = s+len-3;
UINT8 *d, *decoded;
int gfxnum;
@@ -144,7 +144,7 @@ static TILE_GET_INFO( get_gai_936_tile_info )
{
mystwarr_state *state = machine.driver_data<mystwarr_state>();
int tileno, colour;
- UINT8 *ROM = machine.region("gfx4")->base();
+ UINT8 *ROM = state->memregion("gfx4")->base();
UINT8 *dat1 = ROM, *dat2 = ROM + 0x20000, *dat3 = ROM + 0x60000;
tileno = dat3[tile_index] | ((dat2[tile_index]&0x3f)<<8);
@@ -193,7 +193,7 @@ static TILE_GET_INFO( get_ult_936_tile_info )
{
mystwarr_state *state = machine.driver_data<mystwarr_state>();
int tileno, colour;
- UINT8 *ROM = machine.region("gfx4")->base();
+ UINT8 *ROM = state->memregion("gfx4")->base();
UINT8 *dat1 = ROM, *dat2 = ROM + 0x40000;
tileno = dat2[tile_index] | ((dat1[tile_index]&0x1f)<<8);
@@ -449,8 +449,8 @@ WRITE16_MEMBER(mystwarr_state::ddd_053936_clip_w)
// reference: 223e5c in gaiapolis (ROMs 34j and 36m)
READ16_MEMBER(mystwarr_state::gai_053936_tilerom_0_r)
{
- UINT8 *ROM1 = (UINT8 *)machine().region("gfx4")->base();
- UINT8 *ROM2 = (UINT8 *)machine().region("gfx4")->base();
+ UINT8 *ROM1 = (UINT8 *)machine().root_device().memregion("gfx4")->base();
+ UINT8 *ROM2 = (UINT8 *)machine().root_device().memregion("gfx4")->base();
ROM1 += 0x20000;
ROM2 += 0x20000+0x40000;
@@ -460,8 +460,8 @@ READ16_MEMBER(mystwarr_state::gai_053936_tilerom_0_r)
READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_0_r)
{
- UINT8 *ROM1 = (UINT8 *)machine().region("gfx4")->base();
- UINT8 *ROM2 = (UINT8 *)machine().region("gfx4")->base();
+ UINT8 *ROM1 = (UINT8 *)machine().root_device().memregion("gfx4")->base();
+ UINT8 *ROM2 = (UINT8 *)machine().root_device().memregion("gfx4")->base();
ROM2 += 0x40000;
@@ -471,7 +471,7 @@ READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_0_r)
// reference: 223e1a in gaiapolis (ROM 36j)
READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_1_r)
{
- UINT8 *ROM = (UINT8 *)machine().region("gfx4")->base();
+ UINT8 *ROM = (UINT8 *)machine().root_device().memregion("gfx4")->base();
return ROM[offset/2];
}
@@ -479,7 +479,7 @@ READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_1_r)
// reference: 223db0 in gaiapolis (ROMs 32n, 29n, 26n)
READ16_MEMBER(mystwarr_state::gai_053936_tilerom_2_r)
{
- UINT8 *ROM = (UINT8 *)machine().region("gfx3")->base();
+ UINT8 *ROM = (UINT8 *)machine().root_device().memregion("gfx3")->base();
offset += (m_roz_rombank * 0x100000);
@@ -488,7 +488,7 @@ READ16_MEMBER(mystwarr_state::gai_053936_tilerom_2_r)
READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_2_r)
{
- UINT8 *ROM = (UINT8 *)machine().region("gfx3")->base();
+ UINT8 *ROM = (UINT8 *)machine().root_device().memregion("gfx3")->base();
offset += (m_roz_rombank * 0x100000);
diff --git a/src/mame/video/n64.h b/src/mame/video/n64.h
index 1f6e9fbd366..772521f478f 100644
--- a/src/mame/video/n64.h
+++ b/src/mame/video/n64.h
@@ -418,8 +418,8 @@ class n64_rdp : public poly_manager<UINT32, rdp_poly_state, 8, 32000>
m_tmem = auto_alloc_array(machine(), UINT8, 0x1000);
memset(m_tmem, 0, 0x1000);
- UINT8 *normpoint = machine().region("normpoint")->base();
- UINT8 *normslope = machine().region("normslope")->base();
+ UINT8 *normpoint = machine().root_device().memregion("normpoint")->base();
+ UINT8 *normslope = machine().root_device().memregion("normslope")->base();
for(INT32 i = 0; i < 64; i++)
{
diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c
index f4446f483c1..1b79b860689 100644
--- a/src/mame/video/n8080.c
+++ b/src/mame/video/n8080.c
@@ -147,7 +147,7 @@ SCREEN_UPDATE_IND16( spacefev )
int y;
const UINT8* pRAM = state->m_videoram;
- const UINT8* pPROM = screen.machine().region("proms")->base();
+ const UINT8* pPROM = state->memregion("proms")->base();
for (y = 0; y < 256; y++)
{
@@ -213,7 +213,7 @@ SCREEN_UPDATE_IND16( sheriff )
n8080_state *state = screen.machine().driver_data<n8080_state>();
UINT8 mask = state->flip_screen() ? 0xff : 0x00;
- const UINT8* pPROM = screen.machine().region("proms")->base();
+ const UINT8* pPROM = state->memregion("proms")->base();
int x;
int y;
diff --git a/src/mame/video/namcofl.c b/src/mame/video/namcofl.c
index 7b26a53e49b..8b87caef7d0 100644
--- a/src/mame/video/namcofl.c
+++ b/src/mame/video/namcofl.c
@@ -119,7 +119,7 @@ static int FLobjcode2tile( running_machine &machine, int code )
VIDEO_START( namcofl )
{
- namco_tilemap_init( machine, NAMCOFL_TILEGFX, machine.region(NAMCOFL_TILEMASKREGION)->base(), TilemapCB );
+ namco_tilemap_init( machine, NAMCOFL_TILEGFX, machine.root_device().memregion(NAMCOFL_TILEMASKREGION)->base(), TilemapCB );
namco_obj_init(machine,NAMCOFL_SPRITEGFX,0x0,FLobjcode2tile);
namco_roz_init(machine,NAMCOFL_ROTGFX,NAMCOFL_ROTMASKREGION);
}
diff --git a/src/mame/video/namconb1.c b/src/mame/video/namconb1.c
index 94a22669af7..07d0f98e253 100644
--- a/src/mame/video/namconb1.c
+++ b/src/mame/video/namconb1.c
@@ -164,7 +164,7 @@ NB1objcode2tile( running_machine &machine, int code )
VIDEO_START( namconb1 )
{
- namco_tilemap_init( machine, NAMCONB1_TILEGFX, machine.region(NAMCONB1_TILEMASKREGION)->base(), NB1TilemapCB );
+ namco_tilemap_init( machine, NAMCONB1_TILEGFX, machine.root_device().memregion(NAMCONB1_TILEMASKREGION)->base(), NB1TilemapCB );
namco_obj_init(machine,NAMCONB1_SPRITEGFX,0x0,NB1objcode2tile);
} /* namconb1 */
@@ -225,7 +225,7 @@ NB2objcode2tile( running_machine &machine, int code )
VIDEO_START( namconb2 )
{
- namco_tilemap_init(machine, NAMCONB1_TILEGFX, machine.region(NAMCONB1_TILEMASKREGION)->base(), NB2TilemapCB );
+ namco_tilemap_init(machine, NAMCONB1_TILEGFX, machine.root_device().memregion(NAMCONB1_TILEMASKREGION)->base(), NB2TilemapCB );
namco_obj_init(machine,NAMCONB1_SPRITEGFX,0x0,NB2objcode2tile);
namco_roz_init(machine, NAMCONB1_ROTGFX,NAMCONB1_ROTMASKREGION);
} /* namconb2_vh_start */
diff --git a/src/mame/video/namcos1.c b/src/mame/video/namcos1.c
index 0bcd53cd330..f47d917513d 100644
--- a/src/mame/video/namcos1.c
+++ b/src/mame/video/namcos1.c
@@ -121,7 +121,7 @@ VIDEO_START( namcos1 )
namcos1_state *state = machine.driver_data<namcos1_state>();
int i;
- state->m_tilemap_maskdata = (UINT8 *)machine.region("gfx1")->base();
+ state->m_tilemap_maskdata = (UINT8 *)state->memregion("gfx1")->base();
/* allocate videoram */
state->m_videoram = auto_alloc_array(machine, UINT8, 0x8000);
diff --git a/src/mame/video/namcos2.c b/src/mame/video/namcos2.c
index 97f3134491a..9a0b3f8d680 100644
--- a/src/mame/video/namcos2.c
+++ b/src/mame/video/namcos2.c
@@ -443,7 +443,7 @@ READ16_HANDLER( namcos2_sprite_ram_r )
VIDEO_START( namcos2 )
{
- namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.root_device().memregion("gfx4")->base(),TilemapCB);
tilemap_roz = tilemap_create(machine, get_tile_info_roz,tilemap_scan_rows,8,8,256,256);
tilemap_roz->set_transparent_pen(0xff);
DrawSpriteInit(machine);
@@ -492,7 +492,7 @@ SCREEN_UPDATE_IND16( namcos2_default )
VIDEO_START( finallap )
{
- namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.root_device().memregion("gfx4")->base(),TilemapCB);
DrawSpriteInit(machine);
namco_road_init(machine, 3);
}
@@ -522,7 +522,7 @@ SCREEN_UPDATE_IND16( finallap )
VIDEO_START( luckywld )
{
- namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.root_device().memregion("gfx4")->base(),TilemapCB);
namco_obj_init( machine, 0, 0x0, NULL );
if( namcos2_gametype==NAMCOS2_LUCKY_AND_WILD )
{
@@ -563,7 +563,7 @@ SCREEN_UPDATE_IND16( luckywld )
VIDEO_START( sgunner )
{
- namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.root_device().memregion("gfx4")->base(),TilemapCB);
namco_obj_init( machine, 0, 0x0, NULL );
}
@@ -589,7 +589,7 @@ SCREEN_UPDATE_IND16( sgunner )
VIDEO_START( metlhawk )
{
- namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.root_device().memregion("gfx4")->base(),TilemapCB);
namco_roz_init( machine, 1, "gfx5" );
}
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 401a1bcff19..71b031660dd 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -861,7 +861,7 @@ ApplyGamma( running_machine &machine, bitmap_rgb32 &bitmap )
}
else
{ /* system 22 */
- const UINT8 *rlut = 0x000+(const UINT8 *)machine.region("user1")->base();
+ const UINT8 *rlut = 0x000+(const UINT8 *)machine.root_device().memregion("user1")->base();
const UINT8 *glut = 0x100+rlut;
const UINT8 *blut = 0x200+rlut;
for( y=0; y<bitmap.height(); y++ )
@@ -2741,10 +2741,10 @@ static VIDEO_START( common )
for (code = 0; code < machine.gfx[GFX_TEXTURE_TILE]->total_elements; code++)
gfx_element_decode(machine.gfx[GFX_TEXTURE_TILE], code);
- Prepare3dTexture(machine, machine.region("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->gfxdata );
+ Prepare3dTexture(machine, machine.root_device().memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->gfxdata );
state->m_dirtypal = auto_alloc_array(machine, UINT8, NAMCOS22_PALETTE_SIZE/4);
- state->m_mPtRomSize = machine.region("pointrom")->bytes()/3;
- state->m_mpPolyL = machine.region("pointrom")->base();
+ state->m_mPtRomSize = machine.root_device().memregion("pointrom")->bytes()/3;
+ state->m_mpPolyL = state->memregion("pointrom")->base();
state->m_mpPolyM = state->m_mpPolyL + state->m_mPtRomSize;
state->m_mpPolyH = state->m_mpPolyM + state->m_mPtRomSize;
diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c
index 478c7ee42f3..878ef853c7a 100644
--- a/src/mame/video/namcos86.c
+++ b/src/mame/video/namcos86.c
@@ -34,7 +34,7 @@ Namco System 86 Video Hardware
PALETTE_INIT( namcos86 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
namcos86_state *state = machine.driver_data<namcos86_state>();
int i;
rgb_t palette[512];
diff --git a/src/mame/video/naughtyb.c b/src/mame/video/naughtyb.c
index 781b700a5d2..1307856a6c3 100644
--- a/src/mame/video/naughtyb.c
+++ b/src/mame/video/naughtyb.c
@@ -58,7 +58,7 @@ static const res_net_info naughtyb_net_info =
PALETTE_INIT( naughtyb )
{
- 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/video/nbmj8688.c b/src/mame/video/nbmj8688.c
index 2734062d31f..82e98dd57d8 100644
--- a/src/mame/video/nbmj8688.c
+++ b/src/mame/video/nbmj8688.c
@@ -162,7 +162,7 @@ WRITE8_MEMBER(nbmj8688_state::mjsikaku_scrolly_w)
WRITE8_MEMBER(nbmj8688_state::mjsikaku_romsel_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
m_mjsikaku_gfxrom = (data & 0x0f);
if ((m_mjsikaku_gfxrom << 17) > (gfxlen - 1))
@@ -176,7 +176,7 @@ WRITE8_MEMBER(nbmj8688_state::mjsikaku_romsel_w)
WRITE8_MEMBER(nbmj8688_state::secolove_romsel_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
m_mjsikaku_gfxrom = ((data & 0xc0) >> 4) + (data & 0x03);
mjsikaku_gfxflag2_w(space, 0, data);
@@ -191,7 +191,7 @@ WRITE8_MEMBER(nbmj8688_state::secolove_romsel_w)
WRITE8_MEMBER(nbmj8688_state::crystalg_romsel_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
m_mjsikaku_gfxrom = (data & 0x03);
mjsikaku_gfxflag2_w(space, 0, data);
@@ -206,7 +206,7 @@ WRITE8_MEMBER(nbmj8688_state::crystalg_romsel_w)
WRITE8_MEMBER(nbmj8688_state::seiha_romsel_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
m_mjsikaku_gfxrom = (data & 0x1f);
mjsikaku_gfxflag3_w(space, 0, data);
@@ -274,7 +274,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void mbmj8688_gfxdraw(running_machine &machine, int gfxtype)
{
nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
- UINT8 *GFX = machine.region("gfx1")->base();
+ UINT8 *GFX = state->memregion("gfx1")->base();
int x, y;
int dx1, dx2, dy;
@@ -317,7 +317,7 @@ static void mbmj8688_gfxdraw(running_machine &machine, int gfxtype)
skipy = -1;
}
- gfxlen = machine.region("gfx1")->bytes();
+ gfxlen = machine.root_device().memregion("gfx1")->bytes();
gfxaddr = (state->m_mjsikaku_gfxrom << 17) + (state->m_blitter_src_addr << 1);
//popmessage("ADDR:%08X DX:%03d DY:%03d SX:%03d SY:%03d", gfxaddr, startx, starty, sizex, sizey);
//if (state->m_blitter_direction_x|state->m_blitter_direction_y) popmessage("ADDR:%08X FX:%01d FY:%01d", gfxaddr, state->m_blitter_direction_x, state->m_blitter_direction_y);
diff --git a/src/mame/video/nbmj8891.c b/src/mame/video/nbmj8891.c
index 4f155264957..907813b7c47 100644
--- a/src/mame/video/nbmj8891.c
+++ b/src/mame/video/nbmj8891.c
@@ -252,7 +252,7 @@ WRITE8_MEMBER(nbmj8891_state::nbmj8891_vramsel_w)
WRITE8_MEMBER(nbmj8891_state::nbmj8891_romsel_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
m_gfxrom = (data & 0x0f);
if ((0x20000 * m_gfxrom) > (gfxlen - 1))
@@ -320,7 +320,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void nbmj8891_gfxdraw(running_machine &machine)
{
nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
- UINT8 *GFX = machine.region("gfx1")->base();
+ UINT8 *GFX = state->memregion("gfx1")->base();
int width = machine.primary_screen->width();
int x, y;
@@ -359,7 +359,7 @@ static void nbmj8891_gfxdraw(running_machine &machine)
skipy = -1;
}
- gfxlen = machine.region("gfx1")->bytes();
+ gfxlen = machine.root_device().memregion("gfx1")->bytes();
gfxaddr = (state->m_gfxrom << 17) + (state->m_blitter_src_addr << 1);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
@@ -472,7 +472,7 @@ static void nbmj8891_gfxdraw(running_machine &machine)
VIDEO_START( nbmj8891_1layer )
{
nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
- UINT8 *CLUT = machine.region("protection")->base();
+ UINT8 *CLUT = state->memregion("protection")->base();
int i;
int width = machine.primary_screen->width();
int height = machine.primary_screen->height();
diff --git a/src/mame/video/nbmj8900.c b/src/mame/video/nbmj8900.c
index 21f9a0436c1..792cd992479 100644
--- a/src/mame/video/nbmj8900.c
+++ b/src/mame/video/nbmj8900.c
@@ -147,12 +147,12 @@ WRITE8_MEMBER(nbmj8900_state::nbmj8900_romsel_w)
{
m_gfxrom = (data & 0x0f);
- if ((0x20000 * m_gfxrom) > (machine().region("gfx")->bytes() - 1))
+ if ((0x20000 * m_gfxrom) > (machine().root_device().memregion("gfx")->bytes() - 1))
{
#ifdef MAME_DEBUG
popmessage("GFXROM BANK OVER!!");
#endif
- m_gfxrom &= (machine().region("gfx")->bytes() / 0x20000 - 1);
+ m_gfxrom &= (machine().root_device().memregion("gfx")->bytes() / 0x20000 - 1);
}
}
@@ -211,7 +211,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void nbmj8900_gfxdraw(running_machine &machine)
{
nbmj8900_state *state = machine.driver_data<nbmj8900_state>();
- unsigned char *GFX = machine.region("gfx")->base();
+ unsigned char *GFX = state->memregion("gfx")->base();
int x, y;
int dx1, dx2, dy1, dy2;
@@ -255,12 +255,12 @@ static void nbmj8900_gfxdraw(running_machine &machine)
{
for (x = startx, ctrx = sizex; ctrx >= 0; x += skipx, ctrx--)
{
- if ((gfxaddr > (machine.region("gfx")->bytes() - 1)))
+ if ((gfxaddr > (machine.root_device().memregion("gfx")->bytes() - 1)))
{
#ifdef MAME_DEBUG
popmessage("GFXROM ADDRESS OVER!!");
#endif
- gfxaddr &= (machine.region("gfx")->bytes() - 1);
+ gfxaddr &= (machine.root_device().memregion("gfx")->bytes() - 1);
}
color = GFX[gfxaddr++];
diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c
index ff37a4f152b..279aa95cfdf 100644
--- a/src/mame/video/nbmj8991.c
+++ b/src/mame/video/nbmj8991.c
@@ -78,7 +78,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type3_w)
******************************************************************************/
WRITE8_MEMBER(nbmj8991_state::nbmj8991_blitter_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
switch (offset)
{
@@ -180,7 +180,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void nbmj8991_gfxdraw(running_machine &machine)
{
nbmj8991_state *state = machine.driver_data<nbmj8991_state>();
- UINT8 *GFX = machine.region("gfx1")->base();
+ UINT8 *GFX = state->memregion("gfx1")->base();
int width = machine.primary_screen->width();
int x, y;
@@ -220,7 +220,7 @@ static void nbmj8991_gfxdraw(running_machine &machine)
skipy = -1;
}
- gfxlen = machine.region("gfx1")->bytes();
+ gfxlen = machine.root_device().memregion("gfx1")->bytes();
gfxaddr = (state->m_gfxrom << 17) + (state->m_blitter_src_addr << 1);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c
index 982a35f0bf7..e43f31ecb97 100644
--- a/src/mame/video/nbmj9195.c
+++ b/src/mame/video/nbmj9195.c
@@ -72,7 +72,7 @@ static int nbmj9195_blitter_r(address_space *space, int offset, int vram)
{
nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
int ret;
- UINT8 *GFXROM = space->machine().region("gfx1")->base();
+ UINT8 *GFXROM = state->memregion("gfx1")->base();
switch (offset)
{
@@ -209,7 +209,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void nbmj9195_gfxdraw(running_machine &machine, int vram)
{
nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
- UINT8 *GFX = machine.region("gfx1")->base();
+ UINT8 *GFX = state->memregion("gfx1")->base();
int width = machine.primary_screen->width();
int x, y;
@@ -256,7 +256,7 @@ static void nbmj9195_gfxdraw(running_machine &machine, int vram)
skipy = -1;
}
- gfxlen = machine.region("gfx1")->bytes();
+ gfxlen = machine.root_device().memregion("gfx1")->bytes();
gfxaddr = ((state->m_blitter_src_addr[vram] + 2) & 0x00ffffff);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c
index 2d28d2765c1..62347d77f8e 100644
--- a/src/mame/video/neogeo.c
+++ b/src/mame/video/neogeo.c
@@ -271,8 +271,8 @@ static void draw_fixed_layer( running_machine &machine, bitmap_rgb32 &bitmap, in
neogeo_state *state = machine.driver_data<neogeo_state>();
int x;
- UINT8* gfx_base = machine.region(state->m_fixed_layer_source ? "fixed" : "fixedbios")->base();
- UINT32 addr_mask = machine.region(state->m_fixed_layer_source ? "fixed" : "fixedbios")->bytes() - 1;
+ UINT8* gfx_base = machine.root_device().memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->base();
+ UINT32 addr_mask = state->memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->bytes() - 1;
UINT16 *video_data = &state->m_videoram[0x7000 | (scanline >> 3)];
UINT32 *pixel_addr = &bitmap.pix32(scanline, NEOGEO_HBEND);
@@ -689,7 +689,7 @@ static void optimize_sprite_data( running_machine &machine )
power of 2 */
state->m_sprite_gfx_address_mask = 0xffffffff;
- len = machine.region("sprites")->bytes();
+ len = state->memregion("sprites")->bytes();
for (bit = 0x80000000; bit != 0; bit >>= 1)
{
@@ -701,7 +701,7 @@ static void optimize_sprite_data( running_machine &machine )
state->m_sprite_gfx = auto_alloc_array_clear(machine, UINT8, state->m_sprite_gfx_address_mask + 1);
- src = machine.region("sprites")->base();
+ src = machine.root_device().memregion("sprites")->base();
dest = state->m_sprite_gfx;
for (i = 0; i < len; i += 0x80, src += 0x80)
@@ -892,7 +892,7 @@ VIDEO_START( neogeo )
machine.save().register_postload(save_prepost_delegate(FUNC(regenerate_pens), &machine));
- state->m_region_zoomy = machine.region("zoomy")->base();
+ state->m_region_zoomy = state->memregion("zoomy")->base();
}
diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c
index 884f88b8ba3..f9a8b038998 100644
--- a/src/mame/video/niyanpai.c
+++ b/src/mame/video/niyanpai.c
@@ -66,7 +66,7 @@ static int niyanpai_blitter_r(running_machine &machine, int vram, int offset)
{
niyanpai_state *state = machine.driver_data<niyanpai_state>();
int ret;
- UINT8 *GFXROM = machine.region("gfx1")->base();
+ UINT8 *GFXROM = state->memregion("gfx1")->base();
switch (offset)
{
@@ -180,7 +180,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void niyanpai_gfxdraw(running_machine &machine, int vram)
{
niyanpai_state *state = machine.driver_data<niyanpai_state>();
- UINT8 *GFX = machine.region("gfx1")->base();
+ UINT8 *GFX = state->memregion("gfx1")->base();
int width = machine.primary_screen->width();
int x, y;
@@ -227,7 +227,7 @@ static void niyanpai_gfxdraw(running_machine &machine, int vram)
skipy = -1;
}
- gfxlen = machine.region("gfx1")->bytes();
+ gfxlen = machine.root_device().memregion("gfx1")->bytes();
gfxaddr = ((state->m_blitter_src_addr[vram] + 2) & 0x00ffffff);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c
index 011bbd2a5c2..c3cfaa50e90 100644
--- a/src/mame/video/nmk16.c
+++ b/src/mame/video/nmk16.c
@@ -638,7 +638,7 @@ int nmk16_bg_sprflip_tx_update(screen_device &screen, bitmap_ind16 &bitmap, cons
int nmk16_bioshipbg_sprflip_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
nmk16_state *state = screen.machine().driver_data<nmk16_state>();
- UINT16 *tilerom = (UINT16 *)screen.machine().region("gfx5")->base();
+ UINT16 *tilerom = (UINT16 *)state->memregion("gfx5")->base();
int scrollx=-(state->m_bioship_scroll[1] + state->m_bioship_scroll[0]*256);
int scrolly=-(state->m_bioship_scroll[3] + state->m_bioship_scroll[2]*256);
diff --git a/src/mame/video/nova2001.c b/src/mame/video/nova2001.c
index b6305996d9f..a3114eaa690 100644
--- a/src/mame/video/nova2001.c
+++ b/src/mame/video/nova2001.c
@@ -10,7 +10,7 @@
PALETTE_INIT( nova2001 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* Color #1 is used for palette animation. */
diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c
index 976d464e77d..98d8f219456 100644
--- a/src/mame/video/ojankohs.c
+++ b/src/mame/video/ojankohs.c
@@ -19,7 +19,7 @@
PALETTE_INIT( ojankoy )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int bit0, bit1, bit2, bit3, bit4, r, g, b;
diff --git a/src/mame/video/othunder.c b/src/mame/video/othunder.c
index 57efde446e9..e54b5187fae 100644
--- a/src/mame/video/othunder.c
+++ b/src/mame/video/othunder.c
@@ -66,7 +66,7 @@ spriteram is being tested, take no notice of that.]
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const int *primasks, int y_offs )
{
othunder_state *state = machine.driver_data<othunder_state>();
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT16 tile_mask = (machine.gfx[0]->total_elements) - 1;
UINT16 *spriteram16 = state->m_spriteram;
int offs, data, tilenum, color, flipx, flipy;
diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c
index 288875f62ee..babd33bd4e3 100644
--- a/src/mame/video/pacland.c
+++ b/src/mame/video/pacland.c
@@ -90,7 +90,7 @@ static void switch_palette(running_machine &machine)
PALETTE_INIT( pacland )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
pacland_state *state = machine.driver_data<pacland_state>();
int i;
@@ -253,7 +253,7 @@ WRITE8_MEMBER(pacland_state::pacland_scroll1_w)
WRITE8_MEMBER(pacland_state::pacland_bankswitch_w)
{
int bankaddress;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
bankaddress = 0x10000 + ((data & 0x07) << 13);
membank("bank1")->set_base(&RAM[bankaddress]);
diff --git a/src/mame/video/pacman.c b/src/mame/video/pacman.c
index f208e96d0c7..c483ae227da 100644
--- a/src/mame/video/pacman.c
+++ b/src/mame/video/pacman.c
@@ -63,7 +63,7 @@
PALETTE_INIT( pacman )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
diff --git a/src/mame/video/pandoras.c b/src/mame/video/pandoras.c
index 4833d9fb698..75c8698ff9b 100644
--- a/src/mame/video/pandoras.c
+++ b/src/mame/video/pandoras.c
@@ -23,7 +23,7 @@
PALETTE_INIT( pandoras )
{
- 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];
diff --git a/src/mame/video/pastelg.c b/src/mame/video/pastelg.c
index 64ceed59ffe..914bf9090ca 100644
--- a/src/mame/video/pastelg.c
+++ b/src/mame/video/pastelg.c
@@ -21,7 +21,7 @@ static void pastelg_gfxdraw(running_machine &machine);
******************************************************************************/
PALETTE_INIT( pastelg )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int bit0, bit1, bit2, bit3, r, g, b;
@@ -100,7 +100,7 @@ WRITE8_MEMBER(pastelg_state::threeds_output_w)
READ8_MEMBER(pastelg_state::threeds_rom_readback_r)
{
- UINT8 *GFX = machine().region("gfx1")->base();
+ UINT8 *GFX = memregion("gfx1")->base();
return GFX[(m_blitter_src_addr | (m_gfxrom << 16)) & 0x3ffff];
}
@@ -108,7 +108,7 @@ READ8_MEMBER(pastelg_state::threeds_rom_readback_r)
WRITE8_MEMBER(pastelg_state::pastelg_romsel_w)
{
- int gfxlen = machine().region("gfx1")->bytes();
+ int gfxlen = memregion("gfx1")->bytes();
m_gfxrom = ((data & 0xc0) >> 6);
m_palbank = ((data & 0x10) >> 4);
nb1413m3_sndrombank1_w(&space, 0, data);
@@ -158,7 +158,7 @@ static TIMER_CALLBACK( blitter_timer_callback )
static void pastelg_gfxdraw(running_machine &machine)
{
pastelg_state *state = machine.driver_data<pastelg_state>();
- UINT8 *GFX = machine.region("gfx1")->base();
+ UINT8 *GFX = state->memregion("gfx1")->base();
int width = machine.primary_screen->width();
int x, y;
@@ -202,7 +202,7 @@ static void pastelg_gfxdraw(running_machine &machine)
incy = -1;
}
- gfxlen = machine.region("gfx1")->bytes();
+ gfxlen = machine.root_device().memregion("gfx1")->bytes();
gfxaddr = (state->m_gfxrom << 16) + state->m_blitter_src_addr;
readflag = 0;
diff --git a/src/mame/video/pcktgal.c b/src/mame/video/pcktgal.c
index e3c69fee4b9..d3e588b1de6 100644
--- a/src/mame/video/pcktgal.c
+++ b/src/mame/video/pcktgal.c
@@ -4,7 +4,7 @@
PALETTE_INIT( pcktgal )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
diff --git a/src/mame/video/pgm.c b/src/mame/video/pgm.c
index 89fa01163ad..b1843d7197e 100644
--- a/src/mame/video/pgm.c
+++ b/src/mame/video/pgm.c
@@ -620,8 +620,8 @@ VIDEO_START( pgm )
pgm_state *state = machine.driver_data<pgm_state>();
int i;
- state->m_bdata = machine.region("sprmask")->base();
- state->m_bdatasize = machine.region("sprmask")->bytes() - 1;
+ state->m_bdata = machine.root_device().memregion("sprmask")->base();
+ state->m_bdatasize = state->memregion("sprmask")->bytes() - 1;
state->m_aoffset = 0;
state->m_boffset = 0;
diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c
index c01d6a5ed13..d37d63e97cd 100644
--- a/src/mame/video/phoenix.c
+++ b/src/mame/video/phoenix.c
@@ -78,7 +78,7 @@ static const res_net_info survival_net_info =
PALETTE_INIT( phoenix )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
rgb_t *rgb;
@@ -96,7 +96,7 @@ PALETTE_INIT( phoenix )
PALETTE_INIT( survival )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
rgb_t *rgb;
@@ -114,7 +114,7 @@ PALETTE_INIT( survival )
PALETTE_INIT( pleiads )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
rgb_t *rgb;
@@ -226,7 +226,7 @@ VIDEO_START( phoenix )
WRITE8_MEMBER(phoenix_state::phoenix_videoram_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
m_videoram_pg[m_videoram_pg_index][offset] = data;
diff --git a/src/mame/video/pingpong.c b/src/mame/video/pingpong.c
index d721ad2acc3..c81d69c7c1f 100644
--- a/src/mame/video/pingpong.c
+++ b/src/mame/video/pingpong.c
@@ -32,7 +32,7 @@
***************************************************************************/
PALETTE_INIT( pingpong )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/pitnrun.c b/src/mame/video/pitnrun.c
index 498b7f7de51..fbb0ace680a 100644
--- a/src/mame/video/pitnrun.c
+++ b/src/mame/video/pitnrun.c
@@ -100,7 +100,7 @@ static void pitnrun_spotlights(running_machine &machine)
{
pitnrun_state *state = machine.driver_data<pitnrun_state>();
int x,y,i,b,datapix;
- UINT8 *ROM = machine.region("user1")->base();
+ UINT8 *ROM = state->memregion("user1")->base();
for(i=0;i<4;i++)
for(y=0;y<128;y++)
for(x=0;x<16;x++)
@@ -117,7 +117,7 @@ static void pitnrun_spotlights(running_machine &machine)
PALETTE_INIT (pitnrun)
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int bit0,bit1,bit2,r,g,b;
for (i = 0;i < 32*3; i++)
@@ -219,19 +219,19 @@ SCREEN_UPDATE_IND16( pitnrun )
#ifdef MAME_DEBUG
if (screen.machine().input().code_pressed_once(KEYCODE_Q))
{
- UINT8 *ROM = screen.machine().region("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
ROM[0x84f6]=0; /* lap 0 - normal */
}
if (screen.machine().input().code_pressed_once(KEYCODE_W))
{
- UINT8 *ROM = screen.machine().region("maincpu")->base();
+ UINT8 *ROM = screen.machine().root_device().memregion("maincpu")->base();
ROM[0x84f6]=6; /* lap 6 = spotlight */
}
if (screen.machine().input().code_pressed_once(KEYCODE_E))
{
- UINT8 *ROM = screen.machine().region("maincpu")->base();
+ UINT8 *ROM = screen.machine().root_device().memregion("maincpu")->base();
ROM[0x84f6]=2; /* lap 3 (trial 2)= lightnings */
ROM[0x8102]=1;
}
diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c
index a91ced248ef..54ed27034f7 100644
--- a/src/mame/video/playch10.c
+++ b/src/mame/video/playch10.c
@@ -16,7 +16,7 @@ WRITE8_MEMBER(playch10_state::playch10_videoram_w)
PALETTE_INIT( playch10 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
int i;
@@ -93,7 +93,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( playch10 )
{
playch10_state *state = machine.driver_data<playch10_state>();
- const UINT8 *bios = machine.region("maincpu")->base();
+ const UINT8 *bios = state->memregion("maincpu")->base();
state->m_pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
@@ -103,7 +103,7 @@ VIDEO_START( playch10 )
VIDEO_START( playch10_hboard )
{
playch10_state *state = machine.driver_data<playch10_state>();
- const UINT8 *bios = machine.region("maincpu")->base();
+ const UINT8 *bios = state->memregion("maincpu")->base();
state->m_pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
diff --git a/src/mame/video/plygonet.c b/src/mame/video/plygonet.c
index bb05aef189b..5401dfeba59 100644
--- a/src/mame/video/plygonet.c
+++ b/src/mame/video/plygonet.c
@@ -102,7 +102,7 @@ VIDEO_START( polygonet )
assert(state->m_ttl_gfx_index != MAX_GFX_ELEMENTS);
/* decode the ttl layer's gfx */
- machine.gfx[state->m_ttl_gfx_index] = gfx_element_alloc(machine, &charlayout, machine.region("gfx1")->base(), machine.total_colors() / 16, 0);
+ machine.gfx[state->m_ttl_gfx_index] = gfx_element_alloc(machine, &charlayout, machine.root_device().memregion("gfx1")->base(), machine.total_colors() / 16, 0);
/* create the tilemap */
state->m_ttl_tilemap = tilemap_create(machine, ttl_get_tile_info, plygonet_scan, 8, 8, 64, 32);
diff --git a/src/mame/video/polepos.c b/src/mame/video/polepos.c
index c5bb1276e0d..f2b065ae761 100644
--- a/src/mame/video/polepos.c
+++ b/src/mame/video/polepos.c
@@ -27,7 +27,7 @@
PALETTE_INIT( polepos )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
polepos_state *state = machine.driver_data<polepos_state>();
int i, j;
@@ -348,7 +348,7 @@ WRITE8_MEMBER(polepos_state::polepos_alpha_w)
static void draw_road(running_machine &machine, bitmap_ind16 &bitmap)
{
polepos_state *state = machine.driver_data<polepos_state>();
- const UINT8 *road_control = machine.region("gfx5")->base();
+ const UINT8 *road_control = state->memregion("gfx5")->base();
const UINT8 *road_bits1 = road_control + 0x2000;
const UINT8 *road_bits2 = road_control + 0x4000;
int x, y, i;
@@ -427,7 +427,7 @@ static void zoom_sprite(running_machine &machine, bitmap_ind16 &bitmap,int big,
{
const gfx_element *gfx = machine.gfx[big ? 3 : 2];
const UINT8 *gfxdata = gfx_element_get_data(gfx, code % gfx->total_elements);
- UINT8 *scaling_rom = machine.region("gfx6")->base();
+ UINT8 *scaling_rom = machine.root_device().memregion("gfx6")->base();
UINT32 transmask = colortable_get_transpen_mask(machine.colortable, gfx, color, 0x1f);
int coloroffs = gfx->color_base + color * gfx->color_granularity;
int x,y;
diff --git a/src/mame/video/policetr.c b/src/mame/video/policetr.c
index 69f91013b30..2504a4eaede 100644
--- a/src/mame/video/policetr.c
+++ b/src/mame/video/policetr.c
@@ -26,10 +26,10 @@ VIDEO_START( policetr )
{
policetr_state *state = machine.driver_data<policetr_state>();
/* the source bitmap is in ROM */
- state->m_srcbitmap = machine.region("gfx1")->base();
+ state->m_srcbitmap = machine.root_device().memregion("gfx1")->base();
/* compute the height */
- state->m_srcbitmap_height_mask = (machine.region("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
+ state->m_srcbitmap_height_mask = (state->memregion("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
/* the destination bitmap is not directly accessible to the CPU */
state->m_dstbitmap = auto_alloc_array(machine, UINT8, DSTBITMAP_WIDTH * DSTBITMAP_HEIGHT);
diff --git a/src/mame/video/pooyan.c b/src/mame/video/pooyan.c
index eb7a3f996e2..525e38065e6 100644
--- a/src/mame/video/pooyan.c
+++ b/src/mame/video/pooyan.c
@@ -29,7 +29,7 @@
PALETTE_INIT( pooyan )
{
- 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];
diff --git a/src/mame/video/popeye.c b/src/mame/video/popeye.c
index 54b7d41c02b..fcca06dc788 100644
--- a/src/mame/video/popeye.c
+++ b/src/mame/video/popeye.c
@@ -115,7 +115,7 @@ static void convert_color_prom(running_machine &machine,const UINT8 *color_prom)
PALETTE_INIT( popeye )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
popeye_state *state = machine.driver_data<popeye_state>();
state->m_invertmask = 0xff;
@@ -124,7 +124,7 @@ PALETTE_INIT( popeye )
PALETTE_INIT( popeyebl )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
popeye_state *state = machine.driver_data<popeye_state>();
state->m_invertmask = 0x00;
@@ -135,7 +135,7 @@ static void set_background_palette(running_machine &machine,int bank)
{
popeye_state *state = machine.driver_data<popeye_state>();
int i;
- UINT8 *color_prom = machine.region("proms")->base() + 16 * bank;
+ UINT8 *color_prom = state->memregion("proms")->base() + 16 * bank;
for (i = 0;i < 16;i++)
{
diff --git a/src/mame/video/popper.c b/src/mame/video/popper.c
index b2050de33be..1c6f032c96b 100644
--- a/src/mame/video/popper.c
+++ b/src/mame/video/popper.c
@@ -46,7 +46,7 @@ static const res_net_info popper_net_info =
PALETTE_INIT( popper )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &popper_decode_info, &popper_net_info);
diff --git a/src/mame/video/portrait.c b/src/mame/video/portrait.c
index 72e6edfde79..f533a910041 100644
--- a/src/mame/video/portrait.c
+++ b/src/mame/video/portrait.c
@@ -77,9 +77,9 @@ VIDEO_START( portrait )
PALETTE_INIT( portrait )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
- UINT8* lookup = machine.region("tileattr")->base();
+ UINT8* lookup = machine.root_device().memregion("tileattr")->base();
/* allocate the colortable */
machine.colortable = colortable_alloc(machine, 0x40);
diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c
index 7c70c74f3f8..441906acc8f 100644
--- a/src/mame/video/ppu2c0x.c
+++ b/src/mame/video/ppu2c0x.c
@@ -410,7 +410,7 @@ void ppu2c0x_device::init_palette_rgb( running_machine &machine, int first_entry
int R, G, B;
- UINT8 *palette_data = machine.region("palette")->base();
+ UINT8 *palette_data = machine.root_device().memregion("palette")->base();
/* Loop through the emphasis modes (8 total) */
for (color_emphasis = 0; color_emphasis < 8; color_emphasis++)
diff --git a/src/mame/video/prehisle.c b/src/mame/video/prehisle.c
index 357a294afbe..812942b78eb 100644
--- a/src/mame/video/prehisle.c
+++ b/src/mame/video/prehisle.c
@@ -59,7 +59,7 @@ WRITE16_MEMBER(prehisle_state::prehisle_control16_w)
static TILE_GET_INFO( get_bg2_tile_info )
{
- UINT8 *tilerom = machine.region("gfx5")->base();
+ UINT8 *tilerom = machine.root_device().memregion("gfx5")->base();
int offs = tile_index * 2;
int attr = tilerom[offs + 1] + (tilerom[offs] << 8);
diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c
index c699561e1f8..f8aa0a853d7 100644
--- a/src/mame/video/psikyo.c
+++ b/src/mame/video/psikyo.c
@@ -269,8 +269,8 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
static const int pri[] = { 0, 0xfc, 0xff, 0xff };
int offs;
UINT16 *spritelist = (UINT16 *)(state->m_spritebuf2 + 0x1800 / 4);
- UINT8 *TILES = machine.region("spritelut")->base(); // Sprites LUT
- int TILES_LEN = machine.region("spritelut")->bytes();
+ UINT8 *TILES = machine.root_device().memregion("spritelut")->base(); // Sprites LUT
+ int TILES_LEN = machine.root_device().memregion("spritelut")->bytes();
int width = machine.primary_screen->width();
int height = machine.primary_screen->height();
@@ -388,8 +388,8 @@ static void draw_sprites_bootleg( running_machine &machine, bitmap_ind16 &bitmap
static const int pri[] = { 0, 0xfc, 0xff, 0xff };
int offs;
UINT16 *spritelist = (UINT16 *)(state->m_spritebuf2 + 0x1800 / 4);
- UINT8 *TILES = machine.region("spritelut")->base(); // Sprites LUT
- int TILES_LEN = machine.region("spritelut")->bytes();
+ UINT8 *TILES = machine.root_device().memregion("spritelut")->base(); // Sprites LUT
+ int TILES_LEN = machine.root_device().memregion("spritelut")->bytes();
int width = machine.primary_screen->width();
int height = machine.primary_screen->height();
diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c
index cb662f657cf..4b982ff7d43 100644
--- a/src/mame/video/punchout.c
+++ b/src/mame/video/punchout.c
@@ -327,7 +327,7 @@ static void punchout_copy_top_palette(running_machine &machine, int bank)
{
punchout_state *state = machine.driver_data<punchout_state>();
int i;
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = state->memregion("proms")->base();
// top monitor palette
for (i = 0; i < 0x100; i++)
@@ -347,7 +347,7 @@ static void punchout_copy_bot_palette(running_machine &machine, int bank)
{
punchout_state *state = machine.driver_data<punchout_state>();
int i;
- const UINT8 *color_prom = machine.region("proms")->base() + 0x600;
+ const UINT8 *color_prom = state->memregion("proms")->base() + 0x600;
// bottom monitor palette
for (i = 0; i < 0x100; i++)
diff --git a/src/mame/video/pushman.c b/src/mame/video/pushman.c
index 5ed997b2f23..9a3fb7c3e7f 100644
--- a/src/mame/video/pushman.c
+++ b/src/mame/video/pushman.c
@@ -15,7 +15,7 @@ static TILEMAP_MAPPER( background_scan_rows )
static TILE_GET_INFO( get_back_tile_info )
{
- UINT8 *bg_map = machine.region("gfx4")->base();
+ UINT8 *bg_map = machine.root_device().memregion("gfx4")->base();
int tile;
tile = bg_map[tile_index << 1] + (bg_map[(tile_index << 1) + 1] << 8);
diff --git a/src/mame/video/quasar.c b/src/mame/video/quasar.c
index d5ff8432624..ceb992adcef 100644
--- a/src/mame/video/quasar.c
+++ b/src/mame/video/quasar.c
@@ -21,7 +21,7 @@
PALETTE_INIT( quasar )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/quizdna.c b/src/mame/video/quizdna.c
index 3f968f608b1..dd9e612e5f5 100644
--- a/src/mame/video/quizdna.c
+++ b/src/mame/video/quizdna.c
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_fg_tile_info )
{
quizdna_state *state = machine.driver_data<quizdna_state>();
int code,col,x,y;
- UINT8 *FG = machine.region("user1")->base();
+ UINT8 *FG = state->memregion("user1")->base();
x = tile_index & 0x1f;
y = FG[(tile_index >> 5) & 0x1f] & 0x3f;
@@ -65,7 +65,7 @@ VIDEO_START( quizdna )
WRITE8_MEMBER(quizdna_state::quizdna_bg_ram_w)
{
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
m_bg_ram[offset] = data;
RAM[0x12000+offset] = data;
@@ -76,7 +76,7 @@ WRITE8_MEMBER(quizdna_state::quizdna_fg_ram_w)
{
int i;
int offs = offset & 0xfff;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
RAM[0x10000+offs] = data;
RAM[0x11000+offs] = data; /* mirror */
diff --git a/src/mame/video/rallyx.c b/src/mame/video/rallyx.c
index 17d26099ba0..2a9af17fda6 100644
--- a/src/mame/video/rallyx.c
+++ b/src/mame/video/rallyx.c
@@ -57,7 +57,7 @@ needs more color combination to render its graphics.
PALETTE_INIT( rallyx )
{
- 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];
@@ -116,7 +116,7 @@ PALETTE_INIT( rallyx )
PALETTE_INIT( jungler )
{
- 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 };
static const int resistances_star[3] = { 150, 100 };
diff --git a/src/mame/video/redalert.c b/src/mame/video/redalert.c
index 0feea399722..f25880443bf 100644
--- a/src/mame/video/redalert.c
+++ b/src/mame/video/redalert.c
@@ -51,7 +51,7 @@ static void get_pens(running_machine &machine, pen_t *pens)
double charmap_b_weights[2];
double back_r_weight[1];
double back_gb_weight[1];
- const UINT8 *prom = machine.region("proms")->base();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
scaler = compute_resistor_weights(0, 0xff, -1,
1, resistances_bitmap, bitmap_weight, 470, 0,
@@ -116,7 +116,7 @@ static void get_panther_pens(running_machine &machine, pen_t *pens)
double charmap_b_weights[2];
double back_r_weight[1];
double back_gb_weight[1];
- const UINT8 *prom = machine.region("proms")->base();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
scaler = compute_resistor_weights(0, 0xff, -1,
1, resistances_bitmap, bitmap_weight, 470, 0,
diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c
index 6e1030597e1..2f25bdf5869 100644
--- a/src/mame/video/redclash.c
+++ b/src/mame/video/redclash.c
@@ -20,7 +20,7 @@
PALETTE_INIT( redclash )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/retofinv.c b/src/mame/video/retofinv.c
index c883466ac2c..2e9c493de0c 100644
--- a/src/mame/video/retofinv.c
+++ b/src/mame/video/retofinv.c
@@ -12,7 +12,7 @@
PALETTE_INIT( retofinv )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/rockrage.c b/src/mame/video/rockrage.c
index cdf85519b52..1c1cec544b4 100644
--- a/src/mame/video/rockrage.c
+++ b/src/mame/video/rockrage.c
@@ -4,7 +4,7 @@
PALETTE_INIT( rockrage )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/rocnrope.c b/src/mame/video/rocnrope.c
index f9ce1d31a53..c3a1470f1c3 100644
--- a/src/mame/video/rocnrope.c
+++ b/src/mame/video/rocnrope.c
@@ -31,7 +31,7 @@
PALETTE_INIT( rocnrope )
{
- 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];
diff --git a/src/mame/video/rollrace.c b/src/mame/video/rollrace.c
index ef07a4cf98b..875e83f3e63 100644
--- a/src/mame/video/rollrace.c
+++ b/src/mame/video/rollrace.c
@@ -22,7 +22,7 @@
***************************************************************************/
PALETTE_INIT( rollrace )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
@@ -103,7 +103,7 @@ SCREEN_UPDATE_IND16( rollrace )
int sx, sy;
int scroll;
int col;
- const UINT8 *mem = screen.machine().region("user1")->base();
+ const UINT8 *mem = state->memregion("user1")->base();
/* fill in background colour*/
bitmap.fill(state->m_ra_bkgpen, cliprect);
diff --git a/src/mame/video/route16.c b/src/mame/video/route16.c
index 4001091499d..4a93f37cafd 100644
--- a/src/mame/video/route16.c
+++ b/src/mame/video/route16.c
@@ -73,8 +73,8 @@ SCREEN_UPDATE_RGB32( route16 )
route16_state *state = screen.machine().driver_data<route16_state>();
offs_t offs;
- UINT8 *color_prom1 = &screen.machine().region("proms")->base()[0x000];
- UINT8 *color_prom2 = &screen.machine().region("proms")->base()[0x100];
+ UINT8 *color_prom1 = &screen.machine().root_device().memregion("proms")->base()[0x000];
+ UINT8 *color_prom2 = &state->memregion("proms")->base()[0x100];
for (offs = 0; offs < state->m_videoram1.bytes(); offs++)
{
@@ -130,8 +130,8 @@ static int video_update_stratvox_ttmahjng(running_machine &machine, bitmap_rgb32
route16_state *state = machine.driver_data<route16_state>();
offs_t offs;
- UINT8 *color_prom1 = &machine.region("proms")->base()[0x000];
- UINT8 *color_prom2 = &machine.region("proms")->base()[0x100];
+ UINT8 *color_prom1 = &machine.root_device().memregion("proms")->base()[0x000];
+ UINT8 *color_prom2 = &state->memregion("proms")->base()[0x100];
for (offs = 0; offs < state->m_videoram1.bytes(); offs++)
{
diff --git a/src/mame/video/rungun.c b/src/mame/video/rungun.c
index ee7764148f1..579f63eb195 100644
--- a/src/mame/video/rungun.c
+++ b/src/mame/video/rungun.c
@@ -89,7 +89,7 @@ VIDEO_START( rng )
assert(gfx_index != MAX_GFX_ELEMENTS);
// decode the ttl layer's gfx
- machine.gfx[gfx_index] = gfx_element_alloc(machine, &charlayout, machine.region("gfx3")->base(), machine.total_colors() / 16, 0);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &charlayout, state->memregion("gfx3")->base(), machine.total_colors() / 16, 0);
state->m_ttl_gfx_index = gfx_index;
// create the tilemap
diff --git a/src/mame/video/sbasketb.c b/src/mame/video/sbasketb.c
index 21b86633a2f..025fe0ca448 100644
--- a/src/mame/video/sbasketb.c
+++ b/src/mame/video/sbasketb.c
@@ -28,7 +28,7 @@
PALETTE_INIT( sbasketb )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[4] = { 2000, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
diff --git a/src/mame/video/scotrsht.c b/src/mame/video/scotrsht.c
index fb8b951b3f6..a6052e59095 100644
--- a/src/mame/video/scotrsht.c
+++ b/src/mame/video/scotrsht.c
@@ -5,7 +5,7 @@
/* Similar as Iron Horse */
PALETTE_INIT( scotrsht )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/sega16sp.c b/src/mame/video/sega16sp.c
index 428b3dc09ca..461dfce55dd 100644
--- a/src/mame/video/sega16sp.c
+++ b/src/mame/video/sega16sp.c
@@ -78,9 +78,9 @@ INLINE const sega16sp_interface *get_interface( device_t *device )
void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
- const UINT8 *zoom = (const UINT8 *)machine.region("proms")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
+ const UINT8 *zoom = (const UINT8 *)machine.root_device().memregion("proms")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -243,9 +243,9 @@ void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bi
void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000;
- const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
- const UINT8 *zoom = (const UINT8 *)machine.region("proms")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x20000;
+ const UINT32 *spritebase = (const UINT32 *)machine.root_device().memregion("gfx2")->base();
+ const UINT8 *zoom = (const UINT8 *)machine.root_device().memregion("proms")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -414,8 +414,8 @@ void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device,
void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -580,11 +580,11 @@ void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitma
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
- spritebase = (const UINT16 *)machine.region("gfx2")->base();
+ spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
if (!spritebase)
return;
- numbanks = machine.region("gfx2")->bytes() / 0x20000;
+ numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x20000;
/* first scan forward to find the end of the list */
for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8)
@@ -741,8 +741,8 @@ void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitma
void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000;
- const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x20000;
+ const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -919,8 +919,8 @@ void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device
static void segaic16_sprites_xboard_outrun_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int type)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x40000;
- const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x40000;
+ const UINT32 *spritebase = (const UINT32 *)machine.root_device().memregion("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -1090,8 +1090,8 @@ void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bi
void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx1")->bytes() / 0x80000;
- const UINT64 *spritebase = (const UINT64 *)machine.region("gfx1")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx1")->bytes() / 0x80000;
+ const UINT64 *spritebase = (const UINT64 *)machine.root_device().memregion("gfx1")->base();
const UINT16 *rotatebase = segaic16_rotate[0].buffer ? segaic16_rotate[0].buffer : segaic16_rotate[0].rotateram;
UINT8 visited[0x1000];
sega16sp_state *sega16sp = get_safe_token(device);
@@ -1384,8 +1384,8 @@ void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bi
void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -1407,8 +1407,8 @@ void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t
/* 4 player passing shot is different to this.. */
void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -1429,8 +1429,8 @@ void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_
void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
diff --git a/src/mame/video/segag80r.c b/src/mame/video/segag80r.c
index c299d72e6f9..7577eed2fe3 100644
--- a/src/mame/video/segag80r.c
+++ b/src/mame/video/segag80r.c
@@ -153,7 +153,7 @@ static void spaceod_bg_init_palette(running_machine &machine)
static TILE_GET_INFO( spaceod_get_tile_info )
{
segag80r_state *state = machine.driver_data<segag80r_state>();
- int code = machine.region("gfx2")->base()[tile_index + 0x1000 * (state->m_spaceod_bg_control >> 6)];
+ int code = state->memregion("gfx2")->base()[tile_index + 0x1000 * (state->m_spaceod_bg_control >> 6)];
SET_TILE_INFO(1, code + 0x100 * ((state->m_spaceod_bg_control >> 2) & 1), 0, 0);
}
@@ -169,7 +169,7 @@ static TILEMAP_MAPPER( spaceod_scan_rows )
static TILE_GET_INFO( bg_get_tile_info )
{
segag80r_state *state = machine.driver_data<segag80r_state>();
- int code = machine.region("gfx2")->base()[tile_index];
+ int code = state->memregion("gfx2")->base()[tile_index];
SET_TILE_INFO(1, code + 0x100 * state->m_bg_char_bank, code >> 4, 0);
}
@@ -216,13 +216,13 @@ VIDEO_START( segag80r )
/* background tilemap is effectively 1 screen x n screens */
case G80_BACKGROUND_MONSTERB:
- state->m_bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 32,machine.region("gfx2")->bytes() / 32);
+ state->m_bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 32,machine.root_device().memregion("gfx2")->bytes() / 32);
break;
/* background tilemap is effectively 4 screens x n screens */
case G80_BACKGROUND_PIGNEWT:
case G80_BACKGROUND_SINDBADM:
- state->m_bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 128,machine.region("gfx2")->bytes() / 128);
+ state->m_bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 128,machine.root_device().memregion("gfx2")->bytes() / 128);
break;
}
diff --git a/src/mame/video/segag80v.c b/src/mame/video/segag80v.c
index 1746f93b01e..fc706b56de1 100644
--- a/src/mame/video/segag80v.c
+++ b/src/mame/video/segag80v.c
@@ -110,7 +110,7 @@ INLINE int adjust_xy(segag80v_state *state, int rawx, int rawy, int *outx, int *
static void sega_generate_vector_list(running_machine &machine)
{
segag80v_state *state = machine.driver_data<segag80v_state>();
- UINT8 *sintable = machine.region("proms")->base();
+ UINT8 *sintable = state->memregion("proms")->base();
double total_time = 1.0 / (double)IRQ_CLOCK;
UINT16 symaddr = 0;
UINT8 *vectorram = state->m_vectorram;
diff --git a/src/mame/video/segaic16.c b/src/mame/video/segaic16.c
index 159c07ba42b..e5d7ffe422c 100644
--- a/src/mame/video/segaic16.c
+++ b/src/mame/video/segaic16.c
@@ -1412,8 +1412,8 @@ WRITE16_HANDLER( segaic16_textram_0_w )
static void segaic16_road_hangon_decode(running_machine &machine, struct road_info *info)
{
int x, y;
- const UINT8 *gfx = machine.region("gfx3")->base();
- int len = machine.region("gfx3")->bytes();
+ const UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int len = machine.root_device().memregion("gfx3")->bytes();
/* allocate memory for the unpacked road data */
info->gfx = auto_alloc_array(machine, UINT8, 256 * 512);
@@ -1673,8 +1673,8 @@ static void segaic16_road_hangon_draw(struct road_info *info, bitmap_ind16 &bitm
static void segaic16_road_outrun_decode(running_machine &machine, struct road_info *info)
{
int x, y;
- const UINT8 *gfx = machine.region("gfx3")->base();
- int len = machine.region("gfx3")->bytes();
+ const UINT8 *gfx = machine.root_device().memregion("gfx3")->base();
+ int len = machine.root_device().memregion("gfx3")->bytes();
/* allocate memory for the unpacked road data */
info->gfx = auto_alloc_array(machine, UINT8, (256 * 2 + 1) * 512);
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c
index 1e567c9f8f2..998dea6a8b5 100644
--- a/src/mame/video/segas32.c
+++ b/src/mame/video/segas32.c
@@ -1665,8 +1665,8 @@ static int draw_one_sprite(running_machine &machine, UINT16 *data, int xoffs, in
};
bitmap_ind16 &bitmap = *state->m_layer_data[(!state->m_is_multi32 || !(data[3] & 0x0800)) ? MIXER_LAYER_SPRITES_2 : MIXER_LAYER_MULTISPR_2].bitmap;
- UINT8 numbanks = machine.region("gfx2")->bytes() / 0x400000;
- const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
+ UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x400000;
+ const UINT32 *spritebase = (const UINT32 *)machine.root_device().memregion("gfx2")->base();
int indirect = data[0] & 0x2000;
int indlocal = data[0] & 0x1000;
diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c
index 571206a226b..7d54edb2610 100644
--- a/src/mame/video/seibuspi.c
+++ b/src/mame/video/seibuspi.c
@@ -508,7 +508,7 @@ VIDEO_START( spi )
for (i = 6000; i < 6016; i++) { state->m_alpha_table[i] = 1; }
for (i = 6128; i < 6144; i++) { state->m_alpha_table[i] = 1; }
- region_length = machine.region("gfx2")->bytes();
+ region_length = machine.root_device().memregion("gfx2")->bytes();
if (region_length <= 0x300000)
{
diff --git a/src/mame/video/seicross.c b/src/mame/video/seicross.c
index d786fcefc89..10e33ba18d5 100644
--- a/src/mame/video/seicross.c
+++ b/src/mame/video/seicross.c
@@ -27,7 +27,7 @@
***************************************************************************/
PALETTE_INIT( seicross )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c
index 740c3e1ae60..3a418d407a5 100644
--- a/src/mame/video/seta.c
+++ b/src/mame/video/seta.c
@@ -290,8 +290,8 @@ WRITE16_MEMBER(seta_state::seta_vregs_w)
if (new_bank != m_samples_bank)
{
- UINT8 *rom = machine().region("x1snd")->base();
- int samples_len = machine().region("x1snd")->bytes();
+ UINT8 *rom = memregion("x1snd")->base();
+ int samples_len = memregion("x1snd")->bytes();
int addr;
m_samples_bank = new_bank;
@@ -665,7 +665,7 @@ PALETTE_INIT( zingzip )
// color prom
PALETTE_INIT( inttoote )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int x;
for (x = 0; x < 0x200 ; x++)
{
@@ -684,7 +684,7 @@ PALETTE_INIT( setaroul )
PALETTE_INIT( usclssic )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int color, pen;
int x;
diff --git a/src/mame/video/sf.c b/src/mame/video/sf.c
index 400129ff722..f7c9b604fa9 100644
--- a/src/mame/video/sf.c
+++ b/src/mame/video/sf.c
@@ -9,7 +9,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *base = machine.region("gfx5")->base() + 2 * tile_index;
+ UINT8 *base = machine.root_device().memregion("gfx5")->base() + 2 * tile_index;
int attr = base[0x10000];
int color = base[0];
int code = (base[0x10000 + 1] << 8) | base[1];
@@ -22,7 +22,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- UINT8 *base = machine.region("gfx5")->base() + 0x20000 + 2 * tile_index;
+ UINT8 *base = machine.root_device().memregion("gfx5")->base() + 0x20000 + 2 * tile_index;
int attr = base[0x10000];
int color = base[0];
int code = (base[0x10000 + 1] << 8) | base[1];
diff --git a/src/mame/video/shangkid.c b/src/mame/video/shangkid.c
index cfd6f269ffe..816cd839df8 100644
--- a/src/mame/video/shangkid.c
+++ b/src/mame/video/shangkid.c
@@ -43,7 +43,7 @@ static TILE_GET_INFO( get_bg_tile_info ){
}
tileinfo.category =
- (machine.region( "proms" )->base()[0x800+color*4]==2)?1:0;
+ (machine.root_device().memregion( "proms" )->base()[0x800+color*4]==2)?1:0;
}
VIDEO_START( shangkid )
@@ -201,7 +201,7 @@ SCREEN_UPDATE_IND16( shangkid )
PALETTE_INIT( dynamski )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/shaolins.c b/src/mame/video/shaolins.c
index 1ad260dc2d4..612e73aa191 100644
--- a/src/mame/video/shaolins.c
+++ b/src/mame/video/shaolins.c
@@ -28,7 +28,7 @@
***************************************************************************/
PALETTE_INIT( shaolins )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[4] = { 2200, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c
index afc199c69be..4b6757eb5b6 100644
--- a/src/mame/video/shisen.c
+++ b/src/mame/video/shisen.c
@@ -12,7 +12,7 @@ WRITE8_MEMBER(shisen_state::sichuan2_bankswitch_w)
{
int bankaddress;
int bank;
- UINT8 *RAM = machine().region("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
if (data & 0xc0) logerror("bank switch %02x\n",data);
diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c
index f89d90f7e0d..7e0fb362e8f 100644
--- a/src/mame/video/shootout.c
+++ b/src/mame/video/shootout.c
@@ -9,7 +9,7 @@
PALETTE_INIT( shootout )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
diff --git a/src/mame/video/sidearms.c b/src/mame/video/sidearms.c
index bae8bf06958..cf41fab7123 100644
--- a/src/mame/video/sidearms.c
+++ b/src/mame/video/sidearms.c
@@ -143,7 +143,7 @@ static TILEMAP_MAPPER( sidearms_tilemap_scan )
VIDEO_START( sidearms )
{
sidearms_state *state = machine.driver_data<sidearms_state>();
- state->m_tilerom = machine.region("gfx4")->base();
+ state->m_tilerom = state->memregion("gfx4")->base();
if (!state->m_gameid)
{
@@ -226,7 +226,7 @@ static void sidearms_draw_starfield( running_machine &machine, bitmap_ind16 &bit
_vcount_191 = state->m_vcount_191;
_hcount_191 = state->m_hcount_191 & 0xff;
- sf_rom = machine.region("user1")->base();
+ sf_rom = machine.root_device().memregion("user1")->base();
#if 0 // old loop (for reference; easier to read)
if (!flipon)
diff --git a/src/mame/video/sidepckt.c b/src/mame/video/sidepckt.c
index 3fc8fd8bbfc..1e1b0968aba 100644
--- a/src/mame/video/sidepckt.c
+++ b/src/mame/video/sidepckt.c
@@ -4,7 +4,7 @@
PALETTE_INIT( sidepckt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
diff --git a/src/mame/video/skyfox.c b/src/mame/video/skyfox.c
index d316835dee4..158f87d2e75 100644
--- a/src/mame/video/skyfox.c
+++ b/src/mame/video/skyfox.c
@@ -89,7 +89,7 @@ WRITE8_MEMBER(skyfox_state::skyfox_vregs_w)
PALETTE_INIT( skyfox )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 256; i++)
@@ -240,7 +240,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
skyfox_state *state = machine.driver_data<skyfox_state>();
- UINT8 *RAM = machine.region("gfx2")->base();
+ UINT8 *RAM = state->memregion("gfx2")->base();
int x, y, i;
/* The foreground stars (sprites) move at twice this speed when
diff --git a/src/mame/video/skykid.c b/src/mame/video/skykid.c
index 065efd0a69c..44b099c58fc 100644
--- a/src/mame/video/skykid.c
+++ b/src/mame/video/skykid.c
@@ -17,7 +17,7 @@
PALETTE_INIT( skykid )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/skyraid.c b/src/mame/video/skyraid.c
index 4bcd8eab764..cfc7575683f 100644
--- a/src/mame/video/skyraid.c
+++ b/src/mame/video/skyraid.c
@@ -39,7 +39,7 @@ static void draw_text(running_machine &machine, bitmap_ind16 &bitmap, const rect
static void draw_terrain(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
skyraid_state *state = machine.driver_data<skyraid_state>();
- const UINT8* p = machine.region("user1")->base();
+ const UINT8* p = state->memregion("user1")->base();
int x;
int y;
@@ -114,7 +114,7 @@ static void draw_missiles(running_machine &machine, bitmap_ind16 &bitmap, const
static void draw_trapezoid(running_machine &machine, bitmap_ind16& dst, bitmap_ind16& src)
{
- const UINT8* p = machine.region("user2")->base();
+ const UINT8* p = machine.root_device().memregion("user2")->base();
int x;
int y;
diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c
index 28ef08641a8..e29fa01c477 100644
--- a/src/mame/video/snk.c
+++ b/src/mame/video/snk.c
@@ -27,7 +27,7 @@
PALETTE_INIT( tnk3 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
int num_colors = 0x400;
diff --git a/src/mame/video/snk6502.c b/src/mame/video/snk6502.c
index e6bd5337b06..7502d8a0331 100644
--- a/src/mame/video/snk6502.c
+++ b/src/mame/video/snk6502.c
@@ -24,7 +24,7 @@
***************************************************************************/
PALETTE_INIT( snk6502 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
snk6502_state *state = machine.driver_data<snk6502_state>();
int i;
@@ -210,7 +210,7 @@ SCREEN_UPDATE_IND16( snk6502 )
PALETTE_INIT( satansat )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
snk6502_state *state = machine.driver_data<snk6502_state>();
int i;
diff --git a/src/mame/video/snookr10.c b/src/mame/video/snookr10.c
index bc1f5b21df8..bcaf5435b36 100644
--- a/src/mame/video/snookr10.c
+++ b/src/mame/video/snookr10.c
@@ -57,7 +57,7 @@ WRITE8_MEMBER(snookr10_state::snookr10_colorram_w)
PALETTE_INIT( snookr10 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* GGBBBRRR */
int i;
@@ -118,7 +118,7 @@ static TILE_GET_INFO( get_bg_tile_info )
PALETTE_INIT( apple10 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* GGBBBRRR */
int i, cn;
diff --git a/src/mame/video/sonson.c b/src/mame/video/sonson.c
index 2fd6e9e1282..5a8c32ad8db 100644
--- a/src/mame/video/sonson.c
+++ b/src/mame/video/sonson.c
@@ -41,7 +41,7 @@
PALETTE_INIT( sonson )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c
index 09095d19de5..92951f7293a 100644
--- a/src/mame/video/spacefb.c
+++ b/src/mame/video/spacefb.c
@@ -209,7 +209,7 @@ static void get_sprite_pens(running_machine &machine, pen_t *pens)
{
spacefb_state *state = machine.driver_data<spacefb_state>();
static const double fade_weights[] = { 1.0, 1.5, 2.5, 4.0 };
- const UINT8 *prom = machine.region("proms")->base();
+ const UINT8 *prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < NUM_SPRITE_PENS; i++)
@@ -251,7 +251,7 @@ static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap
spacefb_state *state = machine.driver_data<spacefb_state>();
UINT8 sy;
- UINT8 *gfx = machine.region("gfx2")->base();
+ UINT8 *gfx = state->memregion("gfx2")->base();
UINT8 code = state->m_videoram[offs + 0x0200] & 0x3f;
UINT8 y = ~state->m_videoram[offs + 0x0100] - 2;
@@ -303,7 +303,7 @@ static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitm
spacefb_state *state = machine.driver_data<spacefb_state>();
UINT8 sy;
- UINT8 *gfx = machine.region("gfx1")->base();
+ UINT8 *gfx = state->memregion("gfx1")->base();
UINT8 code = ~state->m_videoram[offs + 0x0200];
UINT8 color_base = (~state->m_videoram[offs + 0x0300] & 0x0f) << 2;
diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c
index 647c6df9391..968a9bb668d 100644
--- a/src/mame/video/spdodgeb.c
+++ b/src/mame/video/spdodgeb.c
@@ -5,7 +5,7 @@
PALETTE_INIT( spdodgeb )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
@@ -108,7 +108,7 @@ WRITE8_MEMBER(spdodgeb_state::spdodgeb_scrollx_lo_w)
WRITE8_MEMBER(spdodgeb_state::spdodgeb_ctrl_w)
{
- UINT8 *rom = machine().region("maincpu")->base();
+ UINT8 *rom = memregion("maincpu")->base();
/* bit 0 = flip screen */
flip_screen_set(data & 0x01);
diff --git a/src/mame/video/speedatk.c b/src/mame/video/speedatk.c
index 65425ecb8e6..10b21b5607b 100644
--- a/src/mame/video/speedatk.c
+++ b/src/mame/video/speedatk.c
@@ -10,7 +10,7 @@
PALETTE_INIT( speedatk )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/sprcros2.c b/src/mame/video/sprcros2.c
index 4685dd6dc00..8562329b4a8 100644
--- a/src/mame/video/sprcros2.c
+++ b/src/mame/video/sprcros2.c
@@ -9,7 +9,7 @@ Super Cross II (JPN Ver.)
PALETTE_INIT( sprcros2 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c
index 574f1429301..ca481a9828e 100644
--- a/src/mame/video/srmp2.c
+++ b/src/mame/video/srmp2.c
@@ -11,7 +11,7 @@ Functions to emulate the video hardware of the machine.
PALETTE_INIT( srmp2 )
{
- 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++)
@@ -26,7 +26,7 @@ PALETTE_INIT( srmp2 )
PALETTE_INIT( srmp3 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/ssozumo.c b/src/mame/video/ssozumo.c
index 272033a72b9..d08fe4777b5 100644
--- a/src/mame/video/ssozumo.c
+++ b/src/mame/video/ssozumo.c
@@ -14,7 +14,7 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/10/04
PALETTE_INIT( ssozumo )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int bit0, bit1, bit2, bit3, r, g, b;
int i;
diff --git a/src/mame/video/sspeedr.c b/src/mame/video/sspeedr.c
index 0318917ec27..cc27312c557 100644
--- a/src/mame/video/sspeedr.c
+++ b/src/mame/video/sspeedr.c
@@ -83,7 +83,7 @@ WRITE8_MEMBER(sspeedr_state::sspeedr_track_ice_w)
static void draw_track(running_machine &machine, bitmap_ind16 &bitmap)
{
sspeedr_state *state = machine.driver_data<sspeedr_state>();
- const UINT8* p = machine.region("gfx3")->base();
+ const UINT8* p = state->memregion("gfx3")->base();
int x;
int y;
diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c
index dee05e925d5..66af5ae15a9 100644
--- a/src/mame/video/st0016.c
+++ b/src/mame/video/st0016.c
@@ -186,8 +186,8 @@ WRITE8_MEMBER(st0016_state::st0016_vregs_w)
UINT32 srcadr=(st0016_vregs[0xa0]|(st0016_vregs[0xa1]<<8)|(st0016_vregs[0xa2]<<16))<<1;
UINT32 dstadr=(st0016_vregs[0xa3]|(st0016_vregs[0xa4]<<8)|(st0016_vregs[0xa5]<<16))<<1;
UINT32 length=((st0016_vregs[0xa6]|(st0016_vregs[0xa7]<<8)|((st0016_vregs[0xa8]&0x1f)<<16))+1)<<1;
- UINT32 srclen = (machine().region("maincpu")->bytes()-0x10000);
- UINT8 *mem = machine().region("maincpu")->base();
+ UINT32 srclen = (machine().root_device().memregion("maincpu")->bytes()-0x10000);
+ UINT8 *mem = memregion("maincpu")->base();
srcadr += macs_cart_slot*0x400000;
diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c
index ded231b9661..aa4fee5dcfc 100644
--- a/src/mame/video/stactics.c
+++ b/src/mame/video/stactics.c
@@ -59,7 +59,7 @@ tilt the mirror up and down, and the monitor left and right.
static PALETTE_INIT( stactics )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x400; i++)
@@ -306,7 +306,7 @@ static void set_indicator_leds(int data, const char *output_name, int base_index
static void update_artwork(running_machine &machine, stactics_state *state)
{
int i;
- UINT8 *beam_region = machine.region("user1")->base();
+ UINT8 *beam_region = machine.root_device().memregion("user1")->base();
/* set the lamps first */
output_set_indexed_value("base_lamp", 4, state->m_lamps[0] & 0x01);
diff --git a/src/mame/video/stfight.c b/src/mame/video/stfight.c
index 1a11299f066..076a17dcdfe 100644
--- a/src/mame/video/stfight.c
+++ b/src/mame/video/stfight.c
@@ -32,7 +32,7 @@
PALETTE_INIT( stfight )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -97,7 +97,7 @@ static TILEMAP_MAPPER( fg_scan )
static TILE_GET_INFO( get_fg_tile_info )
{
- UINT8 *fgMap = machine.region("gfx5")->base();
+ UINT8 *fgMap = machine.root_device().memregion("gfx5")->base();
int attr,tile_base;
attr = fgMap[0x8000+tile_index];
@@ -120,7 +120,7 @@ static TILEMAP_MAPPER( bg_scan )
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *bgMap = machine.region("gfx6")->base();
+ UINT8 *bgMap = machine.root_device().memregion("gfx6")->base();
int attr,tile_bank,tile_base;
attr = bgMap[0x8000+tile_index];
diff --git a/src/mame/video/strnskil.c b/src/mame/video/strnskil.c
index fe03dd75c99..5168d83ff35 100644
--- a/src/mame/video/strnskil.c
+++ b/src/mame/video/strnskil.c
@@ -14,7 +14,7 @@ Video hardware driver by Uki
PALETTE_INIT( strnskil )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -126,7 +126,7 @@ SCREEN_UPDATE_IND16( strnskil )
{
strnskil_state *state = screen.machine().driver_data<strnskil_state>();
int row;
- const UINT8 *usr1 = screen.machine().region("user1")->base();
+ const UINT8 *usr1 = state->memregion("user1")->base();
for (row = 0; row < 32; row++)
{
diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c
index 771c2d13e5e..9dfd990969c 100644
--- a/src/mame/video/stvvdp2.c
+++ b/src/mame/video/stvvdp2.c
@@ -6839,7 +6839,7 @@ static void stv_dump_ram()
fp=fopen("68k.dmp", "w+b");
if (fp)
{
- fwrite(machine.region(REGION_CPU3)->base(), 0x100000, 1, fp);
+ fwrite(machine.root_device().memregion(REGION_CPU3)->base(), 0x100000, 1, fp);
fclose(fp);
}
}
diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c
index dcbb086c552..ff00aa40167 100644
--- a/src/mame/video/suna8.c
+++ b/src/mame/video/suna8.c
@@ -83,7 +83,7 @@ static TILE_GET_INFO( get_tile_info )
if (machine.input().code_pressed(KEYCODE_X))
{
- UINT8 *rom = machine.region("maincpu")->base() + 0x10000 + 0x4000 * state->m_trombank;
+ UINT8 *rom = state->memregion("maincpu")->base() + 0x10000 + 0x4000 * state->m_trombank;
code = rom[ 2 * tile_index + 0 ];
attr = rom[ 2 * tile_index + 1 ];
}
@@ -416,7 +416,7 @@ SCREEN_UPDATE_IND16( suna8 )
if (screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X))
{
suna8_state *state = screen.machine().driver_data<suna8_state>();
- int max_tiles = screen.machine().region("gfx1")->bytes() / (0x400 * 0x20);
+ int max_tiles = state->memregion("gfx1")->bytes() / (0x400 * 0x20);
if (screen.machine().input().code_pressed_once(KEYCODE_Q)) { state->m_page--; screen.machine().tilemap().mark_all_dirty(); }
if (screen.machine().input().code_pressed_once(KEYCODE_W)) { state->m_page++; screen.machine().tilemap().mark_all_dirty(); }
diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c
index 42adf0ec521..d183c3a9129 100644
--- a/src/mame/video/superchs.c
+++ b/src/mame/video/superchs.c
@@ -58,7 +58,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
{
superchs_state *state = machine.driver_data<superchs_state>();
UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c
index 86059594a06..cccb24fa6e6 100644
--- a/src/mame/video/suprloco.c
+++ b/src/mame/video/suprloco.c
@@ -30,7 +30,7 @@
***************************************************************************/
PALETTE_INIT( suprloco )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
@@ -203,7 +203,7 @@ static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap,const rec
dy = -1;
}
- gfx2 = machine.region("gfx2")->base();
+ gfx2 = machine.root_device().memregion("gfx2")->base();
for (row = 0;row < height;row++,adjy+=dy)
{
int color1,color2,flipx;
diff --git a/src/mame/video/suprnova.c b/src/mame/video/suprnova.c
index 2aca99d7717..f97d591e637 100644
--- a/src/mame/video/suprnova.c
+++ b/src/mame/video/suprnova.c
@@ -626,7 +626,7 @@ SCREEN_UPDATE_RGB32(skns)
state->m_sprite_bitmap.fill(0x0000, cliprect);
if (state->m_alt_enable_sprites)
- state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap, cliprect, state->m_spriteram, state->m_spriteram.bytes(), screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_spc_regs );
+ state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap, cliprect, state->m_spriteram, state->m_spriteram.bytes(), screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), state->m_spc_regs );
return 0;
diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c
index a2ae19cee32..f4b303b033d 100644
--- a/src/mame/video/suprridr.c
+++ b/src/mame/video/suprridr.c
@@ -57,7 +57,7 @@ VIDEO_START( suprridr )
PALETTE_INIT( suprridr )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 96; i++)
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index c362df8d860..9f1a86e41de 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -291,7 +291,7 @@ WRITE8_DEVICE_HANDLER( system1_videoram_bank_w )
WRITE8_MEMBER(system1_state::system1_paletteram_w)
{
- const UINT8 *color_prom = machine().region("palette")->base();
+ const UINT8 *color_prom = memregion("palette")->base();
int val,r,g,b;
/*
@@ -363,8 +363,8 @@ WRITE8_MEMBER(system1_state::system1_paletteram_w)
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset)
{
system1_state *state = machine.driver_data<system1_state>();
- UINT32 gfxbanks = machine.region("sprites")->bytes() / 0x8000;
- const UINT8 *gfxbase = machine.region("sprites")->base();
+ UINT32 gfxbanks = machine.root_device().memregion("sprites")->bytes() / 0x8000;
+ const UINT8 *gfxbase = state->memregion("sprites")->base();
UINT8 *spriteram = state->m_spriteram;
int flipscreen = state->flip_screen();
int spritenum;
@@ -493,7 +493,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
static void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs)
{
system1_state *state = screen.machine().driver_data<system1_state>();
- const UINT8 *lookup = screen.machine().region("proms")->base();
+ const UINT8 *lookup = state->memregion("proms")->base();
int x, y;
/* first clear the sprite bitmap and draw sprites within this area */
diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c
index 7bfd9b96efb..d6cc687dca5 100644
--- a/src/mame/video/tagteam.c
+++ b/src/mame/video/tagteam.c
@@ -34,7 +34,7 @@ static const res_net_decode_info tagteam_decode_info =
PALETTE_INIT( tagteam )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &tagteam_decode_info, &tagteam_net_info);
diff --git a/src/mame/video/tail2nos.c b/src/mame/video/tail2nos.c
index 800997d047f..9c5825fa77d 100644
--- a/src/mame/video/tail2nos.c
+++ b/src/mame/video/tail2nos.c
@@ -62,7 +62,7 @@ VIDEO_START( tail2nos )
state->m_bg_tilemap->set_transparent_pen(15);
- state->m_zoomdata = (UINT16 *)machine.region("gfx3")->base();
+ state->m_zoomdata = (UINT16 *)state->memregion("gfx3")->base();
state->save_pointer(NAME(state->m_zoomdata), 0x20000 / 2);
machine.save().register_postload(save_prepost_delegate(FUNC(tail2nos_postload), &machine));
diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c
index d4d104a4494..ba6104754d9 100644
--- a/src/mame/video/taito_z.c
+++ b/src/mame/video/taito_z.c
@@ -147,7 +147,7 @@ confirmed
static void contcirc_draw_sprites_16x8( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs )
{
taitoz_state *state = machine.driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT16 *spriteram = state->m_spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -242,7 +242,7 @@ static void contcirc_draw_sprites_16x8( running_machine &machine, bitmap_ind16 &
static void chasehq_draw_sprites_16x16( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs )
{
taitoz_state *state = machine.driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT16 *spriteram = state->m_spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -428,7 +428,7 @@ static void chasehq_draw_sprites_16x16( running_machine &machine, bitmap_ind16 &
static void bshark_draw_sprites_16x8( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs )
{
taitoz_state *state = machine.driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT16 *spriteram = state->m_spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -524,7 +524,7 @@ static void bshark_draw_sprites_16x8( running_machine &machine, bitmap_ind16 &bi
static void sci_draw_sprites_16x8( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs )
{
taitoz_state *state = machine.driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT16 *spriteram = state->m_spriteram;
int offs, start_offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -629,7 +629,7 @@ static void sci_draw_sprites_16x8( running_machine &machine, bitmap_ind16 &bitma
static void aquajack_draw_sprites_16x8(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int y_offs)
{
taitoz_state *state = machine.driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT16 *spriteram = state->m_spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -724,7 +724,7 @@ static void aquajack_draw_sprites_16x8(running_machine &machine, bitmap_ind16 &b
static void spacegun_draw_sprites_16x8(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int y_offs)
{
taitoz_state *state = machine.driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT16 *spriteram = state->m_spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c
index 784d61bec87..4065c29dcce 100644
--- a/src/mame/video/taitoic.c
+++ b/src/mame/video/taitoic.c
@@ -3964,7 +3964,7 @@ void tc0150rod_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cl
UINT16 roada_line[512], roadb_line[512];
UINT16 *dst16;
UINT16 *roada, *roadb;
- UINT16 *roadgfx = (UINT16 *)device->machine().region(tc0150rod->gfx_region)->base();
+ UINT16 *roadgfx = (UINT16 *)device->machine().root_device().memregion(tc0150rod->gfx_region)->base();
UINT16 pixel, color, gfx_word;
UINT16 roada_clipl, roada_clipr, roada_bodyctrl;
diff --git a/src/mame/video/taitosj.c b/src/mame/video/taitosj.c
index c594844b991..80d55a7f439 100644
--- a/src/mame/video/taitosj.c
+++ b/src/mame/video/taitosj.c
@@ -144,7 +144,7 @@ static void compute_draw_order(running_machine &machine)
{
taitosj_state *state = machine.driver_data<taitosj_state>();
int i;
- UINT8 *color_prom = machine.region("proms")->base();
+ UINT8 *color_prom = state->memregion("proms")->base();
/* do a simple conversion of the PROM into layer priority order. Note that */
/* this is a simplification, which assumes the PROM encodes a sensible priority */
@@ -204,7 +204,7 @@ READ8_MEMBER(taitosj_state::taitosj_gfxrom_r)
offs_t offs = m_gfxpointer[0] | (m_gfxpointer[1] << 8);
if (offs < 0x8000)
- ret = machine().region("gfx1")->base()[offs];
+ ret = memregion("gfx1")->base()[offs];
else
ret = 0;
diff --git a/src/mame/video/tankbatt.c b/src/mame/video/tankbatt.c
index 1801e91ab8b..b63da82526b 100644
--- a/src/mame/video/tankbatt.c
+++ b/src/mame/video/tankbatt.c
@@ -17,7 +17,7 @@
***************************************************************************/
PALETTE_INIT( tankbatt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
#define RES_1 0xc0 /* this is a guess */
diff --git a/src/mame/video/tatsumi.c b/src/mame/video/tatsumi.c
index 41873a119a7..b28250af76b 100644
--- a/src/mame/video/tatsumi.c
+++ b/src/mame/video/tatsumi.c
@@ -973,7 +973,7 @@ static void draw_bg(running_machine &machine, bitmap_rgb32 &dst, tilemap_t *src,
Each tile (0x4000 of them) has a lookup table in ROM to build an individual 3-bit palette
from sets of 8 bit palettes!
*/
- const UINT8* tile_cluts = machine.region("gfx4")->base();
+ const UINT8* tile_cluts = machine.root_device().memregion("gfx4")->base();
const bitmap_ind16 &src_bitmap = src->pixmap();
int src_y_mask=ysize-1;
int src_x_mask=xsize-1;
@@ -1008,7 +1008,7 @@ static void draw_ground(running_machine &machine, bitmap_rgb32 &dst, const recta
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
int x, y;
- const UINT8 *lut = machine.region("proms")->base();
+ const UINT8 *lut = state->memregion("proms")->base();
UINT16 gva = 0x180; // TODO
UINT8 sky_val = state->m_apache3_rotate_ctrl[1] & 0xff;
diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c
index 541ee62b203..e755ac0141f 100644
--- a/src/mame/video/tceptor.c
+++ b/src/mame/video/tceptor.c
@@ -20,7 +20,7 @@
PALETTE_INIT( tceptor )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
tceptor_state *state = machine.driver_data<tceptor_state>();
int i;
@@ -243,7 +243,7 @@ static void decode_bg(running_machine &machine, const char * region)
};
int gfx_index = state->m_bg;
- UINT8 *src = machine.region(region)->base() + 0x8000;
+ UINT8 *src = machine.root_device().memregion(region)->base() + 0x8000;
UINT8 *buffer;
int len = 0x8000;
int i;
@@ -261,7 +261,7 @@ static void decode_bg(running_machine &machine, const char * region)
auto_free(machine, buffer);
/* decode the graphics */
- machine.gfx[gfx_index] = gfx_element_alloc(machine, &bg_layout, machine.region(region)->base(), 64, 2048);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &bg_layout, machine.root_device().memregion(region)->base(), 64, 2048);
}
static void decode_sprite(running_machine &machine, int gfx_index, const gfx_layout *layout, const void *data)
@@ -291,8 +291,8 @@ static void decode_sprite16(running_machine &machine, const char * region)
2*16*16
};
- UINT8 *src = machine.region(region)->base();
- int len = machine.region(region)->bytes();
+ UINT8 *src = machine.root_device().memregion(region)->base();
+ int len = machine.root_device().memregion(region)->bytes();
UINT8 *dst;
int i, y;
@@ -343,8 +343,8 @@ static void decode_sprite32(running_machine &machine, const char * region)
2*32*32
};
- UINT8 *src = machine.region(region)->base();
- int len = machine.region(region)->bytes();
+ UINT8 *src = machine.root_device().memregion(region)->base();
+ int len = machine.root_device().memregion(region)->bytes();
int total = spr32_layout.total;
int size = spr32_layout.charincrement / 8;
UINT8 *dst;
diff --git a/src/mame/video/tecmosys.c b/src/mame/video/tecmosys.c
index 057cdeeac96..4a50880233d 100644
--- a/src/mame/video/tecmosys.c
+++ b/src/mame/video/tecmosys.c
@@ -112,7 +112,7 @@ WRITE16_MEMBER(tecmosys_state::bg2_tilemap_lineram_w)
static void tecmosys_render_sprites_to_bitmap(running_machine &machine, bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray )
{
tecmosys_state *state = machine.driver_data<tecmosys_state>();
- UINT8 *gfxsrc = machine.region ( "gfx1" )->base();
+ UINT8 *gfxsrc = state->memregion ( "gfx1" )->base();
int i;
/* render sprites (with priority information) to temp bitmap */
diff --git a/src/mame/video/terracre.c b/src/mame/video/terracre.c
index 95954bc784c..a89980005df 100644
--- a/src/mame/video/terracre.c
+++ b/src/mame/video/terracre.c
@@ -34,7 +34,7 @@ TILE_GET_INFO( get_fg_tile_info )
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
terracre_state *state = machine.driver_data<terracre_state>();
- const UINT8 *spritepalettebank = machine.region("user1")->base();
+ const UINT8 *spritepalettebank = state->memregion("user1")->base();
const gfx_element *pGfx = machine.gfx[2];
const UINT16 *pSource = state->m_spriteram;
int i;
@@ -95,7 +95,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
PALETTE_INIT( amazon )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c
index 1ef3449c9ef..3cf24c6b0f1 100644
--- a/src/mame/video/thedeep.c
+++ b/src/mame/video/thedeep.c
@@ -88,7 +88,7 @@ WRITE8_MEMBER(thedeep_state::thedeep_vram_1_w)
PALETTE_INIT( thedeep )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 512;i++)
palette_set_color_rgb(machine,i,pal4bit(color_prom[0x400 + i] >> 0),pal4bit(color_prom[0x400 + i] >> 4),pal4bit(color_prom[0x200 + i] >> 0));
diff --git a/src/mame/video/thepit.c b/src/mame/video/thepit.c
index bbf855a6351..e0d708842a3 100644
--- a/src/mame/video/thepit.c
+++ b/src/mame/video/thepit.c
@@ -28,7 +28,7 @@
PALETTE_INIT( thepit )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 32; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( thepit )
PALETTE_INIT( suprmous )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 32; i++)
diff --git a/src/mame/video/thief.c b/src/mame/video/thief.c
index e419f11619b..3ddc18d3f47 100644
--- a/src/mame/video/thief.c
+++ b/src/mame/video/thief.c
@@ -161,7 +161,7 @@ static UINT16 fetch_image_addr( coprocessor_t &thief_coprocessor ){
WRITE8_MEMBER(thief_state::thief_blit_w){
coprocessor_t &thief_coprocessor = m_coprocessor;
int i, offs, xoffset, dy;
- UINT8 *gfx_rom = machine().region( "gfx1" )->base();
+ UINT8 *gfx_rom = memregion( "gfx1" )->base();
UINT8 x = thief_coprocessor.param[SCREEN_XPOS];
UINT8 y = thief_coprocessor.param[SCREEN_YPOS];
UINT8 width = thief_coprocessor.param[BLIT_WIDTH];
@@ -239,7 +239,7 @@ READ8_MEMBER(thief_state::thief_coprocessor_r){
return thief_coprocessor.image_ram[addr];
}
else {
- UINT8 *gfx_rom = machine().region( "gfx1" )->base();
+ UINT8 *gfx_rom = memregion( "gfx1" )->base();
addr -= 0x2000;
if( addr<0x6000 ) return gfx_rom[addr];
}
diff --git a/src/mame/video/tigeroad.c b/src/mame/video/tigeroad.c
index baab84bc1e7..ba7879a4656 100644
--- a/src/mame/video/tigeroad.c
+++ b/src/mame/video/tigeroad.c
@@ -112,7 +112,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
static TILE_GET_INFO( get_bg_tile_info )
{
tigeroad_state *state = machine.driver_data<tigeroad_state>();
- UINT8 *tilerom = machine.region("gfx4")->base();
+ UINT8 *tilerom = state->memregion("gfx4")->base();
int data = tilerom[tile_index];
int attr = tilerom[tile_index + 1];
diff --git a/src/mame/video/timelimt.c b/src/mame/video/timelimt.c
index 4c18a23866e..af5e42814af 100644
--- a/src/mame/video/timelimt.c
+++ b/src/mame/video/timelimt.c
@@ -21,7 +21,7 @@
***************************************************************************/
PALETTE_INIT( timelimt ) {
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
diff --git a/src/mame/video/timeplt.c b/src/mame/video/timeplt.c
index b2bdc08094c..6f824a55b3b 100644
--- a/src/mame/video/timeplt.c
+++ b/src/mame/video/timeplt.c
@@ -39,7 +39,7 @@
PALETTE_INIT( timeplt )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
rgb_t palette[32];
int i;
diff --git a/src/mame/video/tmnt.c b/src/mame/video/tmnt.c
index 9ce5784683b..10a03c54196 100644
--- a/src/mame/video/tmnt.c
+++ b/src/mame/video/tmnt.c
@@ -5,7 +5,7 @@
static TILE_GET_INFO( glfgreat_get_roz_tile_info )
{
tmnt_state *state = machine.driver_data<tmnt_state>();
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = state->memregion("user1")->base();
int code;
tile_index += 0x40000 * state->m_glfgreat_roz_rom_bank;
@@ -17,7 +17,7 @@ static TILE_GET_INFO( glfgreat_get_roz_tile_info )
static TILE_GET_INFO( prmrsocr_get_roz_tile_info )
{
- UINT8 *rom = machine.region("user1")->base();
+ UINT8 *rom = machine.root_device().memregion("user1")->base();
int code = rom[tile_index + 0x20000] + 256 * rom[tile_index];
SET_TILE_INFO(0, code & 0x1fff, code >> 13, 0);
@@ -416,14 +416,14 @@ READ16_MEMBER(tmnt_state::glfgreat_rom_r)
{
if (m_glfgreat_roz_rom_mode)
- return machine().region("gfx3")->base()[m_glfgreat_roz_char_bank * 0x80000 + offset];
+ return memregion("gfx3")->base()[m_glfgreat_roz_char_bank * 0x80000 + offset];
else if (offset < 0x40000)
{
- UINT8 *usr = machine().region("user1")->base();
+ UINT8 *usr = memregion("user1")->base();
return usr[offset + 0x80000 + m_glfgreat_roz_rom_bank * 0x40000] + 256 * usr[offset + m_glfgreat_roz_rom_bank * 0x40000];
}
else
- return machine().region("user1")->base()[((offset & 0x3ffff) >> 2) + 0x100000 + m_glfgreat_roz_rom_bank * 0x10000];
+ return memregion("user1")->base()[((offset & 0x3ffff) >> 2) + 0x100000 + m_glfgreat_roz_rom_bank * 0x10000];
}
WRITE16_MEMBER(tmnt_state::glfgreat_122000_w)
@@ -522,10 +522,10 @@ READ16_MEMBER(tmnt_state::prmrsocr_rom_r)
{
if(m_glfgreat_roz_char_bank)
- return machine().region("gfx3")->base()[offset];
+ return memregion("gfx3")->base()[offset];
else
{
- UINT8 *usr = machine().region("user1")->base();
+ UINT8 *usr = memregion("user1")->base();
return 256 * usr[offset] + usr[offset + 0x020000];
}
}
diff --git a/src/mame/video/tnzs.c b/src/mame/video/tnzs.c
index 77497e499ad..32bf8654766 100644
--- a/src/mame/video/tnzs.c
+++ b/src/mame/video/tnzs.c
@@ -32,7 +32,7 @@
PALETTE_INIT( arknoid2 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, col;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/toypop.c b/src/mame/video/toypop.c
index 60e7eb75b4e..4da8dea2e44 100644
--- a/src/mame/video/toypop.c
+++ b/src/mame/video/toypop.c
@@ -20,7 +20,7 @@
PALETTE_INIT( toypop )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* allocate the colortable */
machine.colortable = colortable_alloc(machine, 256);
diff --git a/src/mame/video/tp84.c b/src/mame/video/tp84.c
index e6486aaed73..fc5575e2729 100644
--- a/src/mame/video/tp84.c
+++ b/src/mame/video/tp84.c
@@ -43,7 +43,7 @@
*/
PALETTE_INIT( tp84 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
static const int resistances[4] = { 1000, 470, 220, 100 };
double weights[4];
int i;
diff --git a/src/mame/video/trackfld.c b/src/mame/video/trackfld.c
index 2a234d87633..fe1053ee749 100644
--- a/src/mame/video/trackfld.c
+++ b/src/mame/video/trackfld.c
@@ -31,7 +31,7 @@
PALETTE_INIT( trackfld )
{
- 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];
diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c
index fc2bf9f9fab..28841595ef6 100644
--- a/src/mame/video/travrusa.c
+++ b/src/mame/video/travrusa.c
@@ -39,7 +39,7 @@ J Clegg
PALETTE_INIT( travrusa )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
@@ -115,7 +115,7 @@ PALETTE_INIT( travrusa )
PALETTE_INIT( shtrider )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
diff --git a/src/mame/video/trucocl.c b/src/mame/video/trucocl.c
index 44c51f83b8e..7931bb1cde6 100644
--- a/src/mame/video/trucocl.c
+++ b/src/mame/video/trucocl.c
@@ -38,7 +38,7 @@ Daughterboard: Custom made, plugged in the 2 roms and Z80 mainboard sockets.
PALETTE_INIT( trucocl )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < 32;i++)
diff --git a/src/mame/video/tryout.c b/src/mame/video/tryout.c
index 4001d308e40..33062dcd4d6 100644
--- a/src/mame/video/tryout.c
+++ b/src/mame/video/tryout.c
@@ -11,7 +11,7 @@
PALETTE_INIT( tryout )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
diff --git a/src/mame/video/tubep.c b/src/mame/video/tubep.c
index 7b31c779e21..a2d20760258 100644
--- a/src/mame/video/tubep.c
+++ b/src/mame/video/tubep.c
@@ -133,7 +133,7 @@
PALETTE_INIT( tubep )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
tubep_state *state = machine.driver_data<tubep_state>();
int i,r,g,b;
@@ -437,7 +437,7 @@ static void draw_sprite(running_machine &machine)
tubep_state *state = machine.driver_data<tubep_state>();
UINT32 XDOT;
UINT32 YDOT;
- UINT8 * romCxx = machine.region("user2")->base()+0x00000;
+ UINT8 * romCxx = state->memregion("user2")->base()+0x00000;
UINT8 * romD10 = romCxx+0x10000;
UINT8 * romEF13 = romCxx+0x12000;
UINT8 * romHI2 = romCxx+0x14000;
@@ -588,8 +588,8 @@ SCREEN_UPDATE_IND16( tubep )
pen_t pen_base = 32; //change it later
UINT32 v;
- UINT8 *text_gfx_base = screen.machine().region("gfx1")->base();
- UINT8 *romBxx = screen.machine().region("user1")->base() + 0x2000*state->m_background_romsel;
+ UINT8 *text_gfx_base = screen.machine().root_device().memregion("gfx1")->base();
+ UINT8 *romBxx = state->memregion("user1")->base() + 0x2000*state->m_background_romsel;
/* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect.min_y, cliprect.max_y+1); */
@@ -686,7 +686,7 @@ SCREEN_UPDATE_IND16( tubep )
PALETTE_INIT( rjammer )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const int resistors_rg[3] = { 1000, 470, 220 };
@@ -743,8 +743,8 @@ SCREEN_UPDATE_IND16( rjammer )
int DISP_ = state->m_DISP^1;
UINT32 v;
- UINT8 *text_gfx_base = screen.machine().region("gfx1")->base();
- UINT8 *rom13D = screen.machine().region("user1")->base();
+ UINT8 *text_gfx_base = screen.machine().root_device().memregion("gfx1")->base();
+ UINT8 *rom13D = state->memregion("user1")->base();
UINT8 *rom11BD = rom13D+0x1000;
UINT8 *rom19C = rom13D+0x5000;
diff --git a/src/mame/video/tunhunt.c b/src/mame/video/tunhunt.c
index 7d08d6dce42..1b6e94325a3 100644
--- a/src/mame/video/tunhunt.c
+++ b/src/mame/video/tunhunt.c
@@ -155,7 +155,7 @@ static void set_pens(running_machine &machine)
0020: 00 f0 f0 f0 b0 b0 00 f0
00 f0 f0 00 b0 00 f0 f0
*/
- //const UINT8 *color_prom = machine.region( "proms" )->base();
+ //const UINT8 *color_prom = machine.root_device().memregion( "proms" )->base();
tunhunt_state *state = machine.driver_data<tunhunt_state>();
int color;
int shade;
diff --git a/src/mame/video/turbo.c b/src/mame/video/turbo.c
index 12bd3bcf756..96ec0559f13 100644
--- a/src/mame/video/turbo.c
+++ b/src/mame/video/turbo.c
@@ -283,7 +283,7 @@ INLINE UINT32 sprite_xscale(UINT8 dacinput, double vr1, double vr2, double cext)
static void turbo_prepare_sprites(running_machine &machine, turbo_state *state, UINT8 y, sprite_info *info)
{
- const UINT8 *pr1119 = machine.region("proms")->base() + 0x200;
+ const UINT8 *pr1119 = machine.root_device().memregion("proms")->base() + 0x200;
int sprnum;
/* initialize the line enable signals to 0 */
@@ -349,7 +349,7 @@ static void turbo_prepare_sprites(running_machine &machine, turbo_state *state,
static UINT32 turbo_get_sprite_bits(running_machine &machine, UINT8 road, sprite_info *sprinfo)
{
- const UINT8 *sprite_gfxdata = machine.region("gfx1")->base();
+ const UINT8 *sprite_gfxdata = machine.root_device().memregion("gfx1")->base();
UINT8 sprlive = sprinfo->lst;
UINT32 sprdata = 0;
int level;
@@ -406,8 +406,8 @@ SCREEN_UPDATE_IND16( turbo )
{
turbo_state *state = screen.machine().driver_data<turbo_state>();
bitmap_ind16 &fgpixmap = state->m_fg_tilemap->pixmap();
- const UINT8 *road_gfxdata = screen.machine().region("gfx3")->base();
- const UINT8 *prom_base = screen.machine().region("proms")->base();
+ const UINT8 *road_gfxdata = screen.machine().root_device().memregion("gfx3")->base();
+ const UINT8 *prom_base = state->memregion("proms")->base();
const UINT8 *pr1114 = prom_base + 0x000;
const UINT8 *pr1115 = prom_base + 0x020;
const UINT8 *pr1116 = prom_base + 0x040;
@@ -642,7 +642,7 @@ SCREEN_UPDATE_IND16( turbo )
static void subroc3d_prepare_sprites(running_machine &machine, turbo_state *state, UINT8 y, sprite_info *info)
{
- const UINT8 *pr1449 = machine.region("proms")->base() + 0x300;
+ const UINT8 *pr1449 = machine.root_device().memregion("proms")->base() + 0x300;
int sprnum;
/* initialize the line enable signals to 0 */
@@ -708,7 +708,7 @@ static UINT32 subroc3d_get_sprite_bits(running_machine &machine, sprite_info *sp
end is in bit 1, plb in bit 0
*/
static const UINT8 plb_end[16] = { 0,1,1,2, 1,1,1,1, 1,1,1,1, 0,1,1,2 };
- const UINT8 *sprite_gfxdata = machine.region("gfx1")->base();
+ const UINT8 *sprite_gfxdata = machine.root_device().memregion("gfx1")->base();
UINT32 sprdata = 0;
int level;
@@ -761,7 +761,7 @@ SCREEN_UPDATE_IND16( subroc3d )
{
turbo_state *state = screen.machine().driver_data<turbo_state>();
bitmap_ind16 &fgpixmap = state->m_fg_tilemap->pixmap();
- const UINT8 *prom_base = screen.machine().region("proms")->base();
+ const UINT8 *prom_base = state->memregion("proms")->base();
const UINT8 *pr1419 = prom_base + 0x000;
const UINT8 *pr1620 = prom_base + 0x200;
const UINT8 *pr1450 = prom_base + 0x500;
@@ -861,7 +861,7 @@ SCREEN_UPDATE_IND16( subroc3d )
static void buckrog_prepare_sprites(running_machine &machine, turbo_state *state, UINT8 y, sprite_info *info)
{
- const UINT8 *pr5196 = machine.region("proms")->base() + 0x100;
+ const UINT8 *pr5196 = machine.root_device().memregion("proms")->base() + 0x100;
int sprnum;
/* initialize the line enable signals to 0 */
@@ -928,7 +928,7 @@ static UINT32 buckrog_get_sprite_bits(running_machine &machine, sprite_info *spr
end is in bit 1, plb in bit 0
*/
static const UINT8 plb_end[16] = { 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,2 };
- const UINT8 *sprite_gfxdata = machine.region("gfx1")->base();
+ const UINT8 *sprite_gfxdata = machine.root_device().memregion("gfx1")->base();
UINT32 sprdata = 0;
int level;
@@ -981,8 +981,8 @@ SCREEN_UPDATE_IND16( buckrog )
{
turbo_state *state = screen.machine().driver_data<turbo_state>();
bitmap_ind16 &fgpixmap = state->m_fg_tilemap->pixmap();
- const UINT8 *bgcolor = screen.machine().region("gfx3")->base();
- const UINT8 *prom_base = screen.machine().region("proms")->base();
+ const UINT8 *bgcolor = screen.machine().root_device().memregion("gfx3")->base();
+ const UINT8 *prom_base = state->memregion("proms")->base();
const UINT8 *pr5194 = prom_base + 0x000;
const UINT8 *pr5198 = prom_base + 0x500;
const UINT8 *pr5199 = prom_base + 0x700;
diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c
index 45a27eba783..bcd4613a75c 100644
--- a/src/mame/video/tx1.c
+++ b/src/mame/video/tx1.c
@@ -112,7 +112,7 @@ enum
PALETTE_INIT( tx1 )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
static const res_net_info tx1_net_info =
@@ -236,7 +236,7 @@ static void tx1_draw_char(running_machine &machine, UINT8 *bitmap)
UINT8 *chars, *gfx2;
/* 2bpp characters */
- chars = machine.region("char_tiles")->base();
+ chars = state->memregion("char_tiles")->base();
gfx2 = chars + 0x4000;
/* X scroll value is the last word in char RAM */
@@ -416,13 +416,13 @@ static void tx1_draw_road(running_machine &machine, UINT8 *bitmap)
UINT8 pix[2][4][3];
/* Road slice map ROMs */
- const UINT8 *const gfx3 = machine.region("gfx3")->base();
+ const UINT8 *const gfx3 = machine.root_device().memregion("gfx3")->base();
const UINT8 *const rom_a = gfx3;
const UINT8 *const rom_b = gfx3 + 0x2000;
const UINT8 *const rom_c = gfx3 + 0x4000;
/* Pixel data */
- const UINT8 *const proms = machine.region("proms")->base();
+ const UINT8 *const proms = state->memregion("proms")->base();
const UINT8 *const prom_a = proms + 0x1100;
const UINT8 *const prom_b = proms + 0x1300;
const UINT8 *const prom_c = proms + 0x1500;
@@ -859,18 +859,18 @@ static void tx1_draw_objects(running_machine &machine, UINT8 *bitmap)
UINT32 offs;
/* The many lookup table ROMs */
- const UINT8 *const ic48 = machine.region("user3")->base();
+ const UINT8 *const ic48 = machine.root_device().memregion("user3")->base();
const UINT8 *const ic281 = ic48 + 0x2000;
- const UINT8 *const proms = machine.region("proms")->base();
+ const UINT8 *const proms = machine.root_device().memregion("proms")->base();
const UINT8 *const ic190 = proms + 0xc00;
const UINT8 *const ic162 = proms + 0xe00;
const UINT8 *const ic25 = proms + 0x1000;
- const UINT8 *const ic106 = machine.region("obj_map")->base();
+ const UINT8 *const ic106 = machine.root_device().memregion("obj_map")->base();
const UINT8 *const ic73 = ic106 + 0x4000;
- const UINT8 *const pixdata_rgn = machine.region("obj_tiles")->base();
+ const UINT8 *const pixdata_rgn = state->memregion("obj_tiles")->base();
for (offs = 0x0; offs <= 0x300; offs += 8)
{
@@ -1136,7 +1136,7 @@ static void tx1_combine_layers(running_machine &machine, bitmap_ind16 &bitmap, i
{
tx1_state *state = machine.driver_data<tx1_state>();
int x, y;
- UINT8 *chr_pal = machine.region("proms")->base() + 0x900;
+ UINT8 *chr_pal = state->memregion("proms")->base() + 0x900;
int x_offset = screen * 256;
@@ -1249,7 +1249,7 @@ SCREEN_UPDATE_IND16( tx1_right )
PALETTE_INIT( buggyboy )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -1300,8 +1300,8 @@ static void buggyboy_draw_char(running_machine &machine, UINT8 *bitmap, int wide
UINT32 x_mask;
/* 2bpp characters */
- chars = machine.region("char_tiles")->base();
- gfx2 = machine.region("char_tiles")->base() + 0x4000;
+ chars = machine.root_device().memregion("char_tiles")->base();
+ gfx2 = state->memregion("char_tiles")->base() + 0x4000;
/* X/Y scroll values are the last word in char RAM */
if (wide)
@@ -1535,8 +1535,8 @@ static void buggyboy_draw_road(running_machine &machine, UINT8 *bitmap)
UINT32 rva20_6;
/* ROM/PROM lookup tables */
- const UINT8 *rcols = (UINT8*)(machine.region("proms")->base() + 0x1500);
- const UINT8 *rom = machine.region("road")->base();
+ const UINT8 *rcols = (UINT8*)(machine.root_device().memregion("proms")->base() + 0x1500);
+ const UINT8 *rom = state->memregion("road")->base();
const UINT8 *prom0 = rom + 0x4000;
const UINT8 *prom1 = rom + 0x4200;
const UINT8 *prom2 = rom + 0x4400;
@@ -2167,8 +2167,8 @@ static void buggybjr_draw_road(running_machine &machine, UINT8 *bitmap, int wide
UINT32 rva20_6;
/* ROM/PROM lookup tables */
- const UINT8 *rcols = (UINT8*)(machine.region("proms")->base() + 0x1500);
- const UINT8 *rom = machine.region("road")->base();
+ const UINT8 *rcols = (UINT8*)(machine.root_device().memregion("proms")->base() + 0x1500);
+ const UINT8 *rom = state->memregion("road")->base();
const UINT8 *prom0 = rom + 0x4000;
const UINT8 *prom1 = rom + 0x4200;
const UINT8 *prom2 = rom + 0x4400;
@@ -2580,17 +2580,17 @@ static void buggyboy_draw_objs(running_machine &machine, UINT8 *bitmap, int wide
UINT32 x_stride;
/* The many lookup table ROMs */
- const UINT8 *const bug13 = (UINT8*)machine.region("obj_luts")->base();
+ const UINT8 *const bug13 = (UINT8*)machine.root_device().memregion("obj_luts")->base();
const UINT8 *const bug18s = bug13 + 0x2000;
- const UINT8 *const bb8 = (UINT8*)machine.region("proms")->base() + 0x1600;
+ const UINT8 *const bb8 = (UINT8*)machine.root_device().memregion("proms")->base() + 0x1600;
- const UINT8 *const bug16s = (UINT8*)machine.region("obj_map")->base();
+ const UINT8 *const bug16s = (UINT8*)machine.root_device().memregion("obj_map")->base();
const UINT8 *const bug17s = bug16s + 0x8000;
- const UINT8 *const bb9o = (UINT8*)machine.region("proms")->base() + 0x500;
+ const UINT8 *const bb9o = (UINT8*)machine.root_device().memregion("proms")->base() + 0x500;
const UINT8 *const bb9e = bb9o + 0x800;
- const UINT8 *const pixdata_rgn = (UINT8*)machine.region("obj_tiles")->base();
+ const UINT8 *const pixdata_rgn = (UINT8*)state->memregion("obj_tiles")->base();
if (wide)
{
@@ -2931,7 +2931,7 @@ WRITE16_MEMBER(tx1_state::buggyboy_scolst_w)
static void bb_combine_layers(running_machine &machine, bitmap_ind16 &bitmap, int screen)
{
tx1_state *state = machine.driver_data<tx1_state>();
- UINT8 *chr_pal = machine.region("proms")->base() + 0x400;
+ UINT8 *chr_pal = state->memregion("proms")->base() + 0x400;
UINT32 bmp_stride;
UINT32 x_offset;
UINT32 y;
diff --git a/src/mame/video/ultratnk.c b/src/mame/video/ultratnk.c
index ac51ea5dde5..e0a55baa212 100644
--- a/src/mame/video/ultratnk.c
+++ b/src/mame/video/ultratnk.c
@@ -11,7 +11,7 @@ Atari Ultra Tank video emulation
PALETTE_INIT( ultratnk )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
/* allocate the colortable */
machine.colortable = colortable_alloc(machine, 4);
diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c
index 4ad337c475b..2765aa5e153 100644
--- a/src/mame/video/undrfire.c
+++ b/src/mame/video/undrfire.c
@@ -68,7 +68,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
{
undrfire_state *state = machine.driver_data<undrfire_state>();
UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
@@ -212,8 +212,8 @@ static void draw_sprites_cbombers(running_machine &machine, bitmap_ind16 &bitmap
{
undrfire_state *state = machine.driver_data<undrfire_state>();
UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
- UINT8 *spritemapHibit = (UINT8 *)machine.region("user2")->base();
+ UINT16 *spritemap = (UINT16 *)machine.root_device().memregion("user1")->base();
+ UINT8 *spritemapHibit = (UINT8 *)state->memregion("user2")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
diff --git a/src/mame/video/vball.c b/src/mame/video/vball.c
index 98a336d4ead..48be8913897 100644
--- a/src/mame/video/vball.c
+++ b/src/mame/video/vball.c
@@ -76,7 +76,7 @@ void vb_bgprombank_w( running_machine &machine, int bank )
if (bank==state->m_vb_bgprombank) return;
- color_prom = machine.region("proms")->base() + bank*0x80;
+ color_prom = state->memregion("proms")->base() + bank*0x80;
for (i=0;i<128;i++, color_prom++) {
palette_set_color_rgb(machine,i,pal4bit(color_prom[0] >> 0),pal4bit(color_prom[0] >> 4),
pal4bit(color_prom[0x800] >> 0));
@@ -93,7 +93,7 @@ void vb_spprombank_w( running_machine &machine, int bank )
if (bank==state->m_vb_spprombank) return;
- color_prom = machine.region("proms")->base()+0x400 + bank*0x80;
+ color_prom = state->memregion("proms")->base()+0x400 + bank*0x80;
for (i=128;i<256;i++,color_prom++) {
palette_set_color_rgb(machine,i,pal4bit(color_prom[0] >> 0),pal4bit(color_prom[0] >> 4),
pal4bit(color_prom[0x800] >> 0));
diff --git a/src/mame/video/vertigo.c b/src/mame/video/vertigo.c
index 1dc53986d52..15bb5aba704 100644
--- a/src/mame/video/vertigo.c
+++ b/src/mame/video/vertigo.c
@@ -159,8 +159,8 @@ void vertigo_vproc_reset(running_machine &machine)
int i;
UINT64 *mcode;
- state->m_vectorrom = (UINT16 *)machine.region("user1")->base();
- mcode = (UINT64 *)machine.region("proms")->base();
+ state->m_vectorrom = (UINT16 *)machine.root_device().memregion("user1")->base();
+ mcode = (UINT64 *)state->memregion("proms")->base();
/* Decode microcode */
for (i = 0; i < MC_LENGTH; i++)
diff --git a/src/mame/video/vicdual.c b/src/mame/video/vicdual.c
index af39a7d50c0..9fc0c497f43 100644
--- a/src/mame/video/vicdual.c
+++ b/src/mame/video/vicdual.c
@@ -82,7 +82,7 @@ SCREEN_UPDATE_RGB32( vicdual_bw )
SCREEN_UPDATE_RGB32( vicdual_color )
{
vicdual_state *state = screen.machine().driver_data<vicdual_state>();
- UINT8 *color_prom = (UINT8 *)screen.machine().region("proms")->base();
+ UINT8 *color_prom = (UINT8 *)state->memregion("proms")->base();
UINT8 x = 0;
UINT8 y = cliprect.min_y;
UINT8 video_data = 0;
diff --git a/src/mame/video/vulgus.c b/src/mame/video/vulgus.c
index 6111002d69b..fd6b42b7e6d 100644
--- a/src/mame/video/vulgus.c
+++ b/src/mame/video/vulgus.c
@@ -18,7 +18,7 @@
PALETTE_INIT( vulgus )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 256);
diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c
index c15ebf0baba..24ed3b3bcf8 100644
--- a/src/mame/video/wecleman.c
+++ b/src/mame/video/wecleman.c
@@ -77,8 +77,8 @@ static void get_sprite_info(running_machine &machine)
{
wecleman_state *state = machine.driver_data<wecleman_state>();
const pen_t *base_pal = machine.pens;
- UINT8 *base_gfx = machine.region("gfx1")->base();
- int gfx_max = machine.region("gfx1")->bytes();
+ UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ int gfx_max = state->memregion("gfx1")->bytes();
UINT16 *source = state->m_spriteram;
diff --git a/src/mame/video/williams.c b/src/mame/video/williams.c
index d819d9bf988..be202a29f77 100644
--- a/src/mame/video/williams.c
+++ b/src/mame/video/williams.c
@@ -142,7 +142,7 @@ VIDEO_START( williams )
VIDEO_START( blaster )
{
williams_state *state = machine.driver_data<williams_state>();
- blitter_init(machine, state->m_blitter_config, machine.region("proms")->base());
+ blitter_init(machine, state->m_blitter_config, state->memregion("proms")->base());
create_palette_lookup(machine);
state_save_register(machine);
}
diff --git a/src/mame/video/wiping.c b/src/mame/video/wiping.c
index f341c25c7bd..6bd338a5ad1 100644
--- a/src/mame/video/wiping.c
+++ b/src/mame/video/wiping.c
@@ -19,7 +19,7 @@
PALETTE_INIT( wiping )
{
- 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];
diff --git a/src/mame/video/wiz.c b/src/mame/video/wiz.c
index 9d33cc33fd4..9a5c8887306 100644
--- a/src/mame/video/wiz.c
+++ b/src/mame/video/wiz.c
@@ -35,7 +35,7 @@ VIDEO_START( wiz )
***************************************************************************/
PALETTE_INIT( wiz )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
diff --git a/src/mame/video/xevious.c b/src/mame/video/xevious.c
index 64557adccd4..efcd443ccee 100644
--- a/src/mame/video/xevious.c
+++ b/src/mame/video/xevious.c
@@ -26,7 +26,7 @@
***************************************************************************/
PALETTE_INIT( xevious )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
#define TOTAL_COLORS(gfxn) (machine.gfx[gfxn]->total_colors * machine.gfx[gfxn]->color_granularity)
@@ -100,7 +100,7 @@ PALETTE_INIT( xevious )
PALETTE_INIT( battles )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
machine.colortable = colortable_alloc(machine, 128+1);
@@ -320,7 +320,7 @@ READ8_HANDLER( xevious_bb_r )
{
xevious_state *state = space->machine().driver_data<xevious_state>();
- UINT8 *rom2a = space->machine().region("gfx4")->base();
+ UINT8 *rom2a = state->memregion("gfx4")->base();
UINT8 *rom2b = rom2a+0x1000;
UINT8 *rom2c = rom2a+0x3000;
int adr_2b,adr_2c;
diff --git a/src/mame/video/xorworld.c b/src/mame/video/xorworld.c
index 329b6e6da69..22c1db3905e 100644
--- a/src/mame/video/xorworld.c
+++ b/src/mame/video/xorworld.c
@@ -18,7 +18,7 @@
PALETTE_INIT( xorworld )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++){
diff --git a/src/mame/video/xyonix.c b/src/mame/video/xyonix.c
index 3feca59da96..46f0e97ad35 100644
--- a/src/mame/video/xyonix.c
+++ b/src/mame/video/xyonix.c
@@ -3,7 +3,7 @@
PALETTE_INIT( xyonix )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
diff --git a/src/mame/video/yiear.c b/src/mame/video/yiear.c
index 438fe3b915f..96a9e3e10bc 100644
--- a/src/mame/video/yiear.c
+++ b/src/mame/video/yiear.c
@@ -30,7 +30,7 @@
PALETTE_INIT( yiear )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0; i < machine.total_colors(); i++)
diff --git a/src/mame/video/zaccaria.c b/src/mame/video/zaccaria.c
index 2f96212e161..1dfe241263c 100644
--- a/src/mame/video/zaccaria.c
+++ b/src/mame/video/zaccaria.c
@@ -35,7 +35,7 @@ Here's the hookup from the proms (82s131) to the r-g-b-outputs
***************************************************************************/
PALETTE_INIT( zaccaria )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i, j, k;
static const int resistances_rg[] = { 1200, 1000, 820 };
static const int resistances_b[] = { 1000, 820 };
diff --git a/src/mame/video/zaxxon.c b/src/mame/video/zaxxon.c
index 4bcb164d77e..4ce4b232a88 100644
--- a/src/mame/video/zaxxon.c
+++ b/src/mame/video/zaxxon.c
@@ -17,7 +17,7 @@
PALETTE_INIT( zaxxon )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
zaxxon_state *state = machine.driver_data<zaxxon_state>();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -69,8 +69,8 @@ PALETTE_INIT( zaxxon )
static TILE_GET_INFO( get_bg_tile_info )
{
- const UINT8 *source = machine.region("tilemap_dat")->base();
- int size = machine.region("tilemap_dat")->bytes() / 2;
+ const UINT8 *source = machine.root_device().memregion("tilemap_dat")->base();
+ int size = machine.root_device().memregion("tilemap_dat")->bytes() / 2;
int eff_index = tile_index & (size - 1);
int code = source[eff_index] + 256 * (source[eff_index + size] & 3);
int color = source[eff_index + size] >> 4;
diff --git a/src/mame/video/zodiack.c b/src/mame/video/zodiack.c
index 82e9557b519..cb462d67535 100644
--- a/src/mame/video/zodiack.c
+++ b/src/mame/video/zodiack.c
@@ -48,7 +48,7 @@ WRITE8_MEMBER( zodiack_state::flipscreen_w )
PALETTE_INIT( zodiack )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
/* allocate the colortable */